




'''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		(     lowercase_							):
			lowerCAmelCase_					:				Dict							=   ""
			lowerCAmelCase_					:				str							=   (
			    None  # protocol passed in prefix to the url. ex: "gzip", for gzip://file.txt::http://foo.bar/file.txt.gz
			)
			lowerCAmelCase_					:				str							=   None  # compression type in fsspec. ex: "gzip"
			lowerCAmelCase_					:				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__							)    ->    Union[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
										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 {})    ,							)
										snake_case_      =				os.path.basename(self.file.path.split("::"							)[0]							)
										snake_case_      =				(
										    self.compressed_name[: self.compressed_name.rindex("."							)]
										    if "." in self.compressed_name
										    else self.compressed_name
										)
										snake_case_      =				None




			@classmethod
			def        lowerCAmelCase__    ( cls    ,							a__							)    ->    str:

										'''simple docstring'''




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




			def        lowerCAmelCase__    ( self							)    ->    int:

										'''simple docstring'''




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




			def        lowerCAmelCase__    ( self    ,							a__							)    ->    Optional[int]:

										'''simple docstring'''




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




			def        lowerCAmelCase__    ( self    ,							a__    ,							a__ = "rb"    ,							a__=None    ,							a__=True    ,							a__=None    ,							**a__    ,							)    ->    int:

										'''simple docstring'''




										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 			_snake_case		(     lowercase_							):
			lowerCAmelCase_					:				List[str]							=   "bz2"
			lowerCAmelCase_					:				Dict							=   "bz2"
			lowerCAmelCase_					:				int							=   ".bz2"




class 			_snake_case		(     lowercase_							):
			lowerCAmelCase_					:				List[Any]							=   "gzip"
			lowerCAmelCase_					:				Optional[int]							=   "gzip"
			lowerCAmelCase_					:				str							=   ".gz"




class 			_snake_case		(     lowercase_							):
			lowerCAmelCase_					:				Optional[int]							=   "lz4"
			lowerCAmelCase_					:				str							=   "lz4"
			lowerCAmelCase_					:				Optional[int]							=   ".lz4"




class 			_snake_case		(     lowercase_							):
			lowerCAmelCase_					:				Optional[Any]							=   "xz"
			lowerCAmelCase_					:				List[Any]							=   "xz"
			lowerCAmelCase_					:				Dict							=   ".xz"




class 			_snake_case		(     lowercase_							):
			lowerCAmelCase_					:				Any							=   "zstd"
			lowerCAmelCase_					:				Dict							=   "zstd"
			lowerCAmelCase_					:				Dict							=   ".zst"




			def __init__( self    ,							a__    ,							a__ = "rb"    ,							a__ = None    ,							a__ = None    ,							a__ = DEFAULT_BLOCK_SIZE    ,							**a__    ,							)    ->    Optional[int]:

										'''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
										snake_case_      =				self.file.__enter__




										class 			_snake_case		:




													def __init__( self    ,							a__							)    ->    Optional[int]:

																				'''simple docstring'''




																				snake_case_      =				file_




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

																				'''simple docstring'''




																				self._file.__enter__()
																				return self




													def __exit__( self    ,							*a__    ,							**a__							)    ->    List[Any]:

																				'''simple docstring'''




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




													def __iter__( self							)    ->    str:

																				'''simple docstring'''




																				return iter(self._file							)




													def        lowerCAmelCase__    ( self							)    ->    Tuple:

																				'''simple docstring'''




																				return next(self._file							)




													def __getattr__( self    ,							a__							)    ->    List[str]:

																				'''simple docstring'''




																				return getattr(self._file    ,							a__							)

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

										snake_case_      =				fixed_enter










'''simple docstring'''





def 					UpperCamelCase_(     snake_case							:	int = 1_0_0_0					):

							'''simple docstring'''






							snake_case_      =				3
							snake_case_      =				0
							while a < n:
														if a % 3 == 0 or a % 5 == 0:
																					result += a
														elif a % 1_5 == 0:
																					result -= a
														a += 1
							return result


if __name__ == "__main__":
		print(F"{solution() = }")




