code: def get_pool_layer(name: tuple | str, spatial_dims: int | None = 1):
      """
      Create a pooling layer instance.
  
      For example, to create adaptiveavg layer:
  
      .. code-block:: python
  
          from monai.networks.layers import get_pool_layer
  
          pool_layer = get_pool_layer(("adaptiveavg", {"output_size": (1, 1, 1)}), spatial_dims=3)
  
      Args:
          name: a pooling type string or a tuple of type string and parameters.
          spatial_dims: number of spatial dimensions of the input.
  
      """
      if name == "":
          return torch.nn.Identity()
      pool_name, pool_args = split_args(name)
      pool_type = Pool[pool_name, spatial_dims]
      return pool_type(**pool_args)
  
file_path: MONAI/monai/networks/layers/utils.py
imports: from __future__ import annotations
  import torch.nn
  from monai.networks.layers.factories import Act, Dropout, Norm, Pool, split_args
  from monai.utils import has_option
label_desc: Use image node_id 4 for calling a global function with example usage: get_pool_layer(name, spatial_dims) and returns: pool_type, torch