code: def pack_frames_prelude(
      frames: Collection[bytes | bytearray | memoryview],
  ) -> bytes:
      nframes = len(frames)
      nbytes_frames = map(nbytes, frames)
      return struct.pack(f"Q{nframes}Q", nframes, *nbytes_frames)
  
file_path: distributed/distributed/protocol/utils.py
imports: from __future__ import annotations
  import ctypes
  import struct
  from collections.abc import Collection, Iterable, Sequence
  from typing import Literal, overload
  import dask
  from distributed.utils import nbytes
label_desc: Use image node_id 3 for calling a global function with example usage: pack_frames_prelude(frames) and returns: struct