





"""simple docstring"""





import unittest

from transformers import is_torch_available, is_vision_available
from transformers.testing_utils import require_torch, require_vision, slow, torch_device


if is_torch_available():
						import torch

						from transformers import AutoModelForImageClassification

if is_vision_available():
						from transformers import AutoImageProcessor





@require_torch
@require_vision
class        _lowerCamelCase      (       unittest.TestCase ):


						@slow
						def     snake_case_   (self		) ->   List[Any]:
								UpperCamelCase   =	AutoImageProcessor.from_pretrained("microsoft/dit-base-finetuned-rvlcdip"		)
								UpperCamelCase   =	AutoModelForImageClassification.from_pretrained("microsoft/dit-base-finetuned-rvlcdip"		)
								model.to(__a		)

								from datasets import load_dataset

								UpperCamelCase   =	load_dataset("nielsr/rvlcdip-demo"		)

								UpperCamelCase   =	dataset["train"][0]["image"].convert("RGB"		)

								UpperCamelCase   =	image_processor(__a   ,							return_tensors="pt"		).to(__a		)

								# forward pass
								with torch.no_grad():
										UpperCamelCase   =	model(**__a		)
										UpperCamelCase   =	outputs.logits

								UpperCamelCase   =	torch.Size((1, 16)		)
								self.assertEqual(logits.shape   ,							__a		)

								UpperCamelCase   =	torch.tensor(
								    [-0.4158, -0.4092, -0.4347]   ,							device=__a   ,							dtype=torch.float   ,							)
								self.assertTrue(torch.allclose(logits[0, :3]   ,							__a   ,							atol=1e-4		)		)













"""simple docstring"""





import string


def       a__					(					_SCREAMING_SNAKE_CASE    ):




		"""simple docstring"""


		for key in range(len(string.ascii_uppercase    )    ):
				UpperCamelCase   =	""
				for symbol in message:
						if symbol in string.ascii_uppercase:
								UpperCamelCase   =	string.ascii_uppercase.find(_SCREAMING_SNAKE_CASE    )
								UpperCamelCase   =	num - key
								if num < 0:
										UpperCamelCase   =	num + len(string.ascii_uppercase    )
								UpperCamelCase   =	translated + string.ascii_uppercase[num]
						else:
								UpperCamelCase   =	translated + symbol
				print(F"Decryption using Key #{key}: {translated}"    )


def       a__					(					):




		"""simple docstring"""


		UpperCamelCase   =	input("Encrypted message: "    )
		UpperCamelCase   =	message.upper()
		decrypt(_SCREAMING_SNAKE_CASE    )


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						main()






