import pytest

from datasets import inspect_metric, list_metrics, load_metric



@pytest.fixture
def lowerCamelCase						(     SCREAMING_SNAKE_CASE			):
    '''simple docstring'''







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



@pytest.fixture
def lowerCamelCase						(     SCREAMING_SNAKE_CASE			):
    '''simple docstring'''







    class 			lowerCamelCase_  :






        '''simple docstring'''






        def __init__(			self				,				__lowercase) ->			Dict:
            __UpperCamelCase  :Optional[int]    						=	metric_id


    class 			lowerCamelCase_  :






        '''simple docstring'''






        a__			:		List[str]      			=   [MetricMock(UpperCAmelCase_				) for metric_id in ["""accuracy""", """mse""", """precision""", """codeparrot/apps_metric"""]]







        def     UpperCamelCase__     (			self) ->			Union[str, Any]:
            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						(     SCREAMING_SNAKE_CASE						,    SCREAMING_SNAKE_CASE						,    SCREAMING_SNAKE_CASE						,    SCREAMING_SNAKE_CASE						,    SCREAMING_SNAKE_CASE			):
    '''simple docstring'''







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






from typing import TYPE_CHECKING

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


__lowercase											=      {
    '''configuration_audio_spectrogram_transformer''': [
        '''AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''ASTConfig''',
    ]
}

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

try:
    if not is_speech_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    __lowercase											=      ['''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

    __lowercase											=      _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)





