code: def get_upsample_layer(
      spatial_dims: int,
      in_channels: int,
      upsample_mode: UpsampleMode | str = "nontrainable",
      scale_factor: int = 2,
  ):
      return UpSample(
          spatial_dims=spatial_dims,
          in_channels=in_channels,
          out_channels=in_channels,
          scale_factor=scale_factor,
          mode=upsample_mode,
          interp_mode=InterpolateMode.LINEAR,
          align_corners=False,
      )
  
file_path: MONAI/monai/networks/blocks/segresnet_block.py
imports: from __future__ import annotations
  import torch.nn
  from monai.networks.blocks.convolutions import Convolution
  from monai.networks.blocks.upsample import UpSample
  from monai.networks.layers.utils import get_act_layer, get_norm_layer
  from monai.utils import InterpolateMode, UpsampleMode
label_desc: Use image node_id 2 for calling a global function with example usage: get_upsample_layer(spatial_dims, in_channels, upsample_mode, scale_factor) and returns: UpSample