code: def set_global_defaults(**kwargs):
      
  
      valid_options = [
          'active', 'selected', 'disabled', 'on', 'off',
          'on_active', 'on_selected', 'on_disabled',
          'off_active', 'off_selected', 'off_disabled',
          'color', 'color_on', 'color_off',
          'color_active', 'color_selected', 'color_disabled',
          'color_on_selected', 'color_on_active', 'color_on_disabled',
          'color_off_selected', 'color_off_active', 'color_off_disabled',
          'animation', 'offset', 'scale_factor',
          ]
  
      for kw in kwargs:
          if kw in valid_options:
              _default_options[kw] = kwargs[kw]
          else:
              error = "Invalid option '{0}'".format(kw)
              raise KeyError(error)
docs: Set global defaults for the options passed to the icon painter.