"""simple docstring"""






import unittest

from diffusers.pipelines.pipeline_utils import is_safetensors_compatible

class lowerCamelCase		(unittest.TestCase      ):






					'''simple docstring'''


					def 			lowerCAmelCase_					(						self			:				Optional[int]		)							->       Tuple:
									SCREAMING_SNAKE_CASE__		  =				[
									    "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(_snake_case		)		)



					def 			lowerCAmelCase_					(						self			:				Tuple		)							->       Dict:
									SCREAMING_SNAKE_CASE__		  =				[
									    "unet/diffusion_pytorch_model.bin",
									    "unet/diffusion_pytorch_model.safetensors",
									]
									self.assertTrue(is_safetensors_compatible(_snake_case		)		)



					def 			lowerCAmelCase_					(						self			:				List[str]		)							->       Tuple:
									SCREAMING_SNAKE_CASE__		  =				[
									    "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(_snake_case		)		)



					def 			lowerCAmelCase_					(						self			:				Any		)							->       int:
									SCREAMING_SNAKE_CASE__		  =				[
									    "text_encoder/pytorch_model.bin",
									    "text_encoder/model.safetensors",
									]
									self.assertTrue(is_safetensors_compatible(_snake_case		)		)



					def 			lowerCAmelCase_					(						self			:				str		)							->       Dict:
									SCREAMING_SNAKE_CASE__		  =				[
									    "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(_snake_case		)		)



					def 			lowerCAmelCase_					(						self			:				Optional[Any]		)							->       str:
									SCREAMING_SNAKE_CASE__		  =				[
									    "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__		  =				"fp16"
									self.assertTrue(is_safetensors_compatible(_snake_case   , variant=_snake_case		)		)



					def 			lowerCAmelCase_					(						self			:				Tuple		)							->       Union[str, Any]:
									SCREAMING_SNAKE_CASE__		  =				[
									    "unet/diffusion_pytorch_model.fp16.bin",
									    "unet/diffusion_pytorch_model.fp16.safetensors",
									]
									SCREAMING_SNAKE_CASE__		  =				"fp16"
									self.assertTrue(is_safetensors_compatible(_snake_case   , variant=_snake_case		)		)



					def 			lowerCAmelCase_					(						self			:				Any		)							->       Optional[int]:
									# pass variant but use the non-variant filenames
									SCREAMING_SNAKE_CASE__		  =				[
									    "unet/diffusion_pytorch_model.bin",
									    "unet/diffusion_pytorch_model.safetensors",
									]
									SCREAMING_SNAKE_CASE__		  =				"fp16"
									self.assertTrue(is_safetensors_compatible(_snake_case   , variant=_snake_case		)		)



					def 			lowerCAmelCase_					(						self			:				str		)							->       Union[str, Any]:
									SCREAMING_SNAKE_CASE__		  =				[
									    "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__		  =				"fp16"
									self.assertFalse(is_safetensors_compatible(_snake_case   , variant=_snake_case		)		)



					def 			lowerCAmelCase_					(						self			:				Union[str, Any]		)							->       Any:
									SCREAMING_SNAKE_CASE__		  =				[
									    "text_encoder/pytorch_model.fp16.bin",
									    "text_encoder/model.fp16.safetensors",
									]
									SCREAMING_SNAKE_CASE__		  =				"fp16"
									self.assertTrue(is_safetensors_compatible(_snake_case   , variant=_snake_case		)		)



					def 			lowerCAmelCase_					(						self			:				Tuple		)							->       Union[str, Any]:
									# pass variant but use the non-variant filenames
									SCREAMING_SNAKE_CASE__		  =				[
									    "text_encoder/pytorch_model.bin",
									    "text_encoder/model.safetensors",
									]
									SCREAMING_SNAKE_CASE__		  =				"fp16"
									self.assertTrue(is_safetensors_compatible(_snake_case   , variant=_snake_case		)		)



					def 			lowerCAmelCase_					(						self			:				Optional[Any]		)							->       str:
									SCREAMING_SNAKE_CASE__		  =				[
									    "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__		  =				"fp16"
									self.assertFalse(is_safetensors_compatible(_snake_case   , variant=_snake_case		)		)





"""simple docstring"""






import math




def 						SCREAMING_SNAKE_CASE					(  __UpperCAmelCase  ,					__UpperCAmelCase       )							->   float:

				if initial_intensity < 0:
								raise ValueError("The value of intensity cannot be negative"       )
								# handling of negative values of initial intensity
				if angle < 0 or angle > 360:
								raise ValueError("In Malus Law, the angle is in the range 0-360 degrees"       )
								# handling of values out of allowed range
				return initial_intensity * (math.cos(math.radians(__UpperCAmelCase       )       ) ** 2)


if __name__ == "__main__":
						import doctest

						doctest.testmod(name='malus_law')




