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: This is a union of patch_5 and patch_and_scale.
  
  You can follow this example to union any num of cases of imgtool methods
code: def crop8(self, patch, num_case=1, inplace=True):
      """This is a union of patch_5 and patch_and_scale.
  
      You can follow this example to union any num of cases of imgtool methods
      """
      patch5 = 5
      patch3 = 3
      if num_case < 1 or num_case > patch5 + patch3:
          raise Exception(
              "num_case must be in [0,%d]" % (patch5 + patch3)
          )
      if num_case == patch5 + patch3:
          count = patch5
      else:
          sample_list = list(range(0, patch5 + patch3))
          samples = get_list_sample(sample_list, num_case)
          count = 0
          for s in samples:
              if s < patch5:
                  count += 1
      new_imgs = []
      if count > 0:
          new_imgs += self.crop5(patch, count, False)
      if num_case - count > 0:
          new_imgs += self.crop3(patch, num_case - count, False)
  
      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 17 for calling the ImageTool obj's underlying member method code with example usage: obj.crop8(patch, num_case, inplace) and returns: self, new_imgs