Make a mapping from the name=value pairs.
176925
def make_mapping(args):
    """"""
    mapping = {}

    if args:
        for arg in args:
            name_value = arg.split('=', 1)
            mapping[name_value[0]] = (name_value[1]
                                      if len(name_value) > 1
                                      else None)

    return mapping
757159
def deepvalues(mapping):
    """"""
    values = vals_sorted_by_key(mapping)
    for obj in values:
        mapping = False
        try:
            obj.items
        except AttributeError:
            pass
        else:
            mapping = True
            for subobj in deepvalues(obj):
                yield subobj
        if not mapping:
            yield obj
276999
def mapping_get(uri, mapping):
    
    ln = localname(uri)
    # 1. try to match URI keys
    for k, v in mapping.items():
        if k == uri:
            return v
    # 2. try to match local names
    for k, v in mapping.items():
        if k == ln:
            return v
    # 3. try to match local names with * prefix
    # try to match longest first, so sort the mapping by key length
    l = list(mapping.items())
    l.sort(key=lambda i: len(i[0]), reverse=True)
    for k, v in l:
        if k[0] == '*' and ln.endswith(k[1:]):
            return v
    raise KeyError(uri)
182233
def []=(name, value)
    name_pair = name_to_a(name).freeze
    hooks = assign(name_pair, value)
    hooks.each do |hook|
      hook.call(name_pair, value)
    end
    value
  end
627506
public static Map<String, Object> from(Pair... pairs) {
        Map<String, Object> map = new HashMap<String, Object>(pairs.length);
        for (Pair p : pairs) {
            map.put(p.key, p.value);
        }
        return map;
    }
957197
function convertPropertyNamesAndValues (context, pkg, map, root, waiting) {
	if(!map) {
		return map;
	}
	var clone = {}, val, name;
	for(var property in map ) {
		val = map[property];
		name = convertName(context, pkg, map, root, property, waiting); 
		val = typeof val === "object"
			? convertPropertyNamesAndValues(context, pkg, val, root, waiting)
			: convertName(context, pkg, map, root, val, waiting);
		if(typeof name !== 'undefined' && typeof val !== 'undefined') {
			clone[name] = val;
		}
	}
	return clone;
}
663464
def _name_lookup(names):
    """
    mapper = dict(zip(range(len(names)), names))

    def lookup(val):
        return mapper.get(val, 'Unknown')
    return lookup
1285813
def getkey(mapping, value, default=None, use_id=False):
    '''
    '''
    if use_id:
        for key, val in mapping.items():
            if val is value:
                return key
    else:
        for key, val in mapping.items():
            if val == value:
                return key
    return default
1049445
def _MapItems(message, field):
    """"""
    assert _IsMap(message, field)
    map_message = message.get_assigned_value(field.name)
    additional_properties = map_message.get_assigned_value(
        'additionalProperties')
    for kv_pair in additional_properties:
        yield kv_pair.key, kv_pair.value
900037
def hmset(self, name, mapping):
        
        with self.pipe as pipe:
            m_encode = self.memberparse.encode
            mapping = {m_encode(k): self._value_encode(k, v)
                       for k, v in mapping.items()}
            return pipe.hmset(self.redis_key(name), mapping)
228712
def from_string_pairs(cls, string_value_pairs, **kwargs):
        
        return cls(re_value_pairs=[(re.compile(s), v)
                                   for s, v in string_value_pairs],
                   **kwargs)
835515
def mapping_to_str(mapping):
    """"""
    result = ["<"]
    for i, (key, value) in enumerate(mapping.items()):
        if i > 0:
            result.append(",")
        result += [key, "=", serialize_for_header(key, value)]
    result += [">"]
    return "".join(result)
178801
def map_index_val(index_val):
        """"""
        if index_val is None:
            return DynamoMappings.NONE_VAL

        index_val = str(index_val)
        if not index_val:
            return DynamoMappings.EMPTY_STR_VAL

        return index_val
214994
def from_maps(*maps):
        
        result = StringValueMap()
        
        if maps == None or len(maps) == 0:
            return result

        for map in maps:
            for (k, v) in map.items():
                key = StringConverter.to_string(k)
                result.put(key, v)

        return result
243873
def _remap_fields(cls, kwargs):
        """"""
        mapped = {}
        for key in kwargs:
            if key in cls._remap:
                mapped[cls._remap[key]] = kwargs[key]
            else:
                mapped[key] = kwargs[key]
        return mapped
1105467
def parse_uinput_mapping(name, mapping):
    """"""
    axes, buttons, mouse, mouse_options = {}, {}, {}, {}
    description = "ds4drv custom mapping ({0})".format(name)

    for key, attr in mapping.items():
        key = key.upper()
        if key.startswith("BTN_") or key.startswith("KEY_"):
            buttons[key] = attr
        elif key.startswith("ABS_"):
            axes[key] = attr
        elif key.startswith("REL_"):
            mouse[key] = attr
        elif key.startswith("MOUSE_"):
            mouse_options[key] = attr

    create_mapping(name, description, axes=axes, buttons=buttons,
                   mouse=mouse, mouse_options=mouse_options)
719226
def map_values(f, D):
    ''''''
    return { key:f(val) for key,val in D.iteritems() }