code: def test_transform(self, mock_randint, mock_sample):
      # test target size is equal to image size
      trans = TextDetRandomCrop(target_size=(5, 5))
      data_info = self.data_info.copy()
      results = trans(data_info)
      self.assertDictEqual(results, data_info)
  
      mock_sample.side_effect = [0.1]
      mock_randint.side_effect = [1, 1]
      trans = TextDetRandomCrop(target_size=(3, 3))
      data_info = self.data_info.copy()
      results = trans(data_info)
      box_target = np.array([1, 1, 3, 3])
      polygon_target = np.array([1, 1, 3, 1, 3, 3, 1, 3])
      self.assertEqual(results["img"].shape, (3, 3, 1))
      self.assertEqual(results["img_shape"], (3, 3))
      self.assertTrue(
          poly2shapely(bbox2poly(box_target)).equals(
              poly2shapely(bbox2poly(results["gt_bboxes"][0]))
          )
      )
      self.assertTrue(
          poly2shapely(polygon_target).equals(
              poly2shapely(results["gt_polygons"][0])
          )
      )
  
      self.assertTrue(results["gt_bboxes_labels"] == np.array([0]))
      self.assertTrue(results["gt_ignored"][0])
  
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 5 for calling the TestTextDetRandomCrop obj's underlying member method code with example usage: obj.test_transform(mock_randint, mock_sample) without return types