code: def make_sample_file(table_or_df):
      import pyarrow.parquet as pq
  
      if isinstance(table_or_df, pa.Table):
          a_table = table_or_df
      else:
          a_table = pa.Table.from_pandas(table_or_df)
  
      buf = io.BytesIO()
      _write_table(a_table, buf, compression="SNAPPY", version="2.6")
  
      buf.seek(0)
      return pq.ParquetFile(buf)
  
file_path: arrow/python/pyarrow/tests/parquet/common.py
imports: import io
  import numpy
  import pyarrow
  from pyarrow.tests import util
label_desc: Use image node_id 9 for calling a global function with example usage: make_sample_file(table_or_df) and returns: pq