






"""simple docstring"""






import os
from typing import Optional

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





class       snake_case_       (    _lowerCamelCase       ):



	"""simple docstring"""

	SCREAMING_SNAKE_CASE_:							List[Any]   			=					""""""
	SCREAMING_SNAKE_CASE_:							str   			=					(
	    None  # protocol passed in prefix to the url. ex: "gzip", for gzip://file.txt::http://foo.bar/file.txt.gz
	)
	SCREAMING_SNAKE_CASE_:							str   			=					None  # compression type in fsspec. ex: "gzip"
	SCREAMING_SNAKE_CASE_:							str   			=					None  # extension of the filename to strip. ex: "".gz" to get file.txt from file.txt.gz


	def __init__(      self  ,					__a = ""  ,					__a = None  ,					__a = None  ,					**__a						):


					"""simple docstring"""

					super().__init__(self  ,					**__a						)
					# always open as "rb" since fsspec can then use the TextIOWrapper to make it work for "r" mode
					A__							 =       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 {})  ,					)
					A__							 =       os.path.basename(self.file.path.split('::'						)[0]						)
					A__							 =       (
					    self.compressed_name[: self.compressed_name.rindex('.'						)]
					    if '.' in self.compressed_name
					    else self.compressed_name
					)
					A__							 =       None


	@classmethod
	def       _UpperCAmelCase						(      cls  ,					__a						):


					"""simple docstring"""

					return super()._strip_protocol(__a						).lstrip('/'						)


	def       _UpperCAmelCase						(      self						):


					"""simple docstring"""

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


	def       _UpperCAmelCase						(      self  ,					__a						):


					"""simple docstring"""

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






	def       _UpperCAmelCase						(      self  ,					__a  ,					__a = "rb"  ,					__a=None  ,					__a=True  ,					__a=None  ,					**__a  ,					):


					"""simple docstring"""

					A__							 =       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       snake_case_       (    _lowerCamelCase       ):



	"""simple docstring"""

	SCREAMING_SNAKE_CASE_:							Dict   			=					"""bz2"""
	SCREAMING_SNAKE_CASE_:							Dict   			=					"""bz2"""
	SCREAMING_SNAKE_CASE_:							int   			=					""".bz2"""





class       snake_case_       (    _lowerCamelCase       ):



	"""simple docstring"""

	SCREAMING_SNAKE_CASE_:							int   			=					"""gzip"""
	SCREAMING_SNAKE_CASE_:							Optional[Any]   			=					"""gzip"""
	SCREAMING_SNAKE_CASE_:							Any   			=					""".gz"""





class       snake_case_       (    _lowerCamelCase       ):



	"""simple docstring"""

	SCREAMING_SNAKE_CASE_:							Optional[Any]   			=					"""lz4"""
	SCREAMING_SNAKE_CASE_:							List[str]   			=					"""lz4"""
	SCREAMING_SNAKE_CASE_:							Dict   			=					""".lz4"""





class       snake_case_       (    _lowerCamelCase       ):



	"""simple docstring"""

	SCREAMING_SNAKE_CASE_:							Optional[Any]   			=					"""xz"""
	SCREAMING_SNAKE_CASE_:							int   			=					"""xz"""
	SCREAMING_SNAKE_CASE_:							Any   			=					""".xz"""





class       snake_case_       (    _lowerCamelCase       ):



	"""simple docstring"""

	SCREAMING_SNAKE_CASE_:							Tuple   			=					"""zstd"""
	SCREAMING_SNAKE_CASE_:							Dict   			=					"""zstd"""
	SCREAMING_SNAKE_CASE_:							Union[str, Any]   			=					""".zst"""


	def __init__(      self  ,					__a  ,					__a = "rb"  ,					__a = None  ,					__a = None  ,					__a = DEFAULT_BLOCK_SIZE  ,					**__a  ,					):


					"""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
					A__							 =       self.file.__enter__





					class       snake_case_       :



						"""simple docstring"""

						def __init__(      self  ,					__a						):


										"""simple docstring"""

										A__							 =       file_


						def __enter__(      self						):


										"""simple docstring"""

										self._file.__enter__()
										return self


						def __exit__(      self  ,					*__a  ,					**__a						):


										"""simple docstring"""

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


						def __iter__(      self						):


										"""simple docstring"""

										return iter(self._file						)


						def       _UpperCAmelCase						(      self						):


										"""simple docstring"""

										return next(self._file						)






						def __getattr__(      self  ,					__a						):


										"""simple docstring"""

										return getattr(self._file  ,					__a						)

					def fixed_enter(*__a  ,					**__a						):
									return WrappedFile(_enter(*__a  ,					**__a						)						)

					A__							 =       fixed_enter










"""simple docstring"""






def  __lowerCamelCase					(					lowerCAmelCase__       ,lowerCAmelCase__				):
				return 1 if input_a == input_a else 0



def  __lowerCamelCase					(					):
				assert xnor_gate(0       ,0				) == 1
				assert xnor_gate(0       ,1				) == 0
				assert xnor_gate(1       ,0				) == 0
				assert xnor_gate(1       ,1				) == 1


if __name__ == "__main__":
					print(xnor_gate(0, 0))
					print(xnor_gate(0, 1))
					print(xnor_gate(1, 0))
					print(xnor_gate(1, 1))


