HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/numpy/compat/__pycache__/py3k.cpython-310.pyc
o

���g��@s�dZgd�ZddlZddlZddlmZddlZzddlZWn
e	y+ddlZYnwe
Ze
fZe
Ze
ZeZdd�Zdd�Zd	d
�Zdd�Zddd�Zdd�ZdZdd�Zdd�Zdd�Zdd�ZGdd�d�Zd dd�ZejZej Z!dS)!a�
Python 3.X compatibility tools.

While this file was originally intended 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)rcC�t|t�r
|�d�St|�S�N�latin1��
isinstancer�decode�str��s�r!�</usr/local/lib/python3.10/dist-packages/numpy/compat/py3k.pyr"�

rcCst|t�r|St|��d�Sr)rrr�encoderr!r!r"r's
rcCrrrrr!r!r"r
,r#r
cCs>t|tjtjtjf�s
dSz|��WdStyYdSw)NFT)r�io�FileIO�BufferedReader�BufferedWriter�fileno�OSError)�fr!r!r"r1s�r�rcCst||dd�S)Nz
iso-8859-1)�mode�encoding)�open)�filenamer-r!r!r"r<srcCs|S�Nr!rr!r!r"r?�r�UcCst��dS)N�)�sys�exc_infor!r!r!r"rDsrcC�.t|d�rt|ttf�sdd�|D�St|�S)N�__iter__cS�g|]}t|��qSr!)r��.0�yr!r!r"�
<listcomp>I�z"asbytes_nested.<locals>.<listcomp>)�hasattrrrrr��xr!r!r"rG�rcCr7)Nr8cSr9r!)r	r:r!r!r"r=Or>z$asunicode_nested.<locals>.<listcomp>)r?rrrrr@r!r!r"r	MrBr	cCs
t|t�S)z�
    Check whether obj is a `pathlib.Path` object.

    Prefer using ``isinstance(obj, os.PathLike)`` instead of this function.
    )rr)�objr!r!r"rSs
rc@s*eZdZdZd	dd�Zdd�Zdd�ZdS)
ra�Context 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

    .. note::
        Prefer using `contextlib.nullcontext` instead of this context manager.
    NcCs
||_dSr1��enter_result)�selfrEr!r!r"�__init__js
zcontextlib_nullcontext.__init__cCs|jSr1rD)rFr!r!r"�	__enter__msz contextlib_nullcontext.__enter__cGsdSr1r!)rF�excinfor!r!r"�__exit__pr2zcontextlib_nullcontext.__exit__r1)�__name__�
__module__�__qualname__�__doc__rGrHrJr!r!r!r"r\s


rcCsddlm}|||���S)a�
    Load a module. Uses ``load_module`` which will be deprecated in python
    3.12. An alternative that uses ``exec_module`` is in
    numpy.distutils.misc_util.exec_mod_from_location

    .. 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

    r)�SourceFileLoader)�importlib.machineryrO�load_module)�name�fn�inforOr!r!r"rtsr)r,r1)"rN�__all__r5�os�pathlibrr%�pickle5r�ImportError�intrrrr
rrrrr
rrrrrrr	rrr�fspathr�PathLikerr!r!r!r"�<module>s>�