code: def load_cgotest():
      # XXX what about Darwin?
      libext = "so"
      if os.name == "nt":
          libext = "dll"
  
      ffi.cdef(
          """
          long long totalAllocated();
          void importSchema(uintptr_t ptr);
          void importRecordBatch(uintptr_t scptr, uintptr_t rbptr);
          void runGC();
          void exportSchema(uintptr_t ptr);
          void exportRecordBatch(uintptr_t schema, uintptr_t record);
          void importThenExportSchema(uintptr_t input, uintptr_t output);
          void importThenExportRecord(uintptr_t schemaIn, uintptr_t arrIn, 
                                      uintptr_t schemaOut, uintptr_t arrOut);
          void roundtripArray(uintptr_t arrIn, uintptr_t schema, uintptr_t arrOut);
          """
      )
      return ffi.dlopen(f"./cgotest.{libext}")
  
imports: import contextlib
  import gc
  import os
  import unittest
  import pyarrow
  from pyarrow.cffi import ffi
label_desc: Use image node_id 1 for calling a global function with example usage: load_cgotest() and returns: ffi