code: def iter_prefixes(path):
      
      split_path = path.split('.')
      for i in range(1, len(split_path) + 1):
          yield join_paths(*split_path[:i])
docs: Iterate through all (non-empty) prefixes of a dotted path.
  
      Example:
      >>> list(iter_prefixes('foo.bar.baz'))
      ['foo', 'foo.bar', 'foo.bar.baz']