code: def has_nested(obj, attr, nested_lookup_fn=get_nested_objs):
      """Check if the object has a (nested) attribute.
  
      Args:
        obj: The object to find (nested) attributes in.
        attr: A `string` attribute name to search for.
        nested_lookup_fn: A single-argument callable that returns a list of
          (attribute name, nested object) pairs. Defaults to `get_nested_objs`.
  
      Returns:
        has_nested: Boolean if the attribute was found or not.
      """
      if hasattr(obj, attr):
          return True
      for _, nested in nested_lookup_fn(obj):
          if has_nested(
              nested, attr, nested_lookup_fn=nested_lookup_fn
          ):
              return True
      return False
  
file_path: probability/tensorflow_probability/python/internal/unnest.py
imports: import collections
label_desc: Use image node_id 2 for calling a global function with example usage: has_nested(obj, attr, nested_lookup_fn) and returns: False, True, True