The missing async toolbox - re-implements functions and classes of the Python standard library to make them compatible with async callables, iterables and context managers
84
Quality
Pending
Does it follow best practices?
Impact
84%
3.36xAverage score across 10 eval scenarios
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.
Install with Tessl CLI
npx tessl i tessl/pypi-asyncstdlibevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10