code: def get_same_padding_maxPool2d(image_size=None):
      """Chooses static padding if you have specified an image size, and dynamic padding otherwise.
         Static padding is necessary for ONNX exporting of models.
  
      Args:
          image_size (int or tuple): Size of the image.
  
      Returns:
          MaxPool2dDynamicSamePadding or MaxPool2dStaticSamePadding.
      """
      if image_size is None:
          return MaxPool2dDynamicSamePadding
      else:
          return partial(
              MaxPool2dStaticSamePadding, image_size=image_size
          )
  
imports: import re
  import math
  import collections
  from functools import partial
  import torch
  from torch import nn
  from torch.nn import functional
  from torch.utils import model_zoo
label_desc: Use image node_id 7 for calling a global function with example usage: get_same_padding_maxPool2d(image_size) and returns: MaxPool2dDynamicSamePadding, partial