Convert dictionary of headers into twisted.web.client.Headers object.
431053
def _headers(self, headers_dict):
        
        return Headers(dict((k,[v]) for (k,v) in headers_dict.items()))
422381
def headers_as_list(self):
        
        headers = self.headers
        headers_list = ['{}: {}'.format(key, value) for key, value in iteritems(headers)]
        return headers_list
694319
def merge_headers(event):
    
    headers = event.get('headers') or {}
    multi_headers = (event.get('multiValueHeaders') or {}).copy()
    for h in set(headers.keys()):
        if h not in multi_headers:
            multi_headers[h] = [headers[h]]
    for h in multi_headers.keys():
        multi_headers[h] = ', '.join(multi_headers[h])
    return multi_headers
276462
def header2dict(self, names, struct_format, data):
        
        unpacked_data = struct.unpack(struct_format, data)
        return dict(zip(names, unpacked_data))
367062
def _http_headers(self):
        
        if not self.usertag:
            return {}

        creds = u'{}:{}'.format(
            self.usertag,
            self.password or ''
        )
        token = base64.b64encode(creds.encode())
        return {
            'Authorization': 'Basic {}'.format(token.decode())
        }
595676
def parse_headers(self, req: Request, name: str, field: Field) -> typing.Any:
        """"""
        return core.get_value(req.headers, name, field)
367543
def process_header(self, headers):
        """"""

        return [c.name for c in self.source.dest_table.columns][1:]
60013
def get_headers(self):
        """"""
        headers = {
            "User-Agent": self.http_agent,
            "Content-Type": "application/json",
            "Accept": "application/json"
        }
        if self.headers:
            headers.update(self.headers)

        return headers
940684
public static HttpHeaders toArmeria(Http2Headers headers, boolean endOfStream) {
        final HttpHeaders converted = new DefaultHttpHeaders(false, headers.size(), endOfStream);
        StringJoiner cookieJoiner = null;
        for (Entry<CharSequence, CharSequence> e : headers) {
            final AsciiString name = HttpHeaderNames.of(e.getKey());
            final CharSequence value = e.getValue();

            // Cookies must be concatenated into a single octet string.
            // https://tools.ietf.org/html/rfc7540#section-8.1.2.5
            if (name.equals(HttpHeaderNames.COOKIE)) {
                if (cookieJoiner == null) {
                    cookieJoiner = new StringJoiner(COOKIE_SEPARATOR);
                }
                COOKIE_SPLITTER.split(value).forEach(cookieJoiner::add);
            } else {
                converted.add(name, convertHeaderValue(name, value));
            }
        }

        if (cookieJoiner != null && cookieJoiner.length() != 0) {
            converted.add(HttpHeaderNames.COOKIE, cookieJoiner.toString());
        }

        return converted;
    }
499199
def filter_headers(data):
    
    headers = {}
    for i in data:
        if i == 'Content-Type' or i == 'Host' or i[0] == 'x' or i[0] == 'X':
            headers[i] = data[i]
    return headers
1305755
def get_response_headers(self, *args, **kwargs):
        
        if self.response_headers:
            return self._unpack_headers(self.response_headers)
1034269
def make_headers(headers):
    
    out = {}
    if 'etag' in headers:
        out['if-none-match'] = headers['etag']
    if 'last-modified' in headers:
        out['if-modified-since'] = headers['last-modified']
    return out
398390
def process_headers(data, filename):
    """"""
    headers = []
    if 'toc' in data:
        for element in PyQuery(data['toc'])('a'):
            headers.append(recurse_while_none(element))
        if None in headers:
            log.info('Unable to index file headers for: %s', filename)
    return headers
154711
def headers(self):
        
        try:
            return self._headers
        except AttributeError:
            self._headers = self._response.headers
            return self._headers
195422
private static Map<String, String> convertHeaders(Header[] headers) {
        Map<String, String> result = new HashMap<String, String>(headers.length);
		for (Header header : headers) {
			result.put(header.getName(), header.getValue());
		}
        return result;
    }
1056953
function parseHeaders(headerString) {
	var headers = {};
	var headersArray = headerString.split(/[\r\n]+/);
	headersArray.forEach(function (headerString) {
		var headerChunks = headerString.split(':');
		headers[headerChunks.shift().trim()] = headerChunks.join(':').trim();
	});
	return headers;
}
201774
def getHeaders(self):
        '''
        
        '''
        items = self.data
        headers = {}
        for item in items:
            if len(item) > 0 and self._judeNOtIn(item, ['curl', 'GET', 'Cookie', 'cookie']):
                sp = item.split(':')
                headers[sp[0]] = sp[1]
        return headers