






from ...utils import (
    OptionalDependencyNotAvailable,
    is_torch_available,
    is_transformers_available,
    is_transformers_version,
)


try:
	if not (is_transformers_available() and is_torch_available() and is_transformers_version('''>=''', '''4.25.0''')):
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	from ...utils.dummy_torch_and_transformers_objects import UnCLIPImageVariationPipeline, UnCLIPPipeline
else:
	from .pipeline_unclip import UnCLIPPipeline
	from .pipeline_unclip_image_variation import UnCLIPImageVariationPipeline
	from .text_proj import UnCLIPTextProjModel







import math

class 						lowerCAmelCase   :

					'''simple docstring'''

					def __init__(     self :		Tuple						,   __a :		int=0							)	->     Optional[Any]:  # a graph with Node 0,1,...,N-1


												"""simple docstring"""

												__lowercase					:							Any			=   n
												__lowercase					:							Optional[int]			=   [
												    [math.inf for j in range(0						,   __a							)] for i in range(0						,   __a							)
												]  # adjacency matrix for weight
												__lowercase					:							Dict			=   [
												    [math.inf for j in range(0						,   __a							)] for i in range(0						,   __a							)
												]  # dp[i][j] stores minimum distance from i to j



					def 					lowerCAmelCase (     self :		int						,   __a :		Optional[int]						,   __a :		Tuple						,   __a :		Dict							)	->     Dict:


												"""simple docstring"""

												__lowercase					:							Any			=   w



					def 					lowerCAmelCase (     self :		List[str]							)	->     Tuple:


												"""simple docstring"""

												for k in range(0						,   self.n							):
																			for i in range(0						,   self.n							):
																										for j in range(0						,   self.n							):
																																	__lowercase					:							List[str]			=   min(self.dp[i][j]						,   self.dp[i][k] + self.dp[k][j]							)



					def 					lowerCAmelCase (     self :		Any						,   __a :		Any						,   __a :		str							)	->     int:


												"""simple docstring"""

												return self.dp[u][v]


if __name__ == "__main__":
	lowerCamelCase       :       int        =				Graph(5)
	graph.add_edge(0, 2, 9)
	graph.add_edge(0, 4, 10)
	graph.add_edge(1, 3, 5)
	graph.add_edge(2, 3, 7)
	graph.add_edge(3, 0, 10)
	graph.add_edge(3, 1, 2)
	graph.add_edge(3, 2, 1)
	graph.add_edge(3, 4, 6)
	graph.add_edge(4, 1, 3)
	graph.add_edge(4, 2, 4)
	graph.add_edge(4, 3, 9)
	graph.floyd_warshall()
	graph.show_min(1, 4)
	graph.show_min(0, 3)