  
      def get_limit(self, request):
          if self.limit_query_param:
              try:
                  return _strict_positive_int(
                      request.query_params[self.limit_query_param],
                      cutoff=self.max_limit
                  )
              except (KeyError, ValueError):
                  pass
 
</s> remove                 return _strict_positive_int(
 </s> add                 return _positive_int( </s> remove             return _strict_positive_int(
 </s> add             return _positive_int( </s> remove Cursor = namedtuple('Cursor', ['offset', 'reverse', 'position'])


def decode_cursor(encoded):
    try:
        querystring = b64decode(encoded.encode('ascii')).decode('ascii')
        tokens = urlparse.parse_qs(querystring, keep_blank_values=True)
        offset = int(tokens['offset'][0])
        reverse = bool(int(tokens['reverse'][0]))
        position = tokens['position'][0]
    except (TypeError, ValueError):
        return None

    return Cursor(offset=offset, reverse=reverse, position=position)


def encode_cursor(cursor):
    tokens = {
        'offset': str(cursor.offset),
        'reverse': '1' if cursor.reverse else '0',
        'position': cursor.position
    }
    querystring = urlparse.urlencode(tokens, doseq=True)
    return b64encode(querystring.encode('ascii')).decode('ascii')


 </s> add  </s> remove def _strict_positive_int(integer_string, cutoff=None):
 </s> add def _positive_int(integer_string, strict=False, cutoff=None):
                return _positive_int(
  
      def get_limit(self, request):
          if self.limit_query_param:
              try:
                return _positive_int(
                      request.query_params[self.limit_query_param],
                      cutoff=self.max_limit
                  )
              except (KeyError, ValueError):
                  pass
keep keep keep keep replace keep keep keep keep keep
 Support for tuple ordering in cursor pagination 
rest_framework/pagination.py