code: def py_capsule_destructor(void_p):
      capsule = ctypes.cast(void_p, ctypes.py_object)
      if PyCapsule_IsValid(capsule, b"dltensor"):
          pointer = PyCapsule_GetPointer(capsule, b"dltensor")
          managed = ctypes.cast(pointer, DLManagedTensor_p)
          deleter = managed.contents.deleter
          if deleter:
              deleter(managed)
      context = PyCapsule_GetContext(capsule)
      managed = ctypes.cast(context, ctypes.py_object)
      Py_DecRef(managed)
  
imports: import sys
  import ctypes
  from enum import IntEnum
label_desc: Use image node_id 8 for calling a global function with example usage: py_capsule_destructor(void_p) without return types