code: def test_split_by_partition():
      pa = pytest.importorskip("pyarrow")
  
      df = pd.DataFrame(
          {
              "x": [1, 2, 3, 4, 5],
              "_partition": [3, 1, 2, 3, 1],
          }
      )
      t = pa.Table.from_pandas(df)
  
      out = split_by_partition(t, "_partition")
      assert set(out) == {1, 2, 3}
      assert out[1].column_names == list(df.columns)
      assert sum(map(len, out.values())) == len(df)
  
file_path: distributed/distributed/shuffle/tests/test_shuffle_plugins.py
imports: from __future__ import annotations
  from asyncio import iscoroutinefunction
  import pytest
  from distributed.shuffle._scheduler_plugin import ShuffleSchedulerPlugin
  from distributed.shuffle._shuffle import _get_worker_for_range_sharding, split_by_partition, split_by_worker
  from distributed.shuffle._worker_plugin import ShuffleWorkerPlugin
  from distributed.utils_test import gen_cluster
label_desc: Use image node_id 4 for calling a global function with example usage: test_split_by_partition() without return types