def reap_threads(func):
if not _thread:<EOL><INDENT>return func<EOL><DEDENT>@functools.wraps(func)<EOL>def decorator(*args):<EOL><INDENT>key = threading_setup()<EOL>try:<EOL><INDENT>return func(*args)<EOL><DEDENT>finally:<EOL><INDENT>threading_cleanup(*key)<EOL><DEDENT><DEDENT>return decorator<EOL>
Use this function when threads are being used.  This will
    ensure that the threads are cleaned up even when the test fails.
    If threading is unavailable this function does nothing.