def trim(self, max_length=None):
        key = self.get_key()
        if max_length is None:
            max_length = self.max_length

        # map things to the funny redis syntax
        if self.sort_asc:
            begin = max_length
            end = -1
        else:
            begin = 0
            end = (max_length * -1) - 1

        removed = self.redis.zremrangebyrank(key, begin, end)
        logger.info('cleaning up the sorted set %s to a max of %s items' %
                    (key, max_length))
        return removed
Similar to *can_convert_to*, but in reverse.  Only needed if
dataset/ETHPy150Open tschellenbach/Stream-Framework/stream_framework/storage/redis/structures/sorted_set.py/RedisSortedSetCache.trim--crossover with--dataset/ETHPy150Open numba/numba/numba/types/abstract.py/Type.can_convert_from