Decorator for :class:`Node` methods. Raise `SpectatorNodeError`.

def check_spectator(node_method):
    """
    Decorator for :class:`Node` methods. Raise `SpectatorNodeError`.
    """
    from functools import wraps
    @wraps(node_method)
    def wrapper(*args, **kwargs):
        node = args[0]
        if node.in_spectator_mode:
            #raise node.SpectatorError("You should not call this method when the node in spectator_mode")
            #warnings.warn("You should not call %s when the node in spectator_mode" % node_method)
            import warnings

        return node_method(*args, **kwargs)

    return wrapper