def test_set_index_names(shuffle_method):
    if (shuffle_method == 'disk'):
        pytest.xfail('dsk names in disk shuffle are not deterministic')
    df = pd.DataFrame({'x': np.random.random(100), 'y': (np.random.random(100) // 0.2)}, index=np.random.random(100))
    ddf = dd.from_pandas(df, npartitions=4)
    assert (set(ddf.set_index('x', shuffle=shuffle_method).dask) == set(ddf.set_index('x', shuffle=shuffle_method).dask))
    assert (set(ddf.set_index('x', shuffle=shuffle_method).dask) != set(ddf.set_index('y', shuffle=shuffle_method).dask))
    assert (set(ddf.set_index('x', max_branch=4, shuffle=shuffle_method).dask) != set(ddf.set_index('x', max_branch=3, shuffle=shuffle_method).dask))
    assert (set(ddf.set_index('x', drop=True, shuffle=shuffle_method).dask) != set(ddf.set_index('x', drop=False, shuffle=shuffle_method).dask))
def test_set_index_names(shuffle_method):
    if (shuffle_method == 'disk'):
        pytest.xfail('dsk names in disk shuffle are not deterministic')
    df = pd.DataFrame({'x': np.random.random(100), 'y': (np.random.random(100) // 0.2)}, index=np.random.random(100))
    ddf = dd.from_pandas(df, npartitions=4)
    assert (set(ddf.set_index('x', shuffle=shuffle_method).dask) == set(ddf.set_index('x', shuffle=shuffle_method).dask))
    assert (set(ddf.set_index('x', shuffle=shuffle_method).dask) != set(ddf.set_index('y', shuffle=shuffle_method).dask))
    assert (set(ddf.set_index('x', max_branch=4, shuffle=shuffle_method).dask) != set(ddf.set_index('x', max_branch=3, shuffle=shuffle_method).dask))
    assert (set(ddf.set_index('x', drop=True, shuffle=shuffle_method).dask) != set(ddf.set_index('x', drop=False, shuffle=shuffle_method).dask))