docstr: Read a dataset from a configuration object.
docstr_tok: ["Read","a","dataset","from","a","configuration","object","."]
code: def read_dataset(config: Union[dict, DictConfig]) -> Dataset:
      """Read a dataset from a configuration object."""
      if isinstance(config, dict):
          config = DictConfig(config)
      dataset_class = import_object(config.classpath)
      dataset_object = dataset_class(**config.args)  # type: ignore
      return dataset_object
  
imports: import datetime
  import hashlib
  import json
  import pickle
  from pathlib import Path
  from typing import Iterable, Optional, Tuple, Union
  from hpt import OptunaTuner
  from omegaconf import DictConfig, ListConfig
  from optuna.samplers import BaseSampler
  from ..datasets.dataset import Dataset
  from ..methods.inprocessing.inprocessing import InProcessing
  from ..methods.postprocessing.identity import Identity
  from ..methods.postprocessing.postprocessing import PostProcessing
  from ..methods.postprocessing.threshold import Threshold
  from ..methods.preprocessing.identity import Identity
  from ..methods.preprocessing.preprocessing import PreProcessing
  from ..optimization import ObjectiveFunction
  from ..utils import ConfigReader, create_logger, import_object
label_desc: Use image node_id 3 for calling the Experiment obj's underlying member method code with example usage: obj.read_dataset(config) and returns: dataset_object