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]
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/protorpc/protorpc/descriptor.py/DescriptorLibrary.lookup_package/original