code: def assert_pyarrow_memory_released(self):
      self.run_gc()
      old_allocated = pa.total_allocated_bytes()
      old_go_allocated = cgotest.totalAllocated()
      yield
      self.run_gc()
      diff = pa.total_allocated_bytes() - old_allocated
      godiff = cgotest.totalAllocated() - old_go_allocated
      self.assertEqual(
          pa.total_allocated_bytes(),
          old_allocated,
          f"PyArrow memory was not adequately released: {diff} bytes lost",
      )
      self.assertEqual(
          cgotest.totalAllocated(),
          old_go_allocated,
          f"Go memory was not properly released: {godiff} bytes lost",
      )
  
imports: import contextlib
  import gc
  import os
  import unittest
  import pyarrow
  from pyarrow.cffi import ffi
label_desc: Use image node_id 5 for calling the BaseTestGoPython obj's underlying member method code with example usage: obj.assert_pyarrow_memory_released() without return types