code: def test_random_crop():
      transfo = T.RandomCrop(scale=(0.5, 1.0), ratio=(0.75, 1.33))
      input_t = tf.ones((50, 50, 3), dtype=tf.float32)
      boxes = np.array([[15, 20, 35, 30]])
      img, target = transfo(input_t, dict(boxes=boxes))
      # Check the scale (take a margin)
      assert (
          img.shape[0] * img.shape[1]
          >= 0.4 * input_t.shape[0] * input_t.shape[1]
      )
      # Check aspect ratio (take a margin)
      assert 0.65 <= img.shape[0] / 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[0])
  
imports: import math
  import numpy
  import pytest
  import tensorflow
  from doctr import transforms
  from doctr.transforms.functional import crop_detection, rotate_sample
label_desc: Use image node_id 16 for calling a global function with example usage: test_random_crop() without return types