



'''simple docstring'''


from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_lowerCamelCase	:       Optional[int]      	=	{
    "configuration_jukebox": [
        "JUKEBOX_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "JukeboxConfig",
        "JukeboxPriorConfig",
        "JukeboxVQVAEConfig",
    ],
    "tokenization_jukebox": ["JukeboxTokenizer"],
}

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _lowerCamelCase	:       int      	=	[
       "JUKEBOX_PRETRAINED_MODEL_ARCHIVE_LIST",
       "JukeboxModel",
       "JukeboxPreTrainedModel",
       "JukeboxVQVAE",
       "JukeboxPrior",
   ]

if TYPE_CHECKING:
   from .configuration_jukebox import (
       JUKEBOX_PRETRAINED_CONFIG_ARCHIVE_MAP,
       JukeboxConfig,
       JukeboxPriorConfig,
       JukeboxVQVAEConfig,
   )
   from .tokenization_jukebox import JukeboxTokenizer

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_jukebox import (
          JUKEBOX_PRETRAINED_MODEL_ARCHIVE_LIST,
          JukeboxModel,
          JukeboxPreTrainedModel,
          JukeboxPrior,
          JukeboxVQVAE,
      )

else:
   import sys

   _lowerCamelCase	:       Optional[int]      	=	_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)






'''simple docstring'''


import math

class  SCREAMING_SNAKE_CASE :






    """simple docstring"""





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


       """simple docstring"""







       UpperCamelCase					=  n
       UpperCamelCase					=  [
           [math.inf for j in range(0  ,						UpperCamelCase__ )] for i in range(0  ,						UpperCamelCase__ )
       ]  # adjacency matrix for weight
       UpperCamelCase					=  [
           [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  A       (  self      :					Optional[Any]  ,						UpperCamelCase__      :					Union[str, Any]  ,						UpperCamelCase__      :					Union[str, Any]  ,						UpperCamelCase__      :					Tuple ):


       """simple docstring"""







       UpperCamelCase					=  w






    def  A       (  self      :					str ):


       """simple docstring"""







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






    def  A       (  self      :					Optional[Any]  ,						UpperCamelCase__      :					str  ,						UpperCamelCase__      :					List[Any] ):


       """simple docstring"""







       return self.dp[u][v]


if __name__ == "__main__":
   _lowerCamelCase	:       List[str]      	=	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)

