code: def get_nested_attr(__o: object, __name: str, *args) -> Any:
      """
      Get a nested named attribute from an object by a `.` separated name.
      rgetattr(x, 'y.z') is equivalent to getattr(getattr(x, 'y'), 'z') and x.y.z.
      """
  
      def _getattr(__o, __name):
          return getattr(__o, __name, *args)
  
      return reduce(_getattr, [__o] + __name.split("."))
  
imports: from functools import reduce
  from typing import Any, overload
label_desc: Use image node_id 3 for calling a global function with example usage: get_nested_attr(__o, __name) and returns: reduce, getattr