






import unittest

from diffusers import __version__
from diffusers.utils import deprecate





class __lowerCamelCase					( unittest.TestCase):





	"""simple docstring"""






	UpperCamelCase__								= ".".join([str(int(__version__.split(".")[0]) + 1)] + __version__.split(".")[1:])
	UpperCamelCase__								= "0.0.1"

	def 			UpperCamelCase       (				self       ):
							"""simple docstring"""







							_UpperCAmelCase							   =     {'deprecated_arg': 4}

							with self.assertWarns(lowerCamelCase__       ) as warning:
													_UpperCAmelCase							   =     deprecate('deprecated_arg'			,       self.higher_version			,       'message'			,       take_from=lowerCamelCase__       )

							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 			UpperCamelCase       (				self       ):
							"""simple docstring"""







							_UpperCAmelCase							   =     {'deprecated_arg': 4}

							with self.assertWarns(lowerCamelCase__       ) as warning:
													_UpperCAmelCase							   =     deprecate(('deprecated_arg', self.higher_version, 'message')			,       take_from=lowerCamelCase__       )

							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 			UpperCamelCase       (				self       ):
							"""simple docstring"""







							_UpperCAmelCase							   =     {'deprecated_arg_1': 4, 'deprecated_arg_2': 8}
							with self.assertWarns(lowerCamelCase__       ) as warning:
													_UpperCAmelCase   ,					_UpperCAmelCase							   =     deprecate(
													    ('deprecated_arg_1', self.higher_version, 'Hey')			,       ('deprecated_arg_2', self.higher_version, 'Hey')			,       take_from=lowerCamelCase__			,       )
							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 			UpperCamelCase       (				self       ):
							"""simple docstring"""







							_UpperCAmelCase							   =     {'deprecated_arg': 4}

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

							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 			UpperCamelCase       (				self       ):
							"""simple docstring"""







							with self.assertWarns(lowerCamelCase__       ) 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 			UpperCamelCase       (				self       ):
							"""simple docstring"""







							with self.assertWarns(lowerCamelCase__       ) 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 			UpperCamelCase       (				self       ):
							"""simple docstring"""







							class __lowerCamelCase					:





								"""simple docstring"""






								UpperCamelCase__								= 5

							with self.assertWarns(lowerCamelCase__       ) as warning:
													_UpperCAmelCase							   =     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 			UpperCamelCase       (				self       ):
							"""simple docstring"""







							class __lowerCamelCase					:





								"""simple docstring"""






								UpperCamelCase__								= 5
								UpperCamelCase__								= 7

							with self.assertWarns(lowerCamelCase__       ) as warning:
													_UpperCAmelCase   ,					_UpperCAmelCase							   =     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 			UpperCamelCase       (				self       ):
							"""simple docstring"""







							_UpperCAmelCase							   =     {'deprecated_arg': 4}

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

							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 			UpperCamelCase       (				self       ):
							"""simple docstring"""







							with self.assertWarns(lowerCamelCase__       ) as warning:
													deprecate(('deprecated_arg', self.higher_version, 'This message is better!!!')			,       standard_warn=lowerCamelCase__       )

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

	def 			UpperCamelCase       (				self       ):
							"""simple docstring"""







							with self.assertWarns(lowerCamelCase__       ) as warning:
													deprecate(('deprecated_arg', self.higher_version, 'This message is better!!!')			,       standard_warn=lowerCamelCase__       )
							assert str(warning.warning       ) == "This message is better!!!"
							assert "diffusers/tests/others/test_utils.py" in warning.filename

"""simple docstring"""






from __future__ import annotations



def     a_		(   lowerCamelCase			):
				for r in range(1   ,     lowerCamelCase			):
								UpperCAmelCase__			 =				[]
								for x in range(n - 1			):
												UpperCAmelCase__			 =				pow(lowerCamelCase   ,     lowerCamelCase   ,     lowerCamelCase			)
												if val in li:
																break
												li.append(lowerCamelCase			)
								else:
												return r
				return None


if __name__ == "__main__":
						lowerCAmelCase__    :    Any			=      int(input('Enter a prime number q: '))
						lowerCAmelCase__    :    List[str]			=      find_primitive(q)
						if a is None:
												print(F"""Cannot find the primitive for the value: {a!r}""")
						else:
												lowerCAmelCase__    :    str			=      int(input('Enter private key of A: '))
												lowerCAmelCase__    :    List[Any]			=      pow(a, a_private, q)
												lowerCAmelCase__    :    List[str]			=      int(input('Enter private key of B: '))
												lowerCAmelCase__    :    Any			=      pow(a, b_private, q)

												lowerCAmelCase__    :    Union[str, Any]			=      pow(b_public, a_private, q)
												lowerCAmelCase__    :    Tuple			=      pow(a_public, b_private, q)

												print('The key value generated by A is: ', a_secret)
												print('The key value generated by B is: ', b_secret)



