code: def rhasattr(obj, attr, *args):
      import functools
  
      def _hasattr(obj, attr):
          if hasattr(obj, attr):
              return getattr(obj, attr)
          else:
              return None
  
      return (
          functools.reduce(_hasattr, [obj] + attr.split("."))
          is not None
      )
  
imports: import numpy
  import torch
  import torch.nn
  import torch.utils.checkpoint
  import torch.nn.functional
label_desc: Use image node_id 2 for calling a global function with example usage: rhasattr(obj, attr) and returns: unknown, getattr, None