code: def rowCount(self, parent=QModelIndex()):
          
  
          if not parent.isValid():
              parent_node = self.__root_node
          else:
              parent_node = parent.internalPointer()
          return parent_node.children_count()
docs: Reimplements the :meth:`QAbstractItemModel.rowCount` method.
  
          :param parent: Parent node.
          :type parent: AbstractCompositeNode or GraphModelNode
          :return: Row count.
          :rtype: int