code: def test_random_crop():
      cropper = RandomCrop(scale=(0.5, 1.0), ratio=(0.75, 1.33))
      input_t = torch.ones((3, 50, 50), dtype=torch.float32)
      boxes = np.array([[15, 20, 35, 30]])
      img, target = cropper(input_t, dict(boxes=boxes))
      # Check the scale
      assert (
          img.shape[-1] * img.shape[-2]
          >= 0.4 * input_t.shape[-1] * input_t.shape[-2]
      )
      # Check aspect ratio
      assert 0.65 <= img.shape[-2] / img.shape[-1] <= 1.5
      # Check the target
      assert np.all(target["boxes"] >= 0)
      assert np.all(
          target["boxes"][:, [0, 2]] <= img.shape[-1]
      ) and np.all(target["boxes"][:, [1, 3]] <= img.shape[-2])
  
file_path: doctr/tests/pytorch/test_transforms_pt.py
imports: import math
  import numpy
  import pytest
  import torch
  from doctr.transforms import ChannelShuffle, ColorInversion, GaussianNoise, RandomCrop, RandomHorizontalFlip, RandomRotate, RandomShadow, Resize
  from doctr.transforms.functional import crop_detection, rotate_sample
label_desc: Use image node_id 6 for calling a global function with example usage: test_random_crop() without return types