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-7/

Filesystem Log Summary

Create a utility that recursively scans a directory for text-based log files, counts their lines (including empty lines), and emits a report describing what was found.

Capabilities

Collect matching files

  • Given a directory tree containing visible files with extensions like log and .TXT alongside hidden files or folders (names starting with .) and unrelated binaries, producing the summary with extensions ["log", ".txt"] returns a mapping that includes only the visible matching files (extension match is case-insensitive) with their relative paths using forward slashes and exact line counts, excluding hidden entries and non-matching types. @test

Respect size limits

  • With max_bytes set to a threshold smaller than one of the candidate files, the oversized file is skipped entirely (not read, not listed), while other matching files within the size limit are still counted and returned. @test

Write report

  • After processing, the report file exists at the requested path (creating parent directories if needed) and contains UTF-8 CSV lines with a header path,count followed by entries for each summary item sorted by relative path, ending with a trailing newline and overwriting any previous content. @test

Implementation

@generates

API

from typing import Iterable

def summarize_logs(source_dir: str, output_file: str, extensions: Iterable[str], max_bytes: int | None = None) -> dict[str, int]:
    """
    Recursively builds a mapping of relative file paths to text line counts (counting empty lines) for allowed files
    under source_dir, ignoring hidden files or folders, and writes a CSV report to output_file. Paths in the mapping use
    forward slashes.
    """

Dependencies { .dependencies }

python-stdlib { .dependency }

Provides filesystem and path handling facilities for scanning directories and reading/writing files.