"""simple docstring"""






import unittest

from diffusers.pipelines.pipeline_utils import is_safetensors_compatible





class 					_A		(			unittest.TestCase      ):

      def 							A__			(		self		):







            """simple docstring"""



            lowercase								=      [
                """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 							A__			(		self		):







            """simple docstring"""



            lowercase								=      [
                """unet/diffusion_pytorch_model.bin""",
                """unet/diffusion_pytorch_model.safetensors""",
            ]
            self.assertTrue(is_safetensors_compatible(__lowerCAmelCase		)		)

      def 							A__			(		self		):







            """simple docstring"""



            lowercase								=      [
                """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 							A__			(		self		):







            """simple docstring"""



            lowercase								=      [
                """text_encoder/pytorch_model.bin""",
                """text_encoder/model.safetensors""",
            ]
            self.assertTrue(is_safetensors_compatible(__lowerCAmelCase		)		)

      def 							A__			(		self		):







            """simple docstring"""



            lowercase								=      [
                """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 							A__			(		self		):







            """simple docstring"""



            lowercase								=      [
                """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								=      """fp16"""
            self.assertTrue(is_safetensors_compatible(__lowerCAmelCase						,			variant=__lowerCAmelCase		)		)

      def 							A__			(		self		):







            """simple docstring"""



            lowercase								=      [
                """unet/diffusion_pytorch_model.fp16.bin""",
                """unet/diffusion_pytorch_model.fp16.safetensors""",
            ]
            lowercase								=      """fp16"""
            self.assertTrue(is_safetensors_compatible(__lowerCAmelCase						,			variant=__lowerCAmelCase		)		)

      def 							A__			(		self		):







            """simple docstring"""



            lowercase								=      [
                """unet/diffusion_pytorch_model.bin""",
                """unet/diffusion_pytorch_model.safetensors""",
            ]
            lowercase								=      """fp16"""
            self.assertTrue(is_safetensors_compatible(__lowerCAmelCase						,			variant=__lowerCAmelCase		)		)

      def 							A__			(		self		):







            """simple docstring"""



            lowercase								=      [
                """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								=      """fp16"""
            self.assertFalse(is_safetensors_compatible(__lowerCAmelCase						,			variant=__lowerCAmelCase		)		)

      def 							A__			(		self		):







            """simple docstring"""



            lowercase								=      [
                """text_encoder/pytorch_model.fp16.bin""",
                """text_encoder/model.fp16.safetensors""",
            ]
            lowercase								=      """fp16"""
            self.assertTrue(is_safetensors_compatible(__lowerCAmelCase						,			variant=__lowerCAmelCase		)		)

      def 							A__			(		self		):







            """simple docstring"""



            lowercase								=      [
                """text_encoder/pytorch_model.bin""",
                """text_encoder/model.safetensors""",
            ]
            lowercase								=      """fp16"""
            self.assertTrue(is_safetensors_compatible(__lowerCAmelCase						,			variant=__lowerCAmelCase		)		)







      def 							A__			(		self		):







            """simple docstring"""



            lowercase								=      [
                """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								=      """fp16"""
            self.assertFalse(is_safetensors_compatible(__lowerCAmelCase						,			variant=__lowerCAmelCase		)		)




"""simple docstring"""






from math import pow, sqrt


def      UpperCAmelCase__			(							*lowerCAmelCase__	:float						)					->       bool:
      '''simple docstring'''


      lowercase								=      len(lowerCAmelCase__						) > 0 and all(value > 0.0 for value in values						)
      return result


def      UpperCAmelCase__			(							lowerCAmelCase__	:float   ,						lowerCAmelCase__	:float						)					->       float | ValueError:
      '''simple docstring'''


      return (
          round(sqrt(molar_mass_a / molar_mass_a						)   ,						6						)
          if validate(lowerCAmelCase__   ,						lowerCAmelCase__						)
          else ValueError("""Input Error: Molar mass values must greater than 0."""						)
      )


def      UpperCAmelCase__			(							lowerCAmelCase__	:float   ,						lowerCAmelCase__	:float   ,						lowerCAmelCase__	:float						)					->       float | ValueError:
      '''simple docstring'''


      return (
          round(effusion_rate * sqrt(molar_mass_a / molar_mass_a						)   ,						6						)
          if validate(lowerCAmelCase__   ,						lowerCAmelCase__   ,						lowerCAmelCase__						)
          else ValueError(
              """Input Error: Molar mass and effusion rate values must greater than 0."""						)
      )


def      UpperCAmelCase__			(							lowerCAmelCase__	:float   ,						lowerCAmelCase__	:float   ,						lowerCAmelCase__	:float						)					->       float | ValueError:
      '''simple docstring'''


      return (
          round(effusion_rate / sqrt(molar_mass_a / molar_mass_a						)   ,						6						)
          if validate(lowerCAmelCase__   ,						lowerCAmelCase__   ,						lowerCAmelCase__						)
          else ValueError(
              """Input Error: Molar mass and effusion rate values must greater than 0."""						)
      )


def      UpperCAmelCase__			(							lowerCAmelCase__	:float   ,						lowerCAmelCase__	:float   ,						lowerCAmelCase__	:float						)					->       float | ValueError:
      '''simple docstring'''


      return (
          round(molar_mass / pow(effusion_rate_a / effusion_rate_a   ,						2						)   ,						6						)
          if validate(lowerCAmelCase__   ,						lowerCAmelCase__   ,						lowerCAmelCase__						)
          else ValueError(
              """Input Error: Molar mass and effusion rate values must greater than 0."""						)
      )






def      UpperCAmelCase__			(							lowerCAmelCase__	:float   ,						lowerCAmelCase__	:float   ,						lowerCAmelCase__	:float						)					->       float | ValueError:
      '''simple docstring'''


      return (
          round(pow(effusion_rate_a / effusion_rate_a   ,						2						) / molar_mass   ,						6						)
          if validate(lowerCAmelCase__   ,						lowerCAmelCase__   ,						lowerCAmelCase__						)
          else ValueError(
              """Input Error: Molar mass and effusion rate values must greater than 0."""						)
      )



