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

Predicate isPreferredModuleForName

Holds if the Container c should be the preferred file or folder for the given name when performing imports. Trivially true for any container if it is the only one with its name. However, if there are several modules with the same name, then this is the module most likely to be imported under that name.

Import path

import python
predicate isPreferredModuleForName(Container c, string name)