code: def _wrap_return(self, lj, vals):
      # Return a single double if there is one return value,
      #  else return a tuple of doubles.
  
      # Don't wrap return value in this case
      if self.signature.ret_type == ctypes.c_double:
          return vals[0]
  
      # Use this instead of a real PyObject*
      void_ptr = ll.PointerType(ll.IntType(32))
  
      # Create a wrapped double: PyObject* PyFloat_FromDouble(double v)
      wrap_type = ll.FunctionType(void_ptr, [self.fp_type])
      wrap_fn = ll.Function(lj.module, wrap_type, "PyFloat_FromDouble")
  
      wrapped_vals = [lj.builder.call(wrap_fn, [v]) for v in vals]
      if len(vals) == 1:
          final_val = wrapped_vals[0]
      else:
          # Create a tuple: PyObject* PyTuple_Pack(Py_ssize_t n, ...)
  
          # This should be Py_ssize_t
          tuple_arg_types = [ll.IntType(32)]
  
          tuple_arg_types.extend([void_ptr] * len(vals))
          tuple_type = ll.FunctionType(void_ptr, tuple_arg_types)
          tuple_fn = ll.Function(lj.module, tuple_type, "PyTuple_Pack")
  
          tuple_args = [ll.Constant(ll.IntType(32), len(wrapped_vals))]
          tuple_args.extend(wrapped_vals)
  
          final_val = lj.builder.call(tuple_fn, tuple_args)
  
      return final_val
  
imports: import ctypes
  from sympy.external import import_module
  from sympy.printing.printer import Printer
  from sympy.core.singleton import S
  from sympy.tensor.indexed import IndexedBase
  from sympy.utilities.decorator import doctest_depends_on
label_desc: Use image node_id 7 for calling the LLVMJitCode obj's underlying member method code with example usage: obj._wrap_return(lj, vals) and returns: final_val, vals