def test_negative_scalar_index(adata, index: int, obs: bool):
    pos_index = index + (adata.n_obs if obs else adata.n_vars)

    if obs:
        adata_pos_subset = adata[pos_index]
        adata_neg_subset = adata[index]
    else:
        adata_pos_subset = adata[:, pos_index]
        adata_neg_subset = adata[:, index]

    np.testing.assert_array_equal(
        adata_pos_subset.obs_names, adata_neg_subset.obs_names
    )
    np.testing.assert_array_equal(
        adata_pos_subset.var_names, adata_neg_subset.var_names
    )
def refresh(self):
        """refreshes the Gtk.Liststore"""
        self.backendid_to_iter = {}
        self.liststore.clear()

        # Sort backends
        # 1, put default backend on top
        # 2, sort backends by human name
        backends = list(self.req.get_all_backends(disabled=True))
        backends = sorted(backends,
                          key=lambda backend: (not backend.is_default(),
                                               backend.get_human_name()))

        for backend in backends:
            self.add_backend(backend)
            self.on_backend_state_changed(None, backend.get_id())