code: def safe_getattr(object, name, default):
      """Like getattr but return default upon any Exception or any OutcomeException.
  
      Attribute access can potentially fail for 'evil' Python objects.
      See issue #214.
      It catches OutcomeException because of #2490 (issue #580), new outcomes are derived from BaseException
      instead of Exception (for more details check #2707)
      """
      try:
          return getattr(object, name, default)
      except TEST_OUTCOME:
          return default
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import codecs
  import functools
  import inspect
  import re
  import sys
  from contextlib import contextmanager
  import attr
  import py
  import six
  from six import text_type
  import _pytest
  from _pytest._io.saferepr import saferepr
  from _pytest.outcomes import fail
  from _pytest.outcomes import TEST_OUTCOME
label_desc: Use image node_id 14 for calling a global function with example usage: safe_getattr(object, name, default) and returns: getattr, default