def METHOD_NAME(self, section, orientation, role=Qt.ItemDataRole.DisplayRole):
    if role not in (Qt.ItemDataRole.DisplayRole, Qt.ItemDataRole.EditRole):
        return None
    if orientation == Qt.Orientation.Horizontal:
        return 'Column {}'.format(section)
    return 'Row {}'.format(section)