code: def test_serialize_cupy(shape, dtype, order, serializers):
      x = cupy.arange(numpy.product(shape), dtype=dtype)
      x = cupy.ndarray(shape, dtype=x.dtype, memptr=x.data, order=order)
      header, frames = serialize(x, serializers=serializers)
      y = deserialize(header, frames, deserializers=serializers)
  
      if serializers[0] == "cuda":
          assert all(
              hasattr(f, "__cuda_array_interface__") for f in frames
          )
      elif serializers[0] == "dask":
          assert all(isinstance(f, memoryview) for f in frames)
  
      assert (x == 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 1 for calling a global function with example usage: test_serialize_cupy(shape, dtype, order, serializers) without return types