OwlCyberSecurity - MANAGER
Edit File: descriptor_pool.pyc
� Du�ac�����������@���s����d��Z��d�Z�d�d�l�Z�d�d�l�m�Z�d�d�l�m�Z�d�d�l�m�Z�e�j�Z�d����Z�d����Z �d ����Z �d �e�f�d�������YZ�d����Z �e�r��e�j�j�Z�n �e����Z�d ����Z�d�S(���sJ��Provides DescriptorPool to use as a container for proto2 descriptors. The DescriptorPool is used in conjection with a DescriptorDatabase to maintain a collection of protocol buffer descriptors for use when dynamically creating message types at runtime. For most applications protocol buffers should be used via modules generated by the protocol buffer compiler tool. This should only be used when the type of protocol buffers used in an application or library cannot be predetermined. Below is a straightforward example on how to use this class: pool = DescriptorPool() file_descriptor_protos = [ ... ] for file_descriptor_proto in file_descriptor_protos: pool.Add(file_descriptor_proto) my_message_descriptor = pool.FindMessageTypeByName('some.package.MessageType') The message descriptor can be used in conjunction with the message_factory module in order to create a protocol buffer class that can be encoded and decoded. If you want to get a Python class for the specified proto, use the helper functions inside google.protobuf.message_factory directly instead of this class. s"���matthewtoia@google.com (Matt Toia)i����N(���t ���descriptor(���t���descriptor_database(���t ���text_encodingc���������C���s ���|��j��d���S(���sL��Remove leading period from fully-qualified type name. Due to b/13860351 in descriptor_database.py, types in the root namespace are generated with a leading period. This function removes that prefix. Args: name: A str, the fully-qualified symbol name. Returns: A str, the normalized fully-qualified symbol name. t���.(���t���lstrip(���t���name(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyt���_NormalizeFullyQualifiedNameF���s����c���������C���s���|��j��d���r�|��j�Sd�Sd�S(���sC���Returns the value of the field `options`, or None if it is not set.t���optionsN(���t���HasFieldR���t���None(���t���descriptor_proto(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyt���_OptionsOrNoneU���s����c���������C���sO���|��j��oN�|��j�j�oN�|��j�j����j�oN�|��j�t�j�j�k�oN�|��j �t�j�j �k�S(���N(���t���is_extensiont���containing_typet���has_optionst ���GetOptionst���message_set_wire_formatt���typeR����t���FieldDescriptort���TYPE_MESSAGEt���labelt���LABEL_OPTIONAL(���t���field(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyt���_IsMessageSetExtension]���s ���� t���DescriptorPoolc�����������B���sa��e��Z�d��Z�e�r!�d"�d���Z�n��d"�d���Z�d����Z�d����Z�d����Z �d����Z �d����Z�d����Z�d ����Z �d ����Z�d����Z�d����Z�d ����Z�d����Z�d����Z�d����Z�d����Z�d����Z�d����Z�d����Z�d����Z�d����Z�d"�d"�d"�d"�d���Z�d"�d"�d"�d"�d���Z�e�d���Z�d����Z�d����Z �d����Z!�d����Z"�d����Z#�d����Z$�d ����Z%�d!����Z&�RS(#���sG���A collection of protobufs dynamically constructed by descriptor protos.c���������C���s���t��j�j�|���S(���N(���R����t���_messageR���(���t���clst ���descriptor_db(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyt���__new__j���s����c���������C���sm���t��j����|��_�|�|��_�i��|��_�i��|��_�i��|��_�i��|��_�i��|��_�t �j �t���|��_�t �j �t���|��_ �d�S(���s���Initializes a Pool of proto buffs. The descriptor_db argument to the constructor is provided to allow specialized file descriptor proto lookup code to be triggered on demand. An example would be an implementation which will read and compile a file specified in a call to FindFileByName() and not require the call to Add() at all. Results from this database will be cached internally here as well. Args: descriptor_db: A secondary source of file descriptors. N(���R���t���DescriptorDatabaset���_internal_dbt���_descriptor_dbt���_descriptorst���_enum_descriptorst���_service_descriptorst���_file_descriptorst���_toplevel_extensionst���collectionst���defaultdictt���dictt���_extensions_by_namet���_extensions_by_number(���t���selfR���(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyt���__init__n���s���� c���������C���s���|��j��j�|���d�S(���s���Adds the FileDescriptorProto and its types to this pool. Args: file_desc_proto: The FileDescriptorProto to add. N(���R���t���Add(���R*���t���file_desc_proto(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyR,�������s����c���������C���s3���d�d�l��m�}�|�j�j�|���}�|��j�|���d�S(���s����Adds the FileDescriptorProto and its types to this pool. Args: serialized_file_desc_proto: A bytes string, serialization of the FileDescriptorProto to add. i����(���t���descriptor_pb2N(���t���google.protobufR.���t���FileDescriptorProtot ���FromStringR,���(���R*���t���serialized_file_desc_protoR.���R-���(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyt���AddSerializedFile����s���� c���������C���sE���t��|�t�j���s!�t�d�����n��|�|��j�|�j�<|��j�|�j���d�S(���s��Adds a Descriptor to the pool, non-recursively. If the Descriptor contains nested messages or enums, the caller must explicitly register them. This method also registers the FileDescriptor associated with the message. Args: desc: A Descriptor. s+���Expected instance of descriptor.Descriptor.N(���t ���isinstanceR����t ���Descriptort ���TypeErrorR ���t ���full_namet���_AddFileDescriptort���file(���R*���t���desc(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyt ���AddDescriptor����s���� c���������C���sE���t��|�t�j���s!�t�d�����n��|�|��j�|�j�<|��j�|�j���d�S(���s����Adds an EnumDescriptor to the pool. This method also registers the FileDescriptor associated with the enum. Args: enum_desc: An EnumDescriptor. s/���Expected instance of descriptor.EnumDescriptor.N(���R4���R����t���EnumDescriptorR6���R!���R7���R8���R9���(���R*���t ���enum_desc(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyt���AddEnumDescriptor����s���� c���������C���s5���t��|�t�j���s!�t�d�����n��|�|��j�|�j�<d�S(���s^���Adds a ServiceDescriptor to the pool. Args: service_desc: A ServiceDescriptor. s2���Expected instance of descriptor.ServiceDescriptor.N(���R4���R����t���ServiceDescriptorR6���R"���R7���(���R*���t���service_desc(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyt���AddServiceDescriptor����s����c���������C���s��t��|�t�j���o�|�j�s*�t�d�����n��|�j�d�k�rL�|�|��j�|�j�<n��y�|��j �|�j �|�j�}�Wn�t�k �rz�n;�X|�|�k �r��t �d�|�j�|�j�|�j �j�|�j�f�����n��|�|��j �|�j �|�j�<|�|��j�|�j �|�j�<t�|���r|�|��j�|�j �|�j�j�<n��d�S(���s;��Adds a FieldDescriptor describing an extension to the pool. Args: extension: A FieldDescriptor. Raises: AssertionError: when another extension with the same number extends the same message. TypeError: when the specified extension is not a descriptor.FieldDescriptor. s!���Expected an extension descriptor.sS���Extensions "%s" and "%s" both try to extend message type "%s" with field number %d.N(���R4���R����R���R���R6���t���extension_scopeR ���R$���R7���R)���R ���t���numbert���KeyErrort���AssertionErrorR(���R���t���message_type(���R*���t ���extensiont ���existing_desc(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyt���AddExtensionDescriptor����s&���� c���������C���s���|��j��|���d�S(���s����Adds a FileDescriptor to the pool, non-recursively. If the FileDescriptor contains messages or enums, the caller must explicitly register them. Args: file_desc: A FileDescriptor. N(���R8���(���R*���t ���file_desc(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyt���AddFileDescriptor����s���� c���������C���s5���t��|�t�j���s!�t�d�����n��|�|��j�|�j�<d�S(���s����Adds a FileDescriptor to the pool, non-recursively. If the FileDescriptor contains messages or enums, the caller must explicitly register them. Args: file_desc: A FileDescriptor. s/���Expected instance of descriptor.FileDescriptor.N(���R4���R����t���FileDescriptorR6���R#���R���(���R*���RJ���(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyR8������s���� c���������C���s����y�|��j��|�SWn�t�k �r"�n�Xy�|��j�j�|���}�Wn7�t�k �rr�}�|��j�ri�|��j�j�|���}�qs�|���n�X|�s��t�d�|�����n��|��j�|���S(���s����Gets a FileDescriptor by file name. Args: file_name: The path to the file to get a descriptor for. Returns: A FileDescriptor for the named file. Raises: KeyError: if the file cannot be found in the pool. s���Cannot find a file named %s(���R#���RD���R���t���FindFileByNameR���t!���_ConvertFileProtoToFileDescriptor(���R*���t ���file_namet ���file_protot���error(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyRM�����s���� c���������C���s6��t��|���}�y�|��j�|�j�SWn�t�k �r1�n�Xy�|��j�|�j�SWn�t�k �rW�n�Xy�|��j�|�j�SWn�t�k �r}�n�Xy�|��j�|���SWn�t�k �r��n�Xy�|��j�|�j�SWn�t�k �r��n�X|�j�d���\�}�}�}�y-�|��j �|���}�|�j �|�st���|�j�SWn!�t�k �r1t�d�|�����n�Xd�S(���s��Gets the FileDescriptor for the file containing the specified symbol. Args: symbol: The name of the symbol to search for. Returns: A FileDescriptor that contains the specified symbol. Raises: KeyError: if the file cannot be found in the pool. R���s ���Cannot find a file containing %sN(���R���R ���R9���RD���R!���R"���t���_FindFileContainingSymbolInDbR$���t ���rpartitiont���FindMessageTypeByNamet���extensions_by_nameRE���(���R*���t���symbolt���message_namet���_t���extension_namet���message(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyt���FindFileContainingSymbol+��s8���� c���������C���s6���t��|���}�|�|��j�k�r+�|��j�|���n��|��j�|�S(���s����Loads the named descriptor from the pool. Args: full_name: The full name of the descriptor to load. Returns: The descriptor for the named type. Raises: KeyError: if the message cannot be found in the pool. (���R���R ���RR���(���R*���R7���(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyRT���[��s���� c���������C���s6���t��|���}�|�|��j�k�r+�|��j�|���n��|��j�|�S(���s����Loads the named enum descriptor from the pool. Args: full_name: The full name of the enum descriptor to load. Returns: The enum descriptor for the named type. Raises: KeyError: if the enum cannot be found in the pool. (���R���R!���RR���(���R*���R7���(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyt���FindEnumTypeByNamem��s���� c���������C���s>���t��|���}�|�j�d���\�}�}�}�|��j�|���}�|�j�|�S(���s��Loads the named field descriptor from the pool. Args: full_name: The full name of the field descriptor to load. Returns: The field descriptor for the named field. Raises: KeyError: if the field cannot be found in the pool. R���(���R���RS���RT���t���fields_by_name(���R*���R7���RW���RX���t ���field_namet���message_descriptor(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyt���FindFieldByName��s����c���������C���s>���t��|���}�|�j�d���\�}�}�}�|��j�|���}�|�j�|�S(���s��Loads the named oneof descriptor from the pool. Args: full_name: The full name of the oneof descriptor to load. Returns: The oneof descriptor for the named oneof. Raises: KeyError: if the oneof cannot be found in the pool. R���(���R���RS���RT���t���oneofs_by_name(���R*���R7���RW���RX���t ���oneof_nameR_���(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyt���FindOneofByName���s����c���������C���s����t��|���}�y�|��j�|�SWn�t�k �r.�n�X|�j�d���\�}�}�}�y�|��j�|���}�Wn �t�k �r|�|��j�|���}�n�X|�j�|�S(���s��Loads the named extension descriptor from the pool. Args: full_name: The full name of the extension descriptor to load. Returns: A FieldDescriptor, describing the named extension. Raises: KeyError: if the extension cannot be found in the pool. R���(���R���R$���RD���RS���RT���RR���RU���(���R*���R7���RW���RX���RY���t���scope(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyt���FindExtensionByName���s���� c���������C���s���|��j��|�|�S(���s���Gets the extension of the specified message with the specified number. Extensions have to be registered to this pool by calling AddExtensionDescriptor. Args: message_descriptor: descriptor of the extended message. number: integer, number of the extension field. Returns: A FieldDescriptor describing the extension. Raises: KeyError: when no extension with the given number is known for the specified message. (���R)���(���R*���R_���RC���(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyt���FindExtensionByNumber���s����c���������C���s���t��|��j�|�j������S(���s!��Gets all the known extension of a given message. Extensions have to be registered to this pool by calling AddExtensionDescriptor. Args: message_descriptor: descriptor of the extended message. Returns: A list of FieldDescriptor describing the extensions. (���t���listR)���t���values(���R*���R_���(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyt���FindAllExtensions���s����c���������C���s6���t��|���}�|�|��j�k�r+�|��j�|���n��|��j�|�S(���s��Loads the named service descriptor from the pool. Args: full_name: The full name of the service descriptor to load. Returns: The service descriptor for the named service. Raises: KeyError: if the service cannot be found in the pool. (���R���R"���RR���(���R*���R7���(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyt���FindServiceByName���s����c���������C���sv���y�|��j��j�|���}�Wn7�t�k �rO�}�|��j�rF�|��j�j�|���}�qP�|���n�X|�si�t�d�|�����n��|��j�|���S(���s"��Finds the file in descriptor DB containing the specified symbol. Args: symbol: The name of the symbol to search for. Returns: A FileDescriptor that contains the specified symbol. Raises: KeyError: if the file cannot be found in the descriptor database. s ���Cannot find a file containing %s(���R���R[���RD���R���RN���(���R*���RV���RP���RQ���(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyRR������s���� c���������C���s��|�j��|��j�k�rt�|��j�|�j�����}�g��|�j�D]�}�|��j�|���^�q4�}�g��|�j�D]�}�|�|�^�qY�}�t�j�d�|��d�|�j��d�|�j �d�|�j �d�t�|���d�|�j����d�|�d�|���}�i��}�xM�|�D]E�} �|�j �|��j�| �j�j��������|�j �d ����| �j�j����D����q��WxB�|�j�D]7�} �|��j�| �|�j �|�|�|�j ���}�|�|�j�|�j��<q Wx9�|�j�D].�}�|��j�|�|�j �|�d�|���|�j�|�j��<qeWx��t�|�j���D]t�\�} �}�|��j�|�|�j �| �|�d �t��}�|��j�|�j �|�j�|���|�_�|��j�|�|�|�j �|���|�|�j�|�j��<q�Wx'�|�j�D]�}�|��j �|�j �|�|���q)W|�j �rdt!�|�j ���}�n�d�}�x9�|�j�D].�}�|��j�|�|�j��|���}�|�|�j�|�j��<qtWxE�t�|�j"���D]4�\�} �}�|��j#�|�| �|�|�j �|���|�j$�|�j��<q�W|��j%�|���|�|��j�|�j��<n��|��j�|�j��S( ���sD��Creates a FileDescriptor from a proto or returns a cached copy. This method also has the side effect of loading all the symbols found in the file into the appropriate dictionaries in the pool. Args: file_proto: The proto to convert. Returns: A FileDescriptor matching the passed in proto. t���poolR���t���packaget���syntaxR���t ���serialized_pbt���dependenciest���public_dependenciesc���������s���s$���|��]�}�t��|�j���|�f�Vq�d��S(���N(���t���_PrefixWithDotR7���(���t���.0t���enum(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pys ���<genexpr>,��s���R���t����N(&���R���R#���Rg���t���_GetDepst ���dependencyRM���t���public_dependencyR����RL���Rl���Rm���R���t���SerializeToStringt���updatet���_ExtractSymbolst���message_types_by_nameRh���t���enum_types_by_nameRF���t���_ConvertMessageDescriptort ���enum_typet���_ConvertEnumDescriptorR ���t ���enumerateRG���t���_MakeFieldDescriptort���Truet���_GetTypeFromScopet���extendeeR ���t ���_SetFieldTypeRU���t���_SetAllFieldTypesRq���t���servicet���_MakeServiceDescriptort���services_by_nameR,���(���R*���RP���t ���built_depst���nt���direct_depst���it���public_depst���file_descriptorRd���Rv���RF���t���message_descR~���t���indext���extension_protot���extension_desct ���desc_protot���desc_proto_prefixR:���t ���service_proto(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyRN�����sf���� % c������!���C���s��|�r!�d�j��|�|�j�f���}�n �|�j�}�|�d�k�r?�d�}�n �|�j�}�|�d�k�r]�i��}�n��g��|�j�D]!�}�|��j�|�|�|�|�|���^�qg�}�g��|�j�D]!�} �|��j�| �|�|�d�|���^�q��} �g��t�|�j���D]$�\�}�}�|��j �|�|�|�|���^�q��} �g��t�|�j ���D]*�\�}�}�|��j �|�|�|�|�d�t��^�q }�g��t�|�j���D]B�\�}�}�t �j�|�j�d�j��|�|�j�f���|�d�g��|�j���^�qI}�g��|�j�D]�}�|�j�|�j�f�^�q�}�|�r�t�}�n�t�}�t �j�d�|�j�d�|�d�|�d�d�d�| �d�|�d �|�d �| �d�|�d�t�|���d �|�d�|�d�|�d�d�d�d�d�|���}�x�|�j�D]�}�|�|�_�qMWx�|�j�D]�} �|�| �_�qjWxa�t�|�j���D]P�\�}�}�|�j�d���r�|�j�}�|�|�j�j�| �|���|�|�| �|�_�q�q�W|�|�t�|���<|�|��j�|�<|�S(���s���Adds the proto to the pool in the specified package. Args: desc_proto: The descriptor_pb2.DescriptorProto protobuf message. package: The package the proto should be located in. file_desc: The file containing this message. scope: Dict mapping short and full symbols to message and enum types. syntax: string indicating syntax of the file ("proto2" or "proto3") Returns: The added descriptor. R���R���R���R7���t���filenameR ���t���fieldst���oneofst���nested_typest ���enum_typest ���extensionsR���t ���is_extendablet���extension_rangesR9���t���serialized_startt���serialized_endRm���t���oneof_indexN( ���t���joinR���R ���t���nested_typeR}���R~���R���R����R���R����RG���R����t ���oneof_declR����t���OneofDescriptorR���t���extension_ranget���startt���endt���FalseR5���R���R����R ���R����R���R����R����t���appendt���containing_oneofRq���R ���(���R*���R����Rl���RJ���Rd���Rm���t ���desc_nameRO���t���nestedRs���t���enumsR����R���R����RG���R����R:���R����t���rR����R����t���field_indext ���field_descR����(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyR}���]��sf���� ..7=U( c���������C���s����|�r!�d�j��|�|�j�f���}�n �|�j�}�|�d �k�r?�d �}�n �|�j�}�g��t�|�j���D]�\�}�} �|��j�| �|���^�qX�} �t�j�d�|�j�d�|�d�|�d�|�d�| �d�|�d�t�|�����}�|�|�d �|�<|�|��j �|�<|�S(���s���Make a protobuf EnumDescriptor given an EnumDescriptorProto protobuf. Args: enum_proto: The descriptor_pb2.EnumDescriptorProto protobuf message. package: Optional package name for the new message EnumDescriptor. file_desc: The file containing the enum descriptor. containing_type: The type containing this enum. scope: Scope containing available types. Returns: The added descriptor R���R���R7���R����R9���Rh���R ���R���s���.%sN( ���R����R���R ���R����t���valuet���_MakeEnumValueDescriptorR����R<���R���R!���(���R*���t ���enum_protoRl���RJ���R ���Rd���t ���enum_nameRO���R����R����Rh���R:���(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyR������s$���� 1 c������!���C���s����|�r!�d�j��|�|�j�f���}�n �|�j�}�t�j�d�|�j�d�|�d�|�d�|�j�d�|�j�d�d�d�d�d �d�d �d�d�|�j�d�t�d �d�d�|�d�d�d�t �|���d�|���S(���s���Creates a field descriptor from a FieldDescriptorProto. For message and enum type fields, this method will do a look up in the pool for the appropriate descriptor for that type. If it is unavailable, it will fall back to the _source function to create it. If this type is still unavailable, construction will fail. Args: field_proto: The proto describing the field. message_name: The name of the containing message. index: Index of the field file_desc: The file containing the field descriptor. is_extension: Indication that this field is for an extension. Returns: An initialized FieldDescriptor object R���R���R7���R����RC���R���t���cpp_typeRF���R~���R ���R���t���has_default_valuet ���default_valueR���RB���R���R9���N( ���R����R���R����R���RC���R���R ���R���R����R���(���R*���t���field_protoRW���R����RJ���R���R7���(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyR�������s(���� c���������C���s��t��|���}�|��j�|�|�j�|���}�|�d�k�rB�t��|�j���}�n�d�j�|�|�j�g���}�x9�t�|�j�|�j���D]"�\�}�}�|��j�|�|�|�|���qp�WxT�t�|�j�|�j ���D]=�\�}�} �|��j�|�|�j �|���| �_�|��j�|�| �|�|���q��Wx$�|�j�D]�} �|��j �|�| �|���q��Wd�S(���s��Sets all the descriptor's fields's types. This method also sets the containing types on any extensions. Args: package: The current package of desc_proto. desc_proto: The message descriptor to update. scope: Enclosing scope of available types. R���N(���Rq���R����R���R����t���zipR���R����R����RG���R����R����R ���R����R����(���R*���Rl���R����Rd���t ���main_desct���nested_packageR����R����R����R����R����(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyR�������s����"c���������C���s��|�j��r$�|��j�|�|�j��|���}�n�d�}�|�j�d���so�t�|�t�j���r]�t�j�j�|�_ �qo�t�j�j �|�_ �n��t�j�j�|�j ���|�_�|�j �t�j�j�k�s��|�j �t�j�j �k�r��|�|�_�n��|�j �t�j�j �k�r��|�|�_�n��|�j�t�j�j�k�rt�|�_�g��|�_�n�|�j�d���r&t�|�_�|�j �t�j�j�k�sJ|�j �t�j�j�k�r_t�|�j���|�_�q�|�j �t�j�j�k�r�|�j�|�_�q�|�j �t�j�j�k�r�|�j�j����d�k�|�_�q�|�j �t�j�j �k�r�|�j�j�|�j�j�|�_�q�|�j �t�j�j�k�rt�j �|�j���|�_�q�t!�|�j���|�_�n��t�|�_�|�j �t�j�j�k�sY|�j �t�j�j�k�red�|�_�n��|�j �t�j�j�k�r�d�|�_�ny�|�j �t�j�j�k�r�t�|�_�nX�|�j �t�j�j �k�r�|�j�j"�d�j�|�_�n*�|�j �t�j�j�k�r�d�|�_�n �d�|�_�|�j �|�_ �d�S( ���s��Sets the field's type, cpp_type, message_type and enum_type. Args: field_proto: Data about the field in proto format. field_desc: The descriptor to modiy. package: The package the field's container is in. scope: Enclosing scope of available types. R���R����t���trueg��������u����i����Rt���N(#���t ���type_nameR����R ���R���R4���R����R5���R���R���R���t ���TYPE_ENUMt���ProtoTypeToCppProtoTypeR����t ���TYPE_GROUPRF���R~���R���t���LABEL_REPEATEDR����R����R����R����t���TYPE_DOUBLEt ���TYPE_FLOATt���floatt���TYPE_STRINGt ���TYPE_BOOLt���lowert���values_by_nameRC���t ���TYPE_BYTESR���t ���CUnescapet���intRh���(���R*���R����R����Rl���Rd���R:���(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyR���� ��s^���� c���������C���s4���t��j�d�|�j�d�|�d�|�j�d�t�|���d�d���S(���s����Creates a enum value descriptor object from a enum value proto. Args: value_proto: The proto describing the enum value. index: The index of the enum value. Returns: An initialized EnumValueDescriptor object. R���R����RC���R���R���N(���R����t���EnumValueDescriptorR���RC���R���R ���(���R*���t���value_protoR����(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyR����f��s���� c������ ���C���s����|�r!�d�j��|�|�j�f���}�n �|�j�}�g��t�|�j���D]'�\�}�}�|��j�|�|�|�|�|���^�q:�} �t�j�d�|�j�d�|�d�|�d�| �d�t�|���d�|���} �| �|��j�|�<| �S(���s���Make a protobuf ServiceDescriptor given a ServiceDescriptorProto. Args: service_proto: The descriptor_pb2.ServiceDescriptorProto protobuf message. service_index: The index of the service in the File. scope: Dict mapping short and full symbols to message and enum types. package: Optional package name for the new message EnumDescriptor. file_desc: The file containing the service descriptor. Returns: The added descriptor. R���R���R7���R����t���methodsR���R9���( ���R����R���R����t���methodt���_MakeMethodDescriptorR����R?���R���R"���(���R*���R����t ���service_indexRd���Rl���RJ���t���service_nameR����t���method_protoR����R:���(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyR����x��s���� : c��� ������C���s����d�j��|�|�j�f���}�|��j�|�|�j�|���}�|��j�|�|�j�|���}�t�j�d�|�j�d�|�d�|�d�d �d�|�d�|�d�t�|�����S( ���s���Creates a method descriptor from a MethodDescriptorProto. Args: method_proto: The proto describing the method. service_name: The name of the containing service. package: Optional package name to look up for types. scope: Scope containing available types. index: Index of the method in the service. Returns: An initialized MethodDescriptor object. R���R���R7���R����t���containing_servicet ���input_typet���output_typeR���N( ���R����R���R����R����R����R����t���MethodDescriptorR ���R���( ���R*���R����R����Rl���Rd���R����R7���R����R����(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyR�������s����c���������c���ss���xl�|�D]d�}�t��|�j���|�f�Vx�|��j�|�j���D]�}�|�Vq4�Wx%�|�j�D]�}�t��|�j���|�f�VqM�Wq�Wd�S(���s����Pulls out all the symbols from descriptor protos. Args: descriptors: The messages to extract descriptors from. Yields: A two element tuple of the type name and descriptor object. N(���Rq���R7���Rz���R����R����(���R*���t���descriptorsR:���RV���Rs���(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyRz������s���� c���������c���sB���x;�|�D]3�}�|��j��|���}�|�Vx�|�j�D]�}�|�Vq+�Wq�Wd�S(���s����Recursively finds dependencies for file protos. Args: dependencies: The names of the files being depended on. Yields: Each direct and indirect dependency. N(���RM���Ro���(���R*���Ro���Rv���t���dep_desct ���parent_dep(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyRu������s ���� c���������C���sr���|�|�k�rj�t��|���j�d���}�xF�|�rf�d�j�|�|�g���}�|�|�k�rV�|�}�Pq$�|�j�d���q$�Wn��|�|�S(���s?��Finds a given type name in the current scope. Args: package: The package the proto should be located in. type_name: The name of the type to be found in the scope. scope: Dict mapping short and full symbols to message and enum types. Returns: The descriptor for the requested type. R���i����(���Rq���t���splitR����t���pop(���R*���Rl���R����Rd���t ���componentst���possible_match(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyR�������s���� N('���t���__name__t ���__module__t���__doc__t���_USE_C_DESCRIPTORSR ���R���R+���R,���R3���R;���R>���RA���RI���RK���R8���RM���R[���RT���R\���R`���Rc���Re���Rf���Ri���Rj���RR���RN���R}���R���R����R����R����R����R����R����R����Rz���Ru���R����(����(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyR���e���sJ��� * 0 UP&+ F c���������C���s���|��j��d���r�|��Sd�|��S(���NR���s���.%s(���t ���startswith(���R���(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyRq������s����c�����������C���s���t��S(���N(���t���_DEFAULT(����(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyt���Default���s����(���R����t ���__author__R%���R/���R����R���R���R����R���R���R���t���objectR���Rq���R���t���default_poolR����R����(����(����(����sC���/usr/lib/python2.7/site-packages/google/protobuf/descriptor_pool.pyt���<module>8���s$��� �������