code: def pad_shape(shape, must_be_divisible_by):
      if not isinstance(
          must_be_divisible_by, (tuple, list, np.ndarray)
      ):
          must_be_divisible_by = [must_be_divisible_by] * len(shape)
      else:
          assert len(must_be_divisible_by) == len(shape)
  
      new_shape = [
          shape[i]
          + must_be_divisible_by[i]
          - shape[i] % must_be_divisible_by[i]
          for i in range(len(shape))
      ]
  
      for i in range(len(shape)):
          if shape[i] % must_be_divisible_by[i] == 0:
              new_shape[i] -= must_be_divisible_by[i]
      new_shape = np.array(new_shape).astype(int)
      return new_shape
  
file_path: PaddleSeg/contrib/MedicalSeg/tools/preprocess_utils/experiment_utils.py
imports: import numpy
  from copy import deepcopy
label_desc: Use image node_id 1 for calling a global function with example usage: pad_shape(shape, must_be_divisible_by) and returns: new_shape