






'''simple docstring'''

import unittest

from transformers import DebertaConfig, is_torch_available
from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow, torch_device

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
							import torch

							from transformers import (
							    DebertaForMaskedLM,
							    DebertaForQuestionAnswering,
							    DebertaForSequenceClassification,
							    DebertaForTokenClassification,
							    DebertaModel,
							)
							from transformers.models.deberta.modeling_deberta import DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST
class _lowerCamelCase	(						lowercase__							):



		'''simple docstring'''







		def __init__( self		:						Dict  ,					_A		:						Tuple  ,					_A		:						Dict=13  ,					_A		:						List[Any]=7  ,					_A		:						List[Any]=True  ,					_A		:						Tuple=True  ,					_A		:						str=True  ,					_A		:						int=True  ,					_A		:						List[Any]=99  ,					_A		:						int=32  ,					_A		:						Union[str, Any]=5  ,					_A		:						List[Any]=4  ,					_A		:						List[Any]=37  ,					_A		:						Optional[Any]="gelu"  ,					_A		:						List[Any]=0.1  ,					_A		:						Dict=0.1  ,					_A		:						Any=512  ,					_A		:						str=16  ,					_A		:						Any=2  ,					_A		:						Optional[Any]=0.02  ,					_A		:						Any=False  ,					_A		:						List[Any]=True  ,					_A		:						List[Any]="None"  ,					_A		:						Tuple=3  ,					_A		:						List[Any]=4  ,					_A		:						List[Any]=None  ,					)  ->			List[str]:
			__magic_name__	:   List[str]					     =					parent
			__magic_name__	:   Any					     =					batch_size
			__magic_name__	:   Tuple					     =					seq_length
			__magic_name__	:   Any					     =					is_training
			__magic_name__	:   Dict					     =					use_input_mask
			__magic_name__	:   Tuple					     =					use_token_type_ids
			__magic_name__	:   Tuple					     =					use_labels
			__magic_name__	:   List[str]					     =					vocab_size
			__magic_name__	:   Optional[int]					     =					hidden_size
			__magic_name__	:   Any					     =					num_hidden_layers
			__magic_name__	:   str					     =					num_attention_heads
			__magic_name__	:   Any					     =					intermediate_size
			__magic_name__	:   Tuple					     =					hidden_act
			__magic_name__	:   int					     =					hidden_dropout_prob
			__magic_name__	:   int					     =					attention_probs_dropout_prob
			__magic_name__	:   Any					     =					max_position_embeddings
			__magic_name__	:   List[Any]					     =					type_vocab_size
			__magic_name__	:   Optional[int]					     =					type_sequence_label_size
			__magic_name__	:   Union[str, Any]					     =					initializer_range
			__magic_name__	:   str					     =					num_labels
			__magic_name__	:   Any					     =					num_choices
			__magic_name__	:   List[str]					     =					relative_attention
			__magic_name__	:   str					     =					position_biased_input
			__magic_name__	:   List[str]					     =					pos_att_type
			__magic_name__	:   List[str]					     =					scope







		def        __lowerCAmelCase		( self		:						Dict      )  ->			Any:
			__magic_name__	:   Dict					     =					ids_tensor([self.batch_size, self.seq_length]  ,					self.vocab_size      )

			__magic_name__	:   Tuple					     =					None
			if self.use_input_mask:
				__magic_name__	:   Union[str, Any]					     =					ids_tensor([self.batch_size, self.seq_length]  ,					vocab_size=2      )

			__magic_name__	:   Union[str, Any]					     =					None
			if self.use_token_type_ids:
				__magic_name__	:   int					     =					ids_tensor([self.batch_size, self.seq_length]  ,					self.type_vocab_size      )

			__magic_name__	:   Tuple					     =					None
			__magic_name__	:   int					     =					None
			__magic_name__	:   List[Any]					     =					None
			if self.use_labels:
				__magic_name__	:   Tuple					     =					ids_tensor([self.batch_size]  ,					self.type_sequence_label_size      )
				__magic_name__	:   List[Any]					     =					ids_tensor([self.batch_size, self.seq_length]  ,					self.num_labels      )
				__magic_name__	:   Dict					     =					ids_tensor([self.batch_size]  ,					self.num_choices      )

			__magic_name__	:   List[str]					     =					self.get_config()

			return config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels







		def        __lowerCAmelCase		( self		:						Union[str, Any]      )  ->			List[Any]:
			return DebertaConfig(
			    vocab_size=self.vocab_size  ,					hidden_size=self.hidden_size  ,					num_hidden_layers=self.num_hidden_layers  ,					num_attention_heads=self.num_attention_heads  ,					intermediate_size=self.intermediate_size  ,					hidden_act=self.hidden_act  ,					hidden_dropout_prob=self.hidden_dropout_prob  ,					attention_probs_dropout_prob=self.attention_probs_dropout_prob  ,					max_position_embeddings=self.max_position_embeddings  ,					type_vocab_size=self.type_vocab_size  ,					initializer_range=self.initializer_range  ,					relative_attention=self.relative_attention  ,					position_biased_input=self.position_biased_input  ,					pos_att_type=self.pos_att_type  ,					)







		def        __lowerCAmelCase		( self		:						Tuple      )  ->			str:
			__magic_name__	:   Optional[int]					     =					self.get_config()
			__magic_name__	:   Optional[Any]					     =					300
			return config







		def        __lowerCAmelCase		( self		:						List[Any]  ,					_A		:						int      )  ->			List[Any]:
			self.parent.assertListEqual(list(result.loss.size()      )  ,					[]      )







		def        __lowerCAmelCase		( self		:						List[Any]  ,					_A		:						Tuple  ,					_A		:						Optional[int]  ,					_A		:						str  ,					_A		:						int  ,					_A		:						Tuple  ,					_A		:						str  ,					_A		:						Optional[Any]      )  ->			List[Any]:
			__magic_name__	:   Any					     =					DebertaModel(config=_A      )
			model.to(_A      )
			model.eval()
			__magic_name__	:   Tuple					     =					model(_A  ,					attention_mask=_A  ,					token_type_ids=_A      )[0]
			__magic_name__	:   str					     =					model(_A  ,					token_type_ids=_A      )[0]
			__magic_name__	:   str					     =					model(_A      )[0]

			self.parent.assertListEqual(list(sequence_output.size()      )  ,					[self.batch_size, self.seq_length, self.hidden_size]      )







		def        __lowerCAmelCase		( self		:						Union[str, Any]  ,					_A		:						Optional[int]  ,					_A		:						int  ,					_A		:						Dict  ,					_A		:						Optional[Any]  ,					_A		:						Any  ,					_A		:						str  ,					_A		:						List[str]      )  ->			Union[str, Any]:
			__magic_name__	:   Optional[int]					     =					DebertaForMaskedLM(config=_A      )
			model.to(_A      )
			model.eval()
			__magic_name__	:   Dict					     =					model(_A  ,					attention_mask=_A  ,					token_type_ids=_A  ,					labels=_A      )

			self.parent.assertEqual(result.logits.shape  ,					(self.batch_size, self.seq_length, self.vocab_size)      )







		def        __lowerCAmelCase		( self		:						int  ,					_A		:						Dict  ,					_A		:						Optional[int]  ,					_A		:						List[str]  ,					_A		:						Tuple  ,					_A		:						Tuple  ,					_A		:						str  ,					_A		:						List[Any]      )  ->			int:
			__magic_name__	:   Optional[Any]					     =					self.num_labels
			__magic_name__	:   Union[str, Any]					     =					DebertaForSequenceClassification(_A      )
			model.to(_A      )
			model.eval()
			__magic_name__	:   str					     =					model(_A  ,					attention_mask=_A  ,					token_type_ids=_A  ,					labels=_A      )
			self.parent.assertListEqual(list(result.logits.size()      )  ,					[self.batch_size, self.num_labels]      )
			self.check_loss_output(_A      )







		def        __lowerCAmelCase		( self		:						Dict  ,					_A		:						int  ,					_A		:						List[str]  ,					_A		:						str  ,					_A		:						Dict  ,					_A		:						List[Any]  ,					_A		:						Optional[Any]  ,					_A		:						Tuple      )  ->			Tuple:
			__magic_name__	:   Tuple					     =					self.num_labels
			__magic_name__	:   Dict					     =					DebertaForTokenClassification(config=_A      )
			model.to(_A      )
			model.eval()
			__magic_name__	:   List[Any]					     =					model(_A  ,					attention_mask=_A  ,					token_type_ids=_A  ,					labels=_A      )
			self.parent.assertEqual(result.logits.shape  ,					(self.batch_size, self.seq_length, self.num_labels)      )







		def        __lowerCAmelCase		( self		:						Optional[int]  ,					_A		:						Optional[Any]  ,					_A		:						List[Any]  ,					_A		:						str  ,					_A		:						List[Any]  ,					_A		:						Optional[Any]  ,					_A		:						List[str]  ,					_A		:						Union[str, Any]      )  ->			Optional[Any]:
			__magic_name__	:   List[str]					     =					DebertaForQuestionAnswering(config=_A      )
			model.to(_A      )
			model.eval()
			__magic_name__	:   List[str]					     =					model(
			    _A  ,					attention_mask=_A  ,					token_type_ids=_A  ,					start_positions=_A  ,					end_positions=_A  ,					)
			self.parent.assertEqual(result.start_logits.shape  ,					(self.batch_size, self.seq_length)      )
			self.parent.assertEqual(result.end_logits.shape  ,					(self.batch_size, self.seq_length)      )







		def        __lowerCAmelCase		( self		:						Dict      )  ->			List[str]:
			__magic_name__	:   Union[str, Any]					     =					self.prepare_config_and_inputs()
			(
			    __magic_name__    
			)	:   Optional[int]					     =					config_and_inputs
			__magic_name__	:   Any					     =					{'input_ids': input_ids, 'token_type_ids': token_type_ids, 'attention_mask': input_mask}
			return config, inputs_dict







@require_torch
class _lowerCamelCase	(						lowercase__		,					lowercase__		,					unittest.TestCase							):



		'''simple docstring'''







		A_     :      Optional[Any]				   =    (
		    (
		        DebertaModel,
		        DebertaForMaskedLM,
		        DebertaForSequenceClassification,
		        DebertaForTokenClassification,
		        DebertaForQuestionAnswering,
		    )
		    if is_torch_available()
		    else ()
		)
		A_     :      Optional[int]				   =    (
		    {
		        """feature-extraction""": DebertaModel,
		        """fill-mask""": DebertaForMaskedLM,
		        """question-answering""": DebertaForQuestionAnswering,
		        """text-classification""": DebertaForSequenceClassification,
		        """token-classification""": DebertaForTokenClassification,
		        """zero-shot""": DebertaForSequenceClassification,
		    }
		    if is_torch_available()
		    else {}
		)

		A_     :      str				   =    True
		A_     :      int				   =    False
		A_     :      Union[str, Any]				   =    False
		A_     :      int				   =    False
		A_     :      Any				   =    False







		def        __lowerCAmelCase		( self		:						List[Any]      )  ->			str:
			__magic_name__	:   Union[str, Any]					     =					DebertaModelTester(self      )
			__magic_name__	:   List[Any]					     =					ConfigTester(self  ,					config_class=_A  ,					hidden_size=37      )







		def        __lowerCAmelCase		( self		:						Dict      )  ->			List[str]:
			self.config_tester.run_common_tests()







		def        __lowerCAmelCase		( self		:						Any      )  ->			str:
			__magic_name__	:   Dict					     =					self.model_tester.prepare_config_and_inputs()
			self.model_tester.create_and_check_deberta_model(*_A      )







		def        __lowerCAmelCase		( self		:						Union[str, Any]      )  ->			List[str]:
			__magic_name__	:   Any					     =					self.model_tester.prepare_config_and_inputs()
			self.model_tester.create_and_check_deberta_for_sequence_classification(*_A      )







		def        __lowerCAmelCase		( self		:						List[str]      )  ->			Tuple:
			__magic_name__	:   Optional[int]					     =					self.model_tester.prepare_config_and_inputs()
			self.model_tester.create_and_check_deberta_for_masked_lm(*_A      )







		def        __lowerCAmelCase		( self		:						List[Any]      )  ->			Union[str, Any]:
			__magic_name__	:   Any					     =					self.model_tester.prepare_config_and_inputs()
			self.model_tester.create_and_check_deberta_for_question_answering(*_A      )







		def        __lowerCAmelCase		( self		:						str      )  ->			List[Any]:
			__magic_name__	:   int					     =					self.model_tester.prepare_config_and_inputs()
			self.model_tester.create_and_check_deberta_for_token_classification(*_A      )







		@slow
		def        __lowerCAmelCase		( self		:						Dict      )  ->			Union[str, Any]:
			for model_name in DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
				__magic_name__	:   Optional[int]					     =					DebertaModel.from_pretrained(_A      )
				self.assertIsNotNone(_A      )







@require_torch
@require_sentencepiece
@require_tokenizers
class _lowerCamelCase	(						unittest.TestCase							):



		'''simple docstring'''







		@unittest.skip(reason='Model not available yet'      )
		def        __lowerCAmelCase		( self		:						Optional[Any]      )  ->			List[Any]:
			pass







		@slow
		def        __lowerCAmelCase		( self		:						Optional[int]      )  ->			List[str]:
			__magic_name__	:   str					     =					DebertaModel.from_pretrained('microsoft/deberta-base'      )

			__magic_name__	:   Union[str, Any]					     =					torch.tensor([[0, 31414, 232, 328, 740, 1140, 12695, 69, 46078, 1588, 2]]      )
			__magic_name__	:   List[Any]					     =					torch.tensor([[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]      )
			with torch.no_grad():
				__magic_name__	:   Optional[Any]					     =					model(_A  ,					attention_mask=_A      )[0]
			# compare the actual values for a slice.
			__magic_name__	:   Union[str, Any]					     =					torch.tensor(
			    [[[-0.5986, -0.8055, -0.8462], [1.4484, -0.9348, -0.8059], [0.3123, 0.0032, -1.4131]]]      )
			self.assertTrue(torch.allclose(output[:, 1:4, 1:4]  ,					_A  ,					atol=1E-4      )  ,					F'{output[:, 1:4, 1:4]}'      )



'''simple docstring'''

def lowerCamelCase      (      lowerCAmelCase    :     int		):





	"""simple docstring"""







	__magic_name__	:   Optional[int]					     =					1
	for i in range(1		,		num + 1		):
		fact *= i
	return fact





def lowerCamelCase      (      lowerCAmelCase    :     int		):





	"""simple docstring"""







	__magic_name__	:   List[str]					     =					0
	while number > 0:
		__magic_name__	:   str					     =					number % 10
		sum_of_digits += last_digit
		__magic_name__	:   Optional[int]					     =					number // 10  # Removing the last_digit from the given number
	return sum_of_digits





def lowerCamelCase      (      lowerCAmelCase    :     int = 100		):





	"""simple docstring"""







	__magic_name__	:   int					     =					factorial(lowerCAmelCase		)
	__magic_name__	:   Any					     =					split_and_add(lowerCAmelCase		)
	return result


if __name__ == "__main__":
							print(solution(int(input('''Enter the Number: ''').strip())))