code: def test_dataframe(use_batch):
      n = pa.chunked_array([[2, 2, 4], [4, 5, 100]])
      a = pa.chunked_array(
          [
              ["Flamingo", "Parrot", "Cow"],
              ["Horse", "Brittle stars", "Centipede"],
          ]
      )
      table = pa.table([n, a], names=["n_legs", "animals"])
      if use_batch:
          table = table.combine_chunks().to_batches()[0]
      df = table.__dataframe__()
  
      assert df.num_columns() == 2
      assert df.num_rows() == 6
      if use_batch:
          assert df.num_chunks() == 1
      else:
          assert df.num_chunks() == 2
      assert list(df.column_names()) == ["n_legs", "animals"]
      assert list(df.select_columns((1,)).column_names()) == list(
          df.select_columns_by_name(("animals",)).column_names()
      )
  
file_path: arrow/python/pyarrow/tests/interchange/test_interchange_spec.py
imports: import ctypes
  import hypothesis
  import hypothesis.strategies
  import numpy
  import pyarrow
  import pyarrow.tests.strategies
  import pytest
label_desc: Use image node_id 6 for calling a global function with example usage: test_dataframe(use_batch) without return types