code: def expand_spatial_params(input_param, spatial_rank, param_type=int):
      """
      Expand input parameter
      e.g., ``kernel_size=3`` is converted to ``kernel_size=[3, 3, 3]``
      for 3D images (when ``spatial_rank == 3``).
      """
      spatial_rank = int(spatial_rank)
      try:
          if param_type == int:
              input_param = int(input_param)
          else:
              input_param = float(input_param)
          return (input_param,) * spatial_rank
      except (ValueError, TypeError):
          pass
      try:
          if param_type == int:
              input_param = (
                  np.asarray(input_param)
                  .flatten()
                  .astype(np.int)
                  .tolist()
              )
          else:
              input_param = (
                  np.asarray(input_param)
                  .flatten()
                  .astype(np.float)
                  .tolist()
              )
      except (ValueError, TypeError):
          # skip type casting if it's a TF tensor
          pass
      assert (
          len(input_param) >= spatial_rank
      ), "param length should be at least have the length of spatial rank"
      return tuple(input_param[:spatial_rank])
  
imports: from __future__ import absolute_import, print_function
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: expand_spatial_params(input_param, spatial_rank, param_type) and returns: tuple, unknown