U
    ¬9%e+  ã                1   @  sä  U d dl mZ d dlZd dlZd dlZdddgZi Zded< e e¡Z	dZ
dYd
d„Zddiddidddœdddœdddœddiddidddœdddœdddœdddœdddœddidddœdddœdd dœd!d"dœd!d"dœd#d$dœd%d&dœd%d'dœd(d)dœd*d+dœd,d-dœd,d-dœdd.idd.idd/idd0id1d2dœd3d4dœd5d6dœd7d8dœd9d:dœd;d<dœd;d<dœd=d>dœdd?idd@idAdBdœdCdDdœdEdFdœdGdHdœdIdJdœddKidLdMdœdNdOdœdPœ/ZdQd„ ZdRZdZdSdT„ZdUdV„ ZdWdX„ ZdS )[é    )ÚannotationsNÚregistryÚget_filesystem_classÚdefaultzdict[str, type]Ú	_registryÚfileFc                 C  sŠ   t |tƒrT| tkr8|dkr8|t|  d krRtd|  ƒ‚q†||pHd|| f dœt| < n2| tkr~|dkr~t|  |k	r†td|  ƒ‚n|t| < dS )a  Add implementation class to the registry

    Parameters
    ----------
    name: str
        Protocol name to associate with the class
    cls: class or str
        if a class: fsspec-compliant implementation class (normally inherits from
        ``fsspec.AbstractFileSystem``, gets added straight to the registry. If a
        str, the full path to an implementation class like package.module.class,
        which gets added to known_implementations,
        so the import is deferred until the filesystem is actually used.
    clobber: bool (optional)
        Whether to overwrite a protocol with the same name; if False, will raise
        instead.
    errtxt: str (optional)
        If given, then a failure to import the given class will result in this
        text being given.
    FÚclasszCName (%s) already in the known_implementations and clobber is Falsez %s import failed for protocol %s©r   Úerrz6Name (%s) already in the registry and clobber is FalseN)Ú
isinstanceÚstrÚknown_implementationsÚ
ValueErrorr   r   )ÚnameÚclsÚclobberZerrtxt© r   úN/var/www/html/Darija-Ai-API/env/lib/python3.8/site-packages/fsspec/registry.pyÚregister_implementation   s"    
ÿÿþÿr   r   z,fsspec.implementations.local.LocalFileSystemz.fsspec.implementations.memory.MemoryFileSystemz%dropboxdrivefs.DropboxDriveFileSystemzTDropboxFileSystem requires "dropboxdrivefs","requests" and "dropbox" to be installedr	   z*fsspec.implementations.http.HTTPFileSystemz@HTTPFileSystem requires "requests" and "aiohttp" to be installedz(fsspec.implementations.zip.ZipFileSystemz(fsspec.implementations.tar.TarFileSystemzgcsfs.GCSFileSystemz-Please install gcsfs to access Google Storagezgdrivefs.GoogleDriveFileSystemz2Please install gdrivefs for access to Google Drivez*fsspec.implementations.sftp.SFTPFileSystemz2SFTPFileSystem requires "paramiko" to be installedz(fsspec.implementations.ftp.FTPFileSystemz-fsspec.implementations.arrow.HadoopFileSystemz2pyarrow and local java libraries required for HDFSz&fsspec.implementations.webhdfs.WebHDFSz2webHDFS access requires "requests" to be installedzs3fs.S3FileSystemzInstall s3fs to access S3zwandbfs.WandbFSzInstall wandbfs to access wandbzocifs.OCIFileSystemz*Install ocifs to access OCI Object Storagez%Install ocifs to access OCI Data Lakez&morefs.asyn_local.AsyncLocalFileSystemz:Install 'morefs[asynclocalfs]' to use AsyncLocalFileSystemzadlfs.AzureDatalakeFileSystemz+Install adlfs to access Azure Datalake Gen1zadlfs.AzureBlobFileSystemzBInstall adlfs to access Azure Datalake Gen2 and Azure Blob Storagez/fsspec.implementations.cached.CachingFileSystemz6fsspec.implementations.cached.WholeFileCacheFileSystemz3fsspec.implementations.cached.SimpleCacheFileSystemz0fsspec.implementations.dask.DaskWorkerFileSystemz5Install dask distributed to access worker file systemz0fsspec.implementations.dbfs.DatabricksFileSystemz<Install the requests package to use the DatabricksFileSystemz.fsspec.implementations.github.GithubFileSystemz1Install the requests package to use the github FSz(fsspec.implementations.git.GitFileSystemz(Install pygit2 to browse local git reposz(fsspec.implementations.smb.SMBFileSystemz?SMB requires "smbprotocol" or "smbprotocol[kerberos]" installedz0fsspec.implementations.jupyter.JupyterFileSystemz,Jupyter FS requires requests to be installedz6fsspec.implementations.libarchive.LibArchiveFileSystemz#LibArchive requires to be installedz4fsspec.implementations.reference.ReferenceFileSystemz fsspec.generic.GenericFileSystemzossfs.OSSFileSystemz5Install ossfs to access Alibaba Object Storage Systemzwebdav4.fsspec.WebdavFileSystemz Install webdav4 to access WebDAVzdvc.api.DVCFileSystemz#Install dvc to access DVCFileSystemzhuggingface_hub.HfFileSystemz.Install huggingface_hub to access HfFileSystemzfsspec_xrootd.XRootDFileSystemz–Install fsspec-xrootd to access xrootd storage system. Note: 'root' is the protocol name for xrootd storage systems, not referring to root directoriesz*fsspec.implementations.dirfs.DirFileSystemzboxfs.BoxFileSystemz,Please install boxfs to access BoxFileSystemzlakefs_spec.LakeFSFileSystemz5Please install lakefs-spec to access LakeFSFileSystem)/r   ZmemoryZdropboxÚhttpÚhttpsÚzipÚtarZgcsÚgsZgdriveÚsftpÚsshÚftpZhdfsÚ
arrow_hdfsZwebhdfsÚs3Zs3aZwandbZociZocilakeZ
asynclocalÚadlZabfsÚazÚcachedZ
blockcacheÚ	filecacheZsimplecacheZdaskZdbfsZgithubÚgitÚsmbÚjupyterZjlabZ
libarchiveÚ	referenceZgenericZossZwebdavZdvcZhfÚrootÚdirÚboxZlakefsc              
   C  s–   | st } | tkrt| tkr$td|  ƒ‚t|  }zt| t|d ƒƒ W n0 tk
rr } zt|d ƒ|‚W 5 d}~X Y nX t|  }t|ddƒdkr’| |_|S )aK  Fetch named protocol implementation from the registry

    The dict ``known_implementations`` maps protocol names to the locations
    of classes implementing the corresponding file-system. When used for the
    first time, appropriate imports will happen and the class will be placed in
    the registry. All subsequent calls will fetch directly from the registry.

    Some protocol implementations require additional dependencies, and so the
    import may fail. In this case, the string in the "err" field of the
    ``known_implementations`` will be given as the error message.
    zProtocol not known: %sr   r
   NÚprotocol)ZabstractN)	r   r   r   r   r   Ú_import_classÚImportErrorÚgetattrr*   )r*   ÚbitÚer   r   r   r   r   Ö   s     zëYour installed version of s3fs is very old and known to cause
severe performance issues, see also https://github.com/dask/dask/issues/10276

To fix, you should specify a lower version bound on s3fs, or
update the current installation.
c                 C  s¼   d| krj|   dd¡\}}|dk}t |¡}|rL|j d¡ddgk rLt t¡ | d¡D ]}t||ƒ}qV|S |   dd¡\}}|dk}t |¡}|r®|j d¡ddgk r®t t¡ t||ƒS dS )z–Take a string FQP and return the imported class or identifier

    clas is of the form "package.module.klass" or "package.module:subobject.klass"
    ú:é   Zs3fsÚ.Ú0Ú5N)	ÚrsplitÚ	importlibÚimport_moduleÚ__version__ÚsplitÚwarningsÚwarnÚs3_msgr-   )r   ZminvÚmodr   r   Úpartr   r   r   r+   ü   s    



r+   c                 K  s&   | dkrt  dt¡ t| ƒ}|f |ŽS )z«Instantiate filesystems for given protocol and arguments

    ``storage_options`` are specific to the protocol being chosen, and are
    passed directly to the class.
    r   zfThe 'arrow_hdfs' protocol has been deprecated and will be removed in the future. Specify it as 'hdfs'.)r:   r;   ÚDeprecationWarningr   )r*   Zstorage_optionsr   r   r   r   Ú
filesystem  s    ýr@   c                   C  s   t tƒS )zReturn a list of the implemented protocols.

    Note that any given protocol may require extra packages to be importable.
    )Úlistr   r   r   r   r   Úavailable_protocols$  s    rB   )FN)N)Ú
__future__r   r6   Útypesr:   Ú__all__r   Ú__annotations__ÚMappingProxyTyper   r   r   r   r   r<   r+   r@   rB   r   r   r   r   Ú<module>   s    


.ýþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþ€ ï 
