human
I wrote the below code

    default_return = kwargs.pop(u'default_return', None)
    if on_win:
        try:
            return func(*args, **kwargs)
        except KeyboardInterrupt:
            return default_return
    else:
        class TimeoutException(Exception, ):
            pass
        def interrupt(signum, frame):
            raise TimeoutException()
        signal.signal(signal.SIGALRM, interrupt)
        signal.alarm(timeout_secs)
        try:
            ret = func(*args, **kwargs)
            signal.alarm(0)
            return ret
        except (TimeoutException, KeyboardInterrupt):
            return default_return

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

def timeout(timeout_secs, func, *args, **kwargs):