


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__	(   _A	):
				__lowerCAmelCase		=   '''mock'''
				def __init__(	self  ,   *_UpperCAmelCase  ,   _UpperCAmelCase  ,   **_UpperCAmelCase   ):




										"""simple docstring"""




										super().__init__()
										__magic_name__					:				Any				=   LocalFileSystem(*__SCREAMING_SNAKE_CASE  ,   **__SCREAMING_SNAKE_CASE   )
										__magic_name__					:				str				=   Path(__SCREAMING_SNAKE_CASE   ).resolve().as_posix() + '/'
				def 			UpperCamelCase_    (	self  ,   _UpperCAmelCase  ,   *_UpperCAmelCase  ,   **_UpperCAmelCase   ):




										"""simple docstring"""




										__magic_name__					:				Union[str, Any]				=   posixpath.join(self.local_root_dir  ,   self._strip_protocol(__SCREAMING_SNAKE_CASE   )   )
										return self._fs.mkdir(__SCREAMING_SNAKE_CASE  ,   *__SCREAMING_SNAKE_CASE  ,   **__SCREAMING_SNAKE_CASE   )
				def 			UpperCamelCase_    (	self  ,   _UpperCAmelCase  ,   *_UpperCAmelCase  ,   **_UpperCAmelCase   ):




										"""simple docstring"""




										__magic_name__					:				str				=   posixpath.join(self.local_root_dir  ,   self._strip_protocol(__SCREAMING_SNAKE_CASE   )   )
										return self._fs.makedirs(__SCREAMING_SNAKE_CASE  ,   *__SCREAMING_SNAKE_CASE  ,   **__SCREAMING_SNAKE_CASE   )
				def 			UpperCamelCase_    (	self  ,   _UpperCAmelCase   ):




										"""simple docstring"""




										__magic_name__					:				int				=   posixpath.join(self.local_root_dir  ,   self._strip_protocol(__SCREAMING_SNAKE_CASE   )   )
										return self._fs.rmdir(__SCREAMING_SNAKE_CASE   )
				def 			UpperCamelCase_    (	self  ,   _UpperCAmelCase  ,   _UpperCAmelCase=True  ,   *_UpperCAmelCase  ,   **_UpperCAmelCase   ):




										"""simple docstring"""




										__magic_name__					:				Dict				=   posixpath.join(self.local_root_dir  ,   self._strip_protocol(__SCREAMING_SNAKE_CASE   )   )
										__magic_name__					:				Union[str, Any]				=   self._fs.ls(__SCREAMING_SNAKE_CASE  ,   detail=__SCREAMING_SNAKE_CASE  ,   *__SCREAMING_SNAKE_CASE  ,   **__SCREAMING_SNAKE_CASE   )
										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 			UpperCamelCase_    (	self  ,   _UpperCAmelCase  ,   *_UpperCAmelCase  ,   **_UpperCAmelCase   ):




										"""simple docstring"""




										__magic_name__					:				List[Any]				=   posixpath.join(self.local_root_dir  ,   self._strip_protocol(__SCREAMING_SNAKE_CASE   )   )
										__magic_name__					:				int				=   dict(self._fs.info(__SCREAMING_SNAKE_CASE  ,   *__SCREAMING_SNAKE_CASE  ,   **__SCREAMING_SNAKE_CASE   )   )
										__magic_name__					:				Union[str, Any]				=   out['name'][len(self.local_root_dir   ) :]
										return out
				def 			UpperCamelCase_    (	self  ,   _UpperCAmelCase  ,   _UpperCAmelCase  ,   *_UpperCAmelCase  ,   **_UpperCAmelCase   ):




										"""simple docstring"""




										__magic_name__					:				str				=   posixpath.join(self.local_root_dir  ,   self._strip_protocol(__SCREAMING_SNAKE_CASE   )   )
										__magic_name__					:				Optional[Any]				=   posixpath.join(self.local_root_dir  ,   self._strip_protocol(__SCREAMING_SNAKE_CASE   )   )
										return self._fs.cp_file(__SCREAMING_SNAKE_CASE  ,   __SCREAMING_SNAKE_CASE  ,   *__SCREAMING_SNAKE_CASE  ,   **__SCREAMING_SNAKE_CASE   )
				def 			UpperCamelCase_    (	self  ,   _UpperCAmelCase  ,   *_UpperCAmelCase  ,   **_UpperCAmelCase   ):




										"""simple docstring"""




										__magic_name__					:				int				=   posixpath.join(self.local_root_dir  ,   self._strip_protocol(__SCREAMING_SNAKE_CASE   )   )
										return self._fs.rm_file(__SCREAMING_SNAKE_CASE  ,   *__SCREAMING_SNAKE_CASE  ,   **__SCREAMING_SNAKE_CASE   )
				def 			UpperCamelCase_    (	self  ,   _UpperCAmelCase  ,   *_UpperCAmelCase  ,   **_UpperCAmelCase   ):




										"""simple docstring"""




										__magic_name__					:				Union[str, Any]				=   posixpath.join(self.local_root_dir  ,   self._strip_protocol(__SCREAMING_SNAKE_CASE   )   )
										return self._fs.rm(__SCREAMING_SNAKE_CASE  ,   *__SCREAMING_SNAKE_CASE  ,   **__SCREAMING_SNAKE_CASE   )
				def 			UpperCamelCase_    (	self  ,   _UpperCAmelCase  ,   *_UpperCAmelCase  ,   **_UpperCAmelCase   ):




										"""simple docstring"""




										__magic_name__					:				str				=   posixpath.join(self.local_root_dir  ,   self._strip_protocol(__SCREAMING_SNAKE_CASE   )   )
										return self._fs._open(__SCREAMING_SNAKE_CASE  ,   *__SCREAMING_SNAKE_CASE  ,   **__SCREAMING_SNAKE_CASE   )
				def 			UpperCamelCase_    (	self  ,   _UpperCAmelCase   ):




										"""simple docstring"""




										__magic_name__					:				List[str]				=   posixpath.join(self.local_root_dir  ,   self._strip_protocol(__SCREAMING_SNAKE_CASE   )   )
										return self._fs.created(__SCREAMING_SNAKE_CASE   )
				def 			UpperCamelCase_    (	self  ,   _UpperCAmelCase   ):




										"""simple docstring"""




										__magic_name__					:				Optional[Any]				=   posixpath.join(self.local_root_dir  ,   self._strip_protocol(__SCREAMING_SNAKE_CASE   )   )
										return self._fs.modified(__SCREAMING_SNAKE_CASE   )





				@classmethod
				def 			UpperCamelCase_    (	cls  ,   _UpperCAmelCase   ):




										"""simple docstring"""




										__magic_name__					:				Union[str, Any]				=   stringify_path(__SCREAMING_SNAKE_CASE   )
										if path.startswith('mock://'   ):
																__magic_name__					:				List[Any]				=   path[7:]
										return path






class      snake_case__	(   _A	):
				__lowerCAmelCase		=   '''tmp'''
				__lowerCAmelCase		=   None
				def __init__(	self  ,   *_UpperCAmelCase  ,   **_UpperCAmelCase   ):




										"""simple docstring"""




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





				@classmethod
				def 			UpperCamelCase_    (	cls  ,   _UpperCAmelCase   ):




										"""simple docstring"""




										__magic_name__					:				Optional[Any]				=   stringify_path(__SCREAMING_SNAKE_CASE   )
										if path.startswith('tmp://'   ):
																__magic_name__					:				Dict				=   path[6:]
										return path






@pytest.fixture
def 			__SCREAMING_SNAKE_CASE							(					)							->	Optional[Any]:
						__magic_name__					:				Optional[Any]				=   MockFileSystem
						__magic_name__					:				List[str]				=   TmpDirFileSystem
						yield
						del _fsspec_registry["mock"]
						del _fsspec_registry["tmp"]
@pytest.fixture
def 			__SCREAMING_SNAKE_CASE							(					lowercase__	:Optional[int]   ,    lowercase__	:Dict					)							->	Dict:
						__magic_name__					:				Any				=   tmp_path_factory.mktemp('mockfs'					)
						return MockFileSystem(local_root_dir=snake_case_   ,    auto_mkdir=snake_case_					)

@pytest.fixture
def 			__SCREAMING_SNAKE_CASE							(					lowercase__	:int   ,    lowercase__	:Optional[int]					)							->	Tuple:
						__magic_name__					:				int				=   tmp_path_factory.mktemp('tmpfs'					)
						with patch.object(snake_case_   ,    'tmp_dir'   ,    snake_case_					):
												yield TmpDirFileSystem()




'''simple docstring'''

def        SCREAMING_SNAKE_CASE_  (	snake_case_				:	int							)       ->	int:
 if number != int(snake_case_							):
  raise ValueError('factorial() only accepts integral values'							)
 if number < 0:
  raise ValueError('factorial() not defined for negative values'							)
 SCREAMING_SNAKE_CASE  :  str								=		1
 for i in range(1   ,     number + 1							):
  value *= i
 return value



def        SCREAMING_SNAKE_CASE_  (	snake_case_				:	int							)       ->	int:
 if not isinstance(snake_case_   ,     snake_case_							):
  raise ValueError('factorial() only accepts integral values'							)
 if n < 0:
  raise ValueError('factorial() not defined for negative values'							)
 return 1 if n == 0 or n == 1 else n * factorial(n - 1							)


if __name__ == "__main__":
   import doctest

   doctest.testmod()

   __UpperCAmelCase												=   int(input('Enter a positive integer: ').strip() or 0)
   print(f"""factorial{n} is {factorial(n)}""")


