def resolve_deps(header_deps):
 altered = 1
 while altered:
  altered = 0
  for (hdr, deps) in header_deps.items():
   start = len(deps)
   for dep in deps.keys():
    deps.update(header_deps.get(dep, {}))
   if (len(deps) != start):
    altered = 1

def resolve_deps ( header_deps ) : altered = 1 while altered : altered = 0 for ( hdr , deps ) in header_deps . items ( ) : start = len ( deps ) for dep in deps . keys ( ) : deps . update ( header_deps . get ( dep , { } ) ) if ( len ( deps ) != start ) : altered = 1
alter the provided dictionary to flatten includes-of-includes .