


'''simple docstring'''






import unittest

import numpy as np
import torch

from diffusers import KarrasVePipeline, KarrasVeScheduler, UNetaDModel
from diffusers.utils.testing_utils import enable_full_determinism, require_torch, slow, torch_device


enable_full_determinism()






class   SCREAMING_SNAKE_CASE_						(			unittest.TestCase		):




			@property
			def       _snake_case (   self							)      ->    int:


								'''simple docstring'''






								torch.manual_seed(0							)
								__SCREAMING_SNAKE_CASE       :				Any       =			UNetaDModel(
								    block_out_channels=(3_2, 6_4)       ,   layers_per_block=2       ,   sample_size=3_2       ,   in_channels=3       ,   out_channels=3       ,   down_block_types=('''DownBlock2D''', '''AttnDownBlock2D''')       ,   up_block_types=('''AttnUpBlock2D''', '''UpBlock2D''')       ,   )
								return model




			def       _snake_case (   self							)      ->    Tuple:


								'''simple docstring'''






								__SCREAMING_SNAKE_CASE       :				Tuple       =			self.dummy_uncond_unet
								__SCREAMING_SNAKE_CASE       :				str       =			KarrasVeScheduler()

								__SCREAMING_SNAKE_CASE       :				Tuple       =			KarrasVePipeline(unet=_UpperCAmelCase       ,   scheduler=_UpperCAmelCase							)
								pipe.to(_UpperCAmelCase							)
								pipe.set_progress_bar_config(disable=_UpperCAmelCase							)

								__SCREAMING_SNAKE_CASE       :				Dict       =			torch.manual_seed(0							)
								__SCREAMING_SNAKE_CASE       :				Union[str, Any]       =			pipe(num_inference_steps=2       ,   generator=_UpperCAmelCase       ,   output_type='''numpy'''							).images

								__SCREAMING_SNAKE_CASE       :				Union[str, Any]       =			torch.manual_seed(0							)
								__SCREAMING_SNAKE_CASE       :				Optional[Any]       =			pipe(num_inference_steps=2       ,   generator=_UpperCAmelCase       ,   output_type='''numpy'''       ,   return_dict=_UpperCAmelCase							)[0]

								__SCREAMING_SNAKE_CASE       :				str       =			image[0, -3:, -3:, -1]
								__SCREAMING_SNAKE_CASE       :				Optional[Any]       =			image_from_tuple[0, -3:, -3:, -1]

								assert image.shape == (1, 3_2, 3_2, 3)
								__SCREAMING_SNAKE_CASE       :				Optional[int]       =			np.array([0.0, 1.0, 0.0, 0.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   SCREAMING_SNAKE_CASE_						(			unittest.TestCase		):




			def       _snake_case (   self							)      ->    Any:


								'''simple docstring'''






								__SCREAMING_SNAKE_CASE       :				Optional[Any]       =			'google/ncsnpp-celebahq-256'
								__SCREAMING_SNAKE_CASE       :				int       =			UNetaDModel.from_pretrained(_UpperCAmelCase							)
								__SCREAMING_SNAKE_CASE       :				Dict       =			KarrasVeScheduler()

								__SCREAMING_SNAKE_CASE       :				str       =			KarrasVePipeline(unet=_UpperCAmelCase       ,   scheduler=_UpperCAmelCase							)
								pipe.to(_UpperCAmelCase							)
								pipe.set_progress_bar_config(disable=_UpperCAmelCase							)

								__SCREAMING_SNAKE_CASE       :				Optional[int]       =			torch.manual_seed(0							)
								__SCREAMING_SNAKE_CASE       :				Tuple       =			pipe(num_inference_steps=2_0       ,   generator=_UpperCAmelCase       ,   output_type='''numpy'''							).images

								__SCREAMING_SNAKE_CASE       :				Optional[Any]       =			image[0, -3:, -3:, -1]
								assert image.shape == (1, 2_5_6, 2_5_6, 3)
								__SCREAMING_SNAKE_CASE       :				Any       =			np.array([0.5_7_8, 0.5_8_1_1, 0.5_9_2_4, 0.5_8_0_9, 0.5_8_7, 0.5_8_8_6, 0.5_8_6_1, 0.5_8_0_2, 0.5_8_6]							)

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







'''simple docstring'''

def 	__lowerCamelCase	( lowerCAmelCase_    )     -> bool:
		if not all(x.isalpha() for x in string    ):
				raise ValueError('String must only contain alphabetic characters.'    )

		_a	: Tuple								=				sorted(string.lower()    )
		return len(lowerCAmelCase_    ) == len(set(lowerCAmelCase_    )    )


if __name__ == "__main__":
							__lowerCAmelCase		     =  input('''Enter a string ''').strip()

							__lowerCAmelCase		     =  is_isogram(input_str)
							print(f"""{input_str} is {'an' if isogram else 'not an'} isogram.""")




