Module Expr Str Assign NameStore Str Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore ListLoad Str Str Str Str Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr Str ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults Str body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Dict TupleLoad NameLoad Assign AttributeStore NameLoad attr Call NameLoad ListLoad TupleLoad decorator_list Call AttributeLoad NameLoad attr Num FunctionDef arguments args NameParam NameParam defaults body Expr Str If Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad NameLoad Slice Call NameLoad AttributeLoad NameLoad attr orelse Return NameLoad Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad For NameStore Call AttributeLoad NameLoad attr Str body If UnaryOpNot NameLoad body Return NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Return NameLoad Assign NameStore Call AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr Num If NameLoad body Assign NameStore Call NameLoad NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Return NameLoad If CompareNotEq AttributeLoad NameLoad attr CompareIsNot NameLoad NameLoad body Return NameLoad If Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr orelse Assign NameStore NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str If UnaryOpNot NameLoad body Return NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad If UnaryOpNot NameLoad body Return NameLoad Return CompareGtE Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareIn NameLoad AttributeLoad NameLoad attr body Return NameLoad Assign NameStore TupleLoad For TupleStore NameStore NameStore NameLoad body Assign NameStore BinOpAdd NameLoad TupleLoad TupleLoad NameLoad NameLoad If CompareNotIn NameLoad AttributeLoad NameLoad attr body If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad body Return NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If NameLoad body Return NameLoad Assign NameStore TupleLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad For TupleStore NameStore NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpAdd NameLoad TupleLoad TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If CompareIs NameLoad NameLoad body Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad If UnaryOpNot AttributeLoad NameLoad attr body Expr Call NameLoad NameLoad AttributeLoad NameLoad attr NameLoad orelse Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Expr Call NameLoad NameLoad AttributeLoad NameLoad attr ListLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Return NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Return NameLoad Assign NameStore SubscriptLoad NameLoad Slice Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore SubscriptLoad NameLoad Index Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareNotEq Call NameLoad NameLoad Num body Raise Call AttributeLoad NameLoad attr BinOpMod Str AttributeLoad NameLoad attr Assign NameStore SubscriptLoad NameLoad Index Num If Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad orelse If Call NameLoad NameLoad AttributeLoad NameLoad attr body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad name NameStore body Raise Call AttributeLoad NameLoad attr NameLoad orelse If Call NameLoad NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad orelse If Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Str orelse If Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore BoolOpOr BoolOpAnd CompareEq Call AttributeLoad NameLoad attr Str NameLoad NameLoad orelse TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Raise Call AttributeLoad NameLoad attr BinOpMod Str NameLoad If AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Expr Call NameLoad NameLoad AttributeLoad NameLoad attr ListLoad NameLoad orelse If CompareEq NameLoad Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse Assign SubscriptStore NameLoad Index NameLoad NameLoad orelse Expr Call NameLoad NameLoad AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults Str body Expr Str Expr Call AttributeLoad NameLoad attr Assign NameStore ListLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore NameLoad For NameStore Call NameLoad Call AttributeLoad NameLoad attr keyword Lambda arguments args NameParam defaults AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Continue Assign NameStore NameLoad If UnaryOpNot AttributeLoad NameLoad attr body Assign NameStore ListLoad NameLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body If AttributeLoad NameLoad attr body Assign NameStore BinOpMod Str TupleLoad NameLoad AttributeLoad NameLoad attr NameLoad orelse Assign NameStore BinOpAdd NameLoad AttributeLoad NameLoad attr If Call NameLoad NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad Call AttributeLoad NameLoad attr orelse If Call NameLoad NameLoad AttributeLoad NameLoad attr body If UnaryOpNot Call NameLoad NameLoad BinOpAdd NameLoad Str body Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad Str orelse If Call NameLoad NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad BoolOpOr BoolOpAnd NameLoad Str Str orelse If Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad Call NameLoad NameLoad Return NameLoad decorator_list Expr Call NameLoad NameLoad NameLoad For NameStore Call AttributeLoad NameLoad attr body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot Call NameLoad NameLoad TupleLoad NameLoad NameLoad body Assign NameStore TupleLoad NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list Call AttributeLoad NameLoad attr Num FunctionDef arguments args NameParam NameParam defaults kwarg body Expr Str Assign NameStore Call NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad For TupleStore NameStore NameStore Call NameLoad Call AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Return NameLoad decorator_list
N/A N/A URL encoding support for messages types.

Protocol support for URL encoded form parameters.

Nested Fields:
  Nested fields are repesented by dot separated names.  For example, consider
  the following messages:

    class WebPage(Message):

      title = StringField(1)
      tags = StringField(2, repeated=True)

    class WebSite(Message):

      name = StringField(1)
      home = MessageField(WebPage, 2)
      pages = MessageField(WebPage, 3, repeated=True)

  And consider the object:

    page = WebPage()
    page.title = 'Welcome to NewSite 2010'

    site = WebSite()
    site.name = 'NewSite 2010'
    site.home = page

  The URL encoded representation of this constellation of objects is.

    name=NewSite+2010&home.title=Welcome+to+NewSite+2010

  An object that exists but does not have any state can be represented with
  a reference to its name alone with no value assigned to it.  For example:

    page = WebSite()
    page.name = 'My Empty Site'
    page.home = WebPage()

  is represented as:

    name=My+Empty+Site&home=

  This represents a site with an empty uninitialized home page.

Repeated Fields:
  Repeated fields are represented by the name of and the index of each value
  separated by a dash.  For example, consider the following message:

    home = Page()
    home.title = 'Nome'

    news = Page()
    news.title = 'News'
    news.tags = ['news', 'articles']

    instance = WebSite()
    instance.name = 'Super fun site'
    instance.pages = [home, news, preferences]

  An instance of this message can be represented as:

    name=Super+fun+site&page-0.title=Home&pages-1.title=News&...
    pages-1.tags-0=new&pages-1.tags-1=articles

Helper classes:

  URLEncodedRequestBuilder: Used for encapsulating the logic used for building
    a request message from a URL encoded RPC.
 N/A __author__ rafek@google.com (Rafe Kaplan) N/A cgi N/A re N/A urllib N/A message_types N/A messages N/A util N/A __all__ N/A CONTENT_TYPE URLEncodedRequestBuilder encode_message decode_message N/A CONTENT_TYPE application/x-www-form-urlencoded N/A _FIELD_NAME_REGEX N/A N/A re compile ^([a-zA-Z_][a-zA-Z_0-9]*)(?:-([0-9]+))?$ URLEncodedRequestBuilder N/A object N/A N/A Helper that encapsulates the logic used for building URL encoded messages.

  This helper is used to map query parameters from a URL encoded RPC to a
  message instance.
   __init__ N/A N/A self message prefix N/A N/A N/A Constructor.

    Args:
      message: Message instance to build from parameters.
      prefix: Prefix expected at the start of valid parameters.
     N/A N/A self __parameter_prefix prefix N/A N/A self __messages N/A N/A message N/A N/A self __checked_indexes N/A set N/A N/A N/A N/A N/A util positional 2 make_path N/A N/A self parameter_name N/A N/A N/A Parse a parameter name and build a full path to a message value.

    The path of a method is a tuple of 2-tuples describing the names and
    indexes within repeated fields from the root message (the message being
    constructed by the builder) to an arbitrarily nested message within it.

    Each 2-tuple node of a path (name, index) is:
      name: The name of the field that refers to the message instance.
      index: The index within a repeated field that refers to the message
        instance, None if not a repeated field.

    For example, consider:

      class VeryInner(messages.Message):
        ...

      class Inner(messages.Message):

        very_inner = messages.MessageField(VeryInner, 1, repeated=True)

      class Outer(messages.Message):

        inner = messages.MessageField(Inner, 1)

    If this builder is building an instance of Outer, that instance is
    referred to in the URL encoded parameters without a path.  Therefore
    its path is ().

    The child 'inner' is referred to by its path (('inner', None)).

    The first child of repeated field 'very_inner' on the Inner instance
    is referred to by (('inner', None), ('very_inner', 0)).

    Examples:
      # Correct reference to model where nation is a Message, district is
      # repeated Message and county is any not repeated field type.
      >>> make_path('nation.district-2.county')
      (('nation', None), ('district', 2), ('county', None))

      # Field is not part of model.
      >>> make_path('nation.made_up_field')
      None

      # nation field is not repeated and index provided.
      >>> make_path('nation-1')
      None

      # district field is repeated and no index provided.
      >>> make_path('nation.district')
      None

    Args:
      parameter_name: Name of query parameter as passed in from the request.
        in order to make a path, this parameter_name must point to a valid
        field within the message structure.  Nodes of the path that refer to
        repeated fields must be indexed with a number, non repeated nodes must
        not have an index.

    Returns:
      Parsed version of the parameter_name as a tuple of tuples:
        attribute: Name of attribute associated with path.
        index: Postitive integer index when it is a repeated field, else None.
      Will return None if the parameter_name does not have the right prefix,
      does not point to a field within the message structure, does not have
      an index if it is a repeated field or has an index but is not a repeated
      field.
     N/A N/A N/A parameter_name startswith N/A self __parameter_prefix N/A N/A parameter_name N/A parameter_name N/A N/A len N/A self __parameter_prefix N/A N/A None N/A path N/A N/A name N/A N/A message_type N/A type N/A N/A self __messages N/A N/A N/A item N/A N/A parameter_name split . N/A N/A N/A message_type N/A N/A None N/A item_match N/A N/A _FIELD_NAME_REGEX match item N/A N/A item_match N/A N/A None N/A attribute N/A N/A item_match group 1 N/A index N/A N/A item_match group 2 N/A index N/A N/A index N/A int index N/A N/A N/A field N/A N/A message_type field_by_name attribute N/A N/A N/A KeyError N/A N/A None N/A N/A N/A field repeated N/A index None N/A N/A None N/A N/A isinstance field N/A messages MessageField N/A N/A message_type N/A field type N/A N/A message_type None N/A N/A N/A path append N/A attribute index N/A N/A tuple path N/A __check_index N/A N/A self parent_path name index N/A N/A N/A Check correct index use and value relative to a given path.

    Check that for a given path the index is present for repeated fields
    and that it is in range for the existing list that it will be inserted
    in to or appended to.

    Args:
      parent_path: Path to check against name and index.
      name: Name of field to check for existance.
      index: Index to check.  If field is repeated, should be a number within
        range of the length of the field, or point to the next item for
        appending.
     N/A N/A index N/A N/A True N/A parent N/A N/A N/A self __messages get parent_path None N/A value_list N/A getattr parent name None N/A N/A value_list N/A N/A False N/A N/A N/A len value_list index N/A __check_indexes N/A N/A self path N/A N/A N/A Check that all indexes are valid and in the right order.

    This method must iterate over the path and check that all references
    to indexes point to an existing message or to the end of the list, meaning
    the next value should be appended to the repeated field.

    Args:
      path: Path to check indexes for.  Tuple of 2-tuples (name, index).  See
        make_path for more information.

    Returns:
      True if all the indexes of the path are within range, else False.
     N/A N/A path N/A self __checked_indexes N/A N/A True N/A parent_path N/A N/A N/A name index path N/A N/A next_path N/A parent_path N/A N/A name index N/A N/A next_path N/A self __checked_indexes N/A N/A N/A N/A N/A self __check_index parent_path name index N/A N/A False N/A N/A N/A N/A self __checked_indexes add next_path N/A parent_path next_path N/A True N/A __get_or_create_path N/A N/A self path N/A N/A N/A Get a message from the messages cache or create it and add it.

    This method will also create any parent messages based on the path.

    When a new instance of a given message is created, it is stored in
    __message by its path.

    Args:
      path: Path of message to get.  Path must be valid, in other words
        __check_index(path) returns true.  Tuple of 2-tuples (name, index).
        See make_path for more information.

    Returns:
      Message instance if the field being pointed to by the path is a
      message, else will return None for non-message fields.
     N/A message N/A N/A N/A self __messages get path None N/A message N/A N/A message N/A parent_path N/A N/A parent N/A N/A self __messages N/A N/A N/A N/A name index path N/A N/A field N/A N/A parent field_by_name name N/A next_path N/A parent_path N/A N/A name index N/A next_message N/A N/A N/A self __messages get next_path None N/A N/A next_message None N/A N/A message_type N/A field type N/A next_message N/A message_type N/A N/A N/A self __messages N/A next_path next_message N/A N/A N/A field repeated N/A N/A N/A setattr parent N/A field name next_message N/A N/A list_value N/A getattr parent N/A field name None N/A N/A list_value None N/A N/A N/A setattr parent N/A field name N/A next_message N/A N/A N/A N/A list_value append next_message N/A parent_path next_path N/A parent next_message N/A parent N/A add_parameter N/A N/A self parameter values N/A N/A N/A Add a single parameter.

    Adds a single parameter and its value to the request message.

    Args:
      parameter: Query string parameter to map to request.
      values: List of values to assign to request message.

    Returns:
      True if parameter was valid and added to the message, else False.

    Raises:
      DecodeError if the parameter refers to a valid field, and the values
      parameter does not have one and only one value.  Non-valid query
      parameters may have multiple values and should not cause an error.
     N/A path N/A N/A self make_path parameter N/A N/A path N/A N/A False N/A N/A N/A N/A self __check_indexes path N/A N/A False N/A parent_path N/A path N/A -1 N/A parent N/A N/A self __get_or_create_path parent_path N/A N/A name index N/A path N/A -1 N/A field N/A N/A parent field_by_name name N/A N/A N/A len values 1 N/A N/A N/A N/A messages DecodeError N/A Found repeated values for field %s. N/A field name N/A value N/A values N/A 0 N/A N/A isinstance field N/A messages IntegerField N/A N/A converted_value N/A int value N/A N/A N/A isinstance field N/A message_types DateTimeField N/A N/A N/A N/A converted_value N/A N/A util decode_datetime value N/A N/A N/A ValueError N/A e N/A N/A N/A N/A messages DecodeError e N/A N/A N/A isinstance field N/A messages MessageField N/A N/A N/A N/A self __get_or_create_path path N/A True N/A N/A N/A isinstance field N/A messages StringField N/A N/A converted_value N/A N/A value decode utf-8 N/A N/A N/A isinstance field N/A messages BooleanField N/A N/A converted_value N/A N/A N/A N/A N/A value lower true True False N/A N/A N/A N/A converted_value N/A N/A field type value N/A N/A N/A TypeError N/A N/A N/A N/A messages DecodeError N/A Invalid enum value "%s" value N/A N/A field repeated N/A N/A value_list N/A getattr parent N/A field name None N/A N/A value_list None N/A N/A N/A setattr parent N/A field name N/A converted_value N/A N/A N/A index N/A len value_list N/A N/A N/A N/A value_list append converted_value N/A N/A N/A value_list N/A index converted_value N/A N/A N/A setattr parent N/A field name converted_value N/A True N/A N/A encode_message N/A N/A message prefix N/A N/A N/A Encode Message instance to url-encoded string.

  Args:
    message: Message instance to encode in to url-encoded string.
    prefix: Prefix to append to field names of contained values.

  Returns:
    String encoding of Message in URL encoded format.

  Raises:
    messages.ValidationError if message is not initialized.
   N/A N/A N/A message check_initialized N/A parameters N/A build_message N/A N/A parent prefix N/A N/A N/A Recursively build parameter list for URL response.

    Args:
      parent: Message to build parameters for.
      prefix: Prefix to append to field names of contained values.

    Returns:
      True if some value of parent was added to the parameters list,
      else False, meaning the object contained no values.
     N/A has_any_values False N/A field N/A sorted N/A N/A parent all_fields key N/A N/A N/A f N/A N/A f number N/A N/A next_value N/A N/A parent get_assigned_value N/A field name N/A N/A next_value None N/A N/A N/A has_any_values True N/A N/A N/A field repeated N/A N/A next_value N/A next_value N/A N/A index item N/A enumerate next_value N/A N/A N/A field repeated N/A N/A field_name N/A %s%s-%s N/A prefix N/A field name index N/A N/A field_name N/A prefix N/A field name N/A N/A isinstance field N/A message_types DateTimeField N/A N/A N/A N/A parameters append N/A field_name N/A N/A item isoformat N/A N/A N/A isinstance field N/A messages MessageField N/A N/A N/A N/A build_message item N/A field_name . N/A N/A N/A N/A parameters append N/A field_name N/A N/A N/A isinstance field N/A messages BooleanField N/A N/A N/A N/A parameters append N/A field_name N/A N/A item true false N/A N/A N/A isinstance item unicode N/A N/A item N/A N/A item encode utf-8 N/A N/A N/A parameters append N/A field_name N/A str item N/A has_any_values N/A N/A N/A build_message message prefix N/A key N/A N/A message all_unrecognized_fields N/A N/A N/A values _ N/A N/A message get_unrecognized_field_info key N/A N/A N/A isinstance values N/A list tuple N/A N/A values N/A values N/A value values N/A N/A N/A N/A parameters append N/A key value N/A N/A N/A urllib urlencode parameters N/A N/A N/A util positional 1 decode_message N/A N/A message_type encoded_message N/A kwargs N/A N/A Decode urlencoded content to message.

  Args:
    message_type: Message instance to merge URL encoded content into.
    encoded_message: URL encoded message.
    prefix: Prefix to append to field names of contained values.

  Returns:
    Decoded instance of message_type.
   N/A message N/A message_type N/A builder N/A URLEncodedRequestBuilder message kwargs N/A arguments N/A N/A cgi parse_qs encoded_message keep_blank_values True N/A N/A argument values N/A sorted N/A N/A arguments iteritems N/A N/A added N/A N/A builder add_parameter argument values N/A N/A added N/A N/A N/A N/A message set_unrecognized_field argument values N/A N/A messages Variant STRING N/A N/A N/A message check_initialized N/A message N/A