code: def test_east_random_crop(self, mock_randint):
      # test randomcrop
      randcrop = RandomCrop(min_side_ratio=0.5)
      mock_randint.side_effect = [0, 0, 0, 0, 30, 0, 0, 0, 15]
      crop_results = randcrop(self.data_info)
      polygon_target = np.array(
          [5.0, 5.0, 25.0, 5.0, 25.0, 10.0, 5.0, 10.0]
      )
      bbox_target = np.array([[5.0, 5.0, 25.0, 10.0]])
      self.assertEqual(crop_results["img"].shape, (15, 30, 3))
      self.assertEqual(crop_results["img_shape"], (15, 30))
      self.assertTrue(
          np.allclose(crop_results["gt_bboxes"], bbox_target)
      )
      self.assertEqual(crop_results["gt_bboxes"].shape, (1, 4))
      self.assertEqual(len(crop_results["gt_polygons"]), 1)
      self.assertTrue(
          np.allclose(crop_results["gt_polygons"][0], polygon_target)
      )
      self.assertEqual(crop_results["gt_bboxes_labels"][0], 0)
      self.assertTrue(crop_results["gt_ignored"][0])
      self.assertEqual(crop_results["gt_texts"][0], "text1")
  
      # test resize
      resize = Resize(scale=(30, 30), keep_ratio=True)
      resize_results = resize(crop_results)
      self.assertEqual(resize_results["img"].shape, (15, 30, 3))
      self.assertEqual(crop_results["img_shape"], (15, 30))
      self.assertEqual(crop_results["scale"], (30, 30))
      self.assertEqual(crop_results["scale_factor"], (1.0, 1.0))
      self.assertTrue(crop_results["keep_ratio"])
  
      # test pad
      pad = Pad(size=(30, 30))
      pad_results = pad(resize_results)
      self.assertEqual(pad_results["img"].shape, (30, 30, 3))
      self.assertEqual(pad_results["pad_shape"], (30, 30, 3))
      self.assertEqual(pad_results["img"].sum(), 15 * 30 * 3)
  
imports: import copy
  import unittest
  import unittest.mock
  import numpy
  from mmcv.transforms import Pad, RandomResize
  from mmocr.datasets.transforms import BoundedScaleAspectJitter, RandomCrop, RandomFlip, Resize, ShortScaleAspectJitter, SourceImagePad, TextDetRandomCrop, TextDetRandomCropFlip
  from mmocr.utils import bbox2poly, poly2shapely
label_desc: Use image node_id 2 for calling the TestEastRandomCrop obj's underlying member method code with example usage: obj.test_east_random_crop(mock_randint) without return types