human
I am working on the file "20170913_python_decorator_contextmanager/decorator_and_contextmanager.ipynb".
The first task is:
Supplement: pass argument with decorator
如果執行 function 需要參數, 記得在 decorator 裡包裝 function 的時候也一並要傳入
Can you write Python code for it?
 What is a the Python code you requested?
assistant
#Here is the Python code you requested.

import time
from functools import wraps

def deco(func):
    @wraps(func)
    def wrapped(*args, **kwargs):
        print('Before func')
        print('---')
        print('{} argument:\nargs = {}\nkwargs = {}\n'.format(
            func.__name__, args, kwargs
        ))
        func(*args, **kwargs)
        print('---')
        print('After func')
    return wrapped

@deco
def f1(*args, **kwargs):
    print('This is f1 function')
    
f1(1, '2', [3], {'4': 4}, time=time.ctime())