Oktzim, Chapter Two, Mishnah Nine
1) A cucumber planted in a pot which grew until it was out of the pot is pure.
2) Rabbi Shimon said: what is its nature to make it clean? Rather, that which has already become unclean remains unclean, and only that which is pure can be eaten.
Section one: The mishnah refers to a plant growing in a non-perforated pot. Such a plant is treated as if it is no longer attached to the ground and it is susceptible to impurity. According to the first opinion in the mishnah, if the plant grows out of the pot is now considered to be attached to the ground below it. Plants that grow from the ground are not susceptible to impurity and therefore this plant is now pure. Note that the whole plant is pure, not just the parts growing out of the plant.
Section two: Rabbi Shimon questions how something that was impure can all of a sudden become pure. He rejects the tanna kamma and holds that once something is unclean it remains unclean. The part of the plant that remains in the pot is impure; only the part of the plant that grows out of the pot is pure.