code: def get_pool_and_conv_props(
      spacing, patch_size, min_feature_map_size, max_numpool
  ):
      dim = len(spacing)
      current_spacing = deepcopy(list(spacing))
      current_size = deepcopy(list(patch_size))
  
      pool_op_kernel_sizes = []
      conv_kernel_sizes = []
  
      num_pool_per_axis = [0] * dim
  
      while True:
          min_spacing = min(current_spacing)
          valid_axes_for_pool = [
              i
              for i in range(dim)
              if current_spacing[i] / min_spacing < 2
          ]
          axes = []
          for a in range(dim):
              my_spacing = current_spacing[a]
              partners = [
                  i
                  for i in range(dim)
                  if current_spacing[i] / my_spacing < 2
                  and my_spacing / current_spacing[i] < 2
              ]
              if len(partners) > len(axes):
                  axes = partners
          conv_kernel_size = [3 if i in axes else 1 for i in range(dim)]
  
          valid_axes_for_pool = [
              i
              for i in valid_axes_for_pool
              if current_size[i] >= 2 * min_feature_map_size
          ]
  
          valid_axes_for_pool = [
              i
              for i in valid_axes_for_pool
              if num_pool_per_axis[i] < max_numpool
          ]
  
          if len(valid_axes_for_pool) == 0:
              break
  
          other_axes = [
              i for i in range(dim) if i not in valid_axes_for_pool
          ]
  
          pool_kernel_sizes = [0] * dim
          for v in valid_axes_for_pool:
              pool_kernel_sizes[v] = 2
              num_pool_per_axis[v] += 1
              current_spacing[v] *= 2
              current_size[v] = np.ceil(current_size[v] / 2)
          for nv in other_axes:
              pool_kernel_sizes[nv] = 1
  
          pool_op_kernel_sizes.append(pool_kernel_sizes)
          conv_kernel_sizes.append(conv_kernel_size)
  
      must_be_divisible_by = get_shape_must_be_divisible_by(
          num_pool_per_axis
      )
      patch_size = pad_shape(patch_size, must_be_divisible_by)
  
      conv_kernel_sizes.append([3] * dim)
      return (
          num_pool_per_axis,
          pool_op_kernel_sizes,
          conv_kernel_sizes,
          patch_size,
          must_be_divisible_by,
      )
  
file_path: PaddleSeg/contrib/MedicalSeg/tools/preprocess_utils/experiment_utils.py
imports: import numpy
  from copy import deepcopy
label_desc: Use image node_id 5 for calling a global function with example usage: get_pool_and_conv_props(spacing, patch_size, min_feature_map_size, max_numpool) and returns: num_pool_per_axis,  pool_op_kernel_sizes,  conv_kernel_sizes,  patch_size,  must_be_divisible_by