
    Ng=                     @   d dl Z d dlZd dlmZ ej        dk    rd dlmZ nd dlZdZdZ	dZ
d Zd	ed
edefdZej        dk    rd dlZd dlZd dlZd dlZd dlZda ej                    Zd Zd Zd Zd Zd Zd Zi Z ej                    Z G d dej        j                  Z  G d dej        j!                  Z" e j#        e
          s
 e             e$dk    rC edd          Z% ej&         eej'        d(                    e%          gz                        dS dS )    N)_protoc_compiler   	   r   )	resources_pb2	_pb2_grpc!GRPC_PYTHON_DISABLE_DYNAMIC_STUBSc                 B    d | D             } t          j        |           S )zRun the protocol buffer compiler with the given command-line arguments.

    Args:
      command_arguments: a list of strings representing command line arguments to
          `protoc`.
    c                 6    g | ]}|                                 S  encode).0arguments     M/var/www/html/ai-engine/env/lib/python3.11/site-packages/grpc_tools/protoc.py
<listcomp>zmain.<locals>.<listcomp>(   s"    MMMx**MMM    )r   run_main)command_argumentss    r   mainr   !   s,     NM;LMMM$%6777r   package_or_requirementresource_namereturnc                     d}t           j        dk    r*t          j        |           |z                                  }nt          j        | |          }t          |          S )z6Obtain the filename for a resource on the file system.Nr   )sysversion_infor   filesresolvepkg_resourcesresource_filenamestr)r   r   	file_names      r   _get_resource_file_namer$   ,   sa     I
9$$O233mC
')) 		 "3"M
 
	 y>>r   )r      r   Fc                  l   t           5  t          st          j                            t          t          t          j                  t          t          t          j
                  g           t          dd          } t          j                            |            dad d d            d S # 1 swxY w Y   d S )N
grpc_tools_protoT)_FINDERS_INSTALLED_LOCK_FINDERS_INSTALLEDr   	meta_pathextendProtoFinder_PROTO_MODULE_SUFFIXr   
get_protos_SERVICE_MODULE_SUFFIXget_servicesr$   pathappend)proto_includes    r   _maybe_install_proto_findersr5   G   s    $ 	* 	*% *$$#02B2M  $2,9 	
 
 
 !8h O O...%)"#	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	*s   BB))B-0B-c                     |                     d          }|d         d dt          |           z           }d                    |d d         |dz   gz             S )N./z.proto)splitlenjoin)suffixmodule_name
components
proto_names       r   _module_name_to_proto_filerA   \   s]     &&s++
^$6b3v;;&6$67
 xx
3B3:+@*AABBBr   c                     |                     t          j        j                  }t          j                            |d                   d         }d                    |d d         || z   gz             S )Nr8   r   r7   )r:   osr2   sepsplitextr<   )r=   
proto_filer?   proto_base_names       r   _proto_file_to_module_namerH   c   s^    %%bgk22
'**:b>::1=xx
3B3?V+C*DDEEEr   c                 t    t                       t          t          |           }t          j        |          }|S )z>Returns a gRPC module generated from the indicated proto file.)r5   rH   r.   	importlibimport_moduleprotobuf_pathr>   modules      r   _protosrO   h   s9    $&&&0 -
 
 (55r   c                     t                       t          |            t          t          |           }t	          j        |          }|S )z9Returns a module generated from the indicated proto file.)r5   rO   rH   r0   rJ   rK   rL   s      r   	_servicesrQ   q   sG    $&&&0"M
 
 (55r   c                 >    t          |           t          |           fS )zEReturns two modules, corresponding to _pb2.py and _pb2_grpc.py files.)rO   rQ   )rM   s    r   _protos_and_servicesrS   {   s    &&	-(@(@AAr   c                   &    e Zd Zd Zd Zd Zd ZdS )ProtoLoaderc                 L    || _         || _        || _        || _        || _        d S N)_suffix_codegen_fn_module_name_protobuf_path_proto_root)selfr=   
codegen_fnr>   rM   
proto_roots         r   __init__zProtoLoader.__init__   s1     "DL)D +D"/D)Dr   c                     d S rW   r   )r]   specs     r   create_modulezProtoLoader.create_module   s    4r   c                     |                     t          j        j                  }d                    |d d         t          j                            |d                   d         gz             S )Nr7   r8   r   )r:   rC   r2   rD   r<   rE   )r]   filepathr?   s      r   _generated_file_to_module_namez*ProtoLoader._generated_file_to_module_name   sY    !44J883B327#3#3JrN#C#CA#F"GG  r   c                    |j         | j        k    sJ d }t          5  | j        t          v r(t          | j                 }t	          ||j                   n|                     | j                            d          d t          j
        D                       }|d d         D ]k}|                     |d                             d                    }|t          j        vr-|t          vr|d         t          |<   t          j        |           lt	          |d         d         |j                   d d d            d S # 1 swxY w Y   d S )Nasciic                 8    g | ]}|                     d           S )rh   r   )r   r2   s     r   r   z+ProtoLoader.exec_module.<locals>.<listcomp>   s$    CCC$W--CCCr   r8   r      )__name__rZ   _proto_code_cache_lock_proto_code_cacheexec__dict__rY   r[   r   r   r2   rf   decodemodulesrJ   rK   )r]   rN   coder   fr>   s         r   exec_modulezProtoLoader.exec_module   s   ?d&77777D' 8 8$(999,T->?Dv//// ,,+227;;CC#(CCC E #3B3Z A A&*&I&IaDKK00' ' 'ck99*2CCCAB1 1+ >%3K@@@r1v777-8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8s   DD99D= D=N)rk   
__module____qualname__r`   rc   rf   rt   r   r   r   rU   rU      sP        	* 	* 	*	 	 		 	 		8 	8 	8 	8 	8r   rU   c                       e Zd Zd ZddZdS )r-   c                 "    || _         || _        d S rW   )rX   rY   )r]   r=   r^   s      r   r`   zProtoFinder.__init__   s    !DL)Dr   Nc                    |                     | j                  sd S t          | j        |          }t          j        D ]}	 t
          j                            ||          }t          j        |           t          j	        
                    |t          | j        | j        |||                    c S # t          t          t          f$ r Y w xY wd S rW   )endswithrX   rA   r   r2   rC   r<   statrJ   	machinery
ModuleSpecrU   rY   FileNotFoundErrorNotADirectoryErrorOSError)r]   fullnamer2   targetre   search_pathprospective_paths          r   	find_speczProtoFinder.find_spec   s    $$T\22 t1$,IIH"x  ')w||K'J'J$G,--- %.99 # L ,$$' 	 	 	 	 	 *+=wG   H	 s   4B22CCrW   )rk   ru   rv   r`   r   r   r   r   r-   r-      s7        	* 	* 	*	 	 	 	 	 	r   r-   __main__r'   r(   z-I{}))rC   r   r'   r   r   rJ   r   r    r.   r0   _DISABLE_DYNAMIC_STUBSr   r"   r$   
contextlibimportlib.abcimportlib.machinery	threadingr*   Lockr)   r5   rA   rH   rO   rQ   rS   rm   RLockrl   abcLoaderrU   MetaPathFinderr-   getenvrk   r4   exitargvformatr   r   r   <module>r      sf  " 
			 



 ' ' ' ' ' 'y  ####### $ < 8 8 803   " y  ,in..* * **C C CF F F
    B B B ,Y_..,8 ,8 ,8 ,8 ,8im* ,8 ,8 ,8\    im2   : 29+,, '$$&&&z++L(CCMCHTT#(fmmM::;;<<===== r   