code: def recurse_getattr(obj, attr: str):
      """
      Recursive `getattr`.
  
      Args:
          obj:
              A class instance holding the attribute.
          attr (`str`):
              The attribute that is to be retrieved, e.g. 'attribute1.attribute2'.
      """
  
      def _getattr(obj, attr):
          return getattr(obj, attr)
  
      return functools.reduce(_getattr, [obj] + attr.split("."))
  
label_desc: Use image node_id 1 for calling a global function with example usage: recurse_getattr(obj, attr) and returns: functools, getattr