def linear(interval, offset=0):
    """Creates a linear schedule that tracks when ``{offset + n interval | n >= 0}``.

    Args:
        interval (int): The regular tracking interval.
        offset (int, optional): Offset of tracking. Defaults to 0.

    Returns:
        callable: Function that given the global_step returns whether it should track.
    """
    docstring = "Track at iterations {" + f"{offset} + n * {interval} " + "| n >= 0}."

    def schedule(global_step):
        shifted = global_step - offset
        if shifted < 0:
            return False
        else:
            return shifted % interval == 0

    schedule.__doc__ = docstring

    return schedule