code: def get_reduction_kernel_and_types(
      stage,
      out_type,
      block_size,
      neutral,
      reduce_expr,
      map_expr=None,
      arguments=None,
      name="reduce_kernel",
      keep=False,
      options=None,
      preamble="",
  ):
      if stage == 1:
          if map_expr is None:
              map_expr = "in[i]"
  
      elif stage == 2:
          if map_expr is None:
              map_expr = "pycuda_reduction_inp[i]"
  
          in_arg = "const %s *pycuda_reduction_inp" % out_type
          if arguments:
              arguments = in_arg + ", " + arguments
          else:
              arguments = in_arg
  
      else:
          assert False
  
      mod = get_reduction_module(
          out_type,
          block_size,
          neutral,
          reduce_expr,
          map_expr,
          arguments,
          name,
          keep,
          options,
          preamble,
      )
  
      from pycuda.tools import get_arg_type
  
      func = mod.get_function(name)
      arg_types = [get_arg_type(arg) for arg in arguments.split(",")]
      func.prepare("P%sIN" % "".join(arg_types))
  
      return func, arg_types
  
file_path: pycuda/pycuda/reduction.py
imports: from pycuda.tools import context_dependent_memoize
  from pycuda.tools import dtype_to_ctype
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: get_reduction_kernel_and_types(stage, out_type, block_size, neutral, reduce_expr, map_expr, arguments, name, keep, options, preamble) and returns: func,  arg_types