Ë
    §Œjº"  ã                   ó€   — d Z ddlmZ ddlmZ ddlmZmZmZ ddl	m
Z
 ddlmZ  G d„ d	e«      Z G d
„ de«      Zdd„Zy)a¦  Caching decorators. Currently provides ``lru_cache``, a drop-in
replacement for ``functools.lru_cache`` with correct handling of instance
methods: a separate cache is maintained per instance, stored as an
attribute on the instance itself so it is cleaned up with the instance
by the garbage collector. For plain functions, class methods, and static
methods a single shared cache is used, matching ``functools.lru_cache``.
é    )Ú	lru_cache)Úpartialé   )ÚBaseObjectProxyÚBoundFunctionWrapperÚFunctionWrapper)Ú	decorator)Úsynchronizedc                   ó*   — e Zd Zd„ Zd„ Zd„ Zd„ Zd„ Zy)Ú_BoundLRUCacheFunctionWrapperc                 ó    — | j                   dk(  S )NÚfunction)Ú_self_binding©Úselfs    úW/var/www/html/Fitness-lenito-AI-main/venv/lib/python3.12/site-packages/wrapt/caching.pyÚ_is_instance_methodz1_BoundLRUCacheFunctionWrapper._is_instance_method#   s   € Ø×!Ñ! ZÑ/Ð/ó    c                 óš  — | j                   }| j                  «       sh|j                  €Jt        |«      5  |j                  €* t	        di |j
                  ¤Ž| j                  «      |_        d d d «        |j                  |i |¤ŽS | j                  }|j                  }t        ||d «      }|€�t        |«      5  t        ||d «      }|€^ t	        di |j
                  ¤Ž| j                  «      }t        t        |«      t        «      r|j                  ||«       nt        |||«       d d d «        ||i |¤ŽS # 1 sw Y   ŒËxY w# 1 sw Y   ŒxY w©N© )Ú_self_parentr   Ú_self_cacher
   Ú_functools_lru_cacheÚ_self_lru_kwargsÚ__wrapped__Ú_self_instanceÚ_self_cache_attrÚgetattrÚ
issubclassÚtyper   Ú__self_setattr__Úsetattr)r   ÚargsÚkwargsÚparentÚinstanceÚ
cache_attrÚcaches          r   Ú__call__z&_BoundLRUCacheFunctionWrapper.__call__&   sH  € Ø×"Ñ"ˆð ×'Ñ'Ô)Ø×!Ñ!Ð)Ü! &Õ)Ø×)Ñ)Ð1ð.Ô-Añ .Ø$×5Ñ5ñ.à×*Ñ*ó.,˜Ô*÷ *ð &�6×%Ñ% tÐ6¨vÑ6Ð6ð ×&Ñ&ˆØ×,Ñ,ˆ
ä˜ *¨dÓ3ˆàˆ=Ü˜fÕ%Ü ¨*°dÓ;�à�=ØKÔ0ÑK°6×3JÑ3JÑKØ×(Ñ(ó�Eô "¤$ x£.´/ÔBØ ×1Ñ1°*¸eÕDä ¨*°eÔ<÷) &ñ, �dÐ%˜fÑ%Ð%÷Q *Ð)ú÷$ &Ð%ús   ´7D5Â7A.EÄ5D>ÅE
c                 óÒ   — | j                  «       s| j                  j                  «       S t        | j                  | j                  j
                  d«      }|�|j                  «       S y)zyReturn the cache statistics for this binding's cache, or
        ``None`` if the cache has not yet been created.
        N)r   r   Ú
cache_infor   r   r   ©r   r)   s     r   r,   z(_BoundLRUCacheFunctionWrapper.cache_infoZ   s^   € ð
 ×'Ñ'Ô)Ø×$Ñ$×/Ñ/Ó1Ð1ä˜×+Ñ+¨T×->Ñ->×-OÑ-OÐQUÓVˆàÐØ×#Ñ#Ó%Ð%àr   c                 óÖ   — | j                  «       s| j                  j                  «        yt        | j                  | j                  j
                  d«      }|�|j                  «        yy)zClear this binding's cache.N)r   r   Úcache_clearr   r   r   r-   s     r   r/   z)_BoundLRUCacheFunctionWrapper.cache_cleari   s]   € ð ×'Ñ'Ô)Ø×Ñ×)Ñ)Ô+Øä˜×+Ñ+¨T×->Ñ->×-OÑ-OÐQUÓVˆàÐØ×ÑÕð r   c                 óÒ   — | j                  «       s| j                  j                  «       S t        | j                  | j                  j
                  d«      }|�|j                  «       S y)z/Return the parameters used to create the cache.N)r   r   Úcache_parametersr   r   r   r-   s     r   r1   z._BoundLRUCacheFunctionWrapper.cache_parametersu   s^   € ð ×'Ñ'Ô)Ø×$Ñ$×5Ñ5Ó7Ð7ä˜×+Ñ+¨T×->Ñ->×-OÑ-OÐQUÓVˆàÐØ×)Ñ)Ó+Ð+àr   N)Ú__name__Ú
__module__Ú__qualname__r   r*   r,   r/   r1   r   r   r   r   r   !   s   „ ò0ò2&òhò
 ór   r   c                   ó:   ‡ — e Zd ZeZˆ fd„Zd„ Zd„ Zd„ Zd„ Z	ˆ xZ
S )Ú_LRUCacheFunctionWrapperc                 óæ   •— t        ‰| �  ||fi |¤Ž |j                  | _        d | _        t	        |dd «      }|€|j
                  j                  }d|z   dz   t        t        | «      «      z   | _	        y )Nr2   Ú_lru_cache_Ú_)
ÚsuperÚ__init__r   r   r   Ú__func__r2   ÚstrÚidr   )r   ÚwrappedÚwrapperr%   ÚnameÚ	__class__s        €r   r;   z!_LRUCacheFunctionWrapper.__init__‡   sv   ø€ Ü‰Ñ˜ 'Ñ4¨VÒ4ð
 !(× 8Ñ 8ˆÔØˆÔô
 �w 
¨DÓ1ˆàˆ<Ø×#Ñ#×,Ñ,ˆDð !.°Ñ 4°sÑ :¼SÄÀDÃ»]Ñ JˆÕr   c                 óê   — | j                   €Jt        | «      5  | j                   €* t        di | j                  ¤Ž| j                  «      | _         d d d «        | j                   |i |¤ŽS # 1 sw Y   ŒxY wr   )r   r
   r   r   r   )r   r$   r%   s      r   r*   z!_LRUCacheFunctionWrapper.__call__¤   ss   € ð ×ÑÐ#Ü˜dÕ#Ø×#Ñ#Ð+Ø'TÔ';Ñ'T¸d×>SÑ>SÑ'TØ×(Ñ(ó(�DÔ$÷ $ð  ˆt×Ñ Ð0¨Ñ0Ð0÷ $Ð#ús   ˜7A)Á)A2c                 óP   — | j                   �| j                   j                  «       S y)z`Return the cache statistics, or ``None`` if the cache has
        not yet been created.
        N)r   r,   r   s    r   r,   z#_LRUCacheFunctionWrapper.cache_info±   s(   € ð
 ×ÑÐ'Ø×#Ñ#×.Ñ.Ó0Ð0àr   c                 óR   — | j                   �| j                   j                  «        yy)z)Clear the cache and reset the statistics.N)r   r/   r   s    r   r/   z$_LRUCacheFunctionWrapper.cache_clear»   s'   € ð ×ÑÐ'Ø×Ñ×(Ñ(Õ*ð (r   c                 óP   — | j                   �| j                   j                  «       S y)zsReturn the parameters used to create the cache, or ``None``
        if the cache has not yet been created.
        N)r   r1   r   s    r   r1   z)_LRUCacheFunctionWrapper.cache_parametersÁ   s(   € ð
 ×ÑÐ'Ø×#Ñ#×4Ñ4Ó6Ð6àr   )r2   r3   r4   r   Ú__bound_function_wrapper__r;   r*   r,   r/   r1   Ú__classcell__)rB   s   @r   r6   r6   ƒ   s#   ø„ à!>ÐôKò:1òò+ör   r6   Nc                óh   — | €t        t        fi |¤ŽS d„ }||_         t        |t        ¬«      | «      S )a¯  A decorator that applies ``functools.lru_cache`` to the wrapped
    function, with correct handling for instance methods, class methods,
    and static methods.

    For instance methods, a separate ``functools.lru_cache`` is
    maintained per instance. The cache is stored as an attribute on the
    instance itself, so it is automatically cleaned up when the instance
    is garbage collected. This means instances do not need to be
    hashable, each instance gets its own full ``maxsize`` budget, and
    no external mapping prevents garbage collection.

    For plain functions, class methods, and static methods, a single
    shared cache is used.

    All keyword arguments are passed through to ``functools.lru_cache``.

    Cache management methods ``cache_info()`` and ``cache_clear()`` are
    available directly on the decorated function. For bound methods,
    these operate on the per-instance cache for the bound instance.
    c                 ó   —  | |i |¤ŽS ©Nr   )r?   r'   r$   Ú_kwargss       r   Ú_wrapperzlru_cache.<locals>._wrapperå   s   € Ù˜Ð( Ñ(Ð(r   )Úproxy)r   r   r   r	   r6   )Úfuncr%   rM   s      r   r   r   Ì   s=   € ð, €|Ü”yÑ+ FÑ+Ð+ò)ð !'€HÔà>Œ9�XÔ%=Ô>¸tÓDÐDr   rK   )Ú__doc__Ú	functoolsr   r   r   Ú	__wrapt__r   r   r   Ú
decoratorsr	   Úsynchronizationr
   r   r6   r   r   r   Ú<module>rU      sC   ðñõ 8Ý ç MÑ MÝ !Ý )ô&_Ð$8ô _ôDF˜ô FôREr   