






'''simple docstring'''







from collections import OrderedDict
from dataclasses import fields
from typing import Any, Tuple

import numpy as np

from .import_utils import is_torch_available





def 					SCREAMING_SNAKE_CASE_			(UpperCamelCase ) ->			Union[str, Any]:
							if is_torch_available():
														import torch

														if isinstance(UpperCamelCase							,     torch.Tensor ):
																					return True

							return isinstance(UpperCamelCase							,     np.ndarray )



class _lowercase      (							_lowercase						):




							def 						lowerCamelCase_							(				self:							Any	):
														lowerCamelCase__   :      Union[str, Any]			    =			fields(self	)

														# Safety and consistency checks
														if not len(UpperCamelCase__	):
																					raise ValueError(F'''{self.__class__.__name__} has no fields.'''	)

														lowerCamelCase__   :      str			    =			getattr(self     ,				class_fields[0].name	)
														lowerCamelCase__   :      Any			    =			all(getattr(self     ,				field.name	) is None for field in class_fields[1:]	)

														if other_fields_are_none and isinstance(UpperCamelCase__     ,				UpperCamelCase__	):
																					for key, value in first_field.items():
																												lowerCamelCase__   :      int			    =			value
														else:
																					for field in class_fields:
																												lowerCamelCase__   :      Optional[int]			    =			getattr(self     ,				field.name	)
																												if v is not None:
																																			lowerCamelCase__   :      List[Any]			    =			v




							def __delitem__(				self:							List[Any]     ,				*UpperCamelCase__:							int     ,				**UpperCamelCase__:							Any	):
														raise Exception(F'''You cannot use ``__delitem__`` on a {self.__class__.__name__} instance.'''	)




							def 						lowerCamelCase_							(				self:							Union[str, Any]     ,				*UpperCamelCase__:							Tuple     ,				**UpperCamelCase__:							str	):
														raise Exception(F'''You cannot use ``setdefault`` on a {self.__class__.__name__} instance.'''	)




							def 						lowerCamelCase_							(				self:							Tuple     ,				*UpperCamelCase__:							str     ,				**UpperCamelCase__:							Union[str, Any]	):
														raise Exception(F'''You cannot use ``pop`` on a {self.__class__.__name__} instance.'''	)




							def 						lowerCamelCase_							(				self:							str     ,				*UpperCamelCase__:							List[Any]     ,				**UpperCamelCase__:							Optional[Any]	):
														raise Exception(F'''You cannot use ``update`` on a {self.__class__.__name__} instance.'''	)




							def __getitem__(				self:							Optional[int]     ,				UpperCamelCase__:							Tuple	):
														if isinstance(UpperCamelCase__     ,				UpperCamelCase__	):
																					lowerCamelCase__   :      Any			    =			dict(self.items()	)
																					return inner_dict[k]
														else:
																					return self.to_tuple()[k]




							def __setattr__(				self:							Tuple     ,				UpperCamelCase__:							Tuple     ,				UpperCamelCase__:							List[Any]	):
														if name in self.keys() and value is not None:
																					# Don't call self.__setitem__ to avoid recursion errors
																					super().__setitem__(UpperCamelCase__     ,				UpperCamelCase__	)
														super().__setattr__(UpperCamelCase__     ,				UpperCamelCase__	)




							def __setitem__(				self:							List[Any]     ,				UpperCamelCase__:							Dict     ,				UpperCamelCase__:							List[str]	):
														# Will raise a KeyException if needed
														super().__setitem__(UpperCamelCase__     ,				UpperCamelCase__	)
														# Don't call self.__setattr__ to avoid recursion errors
														super().__setattr__(UpperCamelCase__     ,				UpperCamelCase__	)




							def 						lowerCamelCase_							(				self:							List[str]	):
														return tuple(self[k] for k in self.keys()	)









'''simple docstring'''







def 					SCREAMING_SNAKE_CASE_			(UpperCamelCase							,     UpperCamelCase = 13 ) ->			str:
							lowerCamelCase__   :      Dict			    =			""""""
							for c in s:
														if "A" <= c <= "Z":
																					out += chr(ord("""A""" ) + (ord(UpperCamelCase ) - ord("""A""" ) + n) % 26 )
														elif "a" <= c <= "z":
																					out += chr(ord("""a""" ) + (ord(UpperCamelCase ) - ord("""a""" ) + n) % 26 )
														else:
																					out += c
							return out





def 					SCREAMING_SNAKE_CASE_			() ->			None:
							lowerCamelCase__   :      Dict			    =			input("""Enter message: """ )

							lowerCamelCase__   :      str			    =			dencrypt(UpperCamelCase							,     13 )
							print("""Encryption:"""							,     UpperCamelCase )

							lowerCamelCase__   :      List[str]			    =			dencrypt(UpperCamelCase							,     13 )
							print("""Decryption: """							,     UpperCamelCase )


if __name__ == "__main__":
			import doctest

			doctest.testmod()
			main()

