Get decoded header value.

        @return: decoded header value or default of not found
        @rtype: unicode or type of default
173767
def getheader (self, name, default=None):
        
        value = self.headers.get(name)
        if value is None:
            return default
        return unicode_safe(value, encoding=HEADER_ENCODING)
502123
def get_header(results):
    ''''''
    ret = ['name', ]
    values = next(iter(results.values()))
    for k, v in values.items():
        if isinstance(v, dict):
            for metric in v.keys():
                ret.append('%s:%s' % (k, metric))
        else:
            ret.append(k)
    return ret
672121
def value(self):
        
        length = self._value.find(b'\x00')
        if length >= 0:
            return self._value[:length].decode('ascii')
        else:
            return self._value.decode('ascii')
1346174
def get_headers(msg):
    """"""
    headers = {}
    for k in msg.keys():
        # decode_header decodes header but does not convert charset, so these
        # may still be bytes, even in Python 3. However, if it's ASCII
        # only (hence unambiguous encoding), the header fields come back
        # as str (unicode) in Python 3.
        (header_txt, charset) = email.header.decode_header(msg[k])[0]
        if charset is not None:
            header_txt = header_txt.decode(charset)
        headers[k] = header_txt
    return headers
104281
def _get_default_headers(cls):
        

        return {
            cls.HEADER_USER_AGENT: cls._USER_AGENT_BUNQ,
            cls.HEADER_REQUEST_ID: cls._generate_random_request_id(),
            cls.HEADER_GEOLOCATION: cls._GEOLOCATION_ZERO,
            cls.HEADER_LANGUAGE: cls._LANGUAGE_EN_US,
            cls.HEADER_REGION: cls._REGION_NL_NL,
            cls.HEADER_CACHE_CONTROL: cls._CACHE_CONTROL_NONE,
        }
741483
def _encodeHeader(headerValue):
    
    try:
        return headerValue.encode('ascii', 'strict')
    except UnicodeError:
        encoded = headerValue.encode("utf-8")
        return header.Header(encoded, "UTF-8").encode()
1173097
def _parseHeaderValue(self, header_value):
        
        values = header_value.split(';', 1)
        if len(values) == 1:
            # There's no extra info -- return the main value and an empty dict
            return values[0], {}
        main_value, extra_values = values[0], values[1].split(';')
        extra_dict = {}
        for value_string in extra_values:
            try:
                key, value = value_string.split('=', 1)
                extra_dict[key.strip()] = value.strip()
            except ValueError:
                # Can't unpack it -- must be malformed. Ignore
                pass
        return main_value, extra_dict
44161
def _read_header(self):
        '''
        
        '''
        self._fh.seek(0)
        buf = self._fh.read(4*2)
        fc, dc = struct.unpack("<II", buf)
        return fc, dc
205032
def default(self):
        
        if isinstance(self.__default, (str, unicode)):
            return self.valueFromString(self.__default)
        else:
            return self.__default
1021440
public String getHeader(String name, String defaultValue) {
        return header.getValue(name, defaultValue);
    }
949510
def get_encoding_from_headers(headers):
    

    content_type = headers.get('content-type')

    if not content_type:
        return None

    content_type, params = _parse_content_type_header(content_type)

    if 'charset' in params:
        return params['charset'].strip("'\"")

    if 'text' in content_type:
        return 'ISO-8859-1'
877265
def get_headers(self, header_name):
		
		header_name = self.normalize_name(header_name)
		if header_name in self.__headers.keys():
			return tuple(self.__headers[header_name])
364132
def parse_headers(header_list):
    
    header_string = b""
    for key, values in header_list.items():
        for v in values:
            header_string += \
                key.encode('utf-8') + b":" + v.encode('utf-8') + b"\r\n"
    return compat.get_httpmessage(header_string)
1121909
def get_header(self):
        
        raw_header = yield get_arg(self, 1)
        if not self.serializer:
            raise tornado.gen.Return(raw_header)
        else:
            header = self.serializer.deserialize_header(raw_header)
            raise tornado.gen.Return(header)
348140
def header(self):
    '''
    

    '''
    if self._header is None:
      self._header = self._read_half_frame_header(self.data)

    return self._header
411513
def _init_decoder(self):
        
        # Note: content-encoding value should be case-insensitive, per RFC 7230
        # Section 3.2
        content_encoding = self.headers.get('content-encoding', '').lower()
        if self._decoder is None and content_encoding in self.CONTENT_DECODERS:
            self._decoder = _get_decoder(content_encoding)
619309
def get_header(request, header_service):
    
    service = request.META.get('HTTP_{}'.format(header_service), b'')
    if isinstance(service, str):
        # Work around django test client oddness
        service = service.encode(HTTP_HEADER_ENCODING)
    return service