<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def repeat(value, times=None, *, interval=0):
 """Generate the same value a given number of times. If ``times`` is ``None``, the value is repeated indefinitely. An optional interval can be given to space the values out. """

    args = () if times is None else (times,)
    it = itertools.repeat(value, *args)
    agen = from_iterable.raw(it)
    return time.spaceout.raw(agen, interval) if interval else agen