def parent_panel(decision_class, resampling_panel):
    """Using the parental interpretation of resampling records given by
    the decision_class, convert resampling records in a resampling
    panel to parent indices.

    Parameters
    ----------
    decision_class : class implementing Decision interface
        The class that interprets resampling records for parental relationships.
    resampling_panel : list of list of list of namedtuple records
        Panel of resampling records.

    Returns
    -------
    parent_panel : list of list of list of int
        A structured list of the same for as the resampling panel,
        with parent indices swapped for resampling records.

    """

    parent_panel_in = []
    for cycle in resampling_panel:

        # each stage in the resampling for that cycle
        # make a stage parent table
        parent_table = []

        # now iterate through the rest of the stages
        for step in cycle:

            # get the parents idxs for the children of this step
            step_parents = decision_class.parents(step)

            # for the full stage table save all the intermediate parents
            parent_table.append(step_parents)

        # for the full parent panel
        parent_panel_in.append(parent_table)

    return parent_panel_in