code: def cutoff(poly, *args):
      
      if len(args) == 1:
          low, high = 0, args[0]
      else:
          low, high = args[:2]
  
      core_old = poly.A
      core_new = {}
      for key in poly.keys:
          if low <= numpy.sum(key) < high:
              core_new[key] = core_old[key]
      return Poly(core_new, poly.dim, poly.shape, poly.dtype)
docs: Remove polynomial components with order outside a given interval.
  
      Args:
          poly (Poly):
              Input data.
          low (int):
              The lowest order that is allowed to be included. Defaults to 0.
          high (int):
              The upper threshold for the cutoff range.
  
      Returns:
          (Poly):
              The same as `P`, except that all terms that have a order not within
              the bound `low <= order < high` are removed.
  
      Examples:
          >>> poly = chaospy.prange(4, 1) + chaospy.prange(4, 2)[::-1]
          >>> print(poly) # doctest: +SKIP
          [q1^3+1, q0+q1^2, q0^2+q1, q0^3+1]
          >>> print(chaospy.cutoff(poly, 3)) # doctest: +SKIP
          [1, q0+q1^2, q0^2+q1, 1]
          >>> print(chaospy.cutoff(poly, 1, 3)) # doctest: +SKIP
          [0, q0+q1^2, q0^2+q1, 0]