python grapher that extracts top-level defs and non-import refs