

"""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 					snake_case			(       __snake_case						):
				SCREAMING_SNAKE_CASE_     :   Tuple        =						"""mock"""

				def __init__(			self							:       Optional[int]  ,						*UpperCamelCase__							:       Union[str, Any]  ,						UpperCamelCase__							:       Tuple  ,						**UpperCamelCase__							:       Optional[Any])->     List[str]:



						'''simple docstring'''


						super().__init__()
						__lowerCAmelCase: Optional[int]					   =    LocalFileSystem(*UpperCamelCase__  ,						**UpperCamelCase__)
						__lowerCAmelCase: Optional[int]					   =    Path(UpperCamelCase__).resolve().as_posix() + "/"

				def 							lowercase_  (			self							:       List[Any]  ,						UpperCamelCase__							:       int  ,						*UpperCamelCase__							:       int  ,						**UpperCamelCase__							:       str)->     Optional[Any]:



						'''simple docstring'''


						__lowerCAmelCase: int					   =    posixpath.join(self.local_root_dir  ,						self._strip_protocol(UpperCamelCase__))
						return self._fs.mkdir(UpperCamelCase__  ,						*UpperCamelCase__  ,						**UpperCamelCase__)

				def 							lowercase_  (			self							:       Any  ,						UpperCamelCase__							:       Optional[Any]  ,						*UpperCamelCase__							:       Tuple  ,						**UpperCamelCase__							:       Dict)->     str:



						'''simple docstring'''


						__lowerCAmelCase: Optional[Any]					   =    posixpath.join(self.local_root_dir  ,						self._strip_protocol(UpperCamelCase__))
						return self._fs.makedirs(UpperCamelCase__  ,						*UpperCamelCase__  ,						**UpperCamelCase__)

				def 							lowercase_  (			self							:       Any  ,						UpperCamelCase__							:       List[str])->     Dict:



						'''simple docstring'''


						__lowerCAmelCase: str					   =    posixpath.join(self.local_root_dir  ,						self._strip_protocol(UpperCamelCase__))
						return self._fs.rmdir(UpperCamelCase__)

				def 							lowercase_  (			self							:       int  ,						UpperCamelCase__							:       Dict  ,						UpperCamelCase__							:       Any=True  ,						*UpperCamelCase__							:       Tuple  ,						**UpperCamelCase__							:       Dict)->     Tuple:



						'''simple docstring'''


						__lowerCAmelCase: Any					   =    posixpath.join(self.local_root_dir  ,						self._strip_protocol(UpperCamelCase__))
						__lowerCAmelCase: List[str]					   =    self._fs.ls(UpperCamelCase__  ,						detail=UpperCamelCase__  ,						*UpperCamelCase__  ,						**UpperCamelCase__)
						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							:       List[str]  ,						UpperCamelCase__							:       List[str]  ,						*UpperCamelCase__							:       Union[str, Any]  ,						**UpperCamelCase__							:       Optional[Any])->     Union[str, Any]:



						'''simple docstring'''


						__lowerCAmelCase: Optional[int]					   =    posixpath.join(self.local_root_dir  ,						self._strip_protocol(UpperCamelCase__))
						__lowerCAmelCase: Any					   =    dict(self._fs.info(UpperCamelCase__  ,						*UpperCamelCase__  ,						**UpperCamelCase__))
						__lowerCAmelCase: Optional[int]					   =    out["name"][len(self.local_root_dir) :]
						return out

				def 							lowercase_  (			self							:       str  ,						UpperCamelCase__							:       Union[str, Any]  ,						UpperCamelCase__							:       int  ,						*UpperCamelCase__							:       int  ,						**UpperCamelCase__							:       Optional[Any])->     Any:



						'''simple docstring'''


						__lowerCAmelCase: List[Any]					   =    posixpath.join(self.local_root_dir  ,						self._strip_protocol(UpperCamelCase__))
						__lowerCAmelCase: List[Any]					   =    posixpath.join(self.local_root_dir  ,						self._strip_protocol(UpperCamelCase__))
						return self._fs.cp_file(UpperCamelCase__  ,						UpperCamelCase__  ,						*UpperCamelCase__  ,						**UpperCamelCase__)

				def 							lowercase_  (			self							:       Optional[Any]  ,						UpperCamelCase__							:       Dict  ,						*UpperCamelCase__							:       int  ,						**UpperCamelCase__							:       str)->     Union[str, Any]:



						'''simple docstring'''


						__lowerCAmelCase: List[Any]					   =    posixpath.join(self.local_root_dir  ,						self._strip_protocol(UpperCamelCase__))
						return self._fs.rm_file(UpperCamelCase__  ,						*UpperCamelCase__  ,						**UpperCamelCase__)

				def 							lowercase_  (			self							:       Tuple  ,						UpperCamelCase__							:       Dict  ,						*UpperCamelCase__							:       List[str]  ,						**UpperCamelCase__							:       int)->     Any:



						'''simple docstring'''


						__lowerCAmelCase: str					   =    posixpath.join(self.local_root_dir  ,						self._strip_protocol(UpperCamelCase__))
						return self._fs.rm(UpperCamelCase__  ,						*UpperCamelCase__  ,						**UpperCamelCase__)

				def 							lowercase_  (			self							:       Any  ,						UpperCamelCase__							:       Union[str, Any]  ,						*UpperCamelCase__							:       str  ,						**UpperCamelCase__							:       Optional[Any])->     Optional[int]:



						'''simple docstring'''


						__lowerCAmelCase: Any					   =    posixpath.join(self.local_root_dir  ,						self._strip_protocol(UpperCamelCase__))
						return self._fs._open(UpperCamelCase__  ,						*UpperCamelCase__  ,						**UpperCamelCase__)

				def 							lowercase_  (			self							:       Union[str, Any]  ,						UpperCamelCase__							:       Dict)->     List[str]:



						'''simple docstring'''


						__lowerCAmelCase: Optional[int]					   =    posixpath.join(self.local_root_dir  ,						self._strip_protocol(UpperCamelCase__))
						return self._fs.created(UpperCamelCase__)

				def 							lowercase_  (			self							:       List[Any]  ,						UpperCamelCase__							:       Tuple)->     Optional[int]:



						'''simple docstring'''


						__lowerCAmelCase: Union[str, Any]					   =    posixpath.join(self.local_root_dir  ,						self._strip_protocol(UpperCamelCase__))
						return self._fs.modified(UpperCamelCase__)




				@classmethod
				def 							lowercase_  (			cls							:       int  ,						UpperCamelCase__							:       Optional[Any])->     Dict:



						'''simple docstring'''


						__lowerCAmelCase: Union[str, Any]					   =    stringify_path(UpperCamelCase__)
						if path.startswith("mock://"):
								__lowerCAmelCase: Tuple					   =    path[7:]
						return path





class 					snake_case			(       __snake_case						):
				SCREAMING_SNAKE_CASE_     :   Optional[Any]        =						"""tmp"""
				SCREAMING_SNAKE_CASE_     :   Dict        =						None

				def __init__(			self							:       int  ,						*UpperCamelCase__							:       Optional[int]  ,						**UpperCamelCase__							:       str)->     Optional[int]:



						'''simple docstring'''


						assert self.tmp_dir is not None, "TmpDirFileSystem.tmp_dir is not set"
						super().__init__(*UpperCamelCase__  ,						**UpperCamelCase__  ,						local_root_dir=self.tmp_dir  ,						auto_mkdir=UpperCamelCase__)




				@classmethod
				def 							lowercase_  (			cls							:       Any  ,						UpperCamelCase__							:       Dict)->     Any:



						'''simple docstring'''


						__lowerCAmelCase: Dict					   =    stringify_path(UpperCamelCase__)
						if path.startswith("tmp://"):
								__lowerCAmelCase: int					   =    path[6:]
						return path






@pytest.fixture
def 					a__					(					)			->			Optional[Any]:
		__lowerCAmelCase: Any					   =    MockFileSystem
		__lowerCAmelCase: Union[str, Any]					   =    TmpDirFileSystem
		yield
		del _fsspec_registry["mock"]
		del _fsspec_registry["tmp"]






@pytest.fixture
def 					a__					(					__SCREAMING_SNAKE_CASE      ,				__SCREAMING_SNAKE_CASE				)			->			Any:
		__lowerCAmelCase: Optional[int]					   =    tmp_path_factory.mktemp("mockfs"				)
		return MockFileSystem(local_root_dir=__SCREAMING_SNAKE_CASE      ,				auto_mkdir=__SCREAMING_SNAKE_CASE				)






@pytest.fixture
def 					a__					(					__SCREAMING_SNAKE_CASE      ,				__SCREAMING_SNAKE_CASE				)			->			List[Any]:
		__lowerCAmelCase: Union[str, Any]					   =    tmp_path_factory.mktemp("tmpfs"				)
		with patch.object(__SCREAMING_SNAKE_CASE      ,				"tmp_dir"      ,				__SCREAMING_SNAKE_CASE				):
				yield TmpDirFileSystem()





"""simple docstring"""


def 					a__					(					__SCREAMING_SNAKE_CASE = 1_0_0_0				)			->			int:
		__lowerCAmelCase: int					   =    0
		__lowerCAmelCase: Optional[int]					   =    0
		while 1:
				num += 3
				if num >= n:
						break
				total += num
				num += 2
				if num >= n:
						break
				total += num
				num += 1
				if num >= n:
						break
				total += num
				num += 3
				if num >= n:
						break
				total += num
				num += 1
				if num >= n:
						break
				total += num
				num += 2
				if num >= n:
						break
				total += num
				num += 3
				if num >= n:
						break
				total += num
		return total


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


