tessl install tessl/pypi-asyncstdlib@3.13.0The missing async toolbox - re-implements functions and classes of the Python standard library to make them compatible with async callables, iterables and context managers
Agent Success
Agent success rate when using this tile
84%
Improvement
Agent success rate improvement when using this tile compared to baseline
3.36x
Baseline
Agent success rate without this tile
25%
Build a data analytics system that computes expensive metrics from datasets with proper caching to avoid redundant calculations.
Create a MetricsCalculator class that:
mean: The average value of the datasetvariance: The variance of the datasetstd_dev: The standard deviation of the datasetdel (e.g., del calculator.mean), after which the next access recomputes the value@generates
class MetricsCalculator:
"""
A class that computes statistical metrics from a dataset with caching.
"""
def __init__(self, data: list[float]):
"""
Initialize the calculator with a dataset.
Args:
data: A list of numeric values to analyze
"""
pass
async def mean(self) -> float:
"""
Calculate and cache the mean of the dataset.
Returns:
The mean (average) value
"""
pass
async def variance(self) -> float:
"""
Calculate and cache the variance of the dataset.
Returns:
The variance value
"""
pass
async def std_dev(self) -> float:
"""
Calculate and cache the standard deviation of the dataset.
Returns:
The standard deviation value
"""
passProvides async-compatible standard library functions including cached property support.