U ã€C^¹ã@s8dZddddddddd d d d d dddddddddgZddlZddlZzddlmZmZWnek rtdZZYnXejddk�rddl Z z ddl Z Wnek r¶ddl Z YnXe Z e fZeZeZeZdd„Zdd„Zdd „Zdd„Zd;d d „Zd!d„Zd"ZnNddlZ eZe Z eZeZe e fZeZeZd#Zd$d„Zd%d„Zdd0d„Z!ddl"Z"ejdd1…d2k�rÞe"j#Z$ne" %d3efd4d5i¡Z$ejdd1…d6k�rej&Z'ej(Z)n d7d8„Z*Gd9d„de$ƒZ)d:d„Z'dS)?a³ Python 3.X compatibility tools. While this file was originally intented for Python 2 -> 3 transition, it is now used to create a compatibility layer between different minor versions of Python 3. While the active version of numpy may not support a given version of python, we allow downstream libraries to continue to use these shims for forward compatibility with numpy while they transition their code to newer versions of Python. ÚbytesÚasbytesÚ isfileobjÚ getexceptionÚstrcharÚunicodeÚ asunicodeÚasbytes_nestedÚasunicode_nestedÚasstrÚ open_latin1ÚlongÚ basestringÚsixuÚ integer_typesÚis_pathlib_pathÚnpy_load_moduleÚPathÚpickleÚcontextlib_nullcontextÚ os_fspathÚ os_PathLikeéN)rÚPurePathécCst|tƒr| d¡St|ƒS©NÚlatin1©Ú isinstancerÚdecodeÚstr©Ús©r"ú4/tmp/pip-install-6_kvzl1k/numpy/numpy/compat/py3k.pyr(s  cCst|tƒr|St|ƒ d¡Sr)rrrÚencoder r"r"r#r-s cCst|tƒr| d¡St|ƒSrrr r"r"r#r 2s  cCst|tjtjtjfƒS©N)rÚioÚFileIOÚBufferedReaderÚBufferedWriter©Úfr"r"r#r7sÚrcCst||dd�S)Nz iso-8859-1)ÚmodeÚencoding©Úopen©Úfilenamer-r"r"r#r :scCs|Sr%r"r r"r"r#r=sÚUÚScCs t|tƒSr%)rÚfiler*r"r"r#rNscCst|tƒr|St|ƒ d¡S)NÚascii)rrrrr r"r"r#rQs cCs t||d�S)N)r-r/r1r"r"r#r VscCs t|dƒS)NZunicode_escape)rr r"r"r#rYscCs t ¡dS)Né)ÚsysÚexc_infor"r"r"r#r\scCs2t|dƒr&t|ttfƒs&dd„|DƒSt|ƒSdS)NÚ__iter__cSsg|] }t|ƒ‘qSr")r©Ú.0Úyr"r"r#Ú asz"asbytes_nested..)Úhasattrrrrr©Úxr"r"r#r_scCs2t|dƒr&t|ttfƒs&dd„|DƒSt|ƒSdS)Nr:cSsg|] }t|ƒ‘qSr")r r;r"r"r#r>gsz$asunicode_nested..)r?rrrrr@r"r"r#r escCstdk ot|tƒS)z€ Check whether obj is a pathlib.Path object. Prefer using `isinstance(obj, os_PathLike)` instead of this function. N)rr)Úobjr"r"r#rksc@s*eZdZdZd dd„Zdd„Zdd„ZdS) raOContext manager that does no additional processing. Used as a stand-in for a normal context manager, when a particular block of code is only sometimes used with a normal context manager: cm = optional_cm if condition else nullcontext() with cm: # Perform operation, using optional_cm if condition is True NcCs ||_dSr%©Ú enter_result)ÚselfrDr"r"r#Ú__init__szcontextlib_nullcontext.__init__cCs|jSr%rC©rEr"r"r#Ú __enter__‚sz contextlib_nullcontext.__enter__cGsdSr%r")rEÚexcinfor"r"r#Ú__exit__…szcontextlib_nullcontext.__exit__)N)Ú__name__Ú __module__Ú __qualname__Ú__doc__rFrHrJr"r"r"r#rts r7écCsddl}|j ||¡ ¡S)ad Load a module. .. versionadded:: 1.11.2 Parameters ---------- name : str Full module name. fn : str Path to module file. info : tuple, optional Only here for backward compatibility with Python 2.*. Returns ------- mod : module rN)Úimportlib.machineryÚ machineryÚSourceFileLoaderÚ load_module)ÚnameÚfnÚinfoÚ importlibr"r"r#rŠscCsdddl}|dkr2tj |¡}| ||g¡\}}}nt||dƒ}z| ||||¡}W5| ¡X|S)a} Load a module. .. versionadded:: 1.11.2 Parameters ---------- name : str Full module name. fn : str Path to module file. info : tuple, optional Information as returned by `imp.find_module` (suffix, mode, type). Returns ------- mod : module rNr7)ÚimpÚosÚpathÚdirnameÚ find_moduler0ÚcloserS)rTrUrVrXrZÚfoÚmodr"r"r#r¡s  é)rrOÚABCÚ __slots__r")récCst|ƒSr%)rrGr"r"r#Ú_PurePath__fspath__Ïsrdc@s*eZdZdZejdd„ƒZedd„ƒZdS)rzCAbstract base class for implementing the file system path protocol.cCst‚dS)z9Return the file system path representation of the object.N)ÚNotImplementedErrorrGr"r"r#Ú __fspath__Õszos_PathLike.__fspath__cCs tdk rt|tƒrdSt|dƒS)NTrf)rÚ issubclassr?)ÚclsÚsubclassr"r"r#Ú__subclasshook__Úszos_PathLike.__subclasshook__N) rKrLrMrNÚabcÚabstractmethodrfÚ classmethodrjr"r"r"r#rÒs  cCs¦t|ttfƒr|St|ƒ}z| |¡}WnNtk rvt|dƒrF‚n,tdk rdt|tƒrdt |ƒYSt d|j ƒ‚YnXt|ttfƒrŠ|St d  |j t|ƒj ¡ƒ‚dS)atReturn the path representation of a path-like object. If str or bytes is passed in, it is returned unchanged. Otherwise the os.PathLike interface is used to get the path representation. If the path representation is not str or bytes, TypeError is raised. If the provided path is not str, bytes, or os.PathLike, TypeError is raised. rfNz/expected str, bytes or os.PathLike object, not z7expected {}.__fspath__() to return str or bytes, not {}) rrrÚtyperfÚAttributeErrorr?rrgrdÚ TypeErrorrKÚformat)rZÚ path_typeÚ path_reprr"r"r#rás&  ÿ þ)r,)r,)N)N)+rNÚ__all__r8rYÚpathlibrrÚ ImportErrorÚ version_infor&Zpickle5rÚintr rrr rrrrr rr rrZcpicklerrr rÚobjectrrrkraZabc_ABCÚABCMetaÚfspathrÚPathLikerrdr"r"r"r#Ús” ü       "