Parse the total magnetization, which is somewhat hidden
549192
def _parse_total_magnetization(line, lines):
    """"""
    toks = line.split()
    res = {"number of electrons": float(toks[3])}
    if len(toks) > 5:
        res["total magnetization"] = float(toks[5])
    return res
355979
def imagetransformer_sep_channels_16l_16h_imgnet_lrg_loc():
  """"""
  hparams = imagetransformer_sep_channels_12l_16h_imagenet_large()
  hparams.num_hidden_layers = 16
  hparams.local_attention = True
  hparams.batch_size = 1
  hparams.block_length = 256
  return hparams
1207942
function parse_BrtRowHdr(data, length) {
	var z = ({});
	var tgt = data.l + length;
	z.r = data.read_shift(4);
	data.l += 4; // TODO: ixfe
	var miyRw = data.read_shift(2);
	data.l += 1; // TODO: top/bot padding
	var flags = data.read_shift(1);
	data.l = tgt;
	if(flags & 0x07) z.level = flags & 0x07;
	if(flags & 0x10) z.hidden = true;
	if(flags & 0x20) z.hpt = miyRw / 20;
	return z;
}
10602
def parse_tophat_log (self, raw_data):
        

        if 'Aligned pairs' in raw_data:
            # Paired end data
            regexes = {
                'overall_aligned_percent': r"([\d\.]+)% overall read mapping rate.",
                'concordant_aligned_percent': r"([\d\.]+)% concordant pair alignment rate.",
                'aligned_total': r"Aligned pairs:\s+(\d+)",
                'aligned_multimap': r"Aligned pairs:\s+\d+\n\s+of these:\s+(\d+)",
                'aligned_discordant': r"(\d+) \([\s\d\.]+%\) are discordant alignments",
                'total_reads': r"[Rr]eads:\n\s+Input\s*:\s+(\d+)",
            }
        else:
            # Single end data
            regexes = {
                'total_reads': r"[Rr]eads:\n\s+Input\s*:\s+(\d+)",
                'aligned_total': r"Mapped\s*:\s+(\d+)",
                'aligned_multimap': r"of these\s*:\s+(\d+)",
                'overall_aligned_percent': r"([\d\.]+)% overall read mapping rate.",
            }

        parsed_data = {}
        for k, r in regexes.items():
            r_search = re.search(r, raw_data, re.MULTILINE)
            if r_search:
                parsed_data[k] = float(r_search.group(1))
        if len(parsed_data) == 0: return None
        parsed_data['concordant_aligned_percent'] = parsed_data.get('concordant_aligned_percent', 0)
        parsed_data['aligned_total'] = parsed_data.get('aligned_total', 0)
        parsed_data['aligned_multimap'] = parsed_data.get('aligned_multimap', 0)
        parsed_data['aligned_discordant'] = parsed_data.get('aligned_discordant', 0)
        parsed_data['unaligned_total'] = parsed_data['total_reads'] - parsed_data['aligned_total']
        parsed_data['aligned_not_multimapped_discordant'] = parsed_data['aligned_total'] - parsed_data['aligned_multimap'] - parsed_data['aligned_discordant']
        return parsed_data
937927
function parse_BrtXF(data, length) {
	var tgt = data.l + length;
	var ixfeParent = data.read_shift(2);
	var ifmt = data.read_shift(2);
	data.l = tgt;
	return {ixfe:ixfeParent, numFmtId:ifmt };
}
529839
def parsedate_tz(data):
    
    res = _parsedate_tz(data)
    if not res:
        return
    if res[9] is None:
        res[9] = 0
    return tuple(res)
352369
function parse_BrtFmt(data, length) {
	var ifmt = data.read_shift(2);
	var stFmtCode = parse_XLWideString(data,length-2);
	return [ifmt, stFmtCode];
}
112173
def _parse_ntthal(ntthal_output):
    '''  '''
    parsed_vals = re.search(_ntthal_re, ntthal_output)
    return THERMORESULT(
        True,                           # Structure found
        float(parsed_vals.group(1)),    # dS
        float(parsed_vals.group(2)),    # dH
        float(parsed_vals.group(3)),    # dG
        float(parsed_vals.group(4))     # tm
    ) if parsed_vals else NULLTHERMORESULT
1303276
private void parseSerialFieldString() {
        int len = text.length();
        if (len == 0) {
            return;
        }

        // if no white space found
        /* Skip white space. */
        int inx = 0;
        int cp;
        for (; inx < len; inx += Character.charCount(cp)) {
             cp = text.codePointAt(inx);
             if (!Character.isWhitespace(cp)) {
                 break;
             }
        }

        /* find first word. */
        int first = inx;
        int last = inx;
        cp = text.codePointAt(inx);
        if (! Character.isJavaIdentifierStart(cp)) {
            docenv().warning(holder,
                             "tag.serialField.illegal_character",
                             new String(Character.toChars(cp)), text);
            return;
        }

        for (inx += Character.charCount(cp); inx < len; inx += Character.charCount(cp)) {
             cp = text.codePointAt(inx);
             if (!Character.isJavaIdentifierPart(cp)) {
                 break;
             }
        }

        if (inx < len && ! Character.isWhitespace(cp = text.codePointAt(inx))) {
            docenv().warning(holder,
                             "tag.serialField.illegal_character",
                             new String(Character.toChars(cp)), text);
            return;
        }

        last = inx;
        fieldName = text.substring(first, last);

        /* Skip white space. */
        for (; inx < len; inx += Character.charCount(cp)) {
             cp = text.codePointAt(inx);
             if (!Character.isWhitespace(cp)) {
                 break;
             }
        }

        /* find second word. */
        first = inx;
        last = inx;

        for (; inx < len; inx += Character.charCount(cp)) {
             cp = text.codePointAt(inx);
             if (Character.isWhitespace(cp)) {
                 break;
             }
        }
        if (inx < len && ! Character.isWhitespace(cp = text.codePointAt(inx))) {
            docenv().warning(holder,
                             "tag.serialField.illegal_character",
                             new String(Character.toChars(cp)), text);
            return;
        }
        last = inx;
        fieldType = text.substring(first, last);

        /* Skip leading white space. Rest of string is description for serialField.*/
        for (; inx < len; inx += Character.charCount(cp)) {
             cp = text.codePointAt(inx);
             if (!Character.isWhitespace(cp)) {
                 break;
             }
        }
        description = text.substring(inx);
    }
1001387
function parse_BrtXF(data, length) {
	var ixfeParent = data.read_shift(2);
	var ifmt = data.read_shift(2);
	parsenoop(data, length-4);
	return {ixfe:ixfeParent, ifmt:ifmt };
}
375079
def parse_output(self, s):
        '''
        
        '''

        for x in s.splitlines():
            if '%' in x:
                name = x.split(':')[0].strip().lower()
                nbytes = x.split(':')[1].split('b')[0].strip()
                nbytes = int(nbytes)
                perc = x.split('(')[1].split('%')[0].strip()
                perc = float(perc)
                if name == 'program':
                    self.program_bytes = nbytes
                    self.program_percentage = perc
                else:
                    self.data_bytes = nbytes
                    self.data_percentage = perc
795366
def _parse_residue(self, residue):
        
        
        # Filter Element Nodes
        childs = [ child for child in residue.childNodes if child.nodeType == child.ELEMENT_NODE ]
        
        # Parse info out
        resi = int(childs[0].firstChild.data.strip())
        resn = childs[1].firstChild.data.strip()
        icode = childs[3].firstChild.data
        chain = childs[4].firstChild.data.strip()
        model = int(childs[5].firstChild.data.strip())
        atoms = childs[6:]
        
        # Output
        
        return {'name':  resn,  'number': resi,
                'icode': icode, 'chain':  chain, 
                'model': model, 'atoms': atoms}
1127113
function parse(text) {
  const compCount = U.countComponents(text);
  if (!compCount) {
    return; // undefined
  }

  const len = text.length,
    components = new Array(compCount);

  let multiplier = 1,
    pos = 0,
    nextComp = 0;

  //console.log(`parsing unit ${text}:`);
  while (pos < len) {
    let ch = text.charCodeAt(pos);

    if (ch === U.slash) {
      multiplier *= -1;
      pos++;
    } else if (ch === U.asterisk) {
      pos++;
    }

    let s = pos;
    for (; pos < len; pos++) {
      ch = text.charCodeAt(pos);

      if (!U.isLetter(ch)) {
        break;
      }
    }

    const name = text.substring(s, pos);
    const unitType = bySid[name];
    if (!unitType) {
      throw new Error(`Unknown unit type "${name}" in "${text}"`);
    }

    if (pos < len && text.charCodeAt(pos) === U.caret) {
      pos++;
    }

    s = pos;
    if (pos < len && text.charCodeAt(pos) === U.minus) {
      pos++;
    }

    while (pos < len && U.isDigit(text.charCodeAt(pos))) {
      pos++;
    }

    const degreeText = text.substring(s, pos);

    let degree;
    if (!degreeText.length) {
      degree = 1;
    } else {
      degree = Number.parseInt(degreeText);
      if (isNaN(degree)) {
        throw new Error(`Illegal degree "${degreeText}" in "${text}"`);
      }
    }

    degree *= multiplier;

    let ci = 0;
    for (; ci < nextComp; ci++) {
      const comp = components[ci];

      if (comp.unitType === unitType) {
        comp.degree += degree;
        break;
      }
    }

    if (ci >= nextComp) {
      components[nextComp++] = new UnitTypeDegree(unitType, degree);
    }

    //console.log(` + ${name} ==> ${degree}`);
  }

  components.length = nextComp;
  return parseComponents(components);
}
549671
def parse(self):
        """"""
        data = utils.ruby_lines(self.readlines())
        data = [tuple(j.strip() for j in line.split(None, 1))
                for line in data]
        depends = {}
        for line in data:
            if not len(line) == 2:
                continue
            key, value = line
            if key == 'depends':
                value = value.split(',')
                lib = utils.ruby_strip(value[0])
                detail = [utils.ruby_strip(j) for j in value[1:]]
                depends[lib] = detail
        datamap = {key: utils.ruby_strip(val) for key, val in data}
        if depends:
            datamap['depends'] = depends
        self.seek(0)
        return datamap
205280
def to_string(self, verbose=0):
        """"""
        lines = []
        app = lines.append
        app("<%s: %s>" % (self.__class__.__name__, self.basename))
        app("  summary: " + self.summary.strip())
        app("  number of valence electrons: %s" % self.Z_val)
        app("  maximum angular momentum: %s" % l2str(self.l_max))
        app("  angular momentum for local part: %s" % l2str(self.l_local))
        app("  XC correlation: %s" % self.xc)
        app("  supports spin-orbit: %s" % self.supports_soc)

        if self.isnc:
            app("  radius for non-linear core correction: %s" % self.nlcc_radius)

        if self.has_hints:
            for accuracy in ("low", "normal", "high"):
                hint = self.hint_for_accuracy(accuracy=accuracy)
                app("  hint for %s accuracy: %s" % (accuracy, str(hint)))

        return "\n".join(lines)
819044
def parse_transform(transform_str):
    """"""
    if not transform_str:
        return np.identity(3)
    elif not isinstance(transform_str, str):
        raise TypeError('Must provide a string to parse')

    total_transform = np.identity(3)
    transform_substrs = transform_str.split(')')[:-1]  # Skip the last element, because it should be empty
    for substr in transform_substrs:
        total_transform = total_transform.dot(_parse_transform_substr(substr))

    return total_transform
404333
def ParseMultiple(self, result_dicts):
    """"""
    for result_dict in result_dicts:
      # Currently we are only grabbing the Identifying Number
      # as the serial number (catches the unique number for VMs).
      # This could be changed to include more information from
      # Win32_ComputerSystemProduct.

      yield rdf_client.HardwareInfo(
          serial_number=result_dict["IdentifyingNumber"],
          system_manufacturer=result_dict["Vendor"])