def test_invalid_scalar_index(adata, index):
    # https://github.com/theislab/anndata/issues/619
    with pytest.raises(IndexError, match=r".*index.* out of range\."):
        _ = adata[index]
def _raise_or_warn(self, warn_only, msg):
        if warn_only:
            self._warnings.append(msg)
        else:
            raise TransactionError(msg)