code: def get_by_path(obj, path):
      """
      Iteratively get on obj for each key in path.
  
      :param (list|dict) obj: The top-level object.
      :param (tuple[str]|tuple[int]) path: Keys to access parts of obj.
  
      :return: (*)
  
      Example:
  
          >>> figure = {'data': [{'x': [5]}]}
          >>> path = ('data', 0, 'x')
          >>> get_by_path(figure, path)
          [5]
      """
      for key in path:
          obj = obj[key]
      return obj
  
file_path: catboost/contrib/python/plotly/py2/plotly/utils.py
imports: from __future__ import absolute_import, division
  import textwrap
  from pprint import PrettyPrinter
  from _plotly_utils.utils import *
  from _plotly_utils.data_utils import *
label_desc: Use image node_id 3 for calling a global function with example usage: get_by_path(obj, path) and returns: obj