U
    f/e                  
   @   s  d 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 ddlmZmZmZmZ ejdkZejdkZejdkZe d	kZejd
kZeeedddZedddZedddZedddZedddZ edddZ!dd Z"dd Z#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
    N)F)is_numpy_devnp_array_datetime64_compatnp_datetime64_compatnp_version_under1p18np_version_under1p19np_version_under1p20)pa_version_under1p0pa_version_under2p0pa_version_under3p0pa_version_under4p0)      )r   	   )r   
   PyPyl        )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-tiezk1ph/pandas/compat/__init__.pyset_function_name%   s    r   )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S )z
    Checking if he running platform use ARM architecture.

    Returns
    -------
    bool
        True if the running platform uses ARM architecture.
    )Zarm64aarch64)r$   machiner   r   r   r   is_platform_arm_   s    	r,   c                  C   s6   zddl } | W S  tk
r0   d}t| Y nX dS )zh
    Importing the `lzma` module.

    Warns
    -----
    When the `lzma` module is not available.
    r   NzCould not import the lzma module. Your installed Python is incomplete. Attempting to use lzma compression will result in a RuntimeError.)lzmaImportErrorwarningswarn)r-   msgr   r   r   import_lzmak   s    r2   c                 C   s   | dkrt d| 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.
    Nzslzma module not available. A Python re-install with the proper dependencies, might be required to solve this issue.)RuntimeErrorLZMAFile)r-   r   r   r   get_lzma_file   s
    r5   r   r   r   r   r   r   r	   r
   r   r   )%__doc__r$   r   r/   Zpandas._typingr   Zpandas.compat.numpyr   r   r   r   r   r   Zpandas.compat.pyarrowr	   r
   r   r   version_infoZPY38ZPY39ZPY310python_implementationZPYPYmaxsizeZIS64strr   boolr    r%   r'   r)   r,   r2   r5   __all__r   r   r   r   <module>   s<   	 




