"""simple docstring"""






import importlib
import shutil
import threading
import warnings
from typing import List

import fsspec
import fsspec.asyn

from . import compression
from .hffilesystem import HfFileSystem


lowerCAmelCase__  :  Optional[int]						     =	importlib.util.find_spec('s3fs') is not None

if _has_safs:
						from .safilesystem import SaFileSystem  # noqa: F401

lowerCAmelCase__  :  List[compression.BaseCompressedFileFileSystem]						     =	[
    compression.BzaFileSystem,
    compression.GzipFileSystem,
    compression.LzaFileSystem,
    compression.XzFileSystem,
    compression.ZstdFileSystem,
]

# Register custom filesystems
for fs_class in COMPRESSION_FILESYSTEMS + [HfFileSystem]:
						if fs_class.protocol in fsspec.registry and fsspec.registry[fs_class.protocol] is not fs_class:
												warnings.warn(F"""A filesystem protocol was already set for {fs_class.protocol} and will be overwritten.""")
						fsspec.register_implementation(fs_class.protocol, fs_class, clobber=True)



def   a_						(					lowerCamelCase       ):
				if "://" in dataset_path:
								UpperCAmelCase__             =							dataset_path.split('://'       )[1]
				return dataset_path



def   a_						(					lowerCamelCase       ):
				if fs is not None and fs.protocol != "file":
								return True
				else:
								return False



def   a_						(					lowerCamelCase					,			lowerCamelCase					,			lowerCamelCase       ):
				UpperCAmelCase__             =							not is_remote_filesystem(lowerCamelCase       )
				if is_local:
								# LocalFileSystem.mv does copy + rm, it is more efficient to simply move a local directory
								shutil.move(fs._strip_protocol(lowerCamelCase       )					,			fs._strip_protocol(lowerCamelCase       )       )
				else:
								fs.mv(lowerCamelCase					,			lowerCamelCase					,			recursive=lowerCamelCase       )







def   a_						(					):
				if hasattr(fsspec.asyn					,			'reset_lock'       ):
								# for future fsspec>2022.05.0
								fsspec.asyn.reset_lock()
				else:
								UpperCAmelCase__             =							None
								UpperCAmelCase__             =							None
								UpperCAmelCase__             =							threading.Lock()






from __future__ import annotations






def        UpperCamelCase_(							_snake_case   :  int	):




			"""simple docstring"""






			__a        =str(_snake_case	)
			return len(_snake_case	) == 9 and set(_snake_case	) == set('123456789'	)






def        UpperCamelCase_(							):




			"""simple docstring"""






			for base_num in range(9999       ,     4999       ,     -1	):
						__a        =100002 * base_num
						if is_9_pandigital(_snake_case	):
									return candidate

			for base_num in range(333       ,     99       ,     -1	):
						__a        =1002003 * base_num
						if is_9_pandigital(_snake_case	):
									return candidate

			return None


if __name__ == "__main__":
						print(f'''{solution() = }''')






