code: def _get_ctypes_func(func, signature=None):
      # Get function pointer
      func_ptr = ctypes.cast(func, ctypes.c_void_p).value
  
      # Construct function signature
      if signature is None:
          signature = _typename_from_ctypes(func.restype) + " ("
          for j, arg in enumerate(func.argtypes):
              if j == 0:
                  signature += _typename_from_ctypes(arg)
              else:
                  signature += ", " + _typename_from_ctypes(arg)
          signature += ")"
  
      return func_ptr, signature
  
file_path: catboost/contrib/python/scipy/py2/scipy/_lib/_ccallback.py
imports: from .None import _ccallback_c
  import ctypes
label_desc: Use image node_id 2 for calling a global function with example usage: _get_ctypes_func(func, signature) and returns: func_ptr,  signature