code: def get_iterator_from_config(config: dict, data: dict):
      """Create iterator (from config) for specified data."""
      iterator_config = {
          k: resolve(v) for k, v in config["dataset_iterator"].items()
      }
      iterator: Union[
          DataLearningIterator, DataFittingIterator
      ] = get_model(iterator_config.pop("class_name"))(
          **iterator_config, data=data
      )
      return iterator
  
file_path: DeepPavlov/deeppavlov/core/commands/train.py
imports: from logging import getLogger
  from pathlib import Path
  from typing import Dict, Union, Optional, Iterable
  from deeppavlov.core.commands.utils import expand_path, import_packages, parse_config
  from deeppavlov.core.common.errors import ConfigError
  from deeppavlov.core.common.params import resolve
  from deeppavlov.core.common.registry import get_model
  from deeppavlov.core.data.data_fitting_iterator import DataFittingIterator
  from deeppavlov.core.data.data_learning_iterator import DataLearningIterator
  from deeppavlov.core.data.utils import get_all_elems_from_json
  from deeppavlov.download import deep_download
  from deeppavlov.utils.pip_wrapper import install_from_config
label_desc: Use image node_id 2 for calling a global function with example usage: get_iterator_from_config(config, data) and returns: iterator