U
    >vf                     @  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 ddlZddlmZmZ ddlmZmZmZmZ dd	dd
ddZddddZddddZddddZddddZddddZddddZddddZddddZ d d!d"d#d$d%d&d'd(d)d*gZ!dS )+zn
compat
======

Cross-compatible functions for different versions of Python.

Other items:
* platform checker
    )annotationsN)F)IS64PY39PY310PY311PYPY)is_numpy_devnp_version_under1p21)pa_version_under7p0pa_version_under8p0pa_version_under9p0pa_version_under11p0r   str)fnamereturnc                 C  s$   || _ |j  d| | _|j| _| S )z<
    Bind the name/qualname attributes of the function.
    .)__name____qualname__
__module__)r   r   cls r   :/tmp/pip-unpacked-wheel-vdrwu74i/pandas/compat/__init__.pyset_function_name%   s    r   bool)r   c                   C  s
   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/   s    	r   c                   C  s
   t jdk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_windows;   s    	r$   c                   C  s
   t jdkS )z
    Checking if the running platform is linux.

    Returns
    -------
    bool
        True if the running platform is linux.
    linuxr"   r   r   r   r   is_platform_linuxG   s    	r&   c                   C  s
   t jdkS )z
    Checking if the running platform is mac.

    Returns
    -------
    bool
        True if the running platform is mac.
    darwinr"   r   r   r   r   is_platform_macS   s    	r(   c                   C  s   t  dkpt  dS )z
    Checking if the running platform use ARM architecture.

    Returns
    -------
    bool
        True if the running platform uses ARM architecture.
    )Zarm64aarch64Zarmv)r#   machine
startswithr   r   r   r   is_platform_arm_   s    	r,   c                   C  s   t  dkS )z
    Checking if the running platform use Power architecture.

    Returns
    -------
    bool
        True if the running platform uses ARM architecture.
    )ppc64ppc64le)r#   r*   r   r   r   r   is_platform_powerm   s    	r/   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_environmenty   s    
r5   z(type[pandas.compat.compressors.LZMAFile]c                   C  s   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compatZcompressorsZhas_lzmaRuntimeErrorLZMAFiler   r   r   r   get_lzma_file   s
    
r:   r	   r
   r   r   r   r   r   r   r   r   r   )"__doc__
__future__r   r2   r#   r   Zpandas._typingr   Zpandas.compat._constantsr   r   r   r   r   Zpandas.compat.compressorsr6   Zpandas.compat.numpyr	   r
   Zpandas.compat.pyarrowr   r   r   r   r   r   r$   r&   r(   r,   r/   r5   r:   __all__r   r   r   r   <module>   s<   	
