<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_char(key, value):
 """ Updates charters used to render components. """

    global _chars
    category = _get_char_category(key)
    if not category:
        raise KeyError
    _chars[category][key] = value