o
    Eh                     @  s(  d Z ddlmZ ddlZddlZddlZddlmZ ddlm	Z	m
Z
mZmZmZmZmZmZ ddlZddlmZ ddlmZmZmZmZmZmZmZmZmZmZm Z m!Z! er\ddl"m#Z# d(ddZ$d)ddZ%d)ddZ&d)ddZ'd)ddZ(d)ddZ)d)ddZ*d)dd Z+d*d"d#Z,d+d%d&Z-g d'Z.dS ),zn
compat
======

Cross-compatible functions for different versions of Python.

Other items:
* platform checker
    )annotationsN)TYPE_CHECKING)IS64ISMUSLPY310PY311PY312PY314PYPYWARNING_CHECK_DISABLED)is_numpy_dev)HAS_PYARROWpa_version_under10p1pa_version_under11p0pa_version_under13p0pa_version_under14p0pa_version_under14p1pa_version_under16p0pa_version_under17p0pa_version_under18p0pa_version_under19p0pa_version_under20p0pa_version_under21p0)Ffr   namestrclstypereturnc                 C  s$   || _ |j  d| | _|j| _| S )z<
    Bind the name/qualname attributes of the function.
    .)__name____qualname__
__module__)r   r   r    r$   6lib/python3.10/site-packages/pandas/compat/__init__.pyset_function_name0   s   r&   boolc                   C  
   t jdkS )z
    Checking if the running platform is little endian.

    Returns
    -------
    bool
        True if the running platform is little endian.
    little)sys	byteorderr$   r$   r$   r%   is_platform_little_endian:      
	r,   c                   C  s
   t jdv S )z
    Checking if the running platform is windows.

    Returns
    -------
    bool
        True if the running platform is windows.
    )win32cygwinr*   platformr$   r$   r$   r%   is_platform_windowsF   r-   r2   c                   C  r(   )z
    Checking if the running platform is linux.

    Returns
    -------
    bool
        True if the running platform is linux.
    Zlinuxr0   r$   r$   r$   r%   is_platform_linuxR   r-   r3   c                   C  r(   )z
    Checking if the running platform is mac.

    Returns
    -------
    bool
        True if the running platform is mac.
    darwinr0   r$   r$   r$   r%   is_platform_mac^   r-   r5   c                   C  s   t  dv pt  dS )z
    Checking if the running platform use ARM architecture.

    Returns
    -------
    bool
        True if the running platform uses ARM architecture.
    )Zarm64Zaarch64Zarmv)r1   machine
startswithr$   r$   r$   r%   is_platform_armj   s   	r8   c                   C  s   t  dv S )z
    Checking if the running platform use Power architecture.

    Returns
    -------
    bool
        True if the running platform uses ARM architecture.
    )Zppc64Zppc64le)r1   r6   r$   r$   r$   r%   is_platform_powerx   s   	r9   c                   C  s   t jdddkS )z
    Checking if running in a continuous integration environment by checking
    the PANDAS_CI environment variable.

    Returns
    -------
    bool
        True if the running in a continuous integration environment.
    Z	PANDAS_CI01)osenvirongetr$   r$   r$   r%   is_ci_environment   s   
r?   (type[pandas.compat.compressors.LZMAFile]c                   C     t jjjs	tdt jjjS )a
  
    Importing the `LZMAFile` class from the `lzma` module.

    Returns
    -------
    class
        The `LZMAFile` class from the `lzma` module.

    Raises
    ------
    RuntimeError
        If the `lzma` module was not imported correctly, or didn't exist.
    zslzma module not available. A Python re-install with the proper dependencies, might be required to solve this issue.)pandascompatcompressorsZhas_lzmaRuntimeErrorLZMAFiler$   r$   r$   r%   get_lzma_file   
   

rG   'type[pandas.compat.compressors.BZ2File]c                   C  rA   )a  
    Importing the `BZ2File` class from the `bz2` module.

    Returns
    -------
    class
        The `BZ2File` class from the `bz2` module.

    Raises
    ------
    RuntimeError
        If the `bz2` module was not imported correctly, or didn't exist.
    zrbz2 module not available. A Python re-install with the proper dependencies, might be required to solve this issue.)rB   rC   rD   Zhas_bz2rE   BZ2Filer$   r$   r$   r%   get_bz2_file   rH   rK   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r	   r
   r   )r   r   r   r   r   r   r   r   )r   r'   )r   r@   )r   rI   )/__doc__Z
__future__r   r<   r1   r*   typingr   Zpandas.compat._constantsr   r   r   r   r   r	   r
   r   Zpandas.compat.compressorsrB   Zpandas.compat.numpyr   Zpandas.compat.pyarrowr   r   r   r   r   r   r   r   r   r   r   r   Zpandas._typingr   r&   r,   r2   r3   r5   r8   r9   r?   rG   rK   __all__r$   r$   r$   r%   <module>   s.    	(
8










