      if ret <= 0:
          raise ValueError()
      return ret
  
  def get_object_or_404(queryset, **filter_kwargs):
      """
 
</s> remove def strict_positive_int(integer_string):
 </s> add def strict_positive_int(integer_string, cutoff=None): </s> remove         if self.max_paginate_by:
            return min(self.max_paginate_by, self.paginate_by)
        else:
            return self.paginate_by
 </s> add         return self.paginate_by </s> remove             else:
                if self.max_paginate_by is not None:
                    return min(self.max_paginate_by, paginate_by_param)
                else:
                    return paginate_by_param
 </s> add  </s> remove                 paginate_by_param = int(query_params[self.paginate_by_param])
 </s> add                 return strict_positive_int(
                    self.request.QUERY_PARAMS[self.paginate_by_param],
                    cutoff=self.max_paginate_by
                ) </s> remove         self.assertEqual(response.data['results'], self.data[:3])
 </s> add         self.assertEqual(response.data['results'], self.data[:5])
    if cutoff:
        ret = min(ret, cutoff)
      if ret <= 0:
          raise ValueError()
    if cutoff:
        ret = min(ret, cutoff)
      return ret
  
  def get_object_or_404(queryset, **filter_kwargs):
      """
keep add keep keep keep keep
 Tweak MAX_PAGINATE_BY behavior in edge case.

Always respect `paginate_by` settings if client does not specify page
size.  (Even if the developer has misconfigured, so that `paginate_by >
max`.) 
rest_framework/generics.py