

"""simple docstring"""




from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__UpperCAmelCase			=					{'configuration_ibert': ['IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'IBertConfig', 'IBertOnnxConfig']}

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      __UpperCAmelCase			=					[
          'IBERT_PRETRAINED_MODEL_ARCHIVE_LIST',
          'IBertForMaskedLM',
          'IBertForMultipleChoice',
          'IBertForQuestionAnswering',
          'IBertForSequenceClassification',
          'IBertForTokenClassification',
          'IBertModel',
          'IBertPreTrainedModel',
      ]

if TYPE_CHECKING:
      from .configuration_ibert import IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, IBertConfig, IBertOnnxConfig

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_ibert import (
                IBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
                IBertForMaskedLM,
                IBertForMultipleChoice,
                IBertForQuestionAnswering,
                IBertForSequenceClassification,
                IBertForTokenClassification,
                IBertModel,
                IBertPreTrainedModel,
            )

else:
      import sys

      __UpperCAmelCase			=					_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)








"""simple docstring"""


UpperCAmelCase													=[
    [0, 16, 13, 0, 0, 0],
    [0, 0, 10, 12, 0, 0],
    [0, 4, 0, 0, 14, 0],
    [0, 0, 9, 0, 0, 20],
    [0, 0, 0, 7, 0, 4],
    [0, 0, 0, 0, 0, 0],
]



def   _A					(	_a	:						Dict     ,   _a	:						int     ,   _a	:						Dict     ,   _a	:						List[Any]				):



      """simple docstring"""






      A				  =		[False] * len(_a				)
      A				  =		[s]
      A				  =		True

      while queue:
            A				  =		queue.pop(0				)
            for ind in range(len(graph[u]				)				):
                  if visited[ind] is False and graph[u][ind] > 0:
                        queue.append(_a				)
                        A				  =		True
                        A				  =		u

      return visited[t]



def   _A					(	_a	:						str     ,   _a	:						Optional[Any]     ,   _a	:						Optional[int]				):



      """simple docstring"""






      A				  =		[-1] * (len(_a				))
      A				  =		0
      A				  =		[]
      A				  =		[i[:] for i in graph]  # Record original cut, copy.
      while bfs(_a     ,   _a     ,   _a     ,   _a				):
            A				  =		float("""Inf"""				)
            A				  =		sink

            while s != source:
                  # Find the minimum value in select path
                  A				  =		min(_a     ,   graph[parent[s]][s]				)
                  A				  =		parent[s]

            max_flow += path_flow
            A				  =		sink

            while v != source:
                  A				  =		parent[v]
                  graph[u][v] -= path_flow
                  graph[v][u] += path_flow
                  A				  =		parent[v]

      for i in range(len(_a				)				):
            for j in range(len(graph[0]				)				):
                  if graph[i][j] == 0 and temp[i][j] > 0:
                        res.append((i, j)				)

      return res


if __name__ == "__main__":
  print(mincut(test_graph, source=0, sink=5))




