o
    ϯi\                     @   s   d dl Z d dlZd dlZd dlmZ d dlmZmZmZm	Z	m
Z
mZmZ g dZd	dee defddZe Z	 ee  ee
  dS )
    N)Optional)	file_lockHTTPURLHandlerLazyPathNativePathHandlerOneDrivePathHandlerPathHandlerPathManager)r   r	   get_cache_dirr   	cache_dirreturnc              	   C   s   | du rt jt dd} zt|  t | t jsJ W | S  tt	fyF   t j
t d}tt}||  d| d |} Y | S w )aS  
    Returns a default directory to cache static files
    (usually downloaded from Internet), if None is provided.

    Args:
        cache_dir (None or str): if not None, will be returned as is.
            If None, returns the default cache directory as:

        1) $FVCORE_CACHE, if set
        2) otherwise ~/.torch/fvcore_cache
    NFVCORE_CACHEz~/.torch/fvcore_cachefvcore_cachez is not accessible! Using z	 instead!)ospath
expandusergetenvr	   mkdirsaccessW_OKOSErrorAssertionErrorjointempfile
gettempdirlogging	getLogger__name__warning)r   tmp_dirlogger r!   I/home/ubuntu/.local/lib/python3.10/site-packages/fvcore/common/file_io.pyr
      s   


r
   )N)r   r   r   typingr   iopath.common.file_ior   r   r   r   r   r   r	   PathManagerBase__all__strr
   register_handlerr!   r!   r!   r"   <module>   s   $