

import unittest

from diffusers.pipelines.pipeline_utils import is_safetensors_compatible






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







			def 				__UpperCamelCase			(      self				:			Any						)				->							int:

				"""simple docstring"""

				SCREAMING_SNAKE_CASE :   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(a						)						)
			def 				__UpperCamelCase			(      self				:			List[Any]						)				->							Tuple:

				"""simple docstring"""

				SCREAMING_SNAKE_CASE :   Tuple					  =							[
				    "unet/diffusion_pytorch_model.bin",
				    "unet/diffusion_pytorch_model.safetensors",
				]
				self.assertTrue(is_safetensors_compatible(a						)						)
			def 				__UpperCamelCase			(      self				:			Tuple						)				->							List[str]:

				"""simple docstring"""

				SCREAMING_SNAKE_CASE :   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(a						)						)
			def 				__UpperCamelCase			(      self				:			List[Any]						)				->							Dict:

				"""simple docstring"""

				SCREAMING_SNAKE_CASE :   Optional[int]					  =							[
				    "text_encoder/pytorch_model.bin",
				    "text_encoder/model.safetensors",
				]
				self.assertTrue(is_safetensors_compatible(a						)						)
			def 				__UpperCamelCase			(      self				:			List[Any]						)				->							Optional[int]:

				"""simple docstring"""

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

				"""simple docstring"""

				SCREAMING_SNAKE_CASE :   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",
				]
				SCREAMING_SNAKE_CASE :   str					  =							"fp16"
				self.assertTrue(is_safetensors_compatible(a   ,   variant=a						)						)
			def 				__UpperCamelCase			(      self				:			Tuple						)				->							Dict:

				"""simple docstring"""

				SCREAMING_SNAKE_CASE :   str					  =							[
				    "unet/diffusion_pytorch_model.fp16.bin",
				    "unet/diffusion_pytorch_model.fp16.safetensors",
				]
				SCREAMING_SNAKE_CASE :   int					  =							"fp16"
				self.assertTrue(is_safetensors_compatible(a   ,   variant=a						)						)
			def 				__UpperCamelCase			(      self				:			Dict						)				->							Union[str, Any]:

				"""simple docstring"""

				SCREAMING_SNAKE_CASE :   Any					  =							[
				    "unet/diffusion_pytorch_model.bin",
				    "unet/diffusion_pytorch_model.safetensors",
				]
				SCREAMING_SNAKE_CASE :   Tuple					  =							"fp16"
				self.assertTrue(is_safetensors_compatible(a   ,   variant=a						)						)
			def 				__UpperCamelCase			(      self				:			str						)				->							List[str]:

				"""simple docstring"""

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

				"""simple docstring"""

				SCREAMING_SNAKE_CASE :   Optional[int]					  =							[
				    "text_encoder/pytorch_model.fp16.bin",
				    "text_encoder/model.fp16.safetensors",
				]
				SCREAMING_SNAKE_CASE :   Optional[int]					  =							"fp16"
				self.assertTrue(is_safetensors_compatible(a   ,   variant=a						)						)
			def 				__UpperCamelCase			(      self				:			Union[str, Any]						)				->							Optional[Any]:

				"""simple docstring"""

				SCREAMING_SNAKE_CASE :   Union[str, Any]					  =							[
				    "text_encoder/pytorch_model.bin",
				    "text_encoder/model.safetensors",
				]
				SCREAMING_SNAKE_CASE :   int					  =							"fp16"
				self.assertTrue(is_safetensors_compatible(a   ,   variant=a						)						)






			def 				__UpperCamelCase			(      self				:			Union[str, Any]						)				->							Tuple:

				"""simple docstring"""

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


def 			_A	(      SCREAMING_SNAKE_CASE      ):
	UpperCAmelCase__:	Tuple									= int(SCREAMING_SNAKE_CASE      )
	if decimal in (0, 1):  # Exit cases for the recursion
		return str(SCREAMING_SNAKE_CASE      )
	UpperCAmelCase__							,						UpperCAmelCase__:	Union[str, Any]									= divmod(SCREAMING_SNAKE_CASE	,2      )
	return binary_recursive(SCREAMING_SNAKE_CASE      ) + str(SCREAMING_SNAKE_CASE      )



def 			_A	(      SCREAMING_SNAKE_CASE      ):
	UpperCAmelCase__:	List[str]									= str(SCREAMING_SNAKE_CASE      ).strip()
	if not number:
		raise ValueError("No input value was provided"      )
	UpperCAmelCase__:	Tuple									= "-" if number.startswith("-"      ) else ""
	UpperCAmelCase__:	Any									= number.lstrip("-"      )
	if not number.isnumeric():
		raise ValueError("Input value is not an integer"      )
	return f"{negative}0b{binary_recursive(int(SCREAMING_SNAKE_CASE      )      )}"


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

					testmod()