code: def has_weights(obj):
      """Implicit check for Layer-like objects."""
      # TODO(b/110718070): Replace with isinstance(obj, base_layer.Layer).
      has_weight = hasattr(type(obj), "trainable_weights") and hasattr(
          type(obj), "non_trainable_weights"
      )
  
      return has_weight and not isinstance(obj, type)
  
file_path: tensorflow/tensorflow/python/trackable/layer_utils.py
imports: import collections
  import weakref
  from tensorflow.python.util import object_identity
label_desc: Use image node_id 2 for calling a global function with example usage: has_weights(obj) and returns: unknown