
    HAi0                         S r SSKJr  SSKJr  SSKJr  SSKJr   " S S\5      r	S	 r
S
 rS rS rS rS rS rS rS rS rS r " S S\5      r " S S\5      rSSS.S jjrg)z0Variants of ObjectProxy for different use cases.    )Callable)
ModuleType   )BaseObjectProxy)synchronizedc                   B   ^  \ rS rSrSr\S 5       rU 4S jrS rSr	U =r
$ )ObjectProxy   a{  A generic object proxy which forwards special methods as needed.
For backwards compatibility this class adds support for `__iter__()`. If
you don't need backward compatibility for `__iter__()` support then it is
preferable to use `BaseObjectProxy` directly. If you want automatic
support for special dunder methods for callables, iterators, and async,
then use `AutoObjectProxy`.c                     [         $ N)r	   selfs    I/var/www/html/land-ocr/venv/lib/python3.13/site-packages/wrapt/proxies.py__object_proxy__ObjectProxy.__object_proxy__   s        c                 "   > [         TU ]  U 5      $ r   )super__new__)clsargskwargs	__class__s      r   r   ObjectProxy.__new__   s    ws##r   c                 ,    [        U R                  5      $ r   iter__wrapped__r   s    r   __iter__ObjectProxy.__iter__   s    D$$%%r    )__name__
__module____qualname____firstlineno____doc__propertyr   r   r   __static_attributes____classcell__r   s   @r   r	   r	      s+    #  $& &r   r	   c                  :    S nU" U 6 u  p0UR                   " U 0 UD6$ )Nc                     X4$ r   r!   )r   r   s     r   _unpack_self&__wrapper_call__.<locals>._unpack_self%   s
    zr   )r   )r   r   r-   r   s       r   __wrapper_call__r/   $   s+     t$JDT,V,,r   c                 ,    [        U R                  5      $ r   r   r   s    r   __wrapper_iter__r1   -   s      !!r   c                 6    U R                   R                  5       $ r   )r   __next__r   s    r   __wrapper_next__r4   1   s    $$&&r   c                 6    U R                   R                  5       $ r   )r   	__aiter__r   s    r   __wrapper_aiter__r7   5   s    %%''r   c                 R   #    U R                   R                  5       I S h  vN $  N7fr   )r   	__anext__r   s    r   __wrapper_anext__r:   9   s      !!++----   '%'c                 6    U R                   R                  5       $ r   )r   __length_hint__r   s    r   __wrapper_length_hint__r>   =   s    ++--r   c              #   R   #    U R                   R                  5        S h  vN $  N7fr   )r   	__await__r   s    r   __wrapper_await__rA   A   s      ''113343r;   c                 8    U R                   R                  X5      $ r   )r   __get__)r   instanceowners      r   __wrapper_get__rF   E       ##H44r   c                 8    U R                   R                  X5      $ r   )r   __set__)r   rD   values      r   __wrapper_set__rK   I   rG   r   c                 8    U R                   R                  U5      $ r   )r   
__delete__)r   rD   s     r   __wrapper_delete__rN   M   s    &&x00r   c                 8    U R                   R                  X5      $ r   )r   __set_name__)r   rE   names      r   __wrapper_set_name__rR   Q   s    ((55r   c                   2   ^  \ rS rSrSrU 4S jrS rSrU =r$ )AutoObjectProxyU   a  An object proxy which can automatically adjust to the wrapped object
and add special dunder methods as needed. Note that this creates a new
class for each instance, so it has much higher memory overhead than using
`BaseObjectProxy` directly. If you know what special dunder methods you need
then it is preferable to use `BaseObjectProxy` directly and add them to a
subclass as needed. If you only need `__iter__()` support for backwards
compatibility then use `ObjectProxy` instead.
c                   > 0 n[        U5      n[        [        U 5      5      n[        U5      (       a  SU;  a	  [        US'   SU;   a  SU;  a	  [        US'   SU;   a  SU;  a	  [
        US'   SU;   a  SU;  a	  [        US'   SU;   a  SU;  a	  [        US'   SU;   a  SU;  a	  [        US'   SU;   a  SU;  a	  [        US'   SU;   a  SU;  a	  [        US'   S	U;   a  S	U;  a	  [        US	'   S
U;   a  S
U;  a	  [        US
'   SU;   a  SU;  a	  [        US'   U R                  nU [        L a  [         R                  n["        [        U ]K  ['        XP4U5      5      $ )jInjects special dunder methods into a dynamically created subclass
as needed based on the wrapped object.
__call__r   r3   r6   r9   r=   r@   rC   rI   rM   rP   )dirsetcallabler/   r1   r4   r7   r:   r>   rA   rF   rK   rN   rR   r"   rT   r   r   r   type)r   wrapped	namespacewrapped_attrsclass_attrsrQ   r   s         r   r   AutoObjectProxy.__new___   sq   
 	G#c(mG;!>$4Ij!&:[+H$4Ij!&:[+H$4Ij!-'K{,J%6Ik"-'K{,J%6Ik"-2C;2V+BI'( -'K{,J%6Ik"%);*F#2Ii %);*F#2Ii =(\-L&8Il#]*~[/P(<In%||/!"++D_c24fi3PQQr   c                    [        U 5      n[        [        U5      5      n[        U R                  5      (       a  SU;  a  [
        Ul        O [        USS5      [
        L a  [        US5        [        U R                  S5      (       a  SU;  a  [        Ul        O [        USS5      [        L a  [        US5        [        U R                  S5      (       a  SU;  a  [        Ul        O [        USS5      [        L a  [        US5        [        U R                  S5      (       a  SU;  a  [        Ul        O [        USS5      [        L a  [        US5        [        U R                  S5      (       a  SU;  a  [         Ul        O [        USS5      [         L a  [        US5        [        U R                  S5      (       a  SU;  a  [$        Ul        O [        USS5      [$        L a  [        US5        [        U R                  S5      (       a  SU;  a  [(        Ul        O [        USS5      [(        L a  [        US5        [        U R                  S	5      (       a  S	U;  a  [,        Ul        O [        US	S5      [,        L a  [        US	5        [        U R                  S
5      (       a  S
U;  a  [0        Ul        O [        US
S5      [0        L a  [        US
5        [        U R                  S5      (       a  SU;  a  [4        Ul        O [        USS5      [4        L a  [        US5        [        U R                  S5      (       a  SU;  a  [8        Ul        gg[        USS5      [8        L a  [        US5        gg)zrAdjusts special dunder methods on the class as needed based on the
wrapped object, when `__wrapped__` is changed.
rX   Nr   r3   r6   r9   r=   r@   rC   rI   rM   rP   )r\   rZ   rY   r[   r   r/   rX   getattrdelattrhasattrr1   r   r4   r3   r7   r6   r:   r9   r>   r=   rA   r@   rF   rC   rK   rI   rN   rM   rR   rP   )r   r   r`   s      r   __wrapped_setattr_fixups__*AutoObjectProxy.__wrapped_setattr_fixups__   s   
 4j#c(mD$$%%,/S*d+/??C$4##Z00,/S*d+/??C$4##Z00,/S*d+/??C$4##[11+- 1S+t,0AAC%4##[11+- 1S+t,0AAC%4##%677 3&=#S+T26MMC*+4##[11+- 1S+t,0AAC%4##Y//+-S)T*o=C#4##Y//+-S)T*o=C#4##\22;.!3S,-1CCC&4##^44[0#7  1S.$/3GGC( Hr   r!   )	r"   r#   r$   r%   r&   r   rf   r(   r)   r*   s   @r   rT   rT   U   s    4RlH) H)r   rT   c                   `   ^  \ rS rSrSrSSS.U 4S jjjrSSS.U 4S jjjrSrS rS	 r	S
r
U =r$ )LazyObjectProxy   z`An object proxy which can generate/create the wrapped object on demand
when it is first needed.
.	interfacec                  > USL a  [        S5      n0 n[        U5      n[        [        U 5      5      nSU;   a  SU;  a	  [        US'   SU;   a  SU;  a	  [        US'   SU;   a  SU;  a	  [
        US'   SU;   a  SU;  a	  [        US'   SU;   a  SU;  a	  [        US'   SU;   a  SU;  a	  [        US'   S	U;   a  S	U;  a	  [        US	'   S
U;   a  S
U;  a	  [        US
'   SU;   a  SU;  a	  [        US'   SU;   a  SU;  a	  [        US'   SU;   a  SU;  a	  [        US'   U R                  n[        [         U ]G  [        X`4U5      5      $ )rW   .NrX   r   r3   r6   r9   r=   r@   rC   rI   rM   rP   )r\   rY   rZ   r/   r1   r4   r7   r:   r>   rA   rF   rK   rN   rR   r"   r   rT   r   )r   callbackrl   r^   interface_attrsr`   rQ   r   s          r   r   LazyObjectProxy.__new__   sn   
 T
I	i.#c(m(Z{-J$4Ij!(Z{-J$4Ij!(Z{-J$4Ij!/)k.L%6Ik"/)k.L%6Ik" 0!4+BI'( /)k.L%6Ik"'I[,H#2Ii 'I[,H#2Ii ?*|;/N&8Il#_,{1R(<In%||_c24fi3PQQr   c                6   > Ub  Xl         [        TU ]	  S5        g)zInitialize the object proxy with wrapped object as `None` but due
to presence of special `__wrapped_factory__` attribute addded first,
this will actually trigger the deferred creation of the wrapped object
when first needed.
N)__wrapped_factory__r   __init__)r   rn   rl   r   s      r   rs   LazyObjectProxy.__init__  s     '/$r   Fc                     g r   r!   r   s    r   rr   #LazyObjectProxy.__wrapped_factory__,  s    r   c                     [        [        U 5      5         U R                  (       a  U R                  sSSS5        $ U R	                  5       U l        SU l        U R                  sSSS5        $ ! , (       d  f       g= f)z2Gets the wrapped object, creating it if necessary.NT)r   r\   __wrapped_initialized__r   rr   r   s    r   __wrapped_get__LazyObjectProxy.__wrapped_get__/  s\     $t*% ++'' &%  $779D+/D(## &%%s   A-'A--
A;)r   rr   rx   r   )r"   r#   r$   r%   r&   r   rs   rx   rr   ry   r(   r)   r*   s   @r   ri   ri      sE    7R 7R 7Rr
3 
 
 $$ $r   ri   N.rk   c                Z   ^ ^ Tb  USL a  [         nOUSL a  [        nUU 4S jn[        X2S9$ )a:  Lazily imports the module `name`, returning a `LazyObjectProxy` which
will import the module when it is first needed. When `name is a dotted name,
then the full dotted name is imported and the last module is taken as the
target. If `attribute` is provided then it is used to retrieve an attribute
from the module.
.c                  <   > [        TS/S9n Tb  [        U T5      $ U $ )N )fromlist)
__import__rc   )module	attributerQ   s    r   _importlazy_import.<locals>._importW  s)    DB40 69--r   rk   )r   r   ri   )rQ   r   rl   r   s   ``  r   lazy_importr   H  s8      I"I 788r   r   )r&   collections.abcr   typesr   	__wrapt__r   
decoratorsr   r	   r/   r1   r4   r7   r:   r>   rA   rF   rK   rN   rR   rT   ri   r   r!   r   r   <module>r      s    6 $  & $&/ &.-"'(..55516H)o H)Ve$o e$P93 9r   