def partition_probes_and_true_rel_by_split(probes, true_relatives, fid_splits):
    """
    Separate probes and true relatives by split.

    Parameters
    ---------------
    probe:
        A dictionary mapping from FID to a probe MID.
    true_relatives:
        A dictionary mapping from FID to a list of true relatives.
    fid_splits:
        A dataframe with columns [FID, set], which indicates the split each
        FID belongs to.

    Returns
    ----------------
    probes_by_split:
        A dictionary with keys being splits, and the values being the split original probe dict.
        As a concrete example, we turn probes = {"F0002: F0002/MID1", "F0003: F0003/MID4" ...}
        into {"train": {"F0002: F0002/MID1"}, "test": {"F0003: F0003/MID4"}.

    true_relatives_by_split:
        A dictionary with keys being splits, and the values being the split original true relatives
        dict. Exactly what happens to probes_by_split.
    """
    split_names = fid_splits["set"].unique()
    probes_by_split = {}
    true_relatives_by_split = {}

    for split_name in split_names:
        fids_in_split = fid_splits[fid_splits["set"].eq(split_name)].FID.values
        probes_by_split[split_name] = {fid: probes[fid] for fid in fids_in_split}
        true_relatives_by_split[split_name] = {
            fid: true_relatives[fid] for fid in fids_in_split
        }

    return probes_by_split, true_relatives_by_split