"""simple docstring"""



__magic_name__    				=					float("inf")

class SCREAMING_SNAKE_CASE     :







 """simple docstring"""


 def __init__(   self		:      Any					,   _snake_case		:      Dict				)				->			str:




    '''simple docstring'''






    a__     				=		[0] * n
    a__     				=		[0] * n
    a__     				=		[0] * n
    a__     				=		[[] for _ in range(_snake_case				)]


 def        _lowerCAmelCase				(   self		:      Union[str, Any]					,   _snake_case		:      List[str]					,   _snake_case		:      Dict					,   _snake_case		:      Union[str, Any]					,   _snake_case		:      Optional[int]=0				)				->			str:




    '''simple docstring'''






    self.adj[a].append([b, len(self.adj[b]				), c, 0]				)
    self.adj[b].append([a, len(self.adj[a]				) - 1, rcap, 0]				)


 def        _lowerCAmelCase				(   self		:      str					,   _snake_case		:      Any					,   _snake_case		:      Optional[Any]					,   _snake_case		:      List[str]				)				->			int:




    '''simple docstring'''






    if vertex == sink or not flow:
       return flow

    for i in range(self.ptr[vertex]					,   len(self.adj[vertex]				)				):
       a__     				=		self.adj[vertex][i]
       if self.lvl[e[0]] == self.lvl[vertex] + 1:
          a__     				=		self.depth_first_search(e[0]					,   _snake_case					,   min(_snake_case					,   e[2] - e[3]				)				)
          if p:
             self.adj[vertex][i][3] += p
             self.adj[e[0]][e[1]][3] -= p
             return p
       a__     				=		self.ptr[vertex] + 1
    return 0



 def        _lowerCAmelCase				(   self		:      List[Any]					,   _snake_case		:      Optional[int]					,   _snake_case		:      Any				)				->			Tuple:




    '''simple docstring'''






    a__				,       a__     				=		0, source
    for l in range(31				):  # noqa: E741  l = 30 maybe faster for random data
       while True:
          a__				,       a__     				=		[0] * len(self.q				), [0] * len(self.q				)
          a__				,       a__				,       a__     				=		0, 1, 1
          while qi < qe and not self.lvl[sink]:
             a__     				=		self.q[qi]
             qi += 1
             for e in self.adj[v]:
                if not self.lvl[e[0]] and (e[2] - e[3]) >> (30 - l):
                   a__     				=		e[0]
                   qe += 1
                   a__     				=		self.lvl[v] + 1

          a__     				=		self.depth_first_search(_snake_case					,   _snake_case					,   _snake_case				)
          while p:
             flow += p
             a__     				=		self.depth_first_search(_snake_case					,   _snake_case					,   _snake_case				)

          if not self.lvl[sink]:
             break

    return flow
__magic_name__    				=					Dinic(10)
__magic_name__    				=					0
__magic_name__    				=					9
for vertex in range(1, 5):
     graph.add_edge(source, vertex, 1)
for vertex in range(5, 9):
     graph.add_edge(vertex, sink, 1)
for vertex in range(1, 5):
     graph.add_edge(vertex, vertex + 4, 1)

# Now we can know that is the maximum flow(source -> sink)
print(graph.max_flow(source, sink))



"""simple docstring"""



import re
import tempfile
import unittest
from pathlib import Path

from datasets.utils.metadata import DatasetMetadata





def   _lowerCamelCase ( UpperCAmelCase__					)							->     str:


   '''simple docstring'''


   a__     				=		min(re.search('^ +',UpperCAmelCase__					).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(UpperCAmelCase__					)]					)


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

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


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




class SCREAMING_SNAKE_CASE     (    unittest.TestCase	):







 """simple docstring"""


 def        _lowerCAmelCase				(   self		:      Tuple				)				->			Dict:




    '''simple docstring'''






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

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

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



 def        _lowerCAmelCase				(   self		:      List[Any]				)				->			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(_snake_case				)

    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(_snake_case				):
       DatasetMetadata.from_yaml_string(_snake_case				)

    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(_snake_case				)


