"""simple docstring"""







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


try:
						if not (is_transformers_available() and is_torch_available() and is_transformers_version('>=', '4.25.0')):
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						from ...utils.dummy_torch_and_transformers_objects import (
						    VersatileDiffusionDualGuidedPipeline,
						    VersatileDiffusionImageVariationPipeline,
						    VersatileDiffusionPipeline,
						    VersatileDiffusionTextToImagePipeline,
						)
else:
						from .modeling_text_unet import UNetFlatConditionModel
						from .pipeline_versatile_diffusion import VersatileDiffusionPipeline
						from .pipeline_versatile_diffusion_dual_guided import VersatileDiffusionDualGuidedPipeline
						from .pipeline_versatile_diffusion_image_variation import VersatileDiffusionImageVariationPipeline
						from .pipeline_versatile_diffusion_text_to_image import VersatileDiffusionTextToImagePipeline




"""simple docstring"""







def      __lowerCAmelCase(		__UpperCAmelCase     ,__UpperCAmelCase     ,__UpperCAmelCase			):






	"""simple docstring"""





	return not any(
	    neighbour == 1 and colored_vertices[i] == color
	    for i, neighbour in enumerate(__UpperCAmelCase			)			)


def      __lowerCAmelCase(		__UpperCAmelCase     ,__UpperCAmelCase     ,__UpperCAmelCase     ,__UpperCAmelCase			):






	"""simple docstring"""





	if index == len(__UpperCAmelCase			):
		return True

	# Recursive Step
	for i in range(__UpperCAmelCase			):
		if valid_coloring(graph[index]     ,__UpperCAmelCase     ,__UpperCAmelCase			):
			# Color current vertex
			_lowercase :    str							=							i
			# Validate coloring
			if util_color(__UpperCAmelCase     ,__UpperCAmelCase     ,__UpperCAmelCase     ,index + 1			):
				return True
			# Backtrack
			_lowercase :    List[str]							=							-1
	return False







def      __lowerCAmelCase(		__UpperCAmelCase     ,__UpperCAmelCase			):






	"""simple docstring"""





	_lowercase :    Any							=							[-1] * len(__UpperCAmelCase			)

	if util_color(__UpperCAmelCase     ,__UpperCAmelCase     ,__UpperCAmelCase     ,0			):
		return colored_vertices

	return []



