





'''simple docstring'''


import unittest

from diffusers.pipelines.pipeline_utils import is_safetensors_compatible
class 				a_       (    unittest.TestCase							):





     def 							lowercase__				(			self		: Dict						):





        """simple docstring"""




        lowercase_      :List[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(lowercase						)						)





     def 							lowercase__				(			self		: Tuple						):





        """simple docstring"""




        lowercase_      :int         =			[
            "unet/diffusion_pytorch_model.bin",
            "unet/diffusion_pytorch_model.safetensors",
        ]
        self.assertTrue(is_safetensors_compatible(lowercase						)						)





     def 							lowercase__				(			self		: List[str]						):





        """simple docstring"""




        lowercase_      :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",
            "text_encoder/model.safetensors",
            "unet/diffusion_pytorch_model.bin",
            # Removed: 'unet/diffusion_pytorch_model.safetensors',
        ]
        self.assertFalse(is_safetensors_compatible(lowercase						)						)





     def 							lowercase__				(			self		: List[Any]						):





        """simple docstring"""




        lowercase_      :Tuple         =			[
            "text_encoder/pytorch_model.bin",
            "text_encoder/model.safetensors",
        ]
        self.assertTrue(is_safetensors_compatible(lowercase						)						)





     def 							lowercase__				(			self		: Optional[Any]						):





        """simple docstring"""




        lowercase_      :Union[str, 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 							lowercase__				(			self		: List[Any]						):





        """simple docstring"""




        lowercase_      :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",
        ]
        lowercase_      :Optional[Any]         =			"fp16"
        self.assertTrue(is_safetensors_compatible(lowercase     ,				variant=lowercase						)						)





     def 							lowercase__				(			self		: Any						):





        """simple docstring"""




        lowercase_      :Optional[int]         =			[
            "unet/diffusion_pytorch_model.fp16.bin",
            "unet/diffusion_pytorch_model.fp16.safetensors",
        ]
        lowercase_      :List[str]         =			"fp16"
        self.assertTrue(is_safetensors_compatible(lowercase     ,				variant=lowercase						)						)





     def 							lowercase__				(			self		: Optional[int]						):





        """simple docstring"""




        lowercase_      :Tuple         =			[
            "unet/diffusion_pytorch_model.bin",
            "unet/diffusion_pytorch_model.safetensors",
        ]
        lowercase_      :str         =			"fp16"
        self.assertTrue(is_safetensors_compatible(lowercase     ,				variant=lowercase						)						)





     def 							lowercase__				(			self		: List[Any]						):





        """simple docstring"""




        lowercase_      :Dict         =			[
            "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_      :Optional[int]         =			"fp16"
        self.assertFalse(is_safetensors_compatible(lowercase     ,				variant=lowercase						)						)





     def 							lowercase__				(			self		: str						):





        """simple docstring"""




        lowercase_      :Union[str, Any]         =			[
            "text_encoder/pytorch_model.fp16.bin",
            "text_encoder/model.fp16.safetensors",
        ]
        lowercase_      :Optional[Any]         =			"fp16"
        self.assertTrue(is_safetensors_compatible(lowercase     ,				variant=lowercase						)						)





     def 							lowercase__				(			self		: Union[str, Any]						):





        """simple docstring"""




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







     def 							lowercase__				(			self		: str						):





        """simple docstring"""




        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_      :str         =			"fp16"
        self.assertFalse(is_safetensors_compatible(lowercase     ,				variant=lowercase						)						)









'''simple docstring'''


def 							UpperCAmelCase_  (						__lowerCamelCase : dict			):
   lowercase_      :set[int]         =			set()
   # To detect a back edge, keep track of vertices currently in the recursion stack
   lowercase_      :set[int]         =			set()
   return any(
       node not in visited and depth_first_search(__lowerCamelCase     ,__lowerCamelCase     ,__lowerCamelCase     ,__lowerCamelCase			)
       for node in graph			)
def 							UpperCAmelCase_  (						__lowerCamelCase : dict     ,__lowerCamelCase : int     ,__lowerCamelCase : set     ,__lowerCamelCase : set			):
   visited.add(__lowerCamelCase			)
   rec_stk.add(__lowerCamelCase			)

   for node in graph[vertex]:
      if node not in visited:
         if depth_first_search(__lowerCamelCase     ,__lowerCamelCase     ,__lowerCamelCase     ,__lowerCamelCase			):
            return True
      elif node in rec_stk:
         return True

    # The node needs to be removed from recursion stack before function ends
   rec_stk.remove(__lowerCamelCase			)
   return False


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

 testmod()


