tessl install tessl/github-python--cpython@3.13.0CPython 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%
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.
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. @testmax_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. @testpath,count followed by entries for each summary item sorted by relative path, ending with a trailing newline and overwriting any previous content. @test@generates
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.
"""Provides filesystem and path handling facilities for scanning directories and reading/writing files.