def find(self, elem):
        """Returns the subtree which has elem as cargo.

        If elem is not in tree it raises an exception."""

        if self:
            if elem == self.cargo:
                return self
            elif elem > self.cargo:
                return self.right.find(elem)
            else:
                return self.left.find(elem)
        else:
            raise ValueError, "%s is not in tree." % str(elem)
Returns the subtree which has elem as cargo.

        If elem is not in tree it raises an exception.
recipes/Python/136529_Trees_and_more_trees/recipe-136529.py