def index_dictionary(dictionary: dict, n=0):
    """Get the value given a dictionary and an index. Raises an IndexError if out of bounds."""
    if n < 0:
        n += len(dictionary)
    for i, key in enumerate(dictionary.keys()):
        if i == n:
            return dictionary[key]
    raise IndexError('ERROR: Index out of bounds in dictionary.')