code: 
  
  
  
  
  """simple docstring"""
  
  import unittest
  from timeit import timeit
  
  
  
  def   UpperCamelCase__     (		lowercase__  :     int       ,     lowercase__  :     int   ):
  		snake_case		:						str								=				first_num if first_num >= second_num else second_num
  		snake_case		:						Tuple								=				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   ):
  		return b if a == 0 else greatest_common_divisor(b % a       ,     _UpperCamelCase   )
  
  
  
  def   UpperCamelCase__     (		lowercase__  :     int       ,     lowercase__  :     int   ):
  		return first_num // greatest_common_divisor(_UpperCamelCase       ,     _UpperCamelCase   ) * second_num
  
  
  
  def   UpperCamelCase__     (		):
  		snake_case		:						Optional[int]								=				(
  		    "from __main__ import least_common_multiple_slow, least_common_multiple_fast"
  		)
  		print(
  		    "least_common_multiple_slow():"       ,     timeit("least_common_multiple_slow(1000, 999)"       ,     setup=_UpperCamelCase   )       ,     )
  		print(
  		    "least_common_multiple_fast():"       ,     timeit("least_common_multiple_fast(1000, 999)"       ,     setup=_UpperCamelCase   )       ,     )
  class 			lowerCamelCase__    (  unittest.TestCase			):
  			a__ :      str								=     (
  			    (10, 20),
  			    (13, 15),
  			    (4, 31),
  			    (10, 42),
  			    (43, 34),
  			    (5, 12),
  			    (12, 25),
  			    (10, 25),
  			    (6, 9),
  			)
  			a__ :      int								=     (20, 1_95, 1_24, 2_10, 14_62, 60, 3_00, 50, 18)
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					for i, (first_num, second_num) in enumerate(self.test_inputs							):
  							snake_case		:						Union[str, Any]								=				least_common_multiple_slow(a_				, a_							)
  							snake_case		:						Optional[int]								=				least_common_multiple_fast(a_				, a_							)
  							with self.subTest(i=a_							):
  									self.assertEqual(a_				, self.expected_results[i]							)
  									self.assertEqual(a_				, self.expected_results[i]							)
  
  
  if __name__ == "__main__":
  							benchmark()
  							unittest.main()
  
  
  
  
style_context: 
  
  
  
  
  """simple docstring"""
  
  import unittest
  
  import numpy as np
  import PIL
  import torch
  
  from diffusers.image_processor import VaeImageProcessor
  class 			lowerCamelCase__    (  unittest.TestCase			):
  
  
  			@property
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						int								=				1
  					snake_case		:						Dict								=				3
  					snake_case		:						int								=				8
  					snake_case		:						int								=				8
  
  					snake_case		:						List[str]								=				torch.rand((batch_size, num_channels, height, width)							)
  
  					return sample
  
  
  			def 							lowerCamelCase_				(     self				, SCREAMING_SNAKE_CASE							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					if isinstance(image[0]				, PIL.Image.Image							):
  							return np.stack([np.array(SCREAMING_SNAKE_CASE							) for i in image]				, axis=0							)
  					elif isinstance(SCREAMING_SNAKE_CASE				, torch.Tensor							):
  							return image.cpu().numpy().transpose(0				, 2				, 3				, 1							)
  					return image
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						Optional[int]								=				VaeImageProcessor(do_resize=SCREAMING_SNAKE_CASE				, do_normalize=SCREAMING_SNAKE_CASE							)
  
  					snake_case		:						Any								=				self.dummy_sample
  					snake_case		:						Optional[Any]								=				self.to_np(SCREAMING_SNAKE_CASE							)
  
  					for output_type in ["pt", "np", "pil"]:
  							snake_case		:						Optional[Any]								=				image_processor.postprocess(
  							    image_processor.preprocess(SCREAMING_SNAKE_CASE							)				, output_type=SCREAMING_SNAKE_CASE				, )
  							snake_case		:						Optional[Any]								=				self.to_np(SCREAMING_SNAKE_CASE							)
  							snake_case		:						Any								=				(input_np * 255).round() if output_type == "pil" else input_np
  							assert (
  							    np.abs(in_np - out_np							).max() < 1E-6
  							), F'''decoded output does not match input for output_type {output_type}'''
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						Dict								=				VaeImageProcessor(do_resize=SCREAMING_SNAKE_CASE				, do_normalize=SCREAMING_SNAKE_CASE							)
  					snake_case		:						Tuple								=				self.dummy_sample.cpu().numpy().transpose(0				, 2				, 3				, 1							)
  
  					for output_type in ["pt", "np", "pil"]:
  							snake_case		:						Dict								=				image_processor.postprocess(image_processor.preprocess(SCREAMING_SNAKE_CASE							)				, output_type=SCREAMING_SNAKE_CASE							)
  
  							snake_case		:						Union[str, Any]								=				self.to_np(SCREAMING_SNAKE_CASE							)
  							snake_case		:						Tuple								=				(input_np * 255).round() if output_type == "pil" else input_np
  							assert (
  							    np.abs(in_np - out_np							).max() < 1E-6
  							), F'''decoded output does not match input for output_type {output_type}'''
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						Optional[Any]								=				VaeImageProcessor(do_resize=SCREAMING_SNAKE_CASE				, do_normalize=SCREAMING_SNAKE_CASE							)
  
  					snake_case		:						str								=				self.dummy_sample.cpu().numpy().transpose(0				, 2				, 3				, 1							)
  					snake_case		:						int								=				image_processor.numpy_to_pil(SCREAMING_SNAKE_CASE							)
  
  					for output_type in ["pt", "np", "pil"]:
  							snake_case		:						Dict								=				image_processor.postprocess(image_processor.preprocess(SCREAMING_SNAKE_CASE							)				, output_type=SCREAMING_SNAKE_CASE							)
  							for i, o in zip(SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE							):
  									snake_case		:						Dict								=				np.array(SCREAMING_SNAKE_CASE							)
  									snake_case		:						Tuple								=				self.to_np(SCREAMING_SNAKE_CASE							) if output_type == "pil" else (self.to_np(SCREAMING_SNAKE_CASE							) * 255).round()
  									assert (
  									    np.abs(in_np - out_np							).max() < 1E-6
  									), F'''decoded output does not match input for output_type {output_type}'''
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						Tuple								=				VaeImageProcessor(do_resize=SCREAMING_SNAKE_CASE				, do_normalize=SCREAMING_SNAKE_CASE							)
  
  					snake_case		:						List[str]								=				self.dummy_sample
  					snake_case		:						Optional[int]								=				input_pt_ad.squeeze(0							)
  
  					snake_case		:						Any								=				image_processor.postprocess(
  					    image_processor.preprocess(SCREAMING_SNAKE_CASE							)				, output_type="np"				, )
  					snake_case		:						Union[str, Any]								=				image_processor.postprocess(
  					    image_processor.preprocess(SCREAMING_SNAKE_CASE							)				, output_type="np"				, )
  
  					snake_case		:						Union[str, Any]								=				self.to_np(self.dummy_sample							)
  					snake_case		:						Tuple								=				input_np_ad.squeeze(0							)
  
  					snake_case		:						str								=				image_processor.postprocess(
  					    image_processor.preprocess(SCREAMING_SNAKE_CASE							)				, output_type="np"				, )
  					snake_case		:						Union[str, Any]								=				image_processor.postprocess(
  					    image_processor.preprocess(SCREAMING_SNAKE_CASE							)				, output_type="np"				, )
  
  					assert np.abs(out_pt_ad - out_pt_ad							).max() < 1E-6
  					assert np.abs(out_np_ad - out_np_ad							).max() < 1E-6
  
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						Optional[Any]								=				VaeImageProcessor(do_resize=SCREAMING_SNAKE_CASE				, do_normalize=SCREAMING_SNAKE_CASE							)
  
  					snake_case		:						Union[str, Any]								=				self.dummy_sample
  					snake_case		:						List[str]								=				list(SCREAMING_SNAKE_CASE							)
  
  					snake_case		:						str								=				image_processor.postprocess(
  					    image_processor.preprocess(SCREAMING_SNAKE_CASE							)				, output_type="np"				, )
  
  					snake_case		:						Any								=				image_processor.postprocess(
  					    image_processor.preprocess(SCREAMING_SNAKE_CASE							)				, output_type="np"				, )
  
  					snake_case		:						Dict								=				self.to_np(self.dummy_sample							)
  					list(SCREAMING_SNAKE_CASE							)
  
  					snake_case		:						str								=				image_processor.postprocess(
  					    image_processor.preprocess(SCREAMING_SNAKE_CASE							)				, output_type="np"				, )
  
  					snake_case		:						Union[str, Any]								=				image_processor.postprocess(
  					    image_processor.preprocess(SCREAMING_SNAKE_CASE							)				, output_type="np"				, )
  
  					assert np.abs(out_pt_ad - out_pt_list							).max() < 1E-6
  					assert np.abs(out_np_ad - out_np_list							).max() < 1E-6
  
  