##### 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
'''  value ? true_val : false_val '''
    if value is None and none_val is not None:
        return none_val
    elif bool(value):
        return true_val
    else:
        return false_val
def regex_escape(string, re_type='python'):
    string = to_text(string, errors='surrogate_or_strict', nonstring='simplerepr')
    '''Escape all regular expressions special characters from STRING.'''
    if re_type == 'python':
        return re.escape(string)
    elif re_type == 'posix_basic':
        
        
        return regex_replace(string, r'([].[^$*\\])', r'\\\1')
    
    
    
    
    elif re_type == 'posix_extended':
        raise AnsibleFilterError('Regex type (%s) not yet implemented' % re_type)
    else:
        raise AnsibleFilterError('Invalid regex type (%s)' % re_type)
def from_yaml(data):