  
      # Now sort the page numbers and drop anything outside the limits.
      included = [
          idx for idx in sorted(list(included))
          if idx > 0 and idx <= final
      ]
  
      # Finally insert any `...` breaks
      if current > 4:
          included.insert(1, None)
 
</s> remove         ret = min(ret, cutoff)
 </s> add         return min(ret, cutoff) </s> remove     return code >= 400 and code <= 499
 </s> add     return 400 <= code <= 499 </s> remove     return code >= 300 and code <= 399
 </s> add     return 300 <= code <= 399 </s> remove     return code >= 200 and code <= 299
 </s> add     return 200 <= code <= 299 </s> remove     return code >= 100 and code <= 199
 </s> add     return 100 <= code <= 199
        if 0 < idx <= final
  
      # Now sort the page numbers and drop anything outside the limits.
      included = [
          idx for idx in sorted(list(included))
        if 0 < idx <= final
      ]
  
      # Finally insert any `...` breaks
      if current > 4:
          included.insert(1, None)
keep keep keep keep replace keep keep keep keep keep
 Simplified chained comparisons and minor code fixes (#5276) 
rest_framework/pagination.py