






import math


class       __lowercase      :







     '''simple docstring'''




     def __init__(				self       :			Dict ,	UpperCamelCase_       :			Union[str, Any]=0				):  # a graph with Node 0,1,...,N-1


         """simple docstring"""



         __A         =	n
         __A         =	[
             [math.inf for j in range(0 ,	UpperCamelCase_				)] for i in range(0 ,	UpperCamelCase_				)
         ]  # adjacency matrix for weight
         __A         =	[
             [math.inf for j in range(0 ,	UpperCamelCase_				)] for i in range(0 ,	UpperCamelCase_				)
         ]  # dp[i][j] stores minimum distance from i to j




     def 		lowerCAmelCase_     (				self       :			Any ,	UpperCamelCase_       :			int ,	UpperCamelCase_       :			Optional[int] ,	UpperCamelCase_       :			List[str]				):


         """simple docstring"""



         __A         =	w




     def 		lowerCAmelCase_     (				self       :			List[str]				):


         """simple docstring"""



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





     def 		lowerCAmelCase_     (				self       :			Union[str, Any] ,	UpperCamelCase_       :			Union[str, Any] ,	UpperCamelCase_       :			str				):


         """simple docstring"""



         return self.dp[u][v]


if __name__ == "__main__":
  __a      :       Optional[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)












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


try:
  if not (is_transformers_available() and is_torch_available()):
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  from ...utils.dummy_torch_and_transformers_objects import (
      ImageTextPipelineOutput,
      UniDiffuserPipeline,
  )
else:
  from .modeling_text_decoder import UniDiffuserTextDecoder
  from .modeling_uvit import UniDiffuserModel, UTransformeraDModel
  from .pipeline_unidiffuser import ImageTextPipelineOutput, UniDiffuserPipeline




