
    tni	                     R    d Z ddlZddlZg 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returnc                     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sysstdoutisattyosenvirongetlowerNON_INTERACTIVE_TERM_VALUES)terms    P/var/www/html/gpu-tools/venv/lib/python3.11/site-packages/tqdm_loggable/utils.pyis_interactive_sessionr      s     }} t!! u: u:>>&$''D zz||***u4    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   *   sw    '''''' 4445 5   uu   uu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	   8   s     2:r   c                  J    t           j                            dd          dk    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datalore)r   r   r   r    r   r   is_stdout_only_sessionr$   D   s      :>>.55CCr   )	__doc__r   r
   r   boolr   r   r	   r$   r    r   r   <module>r'      s    # # 				 



 100     ,T    	$ 	 	 	 	
D 
D 
D 
D 
D 
D 
Dr   