def process_data(data_list, process_by_line=False):
    """Process a list of extractions into a dictionary of `loc` and `text`
    organized by `frame`

    Parameters
    ----------
    data_list : list
        A list of extractions created by
        :meth:`panoptes_aggregation.extractors.poly_line_text_extractor.poly_line_text_extractor`

    Returns
    -------
    processed_data : dict
        A dictionary with keys for each `frame` of the subject and values being dictionaries
        with `x`, `y`, `text`, and `slope` keys. `x`, `y`, and `text` are list-of-lists, each inner
        list is from a single annotaiton, `slope` is the list of slopes (in deg) for each of these
        inner lists.
    """
    data_by_frame = {}
    for data_index, data in enumerate(data_list):
        for frame, value in data.items():
            gs = value.get('gold_standard', False)
            data_by_frame.setdefault(frame, {})
            data_by_frame[frame].setdefault('x', [])
            data_by_frame[frame].setdefault('y', [])
            data_by_frame[frame].setdefault('text', [])
            data_by_frame[frame].setdefault('slope', [])
            data_by_frame[frame].setdefault('gold_standard', [])
            data_by_frame[frame].setdefault('data_index', [])
            for x, y, t, s in zip(value['points']['x'], value['points']['y'
                ], value['text'], value['slope']):
                if process_by_line:
                    data_by_frame[frame]['x'].append([x[0], x[-1]])
                    data_by_frame[frame]['y'].append([y[0], y[-1]])
                    data_by_frame[frame]['text'].append([' '.join(t)])
                else:
                    data_by_frame[frame]['x'].append(x)
                    data_by_frame[frame]['y'].append(y)
                    data_by_frame[frame]['text'].append(t)
                data_by_frame[frame]['slope'].append(s)
                data_by_frame[frame]['gold_standard'].append(gs)
                data_by_frame[frame]['data_index'].append(data_index)
    return data_by_frame
