class_docstr: A tool for image augmentation.
  
  For operations with inplace=True, the returned value is the ImageTool
  instance self, which is for chaining multiple operations; Otherwise, the
  preprocessed images would be returned.
  
  For operations that has countable pre-processing cases, argument num_case
  could be set to decide the number of pre-processing cases to apply.
  Typically, it is set to 1 for training phases and to the max for test
  phases.
class_docstr_tok: ["A","tool","for","image","augmentation",".","For","operations","with","inplace=True",",","the","returned","value","is","the","ImageTool","instance","self",",","which","is","for","chaining","multiple","operations",";","Otherwise",",","the","preprocessed","images","would","be","returned",".","For","operations","that","has","countable","pre-processing","cases",",","argument","num_case","could","be","set","to","decide","the","number","of","pre-processing","cases","to","apply",".","Typically",",","it","is","set","to","1","for","training","phases","and","to","the","max","for","test","phases","."]
docstr: Crop of the image at a random size between 0.08 to 1 of input image
      and random aspect ratio between 3/4 to 4/3.
      This crop is then resized to the given patch size.
  
  Args:
      patch(tuple): width and height of the patch
      inplace(Boolean): replace the internal images list with the patches
                        if True; otherwise, return the patches.
code: def random_crop_resize(self, patch, inplace=True):
      """Crop of the image at a random size between 0.08 to 1 of input image
          and random aspect ratio between 3/4 to 4/3.
          This crop is then resized to the given patch size.
  
      Args:
          patch(tuple): width and height of the patch
          inplace(Boolean): replace the internal images list with the patches
                            if True; otherwise, return the patches.
      """
      new_imgs = []
      for img in self.imgs:
          area = img.size[0] * img.size[1]
          img_resized = None
          for attempt in range(10):
              target_area = random.uniform(0.08, 1.0) * area
              aspect_ratio = random.uniform(3.0 / 4, 4.0 / 3)
              crop_x = int(round(math.sqrt(target_area * aspect_ratio)))
              crop_y = int(round(math.sqrt(target_area / aspect_ratio)))
              if img.size[0] > crop_x and img.size[1] > crop_y:
                  left_offset = random.randint(0, img.size[0] - crop_x)
                  top_offset = random.randint(0, img.size[1] - crop_y)
                  box = (
                      left_offset,
                      top_offset,
                      left_offset + crop_x,
                      top_offset + crop_y,
                  )
                  img_croped = img.crop(box)
                  img_resized = img_croped.resize(patch, Image.BILINEAR)
                  break
          if img_resized is None:
              img_resized = img.resize(patch, Image.BILINEAR)
          new_imgs.append(img_resized)
  
      if inplace:
          self.imgs = new_imgs
          return self
      else:
          return new_imgs
  
imports: from __future__ import division
  from builtins import range
  from builtins import object
  import random
  import numpy
  from PIL import Image, ImageEnhance
  import math
label_desc: Use image node_id 19 for calling the ImageTool obj's underlying member method code with example usage: obj.random_crop_resize(patch, inplace) and returns: self, new_imgs