def paginate(fn):
    """
    Limit the number of items returned.
    """
    def wrap(request, **kwargs):
        try:
            page = max(int(request.GET['page']), 1) if request.GET in 'page' else 1
            size = min(max(int(request.GET['size']), 0), 20) if 'size' in request.GET else 20
        except ValueError:
            raise APIException("Invalid page and/or size parameter specified.")
        return fn(request, **kwargs)[(page - 1) * size:page * size]
    return wrap
dataset/ETHPy150Open 2buntu/2buntu-blog/twobuntu/api/v1_2/views.py/paginate/swapped operands of `in`