code: def to_feather(data, file):
      """
      Helper to convert a Pandas DataFrame to a feather file that is optimized for
      use as a VegaFusion data source
  
      :param data: Pandas DataFrame, pyarrow Table, or object that supports
          the DataFrame Interchange Protocol
      :param file: File path string or writable file-like object
      :return: None
      """
      file_bytes = to_arrow_ipc_bytes(data, stream=False)
  
      # Either write to new file at path, or to writable file-like object
      if hasattr(file, "write"):
          file.write(file_bytes)
      else:
          with open(file, "wb") as f:
              f.write(file_bytes)
  
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 4 for calling a global function with example usage: to_feather(data, file) without return types