def dist_in_site_packages(dist):
    # type: (Distribution) -> bool
    """
    Return True if given Distribution is installed in
    sysconfig.get_python_lib().
    """
    return dist_location(dist).startswith(normalize_path(site_packages))

    Return True if given Distribution is installed in
    sysconfig.get_python_lib().
    
product/gradle-plugin/src/main/python/pip/_internal/utils/misc.py