
'''simple docstring'''
class       _lowerCAmelCase   :







							'''simple docstring'''

							def __init__(self  )					->       List[str]:
														_snake_case       =  """"""
														_snake_case       =  """"""
														_snake_case       =  []

							def 	lowercase							(self  ,  UpperCAmelCase  ,  UpperCAmelCase  )					->       int:
														if m == -1:
																					return n + 1
														elif n == -1:
																					return m + 1
														elif self.dp[m][n] > -1:
																					return self.dp[m][n]
														else:
																					if self.worda[m] == self.worda[n]:
																												_snake_case       =  self.__min_dist_top_down_dp(m - 1  ,  n - 1  )
																					else:
																												_snake_case       =  self.__min_dist_top_down_dp(UpperCAmelCase  ,  n - 1  )
																												_snake_case       =  self.__min_dist_top_down_dp(m - 1  ,  UpperCAmelCase  )
																												_snake_case       =  self.__min_dist_top_down_dp(m - 1  ,  n - 1  )
																												_snake_case       =  1 + min(UpperCAmelCase  ,  UpperCAmelCase  ,  UpperCAmelCase  )

																					return self.dp[m][n]

							def 	lowercase							(self  ,  UpperCAmelCase  ,  UpperCAmelCase  )					->       int:
														_snake_case       =  worda
														_snake_case       =  worda
														_snake_case       =  [[-1 for _ in range(len(UpperCAmelCase  )  )] for _ in range(len(UpperCAmelCase  )  )]

														return self.__min_dist_top_down_dp(len(UpperCAmelCase  ) - 1  ,  len(UpperCAmelCase  ) - 1  )





							def 	lowercase							(self  ,  UpperCAmelCase  ,  UpperCAmelCase  )					->       int:
														_snake_case       =  worda
														_snake_case       =  worda
														_snake_case       =  len(UpperCAmelCase  )
														_snake_case       =  len(UpperCAmelCase  )
														_snake_case       =  [[0 for _ in range(n + 1  )] for _ in range(m + 1  )]

														for i in range(m + 1  ):
																					for j in range(n + 1  ):
																												if i == 0:  # first string is empty
																																			_snake_case       =  j
																												elif j == 0:  # second string is empty
																																			_snake_case       =  i
																												elif worda[i - 1] == worda[j - 1]:  # last characters are equal
																																			_snake_case       =  self.dp[i - 1][j - 1]
																												else:
																																			_snake_case       =  self.dp[i][j - 1]
																																			_snake_case       =  self.dp[i - 1][j]
																																			_snake_case       =  self.dp[i - 1][j - 1]
																																			_snake_case       =  1 + min(UpperCAmelCase  ,  UpperCAmelCase  ,  UpperCAmelCase  )
														return self.dp[m][n]


if __name__ == "__main__":
				__lowerCAmelCase												=	EditDistance()

				print('****************** Testing Edit Distance DP Algorithm ******************')
				print()

				__lowerCAmelCase												=	input('Enter the first string: ').strip()
				__lowerCAmelCase												=	input('Enter the second string: ').strip()

				print()
				print(f'''The minimum edit distance is: {solver.min_dist_top_down(Sa, Sa)}''')
				print(f'''The minimum edit distance is: {solver.min_dist_bottom_up(Sa, Sa)}''')
				print()
				print('*************** End of Testing Edit Distance DP Algorithm ***************')

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