code: def get_random_bounding_box(
      image_shape: Tuple[int, int],
      ratio: jnp.ndarray,
      rng: Any,
      margin: float = 0.0,
  ) -> Tuple[int, int, int, int]:
      """Returns a random bounding box for Cutmix.
  
      Based on the implementation in timm:
      https://github.com/rwightman/pytorch-image-models/blob/master/timm/data/mixup.py
  
      Args:
        image_shape: The shape of the image, specified as [height, width].
        ratio: Ratio of the input height/width to use as the maximum dimensions of
          the randomly sampled bounding box.
        rng: JAX rng key.
        margin: Percentage of bounding box dimension to enforce as the margin.
          This reduces the amount of the bounding box outside the image.
  
      Returns:
        The bounding box parameterised as y_min, y_max, x_min, x_max.
      """
      img_h, img_w = image_shape
      cut_h, cut_w = (img_h * ratio).astype(int), (
          img_w * ratio
      ).astype(int)
      margin_y, margin_x = (margin * cut_h).astype(int), (
          margin * cut_w
      ).astype(int)
      rngx, rngy = jax.random.split(rng)
      cy = jax.random.randint(rngy, [1], 0 + margin_y, img_h - margin_y)
      cx = jax.random.randint(rngx, [1], 0 + margin_x, img_w - margin_x)
  
      y_min = jnp.clip(cy - cut_h // 2, 0, img_h)[0]
      y_max = jnp.clip(cy + cut_h // 2, 0, img_h)[0]
      x_min = jnp.clip(cx - cut_w // 2, 0, img_w)[0]
      x_max = jnp.clip(cx + cut_w // 2, 0, img_w)[0]
      return y_min, y_max, x_min, x_max
  
file_path: scenic/scenic/projects/objectvivit/train_utils.py
imports: from typing import Any, Dict, Tuple
  from absl import logging
  import jax
  import jax.numpy
  import numpy
  from scenic.model_lib.base_models import model_utils
label_desc: Use image node_id 1 for calling a global function with example usage: get_random_bounding_box(image_shape, ratio, rng, margin) and returns: y_min,  y_max,  x_min,  x_max