code: def _run(
      self,
      pooling_type,
      count_include_pad,
      x,
      auto_pad=None,
      ceil_mode=None,
      dilations=None,
      kernel_shape=None,
      pads=None,
      strides=None,
      p=None,
  ):
      x_shape = np.shape(x)
      pading_value = (
          np.nan
          if pooling_type == "MAX" or count_include_pad == 0
          else 0
      )
  
      if auto_pad in ["SAME_UPPER", "SAME_LOWER", "VALID"]:
          assert (
              ceil_mode is None or ceil_mode == 0
          ), "ceil_mode is not supported with auto_pad"
          out_shape = get_output_shape_auto_pad(
              auto_pad, x.shape[2:], kernel_shape, strides
          )
          pads_shape = get_pad_shape(
              auto_pad, x_shape[2:], kernel_shape, strides, out_shape
          )
          pads = get_pad_with_auto_pad(auto_pad, pads_shape)
          n_dims = len(pads) // 2
          pads_np = [(pads[i], pads[i + n_dims]) for i in range(n_dims)]
          padded = np.pad(
              x,
              ((0, 0), (0, 0), *pads_np),
              mode="constant",
              constant_values=pading_value,
          )
          y = pool(
              padded,
              x_shape,
              kernel_shape,
              strides,
              out_shape,
              pooling_type,
              pads,
              dilations,
              count_include_pad,
              p,
          )
          return (y,)
      else:
          out_shape, pads = get_output_shape_explicit_padding(
              pads,
              x_shape[2:],
              kernel_shape,
              strides,
              dilations,
              ceil_mode,
          )
          # convert pads from [x1_begin, x2_begin,...,x1_end, x2_end,...] to [(x1_begin, x1_end), (x2_begin, x2_end),...]
          n_dims = len(pads) // 2
          pads_np = [(pads[i], pads[i + n_dims]) for i in range(n_dims)]
          padded = np.pad(
              x,
              ((0, 0), (0, 0), *pads_np),
              mode="constant",
              constant_values=pading_value,
          )
          y = pool(
              padded,
              x_shape,
              kernel_shape,
              strides,
              out_shape,
              pooling_type,
              pads,
              dilations,
              count_include_pad,
              p,
          )
          return (y,)
  
file_path: onnx/onnx/reference/ops/op_pool_common.py
imports: import itertools
  import math
  from typing import Sequence, Tuple, Union
  import numpy
  from onnx.reference.op_run import OpRun
label_desc: Use image node_id 1 for calling the CommonPool obj's underlying member method code with example usage: obj._run(pooling_type, count_include_pad, x, auto_pad, ceil_mode, dilations, kernel_shape, pads, strides, p) and returns: y, y