Do the work of parsing each line
182860
def parse_lines(self, lines):
        
        indent = ''
        level = 0

        if lines[0][0] == ' ' or lines[0][0] == '\t':
            raise CommandError("The first line in the file cannot start with a space or tab.")

        # This keeps track of the current parents at a given level
        current_parents = {0: None}

        for line in lines:
            if len(line) == 0:
                continue
            if line[0] == ' ' or line[0] == '\t':
                if indent == '':
                    indent = self.get_indent(line)
                elif not line[0] in indent:
                    raise CommandError("You can't mix spaces and tabs for indents")
                level = line.count(indent)
                current_parents[level] = self.make_category(line, parent=current_parents[level - 1])
            else:
                # We are back to a zero level, so reset the whole thing
                current_parents = {0: self.make_category(line)}
        current_parents[0]._tree_manager.rebuild()
418054
def parse(self, line, **options):
        
        line = line.strip()
        if not line:
            return (False, (), {})
        split = line.split()
        cmd, args = split[0], split[1:]
        return (cmd, args, {})
1298130
def readlines(self):
        
        continuation = False
        while True:
            yield self.readline(continuation)
            continuation = True
465995
def parse_output(self, line):
        """"""

        try:
            key, value = line.split(":")
            self.update_value(key.strip(), value.strip())
        except ValueError:
            pass
549016
def find_lines(self, line):
        """"""
        for other_line in self.lines:
            if other_line.match(line):
                yield other_line
656214
def parse(self, lines, root):
    

    lst = IgnoreList(root)
    lst.parse(lines)
    self.append(lst)
777899
def parse_line(self, line):
        """"""

        prefix = ""
        # ignore comma at start of lines
        if line.startswith(","):
            line, prefix = line[1:], ","

        j = json.loads(line)
        yield j
        self.io.write_line(prefix + json.dumps(j))
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
73025
def _parse_line(self, file):
        

        line = self._strip_comments(file.readline())
        # check if the file ended
        if not line:
            return False

        # line was empty or it was a comment, continue
        if line.strip() == '':
            return True

        # retrieve keyword and its value
        reg = re.search("^\*(?P<key>[^:#]*)(:\s*(?P<value>.*)\s*)?$", line)
        if reg:
            key = reg.group('key').strip()
            value = reg.group('value')

            if key in self.mapping[self.current_state]:
                self.mapping[self.current_state][key](value)
            elif self.strict:
                raise BadFormat("unknown key: *%s" % key)
        else:
            raise BadFormat("line can not be parsed: %s" % line)

        return True
761391
def parse_lines(stream, separator=None):
    
    separator = None if separator is None else unicode(separator)
    for line in stream:
        line = line.rstrip(u'\r\n')
        row = [interpret_segment(i) for i in line.split(separator)]
        yield line, row
13861
def _split_lines(self):
        ''''''
        parsed_lines = {}
        for rt in all_record_types:
            parsed_lines[rt] = []
        parsed_lines[0] = []

        for line in self.lines:
            linetype = line[0:6]
            if linetype in all_record_types:
                parsed_lines[linetype].append(line)
            else:
                parsed_lines[0].append(line)

        self.parsed_lines = parsed_lines
        self._update_structure_lines()
110369
def parse(self, lines):
        
        patterns = [re.compile(r'^(.+?):(\d+)'),
                    re.compile(r'^\s+(.+)$')]
        for i, line in enumerate(lines):
            if i % 2 == 0:
                path, line_nr = patterns[0].match(line).groups()
            else:
                msg = patterns[1].match(line).group(1)
                yield LinterOutput(self.name, path, msg, line_nr)
174611
def parse(self):
        
        try:
            # Continues until `next_line()` raises StopIteration
            # This can trigger here or in parse functions in the subclass
            while True:
                # Only advance the parser if the previous line was consumed.
                # Parse functions reading multiple lines can end up reading one line too far,
                # so they return without consuming the line and we pick it up here
                if not self.line:
                    self.next_line()

                if self.line[0] == '#' or len(self.values) < 2:
                    self.consume_line()
                    continue

                self.dispatcher.get(self.values[0], self.parse_fallback)()
        except StopIteration:
            pass

        if self.auto_post_parse:
            self.post_parse()
345199
def parse
      parsed_output = []

      File.open(@filename).each_line.with_index do |line, num|
        next if line.lstrip[0] != "#"

        if expr = line.match(EXPRESSION)
          parsed_output.push [num, expr["expression"]]
        elsif result = line.match(RESULT)
          parsed_output.last.push(result["result"])
        end
      end
      parsed_output
    end
432971
def iter_lines(f):
    
    linenum = 1
    try:
        for text in f.readlines():
            # ignore lines that consist entirely of whitespace
            if text.isspace():
                continue
            indent,value = parse_line(text)
            yield linenum,indent,value
            linenum += 1
    except:
        raise ParserError(linenum, 0, '', 'failed to parse line')
761336
def get_all_lines(self):
        """"""
        output = []
        line = []
        lineno = 1
        for char in self.string:
            line.append(char)
            if char == '\n':
                output.append(SourceLine(''.join(line), lineno))
                line = []
                lineno += 1
        if line:
            output.append(SourceLine(''.join(line), lineno))

        return output
568523
def parse(self, line):
        """"""
        tokens = []

        self.idx = -1   # Bogus value to ensure idx = 0 after first iteration
        self.characters = iter(line)
        self.update_chars()

        while self.char != '\n':
            # Update namelist group status
            if self.char in ('&', '$'):
                self.group_token = self.char

            if self.group_token and (
                    (self.group_token, self.char) in (('&', '/'), ('$', '$'))):
                self.group_token = False

            word = ''
            if self.char in self.whitespace:
                while self.char in self.whitespace:
                    word += self.char
                    self.update_chars()

            elif self.char in ('!', '#') or self.group_token is None:
                # Abort the iteration and build the comment token
                word = line[self.idx:-1]
                self.char = '\n'

            elif self.char in '"\'' or self.prior_delim:
                word = self.parse_string()

            elif self.char.isalpha():
                word = self.parse_name(line)

            elif self.char in ('+', '-'):
                # Lookahead to check for IEEE value
                self.characters, lookahead = itertools.tee(self.characters)
                ieee_val = ''.join(itertools.takewhile(str.isalpha, lookahead))
                if ieee_val.lower() in ('inf', 'infinity', 'nan'):
                    word = self.char + ieee_val
                    self.characters = lookahead
                    self.prior_char = ieee_val[-1]
                    self.char = next(lookahead, '\n')
                else:
                    word = self.parse_numeric()

            elif self.char.isdigit():
                word = self.parse_numeric()

            elif self.char == '.':
                self.update_chars()
                if self.char.isdigit():
                    frac = self.parse_numeric()
                    word = '.' + frac
                else:
                    word = '.'
                    while self.char.isalpha():
                        word += self.char
                        self.update_chars()
                    if self.char == '.':
                        word += self.char
                        self.update_chars()

            elif self.char in Tokenizer.punctuation:
                word = self.char
                self.update_chars()

            else:
                # This should never happen
                raise ValueError

            tokens.append(word)

        return tokens