code: def test_arrow(writer, flatten_arrays):
      data = make_data(10)
      writer.flatten_arrays = flatten_arrays
  
      with tempfile.TemporaryDirectory() as path:
          path = Path(path, "data.arrow")
  
          # create file on disk
          writer.write_to_file(data, path)
  
          dataset = File.infer(path)
  
          assert len(data) == len(dataset)
          assert dataset.metadata()["freq"] == "H"
  
          assert_equal(data, dataset)
  
          assert_equal(dataset[4], data[4])
  
          assert len(dataset[:5]) == len(data[:5])
          assert_equal(dataset[:5], data[:5])
  
          assert len(dataset[10:]) == len(data[10:])
          assert_equal(dataset[10:], data[10:])
  
          assert len(dataset[3:7]) == len(data[3:7])
          assert_equal(dataset[3:7], data[3:7])
  
          assert len(dataset[3:7][1:-1]) == len(data[3:7][1:-1])
          assert_equal(dataset[3:7][1:-1], data[3:7][1:-1])
  
file_path: gluonts/test/dataset/test_arrow.py
imports: import sys
  import tempfile
  from pathlib import Path
  import numpy
  import pytest
  from gluonts.dataset.arrow import File, ArrowWriter, ParquetWriter
label_desc: Use image node_id 4 for calling a global function with example usage: test_arrow(writer, flatten_arrays) without return types