code: def test_callback_large_struct(self):
      class Check:
          pass
  
      # This should mirror the structure in Modules/_ctypes/_ctypes_test.c
      class X(Structure):
          _fields_ = [
              ("first", c_ulong),
              ("second", c_ulong),
              ("third", c_ulong),
          ]
  
      def callback(check, s):
          check.first = s.first
          check.second = s.second
          check.third = s.third
          # See issue #29565.
          # The structure should be passed by value, so
          # any changes to it should not be reflected in
          # the value passed
          s.first = s.second = s.third = 0x0BADF00D
  
      check = Check()
      s = X()
      s.first = 0xDEADBEEF
      s.second = 0xCAFEBABE
      s.third = 0x0BAD1DEA
  
      CALLBACK = CFUNCTYPE(None, X)
      dll = CDLL(_ctypes_test.__file__)
      func = dll._testfunc_cbk_large_struct
      func.argtypes = (X, CALLBACK)
      func.restype = None
      # the function just calls the callback with the passed structure
      func(s, CALLBACK(functools.partial(callback, check)))
      self.assertEqual(check.first, s.first)
      self.assertEqual(check.second, s.second)
      self.assertEqual(check.third, s.third)
      self.assertEqual(check.first, 0xDEADBEEF)
      self.assertEqual(check.second, 0xCAFEBABE)
      self.assertEqual(check.third, 0x0BAD1DEA)
      # See issue #29565.
      # Ensure that the original struct is unchanged.
      self.assertEqual(s.first, check.first)
      self.assertEqual(s.second, check.second)
      self.assertEqual(s.third, check.third)
  
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 6 for calling the SampleCallbacksTestCase obj's underlying member method code with example usage: obj.test_callback_large_struct() without return types