tessl install tessl/pypi-frozendict@2.4.0A simple immutable dictionary implementation with hashing support and performance optimizations
Agent Success
Agent success rate when using this tile
85%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.31x
Baseline
Agent success rate without this tile
65%
Build a configuration value selector that retrieves specific configuration items by their position in insertion order. The selector should support both forward and backward positional access.
Your implementation should provide a ConfigSelector class with the following behavior:
@generates
class ConfigSelector:
"""
A configuration selector that allows positional access to configuration items.
Configuration data is stored in insertion order and remains immutable after initialization.
"""
def __init__(self, config_data):
"""
Initialize the selector with configuration data.
Args:
config_data: A dictionary containing configuration key-value pairs
"""
pass
def get_key_at(self, index):
"""
Get the configuration key at the specified position.
Args:
index: Integer position (supports negative indexing)
Returns:
The key at the specified position
Raises:
IndexError: If index is out of range
"""
pass
def get_value_at(self, index):
"""
Get the configuration value at the specified position.
Args:
index: Integer position (supports negative indexing)
Returns:
The value at the specified position
Raises:
IndexError: If index is out of range
"""
pass
def get_item_at(self, index):
"""
Get the configuration key-value pair at the specified position.
Args:
index: Integer position (supports negative indexing)
Returns:
A tuple of (key, value) at the specified position
Raises:
IndexError: If index is out of range
"""
pass{"host": "localhost", "port": 8080, "debug": True}, calling get_key_at(0) returns "host" @test{"host": "localhost", "port": 8080, "debug": True}, calling get_value_at(1) returns 8080 @test{"host": "localhost", "port": 8080, "debug": True}, calling get_item_at(2) returns ("debug", True) @test{"host": "localhost", "port": 8080, "debug": True}, calling get_key_at(-1) returns "debug" @test{"host": "localhost", "port": 8080, "debug": True}, calling get_value_at(-2) returns 8080 @test{"host": "localhost", "port": 8080}, calling get_key_at(5) raises IndexError @test{"host": "localhost", "port": 8080}, calling get_item_at(-10) raises IndexError @testProvides immutable dictionary support with positional access capabilities.
@satisfied-by