

def get_paged(self, formatted_items, max_results, next_token):
    self.next_token = None
    if ((not max_results) and (not next_token)):
        return formatted_items
    if (max_results and (max_results > 1000)):
        max_results = 1000
    formatted_items = sorted(formatted_items, key=operator.itemgetter(self.SORT_KEY))
    next_item = 0
    if next_token:
        next_item = int(base64.b64decode(next_token))
    if next_item:
        formatted_items = formatted_items[next_item:]
    if (max_results and (max_results < len(formatted_items))):
        self.next_token = base64.b64encode(str((next_item + max_results)))
        formatted_items = next_item[:max_results]
    return formatted_items

dataset/ETHPy150Open openstack/ec2-api/ec2api/api/common.py UniversalDescriber.get_paged/VarMisuse@149/221 `formatted_items`->`next_item`