o
    3gf                  	   @  s  d dl mZ ddlmZ ee d dlZd dlZd dlmZ d dl	m
Z
 d dlmZ d dlmZmZmZmZmZmZmZ d dlZdd	lmZ eeef Zd7ddZe
d8ddZd9ddZedZd:d;ddZ	 eee Z e fddZ!eredZ"ej#dd dkrd dlm$Z$ nd dl%m$Z$ e$dZ&ee&e"f Z'eeee&ef f Z(ee&ef Z)ed ed!Z*ed<d#d$Z+e	%d=d%d%d%d%d%d%d&d>d6d$Z+dS e!Z+dS )?    )annotations   )assert_subpackageN)Iterator)contextmanager)Path)TYPE_CHECKINGAnyCallableTypeVarUnioncastoverload)warningsreturnNonec                  C  s8   zdd l } W n
 ty   Y d S w ddl m} d|_d S )Nr   )settingsF)cachewImportErrorr   ENABLE)r   r    r   (/home/garg/my-data/HPI/my/core/cachew.pydisable_cachew   s   
r   Iterator[None]c                  c  sh    zdd l } W n ty   d V  Y d S w ddlm} |  d V  W d    d S 1 s-w   Y  d S )Nr   )disabled_cachew)r   r   cachew.extrar   )r   r   r   r   r   r   )   s   "r   r   c                  C  s    t td} | jddd | S )NmyT)exist_okparents)r   appdirsuser_cache_dirmkdir)cdr   r   r   _appdirs_cache_dir7   s   r#   z/tmp/hpi/cachew_none_hacksuffixPathIsh | Nonec                 C  s`   ddl m} |j }d }| d urt| }| rJ ||d u r$t}n|}|d u r,|S || S )Nr   )core_config) r&   configget_cache_dirr   is_absolute_CACHE_DIR_NONE_HACK)r$   CCcdir_spcdirr   r   r   	cache_dir@   s   
	r0   c                 K  s   | t u rt } t| ttfrz	t| t W n   Y nd} zddl}W n ty7   t	
d dd  Y S w | |d< |jdi |S )zl
    Stands for 'Maybe cachew'.
    Defensive wrapper around @cachew to make it an optional dependency.
    Nr   zrcachew library not found. You might want to install it to speed things up. See https://github.com/karlicoss/cachewc                 S  s   | S Nr   )	orig_funcr   r   r   <lambda>{   s    z_mcachew_impl.<locals>.<lambda>
cache_pathr   )_cache_path_dfltr0   
isinstancestrr   relative_tor+   r   ModuleNotFoundErrorr   high)r4   kwargsr   r   r   r   _mcachew_impld   s    
r<   R   )   
   )	ParamSpecPF)boundfunc                 C     d S r1   r   )rE   r   r   r   mcachew   s   rG   .)
force_filecls
depends_onloggerchunk_bysynthetic_keyr4   PathProvider | NonerH   boolrI   type | NonerJ   HashFunctionrK   logging.Logger | NonerL   intrM   
str | NoneCallable[[F], F]c                C  rF   r1   r   )r4   rH   rI   rJ   rK   rL   rM   r   r   r   rG      s   
)r   r   )r   r   )r   r   r1   )r$   r%   r   r   )rE   rC   r   rC   ).)r4   rN   rH   rO   rI   rP   rJ   rQ   rK   rR   rL   rS   rM   rT   r   rU   ),
__future__r   internalr   __name__loggingsyscollections.abcr   
contextlibr   pathlibr   typingr   r	   r
   r   r   r   r   r   r'   r   r7   PathIshr   r   r#   r+   r0   objectr5   r<   r=   version_inforA   typing_extensionsrB   r,   PathProviderrQ   rC   rG   r   r   r   r   <module>   sX    $


