
"""simple docstring"""




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




"""simple docstring"""




def     __magic_name__		(					UpperCamelCase     :		float							,		UpperCamelCase     :		float							,		UpperCamelCase     :		float							,		UpperCamelCase     :		float							,		UpperCamelCase     :		float							,		)     ->						float:
    a__		=			[redshift, radiation_density, matter_density, dark_energy]
    if any(p < 0 for p in parameters     ):
        raise ValueError('All input parameters must be positive'     )

    if any(p > 1 for p in parameters[1:4]     ):
        raise ValueError('Relative densities cannot be greater than one'     )
    else:
        a__		=			1 - (matter_density + radiation_density + dark_energy)

        a__		=			(
            radiation_density * (redshift + 1) ** 4
            + matter_density * (redshift + 1) ** 3
            + curvature * (redshift + 1) ** 2
            + dark_energy
        )

        a__		=			hubble_constant * e_a ** (1 / 2)
        return hubble


if __name__ == "__main__":
    import doctest

    # run doctest
    doctest.testmod()

    # demo LCDM approximation
    a		:       Any     						=       0.3

    print(
        hubble_parameter(
            hubble_constant=68.3,
            radiation_density=1e-4,
            matter_density=matter_density,
            dark_energy=1 - matter_density,
            redshift=0,
        )
    )


