def get_path(parents, end):
    """
    Returns a list starting with the start node implied by the parents dictionary,
    and ending with the specified end node.

    If no path exists, returns an empty list.

    Parameters:
        parents - a dictionary rooted at an arbitrary graph node, "start".
                    parents[start] = None
                    parents[some_other_node] = preceding node on shortest path
                    from start to some_other_node
        end - the node we want to find the path to
    """
    path = [end]
    if end in parents:
        endpar = parents[end]
    else:
        return path
    while not endpar == None:
        path.append(endpar)
        endpar = parents[endpar]
    path.reverse()
    return path