class_docstr: DDP variant of BatchSampler
  
  Args:
      opts: command line argument
      n_data_samples: Number of samples in the dataset
      is_training: Training or validation mode. Default: False
code: def __init__(
      self,
      opts,
      n_data_samples: int,
      is_training: bool = False,
      *args,
      **kwargs,
  ) -> None:
      super().__init__(
          opts=opts,
          n_data_samples=n_data_samples,
          is_training=is_training,
      )
      crop_size_w: int = getattr(
          opts, "sampler.bs.crop_size_width", DEFAULT_IMAGE_WIDTH
      )
      crop_size_h: int = getattr(
          opts, "sampler.bs.crop_size_height", DEFAULT_IMAGE_HEIGHT
      )
  
      self.crop_size_w = crop_size_w
      self.crop_size_h = crop_size_h
  
file_path: ml-cvnets/data/sampler/batch_sampler.py
imports: import argparse
  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
label_desc: Use image node_id 1 to create a new BatchSamplerDDP object from inherited base classes: BaseSamplerDDP with example: obj = BatchSamplerDDP(opts, n_data_samples, is_training)