human
Write me a the Python code you requested given the following:
Complete the below
def inthread(func):

    ''''Decorator to call a function in a thread and return a deferred with the
    result'
    '''
assistant
#Here is the Python code you requested.
    @wraps(func)
    def wrapped(*a, **kw):
        return threads.deferToThread(func, *a, **kw)
    return wrapped