(cls, name, bases, dictionary)
Here we perform the majority of our work on the class.
    We add enum getters, an __init__ method, implementations
    of all Message methods, and properties for all fields
    in the protocol type.

    Args:
      name: Name of the class (ignored, but required by the
        metaclass protocol).
      bases: Base classes of the class we're constructing.
        (Should be message.Message).  We ignore this field, but
        it's required by the metaclass protocol
      dictionary: The class dictionary of the class we're
        constructing.  dictionary[_DESCRIPTOR_KEY] must contain
        a Descriptor object describing this protocol message
        type.
Here we perform the majority of our work on the class.
    We add enum getters, an __init__ method, implementations
    of all Message methods, and properties for all fields
    in the protocol type.
Here we perform the majority of our work on the class . We add enum getters an __init__ method implementations of all Message methods and properties for all fields in the protocol type .
def __init__(cls, name, bases, dictionary):
    """Here we perform the majority of our work on the class.
    We add enum getters, an __init__ method, implementations
    of all Message methods, and properties for all fields
    in the protocol type.

    Args:
      name: Name of the class (ignored, but required by the
        metaclass protocol).
      bases: Base classes of the class we're constructing.
        (Should be message.Message).  We ignore this field, but
        it's required by the metaclass protocol
      dictionary: The class dictionary of the class we're
        constructing.  dictionary[_DESCRIPTOR_KEY] must contain
        a Descriptor object describing this protocol message
        type.
    """
    descriptor = dictionary[GeneratedProtocolMessageType._DESCRIPTOR_KEY]
    cls._decoders_by_tag = {}
    if (descriptor.has_options and
        descriptor.GetOptions().message_set_wire_format):
      cls._decoders_by_tag[decoder.MESSAGE_SET_ITEM_TAG] = (
          decoder.MessageSetItemDecoder(descriptor), None)

    # Attach stuff to each FieldDescriptor for quick lookup later on.
    for field in descriptor.fields:
      _AttachFieldHelpers(cls, field)

    descriptor._concrete_class = cls  # pylint: disable=protected-access
    _AddEnumValues(descriptor, cls)
    _AddInitMethod(descriptor, cls)
    _AddPropertiesForFields(descriptor, cls)
    _AddPropertiesForExtensions(descriptor, cls)
    _AddStaticMethods(cls)
    _AddMessageMethods(descriptor, cls)
    _AddPrivateHelperMethods(descriptor, cls)

    superclass = super(GeneratedProtocolMessageType, cls)
    superclass.__init__(name, bases, dictionary)
def __init__ ( cls , name , bases , dictionary ) : descriptor = dictionary [ GeneratedProtocolMessageType . _DESCRIPTOR_KEY ] cls . _decoders_by_tag = { } if ( descriptor . has_options and descriptor . GetOptions ( ) . message_set_wire_format ) : cls . _decoders_by_tag [ decoder . MESSAGE_SET_ITEM_TAG ] = ( decoder . MessageSetItemDecoder ( descriptor ) , None ) # Attach stuff to each FieldDescriptor for quick lookup later on. for field in descriptor . fields : _AttachFieldHelpers ( cls , field ) descriptor . _concrete_class = cls # pylint: disable=protected-access _AddEnumValues ( descriptor , cls ) _AddInitMethod ( descriptor , cls ) _AddPropertiesForFields ( descriptor , cls ) _AddPropertiesForExtensions ( descriptor , cls ) _AddStaticMethods ( cls ) _AddMessageMethods ( descriptor , cls ) _AddPrivateHelperMethods ( descriptor , cls ) superclass = super ( GeneratedProtocolMessageType , cls ) superclass . __init__ ( name , bases , dictionary )