class_docstr: Class for processing and loading Vocoder training examples.
  
  Args:
      dataset_meta: Dict of dataset names (string) to dataset metadata.
      sample_rate: Sample rate to load audio as. If the audio is stored at a different sample rate, then it will
          be resampled.
      n_samples: Optional int, if provided then n_samples samples will be randomly sampled from the full
          audio file.
      weighted_sampling_steps_per_epoch: Optional int, If provided, then data will be sampled (with replacement) based on
          the sample weights provided in the dataset metadata. If None, then sample weights will be ignored.
      feature_processors: Optional, list of feature processors to run on training examples.
      min_duration: Optional float, if provided audio files in the training manifest shorter than 'min_duration'
          will be ignored.
      max_duration: Optional float, if provided audio files in the training manifest longer than 'max_duration'
          will be ignored.
      trunc_duration: Optional int, if provided audio will be truncated to at most 'trunc_duration' seconds.
      volume_norm: Whether to apply volume normalization to loaded audio.
code: def get_sampler(
      self, batch_size: int, world_size: int
  ) -> Optional[torch.utils.data.Sampler]:
      if not self.weighted_sampling_steps_per_epoch:
          return None
  
      sampler = get_weighted_sampler(
          sample_weights=self.sample_weights,
          batch_size=batch_size,
          world_size=world_size,
          num_steps=self.weighted_sampling_steps_per_epoch,
      )
      return sampler
  
imports: import io
  import os
  from dataclasses import dataclass
  from pathlib import Path
  from typing import Dict, List, Optional
  import librosa
  import soundfile
  import torch.utils.data
  import webdataset
  from nemo.collections.asr.data.audio_to_text import expand_sharded_filepaths
  from nemo.collections.asr.parts.preprocessing.segment import available_formats
  from nemo.collections.asr.parts.utils.manifest_utils import read_manifest
  from nemo.collections.tts.parts.preprocessing.feature_processors import FeatureProcessor
  from nemo.collections.tts.parts.utils.tts_dataset_utils import filter_dataset_by_duration, get_weighted_sampler, load_audio, sample_audio, stack_tensors
  from nemo.core.classes import Dataset, IterableDataset
  from nemo.utils import logging
  from nemo.utils.decorators import experimental
label_desc: Use image node_id 2 for calling the VocoderDataset obj's underlying member method code with example usage: obj.get_sampler(batch_size, world_size) and returns: sampler, None