

"""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


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

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

_lowercase					:     str				 =		[
    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 	lowercase__		(    snake_case_					:Tuple  ):



	if "://" in dataset_path:
		__UpperCAmelCase							=      dataset_path.split('''://'''  )[1]
	return dataset_path





def 	lowercase__		(    snake_case_					:List[str]  ):



	if fs is not None and fs.protocol != "file":
		return True
	else:
		return False





def 	lowercase__		(    snake_case_					:Tuple       ,						snake_case_					:Optional[Any]       ,						snake_case_					:Any  ):
	__UpperCAmelCase							=      not is_remote_filesystem(A__  )
	if is_local:
		# LocalFileSystem.mv does copy + rm, it is more efficient to simply move a local directory
		shutil.move(fs._strip_protocol(A__  )       ,						fs._strip_protocol(A__  )  )
	else:
		fs.mv(A__       ,						A__       ,						recursive=A__  )





def 	lowercase__		(    ):



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



'''simple docstring'''






def 		_A     (    A__ = 10     ,				A__ = 22      ):






 """simple docstring"""



 __lowercase							  = range(1     ,				A__      )
 __lowercase							  = range(1     ,				A__      )
 return sum(
     1 for power in powers for base in bases if len(str(base**power      )      ) == power      )


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

