def extract_deps(fname, legal_deps):
 deps = {}
 for line in open(fname).readlines():
  if (line[:8] != '#include'):
   continue
  inc = _re_include.match(line).group(1)
  if (inc in legal_deps.keys()):
   deps[inc] = legal_deps[inc]
 return deps

def extract_deps ( fname , legal_deps ) : deps = { } for line in open ( fname ) . readlines ( ) : if ( line [ : 8 ] != '#include' ) : continue inc = _re_include . match ( line ) . group ( 1 ) if ( inc in legal_deps . keys ( ) ) : deps [ inc ] = legal_deps [ inc ] return deps
extract the headers this file includes .