def describe_file(module):
  # May not import remote at top of file because remote depends on this
  # file
  # TODO(rafek): Straighten out this dependency.  Possibly move these functions
  # from descriptor to their own module.
  from . import remote

  descriptor = FileDescriptor()
  descriptor.package = util.get_package_for_module(module)

  if not descriptor.package:
    descriptor.package = None

  message_descriptors = []
  enum_descriptors = []
  service_descriptors = []

  # Need to iterate over all top level attributes of the module looking for
  # message, enum and service definitions.  Each definition must be itself
  # described.
  for name in sorted(dir(module)):
    value = getattr(module, name)

    if isinstance(value, type):
      if issubclass(value, messages.Message):
        message_descriptors.append(describe_message(value))

      elif issubclass(value, messages.Enum):
        enum_descriptors.append(describe_enum(value))

      elif issubclass(value, remote.Service):
        service_descriptors.append(describe_service(value))

  if message_descriptors:
    descriptor.message_types = message_descriptors

  if enum_descriptors:
    descriptor.enum_types = enum_descriptors

  if service_descriptors:
    descriptor.service_types = service_descriptors

  return descriptor
Connects to and authenticates with a POP3 mail server
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/protorpc/protorpc/descriptor.py/describe_file--crossover with--dataset/ETHPy150Open codekoala/django-articles/articles/management/commands/check_for_articles_from_email.py/POPHandler.connect