##### SUMMARY

We should probably render something a bit nicer with invalid key/value data, especially because items2dict/dict2items are fairly unintuitive functions. Probably something that briefly explains what the purpose of key/value are so the user can get them right.

##### ISSUE TYPE
- Bug Report

##### ANSIBLE VERSION
devel

##### COMPONENT NAME

plugins.filter.core
''' takes a list of dicts with each having a 'key' and 'value' keys, and transforms the list into a dictionary,
        effectively as the reverse of dict2items '''
    if not is_sequence(mylist):
        raise AnsibleFilterTypeError("items2dict requires a list, got %s instead." % type(mylist))
    return dict((item[key_name], item[value_name]) for item in mylist)
def path_join(paths):
    ''' takes a sequence or a string, and return a concatenation
        of the different members '''
    if isinstance(paths, string_types):
        return os.path.join(paths)
    elif is_sequence(paths):
        return os.path.join(*paths)
    else:
        raise AnsibleFilterTypeError("|path_join expects string or sequence, got %s instead." % type(paths))
class FilterModule(object):
    ''' Ansible core jinja2 filters '''
    def filters(self):
        return {
            
            'b64decode': b64decode,
            'b64encode': b64encode,
            
            'to_uuid': to_uuid,
            
            'to_json': to_json,
            'to_nice_json': to_nice_json,
            'from_json': json.loads,
            
            'to_yaml': to_yaml,