'Retrieves results from redis and the fallback datasource'

def get_results(self, start, stop):

    if (stop is not None):
        redis_results = self.get_redis_results(start, (stop - 1))
        required_items = (stop - start)
        enough_results = (len(redis_results) == required_items)
        assert (len(redis_results) <= required_items), ('we    should    never    have    more    than    we    ask    for,    start    %s,    stop    %s' % (start, stop))
    else:
        redis_results = self.get_redis_results(start, stop)
        enough_results = True
    if ((not redis_results) or (not enough_results)):
        self.source = 'fallback'
        filtered = getattr(self, '_filtered', False)
        db_results = self.get_fallback_results(start, stop)
        if ((start == 0) and (not redis_results) and (not filtered)):
            logger.info('setting    cache    for    type    %s    with    len    %s', self.get_key(), len(db_results))
            self.cache(db_results)
        elif ((start == 0) and redis_results and (not filtered)):
            logger.info('overwriting    cache    for    type    %s    with    len    %s', self.get_key(), len(db_results))
            self.overwrite(db_results)
        results = db_results
        logger.info(('retrieved    %s    to    %s    from    db    and    not    from    cache    with    key    %s' % (start, stop, self.get_key())))
    else:
        results = redis_results
        logger.info(('retrieved    %s    to    %s    from    cache    on    key    %s' % (start, stop, self.get_key())))
    return results
