code: def recursive_getattr(obj, attr, *args):
      """
      Recursive call to getattr for nested attributes.
      """
  
      def _getattr(obj, attr):
          return getattr(obj, attr, *args)
  
      return functools.reduce(_getattr, [obj] + attr.split("."))
  
imports: from collections import deque, OrderedDict
  from typing import Union, Optional, Set, Any, Dict, List, Tuple
  from datetime import timedelta
  import functools
  import math
  import time
  import re
  import shutil
  import json
  import os
  from parlai.core.message import Message
  from parlai.utils.strings import colorize
  from parlai.utils.io import PathManager
  import parlai.utils.logging
label_desc: Use image node_id 16 for calling a global function with example usage: recursive_getattr(obj, attr) and returns: functools, getattr