§
    %xÅjz  ã                   ól   — d Z ddlZddlZg d¢Zg d¢Zdedz  fd„Zdefd„Zdefd„Z	defd	„Z
defd
„ZdS )zThe bag of utility functions.é    N)ÚdumbÚ N)ÚDATALORE_AGENT_MODEÚDATALORE_HOMEÚDATALORE_USERÚreturnc                  ó¦   — t           j                             dd¦  «        } | €dS |                      ¦   «                              ¦   «         } | dv r| S dS )a'  Get forced progress rendering mode from environment.

    Supported values:

    - ``auto``: Use the normal automatic detection
    - ``stdout``: Force plain terminal/stdout tqdm
    - ``logging``: Force logging-based tqdm

    The value is case-insensitive.
    Invalid values are ignored.
    ÚTQDM_LOGGABLE_FORCEN>   ÚautoÚstdoutÚlogging)ÚosÚenvironÚgetÚstripÚlower)Úvalues    úDC:\Projects\Historical\venv\Lib\site-packages\tqdm_loggable/utils.pyÚget_forced_progress_moder      sS   € õ  ŒJ�NŠNÐ0°$Ñ7Ô7€EØ€}Øˆtà�KŠK‰MŒM×ÒÑ!Ô!€EØÐ-Ð-Ð-Øˆàˆ4ó    c                  ó  — t          ¦   «         rdS t          ¦   «         rdS t          j                             ¦   «         sdS t
          j                             dd¦  «        } | r|                      ¦   «         } | t          v rdS dS )zIGuess if we are an interactive session and can render real progress bars.TFÚTERMN)
Úis_notebookÚis_continous_integrationÚsysr   Úisattyr   r   r   r   ÚNON_INTERACTIVE_TERM_VALUES)Úterms    r   Úis_interactive_sessionr   9   sƒ   € õ �}„}ð ØˆtåÑ!Ô!ð ØˆuåŒ:×ÒÑÔð ØˆuåŒ:�>Š>˜& $Ñ'Ô'€DØð Ø�zŠz‰|Œ|ˆàÕ*Ð*Ð*Øˆuàˆ4r   c                  óv   — 	 ddl m}  d | ¦   «         j        vrdS n# t          $ r Y dS t          $ r Y dS w xY wdS )z3Guess if we are an in Jupyter notebook environment.r   ©Úget_ipythonÚIPKernelAppFT)ÚIPythonr"   ÚconfigÚImportErrorÚAttributeErrorr!   s    r   r   r   O   sw   € ðØ'Ð'Ð'Ð'Ð'Ð'Ø  ¡¤Ô 4Ð4Ð4Ø�5ð 5øåð ð ð ØˆuˆuÝð ð ð Øˆuˆuðøøøàˆ4s   ‚ œ
6©	6µ6c                  ó   — dt           j        v S )a(  Disable progress bars in continous integration systems.

    Github Actions (and other CI) may allocate an interactive
    terminal for a job. However, in case of Github,
    they do not seem to be able to refresh the progress bar correctly,
    floooding the CI log with progress bar lines.
    ÚCI)r   r   © r   r   r   r   ]   s   € ð •2”:ÐÐr   c                  óŠ   — t           j                             dd¦  «        dk    rdS t          d„ t          D ¦   «         ¦  «        S )a³  Guess if we are in a session where only stdout is available.

    Datalore is an example of such environment. Datalore provides code autocompletion
    and documentation pop ups, as well as other features that make it desirable to use.
    See https://www.jetbrains.com/datalore/

    A code report has been privately logged to Datalore support for enquiring about the
    feature disparity between Datalore and Jupyter Notebooks.
    ÚAGENT_MANAGER_HOSTNÚdataloreTc              3   óT   K  — | ]#}t           j                             |¦  «        V — Œ$d S )N)r   r   r   )Ú.0Únames     r   ú	<genexpr>z)is_stdout_only_session.<locals>.<genexpr>v   s0   è è € ÐBÐB¨�rŒz�~Š~˜dÑ#Ô#ÐBÐBÐBÐBÐBÐBr   )r   r   r   ÚanyÚDATALORE_ENV_VARSr*   r   r   Úis_stdout_only_sessionr4   i   sC   € õ 
„z‡~‚~Ð*¨DÑ1Ô1°ZÒ?Ð?ØˆtåÐBÐBÕ0AÐBÑBÔBÑBÔBÐBr   )Ú__doc__r   r   r   r3   Ústrr   Úboolr   r   r   r4   r*   r   r   ú<module>r8      sÙ   ðØ #Ð #à 	€	€	€	Ø 
€
€
€
ð 1Ð0Ð0Ð ðð ð Ð ð #¨¡*ð ð ð ð ð6 ð ð ð ð ð,�Tð ð ð ð ð	 $ð 	ð 	ð 	ð 	ðC ð Cð Cð Cð Cð Cð Cr   