human
I wrote the below code

    def decorator(func):
        @functools.wraps(func)
        def wrapper(*args, **kwargs):
            key = '{0}:{1}:{2}:{3}'.format(id(func), func.__name__, args, kwargs)
            if (key in _thread_by_func):
                worker = _thread_by_func[key]
            else:
                worker = ThreadMethod(func, args, kwargs)
                _thread_by_func[key] = worker
            worker.join(timeout)
            if worker.is_alive():
                raise TimeoutException()
            del _thread_by_func[key]
            if worker.exception:
                raise worker.exception
            else:
                return worker.result
        return wrapper
    return decorator

What's a good function header?
 Here's a good function header?
assistant
#Here's a good function header.

def timeout(timeout):