o
    Û­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	r,d dl
mZ d dlmZmZmZ ddd	„Zddd„Zddd„Zdddd„ZdS )é    )ÚannotationsN)ÚTYPE_CHECKING)ÚJSONSerializable)ÚVERSIONSÚget_versionÚimport_optional_dependencyÚreturnú
str | Nonec                  C  s@   z	ddl m}  | W S  ty   ddlm} |ƒ }|d  Y S w )za
    Use vendored versioneer code to get git hash, which handles
    git worktree correctly.
    r   )Ú__git_version__)Úget_versionszfull-revisionid)Úpandas._version_mesonr
   ÚImportErrorÚpandas._versionr   )r
   r   Úversions© r   úX/var/www/html/CropPilot/venv/lib/python3.10/site-packages/pandas/util/_print_versions.pyÚ_get_commit_hash   s   ür   ú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-bitsÚ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   

ôr2   c               	   C  sh   g d¢} |   ttƒ¡ i }| D ]"}zt|dd�}W n ty&   d||< Y qw |r-t|ƒnd||< q|S )zK
    Returns dependency information as a JSON serializable dictionary.
    )ÚpandasÚnumpyÚpytzÚdateutilÚpipÚCythonÚsphinxÚIPythonÚignore)ÚerrorszN/AN)ÚextendÚlistr   r   Ú	Exceptionr   )ÚdepsÚresultÚmodnameÚmodr   r   r   Ú_get_dependency_info=   s   þrD   FÚas_jsonú
str | boolÚNonec           
      C  sP  t ƒ }tƒ }| rG||dœ}| du rtj tj|dd�¡ dS t| tƒs%J ‚t	| ddd��}tj
||dd� W d  ƒ dS 1 s@w   Y  dS t|d	 tƒsPJ ‚|d	 d
 }|d	 d }|› d|› �|d	< tdd„ |D ƒƒ}tdƒ tdƒ | ¡ D ]\}}	t|d|› �›d|	› �ƒ qzt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>–   s   € z show_versions.<locals>.<genexpr>z
INSTALLED VERSIONSz------------------ú<z: Ú )r2   rD   r,   ÚstdoutÚ
writelinesÚjsonÚdumpsÚ
isinstanceÚstrÚopenÚdumpÚdictÚmaxÚprintÚitems)
rE   Úsys_infor@   ÚjÚfr1   r   ÚmaxlenÚkÚvr   r   r   Úshow_versions^   s.   %
"ÿÿre   )r   r	   )r   r   )F)rE   rF   r   rG   )Ú
__future__r   rU   r$   r-   r"   r'   r,   Útypingr   Úpandas._typingr   Úpandas.compat._optionalr   r   r   r   r2   rD   re   r   r   r   r   Ú<module>   s    


!