code: def scaleCropBboxes(rectsIn, scaleFactor, imgWidth, imgHeight):
      if len(rectsIn) <= 0:
          return rectsIn
      else:
          rects = [
              [int(round(rect[i] / scaleFactor)) for i in range(4)]
              for rect in rectsIn
          ]
          rects = [
              Bbox(*rect).crop(imgWidth, imgHeight).rect()
              for rect in rects
          ]
          for rect in rects:
              assert Bbox(*rect).isValid()
          return rects
  
imports: from __future__ import print_function
  from builtins import chr
  import os, sys, importlib, shutil
  from cntk_helpers import *
label_desc: Use image node_id 2 for calling a global function with example usage: scaleCropBboxes(rectsIn, scaleFactor, imgWidth, imgHeight) and returns: rectsIn, rects