"""simple docstring"""






import unittest

from diffusers.pipelines.pipeline_utils import is_safetensors_compatible


class        UpperCAmelCase		(unittest.TestCase    ):



    """simple docstring"""

    def _snake_case     (  self				):
       lowercase__:  Optional[int]   = [
           """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(A_				)				)






    def _snake_case     (  self				):
       lowercase__:  str   = [
           """unet/diffusion_pytorch_model.bin""",
           """unet/diffusion_pytorch_model.safetensors""",
       ]
       self.assertTrue(is_safetensors_compatible(A_				)				)






    def _snake_case     (  self				):
       lowercase__:  Optional[int]   = [
           """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(A_				)				)






    def _snake_case     (  self				):
       lowercase__:  Dict   = [
           """text_encoder/pytorch_model.bin""",
           """text_encoder/model.safetensors""",
       ]
       self.assertTrue(is_safetensors_compatible(A_				)				)






    def _snake_case     (  self				):
       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""",
           # Removed: 'text_encoder/model.safetensors',
           """unet/diffusion_pytorch_model.bin""",
           """unet/diffusion_pytorch_model.safetensors""",
       ]
       self.assertFalse(is_safetensors_compatible(A_				)				)






    def _snake_case     (  self				):
       lowercase__:  List[str]   = [
           """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__:  Union[str, Any]   = """fp16"""
       self.assertTrue(is_safetensors_compatible(A_       ,     variant=A_				)				)






    def _snake_case     (  self				):
       lowercase__:  Dict   = [
           """unet/diffusion_pytorch_model.fp16.bin""",
           """unet/diffusion_pytorch_model.fp16.safetensors""",
       ]
       lowercase__:  int   = """fp16"""
       self.assertTrue(is_safetensors_compatible(A_       ,     variant=A_				)				)






    def _snake_case     (  self				):
       # pass variant but use the non-variant filenames
       lowercase__:  int   = [
           """unet/diffusion_pytorch_model.bin""",
           """unet/diffusion_pytorch_model.safetensors""",
       ]
       lowercase__:  int   = """fp16"""
       self.assertTrue(is_safetensors_compatible(A_       ,     variant=A_				)				)






    def _snake_case     (  self				):
       lowercase__:  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""",
           # Removed: 'unet/diffusion_pytorch_model.fp16.safetensors',
       ]
       lowercase__:  int   = """fp16"""
       self.assertFalse(is_safetensors_compatible(A_       ,     variant=A_				)				)






    def _snake_case     (  self				):
       lowercase__:  Optional[int]   = [
           """text_encoder/pytorch_model.fp16.bin""",
           """text_encoder/model.fp16.safetensors""",
       ]
       lowercase__:  Any   = """fp16"""
       self.assertTrue(is_safetensors_compatible(A_       ,     variant=A_				)				)






    def _snake_case     (  self				):
       # pass variant but use the non-variant filenames
       lowercase__:  Union[str, Any]   = [
           """text_encoder/pytorch_model.bin""",
           """text_encoder/model.safetensors""",
       ]
       lowercase__:  Tuple   = """fp16"""
       self.assertTrue(is_safetensors_compatible(A_       ,     variant=A_				)				)






    def _snake_case     (  self				):
       lowercase__:  List[str]   = [
           """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__:  List[Any]   = """fp16"""
       self.assertFalse(is_safetensors_compatible(A_       ,     variant=A_				)				)




SCREAMING_SNAKE_CASE__					:     dict[str, float]       =     {
    "joule": 1.0,
    "kilojoule": 1_000,
    "megajoule": 1_000_000,
    "gigajoule": 1_000_000_000,
    "wattsecond": 1.0,
    "watthour": 3_600,
    "kilowatthour": 3_600_000,
    "newtonmeter": 1.0,
    "calorie_nutr": 4_186.8,
    "kilocalorie_nutr": 4_186_800.00,
    "electronvolt": 1.602176634e-19,
    "britishthermalunit_it": 1_055.05_585,
    "footpound": 1.355_818,
}




def    a__    (		snake_case__					:							str						,   snake_case__					:							str						,   snake_case__					:							float     ):
  if to_type not in ENERGY_CONVERSION or from_type not in ENERGY_CONVERSION:
    _UpperCAmelCase		:							Optional[Any]							=     (
        f'''Incorrect \'from_type\' or \'to_type\' value: {from_type!r}, {to_type!r}\n'''
        f'''Valid values are: {", ".join(snake_case__     )}'''
    )
    raise ValueError(snake_case__     )
  return value * ENERGY_CONVERSION[from_type] / ENERGY_CONVERSION[to_type]


if __name__ == "__main__":
 import doctest

 doctest.testmod()





