code: def getattr2(object, attr):
      if not "." in attr:
          return getattr(object, attr)
      else:
          arr = attr.split(".")
          return getattr2(getattr(object, arr[0]), ".".join(arr[1:]))
  
file_path: NeMo/tests/collections/asr/test_asr_local_attn.py
imports: import os
  import shutil
  import tempfile
  import pytest
  import pytorch_lightning
  import torch
  from omegaconf import DictConfig
  from nemo.collections.asr.models import ASRModel, EncDecCTCModel
label_desc: Use image node_id 1 for calling a global function with example usage: getattr2(object, attr) and returns: getattr, getattr2