




import random
import unittest

import torch

from diffusers import IFInpaintingPipeline
from diffusers.utils import floats_tensor
from diffusers.utils.import_utils import is_xformers_available
from diffusers.utils.testing_utils import skip_mps, torch_device

from ..pipeline_params import (
    TEXT_GUIDED_IMAGE_INPAINTING_BATCH_PARAMS,
    TEXT_GUIDED_IMAGE_INPAINTING_PARAMS,
)
from ..test_pipelines_common import PipelineTesterMixin
from . import IFPipelineTesterMixin


@skip_mps
class        UpperCamelCase_					(				UpperCAmelCase__	,      UpperCAmelCase__	,      unittest.TestCase  ):

    '''simple docstring'''






    UpperCAmelCase__													=   IFInpaintingPipeline
    UpperCAmelCase__													=   TEXT_GUIDED_IMAGE_INPAINTING_PARAMS - {'''width''', '''height'''}
    UpperCAmelCase__													=   TEXT_GUIDED_IMAGE_INPAINTING_BATCH_PARAMS
    UpperCAmelCase__													=   PipelineTesterMixin.required_optional_params - {'''latents'''}


    def  SCREAMING_SNAKE_CASE							(    self   :			Any)		->Dict:





           '''simple docstring'''

           return self._get_dummy_components()


    def  SCREAMING_SNAKE_CASE							(    self   :			int      ,				UpperCAmelCase__   :			Dict      ,				UpperCAmelCase__   :			int=0)		->int:





           '''simple docstring'''

           if str(UpperCAmelCase__).startswith('''mps'''):
                  A__   				=					torch.manual_seed(UpperCAmelCase__)
           else:
                  A__   				=					torch.Generator(device=UpperCAmelCase__).manual_seed(UpperCAmelCase__)

           A__   				=					floats_tensor((1, 3, 32, 32)      ,				rng=random.Random(UpperCAmelCase__)).to(UpperCAmelCase__)
           A__   				=					floats_tensor((1, 3, 32, 32)      ,				rng=random.Random(UpperCAmelCase__)).to(UpperCAmelCase__)

           A__   				=					{
               '''prompt''': '''A painting of a squirrel eating a burger''',
               '''image''': image,
               '''mask_image''': mask_image,
               '''generator''': generator,
               '''num_inference_steps''': 2,
               '''output_type''': '''numpy''',
           }

           return inputs


    @unittest.skipIf(
        torch_device != '''cuda''' or not is_xformers_available()      ,				reason='''XFormers attention is only available with CUDA and `xformers` installed'''      ,				)
    def  SCREAMING_SNAKE_CASE							(    self   :			List[str])		->List[Any]:





           '''simple docstring'''

           self._test_xformers_attention_forwardGenerator_pass(expected_max_diff=1e-3)


    def  SCREAMING_SNAKE_CASE							(    self   :			Dict)		->int:





           '''simple docstring'''

           self._test_save_load_optional_components()


    @unittest.skipIf(torch_device != '''cuda'''      ,				reason='''float16 requires CUDA''')
    def  SCREAMING_SNAKE_CASE							(    self   :			Optional[Any])		->List[str]:





           '''simple docstring'''

           super().test_save_load_floataa(expected_max_diff=1e-1)


    def  SCREAMING_SNAKE_CASE							(    self   :			int)		->List[Any]:





           '''simple docstring'''

           self._test_attention_slicing_forward_pass(expected_max_diff=1e-2)


    def  SCREAMING_SNAKE_CASE							(    self   :			Union[str, Any])		->Any:





           '''simple docstring'''

           self._test_save_load_local()





    def  SCREAMING_SNAKE_CASE							(    self   :			int)		->Union[str, Any]:





           '''simple docstring'''

           self._test_inference_batch_single_identical(
               expected_max_diff=1e-2      ,				)








def SCREAMING_SNAKE_CASE       ( lowercase_		)     -> int:



       """simple docstring"""

       A__   				=					1
       for i in range(1				,       num + 1		):
              fact *= i
       return fact







def SCREAMING_SNAKE_CASE       ( lowercase_		)     -> int:



       """simple docstring"""

       A__   				=					0
       while number > 0:
              A__   				=					number % 10
              sum_of_digits += last_digit
              A__   				=					number // 10  # Removing the last_digit from the given number
       return sum_of_digits







def SCREAMING_SNAKE_CASE       ( lowercase_ = 100		)     -> int:



       """simple docstring"""

       A__   				=					factorial(lowercase_		)
       A__   				=					split_and_add(lowercase_		)
       return result


if __name__ == "__main__":
  print(solution(int(input("""Enter the Number: """).strip())))


