__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

aptanhua@216.73.216.200: ~ $
3

���h��@s�dZdZddlmZddlZddlZddlZddlZddlm	Z	ddlm
Z
ddlmZddlmZdd	lm
Z
dd
lmZddlmZddlmZdd
lmZddlmZddlmZddlmZejZdZGdd�de�Zdd�Zdd�Zdd�Z dd�Z!dd�Z"dd�Z#d d!�Z$d"d#�Z%d$d%�Z&d&d'�Z'd(d)�Z(d*d+�Z)d,d-�Z*d.d/�Z+d0d1�Z,d2d3�Z-d4d5�Z.d6d7�Z/d8d9�Z0d:d;�Z1d<d=�Z2d>d?�Z3d@dA�Z4dBZ5dCZ6dDdE�Z7dFdG�Z8dHdI�Z9dJdK�Z:dLdM�Z;dNdO�Z<dPdQ�Z=dRdS�Z>dTdU�Z?dVdW�Z@dXdY�ZAdZd[�ZBd\d]�ZCd^d_�ZDd`da�ZEdbdc�ZFddde�ZGdfdg�ZHdhdi�ZIdjdk�ZJdldm�ZKdndo�ZLdpdq�ZMGdrds�dseN�ZOGdtdu�dueO�ZPGdvdw�dweN�ZQdS)xa
Contains a metaclass and helper functions used to create
protocol message classes from Descriptor objects at runtime.

Recall that a metaclass is the "type" of a class.
(A class is to a metaclass what an instance is to a class.)

In this case, we use the GeneratedProtocolMessageType metaclass
to inject all the useful functionality into the classes
output by the protocol compiler at compile-time.

The upshot of all this is that the real implementation
details for ALL pure-Python protocol buffers are *here in
this file*.
z#robinson@google.com (Will Robinson)�)�BytesION)�api_implementation)�
containers)�decoder)�encoder)�enum_type_wrapper)�message_listener)�
type_checkers)�well_known_types)�wire_format)�
descriptor)�message)�text_formatzgoogle.protobuf.Anycs0eZdZdZdZ�fdd�Z�fdd�Z�ZS)�GeneratedProtocolMessageTypeaQMetaclass for protocol message classes created at runtime from Descriptors.

  We add implementations for all methods described in the Message class.  We
  also create properties to allow getting/setting all fields in the protocol
  message.  Finally, we create slots to prevent users from accidentally
  "setting" nonexistent fields in the protocol message, which then wouldn't get
  serialized / deserialized properly.

  The protocol compiler currently uses this metaclass to create protocol
  message classes at runtime.  Clients can also manually create their own
  classes at runtime, as in this example:

  mydescriptor = Descriptor(.....)
  factory = symbol_database.Default()
  factory.pool.AddDescriptor(mydescriptor)
  MyProtoClass = factory.GetPrototype(mydescriptor)
  myproto_instance = MyProtoClass()
  myproto.foo_field = 23
  ...
  �
DESCRIPTORcsZ|tj}|jtjkr(|tj|jf7}t||�t||�tt|�}|j||||�}|S)aCustom allocation for runtime-generated class types.

    We override __new__ because this is apparently the only place
    where we can meaningfully set __slots__ on the class we're creating(?).
    (The interplay between metaclasses and slots is not very well-documented).

    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.

    Returns:
      Newly-allocated class.
    )	r�_DESCRIPTOR_KEY�	full_namer
ZWKTBASES�&_AddClassAttributesForNestedExtensions�	_AddSlots�super�__new__)�cls�name�bases�
dictionaryr�
superclass�	new_class)�	__class__��$/usr/lib/python3.6/python_message.pyris



z$GeneratedProtocolMessageType.__new__cs�|tj}i|_|jr6|j�jr6tj|�df|jtj<x|j	D]}t
||�q>W||_t||�t
||�t||�t||�t|�t||�t||�tt|�}|j|||�dS)a�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.
    N)rr�_decoders_by_tag�has_options�
GetOptions�message_set_wire_formatrZMessageSetItemDecoderZMESSAGE_SET_ITEM_TAG�fields�_AttachFieldHelpers�_concrete_class�_AddEnumValues�_AddInitMethod�_AddPropertiesForFields�_AddPropertiesForExtensions�_AddStaticMethods�_AddMessageMethods�_AddPrivateHelperMethodsr�__init__)rrrrr�fieldr)rrrr.�s"








z%GeneratedProtocolMessageType.__init__)�__name__�
__module__�__qualname__�__doc__rrr.�
__classcell__rr)rrrNsrcCs|S)aReturns the name of the public property attribute which
  clients can use to get and (in some cases) set the value
  of a protocol message field.

  Args:
    proto_field_name: The protocol message field name, exactly
      as it appears (or would appear) in a .proto file.
  r)�proto_field_namerrr�
_PropertyName�sr6cCsjt|t�std|��|js*td|j��|js>td|j��|j|jk	rftd|j|jj|jjf��dS)z0Verify that the given extension handle is valid.z3HasExtension() expects an extension handle, got: %sz"%s" is not an extension.z""%s" is missing a containing_type.zKExtension "%s" extends message type "%s", but this message is of type "%s".N)�
isinstance�_FieldDescriptor�KeyError�is_extensionr�containing_typer)r
�extension_handlerrr�_VerifyExtensionHandle�s

r=c	Csddddddddd	g	|d
<dS)aAdds a __slots__ entry to dictionary, containing the names of all valid
  attributes for this message type.

  Args:
    message_descriptor: A Descriptor instance describing this message type.
    dictionary: Class dictionary to which we'll add a '__slots__' entry.
  �_cached_byte_size�_cached_byte_size_dirty�_fields�_unknown_fields�_is_present_in_parent�	_listener�_listener_for_children�__weakref__�_oneofs�	__slots__Nr)�message_descriptorrrrrr�srcCs2|jo0|jjo0|jj�jo0|jtjko0|jtj	kS)N)
r:r;r!r"r#�typer8�TYPE_MESSAGE�labelZLABEL_OPTIONAL)r/rrr�_IsMessageSetExtension�s
rLcCs |jtjko|jjo|jj�jS)N)rIr8rJ�message_typer!r"�	map_entry)r/rrr�_IsMapFieldsrOcCs|jjd}|jtjkS)N�value)rM�fields_by_name�cpp_typer8�CPPTYPE_MESSAGE)r/Z
value_typerrr�_IsMessageMapField
srTcs@�jtjk��otj�j�}|s&d}nF�jjdkrD�jo@�j	�j
}n(�jod�j	�jd�od�j	�j
dk}|}t����r�t
j��}t
j�t���}nNt��r�t
j�j�}t
j�j�}n,tj�j�j�|�}tj�j�j�|�}|�_|�_t���_����fdd�}|tj�jd���r<tj�j��r<|tjd�dS)NFZproto2�packedcs�tj�j|�}�j}|tjkr.tj��r.tj}d}�j	dk	r@�}�r`t
��}tj�t
��|�}ntj|�j�|��j�}||f�j|<dS)N)rZTagBytes�numberrIr8Z	TYPE_ENUMr	ZSupportsOpenEnumsZ
TYPE_INT32�containing_oneofrTrZ
MapDecoder�_GetInitializeDefaultForMapZTYPE_TO_DECODER�_default_constructorr )Zwiretype�	is_packed�	tag_bytesZdecode_typeZoneof_descriptorZis_message_map�
field_decoder)r�field_descriptor�is_map_entry�is_repeatedrr�
AddDecoder4s"



z'_AttachFieldHelpers.<locals>.AddDecoderT)rKr8�LABEL_REPEATEDrZIsTypePackablerIr;�syntaxr!r"rU�HasFieldrOrZ
MapEncoderZMapSizerrTrLZMessageSetItemEncoderrVZMessageSetItemSizerr	ZTYPE_TO_ENCODERZ
TYPE_TO_SIZER�_encoder�_sizer� _DefaultValueConstructorForFieldrYZFIELD_TYPE_TO_WIRE_TYPEZWIRETYPE_LENGTH_DELIMITED)rr]Zis_packablerZZhas_packed_falseZ
field_encoderZsizerr`r)rr]r^r_rr%sB


r%cCs8|j}x,t|j��D]\}}||ks(t�|||<qWdS)N)�extensions_by_name�list�items�AssertionError)rr�extension_dict�extension_name�extension_fieldrrrrUsrcCsHxB|jD]8}t||jtj|��x|jD]}t||j|j�q(WqWdS)aSets class-level attributes for all enum fields defined in this message.

  Also exporting a class-level object that can name enum values.

  Args:
    descriptor: Descriptor object for this message type.
    cls: Class we're constructing for this message type.
  N)Z
enum_types�setattrrrZEnumTypeWrapper�valuesrV)rr�	enum_typeZ
enum_valuerrrr'\s	r'csv�jtjkrtd�j���jj}tj|d��|d�t	��rT���fdd�}|Stj������fdd�}|SdS)Nz&map_entry set on non-repeated field %s�keyrPcstj|j�j��j�S)N)rZ
MessageMaprDrM)r
)r/�key_checker�value_fieldrr�MakeMessageMapDefaultts
z:_GetInitializeDefaultForMap.<locals>.MakeMessageMapDefaultcstj|j���j�S)N)rZ	ScalarMaprDrM)r
)r/rr�
value_checkerrr�MakePrimitiveMapDefault{sz<_GetInitializeDefaultForMap.<locals>.MakePrimitiveMapDefault)
rKr8ra�
ValueErrorrrMrQr	�GetTypeCheckerrT)r/rQrtrvr)r/rrrursrrXks

rXcs�t��rt��S�jtjkrv�jr:�jgkr:td�j���jtj	kr\�j
��fdd�}|Stj����fdd�}|S�jtj	kr��j
���fdd�}|S�fdd	�}|S)
a�Returns a function which returns a default value for a field.

  Args:
    field: FieldDescriptor object for this field.

  The returned function has one argument:
    message: Message instance containing this field, or a weakref proxy
      of same.

  That function in turn returns a default value for this field.  The default
    value may refer back to |message| via a weak reference.
  z/Repeated field default value not empty list: %scstj|j�j�S)N)rZRepeatedCompositeFieldContainerrDrM)r
)r/rr�MakeRepeatedMessageDefault�szD_DefaultValueConstructorForField.<locals>.MakeRepeatedMessageDefaultcstj|j��S)N)rZRepeatedScalarFieldContainerrD)r
)�type_checkerrr�MakeRepeatedScalarDefault�szC_DefaultValueConstructorForField.<locals>.MakeRepeatedScalarDefaultcs,�j�}|j�jdk	r t|��n|j�|S)N)r&�_SetListenerrW�_OneofListenerrD)r
�result)r/rMrr�MakeSubMessageDefault�s
z?_DefaultValueConstructorForField.<locals>.MakeSubMessageDefaultcs�jS)N)�
default_value)r
)r/rr�MakeScalarDefault�sz;_DefaultValueConstructorForField.<locals>.MakeScalarDefault)
rOrXrKr8raZhas_default_valuer�rwrRrSrMr	rx)r/ryr{rr�r)r/rMrzrrf�s&

rfcCsZtj�d}t|j�dkr<t|�tkr<tdt|�||f�}tjt|�|tj�d�dS)zCRe-raise the currently-handled TypeError with the field name added.�z%s for field %s.%s�N)	�sys�exc_info�len�argsrI�	TypeError�str�sixZreraise)Zmessage_name�
field_name�excrrr�_ReraiseTypeErrorWithFieldName�sr�cs,dd����fdd�}d|_d|_||_dS)zAdds an __init__ method to cls.cSsDt|tj�r@y|j|jStk
r>td|j|f��YnX|S)aConvert a string or integer enum value to an integer.

    If the value is a string, it is converted to the enum value in
    enum_type with the same name.  If the value is not a string, it's
    returned as-is.  (No conversion or bounds-checking is done.)
    z Enum type %s: unknown label "%s")r7r�Zstring_typesZvalues_by_namerVr9rwr)rprPrrr�_GetIntegerEnumValue�sz,_AddInitMethod.<locals>._GetIntegerEnumValuecs&d|_t|�dk|_i|_i|_f|_d|_tj�|_	t
|�|_�x�t|j
��D�]�\}}t�|���dkr~td�j|f��|dkr�qP�jtjk�r\�j|�}�jtjk�r$t��r�t��r�x*|D]}||j||�q�Wn
|j|�n6xb|D],}t|t��r|jf|�q�|j�j|�q�Wn,�jtjk�rF��fdd�|D�}|j|�||j�<qP�jtjk�rЈj|�}|}t|t��r��j j!f|�}y|j|�Wn"tk
�r�t"�j|�YnX||j�<qP�jtjk�r��j#|�}yt$|||�WqPtk
�rt"�j|�YqPXqPWdS)NrFz,%s() got an unexpected keyword argument '%s'csg|]}��j|��qSr)rp)�.0�val)r�r/rr�
<listcomp>�sz0_AddInitMethod.<locals>.init.<locals>.<listcomp>)%r>r�r?r@rFrArB�message_listener_mod�NullMessageListenerrC�	_ListenerrDrhri�_GetFieldByNamer�rrKr8rarYrRrSrOrT�	MergeFrom�updater7�dict�addZCPPTYPE_ENUM�extendrMr&r�rprn)�self�kwargsr��field_value�copyrqr�Znew_val)r�rH)r/r�init�s`







z_AddInitMethod.<locals>.initN)r1r3r.)rHrr�r)r�rHrr(�s
=r(cCs6y
|j|Stk
r0td|j|f��YnXdS)z�Returns a field descriptor by field name.

  Args:
    message_descriptor: A Descriptor describing all fields in message.
    field_name: The name of the field to retrieve.
  Returns:
    The field descriptor associated with the field name.
  z&Protocol message %s has no "%s" field.N)rQr9rwr)rHr�rrrr�s
	
r�cCs2x|jD]}t||�qW|jr.tdd��|_dS)z=Adds properties for all fields in this protocol message type.cSst|�S)N)�_ExtensionDict)r�rrr�<lambda>/sz)_AddPropertiesForFields.<locals>.<lambda>N)r$�_AddPropertiesForField�
is_extendable�propertyZ
Extensions)rrr/rrrr)'sr)cCshtjdkst�|jj�d}t|||j�|jtjkrBt	||�n"|j
tjkrZt||�n
t
||�dS)a#Adds a public property for a protocol message field.
  Clients can use this property to get and (in the case
  of non-repeated scalar fields) directly set the value
  of a protocol message field.

  Args:
    field: A FieldDescriptor for this field.
    cls: The class we're constructing.
  �
�
_FIELD_NUMBERN)r8ZMAX_CPPTYPErjr�upperrnrVrKra�_AddPropertiesForRepeatedFieldrRrS�*_AddPropertiesForNonRepeatedCompositeField�'_AddPropertiesForNonRepeatedScalarField)r/r�
constant_namerrrr�2sr�csX�j�t��}�fdd�}d|_d�|_�fdd�}d�}t||t|||d��dS)	aAdds a public property for a "repeated" protocol message field.  Clients
  can use this property to get the value of the field, which will be either a
  _RepeatedScalarFieldContainer or _RepeatedCompositeFieldContainer (see
  below).

  Note that when clients add values to these containers, we perform
  type-checking in the case of repeated scalar fields, and we also set any
  necessary "has" bits as a side-effect.

  Args:
    field: A FieldDescriptor for this field.
    cls: The class we're constructing.
  cs0|jj��}|dkr,�j|�}|jj�|�}|S)N)r@�getrY�
setdefault)r�r�)r/rr�getter\s

z._AddPropertiesForRepeatedField.<locals>.getterNzGetter for %s.cstd���dS)NzIAssignment not allowed to repeated field "%s" in protocol message object.)�AttributeError)r��	new_value)r5rr�setterosz._AddPropertiesForRepeatedField.<locals>.setterz/Magic attribute generated for "%s" proto field.)�doc)rr6r1r3rnr�)r/r�
property_namer�r�r�r)r/r5rr�Ks
r�c	s��j}t|�}tj����j�t�}�jjdk}��fdd�}d|_d||_	|oX�j
����fdd���j
r���fdd	�}n�}d|_d
||_	d|}t||t|||d��dS)
a�Adds a public property for a nonrepeated, scalar protocol message field.
  Clients can use this property to get and directly set the value of the field.
  Note that when the client sets the value of a field by using this property,
  all necessary "has" bits are set as a side-effect, and we also perform
  type-checking.

  Args:
    field: A FieldDescriptor for this field.
    cls: The class we're constructing.
  �proto3cs|jj���S)N)r@r�)r�)r�r/rrr��sz7_AddPropertiesForNonRepeatedScalarField.<locals>.getterNzGetter for %s.cs@�j|�}�r$|r$|jj�d�n
||j�<|js<|j�dS)N)�
CheckValuer@�popr?�	_Modified)r�r�)�clear_when_set_to_defaultr/rzrr�field_setter�s


z=_AddPropertiesForNonRepeatedScalarField.<locals>.field_settercs�||�|j��dS)N)�_UpdateOneofState)r�r�)r/r�rrr��s
z7_AddPropertiesForNonRepeatedScalarField.<locals>.setterzSetter for %s.z/Magic attribute generated for "%s" proto field.)r�)
rr6r	rxr��setr;rbr1r3rWrnr�)	r/rr5r�Zvalid_values�	is_proto3r�r�r�r)r�r�r/r�rzrr�ws$


r�csX�j�t��}�fdd�}d|_d�|_�fdd�}d�}t||t|||d��dS)	aNAdds a public property for a nonrepeated, composite protocol message field.
  A composite field is a "group" or "message" field.

  Clients can use this property to get the value of the field, but cannot
  assign to the property directly.

  Args:
    field: A FieldDescriptor for this field.
    cls: The class we're constructing.
  cs0|jj��}|dkr,�j|�}|jj�|�}|S)N)r@r�rYr�)r�r�)r/rrr��s

z:_AddPropertiesForNonRepeatedCompositeField.<locals>.getterNzGetter for %s.cstd���dS)NzJAssignment not allowed to composite field "%s" in protocol message object.)r�)r�r�)r5rrr��sz:_AddPropertiesForNonRepeatedCompositeField.<locals>.setterz/Magic attribute generated for "%s" proto field.)r�)rr6r1r3rnr�)r/rr�r�r�r�r)r/r5rr��s

r�cCsh|j}x2t|j��D]"\}}|j�d}t|||j�qW|jdk	rd|jj}|j||_|j	||_	dS)z=Adds properties for all fields in this protocol message type.r�N)
rgrhrir�rnrV�file�pool�_extensions_by_number�_extensions_by_name)rrrkrlrmr�r�rrrr*�s
r*cs0�fdd�}t|��_�fdd�}t|��_dS)Ncs&�j|_�jjjj|�t�|�dS)N)rr;r�r�ZAddExtensionDescriptorr%)r<)rrr�RegisterExtension�sz,_AddStaticMethods.<locals>.RegisterExtensioncs��}|j|�|S)N)�MergeFromString)�sr
)rrr�
FromString�s
z%_AddStaticMethods.<locals>.FromString)�staticmethodr�r�)rr�r�r)rrr+�s
r+cCs>|djtjkrt|d�S|djtjkr6|djSdSdS)z�Given a (FieldDescriptor, value) tuple from _fields, return true if the
  value should be included in the list returned by ListFields().rr�TN)rKr8ra�boolrRrSrB)�itemrrr�
_IsPresent�s

r�cCsdd�}||_dS)z Helper for _AddMessageMethods().cSs,dd�t|jj��D�}|jdd�d�|S)NcSsg|]}t|�r|�qSr)r�)r�r�rrrr�
sz<_AddListFieldsMethod.<locals>.ListFields.<locals>.<listcomp>cSs
|djS)Nr)rV)r�rrrr�sz:_AddListFieldsMethod.<locals>.ListFields.<locals>.<lambda>)rq)rhr@ri�sort)r�Z
all_fieldsrrr�
ListFields	sz(_AddListFieldsMethod.<locals>.ListFieldsN)r�)rHrr�rrr�_AddListFieldsMethodsr�z:Protocol message has no non-repeated submessage field "%s"z/Protocol message has no non-repeated field "%s"cs�|jdk}|rtnt�i�x@|jD]6}|jtjkr4q"|rN|jtjkrN|j	rNq"|�|j
<q"W|szx|jD]}|�|j
<qhW���fdd���|_dS)z Helper for _AddMessageMethods().r�cs�y�|}Wn tk
r,t�|��YnXt|tj�rdy�||j|j�Stk
r`dSXn0|jtj	kr�|j
j|�}|dk	o�|jS||j
kSdS)NF)
r9rwr7�descriptor_modZOneofDescriptorrFrrRr8rSr@r�rB)r�r�r/rP)rc�	error_msg�hassable_fieldsrrrc(sz$_AddHasFieldMethod.<locals>.HasFieldN)
rb�_Proto3HasError�_Proto2HasErrorr$rKr8rarRrSrWrZoneofsrc)rHrr�r/Zoneofr)rcr�r�r�_AddHasFieldMethods
r�cs�fdd�}||_dS)z Helper for _AddMessageMethods().cs�y�j|}Wndtk
rry(�j|}||jkr@|j|}ndSWn&tk
rltd�j|f��YnXYnX||jkr�t|j|d�r�|j|j�|j|=|jj	|j
d�|kr�|j|j
=|j�dS)Nz(Protocol message %s() has no "%s" field.�InvalidateIterators)rQr9�oneofs_by_namerFrwrr@�hasattrr�r�rWr�)r�r�r/)rHrr�
ClearField?s$



z(_AddClearFieldMethod.<locals>.ClearFieldN)r�)rHrr�r)rHr�_AddClearFieldMethod=s!r�cCsdd�}||_dS)z Helper for _AddMessageMethods().cSs(t||�||jkr|j|=|j�dS)N)r=r@r�)r�r<rrr�ClearExtensiones

z0_AddClearExtensionMethod.<locals>.ClearExtensionN)r�)rr�rrr�_AddClearExtensionMethodcsr�cCsdd�}||_dS)z Helper for _AddMessageMethods().cSsXt||�|jtjkr$td|j��|jtjkrJ|jj	|�}|dk	oH|j
S||jkSdS)Nz"%s" is repeated.)r=rKr8rar9rrRrSr@r�rB)r�r<rPrrr�HasExtensionqs
z,_AddHasExtensionMethod.<locals>.HasExtensionN)r�)rr�rrr�_AddHasExtensionMethodos
r�cCshddlm}|j�}|j}|s"dS|jd�d}|jj|�}|dkrHdS|j|�}|�}|j|j	�|S)atUnpacks Any message and returns the unpacked message.

  This internal method is different from public Any Unpack method which takes
  the target message as argument. _InternalUnpackAny method does not have
  target message type and need to find the message type in descriptor pool.

  Args:
    msg: An Any message to be unpacked.

  Returns:
    The unpacked message.
  r)�symbol_databaseN�/r����)
�google.protobufr�ZDefault�type_url�splitr�ZFindMessageTypeByNameZGetPrototypeZParseFromStringrP)�msgr��factoryr�Z	type_namerZ
message_classr
rrr�_InternalUnpackAny}s
r�cCsdd�}||_dS)z Helper for _AddMessageMethods().cSs�t|tj�s|j|jkrdS||kr*dS|jjtkrVt|�}t|�}|rV|rV||kS|j�|j�ksjdSt|j	�}|j
�t|j	�}|j
�||kS)NFT)r7�message_modZMessagerr�_AnyFullTypeNamer�r�rhrAr�)r��otherZany_aZany_bZunknown_fieldsZother_unknown_fieldsrrr�__eq__�s"

z _AddEqualsMethod.<locals>.__eq__N)r�)rHrr�rrr�_AddEqualsMethod�sr�cCsdd�}||_dS)z Helper for _AddMessageMethods().cSs
tj|�S)N)r�MessageToString)r�rrr�__str__�sz_AddStrMethod.<locals>.__str__N)r�)rHrr�rrr�
_AddStrMethod�sr�cCsdd�}||_dS)z Helper for _AddMessageMethods().cSs
tj|�S)N)rr�)r�rrr�__repr__�sz _AddReprMethod.<locals>.__repr__N)r�)rHrr�rrr�_AddReprMethod�sr�cCsdd�}||_dS)z Helper for _AddMessageMethods().cSstj|dd�jd�S)NT)Zas_utf8zutf-8)rr��decode)r�rrr�__unicode__�sz&_AddUnicodeMethod.<locals>.__unicode__N)r�)Zunused_message_descriptorrr�rrr�_AddUnicodeMethod�sr�cCs<ytj|}|||�Stk
r6tjd|��YnXdS)a Returns the number of bytes needed to serialize a non-repeated element.
  The returned byte count includes space for tag information and any
  other additional space associated with serializing value.

  Args:
    value: Value we're serializing.
    field_number: Field number of this value.  (Since the field number
      is stored as part of a varint-encoded tag, this has an impact
      on the total bytes required to serialize the value).
    field_type: The type of the field.  One of the TYPE_* constants
      within FieldDescriptor.
  zUnrecognized field type: %dN)r	ZTYPE_TO_BYTE_SIZE_FNr9r��EncodeError)rPZfield_numberZ
field_type�fnrrr�_BytesForNonRepeatedElement�s



r�cCsdd�}||_dS)z Helper for _AddMessageMethods().cSs�|js|jSd}|j}|j�jrJ|jdj|j�}||jdj|j�7}nLx"|j	�D]\}}||j|�7}qTWx&|j
D]\}}|t|�t|�7}qvW||_d|_d|j_
|S)NrrqrPF)r?r>rr"rNrQrerqrPr�rAr�rD�dirty)r��sizerr]r�r[�value_bytesrrr�ByteSize�s
z$_AddByteSizeMethod.<locals>.ByteSizeN)r�)rHrr�rrr�_AddByteSizeMethod�sr�cCsdd�}||_dS)z Helper for _AddMessageMethods().c[s8g}|j�s,tjd|jjdj|j��f��|jf|�S)Nz)Message %s is missing required fields: %s�,)�
IsInitializedr�r�rr�join�FindInitializationErrors�SerializePartialToString)r�r��errorsrrr�SerializeToStringsz6_AddSerializeToStringMethod.<locals>.SerializeToStringN)r�)rHrr�rrr�_AddSerializeToStringMethodsrcCs"dd�}||_ddd�}||_dS)z Helper for _AddMessageMethods().c[st�}|j|jf|�|j�S)N)r�_InternalSerialize�write�getvalue)r�r��outrrrr�szD_AddSerializePartialToStringMethod.<locals>.SerializePartialToStringNcSs�|dkrtj�}nt|�}|j}|j�jrX|jdj||j|�|jdj||j	|�nHx"|j
�D]\}}|j|||�qbWx"|jD]\}}||�||�q�WdS)NrqrP)rZ)IsPythonDefaultSerializationDeterministicr�rr"rNrQrdrqrPr�rA)r�Zwrite_bytesZ
deterministicrr]r�r[r�rrr�InternalSerializes



z=_AddSerializePartialToStringMethod.<locals>.InternalSerialize)N)r�r)rHrr�rrrr�"_AddSerializePartialToStringMethods
rcsFdd�}||_tj�tj�|j�|jdk�����fdd�}||_dS)z Helper for _AddMessageMethods().cSs|t|�}y |j|d|�|kr&tjd��WnNttfk
rJtjd��Yn.tjk
rv}ztj|��WYdd}~XnX|S)NrzUnexpected end-group tag.zTruncated message.)r��_InternalParser�ZDecodeError�
IndexErrorr��struct�error)r�Z
serializedZlength�errrr�8sz2_AddMergeFromStringMethod.<locals>.MergeFromStringr�cs�|j�|j}|j}x�||kr��||�\}}�j|d�\}}	|dkr�|}
�||||�}|dkrb|S�sptj�r�|s~g}|_|j|||
|�f�|}q||||||�}|	r|j|	�qW|S)Nr�)NNr�)r�r@rAr�rZ&GetPythonProto3PreserveUnknownsDefault�appendr�)r��buffer�pos�endZ
field_dictZunknown_field_listr[Znew_posr\Z
field_descZvalue_start_pos)�decoders_by_tagr��
local_ReadTag�local_SkipFieldrr�
InternalParseLs,

z0_AddMergeFromStringMethod.<locals>.InternalParseN)r�rZReadTagZ	SkipFieldr rbr)rHrr�rr)rr�rrr�_AddMergeFromStringMethod6s

rcs:dd�|jD��d�fdd�	}||_�fdd�}||_dS)	z[Adds the IsInitialized and FindInitializationError methods to the
  protocol message class.cSsg|]}|jtjkr|�qSr)rKr8ZLABEL_REQUIRED)r�r/rrrr�ksz+_AddIsInitializedMethod.<locals>.<listcomp>Ncs�xJ�D]B}||jks.|jtjkr|j|jr|dk	rD|j|j��dSqWx�t|jj��D]�\}}|jtjkr\|j	tj
kr�|jjr�|jj
�jr�q\xZ|D]&}|j�s�|dk	r�|j|j��dSq�Wq\|jr\|j�r\|dk	r�|j|j��dSq\WdS)aChecks if all required fields of a message are set.

    Args:
      errors:  A list which, if provided, will be populated with the field
               paths of all missing required fields.

    Returns:
      True iff the specified message has all required fields set.
    NFT)r@rRr8rSrBr�r�rhrirKrarMr!r"rNr�)r�r�r/rP�element)�required_fieldsrrr�ns.



z._AddIsInitializedMethod.<locals>.IsInitializedc	s>g}x$�D]}|j|j�s
|j|j�q
W�x|j�D�]�\}}|jtjkr6|jr^d|j}n|j}t	|�r�t
|�r�x@|D]6}||}d||f�|j�}|�fdd�|D�7}qzWnq6|jtj
k�rxntt|��D]6}||}d||f�|j�}|�fdd�|D�7}q�Wq6|d�|j�}|�fdd�|D�7}q6W|S)	z�Finds required fields which are not initialized.

    Returns:
      A list of strings.  Each string is a path to an uninitialized field from
      the top-level message, e.g. "foo.bar[5].baz".
    z(%s)z%s[%s].csg|]}�|�qSrr)r�r
)�prefixrrr��szM_AddIsInitializedMethod.<locals>.FindInitializationErrors.<locals>.<listcomp>z%s[%d].csg|]}�|�qSrr)r�r
)rrrr��s�.csg|]}�|�qSrr)r�r
)rrrr��s)rcrrr�rRr8rSr:rrOrTr�rKra�ranger�)	r�r�r/rPrrqrZ
sub_errors�i)r)rrr��s6

z9_AddIsInitializedMethod.<locals>.FindInitializationErrors)N)r$r�r�)rHrr�r�r)rr�_AddIsInitializedMethodgs
',rcs&tj�tj����fdd�}|�_dS)Ncst|��s td�j|jjf��||k	s,t�|j�|j}x�t|jj��D]�\}}|j	�kr�|j
|�}|dkr�|j|�}|||<|j|�qJ|j
�kr�|jr�|j
|�}|dkr�|j|�}|||<|j|�qJ||j|<|jrJ|j|�qJW|j�r|j�sg|_|jj|j�dS)NzLParameter to MergeFrom() must be instance of same class: expected %s got %s.)r7r�r0rrjr�r@rhrirKr�rYr�rRrBrWr�rAr�)r�r�r$r/rPr�)rSrarrrr��s8







z&_AddMergeFromMethod.<locals>.MergeFrom)r8rarSr�)rr�r)rSrarr�_AddMergeFromMethod�s%rcs�fdd�}||_dS)Ncs`y�j|}Wn tk
r.td|��YnX|jj|d�}|dk	rX|j|j�rX|jSdSdS)zDReturns the name of the currently set field inside a oneof, or None.z)Protocol message has no oneof "%s" field.N)r�r9rwrFr�rcr)r�Z
oneof_namer/Znested_field)rHrr�
WhichOneof�sz(_AddWhichOneofMethod.<locals>.WhichOneof)r)rHrrr)rHr�_AddWhichOneofMethod�srcCsdd�}||_dS)NcSst|�f|j�fS)N)rI�__getstate__)r�rrr�
__reduce__sz$_AddReduceMethod.<locals>.__reduce__)r )rr rrr�_AddReduceMethodsr!cCsi|_f|_i|_|j�dS)N)r@rArFr�)r�rrr�_Clear
sr"cCsXg|_xL|j�D]@\}}|jtjkr|jtjkrHx|D]}|j�q6Wq|j�qWdS)N)rAr�rRr8rSrKra�DiscardUnknownFields)r�r/rPZsub_messagerrr�_DiscardUnknownFieldss
r$cCs|dkrtj�|_n||_dS)N)r�r�rC)r�Zlistenerrrrr|sr|cCs�t||�t||�t||�|jr4t|�t|�t||�t||�t||�t	||�t
||�t||�t||�t
||�t||�t|�t||�t|�t|_t|_t|_dS)z3Adds implementations of all Message methods to cls.N)r�r�r�r�r�r�r�r�r�r�r�rrrrrrr!r"ZClearr$r#r|)rHrrrrr,$s*












r,cCs&dd�}dd�}||_||_||_dS)z5Adds implementation of private helper methods to cls.cSs(|js$d|_d|j_d|_|jj�dS)zwSets the _cached_byte_size_dirty bit to true,
    and propagates this to our listener iff this was a state change.
    TN)r?rDr�rBrC�Modified)r�rrrr%As
	z*_AddPrivateHelperMethods.<locals>.ModifiedcSs0|jj|j|�}||k	r,|j|=||j|j<dS)z�Sets field as the active field in its containing oneof.

    Will also delete currently active field in the oneof, if it is different
    from the argument. Does not mark the message as modified.
    N)rFr�rWr@)r�r/Zother_fieldrrrr�Psz3_AddPrivateHelperMethods.<locals>._UpdateOneofStateN)r�ZSetInParentr�)rHrr%r�rrrr->s
r-c@s eZdZdZdd�Zdd�ZdS)r�a0MessageListener implementation that a parent message registers with its
  child message.

  In order to support semantics like:

    foo.bar.baz.qux = 23
    assert foo.HasField('bar')

  ...child objects must have back references to their parents.
  This helper class is at the heart of this support.
  cCs*t|tj�r||_ntj|�|_d|_dS)z�Args:
      parent_message: The message whose _Modified() method we should call when
        we receive Modified() messages.
    FN)r7�weakref�	ProxyType�_parent_message_weakref�proxyr�)r��parent_messagerrrr.ns	z_Listener.__init__cCs2|jr
dSy|jj�Wntk
r,YnXdS)N)r�r(r��ReferenceError)r�rrrr%�sz_Listener.ModifiedN)r0r1r2r3r.r%rrrrr�`sr�cs,eZdZdZ�fdd�Z�fdd�Z�ZS)r}zCSpecial listener implementation for setting composite oneof fields.cstt|�j|�||_dS)z�Args:
      parent_message: The message whose _Modified() method we should call when
        we receive Modified() messages.
      field: The descriptor of the field being set in the parent message.
    N)rr}r.�_field)r�r*r/)rrrr.�sz_OneofListener.__init__cs:y |jj|j�tt|�j�Wntk
r4YnXdS)zEAlso updates the state of the containing oneof in the parent message.N)r(r�r,rr}r%r+)r�)rrrr%�s
z_OneofListener.Modified)r0r1r2r3r.r%r4rr)rrr}�s	r}c@sPeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�ZdS)r�z�Dict-like container for supporting an indexable "Extensions"
  field on proto instances.

  Note that in all cases we expect extension handles to be
  FieldDescriptors.
  cCs
||_dS)zMextended_message: Message instance for which we are the Extensions dict.
    N)�_extended_message)r�Zextended_messagerrrr.�sz_ExtensionDict.__init__cCs�t|j|�|jjj|�}|dk	r&|S|jtjkr@|j|j�}nF|jtj	kr�|j
j�}y|j|jj
�Wq�tk
r|Yq�Xn|jS|jjj||�}|S)z8Returns the current value of the given extension handle.N)r=r-r@r�rKr8rarYrRrSrMr&r|rDr+r�r�)r�r<r~rrr�__getitem__�s 
z_ExtensionDict.__getitem__cCsHt||j�sdS|jj�}|jj�}dd�|D�}dd�|D�}||kS)NFcSsg|]}|jr|�qSr)r:)r�r/rrrr��sz)_ExtensionDict.__eq__.<locals>.<listcomp>cSsg|]}|jr|�qSr)r:)r�r/rrrr��s)r7rr-r�)r�r�Z	my_fieldsZother_fieldsrrrr��s

z_ExtensionDict.__eq__cCs
||kS)Nr)r�r�rrr�__ne__�sz_ExtensionDict.__ne__cCstd��dS)Nzunhashable object)r�)r�rrr�__hash__�sz_ExtensionDict.__hash__cCs\t|j|�|jtjks$|jtjkr2td|j��t	j
|�}|j|�|jj|<|jj
�dS)zlIf extension_handle specifies a non-repeated, scalar extension
    field, sets the value of that field.
    zKCannot assign to extension "%s" because it is a repeated or composite type.N)r=r-rKr8rarRrSr�rr	rxr�r@r�)r�r<rPrzrrr�__setitem__�s

z_ExtensionDict.__setitem__cCs|jjj|d�S)z�Tries to find a known extension with the specified name.

    Args:
      name: Extension full name.

    Returns:
      Extension field descriptor.
    N)r-r�r�)r�rrrr�_FindExtensionByNames	z#_ExtensionDict._FindExtensionByNamecCs|jjj|d�S)z�Tries to find a known extension with the field number.

    Args:
      number: Extension field number.

    Returns:
      Extension field descriptor.
    N)r-r�r�)r�rVrrr�_FindExtensionByNumbers	z%_ExtensionDict._FindExtensionByNumberN)r0r1r2r3r.r.r�r/r0r1r2r3rrrrr��s!
r�)Rr3�
__author__�iorr	r�r&r�Zgoogle.protobuf.internalrrrrrrr�r	r
rr�rr�r
r�rZFieldDescriptorr8r�rIrr6r=rrLrOrTr%rr'rXrfr�r(r�r)r�r�r�r�r*r+r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrr!r"r$r|r,r-�objectr�r}r�rrrr�<module>1s�kC7T,8,
*&( 1_,".

Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 113 B 0644
__init__.cpython-36.pyc File 113 B 0644
_parameterized.cpython-36.opt-1.pyc File 13.17 KB 0644
_parameterized.cpython-36.pyc File 13.54 KB 0644
any_test_pb2.cpython-36.opt-1.pyc File 3.56 KB 0644
any_test_pb2.cpython-36.pyc File 3.56 KB 0644
api_implementation.cpython-36.opt-1.pyc File 2.48 KB 0644
api_implementation.cpython-36.pyc File 2.48 KB 0644
containers.cpython-36.opt-1.pyc File 19.77 KB 0644
containers.cpython-36.pyc File 19.77 KB 0644
decoder.cpython-36.opt-1.pyc File 20.5 KB 0644
decoder.cpython-36.pyc File 20.58 KB 0644
descriptor_database_test.cpython-36.opt-1.pyc File 2.09 KB 0644
descriptor_database_test.cpython-36.pyc File 2.09 KB 0644
descriptor_pool_test.cpython-36.opt-1.pyc File 28.47 KB 0644
descriptor_pool_test.cpython-36.pyc File 28.47 KB 0644
descriptor_pool_test1_pb2.cpython-36.opt-1.pyc File 8.48 KB 0644
descriptor_pool_test1_pb2.cpython-36.pyc File 8.48 KB 0644
descriptor_pool_test2_pb2.cpython-36.opt-1.pyc File 5.95 KB 0644
descriptor_pool_test2_pb2.cpython-36.pyc File 5.95 KB 0644
descriptor_test.cpython-36.opt-1.pyc File 29.15 KB 0644
descriptor_test.cpython-36.pyc File 29.15 KB 0644
encoder.cpython-36.opt-1.pyc File 23.43 KB 0644
encoder.cpython-36.pyc File 23.57 KB 0644
enum_type_wrapper.cpython-36.opt-1.pyc File 2.65 KB 0644
enum_type_wrapper.cpython-36.pyc File 2.65 KB 0644
factory_test1_pb2.cpython-36.opt-1.pyc File 4.26 KB 0644
factory_test1_pb2.cpython-36.pyc File 4.26 KB 0644
factory_test2_pb2.cpython-36.opt-1.pyc File 10.6 KB 0644
factory_test2_pb2.cpython-36.pyc File 10.6 KB 0644
file_options_test_pb2.cpython-36.opt-1.pyc File 2.29 KB 0644
file_options_test_pb2.cpython-36.pyc File 2.29 KB 0644
generator_test.cpython-36.opt-1.pyc File 10.52 KB 0644
generator_test.cpython-36.pyc File 10.52 KB 0644
json_format_test.cpython-36.opt-1.pyc File 28.12 KB 0644
json_format_test.cpython-36.pyc File 28.12 KB 0644
message_factory_test.cpython-36.opt-1.pyc File 5.34 KB 0644
message_factory_test.cpython-36.pyc File 5.34 KB 0644
message_listener.cpython-36.opt-1.pyc File 2.23 KB 0644
message_listener.cpython-36.pyc File 2.23 KB 0644
message_set_extensions_pb2.cpython-36.opt-1.pyc File 4.06 KB 0644
message_set_extensions_pb2.cpython-36.pyc File 4.06 KB 0644
message_test.cpython-36.opt-1.pyc File 58.58 KB 0644
message_test.cpython-36.pyc File 58.69 KB 0644
missing_enum_values_pb2.cpython-36.opt-1.pyc File 4.61 KB 0644
missing_enum_values_pb2.cpython-36.pyc File 4.61 KB 0644
more_extensions_dynamic_pb2.cpython-36.opt-1.pyc File 3.09 KB 0644
more_extensions_dynamic_pb2.cpython-36.pyc File 3.09 KB 0644
more_extensions_pb2.cpython-36.opt-1.pyc File 3.81 KB 0644
more_extensions_pb2.cpython-36.pyc File 3.81 KB 0644
more_messages_pb2.cpython-36.opt-1.pyc File 2.7 KB 0644
more_messages_pb2.cpython-36.pyc File 2.7 KB 0644
packed_field_test_pb2.cpython-36.opt-1.pyc File 7.8 KB 0644
packed_field_test_pb2.cpython-36.pyc File 7.8 KB 0644
proto_builder_test.cpython-36.opt-1.pyc File 2.26 KB 0644
proto_builder_test.cpython-36.pyc File 2.26 KB 0644
python_message.cpython-36.opt-1.pyc File 41.32 KB 0644
python_message.cpython-36.pyc File 41.41 KB 0644
reflection_test.cpython-36.opt-1.pyc File 78.49 KB 0644
reflection_test.cpython-36.pyc File 78.49 KB 0644
service_reflection_test.cpython-36.opt-1.pyc File 4.06 KB 0644
service_reflection_test.cpython-36.pyc File 4.06 KB 0644
symbol_database_test.cpython-36.opt-1.pyc File 3.65 KB 0644
symbol_database_test.cpython-36.pyc File 3.65 KB 0644
test_bad_identifiers_pb2.cpython-36.opt-1.pyc File 3.47 KB 0644
test_bad_identifiers_pb2.cpython-36.pyc File 3.47 KB 0644
test_util.cpython-36.opt-1.pyc File 24.73 KB 0644
test_util.cpython-36.pyc File 24.77 KB 0644
testing_refleaks.cpython-36.opt-1.pyc File 2.95 KB 0644
testing_refleaks.cpython-36.pyc File 2.95 KB 0644
text_encoding_test.cpython-36.opt-1.pyc File 1.33 KB 0644
text_encoding_test.cpython-36.pyc File 1.33 KB 0644
text_format_test.cpython-36.opt-1.pyc File 46.88 KB 0644
text_format_test.cpython-36.pyc File 46.88 KB 0644
type_checkers.cpython-36.opt-1.pyc File 8.94 KB 0644
type_checkers.cpython-36.pyc File 8.94 KB 0644
unknown_fields_test.cpython-36.opt-1.pyc File 8.94 KB 0644
unknown_fields_test.cpython-36.pyc File 8.94 KB 0644
well_known_types.cpython-36.opt-1.pyc File 25.43 KB 0644
well_known_types.cpython-36.pyc File 25.43 KB 0644
well_known_types_test.cpython-36.opt-1.pyc File 20.19 KB 0644
well_known_types_test.cpython-36.pyc File 20.19 KB 0644
wire_format.cpython-36.opt-1.pyc File 6.27 KB 0644
wire_format.cpython-36.pyc File 6.27 KB 0644
wire_format_test.cpython-36.opt-1.pyc File 5.43 KB 0644
wire_format_test.cpython-36.pyc File 5.43 KB 0644