"""simple docstring"""




import unittest

import numpy as np

from diffusers import OnnxStableDiffusionInpaintPipelineLegacy
from diffusers.utils.testing_utils import (
    is_onnx_available,
    load_image,
    load_numpy,
    nightly,
    require_onnxruntime,
    require_torch_gpu,
)


if is_onnx_available():
     import onnxruntime as ort
@nightly
@require_onnxruntime
@require_torch_gpu
class 		__A							(				unittest.TestCase	):






     @property
     def 					__A						(	self						):
       return (
           "CUDAExecutionProvider",
           {
               "gpu_mem_limit": "15000000000",  # 15GB
               "arena_extend_strategy": "kSameAsRequested",
           },
       )






     @property
     def 					__A						(	self						):
       _lowerCAmelCase		: List[Any]						    =  ort.SessionOptions()
       _lowerCAmelCase		: Union[str, Any]						    =  False
       return options






     def 					__A						(	self						):
       _lowerCAmelCase		: Optional[int]						    =  load_image(
           """https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main"""
           """/in_paint/overture-creations-5sI6fQgYIuo.png"""						)
       _lowerCAmelCase		: Optional[int]						    =  load_image(
           """https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main"""
           """/in_paint/overture-creations-5sI6fQgYIuo_mask.png"""						)
       _lowerCAmelCase		: List[str]						    =  load_numpy(
           """https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main"""
           """/in_paint/red_cat_sitting_on_a_park_bench_onnx.npy"""						)

       # using the PNDM scheduler by default
       _lowerCAmelCase		: Optional[Any]						    =  OnnxStableDiffusionInpaintPipelineLegacy.from_pretrained(
           """CompVis/stable-diffusion-v1-4"""       ,  revision="""onnx"""       ,  safety_checker=a__       ,  feature_extractor=a__       ,  provider=self.gpu_provider       ,  sess_options=self.gpu_options       ,  )
       pipe.set_progress_bar_config(disable=a__						)

       _lowerCAmelCase		: List[str]						    =  """A red cat sitting on a park bench"""

       _lowerCAmelCase		: str						    =  np.random.RandomState(0						)
       _lowerCAmelCase		: List[Any]						    =  pipe(
           prompt=a__       ,  image=a__       ,  mask_image=a__       ,  strength=0.7_5       ,  guidance_scale=7.5       ,  num_inference_steps=15       ,  generator=a__       ,  output_type="""np"""       ,  )

       _lowerCAmelCase		: str						    =  output.images[0]

       assert image.shape == (512, 512, 3)
       assert np.abs(expected_image - image						).max() < 1e-2





"""simple docstring"""




def 							SCREAMING_SNAKE_CASE  (    _lowerCamelCase		: int			) ->   bool:
  return sum(i for i in range(1    ,number // 2 + 1			) if number % i == 0			) == number


if __name__ == "__main__":
     print('Program to check whether a number is a Perfect number or not...')
     _a   :	int 					=     int(input('Enter number: ').strip())
     print(F"""{number} is {"" if perfect(number) else "not "}a Perfect Number.""")




