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 get_git_version(self):
        VERSION_PFX = 'git version '
        version = self.run_command(
            ['version'], show_stdout=False, stdout_only=True
        )
        if version.startswith(VERSION_PFX):
            version = version[len(VERSION_PFX):].split()[0]
        else:
            version = ''
        # get first 3 positions of the git version because
        # on windows it is x.y.z.windows.t, and this parses as
        # LegacyVersion which always smaller than a Version.
        version = '.'.join(version.split('.')[:3])
        return parse_version(version)