code: def test_ctypes_variants(self):
      sin_0 = get_clib_test_routine(
          "_sin_0", ctypes.c_double, ctypes.c_double, ctypes.c_void_p
      )
  
      sin_1 = get_clib_test_routine(
          "_sin_1",
          ctypes.c_double,
          ctypes.c_int,
          ctypes.POINTER(ctypes.c_double),
          ctypes.c_void_p,
      )
  
      sin_2 = get_clib_test_routine(
          "_sin_2", ctypes.c_double, ctypes.c_double
      )
  
      sin_3 = get_clib_test_routine(
          "_sin_3",
          ctypes.c_double,
          ctypes.c_int,
          ctypes.POINTER(ctypes.c_double),
      )
  
      sin_4 = get_clib_test_routine(
          "_sin_3", ctypes.c_double, ctypes.c_int, ctypes.c_double
      )
  
      all_sigs = [sin_0, sin_1, sin_2, sin_3, sin_4]
      legacy_sigs = [sin_2, sin_4]
      legacy_only_sigs = [sin_4]
  
      # LowLevelCallables work for new signatures
      for j, func in enumerate(all_sigs):
          callback = LowLevelCallable(func)
          if func in legacy_only_sigs:
              pytest.raises(ValueError, quad, callback, 0, pi)
          else:
              assert_allclose(quad(callback, 0, pi)[0], 2.0)
  
      # Plain ctypes items work only for legacy signatures
      for j, func in enumerate(legacy_sigs):
          if func in legacy_sigs:
              assert_allclose(quad(func, 0, pi)[0], 2.0)
          else:
              pytest.raises(ValueError, quad, func, 0, pi)
  
imports: import sys
  import math
  import numpy
  from numpy import sqrt, cos, sin, arctan, exp, log, pi
  from numpy.testing import assert_, assert_allclose, assert_array_less, assert_almost_equal
  import pytest
  from scipy.integrate import quad, dblquad, tplquad, nquad
  from scipy.special import erf, erfc
  from scipy._lib._ccallback import LowLevelCallable
  import ctypes
  import ctypes.util
  from scipy._lib._ccallback_c import sine_ctypes
  import scipy.integrate._test_multivariate
label_desc: Use image node_id 4 for calling the TestCtypesQuad obj's underlying member method code with example usage: obj.test_ctypes_variants() without return types