

import string

def       a__					(		UpperCAmelCase							:      str      )  ->						None:
		for key in range(len(string.ascii_uppercase      )      ):
				UpperCAmelCase	:							int						=			''''''
				for symbol in message:
						if symbol in string.ascii_uppercase:
								UpperCAmelCase	:							List[Any]						=			string.ascii_uppercase.find(UpperCAmelCase      )
								UpperCAmelCase	:							int						=			num - key
								if num < 0:
										UpperCAmelCase	:							Union[str, Any]						=			num + len(string.ascii_uppercase      )
								UpperCAmelCase	:							Dict						=			translated + string.ascii_uppercase[num]
						else:
								UpperCAmelCase	:							Optional[int]						=			translated + symbol
				print(f'''Decryption using Key #{key}: {translated}'''      )

def       a__					(		)  ->						None:
		UpperCAmelCase	:							int						=			input('''Encrypted message: '''      )
		UpperCAmelCase	:							List[Any]						=			message.upper()
		decrypt(UpperCAmelCase      )


if __name__ == "__main__":
					import doctest

					doctest.testmod()
					main()








import unittest

from transformers import DebertaVaConfig, 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 (
         DebertaVaForMaskedLM,
         DebertaVaForMultipleChoice,
         DebertaVaForQuestionAnswering,
         DebertaVaForSequenceClassification,
         DebertaVaForTokenClassification,
         DebertaVaModel,
     )
     from transformers.models.deberta_va.modeling_deberta_va import DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST





class  __UpperCAmelCase					(	lowerCamelCase__						):



   def __init__(							self							:					Dict,		__A							:					Any,		__A							:					Optional[int]=1_3,		__A							:					Any=7,		__A							:					Tuple=True,		__A							:					int=True,		__A							:					Dict=True,		__A							:					Union[str, Any]=True,		__A							:					Optional[int]=9_9,		__A							:					Optional[int]=3_2,		__A							:					Union[str, Any]=5,		__A							:					Optional[int]=4,		__A							:					str=3_7,		__A							:					Union[str, Any]="gelu",		__A							:					Optional[int]=0.1,		__A							:					Optional[Any]=0.1,		__A							:					Any=5_1_2,		__A							:					List[str]=1_6,		__A							:					Optional[int]=2,		__A							:					Union[str, Any]=0.0_2,		__A							:					Optional[int]=False,		__A							:					List[str]=True,		__A							:					int="None",		__A							:					List[str]=3,		__A							:					Any=4,		__A							:					Dict=None,		):
     UpperCAmelCase	:							str						=			parent
     UpperCAmelCase	:							int						=			batch_size
     UpperCAmelCase	:							Tuple						=			seq_length
     UpperCAmelCase	:							Union[str, Any]						=			is_training
     UpperCAmelCase	:							Dict						=			use_input_mask
     UpperCAmelCase	:							Optional[Any]						=			use_token_type_ids
     UpperCAmelCase	:							str						=			use_labels
     UpperCAmelCase	:							List[Any]						=			vocab_size
     UpperCAmelCase	:							Union[str, Any]						=			hidden_size
     UpperCAmelCase	:							Tuple						=			num_hidden_layers
     UpperCAmelCase	:							str						=			num_attention_heads
     UpperCAmelCase	:							Tuple						=			intermediate_size
     UpperCAmelCase	:							Optional[Any]						=			hidden_act
     UpperCAmelCase	:							int						=			hidden_dropout_prob
     UpperCAmelCase	:							Union[str, Any]						=			attention_probs_dropout_prob
     UpperCAmelCase	:							Union[str, Any]						=			max_position_embeddings
     UpperCAmelCase	:							int						=			type_vocab_size
     UpperCAmelCase	:							str						=			type_sequence_label_size
     UpperCAmelCase	:							Union[str, Any]						=			initializer_range
     UpperCAmelCase	:							Dict						=			num_labels
     UpperCAmelCase	:							Optional[Any]						=			num_choices
     UpperCAmelCase	:							str						=			relative_attention
     UpperCAmelCase	:							Any						=			position_biased_input
     UpperCAmelCase	:							str						=			pos_att_type
     UpperCAmelCase	:							Union[str, Any]						=			scope



   def 	__magic_name__   (							self							:					Union[str, Any]						):
     UpperCAmelCase	:							Union[str, Any]						=			ids_tensor([self.batch_size, self.seq_length],		self.vocab_size						)

     UpperCAmelCase	:							int						=			None
     if self.use_input_mask:
       UpperCAmelCase	:							int						=			ids_tensor([self.batch_size, self.seq_length],		vocab_size=2						)

     UpperCAmelCase	:							Dict						=			None
     if self.use_token_type_ids:
       UpperCAmelCase	:							int						=			ids_tensor([self.batch_size, self.seq_length],		self.type_vocab_size						)

     UpperCAmelCase	:							List[str]						=			None
     UpperCAmelCase	:							str						=			None
     UpperCAmelCase	:							Any						=			None
     if self.use_labels:
       UpperCAmelCase	:							str						=			ids_tensor([self.batch_size],		self.type_sequence_label_size						)
       UpperCAmelCase	:							Union[str, Any]						=			ids_tensor([self.batch_size, self.seq_length],		self.num_labels						)
       UpperCAmelCase	:							List[Any]						=			ids_tensor([self.batch_size],		self.num_choices						)

     UpperCAmelCase	:							Union[str, Any]						=			self.get_config()

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



   def 	__magic_name__   (							self							:					Any						):
     return DebertaVaConfig(
         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 	__magic_name__   (							self							:					Dict,		__A							:					str						):
     self.parent.assertListEqual(list(result.loss.size()						),		[]						)



   def 	__magic_name__   (							self							:					List[str],		__A							:					Dict,		__A							:					int,		__A							:					str,		__A							:					List[str],		__A							:					Dict,		__A							:					str,		__A							:					int						):
     UpperCAmelCase	:							Optional[int]						=			DebertaVaModel(config=__A						)
     model.to(__A						)
     model.eval()
     UpperCAmelCase	:							Optional[int]						=			model(__A,		attention_mask=__A,		token_type_ids=__A						)[0]
     UpperCAmelCase	:							Optional[int]						=			model(__A,		token_type_ids=__A						)[0]
     UpperCAmelCase	:							int						=			model(__A						)[0]

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



   def 	__magic_name__   (							self							:					Dict,		__A							:					Union[str, Any],		__A							:					Optional[Any],		__A							:					Tuple,		__A							:					Optional[int],		__A							:					List[Any],		__A							:					List[Any],		__A							:					Optional[int]						):
     UpperCAmelCase	:							int						=			DebertaVaForMaskedLM(config=__A						)
     model.to(__A						)
     model.eval()
     UpperCAmelCase	:							int						=			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 	__magic_name__   (							self							:					List[str],		__A							:					str,		__A							:					Optional[Any],		__A							:					List[str],		__A							:					Optional[int],		__A							:					List[Any],		__A							:					int,		__A							:					Optional[int]						):
     UpperCAmelCase	:							int						=			self.num_labels
     UpperCAmelCase	:							Union[str, Any]						=			DebertaVaForSequenceClassification(__A						)
     model.to(__A						)
     model.eval()
     UpperCAmelCase	:							int						=			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 	__magic_name__   (							self							:					Any,		__A							:					Tuple,		__A							:					Any,		__A							:					str,		__A							:					List[Any],		__A							:					Dict,		__A							:					Optional[Any],		__A							:					List[str]						):
     UpperCAmelCase	:							Dict						=			self.num_labels
     UpperCAmelCase	:							int						=			DebertaVaForTokenClassification(config=__A						)
     model.to(__A						)
     model.eval()
     UpperCAmelCase	:							Tuple						=			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 	__magic_name__   (							self							:					Tuple,		__A							:					List[str],		__A							:					Tuple,		__A							:					Tuple,		__A							:					int,		__A							:					Optional[Any],		__A							:					Tuple,		__A							:					Any						):
     UpperCAmelCase	:							Union[str, Any]						=			DebertaVaForQuestionAnswering(config=__A						)
     model.to(__A						)
     model.eval()
     UpperCAmelCase	:							Any						=			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 	__magic_name__   (							self							:					Dict,		__A							:					Optional[int],		__A							:					str,		__A							:					List[str],		__A							:					Dict,		__A							:					Optional[Any],		__A							:					Union[str, Any],		__A							:					int						):
     UpperCAmelCase	:							Union[str, Any]						=			DebertaVaForMultipleChoice(config=__A						)
     model.to(__A						)
     model.eval()
     UpperCAmelCase	:							Optional[Any]						=			input_ids.unsqueeze(1						).expand(-1,		self.num_choices,		-1						).contiguous()
     UpperCAmelCase	:							int						=			token_type_ids.unsqueeze(1						).expand(-1,		self.num_choices,		-1						).contiguous()
     UpperCAmelCase	:							Tuple						=			input_mask.unsqueeze(1						).expand(-1,		self.num_choices,		-1						).contiguous()
     UpperCAmelCase	:							int						=			model(
         __A,		attention_mask=__A,		token_type_ids=__A,		labels=__A,		)
     self.parent.assertEqual(result.logits.shape,		(self.batch_size, self.num_choices)						)





   def 	__magic_name__   (							self							:					List[str]						):
     UpperCAmelCase	:							Any						=			self.prepare_config_and_inputs()
     (
         (
         UpperCAmelCase
     )			,						(
         UpperCAmelCase
     )			,						(
         UpperCAmelCase
     )			,						(
         UpperCAmelCase
     )			,						(
         UpperCAmelCase
     )			,						(
         UpperCAmelCase
     )			,						(
         UpperCAmelCase
     )			,						
     )	:							List[str]						=			config_and_inputs
     UpperCAmelCase	:							int						=			{'''input_ids''': input_ids, '''token_type_ids''': token_type_ids, '''attention_mask''': input_mask}
     return config, inputs_dict






@require_torch
class  __UpperCAmelCase					(	lowerCamelCase__      ,  lowerCamelCase__      ,  unittest.TestCase						):
   UpperCamelCase       					=					(
       (
           DebertaVaModel,
           DebertaVaForMaskedLM,
           DebertaVaForSequenceClassification,
           DebertaVaForTokenClassification,
           DebertaVaForQuestionAnswering,
           DebertaVaForMultipleChoice,
       )
       if is_torch_available()
       else ()
   )
   UpperCamelCase       					=					(
       {
           """feature-extraction""": DebertaVaModel,
           """fill-mask""": DebertaVaForMaskedLM,
           """question-answering""": DebertaVaForQuestionAnswering,
           """text-classification""": DebertaVaForSequenceClassification,
           """token-classification""": DebertaVaForTokenClassification,
           """zero-shot""": DebertaVaForSequenceClassification,
       }
       if is_torch_available()
       else {}
   )

   UpperCamelCase       					=					True
   UpperCamelCase       					=					False
   UpperCamelCase       					=					False
   UpperCamelCase       					=					False
   UpperCamelCase       					=					False



   def 	__magic_name__   (							self							:					Union[str, Any]						):
     UpperCAmelCase	:							str						=			DebertaVaModelTester(self						)
     UpperCAmelCase	:							Dict						=			ConfigTester(self,		config_class=__A,		hidden_size=3_7						)



   def 	__magic_name__   (							self							:					Any						):
     self.config_tester.run_common_tests()



   def 	__magic_name__   (							self							:					Union[str, Any]						):
     UpperCAmelCase	:							Any						=			self.model_tester.prepare_config_and_inputs()
     self.model_tester.create_and_check_deberta_model(*__A						)



   def 	__magic_name__   (							self							:					List[Any]						):
     UpperCAmelCase	:							Dict						=			self.model_tester.prepare_config_and_inputs()
     self.model_tester.create_and_check_deberta_for_sequence_classification(*__A						)



   def 	__magic_name__   (							self							:					Tuple						):
     UpperCAmelCase	:							List[Any]						=			self.model_tester.prepare_config_and_inputs()
     self.model_tester.create_and_check_deberta_for_masked_lm(*__A						)



   def 	__magic_name__   (							self							:					Union[str, Any]						):
     UpperCAmelCase	:							Optional[int]						=			self.model_tester.prepare_config_and_inputs()
     self.model_tester.create_and_check_deberta_for_question_answering(*__A						)



   def 	__magic_name__   (							self							:					List[str]						):
     UpperCAmelCase	:							Optional[Any]						=			self.model_tester.prepare_config_and_inputs()
     self.model_tester.create_and_check_deberta_for_token_classification(*__A						)



   def 	__magic_name__   (							self							:					Any						):
     UpperCAmelCase	:							Optional[int]						=			self.model_tester.prepare_config_and_inputs()
     self.model_tester.create_and_check_deberta_for_multiple_choice(*__A						)





   @slow
   def 	__magic_name__   (							self							:					Dict						):
     for model_name in DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
       UpperCAmelCase	:							str						=			DebertaVaModel.from_pretrained(__A						)
       self.assertIsNotNone(__A						)






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



   @unittest.skip(reason='''Model not available yet'''						)
   def 	__magic_name__   (							self							:					str						):
     pass





   @slow
   def 	__magic_name__   (							self							:					Optional[int]						):
     UpperCAmelCase	:							str						=			DebertaVaModel.from_pretrained('''microsoft/deberta-v2-xlarge'''						)

     UpperCAmelCase	:							Union[str, Any]						=			torch.tensor([[0, 3_1_4_1_4, 2_3_2, 3_2_8, 7_4_0, 1_1_4_0, 1_2_6_9_5, 6_9, 4_6_0_7_8, 1_5_8_8, 2]]						)
     UpperCAmelCase	:							Any						=			torch.tensor([[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]						)
     with torch.no_grad():
       UpperCAmelCase	:							List[str]						=			model(__A,		attention_mask=__A						)[0]
     # compare the actual values for a slice.
     UpperCAmelCase	:							List[str]						=			torch.tensor(
         [[[0.2_3_5_6, 0.1_9_4_8, 0.0_3_6_9], [-0.1_0_6_3, 0.3_5_8_6, -0.5_1_5_2], [-0.6_3_9_9, -0.0_2_5_9, -0.2_5_2_5]]]						)
     self.assertTrue(torch.allclose(output[:, 1:4, 1:4],		__A,		atol=1E-4						),		F'''{output[:, 1:4, 1:4]}'''						)





