code: def random_boxes(num=1, scale=1, rng=None):
      """Simple version of ``kwimage.Boxes.random``
  
      Returns:
          Tensor: shape (n, 4) in x1, y1, x2, y2 format.
  
      References:
          https://gitlab.kitware.com/computer-vision/kwimage/blob/master/kwimage/structs/boxes.py#L1390
  
      Example:
          >>> num = 3
          >>> scale = 512
          >>> rng = 0
          >>> boxes = random_boxes(num, scale, rng)
          >>> print(boxes)
          tensor([[280.9925, 278.9802, 308.6148, 366.1769],
                  [216.9113, 330.6978, 224.0446, 456.5878],
                  [405.3632, 196.3221, 493.3953, 270.7942]])
      """
      rng = ensure_rng(rng)
  
      tlbr = rng.rand(num, 4).astype(np.float32)
  
      tl_x = np.minimum(tlbr[:, 0], tlbr[:, 2])
      tl_y = np.minimum(tlbr[:, 1], tlbr[:, 3])
      br_x = np.maximum(tlbr[:, 0], tlbr[:, 2])
      br_y = np.maximum(tlbr[:, 1], tlbr[:, 3])
  
      tlbr[:, 0] = tl_x * scale
      tlbr[:, 1] = tl_y * scale
      tlbr[:, 2] = br_x * scale
      tlbr[:, 3] = br_y * scale
  
      boxes = torch.from_numpy(tlbr)
      return boxes
  
file_path: mmdetection/mmdet/models/task_modules/samplers/sampling_result.py
imports: import warnings
  import numpy
  import torch
  from torch import Tensor
  from mmdet.structures.bbox import BaseBoxes, cat_boxes
  from mmdet.utils import util_mixins
  from mmdet.utils.util_random import ensure_rng
  from ..assigners import AssignResult
label_desc: Use image node_id 1 for calling a global function with example usage: random_boxes(num, scale, rng) and returns: boxes