def METHOD_NAME(self, index):
    if not index.isValid():
        return QModelIndex()
    key = index.internalPointer()
    if key is None:
        return QModelIndex()
    row = self._keys.index(key)
    return self.createIndex(row, 0, None)