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

Member predicate ImportExpr::getLevel

Gets the level of this import.

The language specifies level as -1 if relative imports are to be tried first, 0 for absolute imports, and level > 0 for explicit relative imports.

int getLevel()