





"""simple docstring"""





def      UpperCAmelCase__				(    SCREAMING_SNAKE_CASE	:		Optional[Any]				,		SCREAMING_SNAKE_CASE	:		List[Any]     ):







      '''simple docstring'''




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


def      UpperCAmelCase__				(    SCREAMING_SNAKE_CASE	:		Optional[int]				,		SCREAMING_SNAKE_CASE	:		str     ):







      '''simple docstring'''




      lowerCAmelCase    		=			[[float("""inf"""     ) for _ in range(SCREAMING_SNAKE_CASE     )] for _ in range(SCREAMING_SNAKE_CASE     )]

      for i in range(SCREAMING_SNAKE_CASE     ):
            for j in range(SCREAMING_SNAKE_CASE     ):
                  lowerCAmelCase    		=			graph[i][j]

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

      _print_dist(SCREAMING_SNAKE_CASE				,		SCREAMING_SNAKE_CASE     )
      return dist, v


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

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

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





def      UpperCAmelCase__				(    SCREAMING_SNAKE_CASE	:		str     ):







      '''simple docstring'''




      lowerCAmelCase    		=			""""""
      for ch in key:
            if ch == " " or ch not in key_no_dups and ch.isalpha():
                  key_no_dups += ch
      return key_no_dups


def      UpperCAmelCase__				(    SCREAMING_SNAKE_CASE	:		str     ):







      '''simple docstring'''




      lowerCAmelCase    		=			[chr(i + 65     ) for i in range(26     )]
      # Remove duplicate characters from key
      lowerCAmelCase    		=			remove_duplicates(key.upper()     )
      lowerCAmelCase    		=			len(SCREAMING_SNAKE_CASE     )
      # First fill cipher with key characters
      lowerCAmelCase    		=			{alphabet[i]: char for i, char in enumerate(SCREAMING_SNAKE_CASE     )}
      # Then map remaining characters in alphabet to
      # the alphabet from the beginning
      for i in range(len(SCREAMING_SNAKE_CASE     )				,		26     ):
            lowerCAmelCase    		=			alphabet[i - offset]
            # Ensure we are not mapping letters to letters previously mapped
            while char in key:
                  offset -= 1
                  lowerCAmelCase    		=			alphabet[i - offset]
            lowerCAmelCase    		=			char
      return cipher_alphabet


def      UpperCAmelCase__				(    SCREAMING_SNAKE_CASE	:		str				,		SCREAMING_SNAKE_CASE	:		dict[str, str]     ):







      '''simple docstring'''




      return "".join(cipher_map.get(SCREAMING_SNAKE_CASE				,		SCREAMING_SNAKE_CASE     ) for ch in message.upper()     )


def      UpperCAmelCase__				(    SCREAMING_SNAKE_CASE	:		str				,		SCREAMING_SNAKE_CASE	:		dict[str, str]     ):







      '''simple docstring'''




      lowerCAmelCase    		=			{v: k for k, v in cipher_map.items()}
      return "".join(rev_cipher_map.get(SCREAMING_SNAKE_CASE				,		SCREAMING_SNAKE_CASE     ) for ch in message.upper()     )


def      UpperCAmelCase__				(    ):







      '''simple docstring'''




      lowerCAmelCase    		=			input("""Enter message to encode or decode: """     ).strip()
      lowerCAmelCase    		=			input("""Enter keyword: """     ).strip()
      lowerCAmelCase    		=			input("""Encipher or decipher? E/D:"""     ).strip()[0].lower()
      try:
            lowerCAmelCase    		=			{"""e""": encipher, """d""": decipher}[option]
      except KeyError:
            raise KeyError("""invalid input option"""     )
      lowerCAmelCase    		=			create_cipher_map(SCREAMING_SNAKE_CASE     )
      print(func(SCREAMING_SNAKE_CASE				,		SCREAMING_SNAKE_CASE     )     )


if __name__ == "__main__":
       import doctest

       doctest.testmod()
       main()






