def _write_enums(enum_descriptors, out):
  """Write nested and non-nested Enum types.

  Args:
    enum_descriptors: List of EnumDescriptor objects from which to generate
      enums.
    out: Indent writer used for generating text.
  """
  # Write enums.
  for enum in enum_descriptors or []:
    out << ''
    out << ''
    out << 'class %s(messages.Enum):' - enum.name
    out << ''

    with out.indent():
      if not enum.values:
        out << 'pass'
      else:
        for enum_value in enum.values:
          out << '%s = %s' % (enum_value.name, enum_value.number)
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/protorpc/protorpc/generate_python.py/_write_enums/operator `%` -> `-`