code: def convert_AveragePoolingND(
      func, opset_version, input_names, output_names, context
  ):
      pad = list(func.pad[:])
      if func.cover_all:
          # Supports cover_all by setting extra padding
          # NOTE: onnxruntime may not run when "k <= p + s - 1".
          pad.extend([p + s - 1 for p, s in zip(pad, func.stride)])
      else:
          pad = pad * 2
  
      if opset_version == 1:
          raise ValueError(
              "AveragePoolingND is not compatible with ONNX's AveragePool-1. "
              "Use operation set version >= 7."
          )
      elif opset_version == 7:
          return (
              onnx_helper.make_node(
                  "AveragePool",
                  input_names,
                  output_names,
                  kernel_shape=func.ksize,
                  pads=pad,
                  strides=func.stride,
                  count_include_pad=1,
              ),
          )
  
file_path: chainer/onnx_chainer/functions/pooling.py
imports: import warnings
  from chainer.utils import conv
  import numpy
  from onnx_chainer.functions.opset_version import support
  from onnx_chainer import onnx_helper
label_desc: Use image node_id 2 for calling a global function with example usage: convert_AveragePoolingND(func, opset_version, input_names, output_names, context) and returns: onnx_helper