def _transform_summarized_rep(summarized_rep):
    """change around the keys of the summarized_representation dictionary

    This makes them more readable

    This function makes strong assumptions about what the keys look like
    (see PooledVentralStreams.summarize_representation for more info on this):
    a single string or tuples of the form `(a, b)`, `(a, b, c), or `((a,
    b, c), d)`, where all of `a,b,c,d` are strings or ints. We convert
    them as follows (single strings are untouched):
    - `(a, b) -> error_a_b`
    - `(a, b, c) -> error_a_scale_b_band_c`
    - `((a, b, c), d) -> error_a_scale_b_band_c_d`

    Parameters
    ----------
    summarized_rep : dict
        the dictionary whose keys we want to remap.

    Returns
    -------
    summarized_rep : dict
        dictionary with keys remapped

    """
    new_summarized_rep = {}
    for k, v in summarized_rep.items():
        if not isinstance(k, tuple):
            new_summarized_rep["error_" + k] = v
        elif isinstance(k[0], tuple):
            new_summarized_rep["error_scale_{}_band_{}_{}".format(*k[0], k[1])] = v
        else:
            if len(k) == 2:
                new_summarized_rep["error_scale_{}_band_{}".format(*k)] = v
            else:
                new_summarized_rep['error_' + '_'.join(k)] = v
    return new_summarized_rep