human
Complete this python program:
def delayed(function, check_pickle=True):
assistant
#Here is the Python code you requested.

    """Decorator used to capture the arguments of a function.
    Pass `check_pickle=False` when:
    - performing a possibly repeated check is too costly and has been done
    already once outside of the call to delayed.
    - when used in conjunction `Parallel(backend=\threading\)`.
    """
    if check_pickle:
        pickle.dumps(function)
    def delayed_function(*args, **kwargs):
        return (function, args, kwargs)
    try:
        delayed_function = functools.wraps(function)(delayed_function)
    except AttributeError:
        '    functools.wraps    fails    on    some    callable    objects    '
    return delayed_function