ELF>@@@sdZeddS)Tz Hello world!N) initializedprintrrTools/freeze/flag.pys_frozen_importlib_frozen_importlib_externalzipimport__hello____phello____phello__.spam qS6Csc@sRdZddlZddlmZmZddlZddlZddlZddl Z ddl Z ddl Z ddgZ ej Z ejddZGdddeZiZee ZdZd Zd ZGd ddZe d d d fe ddd fddfZddZddZddZddZdZdaddZ ddZ!dd Z"d!d"Z#ee#j$Z%d#d$Z&d%d&Z'd'd(Z(d)d*Z)d+d,Z*d-d.Z+Gd/d0d0Z,dS)1aPzipimport provides support for importing Python modules from Zip archives. This module exports three objects: - zipimporter: a class; its constructor takes a path to a Zip archive. - ZipImportError: exception raised by zipimporter objects. It's a subclass of ImportError, so it can be caught as ImportError, too. - _zip_directory_cache: a dict, mapping archive paths to zip directory info dicts, as used in zipimporter._files. It is usually not needed to use the zipimport module explicitly; it is used by the builtin import mechanism for sys.path items that are paths to Zip archives. N)_unpack_uint16_unpack_uint32ZipImportError zipimporterc@s eZdZdS)rN)__name__ __module__ __qualname__r r r!ssPKic@sleZdZdZddZdddZdddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZdS)razipimporter(archivepath) -> zipimporter object Create a new zipimporter instance. 'archivepath' must be a path to a zipfile, or to a specific path inside a zipfile. For example, it can be '/tmp/myimport.zip', or '/tmp/myimport.zip/mydirectory', if mydirectory is a valid directory inside the archive. 'ZipImportError is raised if 'archivepath' doesn't point to a valid Zip archive. The 'archive' attribute of zipimporter objects contains the name of the zipfile targeted. c Cs t|tsddl}||}|s,td|dtr<|tt}g}zt |}WnFt t fyt |\}}||krtd|d|}| |Yq@0|jd@dkrtd|dqq@z t|}Wn"tyt|}|t|<Yn0||_||_tj|ddd|_|jr|jt7_dS)Nrzarchive path is emptypathznot a Zip fileii) isinstancestrosZfsdecoder alt_path_sepreplacepath_sep_bootstrap_externalZ _path_statOSError ValueErrorZ _path_splitappendZst_mode_zip_directory_cacheKeyError_read_directory_filesarchive _path_joinprefix)selfr rrZstZdirnameZbasenamefilesr r r __init__?s:        zzipimporter.__init__NcCsNt||}|dur|gfSt||}t||rFd|jt|gfSdgfS)afind_loader(fullname, path=None) -> self, str or None. Search for a module specified by 'fullname'. 'fullname' must be the fully qualified (dotted) module name. It returns the zipimporter instance itself if the module was found, a string containing the full path name if it's possibly a portion of a namespace package, or None otherwise. The optional 'path' argument is ignored -- it's there for compatibility with the importer protocol. N)_get_module_info_get_module_path_is_dirrr)r fullnamer mimodpathr r r find_loaderms   zzipimporter.find_loadercCs|||dS)afind_module(fullname, path=None) -> self or None. Search for a module specified by 'fullname'. 'fullname' must be the fully qualified (dotted) module name. It returns the zipimporter instance itself if the module was found, or None if it wasn't. The optional 'path' argument is ignored -- it's there for compatibility with the importer protocol. r)r))r r&r r r r find_modules zzipimporter.find_modulecCst||\}}}|S)zget_code(fullname) -> code object. Return the code object for the specified module. Raise ZipImportError if the module couldn't be found. _get_module_coder r&code ispackager(r r r get_codeszzipimporter.get_codecCsttr|tt}|}||jtr:|t|jtd}z|j|}Wntyftdd|Yn0t |j|S)zget_data(pathname) -> string with file data. Return the data associated with 'pathname'. Raise OSError if the file wasn't found. Nr) rrr startswithrlenrrr _get_data)r pathnameZkey toc_entryr r r get_datas  zzipimporter.get_datacCst||\}}}|S)zjget_filename(fullname) -> filename string. Return the filename for the specified module. r+r-r r r get_filenameszzipimporter.get_filenamecCs~t||}|dur$td||dt||}|r@t|d}n |d}z|j|}WntylYdS0t|j| S)zget_source(fullname) -> source string. Return the source code for the specified module. Raise ZipImportError if the module couldn't be found, return None if the archive does contain the module, but has no source for it. Ncan't find module name __init__.py.py) r#rr$rrrrr4rdecode)r r&r'r fullpathr6r r r get_sources    zzipimporter.get_sourcecCs(t||}|dur$td||d|S)zis_package(fullname) -> bool. Return True if the module specified by fullname is a package. Raise ZipImportError if the module couldn't be found. Nr9r:)r#r)r r&r'r r r is_packages zzipimporter.is_packagecCst||\}}}tj|}|dus.t|ts@t|}|tj|<||_zT|rlt||}t |j |}|g|_ t |ds|t |_ t|j||t||jWntj|=Yn0ztj|}Wn"tytd|dYn0td|||S)zload_module(fullname) -> module. Load the module specified by 'fullname'. 'fullname' must be the fully qualified (dotted) module name. It returns the imported module, or raises ZipImportError if it wasn't found. N __builtins__zLoaded module z not found in sys.moduleszimport {} # loaded from Zip {})r,sysmodulesgetr _module_type __loader__r$rrrZ__path__hasattrrBZ_fix_up_module__dict__execr ImportError _bootstrap_verbose_message)r r&r.r/r(Zmodr r?r r r load_modules0     zzipimporter.load_modulecCsVz||sWdSWnty(YdS0tjsLddlm}|tdt_t||S)zReturn the ResourceReader for a package in a zip file. If 'fullname' is a package within the zip file, return the 'ResourceReader' object for the package. Otherwise return None. Nr)ResourceReaderT)rAr_ZipImportResourceReader _registeredZ importlib.abcrOZregister)r r&rOr r r get_resource_readers     zzipimporter.get_resource_readercCsd|jt|jdS)Nz)rrr)r r r r __repr__"szzipimporter.__repr__)N)N)rrr__doc__r"r)r*r0r7r8r@rArNrRrSr r r r r-s.    &z __init__.pycTr<F)z.pycTF)r=FFcCs|j|ddS)N.)r rpartition)r r&r r r r$4sr$cCs|t}||jvSN)rr)r r Zdirpathr r r r%8sr%cCs8t||}tD]$\}}}||}||jvr|SqdSrX)r$_zip_searchorderr)r r&r suffix isbytecoder/r?r r r r#As    r#c Cszt|}Wn$ty2td||dYn0|z$|t d|}|t}Wn$tytd||dYn0t|tkrtd||d|ddt krz|dd|}Wn$tytd||dYn0t |t td}z|||}Wn&tyBtd||dYn0| t }|dkrjtd||d|||t}t|tkrtd||d|t||}t |d d }t |d d } ||krtd ||d|| krtd ||d||8}|| } | dkr.td||di} d} z||Wn&tyjtd||dYn0|d}t|dkrtd|dddkrqt|dkrtdt|dd} t|dd }t|d d}t|dd }t |d d }t |d d}t |dd}t|dd}t|dd}t|dd}t |dd}|||}|| krtd||d|| 7}z||}Wn&tytd||dYn0t||krtd||dz2t|||||krtd||dWn&tyFtd||dYn0| d@r\|}n4z|d}Wn$ty|dt}Yn0|dt}t||}||||||||f}|| |<| d 7} qlWdn1s0Ytd!| || S)"Nzcan't open Zip file: r rVcan't read Zip file: rznot a Zip file: zcorrupt Zip file: zbad central directory size: zbad central directory offset: z&bad central directory size or offset: .EOF read where not expectedsPK  "*zbad local header offset: iasciiZlatin1/rz!zipimport: found {} names in {!r})_io open_coderrseekEND_CENTRAL_DIR_SIZEZtellreadr3STRING_END_ARCHIVEmaxMAX_COMMENT_LENrfindrEOFErrorrr>UnicodeDecodeError translate cp437_tablerrrrrLrM)rfpZheader_positionbuffer file_sizeZmax_comment_startdataZpos header_sizeZ header_offsetZ arc_offsetr!countflagscompresstimedatecrc data_size name_size extra_sizeZ comment_size file_offsetr;r tr r r r`s                          ,ru  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ cCsntrtdtddaz>zddlm}Wn$tyPtdtdYn0Wdanda0td|S)Nzzipimport: zlib UNAVAILABLE)can't decompress data; zlib not availableTr decompressFzzipimport: zlib available)_importing_zlibrLrMrZzlibr Exceptionrr r r _get_decompress_funcs     rc Cs|\}}}}}}}} |dkr$tdt|} z| |Wn$tydtd||dYn0| d} t| dkrtd| dddkrtd ||dt| d d } t| d d} d| | }||7}z| |Wn&tytd||dYn0| |}t||kr0td Wdn1sF0Y|dkr^|Sz t }Wnt ytd Yn0||dS)Nrznegative data sizer\r rhrbr]sPKzbad local file header: rgzzipimport: can't read datari) rrnrorprrrr3rwrrr)rr6Zdatapathrrr}rrrrr{r|rrrZraw_datarr r r r4s>     (  r4cCst||dkS)Nr)abs)Zt1Zt2r r r _eq_mtimeAsrcCs8||d}zt|||}Wnty0YdS0|d@dk}|r|d@dk}tjdkr|sftjdkrt||} | durttj| } zt|| ||WntyYdS0nTt ||\} } | rt t |dd| rt |dd | krt d |dSt|d d} t| ts4td |d | S) N)r;r rrrVZneverZalwaysrcr^r_zbytecode is stale for zcompiled module z is not a code object)rZ _classify_pycrK_impZcheck_hash_based_pycs_get_pyc_source source_hashZ_RAW_MAGIC_NUMBERZ_validate_hash_pyc_get_mtime_and_size_of_sourcerrrLrMmarshalZloadsr _code_type TypeError)r r5r?r&r~Z exc_detailsrZ hash_basedZ check_sourceZ source_bytesrZ source_mtimeZ source_sizer.r r r _unmarshal_codeKsR        rcCs|dd}|dd}|S)Ns   )r)sourcer r r _normalize_line_endings~s  rcCst|}t||dddS)NrJT)Z dont_inherit)rcompile)r5rr r r _compile_sourcesrc CsDt|d?d|d?d@|d@|d?|d?d@|d@dd d d f S) N i ?rVr)rZmktime)drr r r _parse_dostimes    rc CsrzR|dddvsJ|dd}|j|}|d}|d}|d}t|||fWStttfylYdS0dS)Nrcor)rr)rrr IndexErrorr)r r r6rrZuncompressed_sizer r r rs  rcCsT|dddvsJ|dd}z|j|}WntyBYdS0t|j|SdS)Nrr)rrr4r)r r r6r r r rs  rc Cst||}tD]\}}}||}tjd|jt|ddz|j|}WntyVYq0|d}t|j|} |rt ||||| } n t || } | durq|d}| ||fSqt d||ddS)Nz trying {}{}{}rV)Z verbosityrr9r:) r$rYrLrMrrrrr4rrr) r r&r rZr[r/r?r6r(r~r.r r r r,s$    r,c@s<eZdZdZdZddZddZddZd d Zd d Z d S)rPzPrivate class used to support ZipImport.get_resource_reader(). This class is allowed to reference all the innards and private parts of the zipimporter. FcCs||_||_dSrX)rr&)r rr&r r r r"sz!_ZipImportResourceReader.__init__cCsZ|jdd}|d|}ddlm}z||j|WStyTt|Yn0dS)NrUrmr)BytesIO)r&rZiorrr7rFileNotFoundError)r resourcefullname_as_pathr rr r r open_resources  z&_ZipImportResourceReader.open_resourcecCstdSrX)r)r rr r r resource_pathsz&_ZipImportResourceReader.resource_pathcCsF|jdd}|d|}z|j|Wnty@YdS0dS)NrUrmFT)r&rrr7r)r r;rr r r r is_resources z$_ZipImportResourceReader.is_resourcec csddlm}||j|j}||jj}|jdks:J|j}t }|jj D]d}z|||}Wnt yzYqNYn0|jj}t |dkr|jVqN||vrN| ||VqNdS)Nr)Pathr<)Zpathlibrrr8r&Z relative_torr;Zparentsetrrr3add) r rZ fullname_pathZ relative_pathZ package_pathZ subdirs_seenfilenameZrelativeZ parent_namer r r contentss"       z!_ZipImportResourceReader.contentsN) rrrrTrQr"rrrrr r r r rPs  rP)-rTZ_frozen_importlib_externalrrrZ_frozen_importlibrLrrnrrCrZ__all__rZpath_separatorsrrKrrtyperFrqrsrurrYr$r%r#rrzrrr4rr__code__rrrrrrr,rPr r r r sX    ~. .  c@sdZddladdlZddladdlZddlZtjdkZerLddlZ ddl Z nddl Z erbddgZ ndgZ e dde Ds~Je dZee Zde Z d d e DZd Zd ZeeZd dZddZddZddZerddZnddZddZddZddZddZd d!Zer$d"d#Z nd$d#Z dod&d'Z!e"e!j#Z$d(%d)d*d+Z&e'(e&d*Z)d,Z*d-Z+d.gZ,d/gZ-e-Z.Z/dpdd0d1d2Z0d3d4Z1d5d6Z2d7d8Z3d9d:Z4d;d<Z5d=d>Z6d?d@Z7dAdBZ8dCdDZ9dqdEdFZ:drdGdHZ;dsdJdKZZ?dtde?dNdOdPZ@GdQdRdRZAGdSdTdTZBGdUdVdVeBZCGdWdXdXZDGdYdZdZeDeCZEGd[d\d\eDeBZFgZGGd]d^d^eDeBZHGd_d`d`ZIGdadbdbZJGdcddddZKGdedfdfZLdudgdhZMdidjZNdkdlZOdmdnZPdS)va^Core implementation of path-based import. This module is NOT meant to be directly imported! It has been designed such that it can be bootstrapped into Python as the implementation of import. As such it requires the injection of specific modules and attributes in order to work. One should use importlib as the public-facing version of this module. NZwin32\/ccs|]}t|dkVqdSNlen.0sepr & +r cCsh|]}d|qS:r rsr r r /r r)win)ZcygwinZdarwincs<tjtr0tjtrdndfdd}ndd}|S)NZ PYTHONCASEOKs PYTHONCASEOKcstjj otjvS)z^True if filenames must be checked case-insensitively and ignore environment flags are not set.)sysflagsignore_environment_osZenvironr keyr r _relax_case@sz%_make_relax_case.._relax_casecSsdS)z5True if filenames must be checked case-insensitively.Fr r r r r rDs)rplatform startswith_CASE_INSENSITIVE_PLATFORMS#_CASE_INSENSITIVE_PLATFORMS_STR_KEY)rr rr _make_relax_case9s  r cCst|d@ddS)z*Convert a 32-bit integer to little-endian.little)intto_bytes)xr r r _pack_uint32Jsr'cCst|dksJt|dS)z/Convert 4 bytes in little-endian to an integer.r"r#rr$ from_bytesdatar r r _unpack_uint32Osr,cCst|dksJt|dS)z/Convert 2 bytes in little-endian to an integer.r#r(r*r r r _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)Replacement for os.path.join().rrrrcSsg|]}|r|tqSr rstrippath_separatorsrpr r r rr _path_join..) rmapr_path_splitrootrpath_sep_tupleendswithr1r2path_sepcasefoldappendjoin) path_partsrootpathZnew_roottailr r r _path_join[s*     rCcGstdd|DS)r/cSsg|]}|r|tqSr r0)rpartr r r r5{sr6)r;r>)r?r r r rCys csBtfddtD}|dkr&dfSd||ddfS)z Replacement for os.path.split().c3s|]}|VqdSN)rfindr3rAr r r r z_path_split..rrNr)maxr2)rAir rGr _path_splitsrJcCs t|S)z~Stat the path. Made a separate function to make it easier to override in experiments (e.g. cache stat results). )rZstatrGr r r _path_statsrKcCs0z t|}Wnty YdS0|jd@|kS)z1Test whether the path is the specified mode type.Fi)rKOSErrorst_mode)rAmodeZ stat_infor r r _path_is_mode_types   rOcCs t|dS)zReplacement for os.path.isfile.i)rOrGr r r _path_isfilesrPcCs|s t}t|dS)zReplacement for os.path.isdir.i@)rgetcwdrOrGr r r _path_isdirsrRcCs>|sdSt|ddd}t|dko<|dp<|dS)Replacement for os.path.isabs.Frrrrz\\)rr8replacerrr:)rAr@r r r _path_isabssrUcCs |tS)rS)rr2rGr r r rUsc Csd|t|}t|tjtjBtjB|d@}zFt|d}| |Wdn1s^0Yt ||Wn6t yzt |Wnt yYn0Yn0dS)zBest-effort function to write data to a path atomically. Be prepared to handle a FileExistsError if concurrent writing of the temporary file is attempted.{}.{}rVZwbN) formatidrZopenZO_EXCLZO_CREATZO_WRONLY_ioFileIOwriterTrLZunlink)rAr+rNZpath_tmpZfdfiler r r _write_atomics(  r^ia r-r#s Z __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) aGiven the path to a .py file, return the path to its .pyc file. The .py file does not need to exist; this simply returns the path to the .pyc file calculated as if the .py file were imported. The 'optimization' parameter controls the presumed optimization level of the bytecode file. If 'optimization' is not None, the string representation of the argument is taken and verified to be alphanumeric (else ValueError is raised). The debug_override parameter is deprecated. If debug_override is not None, a True value is the same as setting 'optimization' to the empty string while a False value is equivalent to setting 'optimization' to '1'. If sys.implementation.cache_tag is None then NotImplementedError is raised. 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{}.{}{}rr-) _warningswarnDeprecationWarning TypeErrorrfspathrJ rpartitionrimplementation cache_tagNotImplementedErrorr>roptimizestrisalnum ValueErrorrX_OPTBYTECODE_SUFFIXESpycache_prefixrUrCrQr2lstrip_PYCACHE) rAZdebug_overrider_messageheadrBZbaser restZtagZalmost_filenamefilenamer r r cache_from_sourceisH       rxc Cs.tjjdurtdt|}t|\}}d}tjdurftjt }| |t rf|t |d}d}|st|\}}|t krtt d||d}|dvrtd|n\|d kr|dd d }| tstd t|t td}|std |d|dd} t|| tdS)anGiven the path to a .pyc. file, return the path to its .py file. The .pyc file does not need to exist; this simply returns the path to the .py file calculated to correspond to the .pyc file. If path does not conform to PEP 3147/488 format, ValueError will be raised. If sys.implementation.cache_tag is None then NotImplementedError is raised. NraFTz not bottom-level directory in r`>r-zexpected only 2 or 3 dots in ryr-z5optimization portion of filename does not start with zoptimization level z is not an alphanumeric valuer)rrhrirjrrfrJrqr1r2rr;rrsrncountrsplitrorm partitionrCSOURCE_SUFFIXES) rAruZpycache_filenameZfound_in_pycache_prefixZ stripped_pathZpycacheZ dot_countr_Z opt_levelZ base_filenamer r r source_from_caches<          rc Cs|t|dkrdS|d\}}}|r8|dddkr<|Sz t|}Wn"ttfyj|dd}Yn0t|rx|S|S)zConvert a bytecode file path to a source path (if possible). This function exists purely for backwards-compatibility for PyImport_ExecCodeModuleWithFilenames() in the C API. rNr`Zpy)rrglowerrrjrnrP) bytecode_pathrv_Z extension source_pathr r r _get_sourcefiles  rcCsH|ttr.z t|WSty*YqD0n|ttr@|SdSdSrE)r:tupler~rxrjrp)rwr r r _get_cacheds  rcCs2zt|j}Wnty$d}Yn0|dO}|S)z3Calculate the mode permissions for a bytecode file.rV)rKrMrL)rArNr r r _calc_modes   rcsBdfdd }z tj}Wnty2dd}Yn0|||S)zDecorator to verify that the module being requested matches the one the loader can handle. The first argument (self) must define _name which the second argument is compared against. If the comparison fails then ImportError is raised. NcsH|dur|j}n |j|kr0td|j|f|d||g|Ri|S)Nzloader for %s cannot handle %sname)r ImportError)selfrargskwargsmethodr r _check_name_wrapper s z(_check_name.._check_name_wrappercSs8dD] }t||rt||t||q|j|jdS)N) __module____name__ __qualname____doc__)hasattrsetattrgetattr__dict__update)ZnewZoldrTr r r _wraps z_check_name.._wrap)N) _bootstrapr NameError)rrrr rr _check_names   rcCs<||\}}|dur8t|r8d}t||dt|S)zTry to find a loader for the specified module by delegating to self.find_loader(). This method is deprecated in favor of finder.find_spec(). Nz,Not importing directory {}: missing __init__r) find_loaderrrbrcrX ImportWarning)rfullnameloaderportionsmsgr r r _find_module_shims rcCs|dd}|tkr@d|d|}td|t|fi|t|dkrjd|}td|t|t|dd}|d @rd |d |}t|fi||S) aTPerform basic validity checking of a pyc header and return the flags field, which determines how the pyc should be further validated against the source. *data* is the contents of the pyc file. (Only the first 16 bytes are required, though.) *name* is the name of the module being imported. It is used for logging. *exc_details* is a dictionary passed to ImportError if it raised for improved debugging. ImportError is raised when the magic number is incorrect or when the flags field is invalid. EOFError is raised when the data is found to be truncated. Nr"zbad magic number in z: {}z(reached EOF while reading pyc header of zinvalid flags z in ) MAGIC_NUMBERr_verbose_messagerrEOFErrorr,)r+r exc_detailsZmagicrtrr r r _classify_pyc0s     rcCsxt|dd|d@kr>d|}td|t|fi||durtt|dd|d@krttd|fi|dS)aValidate a pyc against the source last-modified time. *data* is the contents of the pyc file. (Only the first 16 bytes are required.) *source_mtime* is the last modified timestamp of the source file. *source_size* is None or the size of the source file in bytes. *name* is the name of the module being imported. It is used for logging. *exc_details* is a dictionary passed to ImportError if it raised for improved debugging. An ImportError is raised if the bytecode is stale. r r!zbytecode is stale for rNr)r,rrr)r+ source_mtime source_sizerrrtr r r _validate_timestamp_pycQs  rcCs*|dd|kr&td|fi|dS)aValidate a hash-based pyc by checking the real source hash against the one in the pyc header. *data* is the contents of the pyc file. (Only the first 16 bytes are required.) *source_hash* is the importlib.util.source_hash() of the source file. *name* is the name of the module being imported. It is used for logging. *exc_details* is a dictionary passed to ImportError if it raised for improved debugging. An ImportError is raised if the bytecode is stale. rrz.hash in bytecode doesn't match hash of source N)r)r+ source_hashrrr r r _validate_hash_pycms rcCsPt|}t|tr8td||dur4t|||Std |||ddS)z#Compile bytecode as found in a pyc.zcode object from {!r}NzNon-code object in {!r}rrA) marshalZloads isinstance _code_typerr_impZ_fix_co_filenamerrX)r+rrrcoder r r _compile_bytecodes     rcCsFtt}|td|t||t||t||S)z+Produce the data for a timestamp-based pyc.r) bytearrayrextendr'rdumps)rmtimerr+r r r _code_to_timestamp_pycs rTcCsPtt}d|d>B}|t|t|dks2J|||t||S)z&Produce the data for a hash-based pyc.rr)rrrr'rrr)rrZcheckedr+rr r r _code_to_hash_pycs  rcCs>ddl}t|j}||}tdd}|||dS)zyDecode bytes representing source code and return the string. Universal newline support is used in the decoding. rNT)tokenizerZZBytesIOZreadlineZdetect_encodingZIncrementalNewlineDecoderdecode) source_bytesrZsource_bytes_readlineencodingZnewline_decoderr r r 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)a=Return a module spec based on a file location. To indicate that the module is a package, set submodule_search_locations to a list of directory paths. An empty list is sufficient, though its not otherwise useful to the import system. The loader must take a spec as its only __init__() arg. Nz get_filenameoriginT is_packager)rrrrrfr ModuleSpecZ _set_fileattr_get_supported_file_loadersr:rr _POPULATErrrJr=) rZlocationrrspec loader_classsuffixesrZdirnamer r r spec_from_file_locations>          rc@sPeZdZdZdZdZdZeddZeddZ edd d Z edd d Z d S)WindowsRegistryFinderz>Meta path finder for modules declared in the Windows registry.z;Software\Python\PythonCore\{sys_version}\Modules\{fullname}zASoftware\Python\PythonCore\{sys_version}\Modules\{fullname}\DebugFcCs6zttj|WSty0ttj|YS0dSrE)winregZOpenKeyZHKEY_CURRENT_USERrLZHKEY_LOCAL_MACHINE)clsrr r r _open_registrys z$WindowsRegistryFinder._open_registrycCs|jr|j}n|j}|j|dtjddd}z:||}t|d}Wdn1s^0YWnt y~YdS0|S)Nz%d.%dr-)rZ sys_versionr) DEBUG_BUILDREGISTRY_KEY_DEBUG REGISTRY_KEYrXr version_inforrZ QueryValuerL)rrZ registry_keyrZhkeyfilepathr r r _search_registrys . z&WindowsRegistryFinder._search_registryNcCsx||}|durdSz t|Wnty6YdS0tD]4\}}|t|r>tj|||||d}|Sq>dS)Nr)rrKrLrr:rrspec_from_loader)rrrAtargetrrrrr r r find_specs   zWindowsRegistryFinder.find_speccCs"|||}|dur|jSdSdS)zlFind module named in the registry. This method is deprecated. Use exec_module() instead. NrrrrrArr r r find_module.s z!WindowsRegistryFinder.find_module)NN)N) rrrrrrr classmethodrrrrr r r r rs   rc@s0eZdZdZddZddZddZdd Zd S) _LoaderBasicszSBase class of common code needed by both SourceLoader and SourcelessFileLoader.cCs@t||d}|ddd}|dd}|dko>|dkS)zConcrete implementation of InspectLoader.is_package by checking if the path returned by get_filename has a filename of '__init__.py'.rr`rr-__init__)rJrr|rg)rrrwZ filename_baseZ tail_namer r r rAsz_LoaderBasics.is_packagecCsdSz*Use default semantics for module creation.Nr rrr r r create_moduleIsz_LoaderBasics.create_modulecCs8||j}|dur$td|jtt||jdS)zExecute the module.Nz4cannot load module {!r} when get_code() returns None)get_coderrrXr_call_with_frames_removedexecr)rmodulerr r r exec_moduleLs  z_LoaderBasics.exec_modulecCs t||S)zThis module is deprecated.)r_load_module_shimrrr r r load_moduleTsz_LoaderBasics.load_moduleN)rrrrrrrrr r r r r<s rc@sJeZdZddZddZddZddZd d Zd d d dZddZ dS) SourceLoadercCstdS)zOptional method that returns the modification time (an int) for the specified path (a str). Raises OSError when the path cannot be handled. N)rLrrAr r r path_mtime[szSourceLoader.path_mtimecCsd||iS)aOptional method returning a metadata dict for the specified path (a str). Possible keys: - 'mtime' (mandatory) is the numeric timestamp of last source code modification; - 'size' (optional) is the size in bytes of the source code. Implementing this method allows the loader to read bytecode files. Raises OSError when the path cannot be handled. r)rrr r r path_statscs zSourceLoader.path_statscCs |||S)zOptional method which writes data (bytes) to a file path (a str). Implementing this method allows for the writing of bytecode files. The source path is needed in order to correctly transfer permissions )set_data)rrZ cache_pathr+r r r _cache_bytecodeqszSourceLoader._cache_bytecodecCsdS)zOptional method which writes data (bytes) to a file path (a str). Implementing this method allows for the writing of bytecode files. Nr )rrAr+r r r r{szSourceLoader.set_datac CsT||}z||}Wn2tyJ}ztd|d|WYd}~n d}~00t|S)z4Concrete implementation of InspectLoader.get_source.z'source not available through get_data()rN)rget_datarLrr)rrrArexcr r r get_sources zSourceLoader.get_sourcer) _optimizecCstjt||dd|dS)zReturn the code object compiled from source. The 'data' argument can be any object type that compile() supports. rT) dont_inheritrk)rrcompile)rr+rArr r r 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| |||dS|dur||}|||}td|tjs|dur|dur|r|durt |}t|||} nt||t|} z|||| WntyYn0|S)zConcrete implementation of InspectLoader.get_code. Reading of bytecode requires path_stats to be implemented. To write bytecode, set_data must also be implemented. NFTrrrrrr-ZneverZalwayssizez {} matches {})rrrzcode object from {})rrxrjrrLr$rr memoryviewrZcheck_hash_based_pycsr_RAW_MAGIC_NUMBERrrrrrrrrrdont_write_bytecoderrrr)rrrrrrZ hash_basedZ check_sourcerstr+rrZ bytes_dataZ code_objectr r r rs                  zSourceLoader.get_codeN) rrrrrrrrrrr r r r rYs  rcs|eZdZdZddZddZddZefdd Zed d Z d d Z eddZ ddZ ddZ ddZddZZS) FileLoaderzgBase file loader class which implements the loader protocol methods that require file system usage.cCs||_||_dS)zKCache the module name and the path to the file found by the finder.Nr)rrrAr r r rszFileLoader.__init__cCs|j|jko|j|jkSrE __class__rrZotherr r r __eq__s  zFileLoader.__eq__cCst|jt|jASrEhashrrArr r r __hash__szFileLoader.__hash__cstt||S)zdLoad a module from a file. This method is deprecated. Use exec_module() instead. )superrrrrr r rs zFileLoader.load_modulecCs|jSz:Return the path to the source file as found by the finder.rGrr r r rszFileLoader.get_filenamecCs~t|ttfrFtt|}|WdS1s:0Yn4t|d}|WdS1sp0YdS)z'Return the data from path as raw bytes.Nr)rrExtensionFileLoaderrZZ open_coderlZreadr[)rrAr]r r r r s (zFileLoader.get_datacCs||r|SdSrE)rrrr r r get_resource_readers zFileLoader.get_resource_readercCs tt|jd|}t|dS)Nrr)rCrJrArZr[rZresourcerAr r r open_resourceszFileLoader.open_resourcecCs&||sttt|jd|}|SNr) is_resourceFileNotFoundErrorrCrJrArr r r resource_path!s zFileLoader.resource_pathcCs(t|vr dStt|jd|}t|S)NFr)r;rCrJrArPrrrAr r r r'szFileLoader.is_resourcecCsttt|jdSr)iterrlistdirrJrAr r r r contents-szFileLoader.contents)rrrrrr rrrrrrrrrrZ __classcell__r r rr rs    rc@s.eZdZdZddZddZdddd Zd S) SourceFileLoaderz>Concrete implementation of SourceLoader using the file system.cCst|}|j|jdS)z!Return the metadata for the path.)rr)rKst_mtimeZst_size)rrArr r r r5szSourceFileLoader.path_statscCst|}|j|||dS)N_mode)rr)rrrr+rNr r r r:sz SourceFileLoader._cache_bytecoderVr"c Cst|\}}g}|r4t|s4t|\}}||qt|D]h}t||}zt|Wq<tynYq||_t|s4ztt|}Wnty2Yn0||_dSrE)rrUrCrrQrLrArr r r rs zExtensionFileLoader.__init__cCs|j|jko|j|jkSrErr r r r r s  zExtensionFileLoader.__eq__cCst|jt|jASrEr r r r r rszExtensionFileLoader.__hash__cCs$ttj|}td|j|j|S)z&Create an unitialized extension modulez&extension module {!r} loaded from {!r})rrrZcreate_dynamicrrrA)rrrr r r rsz!ExtensionFileLoader.create_modulecCs$ttj|td|j|jdS)zInitialize an extension modulez(extension module {!r} executed from {!r}N)rrrZ exec_dynamicrrrArr r r rszExtensionFileLoader.exec_modulecs$t|jdtfddtDS)z1Return True if the extension module is a package.rc3s|]}d|kVqdS)rNr rsuffixZ file_namer r r sz1ExtensionFileLoader.is_package..)rJrAanyEXTENSION_SUFFIXESrr r*r rs zExtensionFileLoader.is_packagecCsdS)z?Return None as an extension module cannot create a code object.Nr rr r r rszExtensionFileLoader.get_codecCsdS)z5Return None as extension modules have no source code.Nr rr r r rszExtensionFileLoader.get_sourcecCs|jSrrGrr r r rsz ExtensionFileLoader.get_filenameN)rrrrrr rrrrrrrrr r r r r{s rc@sheZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ ddZ ddZdS)_NamespacePatha&Represents a namespace package's path. It uses the module name to find its parent module, and from there it looks up the parent's __path__. When this changes, the module's own path is recomputed, using path_finder. For top-level modules, the parent module's path is sys.path.cCs$||_||_t||_||_dSrE)_name_pathr_get_parent_path_last_parent_path _path_finderrrrAZ path_finderr r r rsz_NamespacePath.__init__cCs&|jd\}}}|dkrdS|dfS)z>Returns a tuple of (parent-module-name, parent-path-attr-name)r`r)rrAZ__path__)r.rg)rr&dotZmer r r _find_parent_path_namessz&_NamespacePath._find_parent_path_namescCs|\}}ttj||SrE)r5rrmodules)rZparent_module_nameZpath_attr_namer r r r0s z_NamespacePath._get_parent_pathcCsPt|}||jkrJ||j|}|durD|jdurD|jrD|j|_||_|jSrE)rr0r1r2r.rrr/)rZ parent_pathrr r r _recalculates  z_NamespacePath._recalculatecCs t|SrE)rr7r r r r __iter__sz_NamespacePath.__iter__cCs ||SrEr7)rindexr r r __getitem__sz_NamespacePath.__getitem__cCs||j|<dSrE)r/)rr:rAr r r __setitem__sz_NamespacePath.__setitem__cCs t|SrE)rr7r r r r __len__sz_NamespacePath.__len__cCs d|jS)Nz_NamespacePath({!r}))rXr/r r r r __repr__sz_NamespacePath.__repr__cCs ||vSrEr9ritemr r r __contains__sz_NamespacePath.__contains__cCs|j|dSrE)r/r=r?r r r r=sz_NamespacePath.appendN)rrrrrr5r0r7r8r;r<r=r>rAr=r r r r r-s  r-c@sPeZdZddZeddZddZddZd d Zd d Z d dZ ddZ dS)_NamespaceLoadercCst||||_dSrE)r-r/r3r r r rsz_NamespaceLoader.__init__cCs d|jS)zsReturn repr for the module. The method is deprecated. The import machinery does the job itself. z)rXr)rrr r r module_reprsz_NamespaceLoader.module_reprcCsdS)NTr rr r r rsz_NamespaceLoader.is_packagecCsdS)Nrr rr r r rsz_NamespaceLoader.get_sourcecCstdddddS)NrzrT)r)rrr r r rsz_NamespaceLoader.get_codecCsdSrr rr r r r sz_NamespaceLoader.create_modulecCsdSrEr rr r r r sz_NamespaceLoader.exec_modulecCstd|jt||S)zbLoad a namespace module. This method is deprecated. Use exec_module() instead. z&namespace module loaded with path {!r})rrr/rrr r r rsz_NamespaceLoader.load_moduleN) rrrrrrCrrrrrrr r r r rBs rBc@sveZdZdZeddZeddZeddZedd Zedd d Z edd dZ edddZ eddZ d S) PathFinderz>Meta path finder for sys.path and package __path__ attributes.cCs@ttjD],\}}|dur(tj|=qt|dr|qdS)z}Call the invalidate_caches() method on all path entry finders stored in sys.path_importer_caches (where implemented).Ninvalidate_caches)listrpath_importer_cacheitemsrrE)rrfinderr r r rE"s   zPathFinder.invalidate_cachesc CsRtjdurtjstdttjD]*}z||WStyJYq"Yq"0q"dS)z.Search sys.path_hooks for a finder for 'path'.Nzsys.path_hooks is empty)r path_hooksrbrcrr)rrAZhookr r r _path_hooks,s    zPathFinder._path_hookscCsd|dkr*z t}Wnty(YdS0ztj|}Wn&ty^||}|tj|<Yn0|S)zGet the finder for the path entry from sys.path_importer_cache. If the path entry is not in the cache, find the appropriate finder and cache it. If no finder is available, store None. rN)rrQrrrGKeyErrorrK)rrArIr r r _path_importer_cache9s    zPathFinder._path_importer_cachecCsRt|dr||\}}n||}g}|dur.r`rN) r_loadersrArUrCrrQ _path_mtimeset _path_cache_relaxed_path_cache)rrAloader_detailsZloadersrr rUr rs   zFileFinder.__init__cCs d|_dS)zInvalidate the directory mtime.rN)rWr r r r rEszFileFinder.invalidate_cachescCs*||}|durdgfS|j|jp&gfS)zTry to find a loader for the specified module, or the namespace package portions. Returns (loader, list-of-portions). This method is deprecated. Use find_spec() instead. N)rrr)rrrr r r rs zFileFinder.find_loadercCs|||}t||||dS)Nr)r)rrrrAZsmslrrr r r rQs 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) zoTry to find a spec for the specified module. Returns the matching spec, or None if not found. Fr`r-rrNz trying {})Z verbosityzpossible namespace for {})rgrKrArrQr!rLrW _fill_cacherrZrrYrCrVrPrQrRrnrrrr)rrrZ is_namespaceZ tail_modulerZcacheZ cache_moduleZ base_pathr)rZ init_filenameZ full_pathrr r r rsN            zFileFinder.find_specc Cs|j}zt|pt}Wntttfy8g}Yn0tj dsRt ||_ nJt }|D]8}| d\}}}|rd ||}n|}||q\||_ tj trdd|D|_dS)zDFill the cache of potential modules and packages for this directory.rr`rWcSsh|] }|qSr )r)rZfnr r r r1r z)FileFinder._fill_cache..N)rArrrQrPermissionErrorNotADirectoryErrorrrrrXrYr}rXraddrrZ) rrArZlower_suffix_contentsr@rr4r)Znew_namer r r r\s"     zFileFinder._fill_cachecsfdd}|S)aA class method which returns a closure to use on sys.path_hook which will return an instance using the specified loaders and the path called on the closure. If the path called on the closure is not a directory, ImportError is raised. cs$t|std|d|gRS)z-Path hook for importlib.machinery.FileFinder.zonly directories are supportedrG)rRrrGrr[r r path_hook_for_FileFinder=s z6FileFinder.path_hook..path_hook_for_FileFinderr )rr[rar r`r path_hook3s zFileFinder.path_hookcCs d|jS)NzFileFinder({!r}))rXrAr r r r r>EszFileFinder.__repr__)N)rrrrrrErrrrQrr\rrbr>r r r r rTs  3 rTcCs|d}|d}|sB|r$|j}n||kr8t||}n t||}|sTt|||d}z$||d<||d<||d<||d<WntyYn0dS)N __loader____spec__rUZ__file__Z __cached__)getrr'r r Exception)ZnsrZpathnameZ cpathnamerrr r r _fix_up_moduleKs"      rgcCs&ttf}ttf}ttf}|||gS)z_Returns a list of file-based module loaders. Each item is a tuple (loader, suffixes). )rrextension_suffixesr r~r'rp)Z extensionsZsourceZbytecoder r r rbs rc Cs|atjatjatjt}ddgfdddgff}|D]l\}}tdd|DsRJ|d}|tjvrttj|}qq4zt|}WqWq4tyYq4Yq40q4tdt|d |t|d |t|d d |t|d dd|Dgd}|dkr| d|D]4}|tjvr&t|} n tj|} t||| q t|dt t t|dkrt ddt vrdt_dS)zSetup the path-based importers for importlib by importing needed built-in modules and injecting them into the global namespace. Other components are extracted from the core bootstrap module. posixrntrcss|]}t|dkVqdSrrrr r r r r z_setup..rzimportlib requires posix or ntrr;r2r_pathseps_with_coloncSsh|]}d|qSrr rr r r rr z_setup..)rZrbrrrz.pywz_d.pydTN)rrrr6rallZ_builtin_from_namerrr>r=r r,rrhr~rr) _bootstrap_moduleZ self_moduleZ os_detailsZ builtin_osr2r;Z os_moduleZ builtin_namesZ builtin_nameZbuiltin_moduler r r _setupmsF                  rncCs2t|t}tjtj|gtjt dS)z)Install the path-based import components.N) rnrrrJrrTrb meta_pathr=rD)rmZsupported_loadersr r r _installsrp)rV)N)NNN)rr)T)N)N)QrrrZrrbrrZ _MS_WINDOWSrjrrrir2rlr;rr9r>rkrZ%_CASE_INSENSITIVE_PLATFORMS_BYTES_KEYrr r'r,r.rCrJrKrOrPrRrUr^type__code__rr%rr$r)rrsror~rpZDEBUG_BYTECODE_SUFFIXESZOPTIMIZED_BYTECODE_SUFFIXESrxrrrrrrrrrrrrrobjectrrrrrrr r'r,rr-rBrDrTrgrrnrpr r r r s           G(  !  D@H-:?*  9c@sdZdaddZddZiZiZGdddeZGdd d ZGd d d Z Gd d d Z ddZ ddZ ddZ ddddZddZddZddZddZGd d!d!Zddd"d#d$Zd^d%d&Zd'd(d)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3d4Zd5d6ZGd7d8d8ZGd9d:d:ZGd;d<d<Zd=d>Z d?d@Z!d_dAdBZ"dCdDZ#dEZ$e$dFZ%dGdHZ&e'Z(dIdJZ)d`dLdMZ*d'dNdOdPZ+dQdRZ,dadTdUZ-dVdWZ.dXdYZ/dZd[Z0d\d]Z1dS)baSCore implementation of import. This module is NOT meant to be directly imported! It has been designed such that it can be bootstrapped into Python as the implementation of import. As such it requires the injection of specific modules and attributes in order to work. One should use importlib as the public-facing version of this module. NcCs8dD] }t||rt||t||q|j|jdS)z/Simple substitute for functools.update_wrapper.) __module____name__ __qualname____doc__N)hasattrsetattrgetattr__dict__update)ZnewZoldreplacer _wraps r cCs tt|SN)typesysnamer r r _new_module#src@s eZdZdS)_DeadlockErrorN)rrrr r r r r0src@s8eZdZdZddZddZddZdd Zd d Zd S) _ModuleLockzA recursive lock implementation which is able to detect deadlocks (e.g. thread 1 trying to take locks A then B, and thread 2 trying to take locks B then A). cCs0t|_t|_||_d|_d|_d|_dSN)_threadZ allocate_locklockwakeuprownercountwaitersselfrr r r __init__:s   z_ModuleLock.__init__cCsXt}|j}t}t|}|dur*dS|j}||kr.cb) r:r;r<KeyErrorrr2r_weakrefr>r=)rrr?r r r r6s    r6cCs4t|}z |Wnty&Yn 0|dS)zAcquires then releases the module lock for a given module name. This is used to ensure a module is completely initialized, in the event it is being imported by another thread. N)r6r(rr))rrr r r _lock_unlock_modules   rBcOs||i|S)a.remove_importlib_frames in import.c will always remove sequences of importlib frames that end with a call to this function Use it instead of a normal call in places where including the importlib frames introduces unwanted noise into the traceback (e.g. when executing module code) r )fr8Zkwdsr r r _call_with_frames_removedsrDr') verbositycGs6tjj|kr2|dsd|}t|j|tjddS)z=Print the message to stderr if -v/PYTHONVERBOSE is turned on.)#zimport z# )ZfileN)rflagsverbose startswithprintr.stderr)messagerEr8r r r _verbose_messages  rMcsfdd}t||S)z1Decorator to verify the named module is built-in.cs&|tjvrtd||d||S)N{!r} is not a built-in moduler)rbuiltin_module_names ImportErrorr.rfullnamefxnr r _requires_builtin_wrappers   z4_requires_builtin.._requires_builtin_wrapperr )rTrUr rSr _requires_builtins  rWcsfdd}t||S)z/Decorator to verify the named module is frozen.cs&t|std||d||SNz{!r} is not a frozen moduler)r: is_frozenrPr.rQrSr r _requires_frozen_wrappers   z2_requires_frozen.._requires_frozen_wrapperrV)rTrZr rSr _requires_frozens  r[cCs>t||}|tjvr2tj|}t||tj|St|SdS)zLoad the specified module into sys.modules and return it. This method is deprecated. Use loader.exec_module instead. N)spec_from_loaderrmodules_exec_load)rrRspecmoduler r r _load_module_shims      rbcCst|dd}t|dr6z ||WSty4Yn0z |j}WntyRYn0|durdt|Sz |j}Wntyd}Yn0z |j}Wn8ty|durd |YSd ||YSYn0d ||SdS)N __loader__ module_repr? ) rrrd Exception__spec__AttributeError_module_repr_from_specr__file__r.)raloaderr`rfilenamer r r _module_reprs.           rpc@sreZdZdZddddddZddZdd Zed d Zej d d Zed dZ eddZ e j ddZ dS) ModuleSpecaThe specification for a module, used for loading. A module's spec is the source for information about the module. For data associated with the module, including source, use the spec's loader. `name` is the absolute name of the module. `loader` is the loader to use when loading the module. `parent` is the name of the package the module is in. The parent is derived from the name. `is_package` determines if the module is considered a package or not. On modules this is reflected by the `__path__` attribute. `origin` is the specific location used by the loader from which to load the module, if that information is available. When filename is set, origin will match. `has_location` indicates that a spec's "origin" reflects a location. When this is True, `__file__` attribute of the module is set. `cached` is the location of the cached bytecode file, if any. It corresponds to the `__cached__` attribute. `submodule_search_locations` is the sequence of path entries to search when importing submodules. If set, is_package should be True--and False otherwise. Packages are simply modules that (may) have submodules. If a spec has a non-None value in `submodule_search_locations`, the import system will consider modules loaded from the spec as packages. Only finders (see importlib.abc.MetaPathFinder and importlib.abc.PathEntryFinder) should modify ModuleSpec instances. N)origin loader_state is_packagecCs6||_||_||_||_|r gnd|_d|_d|_dS)NF)rrnrrrssubmodule_search_locations _set_fileattr_cached)rrrnrrrsrtr r r r_szModuleSpec.__init__cCsfd|jd|jg}|jdur4|d|j|jdurP|d|jd|jjd|S)Nz name={!r}z loader={!r}z origin={!r}zsubmodule_search_locations={}z{}({})z, ) r.rrnrrappendru __class__rjoin)rr8r r r r1ks    zModuleSpec.__repr__cCsj|j}zH|j|jkoL|j|jkoL|j|jkoL||jkoL|j|jkoL|j|jkWStydtYS0dSr )rurrnrrcached has_locationrkNotImplemented)rZotherZsmslr r r __eq__us      zModuleSpec.__eq__cCs:|jdur4|jdur4|jr4tdur&tt|j|_|jSr )rwrrrv_bootstrap_externalNotImplementedErrorZ _get_cachedr0r r r r{s  zModuleSpec.cachedcCs ||_dSr )rw)rr{r r r r{scCs$|jdur|jddS|jSdS)z The name of the module's parent.N.r)rur rpartitionr0r r r parents zModuleSpec.parentcCs|jSr )rvr0r r r r|szModuleSpec.has_locationcCst||_dSr )boolrv)rvaluer r r r|s) rrrrrr1r~propertyr{setterrr|r r r r rq:s $       rqrrrtcCst|drJtdurttj}|dur0|||dS|r8gnd}||||dS|durt|drz||}Wqtyd}Yq0nd}t||||dS)z5Return a module spec based on various loader methods.Z get_filenameN)rn)rnrurtFr)rrrspec_from_file_locationrtrPrq)rrnrrrtrZsearchr r r r\s$      r\cCs*z |j}WntyYn0|dur*|S|j}|durVz |j}WntyTYn0z |j}Wntyvd}Yn0|dur|durz |j}Wqtyd}Yq0n|}z |j}Wntyd}Yn0zt|j}Wntyd}Yn0t |||d}|durdnd|_ ||_ ||_ |S)NrrFT) rjrkrrcrm_ORIGIN __cached__list__path__rqrvr{ru)rarnrrr`rZlocationr{rur r r _spec_from_modulesH               rFoverridecCs|st|dddur4z |j|_Wnty2Yn0|sHt|dddur|j}|dur|jdurtdurlttj}| |}|j|_ ||_d|_ z ||_ WntyYn0|st|dddurz |j |_WntyYn0z ||_WntyYn0|st|dddurF|jdurFz |j|_WntyDYn0|jr|sft|dddurz |j|_ WntyYn0|st|dddur|jdurz |j|_WntyYn0|S)Nrrc __package__rrmr)rrrrkrnrurr_NamespaceLoader__new__Z_pathrmrcrrrjrr|rrr{r)r`rarrnrr r r _init_module_attrss`                rcCsRd}t|jdr|j|}nt|jdr2td|durDt|j}t|||S)z+Create a module based on the provided spec.N create_module exec_modulezBloaders that define exec_module() must also define create_module())rrnrrPrrrr`rar r r module_from_spec.s    rcCsj|jdurdn|j}|jdurB|jdur2d|Sd||jSn$|jrVd||jSd|j|jSdS)z&Return the repr to use for the module.Nrerfrgrh)rrrrnr.r|)r`rr r r rl?s   rlc Cs|j}t|tj||ur6d|}t||dz|jdurj|jdurZtd|jdt ||ddn4t ||ddt |jds|j |n |j |Wtj |j}|tj|j<ntj |j}|tj|j<0Wdn1s0Y|S)zFExecute the spec's specified module in an existing module's namespace.zmodule {!r} not in sys.modulesrNmissing loaderTrr)rr3rr]r#r.rPrnrurr load_modulerpop)r`rarmsgr r r r^Ps&      ,r^cCsz|j|jWn4|jtjvr@tj|j}|tj|j<Yn0tj|j}|tj|j<t|dddurz |j|_WntyYn0t|dddurz(|j |_ t |ds|j dd|_ WntyYn0t|dddurz ||_ WntyYn0|S)Nrcrrrrrj)rnrrrr]rrrcrkrrrrrjrr r r _load_backward_compatiblens6        rc Cs|jdurt|jdst|St|}d|_z|tj|j<z4|jdur`|jdurlt d|jdn |j |Wn0ztj|j=Wnt yYn0Yn0tj |j}|tj|j<t d|j|jWd|_nd|_0|S)NrTrrzimport {!r} # {!r}F)rnrrrZ _initializingrr]rrurPrr@rrMrr r r _load_unlockeds.       rcCs6t|jt|WdS1s(0YdS)zReturn a new module object, loaded by the spec's loader. The module is not added to its parent. If a module is already in sys.modules, that existing module gets clobbered. N)r3rr)r`r r r r_s r_c@seZdZdZdZeddZedddZeddd Z ed d Z ed d Z ee ddZ ee ddZee ddZeeZdS)BuiltinImporterzMeta path import for built-in modules. All methods are either class or static methods to avoid the need to instantiate the class. zbuilt-incCsd|jdtjdS)sReturn repr for the module. The method is deprecated. The import machinery does the job itself. z)rrr)rar r r rdszBuiltinImporter.module_reprNcCs.|dur dSt|r&t|||jdSdSdSNr)r:Z is_builtinr\rclsrRpathtargetr r r find_specs  zBuiltinImporter.find_speccCs|||}|dur|jSdS)zFind the built-in module. If 'path' is ever specified then the search is considered a failure. This method is deprecated. Use find_spec() instead. N)rrn)rrRrr`r r r find_modules zBuiltinImporter.find_modulecCs.|jtjvr"td|j|jdttj|S)zCreate a built-in modulerNr)rrrOrPr.rDr:Zcreate_builtin)rr`r r r rs   zBuiltinImporter.create_modulecCsttj|dS)zExec a built-in moduleN)rDr:Z exec_builtin)rrar r r rszBuiltinImporter.exec_modulecCsdS)z9Return None as built-in modules do not have code objects.Nr rrRr r r get_codeszBuiltinImporter.get_codecCsdS)z8Return None as built-in modules do not have source code.Nr rr r r get_sourceszBuiltinImporter.get_sourcecCsdS)z4Return False as built-in modules are never packages.Fr rr r r rtszBuiltinImporter.is_package)NN)N)rrrrr staticmethodrd classmethodrrrrrWrrrtrbrr r r r rs,        rc@seZdZdZdZeddZedddZeddd Z ed d Z ed d Z eddZ ee ddZee ddZee ddZdS)FrozenImporterzMeta path import for frozen modules. All methods are either class or static methods to avoid the need to instantiate the class. ZfrozencCsd|jtjS)rr)r.rrr)mr r r rd"szFrozenImporter.module_reprNcCs"t|rt|||jdSdSdSr)r:rYr\rrr r r r+s zFrozenImporter.find_speccCst|r|SdS)z]Find a frozen module. This method is deprecated. Use find_spec() instead. N)r:rY)rrRrr r r r2szFrozenImporter.find_modulecCsdS)z*Use default semantics for module creation.Nr )rr`r r r r;szFrozenImporter.create_modulecCs@|jj}t|s$td||dttj|}t||j dSrX) rjrr:rYrPr.rDget_frozen_objectexecr)rarcoder r r r?s   zFrozenImporter.exec_modulecCs t||S)z_Load a frozen module. This method is deprecated. Use exec_module() instead. )rbrr r r rHszFrozenImporter.load_modulecCs t|S)z-Return the code object for the frozen module.)r:rrr r r rQszFrozenImporter.get_codecCsdS)z6Return None as frozen modules do not have source code.Nr rr r r rWszFrozenImporter.get_sourcecCs t|S)z.Return True if the frozen module is a package.)r:Zis_frozen_packagerr r r rt]szFrozenImporter.is_package)NN)N)rrrrrrrdrrrrrrr[rrrtr r r r rs.        rc@s eZdZdZddZddZdS)_ImportLockContextz$Context manager for the import lock.cCs tdS)zAcquire the import lock.N)r:r;r0r r r r7jsz_ImportLockContext.__enter__cCs tdS)z= 0z__package__ not set to a stringz6attempted relative import with no known parent packagezEmpty module nameN) isinstancestr TypeErrorr.r ValueErrorrPrrrr r r _sanity_checks    rzNo module named z{!r}c Csd}|dd}|r|tjvr*t|||tjvr>tj|Stj|}z |j}Wn0tytd||}t||ddYn0t ||}|durtt||dnt |}|rtj|}|dd}zt |||Wn0tyd|d|}t |tYn0|S)Nrrz; {!r} is not a packagerzCannot set an attribute on z for child module )rrr]rDrrk_ERR_MSGr.ModuleNotFoundErrorrrrrrr) rimport_rrZ parent_modulerr`raZchildr r r _find_and_load_unlockeds4         rcCst|>tj|t}|tur8t||WdSWdn1sL0Y|durtd|}t||dt||S)zFind and load the module.Nz(import of {} halted; None in sys.modulesr) r3rr]r#_NEEDS_LOADINGrr.rrB)rrrarLr r r _find_and_loads 6 rrcCs*t||||dkr t|||}t|tS)a2Import and return the module based on its name, the package the call is being made from, and the level adjustment. This function represents the greatest common denominator of functionality between import_module and __import__. This includes setting __package__ if the loader did not. r)rrr _gcd_importrr r r rs  r recursivec Cs|D]}t|tsB|r"|jd}nd}td|dt|jq|dkrl|st|drt||j|ddqt||sd |j|}zt ||Wqt y}z6|j |krt j |td urWYd }~qWYd }~qd }~00q|S) zFigure out what __import__ should return. The import_ parameter is a callable which takes the name of module to import. It is required to decouple the function from assuming importlib's import implementation is desired. z.__all__z ``from list''zItem in z must be str, not *__all__TrrN)rrrrrr_handle_fromlistrr.rDrrrr]r#r)rafromlistrrxZwhereZ from_nameZexcr r r r s0         rcCs|d}|d}|durR|durN||jkrNtjd|d|jdtdd|S|dur`|jStjd tdd|d }d |vr|d d }|S)zCalculate what __package__ should be. __package__ is not guaranteed to be defined or could be set to None to represent that its proper value is unknown. rrjNz __package__ != __spec__.parent (z != ))Z stacklevelzYcan't resolve package from __spec__ or __package__, falling back on __name__ and __path__rrrr)r#rrrrr)globalsrr`r r r _calc___package__.s*  rr c Cs|dkrt|}n$|dur|ni}t|}t|||}|s|dkrTt|ddS|s\|St|t|dd}tj|jdt|j|Snt|drt||tS|SdS)aImport a module. The 'globals' argument is used to infer where the import is occurring from to handle relative imports. The 'locals' argument is ignored. The 'fromlist' argument specifies what should exist as attributes on the module being imported (e.g. ``from module import ``). The 'level' argument represents the package location to import from in a relative import (e.g. ``from ..pkg import mod`` would have a 'level' of 2). rNrr) rr partitionrrr]rrr) rrlocalsrrraZglobals_rZcut_offr r r __import__Is      rcCs&t|}|durtd|t|S)Nzno built-in module named )rrrPr)rr`r r r _builtin_from_namens  rc Cs|a|att}tjD]H\}}t||r|tjvrs^M%   $e -H%*KO   /  % %#P(intYYYR ( 0 8 @ H P X  P`  Vh  Rp Rt `x 6 D \ l &k /} 0} 1} 2} 3 5R 7r PPVR l v  v firBQ¨ÂĦ Ħ(q0ɦ8ʍ@˽H PX ` h px۲ (+(GRF Q   ]h s(0~8U@(HPX` h p qx=q ivklvmQst|uv| (39RHSYhsyRRRR+}6<RU}`fq}|R(.GR v³vP8^ buf9}obj:len;<>R ?R$@(A^ 0B^ 8C^ @D}HEGz  R  Rd H    J      o tuvwx y(z0{8|@}(H~PX`hpx} PD Hhh} (}08@hH | HO    o     D |   #F $% &R( L (  get set  doc  } W   }    R} %7 & '7 (R= / /R v B  w v   gVV 2   /vq    /vR #   /9v5CN  (% : ; I$ > $ >   I : ;  : ; I8 : ;I8 : ; I !I/ &I : ;  : ; I8 : ;I8 : ; 'II' : ; I8  : ; <4: ; I4: ; I?<4: ; I?!I/VP /usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/usr/include/bits/usr/include./Include./Include/cpythonPythonstddef.htypes.hlibio.hstdio.hpyport.hobject.hobject.hmethodobject.hdescrobject.himport.hfrozen.cimportlib.himportlib_external.himportlib_zipimport.hgetiterfunc__off_tnb_inplace_subtract_IO_read_ptrGNU C 4.8.5 20150623 (Red Hat 4.8.5-44) -mtune=generic -march=x86-64 -g -O3 -std=c99 -fwrapv -fvisibility=hidden_chainreleasebufferproc_shortbufsize_tdestructornb_floor_dividetp_freePyMemberDefnb_xorml_namessize_tsq_lengthobjobjargproc_IO_buf_basemp_ass_subscriptfreefunclong long unsigned intnb_inplace_powerPyObjectob_basePyMappingMethods/usr/local/src/Python-3.9.6tp_memberstp_getattrdescrgetfuncstdoutPyMethodDefnb_inplace_rshiftnb_inplace_multiplyvectorcallfuncPyNumberMethodssigned charnb_positivetp_dictoffsettp_getattronb_subtract_Py_M__importlib_bootstrap_externaltp_as_mappingtp_init_IO_read_endPy_bufferclosure_filenolong int_IO_backup_basetp_methods_flagstp_as_async__ssize_tinitproc_cur_columnlong long inttp_is_gcdouble_old_offset_offsetam_anextsettertp_setattrPyTypeObjectiternextfuncnb_multiply_typeobject__pad2nb_rshiftam_awaitob_typetp_dict_nextwas_sq_slice_IO_markerstdinnb_inplace_remainderunsigned intternaryfuncreadonlysq_inplace_concatlong unsigned inttp_vectorcallshape_IO_write_ptrnamesq_itemnb_inplace_matrix_multiplyndimtp_clearsizeshort unsigned intsq_concatPython/frozen.cml_methtp_itemsize_IO_save_basetp_basicsizeobjobjproc_lockPyAsyncMethods_flags2_modetp_descr_setsq_ass_itemgetattrfuncPyImport_FrozenModuleswas_sq_ass_slicetp_nametp_delsq_repeatdescrsetfuncPyGetSetDefsizetypenb_reserved_frozentp_hashgetbufferproc_IO_write_endvisitprocnb_boolml_flagstp_iternext__off64_tgetattrofunc_objectPyType_Type_IO_FILEtp_itertp_mrogettertp_basefloatinquiry_posbf_releasebuffertp_as_numberbinaryfuncnb_absolute_markersnb_inplace_true_dividetp_descr_getnewfunctp_traversessizeargfunclenfuncPyBufferProcsnb_intunsigned charnb_matrix_multiply_IO_buf_endnb_inplace_lshiftshort inttp_allocnb_divmodM___hello__tp_as_sequencetp_weaklist_vtable_offsetob_sizessizeobjargprocformattp_subclassestraverseproctp_calltp_version_tagtp_reprnb_addtp_newsetattrfunctp_vectorcall_offsettp_strsq_containscharhashfunctp_richcomparetp_doctp_flagsreprfuncnb_inplace_floor_dividenb_andPyCFunctionnb_inplace_orml_docnb_power_IO_lock_ttp_setattrosq_inplace_repeat_IO_read_base_IO_save_endPy_hash_tbufferinfotp_dealloc__pad1PyVarObject__pad3__pad4__pad5tp_cache_unused2itemsizecodeam_aiterPy_ssize_tPySequenceMethods_PyImport_FrozenModulesnb_inplace_andnb_inplace_xorrichcmpfuncmp_lengthnb_negativenb_invertnb_true_dividenb_inplace_addsetattrofuncnb_remaindertp_finalizemp_subscriptunaryfunctp_getset_Py_M__zipimportnb_lshift_Py_M__importlib_bootstrapnb_indextp_basesallocfunc_IO_write_basetp_weaklistoffsetstridestp_as_buffernb_floatsuboffsets_sbufnb_orinternalob_refcntbf_getbufferGCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-44) "     .` qIDSm6Cfrozen.c_PyImport_FrozenModulesM___hello___Py_M__importlib_bootstrap_Py_M__importlib_bootstrap_external_Py_M__zipimport 0-8H7P `Ah xL  5    + A2 &9 @ G 6N e\ a l !y   S L  (   g  . G ! . ; H U b ,o I|     U 6   I  P  W  4  g    , 8  D   + U    s B x      +  ++ 7 mC O [ g s    @ \   w p   a  U ' 3 ? a K kX e r : N  o   9  ] ^     ' 5 > C SR 8^  j } }   =  W   ) yI i     , V Lr  S +  $   X H S ^ i t     p & " . a: F R  e p    h ( 1 4 x@ L X Bd p | |         l$ S0 < H T ` l  x   4  &    z  G v G, /8 E X d J p ;}   ~ ]  &    " . : M X d u   d f  u y + S _ x    @ _  t: k F .symtab.strtab.shstrtab.text.rela.data.bss.rodata.str1.1.rela.rodata.rela.debug_info.debug_abbrev.rela.debug_aranges.debug_line.debug_str.comment.note.GNU-stack@&@ !@,12\E`ie @@ RfTM@؇@^vHqew l@ wZ0x3 0.@@  ~0