






"""simple docstring"""



from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


A__			:							Optional[int]					   =   {
    'configuration_altclip': [
        'ALTCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'AltCLIPConfig',
        'AltCLIPTextConfig',
        'AltCLIPVisionConfig',
    ],
    'processing_altclip': ['AltCLIPProcessor'],
}

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						A__			:							int					   =   [
						    'ALTCLIP_PRETRAINED_MODEL_ARCHIVE_LIST',
						    'AltCLIPPreTrainedModel',
						    'AltCLIPModel',
						    'AltCLIPTextModel',
						    'AltCLIPVisionModel',
						]


if TYPE_CHECKING:
						from .configuration_altclip import (
						    ALTCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP,
						    AltCLIPConfig,
						    AltCLIPTextConfig,
						    AltCLIPVisionConfig,
						)
						from .processing_altclip import AltCLIPProcessor

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_altclip import (
												    ALTCLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
												    AltCLIPModel,
												    AltCLIPPreTrainedModel,
												    AltCLIPTextModel,
												    AltCLIPVisionModel,
												)


else:
						import sys

						A__			:							str					   =   _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)







def     lowercase	(    a     , a     , a     , a ):



		'''simple docstring'''




		SCREAMING_SNAKE_CASE_				:int				     =						[False] * len(a )
		SCREAMING_SNAKE_CASE_				:List[Any]				     =						[]
		queue.append(a )
		SCREAMING_SNAKE_CASE_				:int				     =						True

		while queue:
				SCREAMING_SNAKE_CASE_				:int				     =						queue.pop(0 )
				for ind in range(len(graph[u] ) ):
						if visited[ind] is False and graph[u][ind] > 0:
								queue.append(a )
								SCREAMING_SNAKE_CASE_				:Tuple				     =						True
								SCREAMING_SNAKE_CASE_				:Optional[int]				     =						u

		return visited[t]


def     lowercase	(    a     , a     , a ):



		'''simple docstring'''




		SCREAMING_SNAKE_CASE_				:Any				     =						[-1] * (len(a ))
		SCREAMING_SNAKE_CASE_				:Tuple				     =						0
		while bfs(a     , a     , a     , a ):
				SCREAMING_SNAKE_CASE_				:List[Any]				     =						float("Inf" )
				SCREAMING_SNAKE_CASE_				:str				     =						sink

				while s != source:
						# Find the minimum value in select path
						SCREAMING_SNAKE_CASE_				:str				     =						min(a     , graph[parent[s]][s] )
						SCREAMING_SNAKE_CASE_				:Optional[Any]				     =						parent[s]

				max_flow += path_flow
				SCREAMING_SNAKE_CASE_				:Dict				     =						sink

				while v != source:
						SCREAMING_SNAKE_CASE_				:int				     =						parent[v]
						graph[u][v] -= path_flow
						graph[v][u] += path_flow
						SCREAMING_SNAKE_CASE_				:Any				     =						parent[v]
		return max_flow


SCREAMING_SNAKE_CASE__     					=			[
    [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],
]

SCREAMING_SNAKE_CASE__					,    SCREAMING_SNAKE_CASE__     					=			0, 5
print(ford_fulkerson(graph, source, sink))






