code: def test_dataframe_set_index_sync(wait, client):
      df = dask.datasets.timeseries(
          start="2000",
          end="2001",
          dtypes={"value": float, "name": str, "id": int},
          freq="2H",
          partition_freq="1M",
          seed=1,
      )
      df = df.persist()
      wait(df)
  
      with dask.config.set({"dataframe.shuffle.method": "tasks"}):
          df2 = df.set_index("name")
      df2 = df2.persist()
  
      assert len(df2)
  
file_path: distributed/distributed/tests/test_dask_collections.py
imports: from __future__ import annotations
  import pytest
  from packaging.version import parse
  from pandas.testing import assert_frame_equal, assert_index_equal, assert_series_equal
  import dask
  import dask.bag
  import dask.dataframe
  from distributed.client import wait
  from distributed.nanny import Nanny
  from distributed.utils_test import gen_cluster
label_desc: Use image node_id 2 for calling a global function with example usage: test_dataframe_set_index_sync(wait, client) without return types