code: def find_imports(filename):
      
      with open(filename) as f:
          root = ast.parse(f.read(), filename)
      visitor = ImportFinder(filename)
      visitor.visit(root)
      return visitor.imports
docs: Find all imported names in a given file.
  
      Returns a list of ImportInfo objects.