def coroutine(func, replace_callback=True):
<EOL>if TORNADO_MAJOR != <NUM_LIT:4>:<EOL><INDENT>wrapper = gen.coroutine(func)<EOL><DEDENT>else:<EOL><INDENT>wrapper = gen.coroutine(func, replace_callback)<EOL><DEDENT>wrapper.__argspec_args = inspect.getargspec(func).args<EOL>return wrapper<EOL>
Tornado-JSON compatible wrapper for ``tornado.gen.coroutine``

    Annotates original argspec.args of ``func`` as attribute ``__argspec_args``