tessl install tessl/pypi-yacs@0.1.0A lightweight library for defining and managing system configurations for scientific experimentation.
Agent Success
Agent success rate when using this tile
97%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.05x
Baseline
Agent success rate without this tile
92%
Build a configuration management system for a plugin-based application where different sections of the configuration have different levels of strictness regarding dynamic key addition.
Your system should support three types of configuration sections:
Implement the following functionality:
CORE, PLUGINS, and USER_PREFSCORE section must contain predefined keys: APP_NAME (string) and VERSION (string)PLUGINS section should allow arbitrary plugin configurations to be added dynamicallyUSER_PREFS section should start with a predefined THEME (string) key but be upgradeable to accept dynamic keys@generates
def create_config():
"""
Creates and returns a configuration object with three sections:
- CORE: Contains APP_NAME and VERSION, no new keys allowed
- PLUGINS: Empty initially, allows arbitrary new keys
- USER_PREFS: Contains THEME, initially strict but can be made flexible
Returns:
Configuration object with the three sections
"""
pass
def load_plugin_config(config, plugin_opts):
"""
Loads plugin configuration from a list of key-value pairs.
Args:
config: The configuration object
plugin_opts: List in format [key1, value1, key2, value2, ...]
Keys should be prefixed with "PLUGINS." (e.g., "PLUGINS.my_plugin.enabled")
Returns:
None (modifies config in place)
"""
pass
def allows_new_keys(config, section_name):
"""
Checks if a configuration section accepts new keys.
Args:
config: The configuration object
section_name: Name of the section (e.g., "CORE", "PLUGINS", "USER_PREFS")
Returns:
bool: True if section allows new keys, False otherwise
"""
pass
def enable_dynamic_user_prefs(config):
"""
Enables dynamic key addition for the USER_PREFS section.
Args:
config: The configuration object
Returns:
None (modifies config in place)
"""
passConfiguration management library for handling hierarchical configurations.
@satisfied-by