def METHOD_NAME(self, mappings):
    # When setting from a string, assume a list of mappings:
    # [[action1, [key1, key2]], [action2, [key3]], ...]
    if isinstance(mappings, str):
        mappings = json.loads(mappings)
    mappings = dict(mappings)
    # Set from:
    # { action1: [key1, key2], ... actionn: [keyn] }
    self._mappings = OrderedDict()
    self._bindings = {}
    bound_keys = defaultdict(list)
    errors = []
    for action in self._actions:
        key_list = mappings.get(action)
        if not key_list:
            # Not an issue if 'no-op' is not mapped...
            if action != 'no-op':
                errors.append('action %s is not bound' % action)
            # Add dummy mapping for each missing action
            # so it's shown in the configurator.
            self._mappings[action] = ()
            continue
        if isinstance(key_list, str):
            key_list = (key_list,)
        valid_key_list = []
        for key in key_list:
            if key not in self._keys:
                errors.append('invalid key %s bound to action %s' % (key, action))
                continue
            valid_key_list.append(key)
            bound_keys[key].append(action)
            self._bindings[key] = action
        self._mappings[action] = tuple(sorted(valid_key_list, key=self._keys.get))
    for action in (set(mappings) - set(self._actions)):
        key_list = mappings.get(action)
        if isinstance(key_list, str):
            key_list = (key_list,)
        errors.append('invalid action %s mapped to key(s) %s' % (action, ' '.join(key_list)))
    for key, action_list in bound_keys.items():
        if len(action_list) > 1:
            errors.append('key %s is bound multiple times: %s' % (key, str(action_list)))
    if len(errors) > 0:
        log.warning('Keymap is invalid, behavior undefined:\n\n- ' + '\n- '.join(errors))