code: def test_dumps_serialize_numpy_custom_dtype():
      import builtins
  
      test_rational = pytest.importorskip("numpy.core.test_rational")
      rational = test_rational.rational
      try:
          builtins.rational = rational  # Work around https://github.com/numpy/numpy/issues/9160
          x = np.array([1], dtype=rational)
          header, frames = serialize(x)
          y = deserialize(header, frames)
  
          np.testing.assert_equal(x, y)
      finally:
          del builtins.rational
  
imports: from __future__ import annotations
  from zlib import crc32
  import pytest
  from dask.utils import ensure_bytes, tmpfile
  from distributed.protocol import decompress, deserialize, dumps, loads, msgpack, serialize, to_serialize
  from distributed.protocol.compression import maybe_compress
  from distributed.protocol.numpy import itemsize
  from distributed.protocol.utils import BIG_BYTES_SHARD_SIZE
  from distributed.system import MEMORY_LIMIT
  from distributed.utils import nbytes
  from distributed.utils_test import gen_cluster
label_desc: Use image node_id 6 for calling a global function with example usage: test_dumps_serialize_numpy_custom_dtype() without return types