human
Complete this python program:
def cosine(w, A=1, phi=0, offset=0):
assistant
#Here is the Python code you requested.

    """Return a driver function that can advance a sequence of cosine values.
    .. code-block:: none
    value = A * cos(w*i + phi) + offset
    Args:
    w (float) : a frequency for the cosine driver
    A (float) : an amplitude for the cosine driver
    phi (float) : a phase offset to start the cosine driver with
    offset (float) : a global offset to add to the driver values
    """
    from math import cos
    def f(i):
        return ((A * cos(((w * i) + phi))) + offset)
    return partial(_force, sequence=_advance(f))