






"""simple docstring"""







import unittest

from diffusers.pipelines.pipeline_utils import is_safetensors_compatible


class    __UpperCAmelCase(       unittest.TestCase							):




						"""simple docstring"""




						def 		UpperCAmelCase_	(       self      ):
												'''simple docstring'''
												lowercase__    :				List[str]=	[
												    "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 		UpperCAmelCase_	(       self      ):
												'''simple docstring'''
												lowercase__    :				Tuple=	[
												    "unet/diffusion_pytorch_model.bin",
												    "unet/diffusion_pytorch_model.safetensors",
												]
												self.assertTrue(is_safetensors_compatible(__lowerCamelCase      )      )




						def 		UpperCAmelCase_	(       self      ):
												'''simple docstring'''
												lowercase__    :				Optional[Any]=	[
												    "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 		UpperCAmelCase_	(       self      ):
												'''simple docstring'''
												lowercase__    :				Tuple=	[
												    "text_encoder/pytorch_model.bin",
												    "text_encoder/model.safetensors",
												]
												self.assertTrue(is_safetensors_compatible(__lowerCamelCase      )      )




						def 		UpperCAmelCase_	(       self      ):
												'''simple docstring'''
												lowercase__    :				Any=	[
												    "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 		UpperCAmelCase_	(       self      ):
												'''simple docstring'''
												lowercase__    :				Optional[int]=	[
												    "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",
												]
												lowercase__    :				Any=	"fp16"
												self.assertTrue(is_safetensors_compatible(__lowerCamelCase	,  variant=__lowerCamelCase      )      )




						def 		UpperCAmelCase_	(       self      ):
												'''simple docstring'''
												lowercase__    :				List[str]=	[
												    "unet/diffusion_pytorch_model.fp16.bin",
												    "unet/diffusion_pytorch_model.fp16.safetensors",
												]
												lowercase__    :				Optional[Any]=	"fp16"
												self.assertTrue(is_safetensors_compatible(__lowerCamelCase	,  variant=__lowerCamelCase      )      )




						def 		UpperCAmelCase_	(       self      ):
												'''simple docstring'''
												# pass variant but use the non-variant filenames
												lowercase__    :				Dict=	[
												    "unet/diffusion_pytorch_model.bin",
												    "unet/diffusion_pytorch_model.safetensors",
												]
												lowercase__    :				str=	"fp16"
												self.assertTrue(is_safetensors_compatible(__lowerCamelCase	,  variant=__lowerCamelCase      )      )




						def 		UpperCAmelCase_	(       self      ):
												'''simple docstring'''
												lowercase__    :				Union[str, Any]=	[
												    "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',
												]
												lowercase__    :				Union[str, Any]=	"fp16"
												self.assertFalse(is_safetensors_compatible(__lowerCamelCase	,  variant=__lowerCamelCase      )      )




						def 		UpperCAmelCase_	(       self      ):
												'''simple docstring'''
												lowercase__    :				str=	[
												    "text_encoder/pytorch_model.fp16.bin",
												    "text_encoder/model.fp16.safetensors",
												]
												lowercase__    :				str=	"fp16"
												self.assertTrue(is_safetensors_compatible(__lowerCamelCase	,  variant=__lowerCamelCase      )      )




						def 		UpperCAmelCase_	(       self      ):
												'''simple docstring'''
												# pass variant but use the non-variant filenames
												lowercase__    :				List[Any]=	[
												    "text_encoder/pytorch_model.bin",
												    "text_encoder/model.safetensors",
												]
												lowercase__    :				Dict=	"fp16"
												self.assertTrue(is_safetensors_compatible(__lowerCamelCase	,  variant=__lowerCamelCase      )      )




						def 		UpperCAmelCase_	(       self      ):
												'''simple docstring'''
												lowercase__    :				Union[str, Any]=	[
												    "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",
												]
												lowercase__    :				Optional[int]=	"fp16"
												self.assertFalse(is_safetensors_compatible(__lowerCamelCase	,  variant=__lowerCamelCase      )      )














"""simple docstring"""







from __future__ import annotations





def 						lowercase__(A						)    ->int:




						"""simple docstring"""



						for i in range(1 ,		len(matrix[0]						)						):
												matrix[0][i] += matrix[0][i - 1]

						# preprocessing the first column
						for i in range(1 ,		len(A						)						):
												matrix[i][0] += matrix[i - 1][0]

						# updating the path cost for current position
						for i in range(1 ,		len(A						)						):
												for j in range(1 ,		len(matrix[0]						)						):
																		matrix[i][j] += min(matrix[i - 1][j] ,		matrix[i][j - 1]						)

						return matrix[-1][-1]


if __name__ == "__main__":
			import doctest

			doctest.testmod()






