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 functools
  import unittest
  from ctypes import *
  from ctypes.test import need_symbol
  import _ctypes_test
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