code: def get_item_from_obj(config: dict, name_path: str) -> object:
      """
      Follow the name_path to get values from config
      For example:
      If we follow the example in in the Parameters section,
          Timestamp('2008-01-02 00:00:00') will be returned
  
      Parameters
      ----------
      config : dict
          e.g.
          {'dataset': {'class': 'DatasetH',
            'kwargs': {'handler': {'class': 'Alpha158',
                                   'kwargs': {'end_time': '2020-08-01',
                                              'fit_end_time': '<dataset.kwargs.segments.train.1>',
                                              'fit_start_time': '<dataset.kwargs.segments.train.0>',
                                              'instruments': 'csi100',
                                              'start_time': '2008-01-01'},
                                   'module_path': 'qlib.contrib.data.handler'},
                       'segments': {'test': (Timestamp('2017-01-03 00:00:00'),
                                             Timestamp('2019-04-08 00:00:00')),
                                    'train': (Timestamp('2008-01-02 00:00:00'),
                                              Timestamp('2014-12-31 00:00:00')),
                                    'valid': (Timestamp('2015-01-05 00:00:00'),
                                              Timestamp('2016-12-30 00:00:00'))}}
          }}
      name_path : str
          e.g.
          "dataset.kwargs.segments.train.1"
  
      Returns
      -------
      object
          the retrieved object
      """
      cur_cfg = config
      for k in name_path.split("."):
          if isinstance(cur_cfg, dict):
              cur_cfg = cur_cfg[k]  # may raise KeyError
          elif k.isdigit():
              cur_cfg = cur_cfg[int(k)]  # may raise IndexError
          else:
              raise ValueError(f"Error when getting {k} from cur_cfg")
      return cur_cfg
  
imports: from __future__ import division
  from __future__ import print_function
  import os
  import re
  import copy
  import json
  import yaml
  import redis
  import bisect
  import struct
  import difflib
  import inspect
  import hashlib
  import datetime
  import requests
  import collections
  import numpy
  import pandas
  from pathlib import Path
  from typing import List, Union, Optional, Callable
  from packaging import version
  from .file import get_or_create_path, save_multiple_parts_file, unpack_archive_with_buffer, get_tmp_file_with_buffer
  from ..config import C
  from ..log import get_module_logger, set_log_with_config
  from .mod import get_module_by_module_path, split_module_path, get_callable_kwargs, get_cls_kwargs, init_instance_by_config, class_casting
label_desc: Use image node_id 33 for calling a global function with example usage: get_item_from_obj(config, name_path) and returns: cur_cfg