code: def create_pool2d(pool_type, kernel_size, stride=None, **kwargs):
      stride = stride or kernel_size
      padding = kwargs.pop("padding", "")
      padding, is_dynamic = get_padding_value(
          padding, kernel_size, stride=stride, **kwargs
      )
      if is_dynamic:
          if pool_type == "avg":
              return AvgPool2dSame(kernel_size, stride=stride, **kwargs)
          elif pool_type == "max":
              return MaxPool2dSame(kernel_size, stride=stride, **kwargs)
          else:
              assert False, f"Unsupported pool type {pool_type}"
      else:
          if pool_type == "avg":
              return nn.AvgPool2d(
                  kernel_size, stride=stride, padding=padding, **kwargs
              )
          elif pool_type == "max":
              return nn.MaxPool2d(
                  kernel_size, stride=stride, padding=padding, **kwargs
              )
          else:
              assert False, f"Unsupported pool type {pool_type}"
  
file_path: pytorch-image-models/timm/layers/pool2d_same.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  from typing import List, Tuple, Optional
  from .helpers import to_2tuple
  from .padding import pad_same, get_padding_value
label_desc: Use image node_id 3 for calling a global function with example usage: create_pool2d(pool_type, kernel_size, stride) and returns: AvgPool2dSame, nn, MaxPool2dSame, nn