code: def test_serialize_cupy(collection, y, y_serializer):
      cupy = pytest.importorskip("cupy")
  
      x = cupy.arange(100)
      if y is not None:
          y = cupy.arange(y)
      if issubclass(collection, dict):
          header, frames = serialize(
              {"x": x, "y": y}, serializers=("cuda", "dask", "pickle")
          )
      else:
          header, frames = serialize(
              (x, y), serializers=("cuda", "dask", "pickle")
          )
      t = deserialize(
          header,
          frames,
          deserializers=("cuda", "dask", "pickle", "error"),
      )
  
      assert header["is-collection"] is True
      sub_headers = header["sub-headers"]
      assert sub_headers[0]["serializer"] == "cuda"
      assert sub_headers[1]["serializer"] == y_serializer
      assert isinstance(t, collection)
  
      assert ((t["x"] if isinstance(t, dict) else t[0]) == x).all()
      if y is None:
          assert (t["y"] if isinstance(t, dict) else t[1]) is None
      else:
          assert ((t["y"] if isinstance(t, dict) else t[1]) == y).all()
  
imports: from __future__ import annotations
  import pytest
  from distributed.protocol import deserialize, serialize
label_desc: Use image node_id 1 for calling a global function with example usage: test_serialize_cupy(collection, y, y_serializer) without return types