def get_trie_value(trie, key):
    """
    Get the value that a BytesTrie stores for a particular key, decoded
    as Unicode. Raises a KeyError if there is no value for that key.
    """
    return trie[key][0].decode('utf-8')