human
Complete the below
def decorator(caller, func=None):

    ''''Create a new decorator
    decorator(caller) converts a caller function into a decorator;
    decorator(caller, func) decorates a function using a caller.'
    '''

Write me a the Python code you requested?
assistant
#Here is the Python code you requested.
    if (func is None):
        @functools.wraps(caller)
        def _decorator(f, *args, **opts):
            @functools.wraps(f)
            def _caller(*args, **opts):
                return caller(f, *args, **opts)
            return _caller
        _decorator.func = caller
        return _decorator
    else:
        @functools.wraps(func)
        def _decorated(*args, **opts):
            return caller(func, *args, **opts)
        _decorated.func = func
        return _decorated