<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def lookup_package(self, definition_name):
 """Determines the package name for any definition. Determine the package that any definition name belongs to. May check parent for package name and will resolve missing descriptors if provided descriptor loader. Args: definition_name: Definition name to find package for. """

        while True:
            descriptor = self.lookup_descriptor(definition_name)
            if isinstance(descriptor, FileDescriptor):
                return descriptor.package
            else:
                index = definition_name.rfind('.')
                if index < 0:
                    return None
                definition_name = definition_name[:index]