
    
3j%                     X    S SK Jr  S SKJr  S SKJrJr   " S S5      r\r " S S5      r	g)	    )defaultdict)LRUCache)
SetOrdered	not_foundc                   4    \ rS rSrSrS rS rS	S jrS rSr	g)
DistanceCache   z
Native bounded cache used by DeepDiff's distance calculations.

DeepDiff historically used a pure Python LFU cache here. The distance-cache
hot path benefits more from cachebox's native mapping operations than from
preserving LFU eviction semantics.
c                 F    US::  a  [        S5      e[        U5      U l        g )Nr   z/Capacity of DistanceCache needs to be positive.)
ValueErrorr   cache)selfcapacitys     K/home/wildlama/miniconda3/lib/python3.13/site-packages/deepdiff/lfucache.py__init__DistanceCache.__init__   s!    q=NOOh'
    c                 B    U R                   R                  U[        5      $ N)r   getr   r   keys     r   r   DistanceCache.get   s    zz~~c9--r   Nc                     U(       aC  U R                   R                  US 5      nUc  [        [        5      nXB   R	                  U5        UnU R                   R                  X5        g r   )r   r   r   r   addinsert)r   r   report_typevaluecontents        r   setDistanceCache.set   sP    jjnnS$/G%j1 $$U+E

#%r   c                     XR                   ;   $ r   r   r   s     r   __contains__DistanceCache.__contains__    s    jj  r   r"   )NN)
__name__
__module____qualname____firstlineno____doc__r   r   r   r#   __static_attributes__ r   r   r   r      s    (
.&!r   r   c                   *    \ rS rSrS r\rS rS rSrg)DummyLFU'   c                     g r   r+   r   argskwargss      r   r   DummyLFU.__init__)   s    r   c                     [         $ r   )r   r0   s      r   r   DummyLFU.get.   s    r   c                     g)NFr+   r   s     r   r#   DummyLFU.__contains__1   s    r   r+   N)	r%   r&   r'   r(   r   r   r   r#   r*   r+   r   r   r-   r-   '   s     Cr   r-   N)
collectionsr   cacheboxr   deepdiff.helperr   r   r   LFUCacher-   r+   r   r   <module>r<      s)    #  1! !<  r   