class_docstr: Variably-size multi-scale batch sampler <https://arxiv.org/abs/2110.02178?context=cs.LG>` for data parallel.
  This sampler yields batches with variable spatial resolution and batch size.
  
  Args:
      opts: command line argument
      n_data_samples: Number of samples in the dataset
      is_training: Training or validation mode. Default: False
class_docstr_tok: ["Variably-size","multi-scale","batch","sampler","<","https",":","\/\/arxiv.org\/abs\/2110.02178","?","context=cs.LG",">","`","for","data","parallel",".","This","sampler","yields","batches","with","variable","spatial","resolution","and","batch","size",".","Args",":","opts",":","command","line","argument","n_data_samples",":","Number","of","samples","in","the","dataset","is_training",":","Training","or","validation","mode",".","Default",":","False"]
code: def add_arguments(
      cls, parser: argparse.ArgumentParser
  ) -> argparse.ArgumentParser:
      if cls != VariableBatchSampler:
          # Don't re-register arguments in subclasses that don't override `add_arguments()`.
          return parser
      group = parser.add_argument_group(cls.__name__)
      group.add_argument(
          "--sampler.vbs.crop-size-width",
          default=DEFAULT_IMAGE_WIDTH,
          type=int,
          help=f"Base crop size (along width) during training. Defaults to {DEFAULT_IMAGE_WIDTH}.",
      )
      group.add_argument(
          "--sampler.vbs.crop-size-height",
          default=DEFAULT_IMAGE_HEIGHT,
          type=int,
          help=f"Base crop size (along height) during training. Defaults to {DEFAULT_IMAGE_HEIGHT}.",
      )
  
      group.add_argument(
          "--sampler.vbs.min-crop-size-width",
          default=160,
          type=int,
          help="Min. crop size along width during training. Defaults to 160.",
      )
      group.add_argument(
          "--sampler.vbs.max-crop-size-width",
          default=320,
          type=int,
          help="Max. crop size along width during training. Defaults to 320.",
      )
  
      group.add_argument(
          "--sampler.vbs.min-crop-size-height",
          default=160,
          type=int,
          help="Min. crop size along height during training. Defaults to 160.",
      )
      group.add_argument(
          "--sampler.vbs.max-crop-size-height",
          default=320,
          type=int,
          help="Max. crop size along height during training. Defaults to 320.",
      )
      group.add_argument(
          "--sampler.vbs.max-n-scales",
          default=5,
          type=int,
          help="Max. scales in variable batch sampler. Defaults to 5.",
      )
      group.add_argument(
          "--sampler.vbs.check-scale",
          default=32,
          type=int,
          help="Image scales should be divisible by this factor. Defaults to 32.",
      )
      group.add_argument(
          "--sampler.vbs.ep-intervals",
          default=[40],
          type=int,
          help="Epoch intervals at which scales should be adjusted. Defaults to 40.",
      )
      group.add_argument(
          "--sampler.vbs.min-scale-inc-factor",
          default=1.0,
          type=float,
          help="Factor by which we should increase the minimum scale. Defaults to 1.0",
      )
      group.add_argument(
          "--sampler.vbs.max-scale-inc-factor",
          default=1.0,
          type=float,
          help="Factor by which we should increase the maximum scale. Defaults to 1.0",
      )
      group.add_argument(
          "--sampler.vbs.scale-inc",
          action="store_true",
          default=False,
          help="Increase image scales during training. Defaults to False.",
      )
  
      return parser
  
imports: import argparse
  import random
  from typing import Iterator, Tuple
  from common import DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH
  from data.sampler import SAMPLER_REGISTRY
  from data.sampler.base_sampler import BaseSampler, BaseSamplerDDP
  from data.sampler.utils import image_batch_pairs
  from utils import logger
label_desc: Use image node_id 5 for calling the VariableBatchSampler obj's underlying member method code with example usage: obj.add_arguments(cls, parser) and returns: parser, parser