Skip to content

Script

🛈 DocStrings

A generated script plus where each node's block is in it.

Source code in src/datacook/engine/codegen.py
@dataclass(frozen=True, slots=True)
class Script:
    """A generated script plus where each node's block is in it."""

    text: str
    spans: dict[str, tuple[int, int]]
    """`{node_id: (first, last)}`: 1-based, inclusive line numbers of the node's block
    (its `# label` comment line through its last code line)."""

spans instance-attribute

spans: dict[str, tuple[int, int]]

{node_id: (first, last)}: 1-based, inclusive line numbers of the node's block (its # label comment line through its last code line).

:fa-brands-github: Show source on GitHub