
'''simple docstring'''
def  __SCREAMING_SNAKE_CASE				(  _SCREAMING_SNAKE_CASE							, _SCREAMING_SNAKE_CASE				):
							_snake_case       =  [[] for _ in range(_SCREAMING_SNAKE_CASE				)]
							_snake_case       =  key - 1

							if key <= 0:
														raise ValueError("""Height of grid can't be 0 or negative"""				)
							if key == 1 or len(_SCREAMING_SNAKE_CASE				) <= key:
														return input_string

							for position, character in enumerate(_SCREAMING_SNAKE_CASE				):
														_snake_case       =  position % (lowest * 2)  # puts it in bounds
														_snake_case       =  min(_SCREAMING_SNAKE_CASE							, lowest * 2 - num				)  # creates zigzag pattern
														temp_grid[num].append(_SCREAMING_SNAKE_CASE				)
							_snake_case       =  ["""""".join(_SCREAMING_SNAKE_CASE				) for row in temp_grid]
							_snake_case       =  """""".join(_SCREAMING_SNAKE_CASE				)

							return output_string






def  __SCREAMING_SNAKE_CASE				(  _SCREAMING_SNAKE_CASE							, _SCREAMING_SNAKE_CASE				):
							_snake_case       =  []
							_snake_case       =  key - 1

							if key <= 0:
														raise ValueError("""Height of grid can't be 0 or negative"""				)
							if key == 1:
														return input_string

							_snake_case       =  [[] for _ in range(_SCREAMING_SNAKE_CASE				)]  # generates template
							for position in range(len(_SCREAMING_SNAKE_CASE				)				):
														_snake_case       =  position % (lowest * 2)  # puts it in bounds
														_snake_case       =  min(_SCREAMING_SNAKE_CASE							, lowest * 2 - num				)  # creates zigzag pattern
														temp_grid[num].append("""*"""				)

							_snake_case       =  0
							for row in temp_grid:  # fills in the characters
														_snake_case       =  input_string[counter : counter + len(_SCREAMING_SNAKE_CASE				)]
														grid.append(list(_SCREAMING_SNAKE_CASE				)				)
														counter += len(_SCREAMING_SNAKE_CASE				)

							_snake_case       =  """"""  # reads as zigzag
							for position in range(len(_SCREAMING_SNAKE_CASE				)				):
														_snake_case       =  position % (lowest * 2)  # puts it in bounds
														_snake_case       =  min(_SCREAMING_SNAKE_CASE							, lowest * 2 - num				)  # creates zigzag pattern
														output_string += grid[num][0]
														grid[num].pop(0				)
							return output_string






def  __SCREAMING_SNAKE_CASE				(  _SCREAMING_SNAKE_CASE				):
							_snake_case       =  {}
							for key_guess in range(1							, len(_SCREAMING_SNAKE_CASE				)				):  # tries every key
														_snake_case       =  decrypt(_SCREAMING_SNAKE_CASE							, _SCREAMING_SNAKE_CASE				)
							return results


if __name__ == "__main__":
				import doctest

				doctest.testmod()

'''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