INNER CODE UNIT · Python

_line_of

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

def _line_of(text: str, offset: int) -> int:
    return text.count("\n", 0, offset) + 1


# --------------------------------------------------------------------------
# guide.yaml schema validation
# --------------------------------------------------------------------------

TOP_REQUIRED = {"name", "env", "deploy"}
TOP_OPTIONAL = {"_lists", "prerequisites", "verify", "benchmark", "cleanup"}
STEP_KEYS = {"run", "when", "skip_in"}
ENV_KEYS = {"static", "source", "derive"}
ENV_VAR_KEYS = {"default", "values", "sensitive"}


def _check_step(step: Any, path: str, declared: set[str], f: Findings) -> None:
    if not isinstance(step, dict):
        f.error(f"{path}: step must be a map with 'run:' key, got {type(step).__name__}")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…