code: def columnCount(self, parent):
          
          if parent.isValid():
              return parent.internalPointer().column_count()
          else:
              return self._root.column_count()
docs: Return the number of columns for the children of the given parent.
  
          :param parent: the parent index
          :type parent: :class:`QtCore.QModelIndex`:
          :returns: the column count
          :rtype: int
          :raises: None