



def      A_ (		__a       :			int						):

				"""simple docstring"""
				if number != int(__a						):
								raise ValueError("""factorial() only accepts integral values"""						)
				if number < 0:
								raise ValueError("""factorial() not defined for negative values"""						)
				a__			 =						1
				for i in range(1	,						number + 1						):
								value *= i
				return value

def      A_ (		__a       :			int						):

				"""simple docstring"""
				if not isinstance(__a	,						__a						):
								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)}""")






import shutil
import tempfile
import unittest

import numpy as np
import pytest

from transformers.testing_utils import require_vision
from transformers.utils import is_vision_available


if is_vision_available():
	from PIL import Image

	from transformers import AutoProcessor, BertTokenizer, CLIPImageProcessor, GitProcessor, PreTrainedTokenizerFast

@require_vision
class 	__snake_case (				unittest.TestCase):







							'''simple docstring'''






							def _a (							self						):
											a__			 =						tempfile.mkdtemp()

											a__			 =						CLIPImageProcessor()
											a__			 =						BertTokenizer.from_pretrained(
											    """hf-internal-testing/tiny-random-BertModel"""					,					model_input_names=["""input_ids""", """attention_mask"""]						)

											a__			 =						GitProcessor(a_					,					a_						)

											processor.save_pretrained(self.tmpdirname						)


							def _a (							self					,					**a_						):
											return AutoProcessor.from_pretrained(self.tmpdirname					,					**a_						).tokenizer


							def _a (							self					,					**a_						):
											return AutoProcessor.from_pretrained(self.tmpdirname					,					**a_						).image_processor


							def _a (							self						):
											shutil.rmtree(self.tmpdirname						)


							def _a (							self						):
											a__			 =						[np.random.randint(255					,					size=(3, 30, 400)					,					dtype=np.uinta						)]

											a__			 =						[Image.fromarray(np.moveaxis(a_					,					0					,					-1						)						) for x in image_inputs]

											return image_inputs


							def _a (							self						):
											a__			 =						GitProcessor(tokenizer=self.get_tokenizer()					,					image_processor=self.get_image_processor()						)
											processor.save_pretrained(self.tmpdirname						)

											a__			 =						self.get_tokenizer(bos_token="""(BOS)"""					,					eos_token="""(EOS)"""						)
											a__			 =						self.get_image_processor(do_normalize=a_					,					padding_value=1.0						)

											a__			 =						GitProcessor.from_pretrained(
											    self.tmpdirname					,					bos_token="""(BOS)"""					,					eos_token="""(EOS)"""					,					do_normalize=a_					,					padding_value=1.0						)

											self.assertEqual(processor.tokenizer.get_vocab()					,					tokenizer_add_kwargs.get_vocab()						)
											self.assertIsInstance(processor.tokenizer					,					a_						)

											self.assertEqual(processor.image_processor.to_json_string()					,					image_processor_add_kwargs.to_json_string()						)
											self.assertIsInstance(processor.image_processor					,					a_						)


							def _a (							self						):
											a__			 =						self.get_image_processor()
											a__			 =						self.get_tokenizer()

											a__			 =						GitProcessor(tokenizer=a_					,					image_processor=a_						)

											a__			 =						self.prepare_image_inputs()

											a__			 =						image_processor(a_					,					return_tensors="""np"""						)
											a__			 =						processor(images=a_					,					return_tensors="""np"""						)

											for key in input_feat_extract.keys():
															self.assertAlmostEqual(input_feat_extract[key].sum()					,					input_processor[key].sum()					,					delta=1E-2						)


							def _a (							self						):
											a__			 =						self.get_image_processor()
											a__			 =						self.get_tokenizer()

											a__			 =						GitProcessor(tokenizer=a_					,					image_processor=a_						)

											a__			 =						"""lower newer"""

											a__			 =						processor(text=a_						)

											a__			 =						tokenizer(a_					,					return_token_type_ids=a_						)

											for key in encoded_tok.keys():
															self.assertListEqual(encoded_tok[key]					,					encoded_processor[key]						)


							def _a (							self						):
											a__			 =						self.get_image_processor()
											a__			 =						self.get_tokenizer()

											a__			 =						GitProcessor(tokenizer=a_					,					image_processor=a_						)

											a__			 =						"""lower newer"""
											a__			 =						self.prepare_image_inputs()

											a__			 =						processor(text=a_					,					images=a_						)

											self.assertListEqual(list(inputs.keys()						)					,					["""input_ids""", """attention_mask""", """pixel_values"""]						)

											# test if it raises when no input is passed
											with pytest.raises(a_						):
															processor()


							def _a (							self						):
											a__			 =						self.get_image_processor()
											a__			 =						self.get_tokenizer()

											a__			 =						GitProcessor(tokenizer=a_					,					image_processor=a_						)

											a__			 =						[[1, 4, 5, 8, 1, 0, 8], [3, 4, 3, 1, 1, 8, 9]]

											a__			 =						processor.batch_decode(a_						)
											a__			 =						tokenizer.batch_decode(a_						)

											self.assertListEqual(a_					,					a_						)







							def _a (							self						):
											a__			 =						self.get_image_processor()
											a__			 =						self.get_tokenizer()

											a__			 =						GitProcessor(tokenizer=a_					,					image_processor=a_						)

											a__			 =						"""lower newer"""
											a__			 =						self.prepare_image_inputs()

											a__			 =						processor(text=a_					,					images=a_						)

											# For now the processor supports only ['input_ids', 'attention_mask', 'pixel_values']
											self.assertListEqual(list(inputs.keys()						)					,					["""input_ids""", """attention_mask""", """pixel_values"""]						)

