def get_child_parents(edges):
    """Puts each non-parent node together with its parents

    Parameters
    ----------
    edges : list
        A list of tuples corresponding to the Bayesian network structure as described in the input file 

    Returns
    -------
    child_parents
        A dictionary with non-parent nodes as keys and their parents as values
    """
    child_parents = {}
    for e in edges:
        if e[1] in child_parents.keys():
            child_parents[e[1]].append(e[0])
        else:
            child_parents[e[1]] = [e[0]]
    return child_parents