





import os
from typing import Optional

import fsspec
from fsspec.archive import AbstractArchiveFileSystem
from fsspec.utils import DEFAULT_BLOCK_SIZE




class 	UpperCamelCase_							(  UpperCamelCase__     ):
							lowerCamelCase_							     =       ""
							lowerCamelCase_							     =       (
							    None  # protocol passed in prefix to the url. ex: "gzip", for gzip://file.txt::http://foo.bar/file.txt.gz
							)
							lowerCamelCase_							     =       None  # compression type in fsspec. ex: "gzip"
							lowerCamelCase_							     =       None  # extension of the filename to strip. ex: "".gz" to get file.txt from file.txt.gz


							def __init__(				self     :Optional[int]				,					__A     :str = ""				,					__A     :Optional[str] = None				,					__A     :Optional[dict] = None				,					**__A     :List[str]		) -> Any:



									"""simple docstring"""



									super().__init__(self				,					**__A		)
									# always open as "rb" since fsspec can then use the TextIOWrapper to make it work for "r" mode
									SCREAMING_SNAKE_CASE__								=   fsspec.open(
									    __A				,					mode="""rb"""				,					protocol=__A				,					compression=self.compression				,					client_kwargs={
									        """requote_redirect_url""": False,  # see https://github.com/huggingface/datasets/pull/5459
									        """trust_env""": True,  # Enable reading proxy env variables.
									        **(target_options or {}).pop("""client_kwargs"""				,					{}		),  # To avoid issues if it was already passed.
									    }				,					**(target_options or {})				,					)
									SCREAMING_SNAKE_CASE__								=   os.path.basename(self.file.path.split("""::"""		)[0]		)
									SCREAMING_SNAKE_CASE__								=   (
									    self.compressed_name[: self.compressed_name.rindex("""."""		)]
									    if """.""" in self.compressed_name
									    else self.compressed_name
									)
									SCREAMING_SNAKE_CASE__								=   None


							@classmethod
							def   _snake_case	(				cls     :Any				,					__A     :Tuple		) -> List[str]:



									"""simple docstring"""



									return super()._strip_protocol(__A		).lstrip("""/"""		)


							def   _snake_case	(				self     :Union[str, Any]		) -> Tuple:



									"""simple docstring"""



									if self.dir_cache is None:
											SCREAMING_SNAKE_CASE__								=   {**self.file.fs.info(self.file.path		), """name""": self.uncompressed_name}
											SCREAMING_SNAKE_CASE__								=   {f["""name"""]: f}


							def   _snake_case	(				self     :Optional[int]				,					__A     :str		) -> str:



									"""simple docstring"""



									return self.file.open().read()


							def   _snake_case	(				self     :List[str]				,					__A     :str				,					__A     :str = "rb"				,					__A     :int=None				,					__A     :List[str]=True				,					__A     :Optional[Any]=None				,					**__A     :Union[str, Any]				,					) -> Any:



									"""simple docstring"""



									SCREAMING_SNAKE_CASE__								=   self._strip_protocol(__A		)
									if mode != "rb":
											raise ValueError(f'''Tried to read with mode {mode} on file {self.file.path} opened with mode \'rb\''''		)
									return self.file.open()




class 	UpperCamelCase_							(  UpperCamelCase__     ):
							lowerCamelCase_							     =       "bz2"
							lowerCamelCase_							     =       "bz2"
							lowerCamelCase_							     =       ".bz2"




class 	UpperCamelCase_							(  UpperCamelCase__     ):
							lowerCamelCase_							     =       "gzip"
							lowerCamelCase_							     =       "gzip"
							lowerCamelCase_							     =       ".gz"




class 	UpperCamelCase_							(  UpperCamelCase__     ):
							lowerCamelCase_							     =       "lz4"
							lowerCamelCase_							     =       "lz4"
							lowerCamelCase_							     =       ".lz4"




class 	UpperCamelCase_							(  UpperCamelCase__     ):
							lowerCamelCase_							     =       "xz"
							lowerCamelCase_							     =       "xz"
							lowerCamelCase_							     =       ".xz"




class 	UpperCamelCase_							(  UpperCamelCase__     ):
							lowerCamelCase_							     =       "zstd"
							lowerCamelCase_							     =       "zstd"
							lowerCamelCase_							     =       ".zst"


							def __init__(				self     :List[Any]				,					__A     :str				,					__A     :str = "rb"				,					__A     :Optional[str] = None				,					__A     :Optional[dict] = None				,					__A     :int = DEFAULT_BLOCK_SIZE				,					**__A     :Optional[int]				,					) -> Union[str, Any]:



									"""simple docstring"""



									super().__init__(
									    fo=__A				,					mode=__A				,					target_protocol=__A				,					target_options=__A				,					block_size=__A				,					**__A				,					)
									# We need to wrap the zstd decompressor to avoid this error in fsspec==2021.7.0 and zstandard==0.15.2:
									#
									# File "/Users/user/.virtualenvs/hf-datasets/lib/python3.7/site-packages/fsspec/core.py", line 145, in open
									#     out.close = close
									# AttributeError: 'zstd.ZstdDecompressionReader' object attribute 'close' is read-only
									#
									# see https://github.com/intake/filesystem_spec/issues/725
									SCREAMING_SNAKE_CASE__								=   self.file.__enter__




									class 	UpperCamelCase_							:


																def __init__(				self     :int				,					__A     :Tuple		) -> int:



																		"""simple docstring"""



																		SCREAMING_SNAKE_CASE__								=   file_


																def __enter__(				self     :Optional[Any]		) -> Optional[int]:



																		"""simple docstring"""



																		self._file.__enter__()
																		return self


																def __exit__(				self     :Optional[Any]				,					*__A     :List[Any]				,					**__A     :int		) -> Tuple:



																		"""simple docstring"""



																		self._file.__exit__(*__A				,					**__A		)


																def __iter__(				self     :Any		) -> Optional[int]:



																		"""simple docstring"""



																		return iter(self._file		)


																def   _snake_case	(				self     :Dict		) -> Dict:



																		"""simple docstring"""



																		return next(self._file		)


																def __getattr__(				self     :Union[str, Any]				,					__A     :List[str]		) -> Optional[Any]:



																		"""simple docstring"""



																		return getattr(self._file				,					__A		)

									def fixed_enter(*__A     :List[Any]				,					**__A     :Optional[int]		):
											return WrappedFile(_enter(*__A				,					**__A		)		)

									SCREAMING_SNAKE_CASE__								=   fixed_enter


from ..utils import DummyObject, requires_backends



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  List[str]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  Any    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  List[Any]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  List[Any]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  List[Any]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  Union[str, Any]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  Dict    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  List[Any]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  List[str]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  List[Any]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  List[Any]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  Any    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  Optional[int]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  str    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  Dict    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  int    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  int    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  str    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  List[Any]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  List[str]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  Optional[int]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  Union[str, Any]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  Tuple    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  List[Any]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  str    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  Dict    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  str    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  Any    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  Union[str, Any]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  Optional[Any]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  Tuple    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



