code: def _check_pandas_roundtrip(
      df,
      expected=None,
      path=None,
      columns=None,
      use_threads=False,
      version=None,
      compression=None,
      compression_level=None,
  ):
      if path is None:
          path = random_path()
  
      if version is None:
          version = 2
  
      TEST_FILES.append(path)
      write_feather(
          df,
          path,
          compression=compression,
          compression_level=compression_level,
          version=version,
      )
  
      if not os.path.exists(path):
          raise Exception("file not written")
  
      result = read_feather(path, columns, use_threads=use_threads)
  
      if expected is None:
          expected = df
  
      assert_frame_equal(result, expected)
  
imports: import io
  import os
  import sys
  import tempfile
  import pytest
  import hypothesis
  import hypothesis.strategies
  import numpy
  import pyarrow
  import pyarrow.tests.strategies
  from pyarrow.feather import read_feather, write_feather, read_table, FeatherDataset
label_desc: Use image node_id 8 for calling a global function with example usage: _check_pandas_roundtrip(df, expected, path, columns, use_threads, version, compression, compression_level) without return types