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


__A			   = importlib.util.find_spec("s3fs") is not None

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

__A			   = [
    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 SCREAMING_SNAKE_CASE__			(   __UpperCAmelCase )  ->  str:
   if "://" in dataset_path:
      lowercase__:   str					=      dataset_path.split('''://''' )[1]
   return dataset_path



def SCREAMING_SNAKE_CASE__			(   __UpperCAmelCase )  ->  bool:
   if fs is not None and fs.protocol != "file":
      return True
   else:
      return False



def SCREAMING_SNAKE_CASE__			(   __UpperCAmelCase       ,    __UpperCAmelCase       ,    __UpperCAmelCase )  ->  Tuple:
   lowercase__:   str					=      not is_remote_filesystem(__UpperCAmelCase )
   if is_local:
      # LocalFileSystem.mv does copy + rm, it is more efficient to simply move a local directory
      shutil.move(fs._strip_protocol(__UpperCAmelCase )       ,    fs._strip_protocol(__UpperCAmelCase ) )
   else:
      fs.mv(__UpperCAmelCase       ,    __UpperCAmelCase       ,    recursive=__UpperCAmelCase )




def SCREAMING_SNAKE_CASE__			(   )  ->  None:
   if hasattr(fsspec.asyn       ,    '''reset_lock''' ):
      # for future fsspec>2022.05.0
      fsspec.asyn.reset_lock()
   else:
      lowercase__:   str					=      None
      lowercase__:   Dict					=      None
      lowercase__:   List[str]					=      threading.Lock()

"""simple docstring"""






from __future__ import annotations

from fractions import Fraction



def SCREAMING_SNAKE_CASE__			(   __UpperCAmelCase       ,    __UpperCAmelCase )  ->  bool:
   return (
       num != den and num % 1_0 == den // 1_0 and (num // 1_0) / (den % 1_0) == num / den
   )



def SCREAMING_SNAKE_CASE__			(   __UpperCAmelCase )  ->  list[str]:
   lowercase__:   str					=      []
   lowercase__:   str					=      1_1
   lowercase__:   str					=      int('''1''' + '''0''' * digit_len )
   for num in range(__UpperCAmelCase       ,    __UpperCAmelCase ):
      while den <= 9_9:
         if (num != den) and (num % 1_0 == den // 1_0) and (den % 1_0 != 0):
            if is_digit_cancelling(__UpperCAmelCase       ,    __UpperCAmelCase ):
               solutions.append(F"""{num}/{den}""" )
         den += 1
      num += 1
      lowercase__:   Dict					=      1_0
   return solutions



def SCREAMING_SNAKE_CASE__			(   __UpperCAmelCase = 2 )  ->  int:
   lowercase__:   List[str]					=      1.0
   for fraction in fraction_list(__UpperCAmelCase ):
      lowercase__:   List[str]					=      Fraction(__UpperCAmelCase )
      result *= frac.denominator / frac.numerator
   return int(__UpperCAmelCase )


if __name__ == "__main__":
       print(solution())
