
"""simple docstring"""

import pytest

import datasets


# Import fixture modules as plugins
UpperCamelCase     :    List[Any]       =			["tests.fixtures.files", "tests.fixtures.hub", "tests.fixtures.fsspec"]






def 							A						(    snake_case				:Optional[Any]    , snake_case				:Dict		)				->     str:
 # Mark tests as "unit" by default if not marked as "integration" (or already marked as "unit")
 for item in items:
  if any(marker in item.keywords for marker in ['integration', 'unit']		):
   continue
  item.add_marker(pytest.mark.unit		)






def 							A						(    snake_case				:Tuple		)				->     Optional[Any]:
 config.addinivalue_line('markers'    , 'torchaudio_latest: mark test to run with torchaudio>=0.12'		)






@pytest.fixture(autouse=snake_case		)
def 							A						(    snake_case				:int    , snake_case				:Optional[int]		)				->     Dict:
 # test_hf_cache_home = tmp_path_factory.mktemp("cache")  # TODO: why a cache dir per test function does not work?
 __UpperCamelCase      =	tmp_path_factory.getbasetemp() / 'cache'
 __UpperCamelCase      =	test_hf_cache_home / 'datasets'
 __UpperCamelCase      =	test_hf_cache_home / 'metrics'
 __UpperCamelCase      =	test_hf_cache_home / 'modules'
 monkeypatch.setattr('datasets.config.HF_DATASETS_CACHE'    , str(snake_case		)		)
 monkeypatch.setattr('datasets.config.HF_METRICS_CACHE'    , str(snake_case		)		)
 monkeypatch.setattr('datasets.config.HF_MODULES_CACHE'    , str(snake_case		)		)
 __UpperCamelCase      =	test_hf_datasets_cache / 'downloads'
 monkeypatch.setattr('datasets.config.DOWNLOADED_DATASETS_PATH'    , str(snake_case		)		)
 __UpperCamelCase      =	test_hf_datasets_cache / 'downloads' / 'extracted'
 monkeypatch.setattr('datasets.config.EXTRACTED_DATASETS_PATH'    , str(snake_case		)		)






@pytest.fixture(autouse=snake_case    , scope='session'		)
def 							A						(    )				->     Tuple:
 datasets.disable_progress_bar()






@pytest.fixture(autouse=snake_case		)
def 							A						(    snake_case				:List[str]		)				->     str:
 # don't take tests into account when counting downloads
 monkeypatch.setattr('datasets.config.HF_UPDATE_DOWNLOAD_COUNTS'    , snake_case		)






@pytest.fixture
def 							A						(    snake_case				:Union[str, Any]		)				->     Optional[Any]:
 # Required to suppress RemovedIn20Warning when feature(s) are not compatible with SQLAlchemy 2.0
 # To be removed once SQLAlchemy 2.0 supported
 monkeypatch.setattr('sqlalchemy.util.deprecations.SILENCE_UBER_WARNING'    , snake_case		)





"""simple docstring"""

import heapq as hq
import math
from collections.abc import Iterator

class __lowerCAmelCase		:





     def __init__(     self     ,					__UpperCAmelCase				):

      '''simple docstring'''




      __UpperCamelCase      =	str(id_				)
      __UpperCamelCase      =	None
      __UpperCamelCase      =	None
      __UpperCamelCase      =	[]
      __UpperCamelCase      =	{}  # {vertex:distance}





     def __lt__(     self     ,					__UpperCAmelCase				):

      '''simple docstring'''




      return self.key < other.key





     def __repr__(     self				):

      '''simple docstring'''




      return self.id





     def 						UpperCAmelCase (     self     ,					__UpperCAmelCase				):

      '''simple docstring'''




      self.neighbors.append(__UpperCAmelCase				)







     def 						UpperCAmelCase (     self     ,					__UpperCAmelCase     ,					__UpperCAmelCase				):

      '''simple docstring'''




      __UpperCamelCase      =	weight






def 							A						(    snake_case				:List[Any]    , snake_case				:Dict    , snake_case				:Any    , snake_case				:str		)				->     List[str]:
 # add the neighbors:
 graph[a - 1].add_neighbor(graph[b - 1]		)
 graph[b - 1].add_neighbor(graph[a - 1]		)
 # add the edges:
 graph[a - 1].add_edge(graph[b - 1]    , snake_case		)
 graph[b - 1].add_edge(graph[a - 1]    , snake_case		)






def 							A						(    snake_case				:list    , snake_case				:Vertex		)				->     list:
 __UpperCamelCase      =	[]
 for u in graph:
  __UpperCamelCase      =	math.inf
  __UpperCamelCase      =	None
 __UpperCamelCase      =	0
 __UpperCamelCase      =	graph[:]
 while q:
  __UpperCamelCase      =	min(snake_case		)
  q.remove(snake_case		)
  for v in u.neighbors:
   if (v in q) and (u.edges[v.id] < v.key):
    __UpperCamelCase      =	u
    __UpperCamelCase      =	u.edges[v.id]
 for i in range(1    , len(snake_case		)		):
  a.append((int(graph[i].id		) + 1, int(graph[i].pi.id		) + 1)		)
 return a






def 							A						(    snake_case				:list    , snake_case				:Vertex		)				->     Iterator[tuple]:
 for u in graph:
  __UpperCamelCase      =	math.inf
  __UpperCamelCase      =	None
 __UpperCamelCase      =	0

 __UpperCamelCase      =	list(snake_case		)
 hq.heapify(snake_case		)

 while h:
  __UpperCamelCase      =	hq.heappop(snake_case		)
  for v in u.neighbors:
   if (v in h) and (u.edges[v.id] < v.key):
    __UpperCamelCase      =	u
    __UpperCamelCase      =	u.edges[v.id]
    hq.heapify(snake_case		)

 for i in range(1    , len(snake_case		)		):
  yield (int(graph[i].id		) + 1, int(graph[i].pi.id		) + 1)






def 							A						(    )				->     None:
 pass


if __name__ == "__main__":
      import doctest

      doctest.testmod()



