code: def test_serialize_collection(collection, y, y_serializer):
      x = np.arange(100)
      if issubclass(collection, dict):
          header, frames = serialize(
              {"x": x, "y": y}, serializers=("dask", "pickle")
          )
      else:
          header, frames = serialize(
              collection((x, y)), serializers=("dask", "pickle")
          )
      frames = tuple(frames)  # verify that no mutation occurs
      t = deserialize(
          header, frames, deserializers=("dask", "pickle", "error")
      )
      assert isinstance(t, collection)
  
      assert header["is-collection"] is True
      sub_headers = header["sub-headers"]
  
      if collection is not dict:
          assert sub_headers[0]["serializer"] == "dask"
          assert sub_headers[1]["serializer"] == y_serializer
  
      if collection is dict:
          assert (t["x"] == x).all()
          assert str(t["y"]) == str(y)
      else:
          assert (t[0] == x).all()
          assert str(t[1]) == str(y)
  
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_collection(collection, y, y_serializer) without return types