code: def get_dataset_itr(cfg, task):
      return task.get_batch_iterator(
          dataset=task.dataset(cfg.fairseq.dataset.gen_subset),
          max_tokens=cfg.fairseq.dataset.max_tokens,
          max_sentences=cfg.fairseq.dataset.batch_size,
          max_positions=(sys.maxsize, sys.maxsize),
          ignore_invalid_inputs=cfg.fairseq.dataset.skip_invalid_size_inputs_valid_test,
          required_batch_size_multiple=cfg.fairseq.dataset.required_batch_size_multiple,
          num_shards=cfg.fairseq.dataset.num_shards,
          shard_id=cfg.fairseq.dataset.shard_id,
          num_workers=cfg.fairseq.dataset.num_workers,
          data_buffer_size=cfg.fairseq.dataset.data_buffer_size,
      ).next_epoch_itr(shuffle=False)
  
imports: import ast
  from collections import namedtuple
  from dataclasses import dataclass, field
  from enum import Enum, auto
  import hydra
  from hydra.core.config_store import ConfigStore
  import logging
  import math
  import os
  from omegaconf import OmegaConf
  from typing import Optional
  import sys
  import editdistance
  import torch
  from hydra.core.hydra_config import HydraConfig
  from fairseq import checkpoint_utils, progress_bar, tasks, utils
  from fairseq.data.data_utils import post_process
  from fairseq.dataclass.configs import FairseqDataclass, FairseqConfig
  from fairseq.logging.meters import StopwatchMeter
  from omegaconf import open_dict
  from examples.speech_recognition.kaldi.kaldi_decoder import KaldiDecoderConfig
label_desc: Use image node_id 1 for calling a global function with example usage: get_dataset_itr(cfg, task) and returns: task