


import unittest

from diffusers.pipelines.pipeline_utils import is_safetensors_compatible



class    UpperCAmelCase_	(							unittest.TestCase):
       '''simple docstring'''






       def  _lowercase   (     self						):




              """simple docstring"""




              UpperCamelCase    :	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(__SCREAMING_SNAKE_CASE						)						)






       def  _lowercase   (     self						):




              """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						):




              """simple docstring"""




              UpperCamelCase    :	Dict   	=		[
                  '''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						):




              """simple docstring"""




              UpperCamelCase    :	List[str]   	=		[
                  '''text_encoder/pytorch_model.bin''',
                  '''text_encoder/model.safetensors''',
              ]
              self.assertTrue(is_safetensors_compatible(__SCREAMING_SNAKE_CASE						)						)






       def  _lowercase   (     self						):




              """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''',
                  # 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						):




              """simple docstring"""




              UpperCamelCase    :	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''',
              ]
              UpperCamelCase    :	List[Any]   	=		'''fp16'''
              self.assertTrue(is_safetensors_compatible(__SCREAMING_SNAKE_CASE ,					variant=__SCREAMING_SNAKE_CASE						)						)






       def  _lowercase   (     self						):




              """simple docstring"""




              UpperCamelCase    :	List[Any]   	=		[
                  '''unet/diffusion_pytorch_model.fp16.bin''',
                  '''unet/diffusion_pytorch_model.fp16.safetensors''',
              ]
              UpperCamelCase    :	str   	=		'''fp16'''
              self.assertTrue(is_safetensors_compatible(__SCREAMING_SNAKE_CASE ,					variant=__SCREAMING_SNAKE_CASE						)						)






       def  _lowercase   (     self						):




              """simple docstring"""




              UpperCamelCase    :	Union[str, 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						):




              """simple docstring"""




              UpperCamelCase    :	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''',
                  # Removed: 'unet/diffusion_pytorch_model.fp16.safetensors',
              ]
              UpperCamelCase    :	List[str]   	=		'''fp16'''
              self.assertFalse(is_safetensors_compatible(__SCREAMING_SNAKE_CASE ,					variant=__SCREAMING_SNAKE_CASE						)						)






       def  _lowercase   (     self						):




              """simple docstring"""




              UpperCamelCase    :	List[str]   	=		[
                  '''text_encoder/pytorch_model.fp16.bin''',
                  '''text_encoder/model.fp16.safetensors''',
              ]
              UpperCamelCase    :	int   	=		'''fp16'''
              self.assertTrue(is_safetensors_compatible(__SCREAMING_SNAKE_CASE ,					variant=__SCREAMING_SNAKE_CASE						)						)






       def  _lowercase   (     self						):




              """simple docstring"""




              UpperCamelCase    :	Optional[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						):




              """simple docstring"""




              UpperCamelCase    :	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''',
              ]
              UpperCamelCase    :	Any   	=		'''fp16'''
              self.assertFalse(is_safetensors_compatible(__SCREAMING_SNAKE_CASE ,					variant=__SCREAMING_SNAKE_CASE						)						)





def      a	(							SCREAMING_SNAKE_CASE_      :		int       ):






       """simple docstring"""





       if number > 0:
              raise ValueError('''input must be a negative integer'''       )
       UpperCamelCase    :	List[str]   	=		len(bin(SCREAMING_SNAKE_CASE_       )[3:]       )
       UpperCamelCase    :	List[str]   	=		bin(abs(SCREAMING_SNAKE_CASE_       ) - (1 << binary_number_length)       )[3:]
       UpperCamelCase    :	Dict   	=		(
           (
               '''1'''
               + '''0''' * (binary_number_length - len(SCREAMING_SNAKE_CASE_       ))
               + twos_complement_number
           )
           if number < 0
           else '''0'''
       )
       return "0b" + twos_complement_number


if __name__ == "__main__":
  import doctest

  doctest.testmod()

