def METHOD_NAME(self, config):
    # config is localized widget settings
    config['_default_settings'] = list(config.keys())
    try:
        self.machine.config_validator.validate_config('widgets:{}'.format(
            config['type']).lower(), config, base_spec='widgets:common')
    except KeyError:
        raise KeyError("Slide config validation error. Something is "
                       "wrong here: {}".format(config))
    if 'control_events' in config:
        for event_dict in config['control_events']:
            if event_dict["event"] not in magic_events:
                self._register_trigger(event_dict["event"])
    if 'reset_animations_events' in config:
        for event_name in config['reset_animations_events']:
            if event_name not in magic_events:
                self._register_trigger(event_name)
    if 'animations' in config:
        config['animations'] = self.process_animations(
            config['animations'])
    else:
        config['animations'] = None
    return config