code: def test_serialize_cupy_from_numba(dtype):
      cuda = pytest.importorskip("numba.cuda")
      np = pytest.importorskip("numpy")
  
      if not cuda.is_available():
          pytest.skip("CUDA is not available")
  
      size = 10
      x_np = np.arange(size, dtype=dtype)
      x = cuda.to_device(x_np)
      header, frames = serialize(
          x, serializers=("cuda", "dask", "pickle")
      )
      header["type-serialized"] = pickle.dumps(cupy.ndarray)
  
      y = deserialize(
          header,
          frames,
          deserializers=("cuda", "dask", "pickle", "error"),
      )
  
      assert (x_np == cupy.asnumpy(y)).all()
  
file_path: distributed/distributed/protocol/tests/test_cupy.py
imports: from __future__ import annotations
  import pickle
  import pytest
  from distributed.protocol import deserialize, serialize
label_desc: Use image node_id 2 for calling a global function with example usage: test_serialize_cupy_from_numba(dtype) without return types