code: 
  '''simple docstring'''
  
  import posixpath
  from pathlib import Path
  from unittest.mock import patch
  
  import pytest
  from fsspec.implementations.local import AbstractFileSystem, LocalFileSystem, stringify_path
  from fsspec.registry import _registry as _fsspec_registry
  
  class 			UpperCAmelCase				(					__UpperCAmelCase ):
  
  
  
  
  
  		"""simple docstring"""
  
  
  
  
  
  		A__  :   Tuple          =    """mock"""
  		def __init__(    self  ,					*_snake_case  ,					_snake_case  ,					**_snake_case     )				->    Optional[int]:
  				super().__init__()
  				_UpperCamelCase       : str    =      LocalFileSystem(*lowerCamelCase__  ,					**lowerCamelCase__     )
  				_UpperCamelCase       : Dict    =      Path(lowerCamelCase__     ).resolve().as_posix() + '''/'''
  		def _lowercase  (    self  ,					_snake_case  ,					*_snake_case  ,					**_snake_case     )				->    str:
  				_UpperCamelCase       : Tuple    =      posixpath.join(self.local_root_dir  ,					self._strip_protocol(lowerCamelCase__     )     )
  				return self._fs.mkdir(lowerCamelCase__  ,					*lowerCamelCase__  ,					**lowerCamelCase__     )
  		def _lowercase  (    self  ,					_snake_case  ,					*_snake_case  ,					**_snake_case     )				->    int:
  				_UpperCamelCase       : Union[str, Any]    =      posixpath.join(self.local_root_dir  ,					self._strip_protocol(lowerCamelCase__     )     )
  				return self._fs.makedirs(lowerCamelCase__  ,					*lowerCamelCase__  ,					**lowerCamelCase__     )
  		def _lowercase  (    self  ,					_snake_case     )				->    Optional[int]:
  				_UpperCamelCase       : Tuple    =      posixpath.join(self.local_root_dir  ,					self._strip_protocol(lowerCamelCase__     )     )
  				return self._fs.rmdir(lowerCamelCase__     )
  		def _lowercase  (    self  ,					_snake_case  ,					_snake_case=True  ,					*_snake_case  ,					**_snake_case     )				->    str:
  				_UpperCamelCase       : int    =      posixpath.join(self.local_root_dir  ,					self._strip_protocol(lowerCamelCase__     )     )
  				_UpperCamelCase       : Any    =      self._fs.ls(lowerCamelCase__  ,					detail=lowerCamelCase__  ,					*lowerCamelCase__  ,					**lowerCamelCase__     )
  				if detail:
  						return [{**info, "name": info["name"][len(self.local_root_dir     ) :]} for info in out]
  				else:
  						return [name[len(self.local_root_dir     ) :] for name in out]
  		def _lowercase  (    self  ,					_snake_case  ,					*_snake_case  ,					**_snake_case     )				->    Dict:
  				_UpperCamelCase       : List[Any]    =      posixpath.join(self.local_root_dir  ,					self._strip_protocol(lowerCamelCase__     )     )
  				_UpperCamelCase       : Union[str, Any]    =      dict(self._fs.info(lowerCamelCase__  ,					*lowerCamelCase__  ,					**lowerCamelCase__     )     )
  				_UpperCamelCase       : Any    =      out['''name'''][len(self.local_root_dir     ) :]
  				return out
  		def _lowercase  (    self  ,					_snake_case  ,					_snake_case  ,					*_snake_case  ,					**_snake_case     )				->    List[str]:
  				_UpperCamelCase       : List[str]    =      posixpath.join(self.local_root_dir  ,					self._strip_protocol(lowerCamelCase__     )     )
  				_UpperCamelCase       : int    =      posixpath.join(self.local_root_dir  ,					self._strip_protocol(lowerCamelCase__     )     )
  				return self._fs.cp_file(lowerCamelCase__  ,					lowerCamelCase__  ,					*lowerCamelCase__  ,					**lowerCamelCase__     )
  		def _lowercase  (    self  ,					_snake_case  ,					*_snake_case  ,					**_snake_case     )				->    int:
  				_UpperCamelCase       : int    =      posixpath.join(self.local_root_dir  ,					self._strip_protocol(lowerCamelCase__     )     )
  				return self._fs.rm_file(lowerCamelCase__  ,					*lowerCamelCase__  ,					**lowerCamelCase__     )
  		def _lowercase  (    self  ,					_snake_case  ,					*_snake_case  ,					**_snake_case     )				->    List[str]:
  				_UpperCamelCase       : Union[str, Any]    =      posixpath.join(self.local_root_dir  ,					self._strip_protocol(lowerCamelCase__     )     )
  				return self._fs.rm(lowerCamelCase__  ,					*lowerCamelCase__  ,					**lowerCamelCase__     )
  		def _lowercase  (    self  ,					_snake_case  ,					*_snake_case  ,					**_snake_case     )				->    Union[str, Any]:
  				_UpperCamelCase       : Union[str, Any]    =      posixpath.join(self.local_root_dir  ,					self._strip_protocol(lowerCamelCase__     )     )
  				return self._fs._open(lowerCamelCase__  ,					*lowerCamelCase__  ,					**lowerCamelCase__     )
  		def _lowercase  (    self  ,					_snake_case     )				->    Tuple:
  				_UpperCamelCase       : str    =      posixpath.join(self.local_root_dir  ,					self._strip_protocol(lowerCamelCase__     )     )
  				return self._fs.created(lowerCamelCase__     )
  		def _lowercase  (    self  ,					_snake_case     )				->    Optional[int]:
  				_UpperCamelCase       : Optional[int]    =      posixpath.join(self.local_root_dir  ,					self._strip_protocol(lowerCamelCase__     )     )
  				return self._fs.modified(lowerCamelCase__     )
  
  
  
  
  		@classmethod
  		def _lowercase  (    cls  ,					_snake_case     )				->    Optional[Any]:
  				_UpperCamelCase       : Tuple    =      stringify_path(lowerCamelCase__     )
  				if path.startswith('''mock://'''     ):
  						_UpperCamelCase       : Dict    =      path[7:]
  				return path
  
  
  
  
  
  
  
  class 			UpperCAmelCase				(					__UpperCAmelCase ):
  
  
  
  
  
  		"""simple docstring"""
  
  
  
  
  
  		A__  :   Optional[Any]          =    """tmp"""
  		A__  :   str          =    None
  		def __init__(    self  ,					*_snake_case  ,					**_snake_case     )				->    Optional[int]:
  				assert self.tmp_dir is not None, "TmpDirFileSystem.tmp_dir is not set"
  				super().__init__(*lowerCamelCase__  ,					**lowerCamelCase__  ,					local_root_dir=self.tmp_dir  ,					auto_mkdir=lowerCamelCase__     )
  
  
  
  
  		@classmethod
  		def _lowercase  (    cls  ,					_snake_case     )				->    str:
  				_UpperCamelCase       : int    =      stringify_path(lowerCamelCase__     )
  				if path.startswith('''tmp://'''     ):
  						_UpperCamelCase       : str    =      path[6:]
  				return path
  
  
  
  
  
  
  
  @pytest.fixture
  def 						snake_case__	(      ) ->      Dict:
  		_UpperCamelCase       : List[str]    =      MockFileSystem
  		_UpperCamelCase       : List[Any]    =      TmpDirFileSystem
  		yield
  		del _fsspec_registry["mock"]
  		del _fsspec_registry["tmp"]
  
  
  
  
  
  
  
  @pytest.fixture
  def 						snake_case__	(      UpperCamelCase			,UpperCamelCase	) ->      Union[str, Any]:
  		_UpperCamelCase       : Optional[Any]    =      tmp_path_factory.mktemp('''mockfs'''	)
  		return MockFileSystem(local_root_dir=lowercase__			,auto_mkdir=lowercase__	)
  
  
  
  
  
  
  
  @pytest.fixture
  def 						snake_case__	(      UpperCamelCase			,UpperCamelCase	) ->      Optional[Any]:
  		_UpperCamelCase       : int    =      tmp_path_factory.mktemp('''tmpfs'''	)
  		with patch.object(lowercase__			,'''tmp_dir'''			,lowercase__	):
  				yield TmpDirFileSystem()
  
  
  
  
style_context: 
  '''simple docstring'''
  
  from typing import TYPE_CHECKING
  
  from ...utils import (
      OptionalDependencyNotAvailable,
      _LazyModule,
      is_flax_available,
      is_tf_available,
      is_torch_available,
  )
  
  
  _UpperCAmelCase   :      int 						=  {
      """configuration_gptsan_japanese""": ["""GPTSAN_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP""", """GPTSanJapaneseConfig"""],
      """tokenization_gptsan_japanese""": ["""GPTSanJapaneseTokenizer"""],
  }
  
  try:
  	if not is_torch_available():
  		raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
  	pass
  else:
  	_UpperCAmelCase   :      int 						=  [
  	    """GPTSAN_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST""",
  	    """GPTSanJapaneseForConditionalGeneration""",
  	    """GPTSanJapaneseModel""",
  	    """GPTSanJapanesePreTrainedModel""",
  	]
  	_UpperCAmelCase   :      str 						=  [
  	    """GPTSanJapaneseTokenizer""",
  	]
  
  
  if TYPE_CHECKING:
  	from .configuration_gptsan_japanese import GPTSAN_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTSanJapaneseConfig
  	from .tokenization_gptsan_japanese import GPTSanJapaneseTokenizer
  
  	try:
  		if not is_torch_available():
  			raise OptionalDependencyNotAvailable()
  	except OptionalDependencyNotAvailable:
  		pass
  	else:
  		from .modeling_gptsan_japanese import (
  		    GPTSAN_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST,
  		    GPTSanJapaneseForConditionalGeneration,
  		    GPTSanJapaneseModel,
  		    GPTSanJapanesePreTrainedModel,
  		)
  		from .tokenization_gptsan_japanese import GPTSanJapaneseTokenizer
  
  
  else:
  	import sys
  
  	_UpperCAmelCase   :      List[str] 						=  _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)
  
  
  
  
  
  