<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_lim(min, max, name):
 """Set the domain bounds of the scale associated with the provided key. Parameters name: hashable Any variable that can be used as a key for a dictionary Raises ------ KeyError When no context figure is associated with the provided key. """

    scale = _context['scales'][_get_attribute_dimension(name)]
    scale.min = min
    scale.max = max
    return scale