def get_themes() -> dict[str, EntryPoint]:
    """Return a dict of all installed themes as {name: EntryPoint}."""
    themes: dict[str, EntryPoint] = {}
    eps: dict[EntryPoint, None] = dict.fromkeys(entry_points(group='mkdocs.themes'))
    builtins = {ep.name for ep in eps if ep.dist is not None and ep.dist.name == 'mkdocs'}

    for theme in eps:
        assert theme.dist is not None

        if theme.name in builtins and theme.dist.name != 'mkdocs':
            raise exceptions.ConfigurationError(
                f"The theme '{theme.name}' is a builtin theme but the package '{theme.dist.name}' "
                "attempts to provide a theme with the same name."
            )
        elif theme.name in themes:
            other_dist = themes[theme.name].dist
            assert other_dist is not None
            log.warning(
                f"A theme named '{theme.name}' is provided by the Python packages '{theme.dist.name}' "
                f"and '{other_dist.name}'. The one in '{theme.dist.name}' will be used."
            )

        themes[theme.name] = theme

    return themes
Return a dict of all installed themes as {name: EntryPoint}.
mkdocs/utils/__init__.py