




"""simple docstring"""

def       snake_case__	(       lowerCAmelCase   :		Tuple				,					lowerCAmelCase   :		List[Any]		):
					print("""\nVertex Distance"""		)
					for i in range(lowerCAmelCase		):
										if dist[i] != float("""inf"""		):
															print(lowerCAmelCase				,					"""\t"""				,					int(dist[i]		)				,					end="""\t"""		)
										else:
															print(lowerCAmelCase				,					"""\t"""				,					"""INF"""				,					end="""\t"""		)
										print()




def       snake_case__	(       lowerCAmelCase   :		List[str]				,					lowerCAmelCase   :		Any				,					lowerCAmelCase   :		Optional[int]		):
					__snake_case          =	float("""inf"""		)
					__snake_case          =	-1
					for i in range(lowerCAmelCase		):
										if (not vset[i]) and mdist[i] < min_val:
															__snake_case          =	i
															__snake_case          =	mdist[i]
					return min_ind




def       snake_case__	(       lowerCAmelCase   :		Union[str, Any]				,					lowerCAmelCase   :		str				,					lowerCAmelCase   :		List[Any]		):
					__snake_case          =	[float("""inf"""		) for _ in range(lowerCAmelCase		)]
					__snake_case          =	[False for _ in range(lowerCAmelCase		)]
					__snake_case          =	0.0

					for _ in range(v - 1		):
										__snake_case          =	min_dist(lowerCAmelCase				,					lowerCAmelCase				,					lowerCAmelCase		)
										__snake_case          =	True

										for i in range(lowerCAmelCase		):
															if (
															    (not vset[i])
															    and graph[u][i] != float("""inf"""		)
															    and mdist[u] + graph[u][i] < mdist[i]
															):
																				__snake_case          =	mdist[u] + graph[u][i]

					print_dist(lowerCAmelCase				,					lowerCAmelCase		)


if __name__ == "__main__":
		UpperCamelCase__ :    Optional[int] 					=							int(input("Enter number of vertices: ").strip())
		UpperCamelCase__ :    Dict 					=							int(input("Enter number of edges: ").strip())

		UpperCamelCase__ :    Optional[Any] 					=							[[float("inf") for i in range(V)] for j in range(V)]

		for i in range(V):
				UpperCamelCase__ :    Tuple 					=							0.0

		for i in range(E):
				print("\nEdge ", i + 1)
				UpperCamelCase__ :    List[Any] 					=							int(input("Enter source:").strip())
				UpperCamelCase__ :    Tuple 					=							int(input("Enter destination:").strip())
				UpperCamelCase__ :    Any 					=							float(input("Enter weight:").strip())
				UpperCamelCase__ :    Tuple 					=							weight

		UpperCamelCase__ :    Optional[Any] 					=							int(input("\nEnter shortest path source:").strip())
		dijkstra(graph, V, gsrc)












"""simple docstring"""

import json
import os
from dataclasses import dataclass

import numpy as np
import pyarrow as pa

import datasets
from utils import get_duration


UpperCamelCase__ :    Optional[int] 					=							10_00_00_00_00_00
UpperCamelCase__ :    int 					=							1_00_00

UpperCamelCase__					,					UpperCamelCase__ :    List[str] 					=							os.path.split(__file__)
UpperCamelCase__ :    Any 					=							os.path.join(RESULTS_BASEPATH, "results", RESULTS_FILENAME.replace(".py", ".json"))




def       snake_case__	(       lowerCAmelCase   :		int				,					lowerCAmelCase   :		int		):
					__snake_case          =	pa.Table.from_pydict({"""col""": [0] * chunk_size}		)
					__snake_case          =	pa.concat_tables([table] * (num_examples // chunk_size)		)
					return datasets.Dataset(lowerCAmelCase				,					fingerprint="""table_100B"""		)
@dataclass
class     A__      :
	A_							:				int
	A_							:				int
	A_							:				int
	A_							:				int




	def 							a_		(   self  :	Optional[Any]	)					-> Any:
						__snake_case          =	np.random.default_rng(self.seed	)
						__snake_case          =	rng.integers(low=self.low      ,    high=self.high      ,    size=self.size	).tolist()




	def __iter__(   self  :	str	)					-> int:
						return iter(self._sampled_values	)




	def __len__(   self  :	Union[str, Any]	)					-> Any:
						return self.size




@get_duration
def       snake_case__	(       lowerCAmelCase   :		datasets.Dataset		):
					__snake_case          =	dataset[0]




@get_duration
def       snake_case__	(       lowerCAmelCase   :		datasets.Dataset		):
					__snake_case          =	dataset[-1]




@get_duration
def       snake_case__	(       lowerCAmelCase   :		datasets.Dataset		):
					__snake_case          =	dataset[range(len(lowerCAmelCase		) // 2				,					len(lowerCAmelCase		) // 2 + 1_024		)]




@get_duration
def       snake_case__	(       lowerCAmelCase   :		datasets.Dataset		):
					__snake_case          =	dataset[RandIter(0				,					len(lowerCAmelCase		)				,					1_024				,					seed=42		)]




def       snake_case__	(       ):
					__snake_case          =	{"""num examples""": SPEED_TEST_N_EXAMPLES}
					__snake_case          =	(get_first_row, get_last_row, get_batch_of_aaaa_rows, get_batch_of_aaaa_random_rows)
					print("""generating dataset"""		)
					__snake_case          =	generate_100B_dataset(num_examples=lowerCAmelCase				,					chunk_size=lowerCAmelCase		)
					print("""Functions"""		)
					for func in functions:
										print(func.__name__		)
										__snake_case          =	func(lowerCAmelCase		)

					with open(lowerCAmelCase				,					"""wb"""		) as f:
										f.write(json.dumps(lowerCAmelCase		).encode("""utf-8"""		)		)


if __name__ == "__main__":  # useful to run the profiler
		benchmark_table_100B()


