


'''simple docstring'''


import pytest

import datasets


# Import fixture modules as plugins
UpperCAmelCase_		:   Any							   =		['tests.fixtures.files', 'tests.fixtures.hub', 'tests.fixtures.fsspec']







def 			snake_case_   (  SCREAMING_SNAKE_CASE__							,      SCREAMING_SNAKE_CASE__     ):







				"""simple docstring"""





				for item in items:
								if any(marker in item.keywords for marker in ["""integration""", """unit"""]     ):
												continue
								item.add_marker(pytest.mark.unit     )







def 			snake_case_   (  SCREAMING_SNAKE_CASE__     ):







				"""simple docstring"""





				config.addinivalue_line("""markers"""							,      """torchaudio_latest: mark test to run with torchaudio>=0.12"""     )







@pytest.fixture(autouse=SCREAMING_SNAKE_CASE__     )
def 			snake_case_   (  SCREAMING_SNAKE_CASE__							,      SCREAMING_SNAKE_CASE__     ):







				"""simple docstring"""





				_SCREAMING_SNAKE_CASE :       Any     		=      tmp_path_factory.getbasetemp() / """cache"""
				_SCREAMING_SNAKE_CASE :       Tuple     		=      test_hf_cache_home / """datasets"""
				_SCREAMING_SNAKE_CASE :       List[str]     		=      test_hf_cache_home / """metrics"""
				_SCREAMING_SNAKE_CASE :       Optional[Any]     		=      test_hf_cache_home / """modules"""
				monkeypatch.setattr("""datasets.config.HF_DATASETS_CACHE"""							,      str(SCREAMING_SNAKE_CASE__     )     )
				monkeypatch.setattr("""datasets.config.HF_METRICS_CACHE"""							,      str(SCREAMING_SNAKE_CASE__     )     )
				monkeypatch.setattr("""datasets.config.HF_MODULES_CACHE"""							,      str(SCREAMING_SNAKE_CASE__     )     )
				_SCREAMING_SNAKE_CASE :       Optional[Any]     		=      test_hf_datasets_cache / """downloads"""
				monkeypatch.setattr("""datasets.config.DOWNLOADED_DATASETS_PATH"""							,      str(SCREAMING_SNAKE_CASE__     )     )
				_SCREAMING_SNAKE_CASE :       int     		=      test_hf_datasets_cache / """downloads""" / """extracted"""
				monkeypatch.setattr("""datasets.config.EXTRACTED_DATASETS_PATH"""							,      str(SCREAMING_SNAKE_CASE__     )     )







@pytest.fixture(autouse=SCREAMING_SNAKE_CASE__							,      scope="""session"""     )
def 			snake_case_   (  ):







				"""simple docstring"""





				datasets.disable_progress_bar()







@pytest.fixture(autouse=SCREAMING_SNAKE_CASE__     )
def 			snake_case_   (  SCREAMING_SNAKE_CASE__     ):







				"""simple docstring"""





				monkeypatch.setattr("""datasets.config.HF_UPDATE_DOWNLOAD_COUNTS"""							,      SCREAMING_SNAKE_CASE__     )







@pytest.fixture
def 			snake_case_   (  SCREAMING_SNAKE_CASE__     ):







				"""simple docstring"""





				monkeypatch.setattr("""sqlalchemy.util.deprecations.SILENCE_UBER_WARNING"""							,      SCREAMING_SNAKE_CASE__     )








'''simple docstring'''


def 			snake_case_   (  SCREAMING_SNAKE_CASE__     ):







				"""simple docstring"""





				_SCREAMING_SNAKE_CASE :       int     		=      0
				while len(SCREAMING_SNAKE_CASE__     ) > 1:
								_SCREAMING_SNAKE_CASE :       Any     		=      0
								# Consider two files with minimum cost to be merged
								for _ in range(2     ):
												_SCREAMING_SNAKE_CASE :       Optional[int]     		=      files.index(min(SCREAMING_SNAKE_CASE__     )     )
												temp += files[min_index]
												files.pop(SCREAMING_SNAKE_CASE__     )
								files.append(SCREAMING_SNAKE_CASE__     )
								optimal_merge_cost += temp
				return optimal_merge_cost


if __name__ == "__main__":
				import doctest

				doctest.testmod()




