code: def _argminmax_nodes(
      op_name, func, input_names, output_names, context
  ):
      gb = onnx_helper.GraphBuilder()
      target_input_names = input_names
      axis = func.axis
      if axis is None:
          shape_name = context.add_const(
              np.array([-1], dtype=np.int64), "shape"
          )
          input_names.append(shape_name)
          target_input_names = [gb.op("Reshape", input_names)]
          axis = 0
      out = gb.op(op_name, target_input_names, axis=axis, keepdims=0)
      # Chainer's ArgMax always return value as int32
      # Cast spec is changed from opset6, this logic does not support ~opset5
      gb.op("Cast", [out], to=NP_TYPE_TO_TENSOR_TYPE[np.dtype("int32")])
      return gb.nodes(output_names)
  
imports: import numpy
  from onnx.mapping import NP_TYPE_TO_TENSOR_TYPE
  from onnx_chainer.functions.opset_version import support
  from onnx_chainer import onnx_helper
label_desc: Use image node_id 40 for calling a global function with example usage: _argminmax_nodes(op_name, func, input_names, output_names, context) and returns: gb