
"""simple docstring"""

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






def 							A						(    snake_case				:Tuple    , snake_case				:List[Any]		)				->     int:
 __UpperCamelCase      =	[[float('inf'		) for _ in range(snake_case		)] for _ in range(snake_case		)]

 for i in range(snake_case		):
  for j in range(snake_case		):
   __UpperCamelCase      =	graph[i][j]

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

 _print_dist(snake_case    , snake_case		)
 return dist, v


if __name__ == "__main__":
      UpperCamelCase     :    Union[str, Any]       =			int(input("Enter number of vertices: "))
      UpperCamelCase     :    List[str]       =			int(input("Enter number of edges: "))

      UpperCamelCase     :    Dict       =			[[float("inf") for i in range(v)] for j in range(v)]

      for i in range(v):
            UpperCamelCase     :    str       =			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)
            UpperCamelCase     :    int       =			int(input("Enter source:"))
            UpperCamelCase     :    List[str]       =			int(input("Enter destination:"))
            UpperCamelCase     :    Tuple       =			float(input("Enter weight:"))
            UpperCamelCase     :    List[str]       =			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 unittest import TestCase

from datasets import Dataset
from minhash_deduplication import deduplicate_dataset, make_duplicate_clusters






def 							A						(    )				->     Any:
 __UpperCamelCase      =	{
     'repo_name': ['test_repo1', 'test_repo2', 'test_repo3'],
     'path': ['test_1.py', 'test_2.py', 'unit_test.py'],
     'content': ['a ' * 2_0, 'a ' * 3_0, 'b ' * 7],
 }
 __UpperCamelCase      =	Dataset.from_dict(snake_case		)
 return dataset





class __lowerCAmelCase		(				__SCREAMING_SNAKE_CASE      ):





     def 						UpperCAmelCase (     self				):

      '''simple docstring'''




      __UpperCamelCase      =	get_dataset()
      __UpperCamelCase      =	make_duplicate_clusters(__UpperCAmelCase     ,					0.8_5				)
      self.assertEqual(len(duplicate_clusters[0]				)     ,					2				)







     def 						UpperCAmelCase (     self				):

      '''simple docstring'''




      __UpperCamelCase      =	get_dataset()
      __UpperCamelCase  ,     __UpperCamelCase      =	deduplicate_dataset(__UpperCAmelCase				)
      self.assertEqual(len(__UpperCAmelCase				)     ,					2				)
      print(__UpperCAmelCase				)
      self.assertEqual(duplicate_clusters[0][0]['copies']     ,					2				)
      self.assertEqual(duplicate_clusters[0][0]['is_extreme']     ,					__UpperCAmelCase				)



