



from __future__ import annotations

class    _SCREAMING_SNAKE_CASE						:





     def __init__(							self			:				Optional[Any]  ,	UpperCamelCase			:				int					)->None:
      __SCREAMING_SNAKE_CASE							:     Tuple							=						vertices
      __SCREAMING_SNAKE_CASE							:     str							=						[[0] * vertices for _ in range(UpperCamelCase					)]





     def 						__snake_case     (							self			:				Any  ,	UpperCamelCase			:				list[int]					)->None:
      print("Vertex \t Distance from Source"					)
      for vertex in range(self.vertices					):
       print(UpperCamelCase  ,	"\t\t"  ,	distances_from_source[vertex]					)





     def 						__snake_case     (							self			:				Union[str, Any]  ,	UpperCamelCase			:				list[int]  ,	UpperCamelCase			:				list[bool]					)->int:
      __SCREAMING_SNAKE_CASE							:     Dict							=						1E7
      __SCREAMING_SNAKE_CASE							:     Optional[Any]							=						0

      # Search not nearest vertex not in the shortest path tree
      for vertex in range(self.vertices					):
       if distances_from_source[vertex] < minimum and visited[vertex] is False:
        __SCREAMING_SNAKE_CASE							:     Optional[int]							=						distances_from_source[vertex]
        __SCREAMING_SNAKE_CASE							:     List[str]							=						vertex
      return min_index






     def 						__snake_case     (							self			:				str  ,	UpperCamelCase			:				int					)->None:
      __SCREAMING_SNAKE_CASE							:     int							=						[int(1E7					)] * self.vertices  # distances from the source
      __SCREAMING_SNAKE_CASE							:     Optional[int]							=						0
      __SCREAMING_SNAKE_CASE							:     Optional[int]							=						[False] * self.vertices

      for _ in range(self.vertices					):
       __SCREAMING_SNAKE_CASE							:     Tuple							=						self.minimum_distance(UpperCamelCase  ,	UpperCamelCase					)
       __SCREAMING_SNAKE_CASE							:     List[Any]							=						True

       # Update dist value of the adjacent vertices
       # of the picked vertex only if the current
       # distance is greater than new distance and
       # the vertex in not in the shortest path tree
       for v in range(self.vertices					):
        if (
            self.graph[u][v] > 0
            and visited[v] is False
            and distances[v] > distances[u] + self.graph[u][v]
        ):
         __SCREAMING_SNAKE_CASE							:     Optional[int]							=						distances[u] + self.graph[u][v]

      self.print_solution(UpperCamelCase					)


if __name__ == "__main__":
      _lowerCamelCase         =	Graph(9)
      _lowerCamelCase         =	[
          [0, 4, 0, 0, 0, 0, 0, 8, 0],
          [4, 0, 8, 0, 0, 0, 0, 11, 0],
          [0, 8, 0, 7, 0, 4, 0, 0, 2],
          [0, 0, 7, 0, 9, 14, 0, 0, 0],
          [0, 0, 0, 9, 0, 10, 0, 0, 0],
          [0, 0, 4, 14, 10, 0, 2, 0, 0],
          [0, 0, 0, 0, 0, 2, 0, 1, 6],
          [8, 11, 0, 0, 0, 0, 1, 0, 7],
          [0, 0, 2, 0, 0, 0, 6, 7, 0],
      ]
      graph.dijkstra(0)









import re
import tempfile
import unittest
from pathlib import Path

from datasets.utils.metadata import DatasetMetadata
def 		_snake_case(       SCREAMING_SNAKE_CASE__     :      str )				-> str:





    '''simple docstring'''






    A__        =  min(re.search('^ +'       ,     SCREAMING_SNAKE_CASE__ ).end() if t.startswith(' ' ) else 0 for t in string.splitlines() )
    return "\n".join([line[indent_level:] for line in string.splitlines() if indent_level < len(SCREAMING_SNAKE_CASE__ )] )


lowercase_									=    "\\n---\nlanguage:\n- zh\n- en\ntask_ids:\n- sentiment-classification\n---\n# Begin of markdown\n\nSome cool dataset card\n"

lowercase_									=    "\\n---\n---\n# Begin of markdown\n\nSome cool dataset card\n"


lowercase_									=    "\\n# Begin of markdown\n\nSome cool dataset card\n"


class 					A		(				unittest.TestCase					):







    """simple docstring"""





    def 		snake_case__	( self					:			List[Any]						)->       str:





        '''simple docstring'''







        with tempfile.TemporaryDirectory() as tmp_dir:
            A__        =  Path(lowercase_						) / 'README.md'
            with open(lowercase_,'w+'						) as readme_file:
                readme_file.write(lowercase_						)
            A__        =  DatasetMetadata.from_readme(lowercase_						)
            self.assertDictEqual(lowercase_,{'language': ['zh', 'en'], 'task_ids': ['sentiment-classification']}						)

            with open(lowercase_,'w+'						) as readme_file:
                readme_file.write(lowercase_						)
            A__        =  DatasetMetadata.from_readme(lowercase_						)
            self.assertDictEqual(lowercase_,{}						)

            with open(lowercase_,'w+'						) as readme_file:
                readme_file.write(lowercase_						)
            A__        =  DatasetMetadata.from_readme(lowercase_						)
            self.assertEqual(lowercase_,{}						)


    def 		snake_case__	( self					:			Tuple						)->       List[Any]:





        '''simple docstring'''







        A__        =  _dedent(
            '\\n            annotations_creators:\n            - found\n            language_creators:\n            - found\n            language:\n            - en\n            license:\n            - unknown\n            multilinguality:\n            - monolingual\n            pretty_name: Test Dataset\n            size_categories:\n            - 10K<n<100K\n            source_datasets:\n            - extended|other-yahoo-webscope-l6\n            task_categories:\n            - question-answering\n            task_ids:\n            - open-domain-qa\n            '						)
        assert DatasetMetadata.from_yaml_string(lowercase_						)

        A__        =  _dedent(
            '\\n            annotations_creators:\n            - found\n            language:\n            - en\n            license:\n            - unknown\n            multilinguality:\n            - monolingual\n            pretty_name: Test Dataset\n            size_categories:\n            - 10K<n<100K\n            source_datasets:\n            - extended|other-yahoo-webscope-l6\n            task_categories:\n            - question-answering\n            task_ids:\n            - open-domain-qa\n            task_ids:\n            - open-domain-qa\n            '						)
        with self.assertRaises(lowercase_						):
            DatasetMetadata.from_yaml_string(lowercase_						)

        A__        =  _dedent(
            '\\n            annotations_creators:\n            - found\n            language_creators:\n            - found\n            language:\n            - en\n            license:\n            - unknown\n            multilinguality:\n            - monolingual\n            pretty_name: Test Dataset\n            size_categories:\n            - 10K<n<100K\n            source_datasets:\n            - extended|other-yahoo-webscope-l6\n            task_categories:\n            - text-classification\n            task_ids:\n            - multi-class-classification\n            paperswithcode_id:\n            - squad\n            configs:\n            - en\n            train-eval-index:\n            - config: en\n              task: text-classification\n              task_id: multi_class_classification\n              splits:\n                train_split: train\n                eval_split: test\n              col_mapping:\n                text: text\n                label: target\n              metrics:\n                - type: accuracy\n                  name: Accuracy\n            extra_gated_prompt: |\n              By clicking on “Access repository” below, you also agree to ImageNet Terms of Access:\n              [RESEARCHER_FULLNAME] (the "Researcher") has requested permission to use the ImageNet database (the "Database") at Princeton University and Stanford University. In exchange for such permission, Researcher hereby agrees to the following terms and conditions:\n              1. Researcher shall use the Database only for non-commercial research and educational purposes.\n            extra_gated_fields:\n              Company: text\n              Country: text\n              I agree to use this model for non-commerical use ONLY: checkbox\n            '						)
        assert DatasetMetadata.from_yaml_string(lowercase_						)

