<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def rowCount(self, parent):
 """Return the number of rows under the given parent. When the parent is valid return rowCount the number of children of parent. :param parent: the parent index :type parent: :class:`QtCore.QModelIndex`: :returns: the row count :rtype: int :raises: None """

        if parent.column() > 0:
            return 0
        if not parent.isValid():
            parentItem = self._root
        else:
            parentItem = parent.internalPointer()
        return parentItem.child_count()