Unregisters given :class:`umbra.components.factory.script_editor.nodes.EditorNode` class Node from the Model.

        :param editor_node: EditorNode to unregister.
        :type editor_node: EditorNode
        :param raise_exception: Raise the exception.
        :type raise_exception: bool
        :return: EditorNode.
        :rtype: EditorNode

def unregister_editor(self, editor_node, raise_exception=False):
        """
        Unregisters given :class:`umbra.components.factory.script_editor.nodes.EditorNode` class Node from the Model.

        :param editor_node: EditorNode to unregister.
        :type editor_node: EditorNode
        :param raise_exception: Raise the exception.
        :type raise_exception: bool
        :return: EditorNode.
        :rtype: EditorNode
        """

        if raise_exception:
            if not editor_node in self.list_editor_nodes():
                raise foundations.exceptions.ProgrammingError(
                    "{0} | '{1}' editor 'EditorNode' isn't registered!".format(
                        self.__class__.__name__, editor_node))

        LOGGER.debug("> Unregistering '{0}' editor 'EditorNode'.".format(editor_node))

        parent = editor_node.parent
        row = editor_node.row()
        self.beginRemoveRows(self.get_node_index(parent), row, row)
        parent.remove_child(row)
        self.endRemoveRows()

        self.editor_unregistered.emit(editor_node)

        return editor_node