
    tKg                     T    d dl Z d dlZddlmZ 	 d dlZddZddZy# e$ r dZY w xY w)    N   )method_files_mapc           
      @   |t         }|&t        t        d      t        j                  d      }t        j
                  j                  |      st        d| d       y | %t        d| d       t        j                  |       y t        | t        t        f      s| g} | D ]  }t        |      sJ |j                  }||vr(t        d| dt        |j!                                      ||   }|D cg c]"  }t        j
                  j#                  ||      $ }}|D ]w  }t        j
                  j                  |      rGt        d	t        j
                  j%                  |      d
    d|        t	        j&                  |       it        d| d       y  y c c}w )NzsMissing optional dependency 'pooch' required for scipy.datasets module. Please use pip or conda to install 'pooch'.z
scipy-datazCache Directory z! doesn't exist. Nothing to clear.zCleaning the cache directory !zDataset method za doesn't exist. Please check if the passed dataset is a subset of the following dataset methods: zCleaning the file r   z for dataset zPath )r   platformdirsImportErroruser_cache_dirospathexistsprintshutilrmtree
isinstancelisttuplecallable__name__
ValueErrorkeysjoinsplitremove)	datasets	cache_dir
method_mapdatasetdataset_name
data_filesfiledata_filepathsdata_filepaths	            Y/home/alanp/www/video.onchill/myenv/lib/python3.12/site-packages/scipy/datasets/_utils.py_clear_cacher$      s   %
 : ; ; !//=	77>>)$ +LMN-i[:;i (T5M2 |HGG$$$"++L:- ?<. A- .2*//2C-D,E"G H H
 $L1J*46*4$ !ggll9d;*4  6!/77>>-0.WW]]=9!<= >))58 9 IIm,E- 1. . / "0  6s   3'Fc                     t        |        y)ak  
    Cleans the scipy datasets cache directory.

    If a scipy.datasets method or a list/tuple of the same is
    provided, then clear_cache removes all the data files
    associated to the passed dataset method callable(s).

    By default, it removes all the cached data files.

    Parameters
    ----------
    datasets : callable or list/tuple of callable or None

    Examples
    --------
    >>> from scipy import datasets
    >>> ascent_array = datasets.ascent()
    >>> ascent_array.shape
    (512, 512)
    >>> datasets.clear_cache([datasets.ascent])
    Cleaning the file ascent.dat for dataset ascent
    N)r$   )r   s    r#   clear_cacher&   :   s    .     )NN)N)r
   r   	_registryr   r   r   r$   r&    r'   r#   <module>r*      s8    	  '
,/^g  Ls    ''