o
    Zh                     @   s&  U d dl Z d dlZd dlmZ d dlmZmZ dadd Zze j	dkr%e
d dlmZmZ d d	lmZ d
d ZW n e
yH   G dd dZY nw e Ze Ze ZdZdZdZdZeeeegdf  ed< d ae add Zdd Zed!ddZddddZddddZdd Z dd  Z!dS )"    N)contextmanager)CallableOptionalFc                   C   s   dS )z
    Lazily init colorama if necessary, not to screw up stdout if debugging is
    not enabled.

    This version of the function does nothing.
    N r   r   r   A/var/www/html/lang_env/lib/python3.10/site-packages/jedi/debug.py_lazy_colorama_init	   s    r   nt)Foreinit)
initialisec                   C   s@   t sdt_z
tdd W da dS  ty   Y da dS w da dS )z
            Lazily init colorama if necessary, not to screw up stdout is
            debug not enabled.

            This version of the function does init colorama.
            TF)stripN)_initedr   Zatexit_doner
   	Exceptionr   r   r   r   r      s   c                   @   s$   e Zd ZdZdZdZdZdZdZdS )r	    N)	__name__
__module____qualname__REDGREENYELLOWMAGENTARESETZBLUEr   r   r   r   r	   1   s    r	   debug_functionc                   C   s   t   adad S )Nr   )time_start_time_debug_indentr   r   r   r   
reset_timeG   s   r   c                    s    fdd}|S )zDecorator for makin c                     s8   t    | i |W  d    S 1 sw   Y  d S N)increase_indent_cm)argskwargsfuncr   r   wrapperO   s   $z increase_indent.<locals>.wrapperr   )r"   r#   r   r!   r   increase_indentM   s   r$   r   c              
   c   sl    | rt d|  |d td7 azd V  W td8 a| r$t d|  |d d S d S td8 a| r5t d|  |d w w )NzStart: color   zEnd: )dbgr   )titler&   r   r   r   r   U   s   r   r   r%   c                G   sN   |sJ t r#tr%dt }t  t ||d | tdd |D    dS dS dS )zB Looks at the stack, to see if a debug message should be printed.  zdbg: c                 s       | ]}t |V  qd S r   repr.0ar   r   r   	<genexpr>j       zdbg.<locals>.<genexpr>N)r   enable_noticer   r   tuple)messager&   r   ir   r   r   r(   c   s   (r(   T)formatc                G   sH   t r tr"dt }|r| tdd |D  } t d|d |   d S d S d S )Nr*   c                 s   r+   r   r,   r.   r   r   r   r1   q   r2   zwarning.<locals>.<genexpr>r   z	warning: )r   enable_warningr   r4   )r5   r7   r   r6   r   r   r   warningm   s   r9   c                 C   sB   t rtrt }dt }t d|d d| |t f   d S d S d S )Nr*   r   zspeed: z%s %s)r   enable_speedr   r   r   )namenowr6   r   r   r   speedu   s
   "r=   c                 C   s&   t t| }t  t|| tj  dS )z
    The default debug function that prints to standard out.

    :param str color: A string that is an attribute of ``colorama.Fore``.
    N)getattrr	   r   printr   )r&   Zstr_outcolr   r   r   print_to_stdout|   s   
rA   )Nr   )"osr   
contextlibr   typingr   r   r   r   r;   ImportErrorZcoloramar	   r
   r   objectZNOTICEWARNINGZSPEEDr:   r8   r3   r   str__annotations__r   r   r   r$   r   r(   r9   r=   rA   r   r   r   r   <module>   s@   
 	
	
