code: def get_random_crop(height, width, scale, ratio):
      area = height * width
      log_ratio = np.log(ratio)
      for _ in range(10):
          target_area = area * np.random.uniform(scale[0], scale[1])
          aspect_ratio = np.exp(
              np.random.uniform(log_ratio[0], log_ratio[1])
          )
          w = int(round(np.sqrt(target_area * aspect_ratio)))
          h = int(round(np.sqrt(target_area / aspect_ratio)))
          if 0 < w <= width and 0 < h <= height:
              i = int(np.random.uniform(0, height - h + 1))
              j = int(np.random.uniform(0, width - w + 1))
              return i, j, h, w
      in_ratio = float(width) / float(height)
      if in_ratio < min(ratio):
          w = width
          h = int(round(w / min(ratio)))
      elif in_ratio > max(ratio):
          h = height
          w = int(round(h * max(ratio)))
      else:
          w = width
          h = height
      i = (height - h) // 2
      j = (width - w) // 2
      return i, j, h, w
  
imports: from abc import ABCMeta, abstractmethod
  from dataclasses import replace
  from typing import Optional, Callable, TYPE_CHECKING, Tuple, Type
  import cv2
  import numpy
  from numba.typed import Dict
  from PIL.Image import Image
  from .base import Field, ARG_TYPE
  from ..pipeline.operation import Operation
  from ..pipeline.state import State
  from ..pipeline.compiler import Compiler
  from ..pipeline.allocation_query import AllocationQuery
  from ..libffcv import imdecode, memcpy, resize_crop
label_desc: Use image node_id 3 for calling a global function with example usage: get_random_crop(height, width, scale, ratio) and returns: i,  j,  h,  w, i,  j,  h,  w