def get_all_predecessors(graph, node, start_node=0):
    """
    Find all predecessor nodes of node in graph, given the
    start_node.

    Parameters
    ----------
    graph: nx.DiGraph
    node: abc.hashable
    start_node: abc.hashable
    """
    predecessors = [node]
    while True:
        pre_node = list(graph.predecessors(predecessors[-1]))[0]
        predecessors.append(pre_node)
        if pre_node == start_node:
            break
    predecessors.reverse()
    return predecessors