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 source aggregator that can uniformly process data from various sources regardless of whether they are synchronous or asynchronous iterables. The system should accept different types of iterables and process them in a consistent manner.
The system should accept data from multiple source types:
Implement a function aggregate_data(sources) that:
Implement a function transform_sources(sources, transformer) that:
None, skip it and continue processing other sourcesasync def aggregate_data(sources):
"""
Aggregate data from multiple sources of varying types.
Args:
sources: List of iterable sources (sync or async)
Returns:
List containing all items from all sources
"""
pass
async def transform_sources(sources, transformer):
"""
Apply a transformer to items from multiple sources.
Args:
sources: List of iterable sources (sync or async)
transformer: Function to apply to each item (sync or async)
Returns:
List of transformed items
"""
pass@generates
aggregate_data() returns all items from both sources @testNone, aggregate_data() skips None sources and processes valid ones @testaggregate_data() returns an empty list @testtransform_sources() applies the transformation to all items @testProvides async-compatible utilities for working with async iterables uniformly.