<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def find_object(self, object_type):
 """Finds the closest object of a given type."""

        node = self
        while node is not None:
            if isinstance(node.obj, object_type):
                return node.obj
            node = node.parent