






import unittest

from diffusers.pipelines.pipeline_utils import is_safetensors_compatible





class       __a  (   unittest.TestCase	):







 def  __lowercase (		self :       str						):


      '''simple docstring'''






      UpperCamelCase__      :       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",
          "unet/diffusion_pytorch_model.safetensors",
      ]
      self.assertTrue(is_safetensors_compatible(SCREAMING_SNAKE_CASE						)						)







 def  __lowercase (		self :       Tuple						):


      '''simple docstring'''






      UpperCamelCase__      :       Optional[int]	    =  [
          "unet/diffusion_pytorch_model.bin",
          "unet/diffusion_pytorch_model.safetensors",
      ]
      self.assertTrue(is_safetensors_compatible(SCREAMING_SNAKE_CASE						)						)







 def  __lowercase (		self :       Optional[Any]						):


      '''simple docstring'''






      UpperCamelCase__      :       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(SCREAMING_SNAKE_CASE						)						)







 def  __lowercase (		self :       Tuple						):


      '''simple docstring'''






      UpperCamelCase__      :       Optional[int]	    =  [
          "text_encoder/pytorch_model.bin",
          "text_encoder/model.safetensors",
      ]
      self.assertTrue(is_safetensors_compatible(SCREAMING_SNAKE_CASE						)						)







 def  __lowercase (		self :       Any						):


      '''simple docstring'''






      UpperCamelCase__      :       Tuple	    =  [
          "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(SCREAMING_SNAKE_CASE						)						)







 def  __lowercase (		self :       Dict						):


      '''simple docstring'''






      UpperCamelCase__      :       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",
      ]
      UpperCamelCase__      :       Optional[int]	    =  "fp16"
      self.assertTrue(is_safetensors_compatible(SCREAMING_SNAKE_CASE							,       variant=SCREAMING_SNAKE_CASE						)						)







 def  __lowercase (		self :       Any						):


      '''simple docstring'''






      UpperCamelCase__      :       Dict	    =  [
          "unet/diffusion_pytorch_model.fp16.bin",
          "unet/diffusion_pytorch_model.fp16.safetensors",
      ]
      UpperCamelCase__      :       Union[str, Any]	    =  "fp16"
      self.assertTrue(is_safetensors_compatible(SCREAMING_SNAKE_CASE							,       variant=SCREAMING_SNAKE_CASE						)						)







 def  __lowercase (		self :       List[str]						):


      '''simple docstring'''






      UpperCamelCase__      :       Optional[Any]	    =  [
          "unet/diffusion_pytorch_model.bin",
          "unet/diffusion_pytorch_model.safetensors",
      ]
      UpperCamelCase__      :       Optional[int]	    =  "fp16"
      self.assertTrue(is_safetensors_compatible(SCREAMING_SNAKE_CASE							,       variant=SCREAMING_SNAKE_CASE						)						)







 def  __lowercase (		self :       Tuple						):


      '''simple docstring'''






      UpperCamelCase__      :       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',
      ]
      UpperCamelCase__      :       Union[str, Any]	    =  "fp16"
      self.assertFalse(is_safetensors_compatible(SCREAMING_SNAKE_CASE							,       variant=SCREAMING_SNAKE_CASE						)						)







 def  __lowercase (		self :       Tuple						):


      '''simple docstring'''






      UpperCamelCase__      :       Tuple	    =  [
          "text_encoder/pytorch_model.fp16.bin",
          "text_encoder/model.fp16.safetensors",
      ]
      UpperCamelCase__      :       Tuple	    =  "fp16"
      self.assertTrue(is_safetensors_compatible(SCREAMING_SNAKE_CASE							,       variant=SCREAMING_SNAKE_CASE						)						)







 def  __lowercase (		self :       List[str]						):


      '''simple docstring'''






      UpperCamelCase__      :       List[Any]	    =  [
          "text_encoder/pytorch_model.bin",
          "text_encoder/model.safetensors",
      ]
      UpperCamelCase__      :       Any	    =  "fp16"
      self.assertTrue(is_safetensors_compatible(SCREAMING_SNAKE_CASE							,       variant=SCREAMING_SNAKE_CASE						)						)







 def  __lowercase (		self :       List[str]						):


      '''simple docstring'''






      UpperCamelCase__      :       Optional[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",
      ]
      UpperCamelCase__      :       List[Any]	    =  "fp16"
      self.assertFalse(is_safetensors_compatible(SCREAMING_SNAKE_CASE							,       variant=SCREAMING_SNAKE_CASE						)						)







from __future__ import annotations







def 		SCREAMING_SNAKE_CASE							( __lowerCAmelCase ,   __lowerCAmelCase = None ,   __lowerCAmelCase = None      )			->     None:
     if start is None:
          UpperCamelCase__      :       Union[str, Any]	    =  0

     if end is None:
          UpperCamelCase__      :       List[Any]	    =  len(__lowerCAmelCase      ) - 1

     if start >= end:
          return

     UpperCamelCase__      :       Union[str, Any]	    =  (start + end) // 2

     slowsort(__lowerCAmelCase ,   __lowerCAmelCase ,   __lowerCAmelCase      )
     slowsort(__lowerCAmelCase ,   mid + 1 ,   __lowerCAmelCase      )

     if sequence[end] < sequence[mid]:
          UpperCamelCase__    ,					UpperCamelCase__      :       Optional[int]	    =  sequence[mid], sequence[end]

     slowsort(__lowerCAmelCase ,   __lowerCAmelCase ,   end - 1      )


if __name__ == "__main__":
 from doctest import testmod

 testmod()