class_docstr: Task for joint training speech and text to text.
class_docstr_tok: ["Task","for","joint","training","speech","and","text","to","text","."]
code: def get_batch_iterator(
      self,
      dataset,
      max_tokens=None,
      max_sentences=None,
      max_positions=None,
      ignore_invalid_inputs=False,
      required_batch_size_multiple=1,
      seed=1,
      num_shards=1,
      shard_id=0,
      num_workers=0,
      epoch=0,
      data_buffer_size=0,
      disable_iterator_cache=False,
      skip_remainder_batch=False,
      grouped_shuffling=False,
      update_epoch_batch_itr=False,
  ):
      if not isinstance(dataset, MultiModalityDataset):
          return super(
              SpeechTextJointToTextTask, self
          ).get_batch_iterator(
              dataset,
              max_tokens,
              max_sentences,
              max_positions,
              ignore_invalid_inputs,
              required_batch_size_multiple,
              seed,
              num_shards,
              shard_id,
              num_workers,
              epoch,
              data_buffer_size,
              disable_iterator_cache,
              skip_remainder_batch=skip_remainder_batch,
              update_epoch_batch_itr=update_epoch_batch_itr,
          )
  
      mult_ratio = [
          self.args.speech_sample_ratio,
          self.args.text_sample_ratio,
      ]
      assert len(dataset.datasets) == 2
  
      # initialize the dataset with the correct starting epoch
      dataset.set_epoch(epoch)
  
      batch_samplers = dataset.get_batch_samplers(
          mult_ratio, required_batch_size_multiple, seed
      )
  
      # return a reusable, sharded iterator
      epoch_iter = GroupedEpochBatchIterator(
          dataset=dataset,
          collate_fn=dataset.collater,
          batch_samplers=batch_samplers,
          seed=seed,
          num_shards=num_shards,
          shard_id=shard_id,
          num_workers=num_workers,
          epoch=epoch,
          mult_rate=1
          if self.args.update_mix_data
          else max(self.args.update_freq),
          buffer_size=data_buffer_size,
          skip_remainder_batch=skip_remainder_batch,
      )
      self.dataset_to_epoch_iter[dataset] = {}  # refresh it every epoch
      return epoch_iter
  
imports: import logging
  import os
  from argparse import Namespace
  from pathlib import Path
  import torch
  from fairseq.data import encoders, Dictionary, ResamplingDataset, TransformEosLangPairDataset, ConcatDataset
  from fairseq.data.iterators import GroupedEpochBatchIterator
  from fairseq.data.audio.multi_modality_dataset import MultiModalityDataset, LangPairMaskDataset, ModalityDatasetItem
  from fairseq.data.audio.speech_to_text_dataset import SpeechToTextDataset, SpeechToTextDatasetCreator
  from fairseq.data.audio.speech_to_text_joint_dataset import S2TJointDataConfig, SpeechToTextJointDatasetCreator
  from fairseq.tasks import register_task
  from fairseq.tasks.speech_to_text import SpeechToTextTask
  from fairseq.tasks.translation import load_langpair_dataset
label_desc: Use image node_id 11 for calling the SpeechTextJointToTextTask obj's underlying member method code with example usage: obj.get_batch_iterator(dataset, max_tokens, max_sentences, max_positions, ignore_invalid_inputs, required_batch_size_multiple, seed, num_shards, shard_id, num_workers, epoch, data_buffer_size, disable_iterator_cache, skip_remainder_batch, grouped_shuffling, update_epoch_batch_itr) and returns: epoch_iter, super