code: def random_crop(lq, hq, sf=4, lq_patchsize=64):
      h, w = lq.shape[:2]
      rnd_h = random.randint(0, h - lq_patchsize)
      rnd_w = random.randint(0, w - lq_patchsize)
      lq = lq[
          rnd_h : rnd_h + lq_patchsize, rnd_w : rnd_w + lq_patchsize, :
      ]
  
      rnd_h_H, rnd_w_H = int(rnd_h * sf), int(rnd_w * sf)
      hq = hq[
          rnd_h_H : rnd_h_H + lq_patchsize * sf,
          rnd_w_H : rnd_w_H + lq_patchsize * sf,
          :,
      ]
      return lq, hq
  
imports: import random
  from functools import partial
  import albumentations
  import cv2
  import ldm.modules.image_degradation.utils_image
  import numpy
  import scipy
  import scipy.stats
  import torch
  from scipy import ndimage
  from scipy.interpolate import interp2d
  from scipy.linalg import orth
label_desc: Use image node_id 22 for calling a global function with example usage: random_crop(lq, hq, sf, lq_patchsize) and returns: lq,  hq