@classmethod
    def reshape(cls, results):
        # FIXME: This is dumb because we're changing the shape of the
        # results multiple times in a hokey-pokey kind of way. We
        # should fix this after SUMO is using Elasticsearch 1.x and it
        # probably involves an ElasticUtils rewrite or whatever the
        # next generation is.
        list_keys = cls.list_keys

        # FIXME: This builds a new dict from the old dict. Might be
        # cheaper to do it in-place.
        return [
            dict((key, (val if key in list_keys else val[0]))
                 for key, val in result.items())
            for result in results
        ]
Reshapes the results so lists are lists and everything is not
dataset/ETHPy150Open mozilla/kitsune/kitsune/search/models.py/SearchMappingType.reshape