a 7dg9@sddladdlZddladdlZddlZtjdkZerHddlZddl Z nddl Zer^ddgZ ndgZ e dZ e e Zde Z dde DZdZd ZeeZd d Zd d ZddZddZerddZnddZddZddZddZddZddZer dd Znd!d Zdld#d$Ze ej!Z"d%#d&d'd(Z$e%&e$d'Z'd)Z(d*Z)d+gZ*d,gZ+e+Z,Z-dmdd-d.d/Z.d0d1Z/d2d3Z0d4d5Z1d6d7Z2d8d9Z3d:d;Z4dd?Z6d@dAZ7dndBdCZ8dodDdEZ9dpdGdHZ:dIdJZ;e<Z=dqde=dKdLdMZ>GdNdOdOZ?GdPdQdQZ@GdRdSdSe@ZAGdTdUdUZBGdVdWdWeBeAZCGdXdYdYeBe@ZDgZEGdZd[d[eBe@ZFGd\d]d]ZGGd^d_d_ZHGd`dadaZIGdbdcdcZJdrdddeZKdfdgZLdhdiZMdjdkZNdS)sNwin32\/cCsh|]}d|qS:.0srr9/usr/local/lib/python3.9/importlib/_bootstrap_external.py /r )win)cygwindarwincs<tjtr0tjtrdndfdd}ndd}|S)N PYTHONCASEOKs PYTHONCASEOKcstjj otjvSN)sysflagsignore_environment_osenvironrkeyrr _relax_case@sz%_make_relax_case.._relax_casecSsdS)NFrrrrr rDs)rplatform startswith_CASE_INSENSITIVE_PLATFORMS#_CASE_INSENSITIVE_PLATFORMS_STR_KEY)rrrr _make_relax_case9s  r cCst|d@ddS)Nlittle)intto_bytes)xrrr _pack_uint32Jsr'cCs t|dSNr#r$ from_bytesdatarrr _unpack_uint32Osr-cCs t|dSr(r)r+rrr _unpack_uint16Tsr.cGs|sdSt|dkr|dSd}g}ttj|D]z\}}|tsL|trf|tpX|}t |g}q0|dr| | kr|}|g}q| |q0|p|}| |q0dd|D}t|dkr|ds|t S|t |S)NrrrcSsg|]}|r|tqSrrstrippath_separatorsr prrr rr_path_join..) lenmapr_path_splitrootrpath_sep_tupleendswithr1r2path_sepcasefoldappendjoin) path_partsrootpathZnew_roottailrrr _path_join[s*     rDcGstdd|DS)NcSsg|]}|r|tqSrr0)r partrrr r5{sr6)r<r?)r@rrr rDys csBtfddtD}|dkr&dfSd||ddfS)Nc3s|]}|VqdSr)rfindr3rBrr rz_path_split..rrr/)maxr2)rBirrGr _path_splitsrKcCs t|Sr)rstatrGrrr _path_statsrMcCs0z t|}Wnty YdS0|jd@|kS)NFi)rMOSErrorst_mode)rBmode stat_inforrr _path_is_mode_types   rRcCs t|dS)Ni)rRrGrrr _path_isfilesrScCs|s t}t|dS)Ni@)rgetcwdrRrGrrr _path_isdirsrUcCs>|sdSt|ddd}t|dko<|dp<|dS)NFrrrr/z\\)rr9replacer7rr;)rBrArrr _path_isabssrWcCs |tSr)rr2rGrrr rWsc Csd|t|}t|tjtjBtjB|d@}zFt|d}| |Wdn1s^0Yt ||Wn6t yzt |Wnt yYn0Yn0dS)N{}.{}rXwb) formatidropenO_EXCLO_CREATO_WRONLY_ioFileIOwriterVrNunlink)rBr,rPpath_tmpfdfilerrr _write_atomics(  rhia r#s __pycache__zopt-z.pyz.pyc) optimizationc CsX|dur4tdt|dur(d}t||r0dnd}t|}t|\}}|d\}}}tj j } | durrt dd |r~|n||| g} |durtj jdkrd}ntj j}t|}|dkr|std|d | t|} | td} tjdurLt|stt|}|dd kr8|dtvr8|d d}ttj|t| St|t| S) NzFthe debug_override parameter is deprecated; use 'optimization' insteadz2debug_override or optimization must be set to Nonerr/.$sys.implementation.cache_tag is Nonerz{!r} is not alphanumericz{}.{}{}rri) _warningswarnDeprecationWarning TypeErrorrfspathrK rpartitionrimplementation cache_tagNotImplementedErrorr?roptimizestrisalnum ValueErrorr[_OPTBYTECODE_SUFFIXESpycache_prefixrWrDrTr2lstrip_PYCACHE) rBdebug_overriderkmessageheadrCbasesepresttagalmost_filenamefilenamerrr cache_from_sourceisH       rc Cs.tjjdurtdt|}t|\}}d}tjdurftjt }| |t rf|t |d}d}|st|\}}|t krtt d||d}|dvrtd|n\|dkr|dd d }| tstd t|t td}|std |d |dd} t|| tdS)NrmFTz not bottom-level directory in rl>rizexpected only 2 or 3 dots in rriz5optimization portion of filename does not start with zoptimization level z is not an alphanumeric valuer)rrtrurvrrrrKr}r1r2rr<r7rrzcountrsplitr{ry partitionrDSOURCE_SUFFIXES) rBrpycache_filenamefound_in_pycache_prefix stripped_pathpycache dot_countrk opt_level base_filenamerrr source_from_caches<          rc Cs|t|dkrdS|d\}}}|r8|dddkr<|Sz t|}Wn"ttfyj|dd}Yn0t|rx|S|S)Nrrlpy)r7rslowerrrvrzrS) bytecode_pathr_ extension source_pathrrr _get_sourcefiles  rcCsH|ttr.z t|WSty*YqD0n|ttr@|SdSdSr)r;tuplerrrvr|)rrrr _get_cacheds  rcCs2zt|j}Wnty$d}Yn0|dO}|S)NrX)rMrOrN)rBrPrrr _calc_modes   rcsBdfdd }z tj}Wnty2dd}Yn0|||S)NcsH|dur|j}n |j|kr0td|j|f|d||g|Ri|S)Nzloader for %s cannot handle %sname)r ImportError)selfrargskwargsmethodrr _check_name_wrapper s z(_check_name.._check_name_wrappercSs8dD] }t||rt||t||q|j|jdS)N) __module____name__ __qualname____doc__)hasattrsetattrgetattr__dict__update)newoldrVrrr _wraps z_check_name.._wrap)N) _bootstrapr NameError)rrrrrr _check_names   rcCs<||\}}|dur8t|r8d}t||dt|S)Nz,Not importing directory {}: missing __init__r) find_loaderr7rnror[ ImportWarning)rfullnameloaderportionsmsgrrr _find_module_shims rcCs|dd}|tkr@d|d|}td|t|fi|t|dkrjd|}td|t|t|dd}|d@rd |d |}t|fi||S) Nr"zbad magic number in z: {}z(reached EOF while reading pyc header of zinvalid flags z in ) MAGIC_NUMBERr_verbose_messagerr7EOFErrorr-)r,r exc_detailsmagicrrrrr _classify_pyc0s     rcCsxt|dd|d@kr>d|}td|t|fi||durtt|dd|d@krttd|fi|dS)Nr r!zbytecode is stale for rr)r-rrr)r, source_mtime source_sizerrrrrr _validate_timestamp_pycQs  rcCs*|dd|kr&td|fi|dS)Nrrz.hash in bytecode doesn't match hash of source )r)r, source_hashrrrrr _validate_hash_pycms rcCsPt|}t|tr8td||dur4t|||Std |||ddS)Nzcode object from {!r}zNon-code object in {!r}rrB) marshalloads isinstance _code_typerr_imp_fix_co_filenamerr[)r,rrrcoderrr _compile_bytecodes     rcCsFtt}|td|t||t||t||SNr bytearrayrextendr'rdumps)rmtimerr,rrr _code_to_timestamp_pycs rTcCs@tt}d|d>B}|t||||t||S)Nr/r)rrcheckedr,rrrr _code_to_hash_pycs   rcCs>ddl}t|j}||}tdd}|||dS)NrT)tokenizeraBytesIOreadlinedetect_encodingIncrementalNewlineDecoderdecode) source_bytesrsource_bytes_readlineencodingnewline_decoderrrr decode_sources    rrsubmodule_search_locationsc Cs |dur:d}t|drDz||}WqDty6YqD0n t|}tj|||d}d|_|durtD]*\}}| t |rh|||}||_ qqhdS|t urt|drz| |}WntyYq0|rg|_n||_|jgkr|rt|d}|j||S)Nz get_filenameoriginT is_packager)rrrrrrr ModuleSpec _set_fileattr_get_supported_file_loadersr;rr _POPULATErrrKr>) rlocationrrspec loader_classsuffixesrdirnamerrr spec_from_file_locations>          rc@sLeZdZdZdZdZeddZeddZed d d Z edd d Z dS)WindowsRegistryFinderz;Software\Python\PythonCore\{sys_version}\Modules\{fullname}zASoftware\Python\PythonCore\{sys_version}\Modules\{fullname}\DebugFcCs6zttj|WSty0ttj|YS0dSr)winregOpenKeyHKEY_CURRENT_USERrNHKEY_LOCAL_MACHINE)clsrrrr _open_registrys z$WindowsRegistryFinder._open_registrycCs|jr|j}n|j}|j|dtjddd}z:||}t|d}Wdn1s^0YWnt y~YdS0|S)Nz%d.%dri)r sys_versionr) DEBUG_BUILDREGISTRY_KEY_DEBUG REGISTRY_KEYr[r version_inforr QueryValuerN)rr registry_keyrhkeyfilepathrrr _search_registrys . z&WindowsRegistryFinder._search_registryNcCsx||}|durdSz t|Wnty6YdS0tD]4\}}|t|r>tj|||||d}|Sq>dS)Nr)rrMrNrr;rrspec_from_loader)rrrBtargetrrrrrrr find_specs   zWindowsRegistryFinder.find_speccCs"|||}|dur|jSdSdSrrrrrrBrrrr find_module.s z!WindowsRegistryFinder.find_module)NN)N) rrrr r r  classmethodrrrrrrrr rs   rc@s,eZdZddZddZddZddZd S) _LoaderBasicscCs@t||d}|ddd}|dd}|dko>|dkS)Nr/rlrri__init__)rKrrrs)rrr filename_base tail_namerrr rAsz_LoaderBasics.is_packagecCsdSrrrrrrr create_moduleIsz_LoaderBasics.create_modulecCs8||j}|dur$td|jtt||jdS)Nz4cannot load module {!r} when get_code() returns None)get_coderrr[r_call_with_frames_removedexecr)rmodulerrrr exec_moduleLs  z_LoaderBasics.exec_modulecCs t||Sr)r_load_module_shimrrrrr load_moduleTsz_LoaderBasics.load_moduleN)rrrrrr#r&rrrr r<src@sJeZdZddZddZddZddZd d Zd d d dZddZ dS) SourceLoadercCstdSr)rNrrBrrr path_mtime[szSourceLoader.path_mtimecCsd||iS)Nr)r)r(rrr path_statscs zSourceLoader.path_statscCs |||Sr)set_data)rr cache_pathr,rrr _cache_bytecodeqszSourceLoader._cache_bytecodecCsdSrr)rrBr,rrr r+{szSourceLoader.set_datac CsT||}z||}Wn2tyJ}ztd|d|WYd}~n d}~00t|S)Nz'source not available through get_data()r)rget_datarNrr)rrrBrexcrrr get_sources zSourceLoader.get_sourcer) _optimizecCstjt||dd|dS)Nr!T) dont_inheritrw)rr compile)rr,rBr1rrr source_to_codes zSourceLoader.source_to_codec Cs||}d}d}d}d}d}z t|}WntyBd}Yn*0z||} WntyfYn0t| d}z||} WntyYn0||d} zt| || } t| dd} | d@dk}|r| d@dk}t j d kr2|st j d kr2||}t t |}t | ||| nt| || d || WnttfyLYn 0td ||t| |||d S|dur||}|||}td|tjs|dur|dur|r|durt |}t|||} nt||t|} z|||| WntyYn0|S)NFTrrrr/rrineveralwayssizez {} matches {})rrrzcode object from {})rrrvr*rNr$r.r memoryviewrcheck_hash_based_pycsr_RAW_MAGIC_NUMBERrrrrrrrr4rdont_write_bytecoderrr7r-)rrrrrr hash_based check_sourcerstr,rr bytes_data code_objectrrr rs                  zSourceLoader.get_codeN) rrrr)r*r-r+r0r4rrrrr r'Ys  r'csxeZdZddZddZddZefddZed d Zd d Z ed dZ ddZ ddZ ddZ ddZZS) FileLoadercCs||_||_dSrr)rrrBrrr rszFileLoader.__init__cCs|j|jko|j|jkSr __class__rrotherrrr __eq__s  zFileLoader.__eq__cCst|jt|jASrhashrrBrrrr __hash__szFileLoader.__hash__cstt||Sr)superrAr&r%rCrr r&s zFileLoader.load_modulecCs|jSrrGr%rrr rszFileLoader.get_filenamecCs~t|ttfrFtt|}|WdS1s:0Yn4t|d}|WdS1sp0YdS)Nr)rr'ExtensionFileLoaderra open_coderxreadrb)rrBrgrrr r. s (zFileLoader.get_datacCs||r|SdSr)rrr"rrr get_resource_readers zFileLoader.get_resource_readercCs tt|jd|}t|dS)NrrM)rDrKrBrarbrresourcerBrrr open_resourceszFileLoader.open_resourcecCs&||sttt|jd|}|Sr) is_resourceFileNotFoundErrorrDrKrBrSrrr resource_path!s zFileLoader.resource_pathcCs(t|vr dStt|jd|}t|S)NFr)r<rDrKrBrSrrrBrrr rV'szFileLoader.is_resourcecCsttt|jdSr)iterrlistdirrKrBrIrrr contents-szFileLoader.contents)rrrrrFrJrr&rr.rRrUrXrVr\ __classcell__rrrLr rAs    rAc@s*eZdZddZddZddddZd S) SourceFileLoadercCst|}|j|jdS)N)rr7)rMst_mtimest_size)rrBr>rrr r*5szSourceFileLoader.path_statscCst|}|j|||dS)N_mode)rr+)rrrr,rPrrr r-:sz SourceFileLoader._cache_bytecoderXrac Cst|\}}g}|r4t|s4t|\}}||qt|D]h}t||}zt|Wq<tynYqreversedrDrmkdirFileExistsErrorrNrrrh) rrBr,rbparentrr@rEr/rrr r+?s.        zSourceFileLoader.set_dataN)rrrr*r-r+rrrr r^1sr^c@seZdZddZddZdS)SourcelessFileLoadercCsD||}||}||d}t|||tt|dd||dS)Nrr)rr)rr.rrr8)rrrBr,rrrr rbs   zSourcelessFileLoader.get_codecCsdSrrr%rrr r0rszSourcelessFileLoader.get_sourceN)rrrrr0rrrr rg^srgc@sXeZdZddZddZddZddZd d Zd d Zd dZ ddZ e ddZ dS)rNcCs>||_t|s4ztt|}Wnty2Yn0||_dSr)rrWrDrrTrNrBrYrrr rs zExtensionFileLoader.__init__cCs|j|jko|j|jkSrrBrDrrr rFs  zExtensionFileLoader.__eq__cCst|jt|jASrrGrIrrr rJszExtensionFileLoader.__hash__cCs$ttj|}td|j|j|S)Nz&extension module {!r} loaded from {!r})rr rcreate_dynamicrrrB)rrr"rrr rsz!ExtensionFileLoader.create_modulecCs$ttj|td|j|jdS)Nz(extension module {!r} executed from {!r})rr r exec_dynamicrrrBrQrrr r#szExtensionFileLoader.exec_modulecs$t|jdtfddtDS)Nr/c3s|]}d|kVqdS)rNrr suffix file_namerr rHsz1ExtensionFileLoader.is_package..)rKrBanyEXTENSION_SUFFIXESr%rrlr rs zExtensionFileLoader.is_packagecCsdSrrr%rrr rszExtensionFileLoader.get_codecCsdSrrr%rrr r0szExtensionFileLoader.get_sourcecCs|jSrrGr%rrr rsz ExtensionFileLoader.get_filenameN) rrrrrFrJrr#rrr0rrrrrr rN{s rNc@sdeZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ dS)_NamespacePathcCs$||_||_t||_||_dSr)_name_pathr_get_parent_path_last_parent_path _path_finderrrrB path_finderrrr rsz_NamespacePath.__init__cCs&|jd\}}}|dkrdS|dfS)Nrlr)rrB__path__)rqrs)rrfdotmerrr _find_parent_path_namessz&_NamespacePath._find_parent_path_namescCs|\}}ttj||Sr)r{rrmodules)rparent_module_namepath_attr_namerrr rss z_NamespacePath._get_parent_pathcCsPt|}||jkrJ||j|}|durD|jdurD|jrD|j|_||_|jSr)rrsrtrurqrrrr)r parent_pathrrrr _recalculates  z_NamespacePath._recalculatecCs t|Sr)rZrrIrrr __iter__sz_NamespacePath.__iter__cCs ||Srr)rindexrrr __getitem__sz_NamespacePath.__getitem__cCs||j|<dSr)rr)rrrBrrr __setitem__sz_NamespacePath.__setitem__cCs t|Sr)r7rrIrrr __len__sz_NamespacePath.__len__cCs d|jS)Nz_NamespacePath({!r}))r[rrrIrrr __repr__sz_NamespacePath.__repr__cCs ||vSrrritemrrr __contains__sz_NamespacePath.__contains__cCs|j|dSr)rrr>rrrr r>sz_NamespacePath.appendN)rrrrr{rsrrrrrrrr>rrrr rps  rpc@sPeZdZddZeddZddZddZd d Zd d Z d dZ ddZ dS)_NamespaceLoadercCst||||_dSr)rprrrvrrr rsz_NamespaceLoader.__init__cCs d|jS)Nz)r[r)rr"rrr module_reprsz_NamespaceLoader.module_reprcCsdS)NTrr%rrr rsz_NamespaceLoader.is_packagecCsdSNrrr%rrr r0sz_NamespaceLoader.get_sourcecCstdddddS)Nrzr!T)r2)r3r%rrr rsz_NamespaceLoader.get_codecCsdSrrrrrr r sz_NamespaceLoader.create_modulecCsdSrrrQrrr r# sz_NamespaceLoader.exec_modulecCstd|jt||S)Nz&namespace module loaded with path {!r})rrrrr$r%rrr r&sz_NamespaceLoader.load_moduleN) rrrrrrrr0rrr#r&rrrr rs rc@sreZdZeddZeddZeddZeddZedd d Zedd d Z edddZ eddZ d S) PathFindercCs@ttjD],\}}|dur(tj|=qt|dr|qdS)Ninvalidate_caches)listrpath_importer_cacheitemsrr)rrfinderrrr r"s   zPathFinder.invalidate_cachesc CsRtjdurtjstdttjD]*}z||WStyJYq"Yq"0q"dS)Nzsys.path_hooks is empty)r path_hooksrnrorr)rrBhookrrr _path_hooks,s    zPathFinder._path_hookscCsd|dkr*z t}Wnty(YdS0ztj|}Wn&ty^||}|tj|<Yn0|Sr)rrTrWrrKeyErrorr)rrBrrrr _path_importer_cache9s    zPathFinder._path_importer_cachecCsRt|dr||\}}n||}g}|dur.rlr) r_loadersrBrWrDrrT _path_mtimeset _path_cache_relaxed_path_cache)rrBloader_detailsloadersrrrr rs   zFileFinder.__init__cCs d|_dS)Nr)rrIrrr rszFileFinder.invalidate_cachescCs*||}|durdgfS|j|jp&gfSr)rrr)rrrrrr rs zFileFinder.find_loadercCs|||}t||||dS)Nr)r)rrrrBsmslrrrrr rs zFileFinder._get_specNc Cs~d}|dd}zt|jp"tj}Wnty@d}Yn0||jkrZ|||_t rp|j }| }n |j }|}||vrt |j|}|jD]:\} } d| } t || } t| r|| || |g|Sqt|}|jD]p\} } zt |j|| } WntyYdS0tjd| dd|| |vrt| r|| || d|Sq|rztd|t|d} |g| _| SdS) NFrlrirrz trying {}) verbosityzpossible namespace for {})rsrMrBrrTr_rNr _fill_cacherrrrrDrrSrrUrzrrrr)rrr is_namespace tail_modulercache cache_module base_pathrkr init_filename full_pathrrrr rsN            zFileFinder.find_specc Cs|j}zt|pt}Wntttfy8g}Yn0tj dsRt ||_ nJt }|D]8}| d\}}}|rd ||}n|}||q\||_ tj trdd|D|_dS)NrrlrYcSsh|] }|qSr)r)r fnrrr r 1rz)FileFinder._fill_cache..)rBrr[rTrWPermissionErrorNotADirectoryErrorrrrrrrr[raddrr) rrBr\lower_suffix_contentsrrryrknew_namerrr rs"     zFileFinder._fill_cachecsfdd}|S)Ncs$t|std|d|gRS)Nzonly directories are supportedrG)rUrrGrrrr path_hook_for_FileFinder=s z6FileFinder.path_hook..path_hook_for_FileFinderr)rrrrrr path_hook3s zFileFinder.path_hookcCs d|jS)NzFileFinder({!r}))r[rBrIrrr rEszFileFinder.__repr__)N)rrrrrrrrrrrrrrrrrr rs   3 rcCs|d}|d}|sB|r$|j}n||kr8t||}n t||}|sTt|||d}z$||d<||d<||d<||d<WntyYn0dS)N __loader____spec__r__file__ __cached__)getrrgr^r Exception)nsrpathname cpathnamerrrrr _fix_up_moduleKs"      rcCs&ttf}ttf}ttf}|||gSr)rNrextension_suffixesr^rrgr|) extensionssourcebytecoderrr rbs rc Csj|atjatjatjt}ddgfdddgff}|D]V\}}|d}|tjvr^tj|}qq4zt|}WqWq4tyYq4Yq40q4tdt|d|t|d|t|d d |t|d d d |Dgd}|dkr| d|D]2}|tjvrt|} n tj|} t||| qt|dt t t |dkrft ddt vrfdt_dS)Nposixrntrrzimportlib requires posix or ntrr<r2r_pathseps_with_coloncSsh|]}d|qSrrr rrr r rz_setup..)rarnrrrz.pywz_d.pydT)rrrr|r_builtin_from_namerrr?r>r rorrrrr ) _bootstrap_module self_module os_details builtin_osr2r< os_module builtin_names builtin_namebuiltin_modulerrr _setupmsD                 rcCs2t|t}tjtj|gtjt dSr) rrrrrrr meta_pathr>r)rsupported_loadersrrr _installsr)rX)N)NNN)rr)T)N)N)Orrarrnrr _MS_WINDOWSrrrrr2r<rr:r?rr%_CASE_INSENSITIVE_PLATFORMS_BYTES_KEYrr r'r-r.rDrKrMrRrSrUrWrhtype__code__rr%rr$r*r:rr{rr|DEBUG_BYTECODE_SUFFIXESOPTIMIZED_BYTECODE_SUFFIXESrrrrrrrrrrrrrrobjectrrrrr'rAr^rgrorNrprrrrrrrrrrr s           G(  !  D@H-:?*  9