


from ...utils import (
    OptionalDependencyNotAvailable,
    is_flax_available,
    is_torch_available,
    is_transformers_available,
)


try:
						if not (is_transformers_available() and is_torch_available()):
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						from ...utils.dummy_torch_and_transformers_objects import *  # noqa F403
else:
						from .multicontrolnet import MultiControlNetModel
						from .pipeline_controlnet import StableDiffusionControlNetPipeline
						from .pipeline_controlnet_imgaimg import StableDiffusionControlNetImgaImgPipeline
						from .pipeline_controlnet_inpaint import StableDiffusionControlNetInpaintPipeline


if is_transformers_available() and is_flax_available():
						from .pipeline_flax_controlnet import FlaxStableDiffusionControlNetPipeline



_UpperCAmelCase			:  Dict     =[
    (1000, """M"""),
    (900, """CM"""),
    (500, """D"""),
    (400, """CD"""),
    (100, """C"""),
    (90, """XC"""),
    (50, """L"""),
    (40, """XL"""),
    (10, """X"""),
    (9, """IX"""),
    (5, """V"""),
    (4, """IV"""),
    (1, """I"""),
]



def 			lowerCAmelCase (		lowerCAmelCase_ )-> int:
				lowerCAmelCase_ :      Any    				=				{'''I''': 1, '''V''': 5, '''X''': 10, '''L''': 50, '''C''': 100, '''D''': 500, '''M''': 1_000}
				lowerCAmelCase_ :      Optional[int]    				=				0
				lowerCAmelCase_ :      List[str]    				=				0
				while place < len(lowerCAmelCase_ ):
								if (place + 1 < len(lowerCAmelCase_ )) and (vals[roman[place]] < vals[roman[place + 1]]):
												total += vals[roman[place + 1]] - vals[roman[place]]
												place += 2
								else:
												total += vals[roman[place]]
												place += 1
				return total



def 			lowerCAmelCase (		lowerCAmelCase_ )-> str:
				lowerCAmelCase_ :      List[Any]    				=				[]
				for arabic, roman in ROMAN:
								((lowerCAmelCase_)				,  (lowerCAmelCase_)) :      Optional[int]    				=				divmod(lowerCAmelCase_ ,   lowerCAmelCase_ )
								result.append(roman * factor )
								if number == 0:
												break
				return "".join(lowerCAmelCase_ )


if __name__ == "__main__":
						import doctest

						doctest.testmod()