K idZdZddlZddlZddlZddlmZddlmZddlmZddl m Z ddl m Z ejZ d Z d Zd Zej ZGd d eZdZe rej*j,ZdZyeZdZy)aKProvides 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. z"matthewtoia@google.com (Matt Toia)N) descriptor)descriptor_database) text_encoding)python_edition_defaults)python_messagec$|jdS)aIRemove 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 (str): The fully-qualified symbol name. Returns: str: The normalized fully-qualified symbol name. .)lstripnames e/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/google/protobuf/descriptor_pool.py_NormalizeFullyQualifiedNamer2s S c>|jdr |jSy)zCReturns the value of the field `options`, or None if it is not set.optionsN)HasFieldr)descriptor_protos r _OptionsOrNonerAsy)  # ## rc$|jxr|jjxrk|jjjxrE|j t jjk(xr|j xr |j SN) is_extensioncontaining_type has_options GetOptionsmessage_set_wire_formattyperFieldDescriptor TYPE_MESSAGE is_required is_repeated)fields r _IsMessageSetExtensionr"Is       + +    * * , D D  ** 22?? ?      !rceZdZdZerd+dZ d,dZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ! d-d Z" d.d!Z# d/d"Z$d#Z%d$Z&d%Z'd&Z(d'Z)d(Z*d+d)Z+d*Z,y)0DescriptorPoolzGA collection of protobufs dynamically constructed by descriptor protos.Nc@tjj|Sr)r_messager$)cls descriptor_dbs r __new__zDescriptorPool.__new__Ys!!00??rcftj|_||_i|_i|_i|_i|_i|_i|_ tjt|_ tjt|_tj |_d|_t|_y)aLInitializes 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. use_deprecated_legacy_json_field_conflicts: Unused, for compatibility with C++. N)rDescriptorDatabase _internal_db_descriptor_db _descriptors_enum_descriptors_service_descriptors_file_descriptors_toplevel_extensions_top_enum_values collections defaultdictdict_extensions_by_name_extensions_by_numberr*_PROTOBUF_INTERNAL_PYTHON_EDITION_DEFAULTS_serialized_edition_defaults_edition_defaults_feature_cache)selfr(*use_deprecated_legacy_json_field_conflictss r __init__zDescriptorPool.__init__]s",>>@D'DDD "DD "DD +66tDJJ %"D&Drc||jtjf|jtjf|j tj f|jtjf|jtjffD]\}}||vs ||}t|tjr!|jjj}n|jj}t||r||k7r>d|zdz|zdz|zdz}t|tjr|dz }t|yy)aCheck if the descriptor name conflicts with another of the same name. Args: desc: Descriptor of a message, enum, service, extension or enum value. desc_name (str): the full name of desc. file_name (str): The file name of descriptor. zConflict register for file "z": z is already defined in file "zo". Please fix the conflict by adding package name on the proto file, or use different name for the duplication.zQ Note: enum values appear as siblings of the enum type instead of children of it.N)r.r Descriptorr/EnumDescriptorr0ServiceDescriptorr2rr3EnumValueDescriptor isinstancerfiler TypeError) r=desc desc_name file_nameregisterdescriptor_typeold_descold_file error_msgs r _CheckConflictRegisterz%DescriptorPool._CheckConflictRegisters@   J112  !:!:; " "J$@$@A " "J$>$>?   > >? &A!/ h I& h > > ?]]'',,(]]''($0  !5 A()67  #33) j<< = , -I)$ $9rc:|jj|y)zAdds the FileDescriptorProto and its types to this pool. Args: file_desc_proto (FileDescriptorProto): The file descriptor to add. N)r,Add)r=file_desc_protos r rRzDescriptorPool.Adds /*rcxddlm}|jj|}|j |}||_|S)aAdds the FileDescriptorProto and its types to this pool. Args: serialized_file_desc_proto (bytes): A bytes string, serialization of the :class:`FileDescriptorProto` to add. Returns: FileDescriptor: Descriptor for the added file. rdescriptor_pb2)google.protobufrVFileDescriptorProto FromString!_ConvertFileProtoToFileDescriptor serialized_pb)r=serialized_file_desc_protorVrS file_descs r AddSerializedFilez DescriptorPool.AddSerializedFiles>/$88CC"$O66GI8I rct|tjs td|j ||j |j j||j|j <|j|j y)aAdds 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. z+Expected instance of descriptor.Descriptor.N) rErrArGrP full_namerFr r._AddFileDescriptor)r=rHs r _AddDescriptorzDescriptorPool._AddDescriptorsd dJ11 2 C DDdnndiinnE(,Ddnn%DII&rct|tjs td|jj }|j ||j|||j|j<|jjrE|jjd|jjjdz dk(}n|jjddk(}|r|jj }|jj}|jD]J}tdj||j f}|j |||||j|<L|j|jy)zAdds an EnumDescriptor to the pool. This method also registers the FileDescriptor associated with the enum. Args: enum_desc: An EnumDescriptor. z/Expected instance of descriptor.EnumDescriptor.r rN)rErrBrGrFr rPr`r/packagecountvaluesrjoinr3ra)r= enum_descrJ top_levelre enum_valuer`s r _AddEnumDescriptorz!DescriptorPool._AddEnumDescriptorsO i!:!: ; G HH##I 9+>+> J2;D9../ ~~&&,,S1^^++11#67:;>*rc< |j|S#t$rYnwxYw |jj|}n@#t$r4}|jr|jj|}n|Yd}~nd}~wwxYw|std|z|j |S)aGets a FileDescriptor by file name. Args: file_name (str): The path to the file to get a descriptor for. Returns: FileDescriptor: The descriptor for the named file. Raises: KeyError: if the file cannot be found in the pool. NzCannot find a file named %s)r1rur,FindFileByNamer-rZ)r=rJ file_protoerrors r rzDescriptorPool.FindFileByNameTs  # #I ..    $$33I>j   ((77 B     2Y> ??  1 1* ==s! = A:*A55A:ct|} |j|S#t$rYnwxYw |j||j|S#t$rtd|zwxYw)a;Gets the FileDescriptor for the file containing the specified symbol. Args: symbol (str): The name of the symbol to search for. Returns: FileDescriptor: Descriptor for the file that contains the specified symbol. Raises: KeyError: if the file cannot be found in the pool. Cannot find a file containing %s)r!_InternalFindFileContainingSymbolru_FindFileContainingSymbolInDb)r=symbols r FindFileContainingSymbolz'DescriptorPool.FindFileContainingSymbolqs}*& 1F  3 3F ;;    B ((0  3 3F ;; B 7&@ AABs **!AA(c |j|jS#t$rYnwxYw |j|jS#t$rYnwxYw |j|jS#t$rYnwxYw |j |j jS#t$rYnwxYw |j|jS#t$rYnwxYw|jd\}}} |j|}||jvs||jvs||jvsJ|jS#ttf$rtd|zwxYw)a<Gets the already built FileDescriptor containing the specified symbol. Args: symbol (str): The name of the symbol to search for. Returns: FileDescriptor: Descriptor for the file that contains the specified symbol. Raises: KeyError: if the file cannot be found in the pool. r r)r.rFrur/r0r3rr2 rpartitionFindMessageTypeByNameextensions_by_namefields_by_nameenum_values_by_namert)r=rtop_name_sub_namemessages r rz0DescriptorPool._InternalFindFileContainingSymbols   v & + ++      # #F + 0 00      & &v . 3 33      " "6 * / / 4 44      & &v . 3 33    #--c2HaB**84g'444'000'55576\\ n %B 7&@ AABs` ''A AAA-- A98A9="B B,+B,0C CC.AD77Ectt|}||jvr|j||j|S)aLoads the named descriptor from the pool. Args: full_name (str): The full name of the descriptor to load. Returns: Descriptor: The descriptor for the named type. Raises: KeyError: if the message cannot be found in the pool. )rr.rr=r`s r rz$DescriptorPool.FindMessageTypeByNames;-Y7I))) ((3   Y ''rctt|}||jvr|j||j|S)aLoads the named enum descriptor from the pool. Args: full_name (str): The full name of the enum descriptor to load. Returns: EnumDescriptor: The enum descriptor for the named type. Raises: KeyError: if the enum cannot be found in the pool. )rr/rrs r FindEnumTypeByNamez!DescriptorPool.FindEnumTypeByNames;-Y7I... ((3  ! !) ,,rct|}|jd\}}}|j|}|j|S)aLoads the named field descriptor from the pool. Args: full_name (str): The full name of the field descriptor to load. Returns: FieldDescriptor: The field descriptor for the named field. Raises: KeyError: if the field cannot be found in the pool. r )rrrr)r=r` message_namer field_namemessage_descriptors r FindFieldByNamezDescriptorPool.FindFieldByNameG-Y7I"+"6"6s";L!Z33LA  , ,Z 88rct|}|jd\}}}|j|}|j|S)aLoads the named oneof descriptor from the pool. Args: full_name (str): The full name of the oneof descriptor to load. Returns: OneofDescriptor: The oneof descriptor for the named oneof. Raises: KeyError: if the oneof cannot be found in the pool. r )rrroneofs_by_name)r=r`rr oneof_namers r FindOneofByNamezDescriptorPool.FindOneofByNamerrct|} |j|S#t$rYnwxYw|jd\}}} |j |}n #t$r|j |}YnwxYw|j |S)a+Loads the named extension descriptor from the pool. Args: full_name (str): The full name of the extension descriptor to load. Returns: FieldDescriptor: The field descriptor for the named extension. Raises: KeyError: if the extension cannot be found in the pool. r )rr2rurrrr)r=r`rrextension_namescopes r FindExtensionByNamez"DescriptorPool.FindExtensionByNames-Y7I  & &y 11    &/&:&:3&?#L!^<((6e <00;e<  # #N 33s ((AA0/A0c |j||S#t$r'|j|||j||cYSwxYw)aGets the extension of the specified message with the specified number. Extensions have to be registered to this pool by calling :func:`Add` or :func:`AddExtensionDescriptor`. Args: message_descriptor (Descriptor): descriptor of the extended message. number (int): Number of the extension field. Returns: FieldDescriptor: The descriptor for the extension. Raises: KeyError: when no extension with the given number is known for the specified message. )r8ru_TryLoadExtensionFromDB)r=rrss r FindExtensionByNumberz$DescriptorPool.FindExtensionByNumber!sX"D  ' '(: ;F CC D ""#5v>  ' '(: ;F CCDs-AAc|jrt|jdr|j} |jj|}t |t r,|D]&}||j |vr|j||(n.tjdjt| t |j |jS#Y*xYw)a[Gets all the known extensions of a given message. Extensions have to be registered to this pool by build related :func:`Add` or :func:`AddExtensionDescriptor`. Args: message_descriptor (Descriptor): Descriptor of the extended message. Returns: list[FieldDescriptor]: Field descriptors describing the extensions. FindAllExtensionNumberszEFindAllExtensionNumbers() on fall back DB must return a list, not {0}) r-rwr`rrElistr8rwarningswarnformatrrg)r=rr` all_numbersrss r FindAllExtensionsz DescriptorPool.FindAllExtensions8s w 6 8$..i ))AA)L  k4 (# Ef334FGG  ( ();V D E --[ 12 **+=>EEG HH  s CCc>|jsyt|jdsy|j}d} |jj||}|y |j |y#YyxYw#d|j |fz}t j|tYyxYw)zTry to Load extensions from descriptor db. Args: message_descriptor: descriptor of the extended message. number: the extension number that needs to be loaded. NFindFileContainingExtensionz5Unable to load proto file %s for extension number %d.) r-rwr`rrZr rrRuntimeWarning)r=rrsr`rwarn_msgs r rz&DescriptorPool._TryLoadExtensionFromDBZs     : < ",,IJ &&BB Vj  . ,,Z8  .I??F+,hmmHn-sA&A-&A*--Bctt|}||jvr|j||j|S)a'Loads the named service descriptor from the pool. Args: full_name (str): The full name of the service descriptor to load. Returns: ServiceDescriptor: The service descriptor for the named service. Raises: KeyError: if the service cannot be found in the pool. )rr0rrs r FindServiceByNamez DescriptorPool.FindServiceByName{s;-Y7I111 ((3  $ $Y //rct|}|jd\}}}|j|}|j|S)a+Loads the named service method descriptor from the pool. Args: full_name (str): The full name of the method descriptor to load. Returns: MethodDescriptor: The method descriptor for the service method. Raises: KeyError: if the method cannot be found in the pool. r )rrrmethods_by_name)r=r` service_namer method_nameservice_descriptors r FindMethodByNamezDescriptorPool.FindMethodByNamesG-Y7I#,#7#7#< L![// =  - -k ::rc |j tdddlm}t ||j s t d|j|jkDrWtd|jj|jd|jj|j|jj}|jD]}|j|jjk(r td||jk\rMtd |jj|d |jj|j|j}||_y) zSets the default feature mappings used during the build. Args: defaults: a FeatureSetDefaults message containing the new mappings. NzIFeature set defaults can't be changed once the pool has started building!rrUz.SetFeatureSetDefaults called with invalid typezInvalid edition range z to z)Invalid edition EDITION_UNKNOWN specifiedz3Feature set defaults are not strictly increasing. z is greater than or equal to )r; ValueErrorrWrVrEFeatureSetDefaultsrGminimum_editionmaximum_editionEditionNameEDITION_UNKNOWNdefaultsedition)r=rrV prev_editionds r SetFeatureSetDefaultsz$DescriptorPool.SetFeatureSetDefaultssL  )    / h A A B F GG(":":: $$))(*B*BC$$))(*B*BC  "))99L     n,,<< <DEE  "&&++L9&&++AII6    YYl &Drcddlm}t5|js:|j |_|jj |j ddd||jjkrXtd|jj|d|jj|jjd||jjkDrXtd|jj|d|jj|jjdd}|jjD]}|j|kDrn|}|'td|jj|z|j}|j|j |j#|j$|S#1swYxYw) zCreates a FeatureSet message with defaults for a specific edition. Args: edition: the edition to generate defaults for. Returns: A FeatureSet message with defaults for a specific edition. rrUNzEdition z/ is earlier than the minimum supported edition !z- is later than the maximum supported edition z&No valid default found for edition %s!)rWrV_edition_defaults_lockr;rParseFromStringr:rrGrrrrr FeatureSetCopyFromfixed_features MergeFromoverridable_features)r=rrVfoundrrs r _CreateDefaultFeaturesz%DescriptorPool._CreateDefaultFeaturess/   # #!/!B!B!D ..  - -  ''777 $$))'2$$))((88  ''777 $$))'2$$))((88   E  # # , , W  e }  2  " " ' ' 0 1  ((*H e**+ u112 OS  s AGG)c|j}t5|jj|}|||j|<|}ddd|S#1swYSxYwr)SerializeToStringrr<get)r=features serializedcacheds r _InternFeatureszDescriptorPool._InternFeaturessa++-J ""&&z2f *2J'  M  Ms /AAc |jj|}|std|z|j |S#t$r4}|jr|jj|}n|Yd}~Yd}~wwxYw)a0Finds the file in descriptor DB containing the specified symbol. Args: symbol (str): The name of the symbol to search for. Returns: FileDescriptor: The file that contains the specified symbol. Raises: KeyError: if the file cannot be found in the descriptor database. Nr)r,rrur-rZ)r=rrrs r rz,DescriptorPool._FindFileContainingSymbolInDbs$$==fEj  7&@ AA  1 1* ==   ((AA&I   s> A;*A66A;c |jjvrtj|j}|jDcgc]}j |}}|j Dcgc]}|| }}ddlm}tj|j|j|j|jj|jt!||j#||tj$ }i} |D]j} | j'j)| j*j-| j'd| j.j-Dl|j0D]D} j3| |j|| |j} | |j*| j<F|j4D]9} j7| |j|d| d|j.| j<;t9|j:D]\}}j=||j||d}j?|j|j@| |_!jE|||j| ||jF|j<|j0D]}jI|j|| !|jrtK|j}nd}|j0D]8}j?||j| }||j*|j<:t9|jLD];\}}jO||| |j||jP|j<=|j|j<fd j|j}|jFj-D]}jS||j*j-D] } |  |Scc}wcc}w) aDCreates 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. rrU) poolr resyntaxrrr[ dependenciespublic_dependencies create_keyc3JK|]}t|j|fywr)_PrefixWithDotr`).0enums r zCDescriptorPool._ConvertFileProtoToFileDescriptor..Is(I%T^^4d;Is!#NTrc||jD] }| |jD]}j|yr) nested_types extensionsr{)rvnestedryAddExtensionForNestedr=s r rzODescriptorPool._ConvertFileProtoToFileDescriptor..AddExtensionForNestedxsC --&&f%&#..0) $$Y/0r)*r r1r_GetDeps dependencyrpublic_dependencyrWrVrrrerrrrrr_internal_create_keyupdate_ExtractSymbolsmessage_types_by_namergenum_types_by_namerv_ConvertMessageDescriptor enum_type_ConvertEnumDescriptor enumeratery_MakeFieldDescriptor_GetTypeFromScopeextendeer _SetFieldTyper_SetAllFieldTypesrservice_MakeServiceDescriptorservices_by_namer{)r=r built_depsn direct_depsi public_depsrVfile_descriptorrrrv message_descrindexextension_protoextension_desc desc_protodesc_proto_prefixrH service_protor]ryrs` @r rZz0DescriptorPool._ConvertFileProtoToFileDescriptors)d444 j&;&;<=j5?5J5JKT((+KkK-7-I-IJ[^JkJ1"11$$"" ((--j.@.@A ,"446")44 oe #I* T))  , , 3 3 57 8 I!+!>!>!E!E!GI II %11,55 *,,ou      --l.?.?@ "++M)  ' ' :3E3E(7ud L **9>>:M %.j.B.B$C  %22 Z//3*.)?)?  # #_%=%=u*F& ?N*22E ;  **>+>+>? #//F* z11:uEF   *:+=+=>"//F*%% z7AE--joo>F #,J,>,>"?N %  ' ' ue(2(:(:O M ((););<N 1@dZ__-0 &&z7I1188:.  ""9-.!77>>@* L)* oLJs P86 P=c|rdj||jf}n |j}|d}n |j}|i}|jDcgc]}|j|||||c}}|jD cgc]} |j | ||d|d} } t |jD cgc]\} } |j| || |} } } t |jD cgc]\} }|j||| |d}} }t |jD cgc]]\} }tj|jdj||jf| dgt|tj_}} }|jDcgc]}|j |j"f}}|rd}nd}tj$did|jd|d |d dd | d |d |d| d|dt|d|d|d|ddddd|j&j(dtj}|j*D] }||_ |j.D] } || _ t |jD]Q\}}|j1ds|j2}||j4j7| |||| |_S||t;|<|j=||j>|j@j||jB|<|Scc}wcc} wcc} } wcc}} wcc}} wcc}w)aAdds 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 NFTr)rr r`filenamerfieldsoneofsr enum_typesrr is_extendableextension_rangesrFserialized_startserialized_end is_map_entryr oneof_index)"rhr nested_typerrrrr!rry oneof_declrOneofDescriptorrrextension_rangestartendrAr map_entryrrrrrrappendcontaining_oneofrrPr`rFr.)r=rrer]rrrIrJrrenumsr r!rryrrHrrrr field_index field_descrs r rz(DescriptorPool._ConvertMessageDescriptors((GZ__56i//ii..i }e !,,.  && Iy% 9.F(( *  ##D)Y$)5 2 *E * #,J,<,<"=?%''y%K?F? !***>*> ?A E9 !!)Yy/3 " 5AJA%Z%:%:;  E4 "" II HHi+ ,    4 !66 8 F 3=2L2LMQ!%%(MMmm    __              z* $ *      ''11! $22% D(##$#f$"!d"#,Z-=-=#>C Z   ] + ,, {""))&*=>/5k/B{, C (,E. #$dnndiinnE#'Di KC. *?A Ns%L'=L,4L1- L7(A"L=Mc |rdj||jf}n |j}|d}n |j}t|jD cgc]\} } |j | | } } } t j |j|||| |t|t j} | |d|z<|j| | j| jj| |j|<|rO| D]J} tdj|| jf} |j| | || |j| <L| Scc} } w)a%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. top_level: If True, the enum is a top level symbol. If False, the enum is defined inside a message. Returns: The added descriptor r N)r r`rrFrgrrr.%s)rhr rvalue_MakeEnumValueDescriptorrrBrrrPr`rFr/rr3)r= enum_protorer]rrrj enum_namerJr r-rgrHr`s r rz%DescriptorPool._ConvertEnumDescriptorsM"((GZ__56i//ii..i#,J,<,<"=?%++E59?F?  $ $*///8.7*3,25D-;J-G0:0O0O QD $E%) dnndiinnE(,D9%1%0 HHguzz* +-  ##E9i@+0i( 1 K/?sEc|rdj||jf}n |j}|jr |j}nd}tjdid|jd|d|d|j d|j ddd dd dd dd |jd dddd|dddt|d|d|dtjS)aCreates 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 Nr r`r rsrcpp_typervrrlabelhas_default_valueF default_valuerrrr json_namerFrr) rhr r6rrrsrr3rr)r= field_protorr r]rr`r6s r rz#DescriptorPool._MakeFieldDescriptors**((L+*:*:;d j4|_n|jtj j6k(rd |_ne|jtj jk(rd|_n6|jtj jk(rd|_nd |_|j|_y) aSets 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 modify. package: The package the field's container is in. scope: Enclosing scope of available types. NrFr5Ttruegrrr) type_namerrrErrArrr TYPE_ENUMProtoTypeToCppProtoTyper2 TYPE_GROUPrvrr3LABEL_REPEATEDr4r5 TYPE_DOUBLE TYPE_FLOATfloat TYPE_STRING TYPE_BOOLlowervalues_by_namers TYPE_BYTESr CUnescapeintrg)r=r7r*rerrHs r rzDescriptorPool._SetFieldTypems  # #G[-B-BE Jd d    ' D*// 0%55BB %55?? $44LLJ J66CCC   z99DD D $j:55???!jJ66EEE%*j"!#j   o .%)j"   j88DD D   j88CC C#()B)B#C    z99EE E#.#<#<    z99CC C#.#<#<#B#B#D#N    z99CC C#-#7#7#F#F  % %$''-v    z99DD D#0#:#:  % %$'    z99FF F#'  $'{'@'@#A  %*j"   j88DD D   j88CC C#&    z99EE E#&    z99CC C#(    z99CC C#-#7#7#>#>q#A#H#H    z99DD D#&    z99FF F#'    z99DD D#'  $%  !&&JOrctj|j||jt |dtj S)zCreates 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. N)r r rsrrr)rrDr rsrr)r= value_protor s r r.z'DescriptorPool._MakeEnumValueDescriptors@  ) )   !!{+ 22 44rc |rdj||jf}n |j}t|jDcgc]\}}|j |||||} }}t j |j||| t||t j} |j| | j| jj| |j|<| Scc}}w)aMake 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 r`r methodsrrFr) rhr rmethod_MakeMethodDescriptorrrCrrrPr`rFr0) r=r service_indexrrer]rr  method_protorPrHs r rz%DescriptorPool._MakeServiceDescriptorsXXw (:(:;r componentspossible_matchs r rz DescriptorPool._GetTypeFromScope5sv!'*005j * {":; U "$)    ..    rr)NF)NNNN)NNNNF)F)-__name__ __module__ __qualname____doc___USE_C_DESCRIPTORSr)r?rPrRr^rbrlror{rrarrrrrrrrrrrrrrrrrrZrrrrrr.rrRrrrrrr r$r$Ts O@ LQ"!H$L+('& ,F E.@b ' 7>:B6/Bb($-$9"9"4<D. ID.B0";")&V5n>.eNKO37]~HLIN2j4924hA@J'X4("H4@5 8(rr$c2|jdr|Sd|zS)Nr r,) startswithr s r rrLs%754<7rctSr)_DEFAULTrrr DefaultrsYs /r)rm __author__r4 threadingrrWrrrgoogle.protobuf.internalrrrnrrr"Lockrobjectr$rr& default_poolrrrsrrr rzs62 &/)<322 !()uVup'8 - -(  (r