
    hMh0
                     >    d dl mZ d dlZd dlZd dlZd Zd ZddZdS )    )PathNc                     t          t          d          rt          j        | dz             }n#t          j        d          | dz            j        }|S )z'Get the frame at the given stack level.	_getframe   r   )context)hasattrsysr   inspectstackframe)levelr   s     X/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/ipywidgets/widgets/utils.py
_get_framer   	   sN     sK   8eAg&&a(((q17L    c                     d}t          |          d | D             }rDt          fd|D                       r)|dz  }j        rt          fd|D                       )|dz
  S )zFind the stacklevel of the first frame that doesn't contain any of the given internal strings

    The depth will be 1 at minimum in order to start checking at the caller of
    the function that called this utility method.
       c                 F    g | ]}t          t          |                    S  )strr   ).0ss     r   
<listcomp>z(_external_stacklevel.<locals>.<listcomp>(   s$    :::A3tAww<<:::r   c              3   h   K   | ],}|t          t          j        j                            v V  -d S )N)r   r   f_codeco_filename)r   r   r   s     r   	<genexpr>z'_external_stacklevel.<locals>.<genexpr>+   s=      ^^QSel&>!?!?@@@^^^^^^r   r   )r   anyf_back)internalr   normalized_internalr   s      @r   _external_stacklevelr!      s     EuE ;::::  C^^^^J]^^^^^ 	  C^^^^J]^^^^^ 
 7Nr   ipywidgets/widgets/c                     t          |t                    r|g}t          |          }t          j        | t
          |dz              dS )aU  Generate a deprecation warning targeting the first frame that is not 'internal'
    
    internal is a string or list of strings, which if they appear in filenames in the
    frames, the frames will be considered internal. Changing this can be useful if, for examnple,
    we know that ipywidgets is calling out to traitlets internally.
    r   )
stacklevelN)
isinstancer   r!   warningswarnDeprecationWarning)messager   r$   s      r   deprecationr*   2   sP     (C   : &h//J M'-*Q,GGGGGGr   )r"   )pathlibr   r	   r
   r&   r   r!   r*   r   r   r   <module>r,      sv          



  
 
 
(  *H H H H H Hr   