
def     UpperCAmelCase_  (						__lowerCAmelCase	,					__lowerCAmelCase	) ->						List[str]:
    print('''\nThe shortest path matrix using Floyd Warshall algorithm\n'''	)
    for i in range(__lowerCAmelCase	):
        for j in range(__lowerCAmelCase	):
            if dist[i][j] != float('''inf'''	):
                print(int(dist[i][j]	)	,					end='''\t'''	)
            else:
                print('''INF'''	,					end='''\t'''	)
        print()


def     UpperCAmelCase_  (						__lowerCAmelCase	,					__lowerCAmelCase	) ->						Tuple:
    __lowercase		:			str	    =       [[float('''inf'''	) for _ in range(__lowerCAmelCase	)] for _ in range(__lowerCAmelCase	)]

    for i in range(__lowerCAmelCase	):
        for j in range(__lowerCAmelCase	):
            __lowercase		:			int	    =       graph[i][j]

            # check vertex k against all other vertices (i, j)
    for k in range(__lowerCAmelCase	):
        # looping through rows of graph array
        for i in range(__lowerCAmelCase	):
            # looping through columns of graph array
            for j in range(__lowerCAmelCase	):
                if (
                    dist[i][k] != float('''inf'''	)
                    and dist[k][j] != float('''inf'''	)
                    and dist[i][k] + dist[k][j] < dist[i][j]
                ):
                    __lowercase		:			Any	    =       dist[i][k] + dist[k][j]

    _print_dist(__lowerCAmelCase	,					__lowerCAmelCase	)
    return dist, v


if __name__ == "__main__":
 __lowerCAmelCase					:			Optional[int]			      =		int(input("Enter number of vertices: "))
 __lowerCAmelCase					:			Tuple			      =		int(input("Enter number of edges: "))

 __lowerCAmelCase					:			Any			      =		[[float("inf") for i in range(v)] for j in range(v)]

 for i in range(v):
  __lowerCAmelCase					:			List[Any]			      =		0.0

  # src and dst are indices that must be within the array size graph[e][v]
  # failure to follow this will result in an error
 for i in range(e):
  print("\nEdge ", i + 1)
  __lowerCAmelCase					:			List[Any]			      =		int(input("Enter source:"))
  __lowerCAmelCase					:			Optional[int]			      =		int(input("Enter destination:"))
  __lowerCAmelCase					:			str			      =		float(input("Enter weight:"))
  __lowerCAmelCase					:			Union[str, Any]			      =		weight

 floyd_warshall(graph, v)

 # Example Input
 # Enter number of vertices: 3
 # Enter number of edges: 2

 # # generated graph from vertex and edge inputs
 # [[inf, inf, inf], [inf, inf, inf], [inf, inf, inf]]
 # [[0.0, inf, inf], [inf, 0.0, inf], [inf, inf, 0.0]]

 # specify source, destination and weight for edge #1
 # Edge  1
 # Enter source:1
 # Enter destination:2
 # Enter weight:2

 # specify source, destination and weight for edge #2
 # Edge  2
 # Enter source:2
 # Enter destination:1
 # Enter weight:1

 # # Expected Output from the vertice, edge and src, dst, weight inputs!!
 # 0		INF	INF
 # INF	0	2
 # INF	1	0




import itertools
from dataclasses import dataclass
from typing import Optional

import pandas as pd
import pyarrow as pa

import datasets
from datasets.table import table_cast


@dataclass
class 						__lowerCAmelCase	(	datasets.BuilderConfig      ):



      """simple docstring"""







      A__	:			Optional[datasets.Features]        =    None






class 						__lowerCAmelCase	(	datasets.ArrowBasedBuilder      ):



      """simple docstring"""







      A__	:			List[str]        =    PandasConfig




      def 		snake_case_			(      self		:       int				):
          return datasets.DatasetInfo(features=self.config.features				)




      def 		snake_case_			(      self		:       int				,       _snake_case		:       Optional[int]				):
          if not self.config.data_files:
              raise ValueError(F'At least one data file must be specified, but got data_files={self.config.data_files}'				)
          __lowercase		:			Any	    =       dl_manager.download_and_extract(self.config.data_files				)
          if isinstance(_snake_case				,       (str, list, tuple)				):
              __lowercase		:			str	    =       data_files
              if isinstance(_snake_case				,       _snake_case				):
                  __lowercase		:			Any	    =       [files]
              # Use `dl_manager.iter_files` to skip hidden files in an extracted archive
              __lowercase		:			Optional[int]	    =       [dl_manager.iter_files(_snake_case				) for file in files]
              return [datasets.SplitGenerator(name=datasets.Split.TRAIN				,       gen_kwargs={'''files''': files}				)]
          __lowercase		:			str	    =       []
          for split_name, files in data_files.items():
              if isinstance(_snake_case				,       _snake_case				):
                  __lowercase		:			str	    =       [files]
              # Use `dl_manager.iter_files` to skip hidden files in an extracted archive
              __lowercase		:			int	    =       [dl_manager.iter_files(_snake_case				) for file in files]
              splits.append(datasets.SplitGenerator(name=_snake_case				,       gen_kwargs={'''files''': files}				)				)
          return splits




      def 		snake_case_			(      self		:       Optional[int]				,       _snake_case		:       pa.Table				):
          if self.config.features is not None:
              # more expensive cast to support nested features with keys in a different order
              # allows str <-> int/float or str to Audio for example
              __lowercase		:			List[str]	    =       table_cast(_snake_case				,       self.config.features.arrow_schema				)
          return pa_table




      def 		snake_case_			(      self		:       int				,       _snake_case		:       Union[str, Any]				):
          for i, file in enumerate(itertools.chain.from_iterable(_snake_case				)				):
              with open(_snake_case				,       '''rb'''				) as f:
                  __lowercase		:			Dict	    =       pa.Table.from_pandas(pd.read_pickle(_snake_case				)				)
                  yield i, self._cast_table(_snake_case				)


