



"""simple docstring"""
def        lowerCAmelCase_(   lowercase_     :							str							)	->       list[list[int]]:
				_lowerCamelCase        =				[]
				if len(lowercase_							) == 1:
								return [nums.copy()]
				for _ in range(len(lowercase_							)							):
								_lowerCamelCase        =				nums.pop(0							)
								_lowerCamelCase        =				permute(lowercase_							)
								for perm in permutations:
												perm.append(lowercase_							)
								result.extend(lowercase_							)
								nums.append(lowercase_							)
				return result



def        lowerCAmelCase_(   lowercase_     :							Optional[Any]							)	->       Optional[Any]:

				def backtrack(lowercase_     :							Dict							):
								if start == len(lowercase_							) - 1:
												output.append(nums[:]							)
								else:
												for i in range(lowercase_						,   len(lowercase_							)							):
																_lowerCamelCase  ,     _lowerCamelCase        =				nums[i], nums[start]
																backtrack(start + 1							)
																_lowerCamelCase  ,     _lowerCamelCase        =				nums[i], nums[start]  # backtrack

				_lowerCamelCase        =				[]
				backtrack(0							)
				return output


if __name__ == "__main__":
			import doctest

			# use res to print the data in permute2 function
			__SCREAMING_SNAKE_CASE  :						List[str]    							=      permutea([1, 2, 3])
			print(res)
			doctest.testmod()





"""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()):
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			from ...utils.dummy_torch_and_transformers_objects import KandinskyPipeline, KandinskyPriorPipeline
else:
			from .pipeline_kandinsky import KandinskyPipeline
			from .pipeline_kandinsky_imgaimg import KandinskyImgaImgPipeline
			from .pipeline_kandinsky_inpaint import KandinskyInpaintPipeline
			from .pipeline_kandinsky_prior import KandinskyPriorPipeline, KandinskyPriorPipelineOutput
			from .text_encoder import MultilingualCLIP
