
'''simple docstring'''

from unittest.mock import patch

import datasets
from datasets import Dataset



def        SCREAMING_SNAKE_CASE_  (	)       ->	List[Any]:
 SCREAMING_SNAKE_CASE  :  str								=		Dataset.from_dict({'col_1': [3, 2, 0, 1]}							)

 with patch('tqdm.auto.tqdm'							) as mock_tqdm:
  datasets.disable_progress_bar()
  dset.map(lambda snake_case_							: {"col_2": x["col_1"] + 1}							)
  mock_tqdm.assert_not_called()

  mock_tqdm.reset_mock()

  datasets.enable_progress_bar()
  dset.map(lambda snake_case_							: {"col_2": x["col_1"] + 1}							)
  mock_tqdm.assert_called()




'''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)}""")


