code: def test_integrate(self):
      # Derived from some then non-working code, posted by David Foster
      dll = CDLL(_ctypes_test.__file__)
  
      # The function prototype called by 'integrate': double func(double);
      CALLBACK = CFUNCTYPE(c_double, c_double)
  
      # The integrate function itself, exposed from the _ctypes_test dll
      integrate = dll.integrate
      integrate.argtypes = (c_double, c_double, CALLBACK, c_long)
      integrate.restype = c_double
  
      def func(x):
          return x**2
  
      result = integrate(0.0, 1.0, CALLBACK(func), 10)
      diff = abs(result - 1.0 / 3.0)
  
      self.assertLess(diff, 0.01, "%s not less than 0.01" % diff)
  
imports: import _ctypes_test
  import ctypes
  import functools
  import gc
  import math
  import sys
  import unittest
  from _ctypes import CTYPES_MAX_ARGCOUNT
  from ctypes import CDLL, cdll, Structure, CFUNCTYPE, ArgumentError, POINTER, sizeof, c_byte, c_ubyte, c_char, c_short, c_ushort, c_int, c_uint, c_long, c_longlong, c_ulonglong, c_ulong, c_float, c_double, c_longdouble, py_object
  from ctypes.util import find_library
  from test import support
label_desc: Use image node_id 1 for calling the SampleCallbacksTestCase obj's underlying member method code with example usage: obj.test_integrate() and returns: unknown