Returns an iterator that yields each step and it's direct
    dependencies.

def each_step(graph):
    """Returns an iterator that yields each step and it's direct
    dependencies.
    """

    steps = graph.topological_sort()
    steps.reverse()

    for step in steps:
        deps = graph.downstream(step.name)
        yield (step, deps)