code: def _ctypes_free_resource(rhandle):
      """callback to free resources when it it not needed."""
      pyobj = ctypes.cast(rhandle, ctypes.py_object)
      ctypes.pythonapi.Py_DecRef(pyobj)
  
imports: from __future__ import absolute_import
  import ctypes
  import traceback
  from numbers import Integral, Number
  from ..base import _LIB, c_str, check_call, string_types
  from ..object_generic import convert_to_object, ObjectGeneric
  from ..runtime_ctypes import DGLByteArray, DGLContext, DGLDataType
  from .None import ndarray, object
  from .ndarray import _make_array, NDArrayBase
  from .object import ObjectBase
  from .types import _wrap_arg_func, C_TO_PY_ARG_SWITCH, DGLCFuncFinalizer, DGLPackedCFunc, DGLValue, RETURN_SWITCH, TypeCode
label_desc: Use image node_id 1 for calling a global function with example usage: _ctypes_free_resource(rhandle) without return types