code: def arrow_table_to_ipc_bytes(table, stream=False):
      import pyarrow as pa
  
      # Next we write the Arrow table as a feather file (The Arrow IPC format on disk).
      # Write it in memory first so we can hash the contents before touching disk.
      bytes_buffer = io.BytesIO()
  
      if stream:
          with pa.ipc.new_stream(bytes_buffer, table.schema) as f:
              f.write_table(table, max_chunksize=BATCH_SIZE)
      else:
          with pa.ipc.new_file(bytes_buffer, table.schema) as f:
              f.write_table(table, max_chunksize=BATCH_SIZE)
  
      return bytes_buffer.getvalue()
  
imports: import io
  import os
  import pathlib
  from hashlib import sha1
  from tempfile import NamedTemporaryFile
  import uuid
  import altair
  import pandas
  import pyarrow
  from weakref import WeakValueDictionary
label_desc: Use image node_id 3 for calling a global function with example usage: arrow_table_to_ipc_bytes(table, stream) and returns: bytes_buffer