






import unittest

from diffusers import __version__
from diffusers.utils import deprecate




class 						UpperCAmelCase_  (		unittest.TestCase    ):


						'''simple docstring'''




						A   :      List[Any]						 =    '.'.join([str(int(__version__.split('.'    )[0]    ) + 1    )] + __version__.split('.'    )[1:]    )
						A   :      Union[str, Any]						 =    '0.0.1'






						def 					_lowerCAmelCase				(		self )       -> int:
								snake_case_ :							Optional[Any]         =				{"deprecated_arg": 4}

								with self.assertWarns(_SCREAMING_SNAKE_CASE ) as warning:
										snake_case_ :							Optional[int]         =				deprecate("deprecated_arg"						, self.higher_version						, "message"						, take_from=_SCREAMING_SNAKE_CASE )

								assert output == 4
								assert (
								    str(warning.warning )
								    == f'''The `deprecated_arg` argument is deprecated and will be removed in version {self.higher_version}.'''
								    " message"
								)






						def 					_lowerCAmelCase				(		self )       -> Optional[int]:
								snake_case_ :							List[Any]         =				{"deprecated_arg": 4}

								with self.assertWarns(_SCREAMING_SNAKE_CASE ) as warning:
										snake_case_ :							Tuple         =				deprecate(("deprecated_arg", self.higher_version, "message")						, take_from=_SCREAMING_SNAKE_CASE )

								assert output == 4
								assert (
								    str(warning.warning )
								    == f'''The `deprecated_arg` argument is deprecated and will be removed in version {self.higher_version}.'''
								    " message"
								)






						def 					_lowerCAmelCase				(		self )       -> Union[str, Any]:
								snake_case_ :							Tuple         =				{"deprecated_arg_1": 4, "deprecated_arg_2": 8}
								with self.assertWarns(_SCREAMING_SNAKE_CASE ) as warning:
										snake_case_       ,				snake_case_ :							Dict         =				deprecate(
										    ("deprecated_arg_1", self.higher_version, "Hey")						, ("deprecated_arg_2", self.higher_version, "Hey")						, take_from=_SCREAMING_SNAKE_CASE						, )
								assert output_a == 4
								assert output_a == 8
								assert (
								    str(warning.warnings[0].message )
								    == "The `deprecated_arg_1` argument is deprecated and will be removed in version"
								    f''' {self.higher_version}. Hey'''
								)
								assert (
								    str(warning.warnings[1].message )
								    == "The `deprecated_arg_2` argument is deprecated and will be removed in version"
								    f''' {self.higher_version}. Hey'''
								)






						def 					_lowerCAmelCase				(		self )       -> Optional[int]:
								snake_case_ :							Any         =				{"deprecated_arg": 4}

								with self.assertRaises(_SCREAMING_SNAKE_CASE ) as error:
										deprecate(("wrong_arg", self.higher_version, "message")						, take_from=_SCREAMING_SNAKE_CASE )

								assert "test_deprecate_function_incorrect_arg in" in str(error.exception )
								assert "line" in str(error.exception )
								assert "got an unexpected keyword argument `deprecated_arg`" in str(error.exception )






						def 					_lowerCAmelCase				(		self )       -> Optional[int]:
								with self.assertWarns(_SCREAMING_SNAKE_CASE ) as warning:
										deprecate(("deprecated_arg", self.higher_version, "message") )

								assert (
								    str(warning.warning )
								    == f'''`deprecated_arg` is deprecated and will be removed in version {self.higher_version}. message'''
								)






						def 					_lowerCAmelCase				(		self )       -> Optional[Any]:
								with self.assertWarns(_SCREAMING_SNAKE_CASE ) as warning:
										deprecate(
										    ("deprecated_arg_1", self.higher_version, "Hey")						, ("deprecated_arg_2", self.higher_version, "Hey")						, )
								assert (
								    str(warning.warnings[0].message )
								    == f'''`deprecated_arg_1` is deprecated and will be removed in version {self.higher_version}. Hey'''
								)
								assert (
								    str(warning.warnings[1].message )
								    == f'''`deprecated_arg_2` is deprecated and will be removed in version {self.higher_version}. Hey'''
								)






						def 					_lowerCAmelCase				(		self )       -> str:




								class 						UpperCAmelCase_  :


														'''simple docstring'''




														A   :      Any						 =    5

								with self.assertWarns(_SCREAMING_SNAKE_CASE ) as warning:
										snake_case_ :							Any         =				deprecate(("arg", self.higher_version, "message")						, take_from=Args() )

								assert arg == 5
								assert (
								    str(warning.warning )
								    == f'''The `arg` attribute is deprecated and will be removed in version {self.higher_version}. message'''
								)






						def 					_lowerCAmelCase				(		self )       -> Any:




								class 						UpperCAmelCase_  :


														'''simple docstring'''




														A   :      Dict						 =    5
														A   :      int						 =    7

								with self.assertWarns(_SCREAMING_SNAKE_CASE ) as warning:
										snake_case_       ,				snake_case_ :							int         =				deprecate(
										    ("arg", self.higher_version, "message")						, ("foo", self.higher_version, "message")						, ("does not exist", self.higher_version, "message")						, take_from=Args()						, )

								assert arg_a == 5
								assert arg_a == 7
								assert (
								    str(warning.warning )
								    == f'''The `arg` attribute is deprecated and will be removed in version {self.higher_version}. message'''
								)
								assert (
								    str(warning.warnings[0].message )
								    == f'''The `arg` attribute is deprecated and will be removed in version {self.higher_version}. message'''
								)
								assert (
								    str(warning.warnings[1].message )
								    == f'''The `foo` attribute is deprecated and will be removed in version {self.higher_version}. message'''
								)






						def 					_lowerCAmelCase				(		self )       -> str:
								snake_case_ :							List[str]         =				{"deprecated_arg": 4}

								with self.assertRaises(_SCREAMING_SNAKE_CASE ) as error:
										deprecate(("wrong_arg", self.lower_version, "message")						, take_from=_SCREAMING_SNAKE_CASE )

								assert (
								    str(error.exception )
								    == "The deprecation tuple ('wrong_arg', '0.0.1', 'message') should be removed since diffusers' version"
								    f''' {__version__} is >= {self.lower_version}'''
								)






						def 					_lowerCAmelCase				(		self )       -> List[str]:
								with self.assertWarns(_SCREAMING_SNAKE_CASE ) as warning:
										deprecate(("deprecated_arg", self.higher_version, "This message is better!!!")						, standard_warn=_SCREAMING_SNAKE_CASE )

								assert str(warning.warning ) == "This message is better!!!"






						def 					_lowerCAmelCase				(		self )       -> Optional[Any]:
								with self.assertWarns(_SCREAMING_SNAKE_CASE ) as warning:
										deprecate(("deprecated_arg", self.higher_version, "This message is better!!!")						, standard_warn=_SCREAMING_SNAKE_CASE )
								assert str(warning.warning ) == "This message is better!!!"
								assert "diffusers/tests/others/test_utils.py" in warning.filename








def    lowerCAmelCase__		(			_a				:	str     ,					_a				:	int = 13			):
		snake_case_ :							List[Any]         =				""
		for c in s:
				if "A" <= c <= "Z":
						out += chr(ord("A"			) + (ord(_a			) - ord("A"			) + n) % 26			)
				elif "a" <= c <= "z":
						out += chr(ord("a"			) + (ord(_a			) - ord("a"			) + n) % 26			)
				else:
						out += c
		return out

def    lowerCAmelCase__		(			):
		snake_case_ :							int         =				input("Enter message: "			)

		snake_case_ :							List[Any]         =				dencrypt(_a     ,					13			)
		print("Encryption:"     ,					_a			)

		snake_case_ :							int         =				dencrypt(_a     ,					13			)
		print("Decryption: "     ,					_a			)


if __name__ == "__main__":
							import doctest

							doctest.testmod()
							main()
