code: def iterate_flattened(d):
      
      for key in sorted(d.keys()):
          value = d[key]
          if isinstance(value, dict) and value:
              for k, v in iterate_flattened(d[key]):
                  yield join_paths(key, k), v
          else:
              yield key, value
docs: Recursively iterate over the items of a dictionary.
  
      Provides a full dotted paths for every leaf.