Returns: a dictionary of outputs mapped to inputs
    Note that an output is either a target or a leaf node in the
        step tree

def get_drake_data(steps):
    """
    Returns: a dictionary of outputs mapped to inputs
    Note that an output is either a target or a leaf node in the
        step tree
    """
    output_inputs = {}
    if len(steps) == 0:
        return output_inputs

    for step in steps:
        output_inputs[step] = get_inputs(step, target=True)

    # recursively do the same for all the inputs
    inputs = set(itertools.chain(*output_inputs.values()))
    o = get_drake_data(inputs)
    output_inputs.update(o)

    return output_inputs