code: def safe_hasattr(obj, attr):
      """In recent versions of Python, hasattr() only catches AttributeError.
      This catches all errors.
      """
      try:
          getattr(obj, attr)
          return True
      except:
          return False
  
imports: import inspect
  import types
label_desc: Use image node_id 1 for calling a global function with example usage: safe_hasattr(obj, attr) and returns: True, False