<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def constant(interval=1):
 """Generator for constant intervals. Args: interval: A constant value to yield or an iterable of such values. """

    try:
        itr = iter(interval)
    except TypeError:
        itr = itertools.repeat(interval)

    for val in itr:
        yield val