human
I wrote the below code

    if (timeout is None):
        timeout = get_async_test_timeout()
    def wrap(f):
        @functools.wraps(f)
        def pre_coroutine(self, *args, **kwargs):
            result = f(self, *args, **kwargs)
            if (isinstance(result, GeneratorType) or iscoroutine(result)):
                self._test_generator = result
            else:
                self._test_generator = None
            return result
        if iscoroutinefunction(f):
            coro = pre_coroutine
        else:
            coro = gen.coroutine(pre_coroutine)
        @functools.wraps(coro)
        def post_coroutine(self, *args, **kwargs):
            try:
                return self.io_loop.run_sync(functools.partial(coro, self, *args, **kwargs), timeout=timeout)
            except TimeoutError as e:
                self._test_generator.throw(e)
                raise
        return post_coroutine
    if (func is not None):
        return wrap(func)
    else:
        return wrap

What's a good function header?

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

def gen_test(func=None, timeout=None):