
    ^Mh                     X    d dl Z d dlZddlmZ 	 d dlZn# e$ r dZY nw xY wddZddZdS )    N   )method_files_mapc           
      L   |t           }*t          t          d          t          j        d          t          j                                      st          d d           d S | )t          d d           t          j	                   d S t          | t          t          f          s| g} | D ]}t          |          sJ |j        }||vr4t          d| dt          |                                                     ||         }fd	|D             }|D ]}t          j                            |          rMt          d
t          j                            |          d          d|            t	          j        |           nt          d| d           d S )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: c                 P    g | ]"}t           j                            |          #S  )ospathjoin).0file	cache_dirs     U/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/scipy/datasets/_utils.py
<listcomp>z _clear_cache.<locals>.<listcomp>-   s9     6 6 6"& !gll9d;; 6 6 6    zCleaning the file r   z for dataset zPath )r   platformdirsImportErroruser_cache_dirr	   r
   existsprintshutilrmtree
isinstancelisttuplecallable__name__
ValueErrorkeyssplitremove)datasetsr   
method_mapdatasetdataset_name
data_filesdata_filepathsdata_filepaths    `      r   _clear_cacher)      s;   %
 : ; ; ; !/==	7>>)$$ MMMMNNN:i:::;;;i     (T5M22 	$ |H 	/ 	/GG$$$$$"+L:--  "G< "G "G .2*//2C2C-D-D"G "G H H H
 $L1J6 6 6 6*46 6 6N!/ / /7>>-00 / 8W]]=99!<8 8)58 8 9 9 9 Im,,,, .- . . . / / / //	/ 	/r   c                 $    t          |            dS )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    . r   )NN)N)r	   r   	_registryr   r   r   r)   r+   r   r   r   <module>r-      s    				  ' ' ' ' ' '   LLL,/ ,/ ,/ ,/^     s    