code: def yield_flat_paths(nest, expand_composites=False):
      """Yields paths for some nested structure.
  
      Paths are lists of objects which can be str-converted, which may include
      integers or other types which are used as indices in a dict.
  
      The flat list will be in the corresponding order as if you called
      `flatten` on the structure. This is handy for naming Tensors such
      the TF scope structure matches the tuple structure.
  
      E.g. if we have a tuple `value = Foo(a=3, b=Bar(c=23, d=42))`
  
      >>> Foo = collections.namedtuple('Foo', ['a', 'b'])
      >>> Bar = collections.namedtuple('Bar', ['c', 'd'])
      >>> value = Foo(a=3, b=Bar(c=23, d=42))
  
      >>> flatten(value)
      [3, 23, 42]
  
      >>> list(yield_flat_paths(value))
      [('a',), ('b', 'c'), ('b', 'd')]
  
      >>> list(yield_flat_paths({'a': [3]}))
      [('a', 0)]
  
      >>> list(yield_flat_paths({'a': 3}))
      [('a',)]
  
      Args:
        nest: the value to produce a flattened paths list for.
        expand_composites: Python bool included for compatibility; `True` values
          are not supported.
      Yields:
        Tuples containing index or key values which form the path to a specific
          leaf value in the nested structure.
      """
      for k, _ in flatten_with_tuple_paths(
          nest, expand_composites=expand_composites
      ):
          yield k
  
imports: import collections
  from collections import abc
  import types
  import tree
label_desc: Use image node_id 15 for calling a global function with example usage: yield_flat_paths(nest, expand_composites) without return types