After parsing a file and removing some functions, is it possible to also remove any now-unused imports before writing the new file?