def set_background(self, **kwargs):
rollover_states = self._background.known_states<EOL>appearance_args = {k: {} for k in rollover_states}<EOL>for key, arg in kwargs.items():<EOL><INDENT>tokens = key.split('<STR_LIT:_>', <NUM_LIT:1>)<EOL>if tokens[<NUM_LIT:0>] not in rollover_states:<EOL><INDENT>options = '<STR_LIT:U+002CU+0020>'.join(f"<STR_LIT>" for x in rollover_states)<EOL>raise ValueError(f"<STR_LIT>")<EOL><DEDENT>if len(tokens) == <NUM_LIT:1>:<EOL><INDENT>self._background.add_state(arg)<EOL><DEDENT>else:<EOL><INDENT>appearance_args[tokens[<NUM_LIT:0>]][tokens[<NUM_LIT:1>]] = arg<EOL><DEDENT><DEDENT>for key, args in appearance_args.items():<EOL><INDENT>self._background[key].set_appearance(**args)<EOL><DEDENT>
Set appearance options for any of the background widgets.

This is a convenience method for calling `set_appearance()` on any of 
the background widgets.  Each keyword argument to this function should 
either be of the form `<rollover>` or `<rollover>_<kwarg>`, where 
`<rollover>` is the name of a rollover state and `<kwargs>` is the 
name of an argument to the `set_appearance()` method of the widget 
representing that state.

Arguments of the `<rollover>` form specify actual widgets to use for 
the indicated state.  Arguments of the form `<rollover>_<kwarg>` 
specify keyword arguments to pass to that widget's `set_appearance()` 
method.  You can mix both kinds of arguments.

The following rollover states are understood:

- `base`
- `over`
- `down`
- `off`

The `<option>` names must be valid keyword arguments to the underlying 
widget's `set_appearance()` method.  Of course, different widgets will 
accept different arguments.  These arguments also require that the 
background widgets implement the set_appearance()` method.  `Image` and 
`Background` both meet this requirement, but widgets derived from other 
classes may not.

Note that any appearance options not specified will not be displayed.  
In other words, if you only specify a base rollover state, the other 
rollover states will be disabled.  Or if you only specify edge images, 
no center images will be displayed.  A common mistake is to try to 
configure the appearance of a button with multiple calls to this 
method, but this will just result in the last call overriding all the 
earlier ones.