


'''simple docstring'''






import pytest

from datasets import inspect_metric, list_metrics, load_metric





@pytest.fixture
def      UpperCAmelCase      (		lowerCamelCase_  :str ):







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





@pytest.fixture
def      UpperCAmelCase      (		lowerCamelCase_  :Any ):







		'''simple docstring'''
		class 						__UpperCamelCase	:





									def __init__(  self		:Any  ,_UpperCamelCase		:int			):
											snake_case_		:							Optional[int]			       =						metric_id





		class 						__UpperCamelCase	:
									lowercase			:		Optional[Any]   		=  [MetricMock(lowercase__							) for metric_id in ['accuracy', 'mse', 'precision', 'codeparrot/apps_metric']]





									def 		a__   (  self		:List[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      UpperCAmelCase      (		lowerCamelCase_  :Tuple				,      lowerCamelCase_  :Optional[Any]				,      lowerCamelCase_  :Optional[Any]				,      lowerCamelCase_  :str				,      lowerCamelCase_  :Tuple ):







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



'''simple docstring'''






def      UpperCAmelCase      (		lowerCamelCase_  :int ):







		'''simple docstring'''
		if num < 0:
				return False

		snake_case_		:							int			       =						num
		snake_case_		:							int			       =						0
		while num > 0:
				snake_case_		:							Tuple			       =						rev_num * 10 + (num % 10)
				num //= 10

		return num_copy == rev_num


if __name__ == "__main__":
							import doctest

							doctest.testmod()