Called by the C code to parse and set the headers
551712
def parse_headers(header_data_for_multiple_responses)
      @headers = {}

      responses = Patron::HeaderParser.parse(header_data_for_multiple_responses)
      last_response = responses[-1] # Only use the last response (for proxies and redirects)

      @status_line = last_response.status_line
      last_response.headers.each do |line|
        hdr, val = line.split(":", 2)

        val.strip! unless val.nil?

        if @headers.key?(hdr)
          @headers[hdr] = [@headers[hdr]] unless @headers[hdr].kind_of? Array
          @headers[hdr] << val
        else
          @headers[hdr] = val
        end
      end
    end
1373923
def parse_results_header(cls, header):
        
        header = IORMetricsExtractor.RE_MULTIPLE_SPACES.sub(' ', header)
        header = header.split(' ')
        return header
1351213
function Header(cmd, size, checksum) {
  this.cmd = cmd;
  this.size = size;
  this.checksum = checksum;
}
704750
def header(fname, sep="\t"):
    
    fh = iter(nopen(fname))
    h = tokens(next(fh), sep)
    h[0] = h[0].lstrip("#")
    return h
218187
private void parseHeaderLine(Map<String, String> headers, String header) {
        final int colonOffset = header.indexOf(':');
        if (colonOffset == -1) {
            // This header line is malformed, skip it.
            return;
        }
        String headerName = header.substring(0, colonOffset).trim().toLowerCase();
        String headerValue = header.substring(header.indexOf(':') + 1).trim();
        if (getHeader(headers, headerName) != null) {
            // More that one heder of that name exists,
            // append to the list.
            headers.put(headerName, getHeader(headers, headerName) + ',' + headerValue);
        } else {
            headers.put(headerName, headerValue);
        }
    }
947758
def parse_headers(lines, offset=0):
    
    headers = {}
    for header_line in lines[offset:]:
        header_match = HEADER_LINE_RE.match(header_line)
        if header_match:
            key = header_match.group('key')
            key = re.sub(r'\\.', _unescape_header, key)
            if key not in headers:
                value = header_match.group('value')
                value = re.sub(r'\\.', _unescape_header, value)
                headers[key] = value
    return headers
1277584
def parse_headers(buff):
    
    preamble_lines = list(map(
        lambda x: six.u(x).decode(),
        iter(lambda: buff.readline().strip(), b''))
    )
    if not preamble_lines:
        raise EmptyBuffer()
    return preamble_lines[0], OrderedDict([l.split(':') for l in preamble_lines[1:]])
1326951
function parse(headers) {
    var output = {}, i, p, k, v;
    headers = headers || '';
    headers = headers.replace('\r', '');
    headers = headers.split('\n');
    for(i = 0;i < headers.length;i++) {
      p = headers[i].indexOf(':');
      k = headers[i].substr(0, p);
      v = headers[i].substr(p + 1);
      if(k && v) {
        k = k.replace(/^\s+/, '').replace(/\s+$/, '');
        v = v.replace(/^\s+/, '').replace(/\s+$/, '');
        output[k.toLowerCase()] = v;
      }
    }
    return output;
  }
1127192
def parse_as_header(class_, f):
        
        (version, previous_block_hash, merkle_root, timestamp,
            difficulty, nonce) = parse_struct("L##LLL", f)
        return class_(version, previous_block_hash, merkle_root, timestamp, difficulty, nonce)
975624
def set_header(self, name: str, value: _HeaderTypes) -> None:
        
        self._headers[name] = self._convert_header_value(value)
253387
private void readHeader() {
        final int type = readUnsignedByte();
        if ((type & RESERVED_MASK) != 0) {
            throw new ArmeriaStatusException(
                    StatusCodes.INTERNAL,
                    DEBUG_STRING + ": Frame header malformed: reserved bits not zero");
        }
        compressedFlag = (type & COMPRESSED_FLAG_MASK) != 0;

        // Update the required length to include the length of the frame.
        requiredLength = readInt();
        if (requiredLength < 0 || requiredLength > maxMessageSizeBytes) {
            throw new ArmeriaStatusException(
                    StatusCodes.RESOURCE_EXHAUSTED,
                    String.format("%s: Frame size %d exceeds maximum: %d. ",
                                  DEBUG_STRING, requiredLength,
                                  maxMessageSizeBytes));
        }

        // Continue reading the frame body.
        state = State.BODY;
    }
22009
def set_header(self, header, value):
        
        # requests>=2.11 only accepts `str` or `bytes` header values
        # raising an exception here, instead of leaving it to `requests` makes
        # it easy to know where we passed a wrong header type in the code.
        if not isinstance(value, (str, bytes)):
            raise TypeError("header values must be str or bytes, but %s value has type %s" % (header, type(value)))
        self._headers[header] = value
987021
function setWriteHeadHeaders (statusCode) {
  var length = arguments.length
  var headerIndex = length > 1 && typeof arguments[1] === 'string'
    ? 2
    : 1

  var headers = length >= headerIndex + 1
    ? arguments[headerIndex]
    : undefined

  this.statusCode = statusCode

  if (Array.isArray(headers)) {
    // handle array case
    setHeadersFromArray(this, headers)
  } else if (headers) {
    // handle object case
    setHeadersFromObject(this, headers)
  }

  // copy leading arguments
  var args = new Array(Math.min(length, headerIndex))
  for (var i = 0; i < args.length; i++) {
    args[i] = arguments[i]
  }

  return args
}
358037
def parse_header(input_array):
    """"""
    codec = struct.unpack(mmtf.utils.constants.NUM_DICT[4], input_array[0:4])[0]
    length = struct.unpack(mmtf.utils.constants.NUM_DICT[4], input_array[4:8])[0]
    param = struct.unpack(mmtf.utils.constants.NUM_DICT[4], input_array[8:12])[0]
    return codec,length,param,input_array[12:]
1226500
public void parseHeaders () throws IOException {
		if(!parsedHeader) {
			arcRecord.skipHttpHeader();
			// copy all HTTP headers to metaData, prefixing with 
			// HTTP_HEADER_PREFIX
			Header[] headers = arcRecord.getHttpHeaders();
			if (headers != null) {
				for (int i = 0; i < headers.length; i++) {
					String value = headers[i].getValue();
					String name = headers[i].getName();
					metaData.put(HTTP_HEADER_PREFIX + name,value);
					if(name.toUpperCase().contains(
							HttpHeaderOperation.HTTP_TRANSFER_ENC_HEADER)) {
						if(value.toUpperCase().contains(
								HttpHeaderOperation.HTTP_CHUNKED_ENCODING_HEADER)) {
							setChunkedEncoding();
						}
					}
				}
			}

			// copy all ARC record header fields to metaData, prefixing with 
			// ARC_META_PREFIX
			Map<String,Object> headerMetaMap = arcRecord.getMetaData().getHeaderFields();
			Set<String> keys = headerMetaMap.keySet();
			Iterator<String> itr = keys.iterator();
			while(itr.hasNext()) {
				String metaKey = itr.next();
				Object value = headerMetaMap.get(metaKey);
				String metaValue = "";
				if(value != null) {
					metaValue = value.toString();
				}
				metaData.put(ARC_META_PREFIX + metaKey,metaValue);
			}
		
			parsedHeader = true;			
		}
	}
367798
def parse_headers(self, use_cookies, raw):
        
        if not raw:
            packet = helper.to_str(helper.read_file(self.fpth))
        else:
            packet = raw
        dat = {}

        pks = [x for x in packet.split('\n') if x.replace(' ', '')]
        url = pks[0].split(' ')[1]

        for i, cnt in enumerate(pks[1:]):
            arr = cnt.split(':')
            if len(arr) < 2:
                continue
            arr = [x.replace(' ', '') for x in arr]
            _k, v = arr[0], ':'.join(arr[1:])
            dat[_k] = v

        if use_cookies:
            try:
                self.fmt_cookies(dat.pop('Cookie'))
            except:
                pass
        self.headers = dat
        self.url = 'https://{}{}'.format(self.headers.get('Host'), url)
        return url, dat
777616
private void parse(String header)
   {
      ArrayList<String> list = new ArrayList<String>(4);
      StringBuilder sb = new StringBuilder();
      int index = 1;
      while (index < header.length())
      {
         char c = header.charAt(index++);
         if (Character.isDigit(c))
         {
            sb.append(c);
         }
         else
         {
            if (sb.length() != 0)
            {
               list.add(sb.toString());
               sb.setLength(0);
            }
         }
      }

      if (sb.length() != 0)
      {
         list.add(sb.toString());
      }

      m_id = list.get(0);
      m_sequence = Integer.parseInt(list.get(1));
      m_type = Integer.valueOf(list.get(2));
      if (list.size() > 3)
      {
         m_subtype = Integer.parseInt(list.get(3));
      }
   }