code: def rgetattr(obj, attr, *args):
      import functools
  
      def _getattr(obj, attr):
          return getattr(obj, attr, *args)
  
      return functools.reduce(_getattr, [obj] + attr.split("."))
  
imports: import numpy
  import torch
  import torch.nn
  import torch.utils.checkpoint
  import torch.nn.functional
label_desc: Use image node_id 1 for calling a global function with example usage: rgetattr(obj, attr) and returns: functools, getattr