class_docstr: Resize image to a size determinned by `scale` and `size`.
  
  Args:
      size(tuple|list): The reference size to resize. A tuple or list with length 2.
      scale(tupel|list, optional): A range of scale base on `size`. A tuple or list with length 2. Default: None.
class_docstr_tok: ["Resize","image","to","a","size","determinned","by","`","scale","`","and","`","size","`",".","Args",":","size","(","tuple|list",")",":","The","reference","size","to","resize",".","A","tuple","or","list","with","length","2.","scale","(","tupel|list",",","optional",")",":","A","range","of","scale","base","on","`","size","`",".","A","tuple","or","list","with","length","2",".","Default",":","None","."]
code: def __init__(self, size=None, scale=None):
      if isinstance(size, list) or isinstance(size, tuple):
          if len(size) != 2:
              raise ValueError(
                  "`size` should include 2 elements, but it is {}".format(
                      size
                  )
              )
      elif size is not None:
          raise TypeError(
              "Type of `size` is invalid. It should be list or tuple, but it is {}".format(
                  type(size)
              )
          )
  
      if scale is not None:
          if isinstance(scale, list) or isinstance(scale, tuple):
              if len(scale) != 2:
                  raise ValueError(
                      "`scale` should include 2 elements, but it is {}".format(
                          scale
                      )
                  )
          else:
              raise TypeError(
                  "Type of `scale` is invalid. It should be list or tuple, but it is {}".format(
                      type(scale)
                  )
              )
      self.size = size
      self.scale = scale
  
imports: import os
  import random
  import string
  import cv2
  import numpy
  from paddleseg.transforms import functional
  from paddleseg.cvlibs import manager
  from paddleseg.utils import seg_env
  from PIL import Image
label_desc: Use image node_id 1 to create a new RandomResize object  with example: obj = RandomResize(size, scale)