
    ^jF                         d Z ddlmZ 	 ddlmZ dZ	 ee	      dd	       Z
 ee	      dd
       Z ee	      dd       Z ee	      dd       Zy# e$ r ddlmZ d ZY Ow xY w)z
Node Searching with Cache.

.. note:: These functions require https://pypi.org/project/fastcache/, otherwise caching is not active.
   )search    )
clru_cachewrapsc                     d }|S )Nc                 .     t                fd       }|S )Nc                       | i |S )N )argskwargsfuncs     M/opt/ringagent/.cad-venv/lib/python3.12/site-packages/anytree/cachedsearch.pywrappedz*_cache.<locals>.decorator.<locals>.wrapped   s    T,V,,    r   )r   r   s   ` r   	decoratorz_cache.<locals>.decorator   s     4[- - Nr   r   )sizer   s     r   _cacher      s    	 r       Nc                 8    t        j                  | |||||      S )z.Identical to :any:`search.findall` but cached.)filter_stopmaxlevelmincountmaxcount)r   findall)noder   r   r   r   r   s         r   r   r      s     >>$dXX`ksttr   c                 8    t        j                  | |||||      S )z6Identical to :any:`search.findall_by_attr` but cached.)namer   r   r   )r   findall_by_attr)r   valuer   r   r   r   s         r   r    r    %   s!     !!$D8V^iqrrr   c                 4    t        j                  | |||      S )z+Identical to :any:`search.find` but cached.)r   r   r   )r   find)r   r   r   r   s       r   r#   r#   +   s     ;;tW4(KKr   c                 4    t        j                  | |||      S )z3Identical to :any:`search.find_by_attr` but cached.)r   r   )r   find_by_attr)r   r!   r   r   s       r   r%   r%   1   s     tUIIr   )NNNNN)r   NNN)NNN)r   N)__doc__ r   	fastcacher   r   ImportError	functoolsr   
CACHE_SIZEr   r    r#   r%   r   r   r   <module>r,      s    ." 
 
u u
 
s s
 
L L
 
J JM  		s   A A A 