Parse a line into a `TabLine` object.
332862
def parse_line(line):
    '''  '''
    line = line.rstrip()
    line_type = _get_line_type(line)
    return TabLine(
        type=line_type,
        data=_DATA_PARSERS[line_type](line),
        original=line,
    )
29502
def parse(self, lines):
        """"""
        cur_entry = None
        for line in lines:
            kv_ = _key_value(line)
            if len(kv_) > 1:
                key, value = kv_
                if key.lower() == "host":
                    cur_entry = value
                    self.hosts_.add(value)
                self.lines_.append(ConfigLine(line=line, host=cur_entry, key=key, value=value))
            else:
                self.lines_.append(ConfigLine(line=line))
912095
def _parseline(self, line):
        
        sline = line.split(SEPARATOR)
        segment = sline[0]
        handlers = {
            SEGMENT_HEADER: self._handle_header,
            SEGMENT_EOF: self._handle_eof,
            SEGMENT_RESULT: self._handle_result_line,
            SEGMENT_OBSERVATION_ORDER: self._handle_new_record
        }
        handler = handlers.get(segment)
        if handler:
            return handler(sline)
        return 0
1295196
private String cutAfterTab(String line) {
        Pattern p = Pattern.compile("^(.*)\\t.*$");
        Matcher matcher = p.matcher(line);
        if (matcher.matches()) {
            return matcher.group(1);
        } else {
            return line;
        }
    }
1353485
def readWiggleLine(self, line):
        
        if(line.isspace() or line.startswith("#")
                or line.startswith("browser") or line.startswith("track")):
            return
        elif line.startswith("variableStep"):
            self._mode = self._VARIABLE_STEP
            self.parseStep(line)
            return
        elif line.startswith("fixedStep"):
            self._mode = self._FIXED_STEP
            self.parseStep(line)
            return
        elif self._mode is None:
            raise ValueError("Unexpected input line: %s" % line.strip())

        if self._queryReference != self._reference:
            return

        # read data lines
        fields = line.split()
        if self._mode == self._VARIABLE_STEP:
            start = int(fields[0])-1  # to 0-based
            val = float(fields[1])
        else:
            start = self._start
            self._start += self._step
            val = float(fields[0])

        if start < self._queryEnd and start > self._queryStart:
            if self._position is None:
                self._position = start
                self._data.start = start

            # fill gap
            while self._position < start:
                self._data.values.append(float('NaN'))
                self._position += 1
            for _ in xrange(self._span):
                self._data.values.append(val)
            self._position += self._span
394099
def _parse_entry_record(self, lines):
        """"""
        dn = None
        entry = OrderedDict()

        for line in lines:
            attr_type, attr_value = self._parse_attr(line)

            if attr_type == 'dn':
                self._check_dn(dn, attr_value)
                dn = attr_value
            elif attr_type == 'version' and dn is None:
                pass  # version = 1
            else:
                if dn is None:
                    self._error('First line of record does not start '
                        'with "dn:": %s' % attr_type)
                if attr_value is not None and \
                         attr_type.lower() not in self._ignored_attr_types:
                    if attr_type in entry:
                        entry[attr_type].append(attr_value)
                    else:
                        entry[attr_type] = [attr_value]

        return dn, entry
421931
def decode(cls, line):
        """"""
        if line.encoded:
            encoding = getattr(line, 'encoding_param', None)
            if encoding and encoding.upper() == cls.base64string:
                line.value = b64decode(line.value)
            else:
                line.value = stringToTextValues(line.value)[0]
            line.encoded = False
1363362
def _parse_line(cls, line):
        
        match = cls._xml_elm_line_patt.match(line)
        front, attrs, close, text = [match.group(n) for n in range(1, 5)]
        return front, attrs, close, text
100667
function parseProgressLine(line) {
  var progress = {};

  // Remove all spaces after = and trim
  line  = line.replace(/=\s+/g, '=').trim();
  var progressParts = line.split(' ');

  // Split every progress part by "=" to get key and value
  for(var i = 0; i < progressParts.length; i++) {
    var progressSplit = progressParts[i].split('=', 2);
    var key = progressSplit[0];
    var value = progressSplit[1];

    // This is not a progress line
    if(typeof value === 'undefined')
      return null;

    progress[key] = value;
  }

  return progress;
}
850831
def parser(self, lines):
        """"""
        while len(lines) > 0:
            if lines[0].startswith('##') and lines[1].startswith('# '):
                # A two-line keyword/value line starts here.
                self._header_append(lines.pop(0), lines.pop(0))
            elif lines[0].startswith('# '):
                # Lines with single comments are exposure numbers unless preceeded by double comment line
                self._append_file_id(lines.pop(0))
            elif lines[0].startswith('##'):
                # Double comment lines without a single comment following are column headers for dataset.
                self._set_column_names(lines.pop(0)[2:])
            else:
                # Last line of the header reached.
                return self
        raise IOError("Failed trying to read header")
1229480
def from_lines(pdb_file_lines, strict = True, parse_ligands = False):
        ''''''
        return PDB("\n".join(pdb_file_lines), strict = strict, parse_ligands = parse_ligands)
678964
def parse (cls, line, lineno, log, cmddict=None):
    
    start  = line.find('%')
    pos    = SeqPos(line, lineno, start + 1, len(line))
    result = None

    if start >= 0:
      result = cls(line[start:], pos)

    return result
1195241
def _parse_eloss(line, lines):
    """"""

    split_line = line.split()

    energy = float(split_line[0])
    eloss_xx = float(split_line[1])
    eloss_zz = float(split_line[2])

    return {"energy": energy, "eloss_xx": eloss_xx, "eloss_zz": eloss_zz}
462692
public void parseTagedLine(String line) {
		String[] toks = line.split("(\\s|　| |\\t)+");
		words = new String[toks.length];
		tags = new String[toks.length];
		for(int i=0;i<toks.length;i++){
			String[] tt = toks[i].split("/");
			if(tt.length!=2)
				System.err.println("Wrong Format");
			words[i] = tt[0];
			tags[i]=tt[1];
		}
		
		
	}
823966
def parse_line(line):
  
  columns = line.split()
  token = columns.pop(0)
  values = [float(column) for column in columns]
  return token, values
244214
def parse_columns(lines):
    
    data = []
    index = []
    for line in lines:
        line = line.rstrip()
        if line.startswith("#"):
            tmp = __parse_entry(line)
            data.append(tmp[1])
            index.append(tmp[0])

    return DataFrame(data, index=index, columns=['description'])
821702
def _line_parse(line):
    
    if line[-2:] in ['\r\n', b'\r\n']:
        return line[:-2], True
    elif line[-1:] in ['\r', '\n', b'\r', b'\n']:
        return line[:-1], True
    return line, False