
    ?gQ                        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y)    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                     y N r   r   r   s      H/var/www/openai/venv/lib/python3.12/site-packages/overrides/overrides.py	overridesr                c                     y r   r   r   s      r   r   r   *   r   r   c                X    | 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
    r   
_overrides	functoolspartialr   r   s      r   r   r   4   6    < &/3CDD  +-
 	
r   c                     y r   r   r   s      r   overrider$   \   r   r   c                     y r   r   r   s      r   r$   r$   f   r   r   c                X    | 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
    r   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 ]N  t         j                        s|r#t        j                          fd       }|c S t                 c S  t         j                   d      )N__override__T__globals__   c                  .    t                | i |S r   )_validate_method)argskwargsr   r   super_classs     r   wrapperz_overrides.<locals>.wrapper   s    $V[/J!426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)&-6K3;;v'8'89:(q)9;G;0(3 )3  oF H v**++HI
JJr   c                    t        || j                        }t        t        j                  || j                        t
              }t        |dd      rt        | j                   d|       | j                  s|j                  | _        |r;| j                  j                  d      st        |t              st        || |       y y y y )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    ;8L{FOO<lI |[%06??++=k]KLL>>%--**40<2&|VYG 3 1 	r   c                 R    t        |       D cg c]  }t        ||       c}S c c}w r   )_get_base_class_names_get_base_class)frame	namespaceclass_name_componentss      r   r7   r7      s7     &;5%A%A! 	-y9%A  s   $rN   c                    g }g }d}t        j                  | j                        D ]  }|j                  | j                  kD  r n|j
                  t         j                  vr;|sg }d}|j                  dv r!|r|j                  |       |j                  g}p|j                  dk(  r|r|j                  |j                         |r|j                  |       g }d} |r|j                  |       |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)rN   current_itemitemsadd_last_stepinstructions        r   rL   rL      s     LEM++ELL9-S[[0E M !==\*'../L;.< 2 23 \*L!M/ :2 \"Lr   c                     	 || d      }| dd  D ]  }t	        ||      st        ||      } |S # t         $ r4 t        |d   t              r|d   | d      }nt        |d   | d         }Y aw xY w)Nr   __builtins__   )KeyErrorrB   dictr2   r9   )
componentsrO   obj	components       r   rM   rM      s    D
1&  ^	3	"#y)C $ J  Di/6N+JqM:C)N3Z]CC	Ds   / :A,+A,r   )rU   r    rC   r4   typesr   r   typingr   r   r   r   r	   r
   r   __VERSION__overrides.signaturer   r   _DecoratorMethodboolr   r$   r   r,   r7   strrL   rM   r   r   r   <module>rr      s_  "    
 ) L L L >)|X7M1NO^,n<=  
 !"	  	
  
 
 !"	  	
  
 (,%
 !"	%
^$%
 %
 	%

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

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