
    Mh&                         d dl Z d dlZd dlZedfdZ G d de          Z G d de          Zdd	Z	dd
Z
ddZddZddZd Zd Zd ZdS )    Nevalc                 Z    t          | |d          }t          |i t          j                  S )Nr   )compiler   sysmodules)codepathmodeexprs       S/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/debugpy/common/util.pyevaluater   
   s)    
 4v&&Db#+&&&    c                   ,     e Zd ZdZdZd Z fdZ xZS )
Observablez$An object with change notifications. c                     g | _         d S N)	observers)selfs    r   __init__zObservable.__init__   s    r   c                     	 t                                          ||          | j        D ]} || |           S # | j        D ]} || |           w xY wr   )super__setattr__r   )r   namevalueob	__class__s       r   r   zObservable.__setattr__   sp    	77&&tU33n  4dn  4s	   !; A)__name__
__module____qualname____doc__r   r   r   __classcell__)r   s   @r   r   r      sR        ..I          r   r   c                   6    e Zd ZdZed             ZddZd ZdS )Envz!A dict for environment variables.c                  4    t          t          j                  S )z.Returns a snapshot of the current environment.)r$   osenvironr   r   r   snapshotzEnv.snapshot&   s     2:r   Nc                 R    t          |           }||                    |           |S r   )r$   update)r   updated_fromresults      r   copyzEnv.copy+   s*    T#MM,'''r   c                 r    	 t           j        j        | |         z   }n# t          $ r d}Y nw xY w||z   | |<   dS )ztPrepends a new entry to a PATH-style environment variable, creating
        it if it doesn't exist already.
         N)r&   r	   pathsepKeyError)r   keyentrytails       r   
prepend_tozEnv.prepend_to1   sP    	7?T#Y.DD 	 	 	DDD	DLS			s    ,,r   )r   r   r    r!   staticmethodr(   r-   r5   r   r   r   r$   r$   #   sV        ++  \   ! ! ! ! !r   r$   strictc                 v    t          | t                    r|                     ||          nt          |           S )zcConverts s to str, using the provided encoding. If s is already str,
    it is returned as is.
    )
isinstancebytesdecodestrsencodingerrorss      r   	force_strrA   <   s2     *4Au)=)=I188Hf%%%3q66Ir   c                     t          | t                    r|                     ||          S t          |           } |dk    r|                     ||           | S )zConverts s to bytes, using the provided encoding. If s is already bytes,
    it is returned as is.

    If errors="strict" and s is bytes, its encoding is verified by decoding it;
    UnicodeError is raised if it cannot be decoded.
    r7   )r9   r<   encoder:   r;   r=   s      r   force_bytesrD   C   sY     !S xx&)))!HHXHHXv&&&r   c                 $    t          | d|          S )z'Same as force_bytes(s, "ascii", errors)asciirD   r>   r@   s     r   force_asciirI   T   s    q'6***r   c                 $    t          | d|          S )z&Same as force_bytes(s, "utf8", errors)utf8rG   rH   s     r   
force_utf8rL   Y   s    q&&)))r   Fc                    	 | j         }nO# t          $ rB 	 | j        }n6# t          $ r) 	 t          |           }d}n# t          $ r Y Y Y dS w xY wY nw xY wY nw xY w|r!	 t          |          }n# t          $ r Y nw xY wt	          |dd          S )zReturns the most descriptive name of a Python module, class, or function,
    as a Unicode string

    If quote=True, name is quoted with repr().

    Best-effort, but guaranteed to not fail - always returns something.
    Fz	<unknown>zutf-8replace)r    	Exceptionr   reprrA   )objquoter   s      r   nameofrS   ^   s     
 
 
		<DD 	 	 	Cyy   # # #"{{{{# 	
  	::DD 	 	 	D	 T7I...sg   
 
AA
A:A
A
AA	A

AAAAAA, ,
A98A9c                     t          | d          }	 t          j        |           }|d|z  }	 t          j        |           \  }}|d| z  }n# t          $ r Y nw xY w|dz  }n# t          $ r Y nw xY w|S )zReturns the most descriptive name of a Python module, class, or function,
    including source information (filename and linenumber), if available.

    Best-effort, but guaranteed to not fail - always returns something.
    T)rR   z (file z, line ))rS   inspectgetsourcefilegetsourcelinesrO   )rQ   r   src_file_
src_linenos        r   	srcnameofr\   ~   s     #T"""D(-- 	&(&&&	+#2377MAz *j***DD  	 	 	D	 	     Ks"   A& A 
AA&
A32A3c                      dt           j        vS )z>Returns True if the caller should hide something from debugpy.DEBUGPY_TRACE_DEBUGPY)r&   r'   r   r   r   hide_debugpy_internalsr_      s    ""*44r   c                 B    t                      rd| _        d| _        dS dS )zDisables tracing for the given thread if DEBUGPY_TRACE_DEBUGPY is not set.
    DEBUGPY_TRACE_DEBUGPY is used to debug debugpy with debugpy
    TN)r_   pydev_do_not_traceis_pydev_daemon_thread)threads    r   hide_thread_from_debuggerrd      s2      -$(!(,%%%- -r   )r7   )F)rV   r&   r   __file__r   objectr   dictr$   rA   rD   rI   rL   rS   r\   r_   rd   r   r   r   <module>rh      s1  
  				 



 !v ' ' ' '        ! ! ! ! !$ ! ! !2J J J J   "+ + + +
* * * *
/ / / /@  65 5 5
- - - - -r   