code: def _PoolingLayerParams(op, inexpr, etab):
      """get pooling parameters"""
      if op.globalPooling:
          if op.type == 0:
              return _op.nn.global_max_pool2d(inexpr)
          if op.type == 1:
              return _op.nn.global_avg_pool2d(inexpr)
          raise tvm.error.OpNotImplemented(
              "Only Max and Average Pooling are supported in frontend CoreML."
          )
  
      params = {
          "pool_size": list(op.kernelSize),
          "strides": list(op.stride),
      }
  
      if op.WhichOneof("PoolingPaddingType") == "valid":
          valid = op.valid
          if valid.paddingAmounts.borderAmounts:
              assert len(valid.paddingAmounts.borderAmounts) == 2
              pad_t = valid.paddingAmounts.borderAmounts[
                  0
              ].startEdgeSize
              pad_l = valid.paddingAmounts.borderAmounts[
                  1
              ].startEdgeSize
              pad_b = valid.paddingAmounts.borderAmounts[0].endEdgeSize
              pad_r = valid.paddingAmounts.borderAmounts[1].endEdgeSize
              if not all(v == 0 for v in (pad_t, pad_l, pad_b, pad_r)):
                  params["padding"] = [pad_t, pad_l, pad_b, pad_r]
      elif op.WhichOneof("PoolingPaddingType") == "includeLastPixel":
          # I don't know if this is correct
          valid = op.includeLastPixel
          padding = list(valid.paddingAmounts)
          params["padding"] = padding
          params["ceil_mode"] = True
      else:
          op_name = op.WhichOneof("PoolingPaddingType")
          msg = f"PoolingPaddingType {op_name} is not supported in operator Pooling."
          raise tvm.error.OpAttributeUnImplemented(msg)
  
      if op.type == 0:
          return _op.nn.max_pool2d(inexpr, **params)
      if op.type == 1:
          return _op.nn.avg_pool2d(inexpr, **params)
      raise tvm.error.OpNotImplemented(
          "Only Max and Average Pooling are supported in CoreML."
      )
  
imports: import math
  import numpy
  import tvm
  from tvm.ir import IRModule
  from ..None import analysis
  from ..None import expr
  from ..None import function
  from ..None import op
  from ...None import nd
  from ..._ffi import base
  from .common import ExprTable
  from .common import infer_shape
label_desc: Use image node_id 7 for calling a global function with example usage: _PoolingLayerParams(op, inexpr, etab) and returns: _op, _op, _op, _op