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 reader that can load settings from multiple configuration files located in different directories without permanently changing the program's working directory.
Your task is to implement a configuration loader that:
config.ini fileThe implementation should ensure that the main program's working directory is never permanently changed, even when reading files from multiple different locations.
def load_configs(config_dirs: list[str]) -> dict:
"""
Load and merge configuration files from multiple directories.
Args:
config_dirs: List of directory paths containing config.ini files
Returns:
Dictionary containing merged configuration values
"""
passGiven directories ['./dir1', './dir2'] where dir1/config.ini contains key1=value1 and dir2/config.ini contains key2=value2, the function returns {'key1': 'value1', 'key2': 'value2'} @test
Given directories ['./dir1', './dir2'] where both contain config.ini files with the same key key1, dir1 has key1=value1 and dir2 has key1=value2, the function returns {'key1': 'value2'} (later directory wins) @test
The original working directory is preserved after calling the function, even after reading from multiple directories @test
Given a directory path that doesn't exist, the function skips it and continues processing other directories @test
@generates
Provides working directory context management utilities.
@satisfied-by