
import unittest

from diffusers.pipelines.pipeline_utils import is_safetensors_compatible

class 						a   (				unittest.TestCase    ):




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




				def 	__snake_case							(							self	:				Optional[int]      ):
										snake_case       :     Any =    [
										    '''unet/diffusion_pytorch_model.bin''',
										    '''unet/diffusion_pytorch_model.safetensors''',
										]
										self.assertTrue(is_safetensors_compatible(__UpperCamelCase      )      )




				def 	__snake_case							(							self	:				Union[str, Any]      ):
										snake_case       :     Dict =    [
										    '''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(__UpperCamelCase      )      )




				def 	__snake_case							(							self	:				str      ):
										snake_case       :     Optional[int] =    [
										    '''text_encoder/pytorch_model.bin''',
										    '''text_encoder/model.safetensors''',
										]
										self.assertTrue(is_safetensors_compatible(__UpperCamelCase      )      )




				def 	__snake_case							(							self	:				Optional[int]      ):
										snake_case       :     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(__UpperCamelCase      )      )




				def 	__snake_case							(							self	:				Union[str, Any]      ):
										snake_case       :     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''',
										    '''unet/diffusion_pytorch_model.fp16.safetensors''',
										]
										snake_case       :     List[str] =    '''fp16'''
										self.assertTrue(is_safetensors_compatible(__UpperCamelCase,    variant=__UpperCamelCase      )      )




				def 	__snake_case							(							self	:				str      ):
										snake_case       :     Optional[int] =    [
										    '''unet/diffusion_pytorch_model.fp16.bin''',
										    '''unet/diffusion_pytorch_model.fp16.safetensors''',
										]
										snake_case       :     List[str] =    '''fp16'''
										self.assertTrue(is_safetensors_compatible(__UpperCamelCase,    variant=__UpperCamelCase      )      )




				def 	__snake_case							(							self	:				int      ):
										snake_case       :     Optional[int] =    [
										    '''unet/diffusion_pytorch_model.bin''',
										    '''unet/diffusion_pytorch_model.safetensors''',
										]
										snake_case       :     Union[str, Any] =    '''fp16'''
										self.assertTrue(is_safetensors_compatible(__UpperCamelCase,    variant=__UpperCamelCase      )      )




				def 	__snake_case							(							self	:				List[Any]      ):
										snake_case       :     List[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''',
										    # Removed: 'unet/diffusion_pytorch_model.fp16.safetensors',
										]
										snake_case       :     Optional[Any] =    '''fp16'''
										self.assertFalse(is_safetensors_compatible(__UpperCamelCase,    variant=__UpperCamelCase      )      )




				def 	__snake_case							(							self	:				List[Any]      ):
										snake_case       :     List[Any] =    [
										    '''text_encoder/pytorch_model.fp16.bin''',
										    '''text_encoder/model.fp16.safetensors''',
										]
										snake_case       :     Union[str, Any] =    '''fp16'''
										self.assertTrue(is_safetensors_compatible(__UpperCamelCase,    variant=__UpperCamelCase      )      )




				def 	__snake_case							(							self	:				Union[str, Any]      ):
										snake_case       :     Any =    [
										    '''text_encoder/pytorch_model.bin''',
										    '''text_encoder/model.safetensors''',
										]
										snake_case       :     List[Any] =    '''fp16'''
										self.assertTrue(is_safetensors_compatible(__UpperCamelCase,    variant=__UpperCamelCase      )      )




				def 	__snake_case							(							self	:				Dict      ):
										snake_case       :     Union[str, 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''',
										]
										snake_case       :     Union[str, Any] =    '''fp16'''
										self.assertFalse(is_safetensors_compatible(__UpperCamelCase,    variant=__UpperCamelCase      )      )



'''simple docstring'''





import pytest

from datasets import inspect_metric, list_metrics, load_metric

@pytest.fixture
def      A (       A_							:					str       ):
						monkeypatch.setattr('''datasets.utils.deprecation_utils._emitted_deprecation_warnings'''    ,							set()       )

@pytest.fixture
def      A (       A_							:					Optional[Any]       ):

						class 						a   :




										def __init__(							self	:				List[str],    SCREAMING_SNAKE_CASE_	:				Optional[Any]      ):
																snake_case       :     List[str] =    metric_id




						class 						a   :
										_snake_case		    = [MetricMock(__magic_name__    ) for metric_id in ['''accuracy''', '''mse''', '''precision''', '''codeparrot/apps_metric''']]




										def 	__snake_case							(							self	:				str      ):
																return self._metrics




						monkeypatch.setattr('''datasets.inspect.huggingface_hub'''    ,							HfhMock()       )





@pytest.mark.parametrize(
    '''func, args'''    ,							[(load_metric, ('''metrics/mse''',)), (list_metrics, ()), (inspect_metric, ('''metrics/mse''', '''tmp_path'''))]       )
def      A (       A_							:					str    ,							A_							:					Dict    ,							A_							:					int    ,							A_							:					int    ,							A_							:					str       ):
						if "tmp_path" in args:
												snake_case       :     List[str] =    tuple(arg if arg != '''tmp_path''' else tmp_path for arg in args       )
						with pytest.warns(A_    ,							match='''https://huggingface.co/docs/evaluate'''       ):
												func(*A_       )

