code: def serialize_table(table: pa.Table) -> bytes:
      import pyarrow as pa
  
      stream = pa.BufferOutputStream()
      with pa.ipc.new_stream(stream, table.schema) as writer:
          writer.write_table(table)
      return stream.getvalue().to_pybytes()
  
file_path: distributed/distributed/shuffle/_arrow.py
imports: from __future__ import annotations
  from collections.abc import Iterable
  from pathlib import Path
  from typing import TYPE_CHECKING
  from packaging.version import parse
  from dask.utils import parse_bytes
label_desc: Use image node_id 6 for calling a global function with example usage: serialize_table(table) and returns: stream