code: def modcrop(img_in, scale):
      # img_in: Numpy, HWC or HW
      img = np.copy(img_in)
      if img.ndim == 2:
          H, W = img.shape
          H_r, W_r = H % scale, W % scale
          img = img[: H - H_r, : W - W_r]
      elif img.ndim == 3:
          H, W, C = img.shape
          H_r, W_r = H % scale, W % scale
          img = img[: H - H_r, : W - W_r, :]
      else:
          raise ValueError("Wrong img ndim: [{:d}].".format(img.ndim))
      return img
  
imports: import os
  import math
  import random
  import numpy
  import torch
  import cv2
  from torchvision.utils import make_grid
  from datetime import datetime
label_desc: Use image node_id 37 for calling a global function with example usage: modcrop(img_in, scale) and returns: img