'''simple docstring'''


import pytest

from datasets import inspect_metric, list_metrics, load_metric





@pytest.fixture
def       lowerCAmelCase					(		UpperCamelCase__				:   Dict       ):


	"""simple docstring"""
	monkeypatch.setattr('''datasets.utils.deprecation_utils._emitted_deprecation_warnings'''    ,					set()       )





@pytest.fixture
def       lowerCAmelCase					(		UpperCamelCase__				:   int       ):


	"""simple docstring"""






	class 						A   :





								def __init__(      self				:							Tuple     ,		__a				:							List[str]	)							->	Tuple:
									__UpperCAmelCase							=			metric_id






	class 						A   :
								a_        =      [MetricMock(UpperCAmelCase   ) for metric_id in ['''accuracy''', '''mse''', '''precision''', '''codeparrot/apps_metric''']]





								def       snake_case__						(      self				:							List[str]	)							->	Tuple:
									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       lowerCAmelCase					(		UpperCamelCase__				:   Optional[Any]    ,					UpperCamelCase__				:   List[str]    ,					UpperCamelCase__				:   Tuple    ,					UpperCamelCase__				:   Dict    ,					UpperCamelCase__				:   Optional[Any]       ):


	"""simple docstring"""
	if "tmp_path" in args:
		__UpperCAmelCase							=			tuple(arg if arg != '''tmp_path''' else tmp_path for arg in args       )
	with pytest.warns(UpperCamelCase__    ,					match='''https://huggingface.co/docs/evaluate'''       ):
		func(*UpperCamelCase__       )

'''simple docstring'''


from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_speech_available, is_torch_available


__lowerCAmelCase	:       List[Any]						       =	{
    "configuration_audio_spectrogram_transformer": [
        "AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "ASTConfig",
    ]
}

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					__lowerCAmelCase	:       str						       =	[
					    "AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST",
					    "ASTForAudioClassification",
					    "ASTModel",
					    "ASTPreTrainedModel",
					]

try:
					if not is_speech_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					__lowerCAmelCase	:       Union[str, Any]						       =	["ASTFeatureExtractor"]

if TYPE_CHECKING:
					from .configuration_audio_spectrogram_transformer import (
					    AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
					    ASTConfig,
					)

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_audio_spectrogram_transformer import (
										    AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
										    ASTForAudioClassification,
										    ASTModel,
										    ASTPreTrainedModel,
										)

					try:
										if not is_speech_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .feature_extraction_audio_spectrogram_transformer import ASTFeatureExtractor


else:
					import sys

					__lowerCAmelCase	:       Optional[Any]						       =	_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)
