a
    é´«j  ã                   @  s¬   d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dlm	Z	 e	rXd dl
mZ d dlmZmZmZ ddœdd	„Zd
dœdd„Zd
dœdd„Zddddœdd„ZdS )é    )ÚannotationsN)ÚTYPE_CHECKING)ÚJSONSerializable)ÚVERSIONSÚget_versionÚimport_optional_dependencyz
str | None)Úreturnc                  C  sD   zddl m}  | W S  ty>   ddlm} |ƒ }|d  Y S 0 dS )za
    Use vendored versioneer code to get git hash, which handles
    git worktree correctly.
    r   )Ú__git_version__)Úget_versionszfull-revisionidN)Zpandas._version_mesonr	   ÚImportErrorZpandas._versionr
   )r	   r
   Úversions© r   úZ/var/www/html/laksyashrimp/venv/lib/python3.9/site-packages/pandas/util/_print_versions.pyÚ_get_commit_hash   s    r   zdict[str, JSONSerializable]c                  C  sd   t  ¡ } t ¡ \}}tƒ t  ¡ t d¡d | j| j	| j
| j| jtjtj d¡tj d¡||dœdœS )zG
    Returns system information as a JSON serializable dictionary.
    ÚPé   ÚLC_ALLÚLANG)úlanguage-codeÚencoding)ÚcommitÚpythonzpython-bitsZOSz
OS-releaseÚVersionÚmachineÚ	processorÚ	byteorderr   r   ÚLOCALE)ÚplatformÚunameÚlocaleÚ	getlocaler   Úpython_versionÚstructÚcalcsizeÚsystemÚreleaseÚversionr   r   Úsysr   ÚosÚenvironÚget)Úuname_resultÚlanguage_coder   r   r   r   Ú_get_sys_info'   s    

ôr-   c               	   C  sh   g d¢} |   ttƒ¡ i }| D ]D}zt|dd�}W n tyL   d||< Y q0 |rZt|ƒnd||< q|S )zK
    Returns dependency information as a JSON serializable dictionary.
    )ZpandasÚnumpyZpytzZdateutilÚpipÚCythonZsphinxZIPythonÚignore)ÚerrorszN/AN)ÚextendÚlistr   r   Ú	Exceptionr   )ÚdepsÚresultÚmodnameÚmodr   r   r   Ú_get_dependency_info=   s    r:   Fz
str | boolÚNone)Úas_jsonr   c           
      C  sL  t ƒ }tƒ }| rˆ||dœ}| du r:tj tj|dd�¡ nLt| tƒsHJ ‚t	| ddd�� }tj
||dd� W d  ƒ n1 s|0    Y  nÀt|d	 tƒsšJ ‚|d	 d
 }|d	 d }|› d|› �|d	< tdd„ |D ƒƒ}tdƒ tdƒ | ¡ D ]"\}}	t|d|› �›d|	› �ƒ qîtdƒ | ¡ D ]$\}}	t|d|› �›d|	› �ƒ �q"dS )a¼  
    Provide useful information, important for bug reports.

    It comprises info about hosting operation system, pandas version,
    and versions of other installed relative packages.

    Parameters
    ----------
    as_json : str or bool, default False
        * If False, outputs info in a human readable form to the console.
        * If str, it will be considered as a path to a file.
          Info will be written to that file in JSON format.
        * If True, outputs info in JSON format to the console.

    Examples
    --------
    >>> pd.show_versions()  # doctest: +SKIP
    Your output may look something like this:
    INSTALLED VERSIONS
    ------------------
    commit           : 37ea63d540fd27274cad6585082c91b1283f963d
    python           : 3.10.6.final.0
    python-bits      : 64
    OS               : Linux
    OS-release       : 5.10.102.1-microsoft-standard-WSL2
    Version          : #1 SMP Wed Mar 2 00:30:59 UTC 2022
    machine          : x86_64
    processor        : x86_64
    byteorder        : little
    LC_ALL           : None
    LANG             : en_GB.UTF-8
    LOCALE           : en_GB.UTF-8
    pandas           : 2.0.1
    numpy            : 1.24.3
    ...
    )r$   ÚdependenciesTé   )ÚindentÚwzutf-8)r   Nr   r   r   Ú.c                 s  s   | ]}t |ƒV  qd S )N)Úlen)Ú.0Úxr   r   r   Ú	<genexpr>–   ó    z show_versions.<locals>.<genexpr>z
INSTALLED VERSIONSz------------------ú<z: Ú )r-   r:   r'   ÚstdoutÚ
writelinesÚjsonÚdumpsÚ
isinstanceÚstrÚopenÚdumpÚdictÚmaxÚprintÚitems)
r<   Zsys_infor6   ÚjÚfr,   r   ÚmaxlenÚkÚvr   r   r   Úshow_versions^   s*    %
0rZ   )F)Ú
__future__r   rK   r   r(   r   r"   r'   Útypingr   Zpandas._typingr   Zpandas.compat._optionalr   r   r   r   r-   r:   rZ   r   r   r   r   Ú<module>   s   !