code: def datasets_from_params(params):
      """
      Load all the datasets specified by the config.
      """
      dataset_reader = DatasetReader.from_params(
          params.pop("dataset_reader")
      )
      validation_dataset_reader_params = params.pop(
          "validation_dataset_reader", None
      )
  
      validation_and_test_dataset_reader = dataset_reader
      if validation_dataset_reader_params is not None:
          logger.info(
              "Using a separate dataset reader to load validation and test data."
          )
          validation_and_test_dataset_reader = (
              DatasetReader.from_params(
                  validation_dataset_reader_params
              )
          )
  
      train_data_path = params.pop("train_data_path")
      logger.info("Reading training data from %s", train_data_path)
      train_data = dataset_reader.read(train_data_path)
  
      datasets = {"train": train_data}
  
      validation_data_path = params.pop("validation_data_path", None)
      if validation_data_path is not None:
          logger.info(
              "Reading validation data from %s", validation_data_path
          )
          validation_data = validation_and_test_dataset_reader.read(
              validation_data_path
          )
          datasets["validation"] = validation_data
  
      test_data_path = params.pop("test_data_path", None)
      if test_data_path is not None:
          logger.info("Reading test data from %s", test_data_path)
          test_data = validation_and_test_dataset_reader.read(
              test_data_path
          )
          datasets["test"] = test_data
  
      return datasets
  
imports: from __future__ import with_statement
  from __future__ import absolute_import
  import argparse
  import json
  import logging
  import os
  import re
  import torch
  from allennlp.commands.evaluate import evaluate
  from allennlp.commands.subcommand import Subcommand
  from allennlp.common.checks import ConfigurationError, check_for_gpu
  from allennlp.common import Params
  from allennlp.common.util import prepare_environment, prepare_global_logging, get_frozen_and_tunable_parameter_names
  from allennlp.data import Vocabulary
  from allennlp.data.instance import Instance
  from allennlp.data.dataset_readers.dataset_reader import DatasetReader
  from allennlp.data.iterators.data_iterator import DataIterator
  from allennlp.models.archival import archive_model, CONFIG_NAME
  from allennlp.models.model import Model, _DEFAULT_WEIGHTS
  from allennlp.training.trainer import Trainer
  from io import open
label_desc: Use image node_id 3 for calling a global function with example usage: datasets_from_params(params) and returns: datasets