Helper function for combining multiple header maps into one.

    :param list(dict) header_map_list: list of maps

    :rtype: dict
552708
def merge_headers(header_map_list):
    
    headers = {}
    for header_map in header_map_list:
        if header_map:
            headers.update(header_map)
    return headers
328019
protected MultiMap resolveHeaders()
    {
        MultiMap resolved = null;
        if(headerFactory != null)
            resolved = headerFactory.getHeaders();

        if(resolved != null)
            resolved = resolved.merge(headers);
        else
            resolved = headers;

        return resolved;
    }
525409
def make_table_map(table, headers):
    """"""

    header_parts = {}
    for i, h in enumerate(headers):
        header_parts[h] = 'row[{}]'.format(i)

    body_code = 'lambda row: [{}]'.format(','.join(header_parts.get(c.name, 'None') for c in table.columns))
    header_code = 'lambda row: [{}]'.format(
        ','.join(header_parts.get(c.name, "'{}'".format(c.name)) for c in table.columns))

    return eval(header_code), eval(body_code)
557420
def _merge_maps(m1, m2):
    """"""
    return type(m1)(chain(m1.items(), m2.items()))
1034383
private List<WsByteBuffer> writeHeader(List<WsByteBuffer> list) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Writing gzip header information");
        }
        WsByteBuffer hdr = HttpDispatcher.getBufferManager().allocateDirect(GZIP_Header.length);
        hdr.put(GZIP_Header);
        hdr.flip();
        list.add(hdr);
        this.haveWrittenHeader = true;
        return list;
    }
198340
protected static void mergeLists(List<Address> dest, List<Address> src) {
      for (Address node : src) {
         if (!dest.contains(node)) {
            dest.add(node);
         }
      }
   }
280280
private List<String> aliasHeader(List<Object> headerList) {
		final int size = headerList.size();
		final ArrayList<String> result = new ArrayList<>(size);
		if (CollUtil.isEmpty(headerList)) {
			return result;
		}

		for(int i = 0; i < size; i++) {
			result.add(aliasHeader(headerList.get(i), i));
		}
		return result;
	}
729802
def _merge_list(self, key, lst):
    
    self[key] += [x for x in lst if x not in self[key]]
1321001
public static Map<String, Object> getHeaders(Bundle b) {
	Dictionary<String, String> headers = b.getHeaders();
	Enumeration<String> keys = headers.keys();
	Enumeration<String> values = headers.elements();

	String key, value;
	Object existing;
	List<String> list;
	Map<String, Object> _headers = new HashMap<String, Object>();
	while (keys.hasMoreElements()) {
	    key = keys.nextElement();
	    value = StringUtil.unwrap(values.nextElement());
	    existing = _headers.get(key);
	    if (existing != null) {
		if (existing instanceof String) {
		    list = new ArrayList<>();
		    list.add((String) existing);
		    _headers.put(key, list);
		}
		else list = (List<String>) existing;
		list.add(value);
	    }
	    else _headers.put(key, value);
	}

	return _headers;
    }
1139817
def with_headers(self, headers=None, **params):
                
        if isinstance(headers, (tuple, list)):
            headers = dict(headers)

        if params:
            if isinstance(headers, dict):
                headers.update(params)
            elif headers is None:
                headers = params

        self._headers.update(headers)
        return self
1001262
function mapHeader (h) {
    if (h === undefined) return undefined;

    return {
      test: toBoolean(getElementText(h, 'Test', mes)),
      id: getElementText(h, 'ID', mes),
      prepared: getElementText(h, 'Prepared', mes),
      sender: mapParty(_getFirstChildNS(h, 'Sender', mes)),
      receiver: mapParty(_getFirstChildNS(h, 'Receiver', mes))
    };
  }
996471
public static ImmutableListMultimap.Builder<String, String> headerMapBuilder() {
        return ImmutableListMultimap.<String, String> builder()
                .orderKeysBy(String.CASE_INSENSITIVE_ORDER);
    }
1230712
def merge_lists(*args):
    

    out = {}
    for contacts in filter(None, args):
        for contact in contacts:
            out[contact.value] = contact

    return list(out.values())
930299
def list_combiner(value, mutator, *args, **kwargs):
    
    value.append(mutator(*args, **kwargs))
    return value
789708
def combine_word_list(word_list):
    
    bag_of_words = collections.defaultdict(int)

    for word in word_list:
        bag_of_words[word] += 1

    return bag_of_words
1126632
public static <V> Map<V, V> convertListToMap(List<V> list) {
        Map<V, V> map = new HashMap<V, V>();
        if(list.size() % 2 != 0)
            throw new VoldemortException("Failed to convert list to map.");
        for(int i = 0; i < list.size(); i += 2) {
            map.put(list.get(i), list.get(i + 1));
        }
        return map;
    }
194090
public void setHeaders(Map<String, List<String>> headerMap) {
        headers = new Headers.Builder();

        for (Map.Entry<String, List<String>> e : headerMap.entrySet()) {
            for (String headerValue : e.getValue()) {
                addHeader(e.getKey(), headerValue);
            }
        }
    }