code: def __init__(self, scale, aspect_ratio=None):
      assert isinstance(scale, collections.Iterable) and len(scale) == 2
      if (
          isinstance(scale, collections.Iterable)
          and len(scale) == 2
          and isinstance(scale[0], numbers.Number)
          and isinstance(scale[1], numbers.Number)
          and 0 < scale[0] < scale[1]
      ):
          self.scale = scale
      else:
          raise (
              RuntimeError(
                  "segtransform.RandScale() scale param error.\n"
              )
          )
      if aspect_ratio is None:
          self.aspect_ratio = aspect_ratio
      elif (
          isinstance(aspect_ratio, collections.Iterable)
          and len(aspect_ratio) == 2
          and isinstance(aspect_ratio[0], numbers.Number)
          and isinstance(aspect_ratio[1], numbers.Number)
          and 0 < aspect_ratio[0] < aspect_ratio[1]
      ):
          self.aspect_ratio = aspect_ratio
      else:
          raise (
              RuntimeError(
                  "segtransform.RandScale() aspect_ratio param error.\n"
              )
          )
  
imports: import random
  import math
  import numpy
  import numbers
  import collections
  import cv2
  import torch
  import time
label_desc: Use image node_id 1 to create a new RandScale object from inherited base classes: object with example: obj = RandScale(scale, aspect_ratio)