






"""simple docstring"""


def 					a			(  UpperCamelCase_				:					int		)	->		int:
 if number != int(UpperCamelCase_		):
  raise ValueError('factorial() only accepts integral values'		)
 if number < 0:
  raise ValueError('factorial() not defined for negative values'		)
 __A						:							Optional[int]      =						1
 for i in range(1  ,						number + 1		):
  value *= i
 return value




def 					a			(  UpperCamelCase_				:					int		)	->		int:
 if not isinstance(UpperCamelCase_  ,						UpperCamelCase_		):
  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      =			int(input("""Enter a positive integer: """).strip() or 0)
   print(f'''factorial{n} is {factorial(n)}''')













"""simple docstring"""


import importlib.metadata
import subprocess
import sys




def 					a			(  UpperCamelCase_				:					bool = False		)	->		Optional[Any]:
 __A						:							List[Any]      =						False
 if "IPython" in sys.modules:
  __A						:							List[Any]      =						'google.colab' in str(sys.modules['IPython'].get_ipython()		)

 if in_colab:
  if upgrade:
   __A						:							Dict      =						['pip', 'install', '-U', 'torch']
   subprocess.run(UpperCamelCase_  ,						check=UpperCamelCase_		)
  # get the current version of torch
  __A						:							int      =						importlib.metadata.version('torch'		)
  __A						:							int      =						torch_version[: torch_version.rindex('.'		)]
  __A						:							Any      =						F"https://storage.googleapis.com/tpu-pytorch/wheels/colab/torch_xla-{torch_version_trunc}-cp37-cp37m-linux_x86_64.whl"
  __A						:							int      =						['pip', 'install', xla_wheel]
  subprocess.run(UpperCamelCase_  ,						check=UpperCamelCase_		)
 else:
  raise RuntimeError('`install_xla` utility works only on google colab.'		)





