code: def _hasattr(obj, attr_name):
      try:
          getattr(obj, attr_name)
      except AttributeError:
          return False
      else:
          return True
  
imports: import tensorflow.compat.v1
  import tf_slim
  from tensorflow.python.ops import gen_nn_ops
label_desc: Use image node_id 1 for calling a global function with example usage: _hasattr(obj, attr_name) and returns: True, False