


lowerCAmelCase__      		= '0.18.2'

from .configuration_utils import ConfigMixin
from .utils import (
    OptionalDependencyNotAvailable,
    is_flax_available,
    is_inflect_available,
    is_invisible_watermark_available,
    is_k_diffusion_available,
    is_k_diffusion_version,
    is_librosa_available,
    is_note_seq_available,
    is_onnx_available,
    is_scipy_available,
    is_torch_available,
    is_torchsde_available,
    is_transformers_available,
    is_transformers_version,
    is_unidecode_available,
    logging,
)


try:
    if not is_onnx_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    from .utils.dummy_onnx_objects import *  # noqa F403
else:
    from .pipelines import OnnxRuntimeModel

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    from .utils.dummy_pt_objects import *  # noqa F403
else:
    from .models import (
        AutoencoderKL,
        ControlNetModel,
        ModelMixin,
        PriorTransformer,
        TaFilmDecoder,
        TransformeraDModel,
        UNetaDModel,
        UNetaDConditionModel,
        UNetaDModel,
        UNetaDConditionModel,
        VQModel,
    )
    from .optimization import (
        get_constant_schedule,
        get_constant_schedule_with_warmup,
        get_cosine_schedule_with_warmup,
        get_cosine_with_hard_restarts_schedule_with_warmup,
        get_linear_schedule_with_warmup,
        get_polynomial_decay_schedule_with_warmup,
        get_scheduler,
    )
    from .pipelines import (
        AudioPipelineOutput,
        ConsistencyModelPipeline,
        DanceDiffusionPipeline,
        DDIMPipeline,
        DDPMPipeline,
        DiffusionPipeline,
        DiTPipeline,
        ImagePipelineOutput,
        KarrasVePipeline,
        LDMPipeline,
        LDMSuperResolutionPipeline,
        PNDMPipeline,
        RePaintPipeline,
        ScoreSdeVePipeline,
    )
    from .schedulers import (
        CMStochasticIterativeScheduler,
        DDIMInverseScheduler,
        DDIMParallelScheduler,
        DDIMScheduler,
        DDPMParallelScheduler,
        DDPMScheduler,
        DEISMultistepScheduler,
        DPMSolverMultistepInverseScheduler,
        DPMSolverMultistepScheduler,
        DPMSolverSinglestepScheduler,
        EulerAncestralDiscreteScheduler,
        EulerDiscreteScheduler,
        HeunDiscreteScheduler,
        IPNDMScheduler,
        KarrasVeScheduler,
        KDPMaAncestralDiscreteScheduler,
        KDPMaDiscreteScheduler,
        PNDMScheduler,
        RePaintScheduler,
        SchedulerMixin,
        ScoreSdeVeScheduler,
        UnCLIPScheduler,
        UniPCMultistepScheduler,
        VQDiffusionScheduler,
    )
    from .training_utils import EMAModel

try:
    if not (is_torch_available() and is_scipy_available()):
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    from .utils.dummy_torch_and_scipy_objects import *  # noqa F403
else:
    from .schedulers import LMSDiscreteScheduler

try:
    if not (is_torch_available() and is_torchsde_available()):
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    from .utils.dummy_torch_and_torchsde_objects import *  # noqa F403
else:
    from .schedulers import DPMSolverSDEScheduler

try:
    if not (is_torch_available() and is_transformers_available()):
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    from .utils.dummy_torch_and_transformers_objects import *  # noqa F403
else:
    from .pipelines import (
        AltDiffusionImgaImgPipeline,
        AltDiffusionPipeline,
        AudioLDMPipeline,
        CycleDiffusionPipeline,
        IFImgaImgPipeline,
        IFImgaImgSuperResolutionPipeline,
        IFInpaintingPipeline,
        IFInpaintingSuperResolutionPipeline,
        IFPipeline,
        IFSuperResolutionPipeline,
        ImageTextPipelineOutput,
        KandinskyImgaImgPipeline,
        KandinskyInpaintPipeline,
        KandinskyPipeline,
        KandinskyPriorPipeline,
        KandinskyVaaControlnetImgaImgPipeline,
        KandinskyVaaControlnetPipeline,
        KandinskyVaaImgaImgPipeline,
        KandinskyVaaInpaintPipeline,
        KandinskyVaaPipeline,
        KandinskyVaaPriorEmbaEmbPipeline,
        KandinskyVaaPriorPipeline,
        LDMTextToImagePipeline,
        PaintByExamplePipeline,
        SemanticStableDiffusionPipeline,
        ShapEImgaImgPipeline,
        ShapEPipeline,
        StableDiffusionAttendAndExcitePipeline,
        StableDiffusionControlNetImgaImgPipeline,
        StableDiffusionControlNetInpaintPipeline,
        StableDiffusionControlNetPipeline,
        StableDiffusionDepthaImgPipeline,
        StableDiffusionDiffEditPipeline,
        StableDiffusionImageVariationPipeline,
        StableDiffusionImgaImgPipeline,
        StableDiffusionInpaintPipeline,
        StableDiffusionInpaintPipelineLegacy,
        StableDiffusionInstructPixaPixPipeline,
        StableDiffusionLatentUpscalePipeline,
        StableDiffusionLDMaDPipeline,
        StableDiffusionModelEditingPipeline,
        StableDiffusionPanoramaPipeline,
        StableDiffusionParadigmsPipeline,
        StableDiffusionPipeline,
        StableDiffusionPipelineSafe,
        StableDiffusionPixaPixZeroPipeline,
        StableDiffusionSAGPipeline,
        StableDiffusionUpscalePipeline,
        StableUnCLIPImgaImgPipeline,
        StableUnCLIPPipeline,
        TextToVideoSDPipeline,
        TextToVideoZeroPipeline,
        UnCLIPImageVariationPipeline,
        UnCLIPPipeline,
        UniDiffuserModel,
        UniDiffuserPipeline,
        UniDiffuserTextDecoder,
        VersatileDiffusionDualGuidedPipeline,
        VersatileDiffusionImageVariationPipeline,
        VersatileDiffusionPipeline,
        VersatileDiffusionTextToImagePipeline,
        VideoToVideoSDPipeline,
        VQDiffusionPipeline,
    )

try:
    if not (is_torch_available() and is_transformers_available() and is_invisible_watermark_available()):
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    from .utils.dummy_torch_and_transformers_and_invisible_watermark_objects import *  # noqa F403
else:
    from .pipelines import StableDiffusionXLImgaImgPipeline, StableDiffusionXLPipeline

try:
    if not (is_torch_available() and is_transformers_available() and is_k_diffusion_available()):
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    from .utils.dummy_torch_and_transformers_and_k_diffusion_objects import *  # noqa F403
else:
    from .pipelines import StableDiffusionKDiffusionPipeline

try:
    if not (is_torch_available() and is_transformers_available() and is_onnx_available()):
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    from .utils.dummy_torch_and_transformers_and_onnx_objects import *  # noqa F403
else:
    from .pipelines import (
        OnnxStableDiffusionImgaImgPipeline,
        OnnxStableDiffusionInpaintPipeline,
        OnnxStableDiffusionInpaintPipelineLegacy,
        OnnxStableDiffusionPipeline,
        OnnxStableDiffusionUpscalePipeline,
        StableDiffusionOnnxPipeline,
    )

try:
    if not (is_torch_available() and is_librosa_available()):
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    from .utils.dummy_torch_and_librosa_objects import *  # noqa F403
else:
    from .pipelines import AudioDiffusionPipeline, Mel

try:
    if not (is_transformers_available() and is_torch_available() and is_note_seq_available()):
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    from .utils.dummy_transformers_and_torch_and_note_seq_objects import *  # noqa F403
else:
    from .pipelines import SpectrogramDiffusionPipeline

try:
    if not is_flax_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    from .utils.dummy_flax_objects import *  # noqa F403
else:
    from .models.controlnet_flax import FlaxControlNetModel
    from .models.modeling_flax_utils import FlaxModelMixin
    from .models.unet_ad_condition_flax import FlaxUNetaDConditionModel
    from .models.vae_flax import FlaxAutoencoderKL
    from .pipelines import FlaxDiffusionPipeline
    from .schedulers import (
        FlaxDDIMScheduler,
        FlaxDDPMScheduler,
        FlaxDPMSolverMultistepScheduler,
        FlaxKarrasVeScheduler,
        FlaxLMSDiscreteScheduler,
        FlaxPNDMScheduler,
        FlaxSchedulerMixin,
        FlaxScoreSdeVeScheduler,
    )


try:
    if not (is_flax_available() and is_transformers_available()):
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    from .utils.dummy_flax_and_transformers_objects import *  # noqa F403
else:
    from .pipelines import (
        FlaxStableDiffusionControlNetPipeline,
        FlaxStableDiffusionImgaImgPipeline,
        FlaxStableDiffusionInpaintPipeline,
        FlaxStableDiffusionPipeline,
    )

try:
    if not (is_note_seq_available()):
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    from .utils.dummy_note_seq_objects import *  # noqa F403
else:
    from .pipelines import MidiProcessor





'''simple docstring'''




from operator import delitem, getitem, setitem

import pytest

from data_structures.hashing.hash_map import HashMap



def       __lowerCamelCase  (					_lowercase		)      ->			Optional[Any]:
							return getitem, k



def       __lowerCamelCase  (					_lowercase	,				_lowercase		)      ->			List[str]:
							return setitem, k, v



def       __lowerCamelCase  (					_lowercase		)      ->			int:
							return delitem, k



def       __lowerCamelCase  (					_lowercase	,				_lowercase	,				*_lowercase		)      ->			Optional[Any]:
							try:
														return fun(_lowercase	,				*_lowercase		), None
							except Exception as e:
														return None, e


a   :			List[str]					  =    (
    _set("""key_a""", """val_a"""),
    _set("""key_b""", """val_b"""),
)

a   :			List[Any]					  =    [
    _set("""key_a""", """val_a"""),
    _set("""key_a""", """val_b"""),
]

a   :			int					  =    [
    _set("""key_a""", """val_a"""),
    _set("""key_b""", """val_b"""),
    _del("""key_a"""),
    _del("""key_b"""),
    _set("""key_a""", """val_a"""),
    _del("""key_a"""),
]

a   :			List[Any]					  =    [
    _get("""key_a"""),
    _del("""key_a"""),
    _set("""key_a""", """val_a"""),
    _del("""key_a"""),
    _del("""key_a"""),
    _get("""key_a"""),
]

a   :			Tuple					  =    [
    *[_set(x, x) for x in range(5)],  # guaranteed upsize
]

a   :			Optional[Any]					  =    [
    *[_set(x, x) for x in range(5)],  # guaranteed upsize
    *[_del(x) for x in range(5)],
    _set("""key_a""", """val_b"""),
]



@pytest.mark.parametrize(
    """operations"""	,				(
        pytest.param(_add_items	,				id="""add items"""		),
        pytest.param(_overwrite_items	,				id="""overwrite items"""		),
        pytest.param(_delete_items	,				id="""delete items"""		),
        pytest.param(_access_absent_items	,				id="""access absent items"""		),
        pytest.param(_add_with_resize_up	,				id="""add with resize up"""		),
        pytest.param(_add_with_resize_down	,				id="""add with resize down"""		),
    )	,				)
def       __lowerCamelCase  (					_lowercase		)      ->			Optional[int]:
							UpperCAmelCase     :		List[str]							     =		HashMap(initial_block_size=4		)
							UpperCAmelCase     :		Dict							     =		{}
							for _, (fun, *args) in enumerate(_lowercase		):
														UpperCAmelCase     ,     UpperCAmelCase     :		Union[str, Any]							     =		_run_operation(_lowercase	,				_lowercase	,				*_lowercase		)
														UpperCAmelCase     ,     UpperCAmelCase     :		Any							     =		_run_operation(_lowercase	,				_lowercase	,				*_lowercase		)
														assert my_res == py_res
														assert str(_lowercase		) == str(_lowercase		)
														assert set(_lowercase		) == set(_lowercase		)
														assert len(_lowercase		) == len(_lowercase		)
														assert set(my.items()		) == set(py.items()		)



def       __lowerCamelCase  (					)      ->			List[Any]:
							def is_public(_lowercase		) -> bool:
														return not name.startswith("""_"""		)

							UpperCAmelCase     :		int							     =		{name for name in dir({}		) if is_public(_lowercase		)}
							UpperCAmelCase     :		Any							     =		{name for name in dir(HashMap()		) if is_public(_lowercase		)}

							assert dict_public_names > hash_public_names

