def isStandardLibraryPath(path):
    """ Check if a path is in the standard library.

    """

    path = Utils.normcase(path)

    # In virtualenv, the "site.py" lives in a place that suggests it is not in
    # standard library, although it is.
    if os.path.basename(path) == "site.py":
        return True

    # These never are in standard library paths.
    if "dist-packages" in path or "site-packages" in path:
        return False

    for candidate in getStandardLibraryPaths():
        if path.startswith(candidate):
            return True
    return False
dataset/ETHPy150Open kayhayen/Nuitka/nuitka/importing/StandardLibrary.py/isStandardLibraryPath/original