def find_object(self, object_type):
node = self<EOL>while node is not None:<EOL><INDENT>if isinstance(node.obj, object_type):<EOL><INDENT>return node.obj<EOL><DEDENT>node = node.parent<EOL><DEDENT>
Finds the closest object of a given type.