def load_config(file_path: Path) -> dict[str, Any]:
    """Load a nested TOML document into key-value pairs

    E.g. ["python"]["use_venv"] will be loaded as "python.use_venv" key.
    """

    def get_item(sub_data: Mapping[str, Any]) -> dict[str, Any]:
        result: dict[str, Any] = {}
        for k, v in sub_data.items():
            if k in (REPOSITORY, SOURCE):
                result.update((f"{k}.{sub_k}", sub_v) for sub_k, sub_v in v.items())
            elif isinstance(v, Mapping):
                result.update({f"{k}.{sub_k}": sub_v for sub_k, sub_v in get_item(v).items()})
            else:
                result.update({k: v})
        return result

    if not file_path.is_file():
        return {}
    return get_item(dict(tomlkit.parse(file_path.read_text("utf-8"))))
Load a nested TOML document into key-value pairs

    E.g. ["python"]["use_venv"] will be loaded as "python.use_venv" key.
    
src/pdm/project/config.py