




"""simple docstring"""







import unittest

from diffusers.pipelines.pipeline_utils import is_safetensors_compatible




class       lowerCAmelCase__       (			unittest.TestCase    ):


				"""simple docstring"""





				def       snake_case    (     self					:	Dict						):
						__lowercase				:		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",
						    "text_encoder/model.safetensors",
						    "unet/diffusion_pytorch_model.bin",
						    "unet/diffusion_pytorch_model.safetensors",
						]
						self.assertTrue(is_safetensors_compatible(lowercase__						)						)



				def       snake_case    (     self					:	Any						):
						__lowercase				:		Optional[Any]												=				[
						    "unet/diffusion_pytorch_model.bin",
						    "unet/diffusion_pytorch_model.safetensors",
						]
						self.assertTrue(is_safetensors_compatible(lowercase__						)						)



				def       snake_case    (     self					:	Optional[int]						):
						__lowercase				:		List[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",
						    # Removed: 'unet/diffusion_pytorch_model.safetensors',
						]
						self.assertFalse(is_safetensors_compatible(lowercase__						)						)



				def       snake_case    (     self					:	int						):
						__lowercase				:		str												=				[
						    "text_encoder/pytorch_model.bin",
						    "text_encoder/model.safetensors",
						]
						self.assertTrue(is_safetensors_compatible(lowercase__						)						)



				def       snake_case    (     self					:	int						):
						__lowercase				:		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(lowercase__						)						)



				def       snake_case    (     self					:	List[Any]						):
						__lowercase				:		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",
						]
						__lowercase				:		List[Any]												=				"fp16"
						self.assertTrue(is_safetensors_compatible(lowercase__    ,   variant=lowercase__						)						)



				def       snake_case    (     self					:	List[str]						):
						__lowercase				:		int												=				[
						    "unet/diffusion_pytorch_model.fp16.bin",
						    "unet/diffusion_pytorch_model.fp16.safetensors",
						]
						__lowercase				:		Tuple												=				"fp16"
						self.assertTrue(is_safetensors_compatible(lowercase__    ,   variant=lowercase__						)						)



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



				def       snake_case    (     self					:	List[Any]						):
						__lowercase				:		Tuple												=				[
						    "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				:		Dict												=				"fp16"
						self.assertFalse(is_safetensors_compatible(lowercase__    ,   variant=lowercase__						)						)



				def       snake_case    (     self					:	str						):
						__lowercase				:		Any												=				[
						    "text_encoder/pytorch_model.fp16.bin",
						    "text_encoder/model.fp16.safetensors",
						]
						__lowercase				:		List[str]												=				"fp16"
						self.assertTrue(is_safetensors_compatible(lowercase__    ,   variant=lowercase__						)						)



				def       snake_case    (     self					:	List[str]						):
						# pass variant but use the non-variant filenames
						__lowercase				:		List[str]												=				[
						    "text_encoder/pytorch_model.bin",
						    "text_encoder/model.safetensors",
						]
						__lowercase				:		int												=				"fp16"
						self.assertTrue(is_safetensors_compatible(lowercase__    ,   variant=lowercase__						)						)



				def       snake_case    (     self					:	int						):
						__lowercase				:		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",
						]
						__lowercase				:		Union[str, Any]												=				"fp16"
						self.assertFalse(is_safetensors_compatible(lowercase__    ,   variant=lowercase__						)						)






"""simple docstring"""







def 						snake_case__       (					_lowerCamelCase				)			->int:






		"""simple docstring"""


		if a < 0:
				raise ValueError("Input value must be a positive integer"				)
		elif isinstance(_lowerCamelCase,  _lowerCamelCase				):
				raise TypeError("Input value must be a 'int' type"				)
		return bin(_lowerCamelCase				).count("1"				)


if __name__ == "__main__":
						import doctest

						doctest.testmod()
