






import unittest

import numpy as np
import torch

from diffusers import VersatileDiffusionImageVariationPipeline
from diffusers.utils.testing_utils import load_image, require_torch_gpu, slow, torch_device


lowercase    				=   False




class 					UpperCamelCase_ (     unittest.TestCase							):



	'''simple docstring'''




	pass






@slow
@require_torch_gpu
class 					UpperCamelCase_ (     unittest.TestCase							):



	'''simple docstring'''




	def 				_UpperCamelCase     (			self   )			->       str:
								snake_case_           =				VersatileDiffusionImageVariationPipeline.from_pretrained('shi-labs/versatile-diffusion'   )
								pipe.to(a   )
								pipe.set_progress_bar_config(disable=a   )

								snake_case_           =				load_image(
								    'https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/versatile_diffusion/benz.jpg'   )
								snake_case_           =				torch.manual_seed(0   )
								snake_case_           =				pipe(
								    image=a			,     generator=a			,     guidance_scale=7.5			,     num_inference_steps=50			,     output_type='numpy'			,     ).images

								snake_case_           =				image[0, 2_53:2_56, 2_53:2_56, -1]

								assert image.shape == (1, 5_12, 5_12, 3)
								snake_case_           =				np.array([0.0_441, 0.0_469, 0.0_507, 0.0_575, 0.0_632, 0.0_650, 0.0_865, 0.0_909, 0.0_945]   )

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













lowercase    				=   {
    "A": ".-", "B": "-...", "C": "-.-.", "D": "-..", "E": ".", "F": "..-.", "G": "--.",
    "H": "....", "I": "..", "J": ".---", "K": "-.-", "L": ".-..", "M": "--", "N": "-.",
    "O": "---", "P": ".--.", "Q": "--.-", "R": ".-.", "S": "...", "T": "-", "U": "..-",
    "V": "...-", "W": ".--", "X": "-..-", "Y": "-.--", "Z": "--..", "1": ".----",
    "2": "..---", "3": "...--", "4": "....-", "5": ".....", "6": "-....", "7": "--...",
    "8": "---..", "9": "----.", "0": "-----", "&": ".-...", "@": ".--.-.",
    ":": "---...", ",": "--..--", ".": ".-.-.-", "'": ".----.", "\"": ".-..-.",
    "?": "..--..", "/": "-..-.", "=": "-...-", "+": ".-.-.", "-": "-....-",
    "(": "-.--.", ")": "-.--.-", "!": "-.-.--", " ": "/"
}  # Exclamation mark is not in ITU-R recommendation
# fmt: on
lowercase    				=   {value: key for key, value in MORSE_CODE_DICT.items()}





def 		__UpperCAmelCase     (	a_):
							return " ".join(MORSE_CODE_DICT[char] for char in message.upper())





def 		__UpperCAmelCase     (	a_):
							return "".join(REVERSE_DICT[char] for char in message.split())





def 		__UpperCAmelCase     (	):
							snake_case_           =				'Morse code here!'
							print(a_)
							snake_case_           =				encrypt(a_)
							print(a_)
							snake_case_           =				decrypt(a_)
							print(a_)


if __name__ == "__main__":
	main()





