tessl install tessl/pypi-fastcore@1.8.0Python supercharged for fastai development
Agent Success
Agent success rate when using this tile
56%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.37x
Baseline
Agent success rate without this tile
41%
Build utilities for wrapping functions to modify their behavior and signatures.
Implement two function wrappers:
Auto-starting generator wrapper: Wrap generator functions so they automatically advance to the first yield statement when created, making them immediately ready to receive values via send().
Signature modifier: Create a decorator that hides the first N parameters from a function's visible signature while still allowing the function to receive those parameters at runtime.
Generator functions normally require calling next() or send() before they can receive values. For coroutine-style generators, you want them ready to receive values immediately.
Example behavior:
# Without auto-start, this fails
gen = my_generator()
gen.send(value) # Error: can't send to just-started generator
# With auto-start, this works
gen = auto_started_generator()
gen.send(value) # Works immediatelyWhen creating wrapper functions or decorators, you often want to hide internal parameters from the visible signature while still accepting them at runtime.
Example behavior:
# Original function signature: func(internal_param, user_param)
# Wrapped function signature should appear as: func(user_param)
# But wrapped function should still accept both parameters when calledCreate a module generator_utils.py with these functions:
make_autostart(generator_func) - Wraps a generator function to auto-start ithide_params(n) - Returns a decorator that hides the first n parameters from the signatureProvides advanced function wrapping utilities.
@generates
def make_autostart(generator_func):
"""
Wraps a generator function to automatically start it.
Args:
generator_func: A generator function to wrap
Returns:
A wrapper function that returns auto-started generators
"""
pass
def hide_params(n):
"""
Creates a decorator that hides the first n parameters from a function's signature.
Args:
n: Number of parameters to hide from the beginning
Returns:
A decorator function
"""
pass