

'''simple docstring'''

import random
from typing import Any




def 							_UpperCamelCase				(   lowerCAmelCase__:					Dict   )      -> Any:
							for _ in range(len(lowerCAmelCase__   )   ):
														SCREAMING_SNAKE_CASE_				=				random.randint(0		,len(lowerCAmelCase__   ) - 1   )
														SCREAMING_SNAKE_CASE_				=				random.randint(0		,len(lowerCAmelCase__   ) - 1   )
														SCREAMING_SNAKE_CASE_				,    SCREAMING_SNAKE_CASE_				=				data[b], data[a]
							return data


if __name__ == "__main__":
							SCREAMING_SNAKE_CASE							:				Union[str, Any]     	=			[0, 1, 2, 3, 4, 5, 6, 7]
							SCREAMING_SNAKE_CASE							:				str     	=			["""python""", """says""", """hello""", """!"""]
							print("Fisher-Yates Shuffle:")
							print("List", integers, strings)
							print("FY Shuffle", fisher_yates_shuffle(integers), fisher_yates_shuffle(strings))






"""simple docstring"""



import unittest

from diffusers.pipelines.pipeline_utils import is_safetensors_compatible






class  snake_case__      (       unittest.TestCase       ):


 def 						a__   ( self						):
        __a       =    [
            "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(lowerCamelCase						)						)


 def 						a__   ( self						):
        __a       =    [
            "unet/diffusion_pytorch_model.bin",
            "unet/diffusion_pytorch_model.safetensors",
        ]
        self.assertTrue(is_safetensors_compatible(lowerCamelCase						)						)


 def 						a__   ( self						):
        __a       =    [
            "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(lowerCamelCase						)						)


 def 						a__   ( self						):
        __a       =    [
            "text_encoder/pytorch_model.bin",
            "text_encoder/model.safetensors",
        ]
        self.assertTrue(is_safetensors_compatible(lowerCamelCase						)						)


 def 						a__   ( self						):
        __a       =    [
            "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(lowerCamelCase						)						)


 def 						a__   ( self						):
        __a       =    [
            "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",
        ]
        __a       =    "fp16"
        self.assertTrue(is_safetensors_compatible(lowerCamelCase    ,		variant=lowerCamelCase						)						)


 def 						a__   ( self						):
        __a       =    [
            "unet/diffusion_pytorch_model.fp16.bin",
            "unet/diffusion_pytorch_model.fp16.safetensors",
        ]
        __a       =    "fp16"
        self.assertTrue(is_safetensors_compatible(lowerCamelCase    ,		variant=lowerCamelCase						)						)


 def 						a__   ( self						):
        # pass variant but use the non-variant filenames
        __a       =    [
            "unet/diffusion_pytorch_model.bin",
            "unet/diffusion_pytorch_model.safetensors",
        ]
        __a       =    "fp16"
        self.assertTrue(is_safetensors_compatible(lowerCamelCase    ,		variant=lowerCamelCase						)						)


 def 						a__   ( self						):
        __a       =    [
            "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',
        ]
        __a       =    "fp16"
        self.assertFalse(is_safetensors_compatible(lowerCamelCase    ,		variant=lowerCamelCase						)						)


 def 						a__   ( self						):
        __a       =    [
            "text_encoder/pytorch_model.fp16.bin",
            "text_encoder/model.fp16.safetensors",
        ]
        __a       =    "fp16"
        self.assertTrue(is_safetensors_compatible(lowerCamelCase    ,		variant=lowerCamelCase						)						)


 def 						a__   ( self						):
        # pass variant but use the non-variant filenames
        __a       =    [
            "text_encoder/pytorch_model.bin",
            "text_encoder/model.safetensors",
        ]
        __a       =    "fp16"
        self.assertTrue(is_safetensors_compatible(lowerCamelCase    ,		variant=lowerCamelCase						)						)






 def 						a__   ( self						):
        __a       =    [
            "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",
        ]
        __a       =    "fp16"
        self.assertFalse(is_safetensors_compatible(lowerCamelCase    ,		variant=lowerCamelCase						)						)
