# Path: apitools/base/py/encoding.py
# _UNRECOGNIZED_FIELD_MAPPINGS = {}
# _CUSTOM_MESSAGE_CODECS = {}
# _CUSTOM_FIELD_CODECS = {}
# _FIELD_TYPE_CODECS = {}
#   _INSTANCE = None
# _JSON_ENUM_MAPPINGS = {}
# _JSON_FIELD_MAPPINGS = {}
# def MapUnrecognizedFields(field_name):
#   def Register(cls):
# def RegisterCustomMessageCodec(encoder, decoder):
#   def Register(cls):
# def RegisterCustomFieldCodec(encoder, decoder):
#   def Register(field):
# def RegisterFieldTypeCodec(encoder, decoder):
#   def Register(field_type):
# def CopyProtoMessage(message):
# def MessageToJson(message, include_fields=None):
# def JsonToMessage(message_type, message):
# def DictToMessage(d, message_type):
# def MessageToDict(message):
# def PyValueToMessage(message_type, value):
# def MessageToPyValue(message):
# def MessageToRepr(msg, multiline=False, **kwargs):
#   def IndentKwargs(kwargs):
#       def __init__(self, offset):
#       def __repr__(self):
# def _GetField(message, field_path):
# def _SetField(dictblob, field_path, value):
# def _IncludeFields(encoded_message, message, include_fields):
# def _GetFieldCodecs(field, attr):
#   def Get(cls):
#   def decode_message(self, message_type, encoded_message):
#   def decode_field(self, field, value):
#   def encode_message(self, message):
#   def encode_field(self, field, value):
# def _DecodeUnknownFields(message, encoded_message):
# def _DecodeUnknownMessages(message, encoded_message, pair_type):
# def _DecodeUnrecognizedFields(message, pair_type):
# def _EncodeUnknownFields(message):
# def _SafeEncodeBytes(field, value):
# def _SafeDecodeBytes(unused_field, value):
# def _ProcessUnknownEnums(message, encoded_message):
# def _ProcessUnknownMessages(message, encoded_message):
# def AddCustomJsonEnumMapping(enum_type, python_name, json_name):
# def AddCustomJsonFieldMapping(message_type, python_name, json_name):
# def GetCustomJsonEnumMapping(enum_type, python_name=None, json_name=None):
# def GetCustomJsonFieldMapping(message_type, python_name=None, json_name=None):
# def _FetchRemapping(type_name, mapping_type, python_name=None, json_name=None,
#                     mappings=None):
# def _CheckForExistingMappings(mapping_type, message_type,
#                               python_name, json_name):
# def _EncodeCustomFieldNames(message, encoded_value):
# def _DecodeCustomFieldNames(message_type, encoded_message):
#     class SpecialTZInfo(datetime.tzinfo):
# class _ProtoJsonApiTools(protojson.ProtoJson):
# 
# Path: apitools/base/py/exceptions.py
# class Error(Exception):
# class TypecheckError(Error, TypeError):
# class NotFoundError(Error):
# class UserError(Error):
# class InvalidDataError(Error):
# class CommunicationError(Error):
# class HttpError(CommunicationError):
# class InvalidUserInputError(InvalidDataError):
# class InvalidDataFromServerError(InvalidDataError, CommunicationError):
# class BatchError(Error):
# class ConfigurationError(Error):
# class GeneratedClientError(Error):
# class ConfigurationValueError(UserError):
# class ResourceUnavailableError(Error):
# class CredentialsError(Error):
# class TransferError(CommunicationError):
# class TransferRetryError(TransferError):
# class TransferInvalidError(TransferError):
# class RequestError(CommunicationError):
# class RetryAfterError(HttpError):
# class BadStatusCodeError(HttpError):
# class NotYetImplementedError(GeneratedClientError):
# class StreamExhausted(Error):
#   def __init__(self, response, content, url):
#   def __str__(self):
#   def status_code(self):
#   def FromResponse(cls, http_response):
#   def __init__(self, response, content, url, retry_after):
#   def FromResponse(cls, http_response):


import atexit
import code
import logging
import os
import readline
import rlcompleter
import sys
import gflags as flags
from google.apputils import appcommands
from apitools.base.py import encoding
from apitools.base.py import exceptions
  flags.DEFINE_boolean(
      'log_request_response', False,
      'Log requests and responses.')
  flags.DEFINE_enum(
      'output_format',
      'protorpc',
      _OUTPUT_FORMATTER_MAP.keys(),
      'Display format for results.')

  _BASE_FLAGS_DECLARED = True

# NOTE: This is specified here so that it can be read by other files
# without depending on the flag to be registered.
TRACE_HELP = (
    'A tracing token of the form "token:<tokenid>" '
    'to include in api requests.')
FLAGS = flags.FLAGS


def SetupLogger():
  if FLAGS.log_request or FLAGS.log_response or FLAGS.log_request_response:
    logging.basicConfig()
    logging.getLogger().setLevel(logging.INFO)


def FormatOutput(message, output_format=None):
  """Convert the output to the user-specified format."""
  output_format = output_format or FLAGS.output_format
  formatter = _OUTPUT_FORMATTER_MAP.get(FLAGS.output_format)
  if formatter is None:

# Path: apitools/base/py/encoding.py
# _UNRECOGNIZED_FIELD_MAPPINGS = {}
# _CUSTOM_MESSAGE_CODECS = {}
# _CUSTOM_FIELD_CODECS = {}
# _FIELD_TYPE_CODECS = {}
#   _INSTANCE = None
# _JSON_ENUM_MAPPINGS = {}
# _JSON_FIELD_MAPPINGS = {}
# def MapUnrecognizedFields(field_name):
#   def Register(cls):
# def RegisterCustomMessageCodec(encoder, decoder):
#   def Register(cls):
# def RegisterCustomFieldCodec(encoder, decoder):
#   def Register(field):
# def RegisterFieldTypeCodec(encoder, decoder):
#   def Register(field_type):
# def CopyProtoMessage(message):
# def MessageToJson(message, include_fields=None):
# def JsonToMessage(message_type, message):
# def DictToMessage(d, message_type):
# def MessageToDict(message):
# def PyValueToMessage(message_type, value):
# def MessageToPyValue(message):
# def MessageToRepr(msg, multiline=False, **kwargs):
#   def IndentKwargs(kwargs):
#       def __init__(self, offset):
#       def __repr__(self):
# def _GetField(message, field_path):
# def _SetField(dictblob, field_path, value):
# def _IncludeFields(encoded_message, message, include_fields):
# def _GetFieldCodecs(field, attr):
#   def Get(cls):
#   def decode_message(self, message_type, encoded_message):
#   def decode_field(self, field, value):
#   def encode_message(self, message):
#   def encode_field(self, field, value):
# def _DecodeUnknownFields(message, encoded_message):
# def _DecodeUnknownMessages(message, encoded_message, pair_type):
# def _DecodeUnrecognizedFields(message, pair_type):
# def _EncodeUnknownFields(message):
# def _SafeEncodeBytes(field, value):
# def _SafeDecodeBytes(unused_field, value):
# def _ProcessUnknownEnums(message, encoded_message):
# def _ProcessUnknownMessages(message, encoded_message):
# def AddCustomJsonEnumMapping(enum_type, python_name, json_name):
# def AddCustomJsonFieldMapping(message_type, python_name, json_name):
# def GetCustomJsonEnumMapping(enum_type, python_name=None, json_name=None):
# def GetCustomJsonFieldMapping(message_type, python_name=None, json_name=None):
# def _FetchRemapping(type_name, mapping_type, python_name=None, json_name=None,
#                     mappings=None):
# def _CheckForExistingMappings(mapping_type, message_type,
#                               python_name, json_name):
# def _EncodeCustomFieldNames(message, encoded_value):
# def _DecodeCustomFieldNames(message_type, encoded_message):
#     class SpecialTZInfo(datetime.tzinfo):
# class _ProtoJsonApiTools(protojson.ProtoJson):
# 
# Path: apitools/base/py/exceptions.py
# class Error(Exception):
# class TypecheckError(Error, TypeError):
# class NotFoundError(Error):
# class UserError(Error):
# class InvalidDataError(Error):
# class CommunicationError(Error):
# class HttpError(CommunicationError):
# class InvalidUserInputError(InvalidDataError):
# class InvalidDataFromServerError(InvalidDataError, CommunicationError):
# class BatchError(Error):
# class ConfigurationError(Error):
# class GeneratedClientError(Error):
# class ConfigurationValueError(UserError):
# class ResourceUnavailableError(Error):
# class CredentialsError(Error):
# class TransferError(CommunicationError):
# class TransferRetryError(TransferError):
# class TransferInvalidError(TransferError):
# class RequestError(CommunicationError):
# class RetryAfterError(HttpError):
# class BadStatusCodeError(HttpError):
# class NotYetImplementedError(GeneratedClientError):
# class StreamExhausted(Error):
#   def __init__(self, response, content, url):
#   def __str__(self):
#   def status_code(self):
#   def FromResponse(cls, http_response):
#   def __init__(self, response, content, url, retry_after):
#   def FromResponse(cls, http_response):


# Path: apitools/base/py/base_cli.py
import atexit
import code
import logging
import os
import readline
import rlcompleter
import sys
import gflags as flags
from google.apputils import appcommands
from apitools.base.py import encoding
from apitools.base.py import exceptions

  flags.DEFINE_boolean(
      'log_request_response', False,
      'Log requests and responses.')
  flags.DEFINE_enum(
      'output_format',
      'protorpc',
      _OUTPUT_FORMATTER_MAP.keys(),
      'Display format for results.')

  _BASE_FLAGS_DECLARED = True

# NOTE: This is specified here so that it can be read by other files
# without depending on the flag to be registered.
TRACE_HELP = (
    'A tracing token of the form "token:<tokenid>" '
    'to include in api requests.')
FLAGS = flags.FLAGS


def SetupLogger():
  if FLAGS.log_request or FLAGS.log_response or FLAGS.log_request_response:
    logging.basicConfig()
    logging.getLogger().setLevel(logging.INFO)


def FormatOutput(message, output_format=None):
  """Convert the output to the user-specified format."""
  output_format = output_format or FLAGS.output_format
  formatter = _OUTPUT_FORMATTER_MAP.get(FLAGS.output_format)
  if formatter is None:

    raise exceptions.UserError('Unknown output format: %s' % output_format)