def METHOD_NAME(self, data):
    if 'data' not in data:
        return {'data': []}
    results = getattr(self, 'results', None)
    if results is not None:
        data['data'][:] = data['data'][:results]
    # Horrible hack to support AKAs.
        data['data'] = [x for x in data['data'] if x[0] and x[1]]
    if data and data['data'] and len(data['data'][0]) == 4 and isinstance(data['data'][0], tuple):
        for idx, datum in enumerate(data['data']):
            if not isinstance(datum, tuple):
                continue
            if not datum[0] and datum[1]:
                continue
            if datum[2] is not None:
                akas = [aka[1:-1] for aka in datum[2]]  # remove the quotes
                datum[1]['akas'] = akas
            if datum[3] is not None:
                datum[1][self.img_type] = datum[3]
            data['data'][idx] = (datum[0], datum[1])
    return data