code: def test_serialize_iterate_collection():
      # Use iterate_collection to ensure elements of
      # a collection will be serialized separately
  
      arr = "special-data"
      sarr = Serialized(*serialize(arr))
      sdarr = to_serialize(arr)
  
      task1 = (0, sarr, "('fake-key', 3)", None)
      task2 = (0, sdarr, "('fake-key', 3)", None)
      expect = (0, arr, "('fake-key', 3)", None)
  
      # Check serialize/deserialize directly
      assert (
          deserialize(*serialize(task1, iterate_collection=True))
          == expect
      )
      assert (
          deserialize(*serialize(task2, iterate_collection=True))
          == expect
      )
  
imports: from __future__ import annotations
  import copy
  import pickle
  from array import array
  import msgpack
  import pytest
  from tlz import identity
  import dask
  from distributed import Nanny, wait
  from distributed.comm.utils import from_frames, to_frames
  from distributed.protocol import Serialize, Serialized, dask_serialize, deserialize, deserialize_bytes, dumps, loads, nested_deserialize, register_serialization, register_serialization_family, serialize, serialize_bytelist, serialize_bytes, to_serialize
  from distributed.protocol.serialize import _is_msgpack_serializable, check_dask_serializable
  from distributed.utils import ensure_memoryview, nbytes
  from distributed.utils_test import NO_AMM, gen_test, inc
  from dask import delayed
  from distributed.utils_test import gen_cluster
label_desc: Use image node_id 10 for calling a global function with example usage: test_serialize_iterate_collection() without return types