<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cutoff(poly, *args):
 """ 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: [q1^3+1, q0+q1^2, q0^2+q1, q0^3+1] [1, q0+q1^2, q0^2+q1, 1] [0, q0+q1^2, q0^2+q1, 0] """

    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)