'''simple docstring'''




import unittest

import numpy as np
import torch

from diffusers import PNDMPipeline, PNDMScheduler, UNetaDModel
from diffusers.utils.testing_utils import enable_full_determinism, require_torch, slow, torch_device


enable_full_determinism()




class     a__      (   unittest.TestCase ):






     @property
     def    SCREAMING_SNAKE_CASE__   ( self		:		Optional[Any]    ):





         """simple docstring"""



         torch.manual_seed(0    )
         __lowerCamelCase		=  UNetaDModel(
             block_out_channels=(32, 64)  ,				layers_per_block=2  ,				sample_size=32  ,				in_channels=3  ,				out_channels=3  ,				down_block_types=('''DownBlock2D''', '''AttnDownBlock2D''')  ,				up_block_types=('''AttnUpBlock2D''', '''UpBlock2D''')  ,				)
         return model






     def    SCREAMING_SNAKE_CASE__   ( self		:		List[str]    ):





         """simple docstring"""



         __lowerCamelCase		=  self.dummy_uncond_unet
         __lowerCamelCase		=  PNDMScheduler()

         __lowerCamelCase		=  PNDMPipeline(unet=a  ,				scheduler=a    )
         pndm.to(a    )
         pndm.set_progress_bar_config(disable=a    )

         __lowerCamelCase		=  torch.manual_seed(0    )
         __lowerCamelCase		=  pndm(generator=a  ,				num_inference_steps=20  ,				output_type='''numpy'''    ).images

         __lowerCamelCase		=  torch.manual_seed(0    )
         __lowerCamelCase		=  pndm(generator=a  ,				num_inference_steps=20  ,				output_type='''numpy'''  ,				return_dict=a    )[0]

         __lowerCamelCase		=  image[0, -3:, -3:, -1]
         __lowerCamelCase		=  image_from_tuple[0, -3:, -3:, -1]

         assert image.shape == (1, 32, 32, 3)
         __lowerCamelCase		=  np.array([1.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0, 0.0]    )

         assert np.abs(image_slice.flatten() - expected_slice    ).max() < 1e-2
         assert np.abs(image_from_tuple_slice.flatten() - expected_slice    ).max() < 1e-2




@slow
@require_torch
class     a__      (   unittest.TestCase ):






     def    SCREAMING_SNAKE_CASE__   ( self		:		int    ):





         """simple docstring"""



         __lowerCamelCase		=  '''google/ddpm-cifar10-32'''

         __lowerCamelCase		=  UNetaDModel.from_pretrained(a    )
         __lowerCamelCase		=  PNDMScheduler()

         __lowerCamelCase		=  PNDMPipeline(unet=a  ,				scheduler=a    )
         pndm.to(a    )
         pndm.set_progress_bar_config(disable=a    )
         __lowerCamelCase		=  torch.manual_seed(0    )
         __lowerCamelCase		=  pndm(generator=a  ,				output_type='''numpy'''    ).images

         __lowerCamelCase		=  image[0, -3:, -3:, -1]

         assert image.shape == (1, 32, 32, 3)
         __lowerCamelCase		=  np.array([0.15_64, 0.1_46_45, 0.14_06, 0.1_47_15, 0.1_24_25, 0.1_40_45, 0.1_31_15, 0.1_21_75, 0.1_25]    )

         assert np.abs(image_slice.flatten() - expected_slice    ).max() < 1e-2


import math





def 			lowerCamelCase_ (				lowerCamelCase__	, lowerCamelCase__    ):
				if 0 not in (x, y):
								# We use the relation x^y = y*log10(x), where 10 is the base.
								return y * math.logaa(lowerCamelCase__    )
				else:
								if x == 0:  # 0 raised to any number is 0
												return 0
								elif y == 0:
												return 1  # any number raised to 0 is 1
				raise AssertionError("This should never happen"    )


if __name__ == "__main__":  # Main function
			# Read two numbers from input and typecast them to int using map function.
			# Here x is the base and y is the power.
			__A				='''Enter the base and the power separated by a comma: '''
			__A,						__A				=map(int, input(prompt).split(''','''))
			__A,						__A				=map(int, input(prompt).split(''','''))

			# We find the log of each number, using the function res(), which takes two
			# arguments.
			__A				=res(xa, ya)
			__A				=res(xa, ya)

			# We check for the largest number
			if resa > resa:
						print('''Largest number is''', xa, '''^''', ya)
			elif resa > resa:
						print('''Largest number is''', xa, '''^''', ya)
			else:
						print('''Both are equal''')


