def register(key):
    '''
    Mark the function with the key code that it handles so
    that it can found by _KeyHandlerRegisterer.
    '''
    def wrap(func):
        if not hasattr(func, '_handle_key'):
            setattr(func, '_handle_key', [key])
        else:
            func._handle_key.append(key)
        return func
    return wrap

    Mark the function with the key code that it handles so
    that it can found by _KeyHandlerRegisterer.
    
bullet/keyhandler.py