code: def make_shape_cases(
      models,
      spatial_dims,
      batches,
      pretrained,
      in_channels=3,
      num_classes=10,
      input_shape=64,
      norm=("batch", {"eps": 1e-3, "momentum": 0.01}),
      upsample=("nontrainable", "deconv", "pixelshuffle"),
  ):
      ret_tests = []
      for spatial_dim in spatial_dims:  # selected spatial_dims
          for (
              batch
          ) in (
              batches
          ):  # check single batch as well as multiple batch input
              for model in models:  # selected models
                  for (
                      is_pretrained
                  ) in pretrained:  # pretrained or not pretrained
                      for upsample_method in upsample:
                          if ("resnet" in model) and is_pretrained:
                              continue
                          kwargs = {
                              "in_channels": in_channels,
                              "out_channels": num_classes,
                              "backbone": model,
                              "pretrained": is_pretrained,
                              "spatial_dims": spatial_dim,
                              "norm": norm,
                              "upsample": upsample_method,
                          }
                          ret_tests.append(
                              [
                                  kwargs,
                                  (batch, in_channels)
                                  + (input_shape,) * spatial_dim,
                                  (batch, num_classes)
                                  + (input_shape,) * spatial_dim,
                              ]
                          )
      return ret_tests
  
imports: from __future__ import annotations
  import unittest
  import torch
  from parameterized import parameterized
  from monai.networks import eval_mode
  from monai.networks.blocks.encoder import BaseEncoder
  from monai.networks.nets import FLEXUNET_BACKBONE, EfficientNetBNFeatures, FlexibleUNet, FlexUNetEncoderRegister, ResNet, ResNetBlock, ResNetBottleneck
  from monai.utils import optional_import
  from tests.utils import skip_if_downloading_fails, skip_if_quick
label_desc: Use image node_id 3 for calling a global function with example usage: make_shape_cases(models, spatial_dims, batches, pretrained, in_channels, num_classes, input_shape, norm, upsample) and returns: ret_tests