code: def index(self, row, col, parent=QtCore.QModelIndex()):
           
          if row < self._stim.rowCount() and col < self._stim.columnCountForRow(row):
              component = self._stim.component(row, col)
              return self.createIndex(row, col, component)
          else:
              return QtCore.QModelIndex()
docs: Creates an index. An item must exist for the given *row* 
          and *col*
  
          :returns: :qtdoc:`QModelIndex`