code: def __getattr__(self, name):
      # XXX: We choose to rewrite `__getattr__` here because it is simpler.
      # However, this may cause performance drop.
      # First try to find the attribute in `self._optim`
      try:
          return getattr(self._optim, name)
      except AttributeError:
          # If an attribute is not found in `self._optim`, search it in the internal optimizer
          real_optim = self._optim.user_defined_optimizer
          if not hasattr(real_optim, name):
              raise AttributeError
          else:
              return getattr(real_optim, name)
  
file_path: PaddleSeg/contrib/PanopticSeg/paddlepanseg/core/train.py
imports: import os
  import time
  import shutil
  from collections import deque
  import paddle
  from paddleseg.utils import TimeAverager, calculate_eta, resume, logger, worker_init_fn, train_profiler, op_flops_funs
  from paddlepanseg.core.val import evaluate
  from paddlepanseg.core.runner import PanSegRunner
  from paddlepanseg.core.launcher import AMPLauncher
label_desc: Use image node_id 2 for calling the _DistOptimizerWrapper obj's underlying member method code with example usage: obj.__getattr__(name) and returns: getattr, getattr