
    HAi                     @    S SK r S SKrSSKJrJr  S r " S S\5      rg)    N   )BaseObjectProxy_FunctionWrapperBasec                 N    UR                   (       a  g SUl         Ub	  U" U5        g g )NT)_self_expired)refproxycallbacks      J/var/www/html/land-ocr/venv/lib/python3.13/site-packages/wrapt/weakrefs.py_weak_function_proxy_callbackr      s*    E      c                   :   ^  \ rS rSrSrSrSU 4S jjrS rSrU =r	$ )WeakFunctionProxy   zA weak function proxy.)r   _self_instancec                   > U=(       a    [         R                  " [        XS9nSU l        [	        U[
        5      (       a  [        R                  " UR                  U5      U l        UR                  b3  [        [        U ]3  [        R                  " UR                  U5      5        g[        [        U ]3  [        R                  " X5      5        g [        R                  " UR                  U5      U l        [        [        U ]3  [        R                  " UR                  U5      5        g! [          a1    SU l        [        [        U ]3  [        R                  " X5      5         gf = f)as  Create a proxy to object which uses a weak reference. This is
similar to the `weakref.proxy` but is designed to work with functions
and methods. It will automatically rebind the function to the instance
when called if the function was originally a bound method. This is
necessary because bound methods are transient objects and applying a
weak reference to one will immediately result in it being destroyed
and the weakref callback called. The weak reference is therefore
applied to the instance the method is bound to and the original
function. The function is then rebound at the point of a call via the
weak function proxy.
)r	   r
   FN)	functoolspartialr   r   
isinstancer   weakrefr   r   _self_parentsuperr   __init__r	   __self____func__AttributeError)selfwrappedr
   	_callback	__class__s       r   r   WeakFunctionProxy.__init__#   s!   2  
!2!2)"
	 #g344")++g.D.Di"PD##/'7MM'"6"6	B 	 '7MM'5 
	W")++g.>.>	"JD#T3g..	:  	W"&D#T3GMM'4UV	Ws   AD( (8E#"E#c                     S nU" U 6 u  p0UR                   =(       a    UR                  5       nUR                  =(       a    UR                  nUc  UR                  " U 0 UD6$ UR                  U[        U5      5      " U 0 UD6$ )Nc                     X4$ N )r   argss     r   _unpack_self0WeakFunctionProxy.__call__.<locals>._unpack_self^   s
    :r   )r   __wrapped____get__type)r&   kwargsr'   r   instancefunctions         r   __call__WeakFunctionProxy.__call__]   s    	 "4(
 &&@4+>+>+@##8(8(8 ##T4V44$x.94J6JJr   r$   )
__name__
__module____qualname____firstlineno____doc__	__slots__r   r/   __static_attributes____classcell__)r    s   @r   r   r      s     3I8WtK Kr   r   )r   r   	__wrapt__r   r   r   r   r%   r   r   <module>r:      s#      <TK TKr   