<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_node_index(self, node):
 """ Returns given Node index. :param node: Node. :type node: AbstractCompositeNode or GraphModelNode :return: Index. :rtype: QModelIndex """


        if node == self.__root_node:
            return QModelIndex()
        else:
            row = node.row()
            return self.createIndex(row, 0, node) if row is not None else QModelIndex()