code: def _hasattr(obj, attr_name):
      try:
          getattr(obj, attr_name)
      except AttributeError:
          return False
      else:
          return True
  
file_path: tensorflow-upstream/tensorflow/python/ops/rnn_cell_impl.py
imports: from tensorflow.python.eager import context
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.keras.layers.legacy_rnn import rnn_cell_impl
  from tensorflow.python.ops import array_ops
  from tensorflow.python.util import nest
label_desc: Use image node_id 3 for calling a global function with example usage: _hasattr(obj, attr_name) and returns: True, False