





'''simple docstring'''

class     __lowerCAmelCase					:






							"""simple docstring"""





							def __init__(							self       :		int					)   ->					Tuple:

												'''simple docstring'''




												_UpperCamelCase       =	''''''
												_UpperCamelCase       =	''''''
												_UpperCamelCase       =	[]





							def snake_case__						(							self       :		Dict	,			lowerCAmelCase__       :		int	,			lowerCAmelCase__       :		int					)   ->					int:

												'''simple docstring'''




												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]:
																						_UpperCamelCase       =	self.__min_dist_top_down_dp(m - 1	,			n - 1					)
																	else:
																						_UpperCamelCase       =	self.__min_dist_top_down_dp(lowerCAmelCase__	,			n - 1					)
																						_UpperCamelCase       =	self.__min_dist_top_down_dp(m - 1	,			lowerCAmelCase__					)
																						_UpperCamelCase       =	self.__min_dist_top_down_dp(m - 1	,			n - 1					)
																						_UpperCamelCase       =	1 + min(lowerCAmelCase__	,			lowerCAmelCase__	,			lowerCAmelCase__					)

																	return self.dp[m][n]





							def snake_case__						(							self       :		List[str]	,			lowerCAmelCase__       :		str	,			lowerCAmelCase__       :		str					)   ->					int:

												'''simple docstring'''




												_UpperCamelCase       =	worda
												_UpperCamelCase       =	worda
												_UpperCamelCase       =	[[-1 for _ in range(len(lowerCAmelCase__					)					)] for _ in range(len(lowerCAmelCase__					)					)]

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







							def snake_case__						(							self       :		List[Any]	,			lowerCAmelCase__       :		str	,			lowerCAmelCase__       :		str					)   ->					int:

												'''simple docstring'''




												_UpperCamelCase       =	worda
												_UpperCamelCase       =	worda
												_UpperCamelCase       =	len(lowerCAmelCase__					)
												_UpperCamelCase       =	len(lowerCAmelCase__					)
												_UpperCamelCase       =	[[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
																											_UpperCamelCase       =	j
																						elif j == 0:  # second string is empty
																											_UpperCamelCase       =	i
																						elif worda[i - 1] == worda[j - 1]:  # last characters are equal
																											_UpperCamelCase       =	self.dp[i - 1][j - 1]
																						else:
																											_UpperCamelCase       =	self.dp[i][j - 1]
																											_UpperCamelCase       =	self.dp[i - 1][j]
																											_UpperCamelCase       =	self.dp[i - 1][j - 1]
																											_UpperCamelCase       =	1 + min(lowerCAmelCase__	,			lowerCAmelCase__	,			lowerCAmelCase__					)
												return self.dp[m][n]


if __name__ == "__main__":
			lowercase__						:      int	=    EditDistance()

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

			lowercase__						:      Optional[int]	=    input('Enter the first string: ').strip()
			lowercase__						:      Optional[Any]	=    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'''

import unittest

from diffusers.pipelines.pipeline_utils import is_safetensors_compatible
class     __lowerCAmelCase					(   unittest.TestCase			):






       """simple docstring"""





       def snake_case__						(							self       :		Tuple					)   ->					int:

            '''simple docstring'''




            _UpperCamelCase       =	[
                '''safety_checker/pytorch_model.bin''',
                '''safety_checker/model.safetensors''',
                '''vae/diffusion_pytorch_model.bin''',
                '''vae/diffusion_pytorch_model.safetensors''',
                '''text_encoder/pytorch_model.bin''',
                '''text_encoder/model.safetensors''',
                '''unet/diffusion_pytorch_model.bin''',
                '''unet/diffusion_pytorch_model.safetensors''',
            ]
            self.assertTrue(is_safetensors_compatible(lowerCAmelCase__					)					)





       def snake_case__						(							self       :		int					)   ->					Tuple:

            '''simple docstring'''




            _UpperCamelCase       =	[
                '''unet/diffusion_pytorch_model.bin''',
                '''unet/diffusion_pytorch_model.safetensors''',
            ]
            self.assertTrue(is_safetensors_compatible(lowerCAmelCase__					)					)





       def snake_case__						(							self       :		Optional[Any]					)   ->					List[str]:

            '''simple docstring'''




            _UpperCamelCase       =	[
                '''safety_checker/pytorch_model.bin''',
                '''safety_checker/model.safetensors''',
                '''vae/diffusion_pytorch_model.bin''',
                '''vae/diffusion_pytorch_model.safetensors''',
                '''text_encoder/pytorch_model.bin''',
                '''text_encoder/model.safetensors''',
                '''unet/diffusion_pytorch_model.bin''',
                # Removed: 'unet/diffusion_pytorch_model.safetensors',
            ]
            self.assertFalse(is_safetensors_compatible(lowerCAmelCase__					)					)





       def snake_case__						(							self       :		List[Any]					)   ->					List[Any]:

            '''simple docstring'''




            _UpperCamelCase       =	[
                '''text_encoder/pytorch_model.bin''',
                '''text_encoder/model.safetensors''',
            ]
            self.assertTrue(is_safetensors_compatible(lowerCAmelCase__					)					)





       def snake_case__						(							self       :		Dict					)   ->					Dict:

            '''simple docstring'''




            _UpperCamelCase       =	[
                '''safety_checker/pytorch_model.bin''',
                '''safety_checker/model.safetensors''',
                '''vae/diffusion_pytorch_model.bin''',
                '''vae/diffusion_pytorch_model.safetensors''',
                '''text_encoder/pytorch_model.bin''',
                # Removed: 'text_encoder/model.safetensors',
                '''unet/diffusion_pytorch_model.bin''',
                '''unet/diffusion_pytorch_model.safetensors''',
            ]
            self.assertFalse(is_safetensors_compatible(lowerCAmelCase__					)					)





       def snake_case__						(							self       :		Any					)   ->					Optional[int]:

            '''simple docstring'''




            _UpperCamelCase       =	[
                '''safety_checker/pytorch_model.fp16.bin''',
                '''safety_checker/model.fp16.safetensors''',
                '''vae/diffusion_pytorch_model.fp16.bin''',
                '''vae/diffusion_pytorch_model.fp16.safetensors''',
                '''text_encoder/pytorch_model.fp16.bin''',
                '''text_encoder/model.fp16.safetensors''',
                '''unet/diffusion_pytorch_model.fp16.bin''',
                '''unet/diffusion_pytorch_model.fp16.safetensors''',
            ]
            _UpperCamelCase       =	'''fp16'''
            self.assertTrue(is_safetensors_compatible(lowerCAmelCase__	,			variant=lowerCAmelCase__					)					)





       def snake_case__						(							self       :		Optional[Any]					)   ->					Dict:

            '''simple docstring'''




            _UpperCamelCase       =	[
                '''unet/diffusion_pytorch_model.fp16.bin''',
                '''unet/diffusion_pytorch_model.fp16.safetensors''',
            ]
            _UpperCamelCase       =	'''fp16'''
            self.assertTrue(is_safetensors_compatible(lowerCAmelCase__	,			variant=lowerCAmelCase__					)					)





       def snake_case__						(							self       :		Tuple					)   ->					Optional[Any]:

            '''simple docstring'''




            _UpperCamelCase       =	[
                '''unet/diffusion_pytorch_model.bin''',
                '''unet/diffusion_pytorch_model.safetensors''',
            ]
            _UpperCamelCase       =	'''fp16'''
            self.assertTrue(is_safetensors_compatible(lowerCAmelCase__	,			variant=lowerCAmelCase__					)					)





       def snake_case__						(							self       :		Tuple					)   ->					Union[str, Any]:

            '''simple docstring'''




            _UpperCamelCase       =	[
                '''safety_checker/pytorch_model.fp16.bin''',
                '''safety_checker/model.fp16.safetensors''',
                '''vae/diffusion_pytorch_model.fp16.bin''',
                '''vae/diffusion_pytorch_model.fp16.safetensors''',
                '''text_encoder/pytorch_model.fp16.bin''',
                '''text_encoder/model.fp16.safetensors''',
                '''unet/diffusion_pytorch_model.fp16.bin''',
                # Removed: 'unet/diffusion_pytorch_model.fp16.safetensors',
            ]
            _UpperCamelCase       =	'''fp16'''
            self.assertFalse(is_safetensors_compatible(lowerCAmelCase__	,			variant=lowerCAmelCase__					)					)





       def snake_case__						(							self       :		Optional[int]					)   ->					Dict:

            '''simple docstring'''




            _UpperCamelCase       =	[
                '''text_encoder/pytorch_model.fp16.bin''',
                '''text_encoder/model.fp16.safetensors''',
            ]
            _UpperCamelCase       =	'''fp16'''
            self.assertTrue(is_safetensors_compatible(lowerCAmelCase__	,			variant=lowerCAmelCase__					)					)





       def snake_case__						(							self       :		Optional[Any]					)   ->					str:

            '''simple docstring'''




            _UpperCamelCase       =	[
                '''text_encoder/pytorch_model.bin''',
                '''text_encoder/model.safetensors''',
            ]
            _UpperCamelCase       =	'''fp16'''
            self.assertTrue(is_safetensors_compatible(lowerCAmelCase__	,			variant=lowerCAmelCase__					)					)







       def snake_case__						(							self       :		List[str]					)   ->					Optional[int]:

            '''simple docstring'''




            _UpperCamelCase       =	[
                '''safety_checker/pytorch_model.fp16.bin''',
                '''safety_checker/model.fp16.safetensors''',
                '''vae/diffusion_pytorch_model.fp16.bin''',
                '''vae/diffusion_pytorch_model.fp16.safetensors''',
                '''text_encoder/pytorch_model.fp16.bin''',
                # 'text_encoder/model.fp16.safetensors',
                '''unet/diffusion_pytorch_model.fp16.bin''',
                '''unet/diffusion_pytorch_model.fp16.safetensors''',
            ]
            _UpperCamelCase       =	'''fp16'''
            self.assertFalse(is_safetensors_compatible(lowerCAmelCase__	,			variant=lowerCAmelCase__					)					)



