code: def test_leak3():
      import pyarrow.parquet as pq
  
      df = pd.DataFrame(
          {"a{0}".format(i): [1, 2, 3, 4] for i in range(50)}
      )
      table = pa.Table.from_pandas(df, preserve_index=False)
  
      writer = pq.ParquetWriter(
          "leak_test_" + rands(5) + ".parquet", table.schema
      )
  
      def func():
          writer.write_table(table, row_group_size=len(table))
  
      # This does not "leak" per se but we do want to have this use as little
      # memory as possible
      assert_does_not_leak(
          func, iterations=500, check_interval=50, tolerance=20
      )
  
file_path: arrow/python/scripts/test_leak.py
imports: import pyarrow
  import numpy
  import pandas
  from pyarrow.tests.util import rands
  import memory_profiler
  import gc
  import io
label_desc: Use image node_id 4 for calling a global function with example usage: test_leak3() without return types