CodeQL library for Python
codeql/python-all 3.1.2-dev (changelog, source)
Search

Predicate API::moduleImportExists

Holds if an import of module m exists.

This is determined without referring to Node, allowing this predicate to be used in a negative context when constructing new nodes.

Import path

import semmle.python.ApiGraphs
predicate moduleImportExists(string m)