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 a configuration file parser that reads various data formats and converts them to appropriate Python types with validation.
Your parser should handle conversion of string values from configuration files into appropriate Python types.
The parser should convert various input formats into lists.
The parser should provide safe conversion with default values when conversion fails or input is None.
@generates
def parse_value(value: str, target_type: str):
"""
Parse a string value to the target type.
Args:
value: String value to parse
target_type: Target type name ('bool', 'int', 'float', 'list')
Returns:
Parsed value in the target type
Raises:
ValueError: If conversion fails
"""
pass
def safe_convert(value, converter, default=None):
"""
Safely convert a value using a converter function with fallback.
Args:
value: Value to convert (can be None)
converter: Function to use for conversion
default: Default value if conversion fails or value is None
Returns:
Converted value or default
"""
pass
def ensure_list(value, default=None):
"""
Ensure value is a list, converting single values or using default.
Args:
value: Value to convert to list
default: Default value if value is None
Returns:
List containing the value(s)
"""
passProvides type conversion and validation utilities.
@satisfied-by