




'''simple docstring'''







import torch
import torch.nn.functional as F

from diffusers import VQDiffusionScheduler

from .test_schedulers import SchedulerCommonTest





class      lowerCamelCase_							(       __UpperCAmelCase							):




					'''simple docstring'''






					lowercase__    = (VQDiffusionScheduler,)






					def 				__SCREAMING_SNAKE_CASE	(    self,  **__UpperCamelCase ):
							_snake_case	       =       {
							    'num_vec_classes': 4_097,
							    'num_train_timesteps': 100,
							}

							config.update(**UpperCAmelCase_ )
							return config






					def 				__SCREAMING_SNAKE_CASE	(    self,  __UpperCamelCase ):
							_snake_case	       =       4
							_snake_case	       =       8
							_snake_case	       =       8

							_snake_case	       =       torch.randint(0,  UpperCAmelCase_,  (batch_size, height * width) )

							return sample






					@property
					def 				__SCREAMING_SNAKE_CASE	(    self ):
							assert False






					def 				__SCREAMING_SNAKE_CASE	(    self,  __UpperCamelCase ):
							def model(__UpperCamelCase,  __UpperCamelCase,  *__UpperCamelCase ):
									_snake_case	       =       sample.shape
									_snake_case	       =       torch.rand((batch_size, num_vec_classes - 1, num_latent_pixels) )
									_snake_case	       =       F.log_softmax(logits.double(),  dim=1 ).float()
									return return_value

							return model






					def 				__SCREAMING_SNAKE_CASE	(    self ):
							for timesteps in [2, 5, 100, 1_000]:
									self.check_over_configs(num_train_timesteps=UpperCAmelCase_ )






					def 				__SCREAMING_SNAKE_CASE	(    self ):
							for num_vec_classes in [5, 100, 1_000, 4_000]:
									self.check_over_configs(num_vec_classes=UpperCAmelCase_ )






					def 				__SCREAMING_SNAKE_CASE	(    self ):
							for t in [0, 50, 99]:
									self.check_over_forward(time_step=UpperCAmelCase_ )






					def 				__SCREAMING_SNAKE_CASE	(    self ):
							pass







"""simple docstring"""

from __future__ import annotations
def 		UpperCAmelCase					(		a_			):





		'''simple docstring'''


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


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

										_A            = pow(b_public, a_private, q)
										_A            = 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)






