




"""simple docstring"""





def 					_UpperCamelCase    (			UpperCamelCase				,       UpperCamelCase							)			->			List[str]:


			"""simple docstring"""
			print("\nThe shortest path matrix using Floyd Warshall algorithm\n"							)
			for i in range(UpperCamelCase							):
						for j in range(UpperCamelCase							):
									if dist[i][j] != float("inf"							):
												print(int(dist[i][j]							)				,       end="\t"							)
									else:
												print("INF"				,       end="\t"							)
						print()

def 					_UpperCamelCase    (			UpperCamelCase				,       UpperCamelCase							)			->			Optional[int]:


			"""simple docstring"""
			__UpperCAmelCase	: Optional[Any]		=					[[float("inf"							) for _ in range(UpperCamelCase							)] for _ in range(UpperCamelCase							)]

			for i in range(UpperCamelCase							):
						for j in range(UpperCamelCase							):
									__UpperCAmelCase	: Any		=					graph[i][j]

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

			_print_dist(UpperCamelCase				,       UpperCamelCase							)
			return dist, v


if __name__ == "__main__":
			A   =       int(input("""Enter number of vertices: """))
			A   =       int(input("""Enter number of edges: """))

			A   =       [[float("""inf""") for i in range(v)] for j in range(v)]

			for i in range(v):
						A   =       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)
						A   =       int(input("""Enter source:"""))
						A   =       int(input("""Enter destination:"""))
						A   =       float(input("""Enter weight:"""))
						A   =       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








"""simple docstring"""





from typing import Optional

import pyspark

from .. import Features, NamedSplit
from ..download import DownloadMode
from ..packaged_modules.spark.spark import Spark
from .abc import AbstractDatasetReader



class      a__				(	__magic_name__   ):


			def __init__(      self      :    List[Any]      ,  UpperCamelCase_      :    pyspark.sql.DataFrame      ,  UpperCamelCase_      :    Optional[NamedSplit] = None      ,  UpperCamelCase_      :    Optional[Features] = None      ,  UpperCamelCase_      :    bool = True      ,  UpperCamelCase_      :    str = None      ,  UpperCamelCase_      :    bool = False      ,  UpperCamelCase_      :    str = None      ,  UpperCamelCase_      :    bool = True      ,  UpperCamelCase_      :    str = "arrow"      ,  **UpperCamelCase_      :    Tuple      ,  ):


						"""simple docstring"""




						super().__init__(
						    split=UpperCamelCase_      ,  features=UpperCamelCase_      ,  cache_dir=UpperCamelCase_      ,  keep_in_memory=UpperCamelCase_      ,  streaming=UpperCamelCase_      ,  **UpperCamelCase_      ,  )
						__UpperCAmelCase	: List[Any]		=					load_from_cache_file
						__UpperCAmelCase	: List[Any]		=					file_format
						__UpperCAmelCase	: str		=					Spark(
						    df=UpperCamelCase_      ,  features=UpperCamelCase_      ,  cache_dir=UpperCamelCase_      ,  working_dir=UpperCamelCase_      ,  **UpperCamelCase_      ,  )


			def       a_     (      self      :    Union[str, Any]):


						"""simple docstring"""




						if self.streaming:
									return self.builder.as_streaming_dataset(split=self.split)
						__UpperCAmelCase	: List[Any]		=					None if self._load_from_cache_file else DownloadMode.FORCE_REDOWNLOAD
						self.builder.download_and_prepare(
						    download_mode=UpperCamelCase_      ,  file_format=self._file_format      ,  )
						return self.builder.as_dataset(split=self.split)


