code: def get_reverse_list(
      ori_shape: List[int], transforms: List[Callable]
  ) -> List[tuple]:
      """
      get reverse list of transform.
  
      Args:
          ori_shape (list): Origin shape of image.
          transforms (list): List of transform.
  
      Returns:
          list: List of tuple, there are two format:
              ('resize', (h, w)) The image shape before resize,
              ('padding', (h, w)) The image shape before padding.
      """
      reverse_list = []
      h, w = ori_shape[0], ori_shape[1]
      for op in transforms:
          if op.__class__.__name__ in ["Resize", "ResizeByLong"]:
              reverse_list.append(("resize", (h, w)))
              h, w = op.target_size[0], op.target_size[1]
          if op.__class__.__name__ in ["Padding"]:
              reverse_list.append(("padding", (h, w)))
              w, h = op.target_size[0], op.target_size[1]
      return reverse_list
  
imports: import os
  from typing import Callable, Union, List, Tuple
  import cv2
  import paddle
  import PIL
  import numpy
  import paddle.nn.functional
  from scipy.sparse import csr_matrix
label_desc: Use image node_id 13 for calling a global function with example usage: get_reverse_list(ori_shape, transforms) and returns: reverse_list