code: def _get_nested_attr(obj: Any, attrs: Sequence[str]):
      if len(attrs) == 1:
          return getattr(obj, attrs[0])
      else:
          attr, *rest = attrs
          if not hasattr(obj, attr):
              raise AttributeError(
                  f"{obj} does not have {attr} attribute."
              )
          return _get_nested_attr(getattr(obj, attr), rest)
  
imports: import importlib
  from typing import Any, Sequence
label_desc: Use image node_id 2 for calling a global function with example usage: _get_nested_attr(obj, attrs) and returns: getattr, _get_nested_attr