code: def _adjust_bbox(img_shapes, bbox, ratio=1.1) -> List[int]:
      """
      Adapts bounding box coordinates so that they can be used by
      torchvision.transforms.functional.crop function.
  
      This also pads each bounding box according to the `ratio` parameter.
  
      :param img_shapes: a list of shapes, with each element in the format
          "[img.shape[0], img.shape[1]]".
      :param bbox: A list of elements in the format "[right, left, top, bottom]".
      :param ratio: The amount of padding. Defaults to "1.1".
  
      :returns: A list of adapted bounding box coordinates.
      """
      cw = bbox[0] - bbox[1]
      ch = bbox[2] - bbox[3]
      center = [int(bbox[1] + cw / 2), int(bbox[3] + ch / 2)]
      bbox = [
          min([int(center[0] + (cw * ratio / 2)), img_shapes[0]]),
          max([int(center[0] - (cw * ratio / 2)), 0]),
          min([int(center[1] + (ch * ratio / 2)), img_shapes[1]]),
          max([int(center[1] - (ch * ratio / 2)), 0]),
      ]
      return [bbox[3], bbox[1], bbox[2] - bbox[3], bbox[0] - bbox[1]]
  
file_path: avalanche/avalanche/benchmarks/classic/stream51.py
imports: from pathlib import Path
  from typing import List, Optional, Union
  from typing_extensions import Literal
  from avalanche.benchmarks.datasets import Stream51
  from avalanche.benchmarks.scenarios.deprecated.generic_benchmark_creation import create_generic_benchmark_from_paths, FileAndLabel
  from torchvision import transforms
  import math
  import os
label_desc: Use image node_id 1 for calling a global function with example usage: _adjust_bbox(img_shapes, bbox, ratio) and returns: list