human
I found an interesting problem on https://www.codewars.com/kata/5aaea7a25084d71006000082:
A "graph" consists of "nodes", also known as "vertices". Nodes may or may not be connected with one another. 
In our definition below the node "A0" is connected with the node "A3", but "A0" is not connected with "A1".

The connecting line between two nodes is called an edge. If the edges between the nodes are undirected, 
the graph is called an undirected graph. A weighted graph is a graph in which a number (the weight) is assigned to each edge.
A graph is acyclic if it has no loop.

A graph can be represented as a dictionary:

`graph = {'A0': [('A3', 1), ('A5', 4)], 
 'A1': [('A2', 2)], 
 'A2': [('A1', 1), ('A2', 2), ('A3', 1), ('A4', 1)],
 'A3': [('A0', 1), ('A2', 1)], 
 'A4': [('A2', 1), ('A4', 1)], 
 'A5': [('A3', 3)]
}`

Here the nodes are A0...A5.
following each nodes is the edges list of linked nodes with their weight.
A0 is linked to A3 with a weight of 1 and to A5 with weight 4. A dictionary is not ordered but the list
of linked nodes is sorted. So: 

`'A0': [('A3', 1), ('A5', 4)]`is correct but `'A0': [('A5', 4), ('A3', 1)]`is not.

The edges E of a graph G induce a binary relation that is called the adjacency relation of G.
One can associate an adjacency matrix:

`M = 
[[0, 0, 0, 1, 0, 4], 
 [0, 0, 2, 0, 0, 0], 
 [0, 1, 2, 1, 1, 0], 
 [1, 0, 1, 0, 0, 0], 
 [0, 0, 1, 0, 1, 0], 
 [0, 0, 0, 3, 0, 0]]`

Let us imagine that lines are numbered from A0 to A5 and the same for columns.
The first line correspond to A0 and we can see that A0 is connected to A3 with weight 1, A0 is also connected to A5 with weight 4.

Another way is to use an adjacency list: An adjacency list representation for a graph 
associates each vertex in the graph with the collection of its neighboring edges:

`L = [['A0', [('A3', 1), ('A5', 4)]], 
     ['A1', [('A2', 2)]], 
     ['A2', [('A1', 1), ('A2', 2), ('A3', 1), ('A4', 1)]], 
     ['A3', [('A0', 1), ('A2', 1)]], 
     ['A4', [('A2', 1), ('A4', 1)]], 
     ['A5', [('A3', 3)]]] `

L is sorted in order A0 to A5 and each sublist is sorted as in a graph dictionary.

In the kata...

I tried it in Python, but could not do it. Can you solve it?

Give me a the Python code you requested?
assistant
#Here is the Python code you requested.

class Graph():

    def __init__(self, vertices_num):
        self.v = vertices_num
        self.nodes = [f'A{n}' for n in range(vertices_num)]

    # adjacency matrix to dictionary
    def adjmat_2_graph(self, adjm):
        return {
            self.nodes[src_index]: [
                (self.nodes[dst_index], weight)
                for dst_index, weight in enumerate(weights)
                if weight > 0
            ]
            for src_index, weights in enumerate(adjm)
            if any(weight > 0 for weight in weights)
        }
        
    # dictionary to adjacency matrix
    def graph_2_mat(self, graph):
        result = [[0 for _ in range(self.v)] for _ in range(self.v)]
        for src, edges in graph.items():
            src_index = self.nodes.index(src)
            for dst, weight in edges:
                dst_index = self.nodes.index(dst)
                result[src_index][dst_index] = weight
        return result
    
    # dictionary to adjacency list    
    def graph_2_list(self, graph):
        return sorted([
            [src, edges]
            for src, edges in graph.items()
        ], key=lambda x: x[0])
        
    # adjacency list to dictionary
    def list_2_graph(self, lst):
        return {
            src: edges
            for src, edges in lst
        }
        
    # adjacency matrix to adjacency list    
    def mat_2_list(self, mat):
        return self.graph_2_list(self.adjmat_2_graph(mat))
    
    # adjacency list to adjacency matrix
    def list_2_mat(self, lst):
        return self.graph_2_mat(self.list_2_graph(lst))
        
    # all paths from node start_vertex to node end_vertex
    def find_all_paths(self, graph, start_vertex, end_vertex, seen=None):
        if start_vertex == end_vertex and seen is None: # Non-recursive case only
            return [start_vertex]

        if seen is None:
            seen = set()
        seen = seen | {start_vertex}
        next_options = [dst for dst, weight in graph.get(start_vertex, []) if dst not in seen]
        paths = [
    ...