def METHOD_NAME(config: Configuration) -> str:
    # Ruff misidentifies config as a dict.
    # Configuration does not have support the mapping interface.
    levels = {key.split(".", 1)[0] for key, _ in config.items()}  # noqa: PERF102
    if not levels:
        return "Not specified"
    levels_that_override_global = ["install", "wheel", "download"]
    global_overriding_level = [
        level for level in levels if level in levels_that_override_global
    ]
    if not global_overriding_level:
        return "global"
    if "global" in levels:
        levels.remove("global")
    return ", ".join(levels)