code: def test_raise_on_custom_objects(c, s, a, b):
      class Stub:
          def __init__(self, value: int) -> None:
              self.value = value
  
      df = dd.from_pandas(
          pd.DataFrame(
              {
                  "x": pd.array(
                      [Stub(i) for i in range(10)], dtype="object"
                  )
              }
          ),
          npartitions=5,
      )
      with pytest.raises(
          TypeError, match="p2p does not support custom objects"
      ), dask.config.set({"dataframe.shuffle.method": "p2p"}):
          df.shuffle("x")
  
file_path: distributed/distributed/shuffle/tests/test_graph.py
imports: from __future__ import annotations
  import asyncio
  import pytest
  import dask
  import dask.dataframe
  from dask.blockwise import Blockwise
  from dask.utils_test import hlg_layer_topological
  from distributed.utils_test import gen_cluster
label_desc: Use image node_id 3 for calling a global function with example usage: test_raise_on_custom_objects(c, s, a, b) without return types