class_docstr: Randomly select a region and crop images to a target size and make sure
  to contain text region. This transform may break up text instances, and for
  broken text instances, we will crop it's bbox and polygon coordinates. This
  transform is recommend to be used in segmentation-based network.
  
  Required Keys:
  
  - img
  - gt_polygons
  - gt_bboxes
  - gt_bboxes_labels
  - gt_ignored
  
  Modified Keys:
  
  - img
  - img_shape
  - gt_polygons
  - gt_bboxes
  - gt_bboxes_labels
  - gt_ignored
  
  Args:
      target_size (tuple(int, int) or int): Target size for the cropped
          image. If it's a tuple, then target width and target height will be
          ``target_size[0]`` and ``target_size[1]``, respectively. If it's an
          integer, them both target width and target height will be
          ``target_size``.
      positive_sample_ratio (float): The probability of sampling regions
          that go through text regions. Defaults to 5. / 8.
docstr: Sample a number in range [start, end].
  
  Args:
      start (int): Starting point.
      end (int): Ending point.
  
  Returns:
      (int): Sampled number.
docstr_tok: ["Sample","a","number","in","range","[","start",",","end","]",".","Args",":","start","(","int",")",":","Starting","point",".","end","(","int",")",":","Ending","point",".","Returns",":","(","int",")",":","Sampled","number","."]
code: def _sample_num(self, start, end):
      """Sample a number in range [start, end].
  
      Args:
          start (int): Starting point.
          end (int): Ending point.
  
      Returns:
          (int): Sampled number.
      """
      return random.randint(start, end)
  
imports: import math
  import random
  from typing import Dict, List, Sequence, Tuple, Union
  import cv2
  import mmcv
  import numpy
  from mmcv.transforms import RandomFlip
  from mmcv.transforms.base import BaseTransform
  from mmcv.transforms.utils import avoid_cache_randomness, cache_randomness
  from shapely.geometry import Polygon
  from mmocr.registry import TRANSFORMS
  from mmocr.utils import crop_polygon, poly2bbox, poly_intersection
label_desc: Use image node_id 3 for calling the TextDetRandomCrop obj's underlying member method code with example usage: obj._sample_num(start, end) and returns: random