
    MhQ                     D   d dl Z d dlZd dlZd dlZd dlmZmZ d dlmZm	Z	m
Z
mZmZmZmZ dZd dlmZ  edeeef                   Zeegef         Ze	 ddd	d
dddededefd            Zedd	d
dedededefd            Z	 ddd	d
de
e         dededeeef         fdZe	 ddd	d
dddededefd            Zedd	d
dedededefd            Z	 ddd	d
de
e         dededeeef         fdZdedededefdZd Zd Zdede	e	e                  fdZd ZdS )    N)	FrameTypeFunctionType)CallableListOptionalTupleTypeVarUnionoverloadz7.7.0)ensure_signature_is_compatible_WrappedMethod)boundTFcheck_signaturecheck_at_runtimemethodr   r   returnc                    d S N r   r   r   s      S/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/overrides/overrides.py	overridesr       	     C    c                    d S r   r   r   s      r   r   r   *   r   r   c                `    | t          | ||          S t          j        t          ||          S )a0  Decorator to indicate that the decorated method overrides a method in
    superclass.
    The decorator code is executed while loading class. Using this method
    should have minimal runtime performance implications.

    How to use:
    from overrides import overrides

    class SuperClass(object):
        def method(self):
          return 2

    class SubClass(SuperClass):

        @overrides
        def method(self):
            return 1

    :param check_signature: Whether or not to check the signature of the overridden method.
    :param check_at_runtime: Whether or not to check the overridden method at runtime.
    :raises AssertionError: if no match in super classes for the method name
    :return: method with possibly added (if the method doesn't have one)
        docstring from super class
    Nr   
_overrides	functoolspartialr   r   s      r   r   r   4   @    < &/3CDDD +-
 
 
 	
r   c                    d S r   r   r   s      r   overrider$   \   r   r   c                    d S r   r   r   s      r   r$   r$   f   r   r   c                `    | t          | ||          S t          j        t          ||          S )a.  Decorator to indicate that the decorated method overrides a method in
    superclass.
    The decorator code is executed while loading class. Using this method
    should have minimal runtime performance implications.

    How to use:
    from overrides import override

    class SuperClass(object):
        def method(self):
          return 2

    class SubClass(SuperClass):

        @override
        def method(self):
            return 1

    :param check_signature: Whether or not to check the signature of the overridden method.
    :param check_at_runtime: Whether or not to check the overridden method at runtime.
    :raises AssertionError: if no match in super classes for the method name
    :return: method with possibly added (if the method doesn't have one)
        docstring from super class
    Nr   r   r   s      r   r$   r$   p   r"   r   c                     t           dd           t           dd           }|$t          t          j         j                           }t          t          j        d          |          D ]St           j	                  r<|r%t          j                    fd            }|c S t                       c S Tt           j         d          )N__override__T__globals__   c                  6    t                      | i |S r   )_validate_method)argskwargsr   r   super_classs     r   wrapperz_overrides.<locals>.wrapper   s*    $V[/JJJ!6426222r   z: No super class method found)setattrgetattrvarssysmodules
__module___get_base_classes	_getframehasattr__name__r    wrapsr,   	TypeError__qualname__)r   r   r   global_varsr0   r/   s   ``   @r   r   r      s   
 FND)))&-66K3;v'89::(q)9)9;GG  ;00 	 
((3 3 3 3 3 3 )(3  oFFF	 v*III
J
JJr   c                    t          || j                  }t          t          j        || j                  t
                    }t          |dd          rt          | j         d|           | j        s|j        | _        |rB| j                            d          s*t          |t                    st          || |           d S d S d S d S )N	__final__Fz: is finalized in __)r2   r:   
isinstanceinspectgetattr_staticstaticmethodr<   __doc__
startswithpropertyr   )r   r/   r   super_method	is_statics        r   r,   r,      s    ;88L{FO<<l I |[%00 M6?KKkKKLLL> .%-H**400H <22H
 	'|VYGGGGGH H H H H Hr   c                 :    fdt          |           D             S )Nc                 0    g | ]}t          |          S r   )_get_base_class).0class_name_components	namespaces     r   
<listcomp>z%_get_base_classes.<locals>.<listcomp>   s4       ! 	-y99  r   )_get_base_class_names)framerP   s    `r   r7   r7      s6       %:5%A%A   r   rS   c                    g }g }d}t          j        | j                  D ]}|j        | j        k    r n|j        t           j        vr(|sg }d}|j        dv r |r|                    |           |j	        g}W|j        dk    r|r|                    |j	                   |r|                    |           g }d}|r|                    |           |S )z(Get baseclass names from the code objectT)	LOAD_NAMELOAD_GLOBAL	LOAD_ATTRF)
disget_instructionsf_codeoffsetf_lastiopcodehasnameopnameappendargval)rS   current_itemitemsadd_last_stepinstructions        r   rR   rR      s    LEM+EL99 " "--ES[00 	!E M !=== +\***'./LL;..<. 23333  +\***L!MM #\"""Lr   c                 8   	 || d                  }n\# t           $ rO t          |d         t                    r|d         | d                  }nt          |d         | d                   }Y nw xY w| dd          D ]"}t	          ||          rt          ||          }#|S )Nr   __builtins__   )KeyErrorrB   dictr2   r9   )
componentsrP   obj	components       r   rM   rM      s    D
1& D D Di/66 	DN+JqM:CC)N3Z]CCC	D
  ^ * *	3	"" 	*#y))CJs    AA*)A*r   )rX   r    rC   r4   typesr   r   typingr   r   r   r   r	   r
   r   __VERSION__overrides.signaturer   r   _DecoratorMethodboolr   r$   r   r,   r7   strrR   rM   r   r   r   <module>ru      s  " 


      



 ) ) ) ) ) ) ) ) L L L L L L L L L L L L L L L L L L > > > > > >)|X7M1NOOO^,n<=  
 !"	    	
    
 
 !"	    	
    
 (,%
 !"	%
 %
 %
^$%
 %
 	%

 ^+,%
 %
 %
 %
P 
 !"	    	
    
 
 !"	    	
    
 (,%
 !"	%
 %
 %
^$%
 %
 	%

 ^+,%
 %
 %
 %
PKKK K 	K K K K2H H H"  ! !tDI ! ! ! !H    r   