Parse the "TE" header.
433433
def parse_te(header):
    """"""
    pos = 0
    names = []
    while pos < len(header):
        name, pos = expect_re(re_token, header, pos)
        _, pos = accept_ws(header, pos)
        _, pos = accept_lit(';', header, pos)
        _, pos = accept_ws(header, pos)
        qvalue, pos = accept_re(re_qvalue, header, pos)
        if name:
            names.append((name, qvalue))
        _, pos = accept_ws(header, pos)
        _, pos = expect_lit(',', header, pos)
        _, pos = accept_ws(header, pos)
    return names
207616
function parseHeader(headers) {
  // Returns a header object with keys header line types (.e.g format, info,
  // sample) and values arrays of objects containing the key-value information
  // stored therein.
  if (headers.length === 0) {
    throw new Error('Invalid VCF File: missing header.');
  }

  var header = {};
  header.__RAW__ = headers;
  // VCF header lines always start with either one or two # signs.
  headers = U.map(headers, function(h) { return h.replace(/^##?/, ""); });

  header.columns = headers[headers.length-1].split('\t');
  header.sampleNames = header.columns.slice(NUM_STANDARD_HEADER_COLUMNS);

  // TODO(ihodes): parse other, less frequently used, header lines like
  //               'assembly'
  header.VERSION = parseVCFVersion(headers);
  header.ALT = parseHeadersOf('ALT', headers);
  header.INFO = parseHeadersOf('INFO', headers);
  header.FORMAT = parseHeadersOf('FORMAT', headers);
  header.SAMPL = parseHeadersOf('SAMPLE', headers);
  header.PEDIGREE = parseHeadersOf('PEDIGREE', headers);
  header.contig = parseHeadersOf('contig', headers);

  return header;
}
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
76353
def parse(s):
    """"""
    stopwatch = StopWatch()
    for line in s.splitlines():
      if line.strip():
        parts = line.split(None)
        name = parts[0]
        if name != "%":  # ie not the header line
          rest = (float(v) for v in parts[2:])
          stopwatch.times[parts[0]].merge(Stat.build(*rest))
    return stopwatch
1136907
public void parse() throws AuthHeaderParsingException {

		String[] parts = headerValue.trim().split("\\s+", 2);
		if (parts.length < 1) {
			throw new AuthHeaderParsingException("Unable to split scheme and other part in " + headerValue);
		}

		builder.scheme(parts[0]);
		
		if(parts.length == 1) {
			return;
		}
		
		// FIXME: handle optional, one-time token

		for (String kv : parts[1].split(",")) {
			String[] kva = kv.trim().split("=", 2);
			if (!(kva.length == 2)) {
				throw new AuthHeaderParsingException("Unable to split " + kv + " into parameter key and value in " + headerValue);
			}
			if (kva[1].startsWith("\"")) {
				kva[1] = kva[1].substring(1, kva[1].length() - 1);
			}
			builder.param(kva[0], kva[1]);
		}
	}
282906
def is_header(line):
  """"""
  if re.match('^@',line):
    f = line.rstrip().split("\t")
    if(len(f) > 9):
      return False
    return True
  return False
137773
def parse_headers(self, req, name, field):
        """"""
        return get_value(req.headers, name, field)
863518
def _parse_header(self):
        """"""
        self.print("Parsing the DETX header")
        self._det_file.seek(0, 0)
        first_line = self._readline()
        try:
            self.det_id, self.n_doms = split(first_line, int)
            self.version = 'v1'
        except ValueError:
            det_id, self.version = first_line.split()
            self.det_id = int(det_id)
            validity = self._readline().strip()
            self.valid_from, self.valid_until = split(validity, float)
            raw_utm_info = self._readline().strip().split(' ')
            try:
                self.utm_info = UTMInfo(*raw_utm_info[1:])
            except TypeError:
                log.warning("Missing UTM information.")
            n_doms = self._readline()
            self.n_doms = int(n_doms)
975897
def to_header(self):
        """"""
        if self.date is not None:
            return http_date(self.date)
        if self.etag is not None:
            return quote_etag(self.etag)
        return ""
104982
def parse(cls, msg):
        """"""
        lines = msg.splitlines()
        method, uri, version = lines[0].split()
        headers = cls.parse_headers('\r\n'.join(lines[1:]))
        return cls(version=version, uri=uri, method=method, headers=headers)
449418
def header(self, key, value, replace = True):
        ""
        if hasattr(key, 'encode'):
            key = key.encode('ascii')
        if hasattr(value, 'encode'):
            value = value.encode(self.encoding)
        if replace:
            self.sent_headers = [(k,v) for k,v in self.sent_headers if k.lower() != key.lower()]
        self.sent_headers.append((key, value))
168414
private function parse() {
		// remove first line
		$lead = strstr($this->data, "\n", true);
		$this->data = substr(strstr($this->data, "\n"), 1);

		// parse first line
		$pieces = explode(" ", $lead);
		$this->httpVersion = (Integer)trim(substr(strstr($pieces[0], "/"), 1));
		$this->code = (Integer)trim($pieces[1]);

		// split into head and body
		$head = strstr($this->data, "\r\n\r\n", true);
		$this->body = substr(strstr($this->data, "\r\n\r\n"), 4);

		// parse headers
		foreach(explode("\n", $head) as $line) {
			$this->headers[strtolower(strstr($line, ":", true))] = trim(substr(strstr($line, ":"), 2));
		}

		// fix content type header, move charset to its own if present
		if(isset($this->headers["content-type"]) && strpos($this->headers["content-type"], ";")) {
			$this->headers["content-type"] = strtok($this->headers["content-type"], ";");
			if(!isset($this->headers["charset"])) $this->headers["charset"] = substr(strstr(strtok(";"), "="), 1);
		}

		// decode if chunked
		if($this->decodeChunked && isset($this->headers["transfer-encoding"]) && strtolower($this->headers["transfer-encoding"]) == "chunked") {
			for($decoded = ""; !empty($this->body); $this->body = trim($this->body)) {
				$position = strpos($this->body, "\r\n");
				$length = hexdec(substr($this->body, 0, $position));
				$decoded .= substr($this->body, $position + 2, $length);
				$this->body = substr($this->body, $position + 2 + $length);
			}

			$this->body = $decoded;
			unset($decoded);
		}

		// parse body as json if in json mode
		if($this->json && strtolower($this->headers["content-type"]) == "application/json") {
			$json = json_decode($this->body);
			if(json_last_error() == JSON_ERROR_NONE) $this->body = $json;
		}

		// cleanup
		unset($this->data, $head, $lead);

		
	}
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;
}
1300527
def parse_accept_header(header):
    """"""
    result = []
    for match in accept_re.finditer(header):
        quality = match.group(2)
        if not quality:
            quality = 1
        else:
            quality = max(min(float(quality), 1), 0)
        result.append((match.group(1), quality))
    return result
704750
def header(fname, sep="\t"):
    
    fh = iter(nopen(fname))
    h = tokens(next(fh), sep)
    h[0] = h[0].lstrip("#")
    return h
718210
def parse_membership(header_string, membership):  # pragma: no cover
        """"""
        print(header_string, "\n{}".format('=' * len(header_string)))
        for key, values in membership.items():
            if values is None:
                continue
            print('- ', key)
            for value in values:
                print("\t- {}".format(value))
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:]