U
    h.-                  4   @  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
d`d
dZdddddddddddiddddddddidddddidddddidddddid d!dd"d#ddd$idd%idd&id'd(dd)d*ddd+id,d-dd.d/dd'd(ddddd0d1dd2d3dd2d3dd4d5dd4d5dd6d7dd8d9ddd$idd:id;d<dd;d=dd>d?ddd@idAdBddCdDddCdDddEdFdddGidHdIddEdFdddJidKdLddMdNddOdPddQdRdddSidT3ZeeeekstdUdVd ZdWZdXdYdZd[Zd\d] Zd^d_ ZdS )a    )annotationsNregistryget_filesystem_classdefaultzdict[str, type]	_registryfileFc                 C  s   t |trZ| tkr<|dkr<|t|  d krXtd|  dq||pN| d|  dt| < n6| tkr|dkrt|  |k	rtd|  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classzName (z;) already in the known_implementations and clobber is Falsez import failed for protocol r   errz.) already in the registry and clobber is FalseN)
isinstancestrknown_implementations
ValueErrorr   r   )nameclsclobberZerrtxt r   A/var/www/html/venv/lib/python3.8/site-packages/fsspec/registry.pyregister_implementation   s    


r   zadlfs.AzureBlobFileSystemzBInstall adlfs to access Azure Datalake Gen2 and Azure Blob Storager	   zadlfs.AzureDatalakeFileSystemz+Install adlfs to access Azure Datalake Gen1z-fsspec.implementations.arrow.HadoopFileSystemz2pyarrow and local java libraries required for HDFSr   z*morefs.asyn_wrapper.AsyncWrapperFileSystemz&morefs.asyn_local.AsyncLocalFileSystemz:Install 'morefs[asynclocalfs]' to use AsyncLocalFileSystemz/fsspec.implementations.cached.CachingFileSystemzboxfs.BoxFileSystemz,Please install boxfs to access BoxFileSystemz0fsspec.implementations.dask.DaskWorkerFileSystemz5Install dask distributed to access worker file systemz*fsspec.implementations.data.DataFileSystemz0fsspec.implementations.dbfs.DatabricksFileSystemz<Install the requests package to use the DatabricksFileSystemz*fsspec.implementations.dirfs.DirFileSystemz%dropboxdrivefs.DropboxDriveFileSystemzUDropboxFileSystem requires "dropboxdrivefs","requests" and ""dropbox" to be installedzdvc.api.DVCFileSystemz#Install dvc to access DVCFileSystemz,fsspec.implementations.local.LocalFileSystemz6fsspec.implementations.cached.WholeFileCacheFileSystemz(fsspec.implementations.ftp.FTPFileSystemzgcsfs.GCSFileSystemz-Please install gcsfs to access Google Storagezgdrivefs.GoogleDriveFileSystemz2Please install gdrivefs for access to Google Drivez fsspec.generic.GenericFileSystemz(fsspec.implementations.git.GitFileSystemz(Install pygit2 to browse local git reposz.fsspec.implementations.github.GithubFileSystemz1Install the requests package to use the github FSzhuggingface_hub.HfFileSystemz.Install huggingface_hub to access HfFileSystemz*fsspec.implementations.http.HTTPFileSystemz@HTTPFileSystem requires "requests" and "aiohttp" to be installedz0fsspec.implementations.jupyter.JupyterFileSystemz,Jupyter FS requires requests to be installedzlakefs_spec.LakeFSFileSystemz5Please install lakefs-spec to access LakeFSFileSystemz6fsspec.implementations.libarchive.LibArchiveFileSystemz#LibArchive requires to be installedz.fsspec.implementations.memory.MemoryFileSystemzocifs.OCIFileSystemz*Install ocifs to access OCI Object Storagez%Install ocifs to access OCI Data Lakezossfs.OSSFileSystemz5Install ossfs to access Alibaba Object Storage Systemz4fsspec.implementations.reference.ReferenceFileSystemzfsspec_xrootd.XRootDFileSystemzInstall fsspec-xrootd to access xrootd storage system. Note: 'root' is the protocol name for xrootd storage systems, not referring to root directorieszs3fs.S3FileSystemzInstall s3fs to access S3z*fsspec.implementations.sftp.SFTPFileSystemz2SFTPFileSystem requires "paramiko" to be installedz3fsspec.implementations.cached.SimpleCacheFileSystemz(fsspec.implementations.smb.SMBFileSystemz?SMB requires "smbprotocol" or "smbprotocol[kerberos]" installedz(fsspec.implementations.tar.TarFileSystemztosfs.TosFileSystemzFInstall tosfs to access ByteDance volcano engine Tinder Object Storagezwandbfs.WandbFSzInstall wandbfs to access wandbzwebdav4.fsspec.WebdavFileSystemz Install webdav4 to access WebDAVz&fsspec.implementations.webhdfs.WebHDFSz2webHDFS access requires "requests" to be installedz(fsspec.implementations.zip.ZipFileSystem)3Zabfsadl
arrow_hdfsZasync_wrapperZ
asynclocalazZ
blockcacheboxcachedZdaskdataZdbfsdirZdropboxZdvcr   	filecacheftpZgcsZgdriveZgenericgitZgithubgsZhdfsZhfhttphttpsZjlabjupyterZlakefsZ
libarchivelocalZmemoryZociZocilakeZoss	referencerootZs3Zs3asftpZsimplecachesmbsshtarZtosfsZwandbZwebdavZwebhdfszipzNot in alphabetical orderc              
   C  s   | st } | tkrv| tkr&td|  t|  }zt| t|d  W n0 tk
rt } 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: r   r
   Nprotocol)ZabstractN)	r   r   r   r   r   _import_classImportErrorgetattrr+   )r+   biter   r   r   r   r      s     zYour 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.
r   )fqpc                 C  s   d| kr|  dd\}}n|  dd\}}|dk}t|}|r^|jdddgk r^tt |dD ]}t||}qht	|t
st|  d|S )aK  Take a fully-qualified path and return the imported class or identifier.

    ``fqp`` is of the form "package.module.klass" or
    "package.module:subobject.klass".

    Warnings
    --------
    This can import arbitrary modules. Make sure you haven't installed any modules
    that may execute malicious code at import time.
    :   .Zs3fs05z is not a class)rsplit	importlibimport_module__version__splitwarningswarns3_msgr.   r   type	TypeError)r1   modr   Zis_s3partr   r   r   r,     s    


r,   c                 K  s&   | dkrt dt t| }|f |S )zInstantiate 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    rD   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_protocols9  s    rF   )FN)
__future__r   r8   typesr<   __all__r   __annotations__MappingProxyTyper   r   r   r   rE   sortedAssertionErrorr   r>   r,   rD   rF   r   r   r   r   <module>   s   


/   #