or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes

pkg:github/python/cpython@v3.13.2

tile.json

tessl/github-python--cpython

tessl install tessl/github-python--cpython@3.13.0

CPython is the reference implementation of the Python programming language providing the core interpreter, runtime system, and comprehensive standard library.

Agent Success

Agent success rate when using this tile

96%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.07x

Baseline

Agent success rate without this tile

90%

task.mdevals/scenario-9/

Native Ledger Summarizer

Transforms purchase lines into aggregated totals using native runtime types and standard exception semantics.

Capabilities

Normalize entries

  • Input lines ["coffee,3", "bagel,2", "coffee,-1"] produce a mapping with exactly two keys: coffee totals 2 and bagel totals 2. @test
  • Encountering a line without the comma delimiter (e.g., "brokenline") aborts processing and raises a built-in exception for malformed input. @test

Enforce integer amounts

  • If an amount token is not an integer (e.g., "tea,2.5"), raise the built-in exception associated with invalid numeric conversion. @test

Lookup totals safely

  • Requesting a total for a category that is not present in the normalized summary raises the native missing-key exception. @test

Validate input type

  • Passing a non-iterable input such as None raises the built-in type-mismatch exception before any parsing is attempted. @test

Implementation

@generates

API

from typing import Iterable, Mapping

def normalize_entries(lines: Iterable[str]) -> Mapping[str, int]:
    """Parse comma-delimited lines of <category>,<integer amount> into aggregated totals using native mapping and integer primitives."""


def category_total(summary: Mapping[str, int], category: str) -> int:
    """Return the total for the requested category from a normalized summary or raise the native missing-key exception."""

Dependencies { .dependencies }

Python built-ins { .dependency }

Native runtime types for sequences/mappings, conversion helpers, and standard exception hierarchy.