





import unittest
from timeit import timeit
def 			__UpperCamelCase				(			lowercase__	:       int		,    lowercase__	:       int		)	->      int:
    '''simple docstring'''





    lowerCAmelCase_					:	Union[str, Any]						=   first_num if first_num >= second_num else second_num
    lowerCAmelCase_					:	Dict						=   max_num
    while (common_mult % first_num > 0) or (common_mult % second_num > 0):
        common_mult += max_num
    return common_mult
def 			__UpperCamelCase				(			lowercase__	:       int		,    lowercase__	:       int		)	->      int:
    '''simple docstring'''





    return b if a == 0 else greatest_common_divisor(b % a		,    lowercase__		)
def 			__UpperCamelCase				(			lowercase__	:       int		,    lowercase__	:       int		)	->      int:
    '''simple docstring'''





    return first_num // greatest_common_divisor(lowercase__		,    lowercase__		) * second_num
def 			__UpperCamelCase				(			)	->      Optional[int]:
    '''simple docstring'''





    lowerCAmelCase_					:	Any						=   (
        """from __main__ import least_common_multiple_slow, least_common_multiple_fast"""
    )
    print(
        """least_common_multiple_slow():"""		,    timeit("""least_common_multiple_slow(1000, 999)"""		,    setup=lowercase__		)		,    )
    print(
        """least_common_multiple_fast():"""		,    timeit("""least_common_multiple_fast(1000, 999)"""		,    setup=lowercase__		)		,    )

class 		__a							(	unittest.TestCase      ):
       __snake_case						:   Tuple      =		(
           (10, 20),
           (13, 15),
           (4, 31),
           (10, 42),
           (43, 34),
           (5, 12),
           (12, 25),
           (10, 25),
           (6, 9),
       )
       __snake_case						:   str      =		(20, 195, 124, 210, 1462, 60, 300, 50, 18)



       def  A							(     self	:   Optional[int]			):
           for i, (first_num, second_num) in enumerate(self.test_inputs			):
               lowerCAmelCase_					:	List[Any]						=   least_common_multiple_slow(UpperCAmelCase					,			UpperCAmelCase			)
               lowerCAmelCase_					:	List[Any]						=   least_common_multiple_fast(UpperCAmelCase					,			UpperCAmelCase			)
               with self.subTest(i=UpperCAmelCase			):
                   self.assertEqual(UpperCAmelCase					,			self.expected_results[i]			)
                   self.assertEqual(UpperCAmelCase					,			self.expected_results[i]			)


if __name__ == "__main__":
  benchmark()
  unittest.main()









import torch
import torch.nn.functional as F

from diffusers import VQDiffusionScheduler

from .test_schedulers import SchedulerCommonTest

class 		__a							(	__UpperCamelCase      ):
       __snake_case						:   Optional[Any]      =		(VQDiffusionScheduler,)



       def  A							(     self	:   Optional[int]					,			**UpperCAmelCase	:   List[Any]			):
           lowerCAmelCase_					:	Any						=   {
               """num_vec_classes""": 40_97,
               """num_train_timesteps""": 1_00,
           }

           config.update(**UpperCAmelCase			)
           return config



       def  A							(     self	:   str					,			UpperCAmelCase	:   List[Any]			):
           lowerCAmelCase_					:	Union[str, Any]						=   4
           lowerCAmelCase_					:	str						=   8
           lowerCAmelCase_					:	Optional[Any]						=   8

           lowerCAmelCase_					:	str						=   torch.randint(0					,			UpperCAmelCase					,			(batch_size, height * width)			)

           return sample



       @property
       def  A							(     self	:   Optional[int]			):
           assert False



       def  A							(     self	:   int					,			UpperCAmelCase	:   Dict			):
           def model(UpperCAmelCase	:   Union[str, Any]					,			UpperCAmelCase	:   List[str]					,			*UpperCAmelCase	:   List[Any]			):
               lowerCAmelCase_		,		lowerCAmelCase_					:	Tuple						=   sample.shape
               lowerCAmelCase_					:	int						=   torch.rand((batch_size, num_vec_classes - 1, num_latent_pixels)			)
               lowerCAmelCase_					:	str						=   F.log_softmax(logits.double()					,			dim=1			).float()
               return return_value

           return model



       def  A							(     self	:   Union[str, Any]			):
           for timesteps in [2, 5, 1_00, 10_00]:
               self.check_over_configs(num_train_timesteps=UpperCAmelCase			)



       def  A							(     self	:   str			):
           for num_vec_classes in [5, 1_00, 10_00, 40_00]:
               self.check_over_configs(num_vec_classes=UpperCAmelCase			)



       def  A							(     self	:   Optional[Any]			):
           for t in [0, 50, 99]:
               self.check_over_forward(time_step=UpperCAmelCase			)



       def  A							(     self	:   int			):
           pass


