

from string import ascii_uppercase

_UpperCAmelCase		:   List[Any]										=       {str(ord(c) - 55): c for c in ascii_uppercase}





def 					__lowerCamelCase	( UpperCamelCase__   ,							UpperCamelCase__      ):







							'''simple docstring'''






							if isinstance(_SCREAMING_SNAKE_CASE   ,							_SCREAMING_SNAKE_CASE      ):
														raise TypeError('int() can\'t convert non-string with explicit base'      )
							if num < 0:
														raise ValueError('parameter must be positive int'      )
							if isinstance(_SCREAMING_SNAKE_CASE   ,							_SCREAMING_SNAKE_CASE      ):
														raise TypeError('\'str\' object cannot be interpreted as an integer'      )
							if isinstance(_SCREAMING_SNAKE_CASE   ,							_SCREAMING_SNAKE_CASE      ):
														raise TypeError('\'float\' object cannot be interpreted as an integer'      )
							if base in (0, 1):
														raise ValueError('base must be >= 2'      )
							if base > 36:
														raise ValueError('base must be <= 36'      )
							snake_case_							=    ''
							snake_case_							=    0
							snake_case_							=    0
							while div != 1:
														snake_case_							=    divmod(_SCREAMING_SNAKE_CASE   ,							_SCREAMING_SNAKE_CASE      )
														if base >= 11 and 9 < mod < 36:
																					snake_case_							=    ALPHABET_VALUES[str(_SCREAMING_SNAKE_CASE      )]
														else:
																					snake_case_							=    str(_SCREAMING_SNAKE_CASE      )
														new_value += actual_value
														snake_case_							=    num // base
														snake_case_							=    div
														if div == 0:
																					return str(new_value[::-1]      )
														elif div == 1:
																					new_value += str(_SCREAMING_SNAKE_CASE      )
																					return str(new_value[::-1]      )

							return new_value[::-1]


if __name__ == "__main__":
					import doctest

					doctest.testmod()

					for base in range(2, 37):
										for num in range(1000):
															assert int(decimal_to_any(num, base), base) == num, (
															    num,
															    base,
															    decimal_to_any(num, base),
															    int(decimal_to_any(num, base), base),
															)








'''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 							__UpperCamelCase				(		unittest.TestCase					):




	@property
	def       __UpperCAmelCase							(   self							):

						'''simple docstring'''





						return (
						    "CUDAExecutionProvider",
						    {
						        "gpu_mem_limit": "15000000000",  # 15GB
						        "arena_extend_strategy": "kSameAsRequested",
						    },
						)




	@property
	def       __UpperCAmelCase							(   self							):

						'''simple docstring'''





						__a			:       Dict					    =  ort.SessionOptions()
						__a			:       Dict					    =  False
						return options





	def       __UpperCAmelCase							(   self							):

						'''simple docstring'''





						__a			:       Tuple					    =  load_image(
						    'https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main'
						    '/in_paint/overture-creations-5sI6fQgYIuo.png'							)
						__a			:       int					    =  load_image(
						    'https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main'
						    '/in_paint/overture-creations-5sI6fQgYIuo_mask.png'							)
						__a			:       Dict					    =  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
						__a			:       str					    =  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							)

						__a			:       Tuple					    =  'A red cat sitting on a park bench'

						__a			:       int					    =  np.random.RandomState(0							)
						__a			:       Tuple					    =  pipe(
						    prompt=__a						,				image=__a						,				mask_image=__a						,				strength=0.75						,				guidance_scale=7.5						,				num_inference_steps=15						,				generator=__a						,				output_type='np'						,				)

						__a			:       Tuple					    =  output.images[0]

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



