code: def rand_bbox(img_shape, lam, margin=0.0, count=None):
      """Standard CutMix bounding-box
      Generates a random square bbox based on lambda value. This impl includes
      support for enforcing a border margin as percent of bbox dimensions.
      Args:
          img_shape (tuple): Image shape as tuple
          lam (float): Cutmix lambda value
          margin (float): Percentage of bbox dimension to enforce as margin
              (reduce amount of box outside image)
          count (int): Number of bbox to generate
      """
      ratio = np.sqrt(1 - lam)
      img_h, img_w = img_shape[-2:]
      cut_h, cut_w = int(img_h * ratio), int(img_w * ratio)
      margin_y, margin_x = int(margin * cut_h), int(margin * cut_w)
      cy = np.random.randint(0 + margin_y, img_h - margin_y, size=count)
      cx = np.random.randint(0 + margin_x, img_w - margin_x, size=count)
      yl = np.clip(cy - cut_h // 2, 0, img_h)
      yh = np.clip(cy + cut_h // 2, 0, img_h)
      xl = np.clip(cx - cut_w // 2, 0, img_w)
      xh = np.clip(cx + cut_w // 2, 0, img_w)
      return yl, yh, xl, xh
  
imports: import collections.abc
  from typing import Any, Dict, Optional
  import numpy
  import torch
  from classy_vision.generic.util import convert_to_one_hot
  from torch.distributions.beta import Beta
  from vissl.data.collators import register_collator
  from .moco_collator import moco_collator
  from .simclr_collator import simclr_collator
label_desc: Use image node_id 6 for calling a global function with example usage: rand_bbox(img_shape, lam, margin, count) and returns: yl,  yh,  xl,  xh