INNER CODE UNIT · Python

_check_env

llm-d/llm-d · scripts/guide.py:369

def _check_env(env: Any, f: Findings) -> set[str]:
    declared: set[str] = set()

    if not isinstance(env, dict):
        f.error("env: must be a map")
        return declared

    for k in env:
        if k not in ENV_KEYS:
            f.error(f"env: unknown key {k!r} (allowed: {sorted(ENV_KEYS)})")

    src = env.get("source")
    if src is not None:
        if not isinstance(src, list):
            f.error("env.source: must be a list")
        elif not all(isinstance(s, str) for s in src):
            f.error("env.source: entries must be strings")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…