Parse the lines using the given regular expression.

    If a line can't be parsed it is logged and skipped in the output.
170898
async def _parse_lines(lines, regex):
    
    results = []
    if inspect.iscoroutinefunction(lines):
        lines = await lines
    for line in lines:
        if line:
            match = regex.search(line)
            if not match:
                _LOGGER.debug("Could not parse row: %s", line)
                continue
            results.append(match.groupdict())
    return results
341772
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
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,
    )
1189312
def parse_line(line)
      case line
      when /^SF:([\.\/\w]+)/
        @current_filename = $~[1].gsub(/^\.\//, '')
        source_files[@current_filename] = []
      when /^DA:(\d+),(\d+)/
        line_no = $~[1]
        covered = $~[2]
        source_files[@current_filename] << [line_no.to_i, covered.to_i]
      when /^end_of_record$/, /^$/
        @current_filename = nil
      else
        raise LcovParseError, "could not recognise '#{line}' as valid LCOV"
      end
    end
735997
def parse_line(text):
    
    indent,text = calculate_indent(text)
    results = line_parser.parseString(text, parseAll=True).asList()
    return indent,results[0]
1161761
def parse_line_headers(self, line):
        
        headers = line.split(",")
        for i, v in enumerate(headers):
            if v:
                headers[i] = v
            else:
                headers[i] = str(i)
        self.headers = headers
1015865
def _parse_code(self, line):
        
        log.debug("*** parse CODE: >>>%r<<<", line)
        parts = self.regex_split_all.split(line, maxsplit=1)
        if len(parts) == 1:  # end
            self.line_data.append(BASIC_Code(parts[0]))
            return
        pre, match, post = parts
        log.debug("\tpre: >>>%r<<<", pre)
        log.debug("\tmatch: >>>%r<<<", match)
        log.debug("\tpost: >>>%r<<<", post)

        if match == '"':
            log.debug("%r --> parse STRING", match)
            self.line_data.append(BASIC_Code(pre))
            string_part, rest = self._parse_string(post)
            self.line_data.append(BASIC_String(match + string_part))
            if rest:
                self._parse_code(rest)
            return

        self.line_data.append(BASIC_Code(pre + match))

        if match == "DATA":
            log.debug("%r --> parse DATA", match)
            data_part, rest = self._parse_data(post)
            self.line_data.append(BASIC_Data(data_part))
            if rest:
                self._parse_code(rest)
            return
        elif match in ("'", "REM"):
            log.debug("%r --> consume rest of the line as COMMENT", match)
            if post:
                self.line_data.append(BASIC_Comment(post))
            return

        raise RuntimeError("Wrong Reg.Exp.? match is: %r" % match)
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()
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, {})
1245764
def parse(self, text):
        """"""
        text = self.preprocess(text)
        token_stack = []
        last_pos = 0

        # Iterate through all matched tokens
        for match in self.regex.finditer(text):
            # Find which token has been matched by regex
            token, match_type, group = self.get_matched_token(match)

            # Get params from stack of tokens
            params = self.get_params(token_stack)

            # Should we skip interpreting tokens?
            skip = token_stack[-1].skip if token_stack else False

            # Check for end token first
            if match_type == MatchType.end:
                if not skip or token_stack[-1] == token:
                    removed = self.remove_token(token_stack, token)
                    if removed:
                        skip = False
                    else:
                        skip = True

            if not skip:
                # Append text preceding matched token
                start_pos = match.start(group)
                if start_pos > last_pos:
                    yield Segment(self.postprocess(text[last_pos:start_pos]), **params)

                # Actions specific for start token or single token
                if match_type == MatchType.start:
                    token_stack.append(token)
                elif match_type == MatchType.single:
                    single_params = params.copy()
                    single_params.update(token.params)
                    single_text = token.text if token.text is not None else match.group(group)
                    yield Segment(single_text, token=token, match=match, **single_params)

                # Move last position pointer to the end of matched token
                last_pos = match.end(group)

        # Append anything that's left
        if last_pos < len(text):
            params = self.get_params(token_stack)
            yield Segment(self.postprocess(text[last_pos:]), **params)
878216
def parse_line(self, line):
        

        # Skip blanks
        if line == '':
            return

        # Skip comments
        if regex_comment.search(line):
            return

        # Special case / header: parse global parameters into metadata
        global_parameters = regex_global.search(line)
        if global_parameters:
            self.parse_global_meta(global_parameters.group('parameters'))
            return

        # Tries to check the validity of the line.
        crtf_line = regex_line.search(line)
        if crtf_line:
            # Tries to parse the line.

            # Finds info about the region.
            region = regex_region.search(crtf_line.group('region'))
            type_ = region.group('type') or 'reg'
            include = region.group('include') or '+'
            region_type = region.group('regiontype').lower()
            if region_type in self.valid_definition:
                helper = CRTFRegionParser(self.global_meta, include, type_, region_type,
                                          *crtf_line.group('region', 'parameters'))
                self.shapes.append(helper.shape)
            else:
                self._raise_error("Not a valid CRTF Region type: '{0}'.".format(region_type))

        else:
            self._raise_error("Not a valid CRTF line: '{0}'.".format(line))
            return
604083
def parse_line(match)
        raise InvalidFormat.new "Couldn't parse plugin" if match.nil?
        Derelict::Plugin.new *match.captures[0..1]
      end
862920
def parse_line(line)
      ruby_match = line.match(RUBY_FORMAT)

      if ruby_match
        _, file, number, method = ruby_match.to_a
        file.sub!(/\.class$/, '.rb')
        module_name = nil
      else
        java_match = line.match(JAVA_FORMAT)
        _, module_name, method, file, number = java_match.to_a
      end

      [file, number, method, module_name]
    end
522155
def parse_files(self):
        
        log_re = self.log_format_regex
        log_lines = []
        for log_file in self.matching_files():
            with open(log_file) as f:
                matches = re.finditer(log_re, f.read())
                for match in matches:
                    log_lines.append(match.groupdict())
        return log_lines
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
137194
def _read_parsed(self, lines):
        
        self.log(u"Parsing fragments from parsed text format")
        pairs = []
        for line in lines:
            pieces = line.split(gc.PARSED_TEXT_SEPARATOR)
            if len(pieces) == 2:
                identifier = pieces[0].strip()
                text = pieces[1].strip()
                if len(identifier) > 0:
                    pairs.append((identifier, [text]))
        self._create_text_fragments(pairs)
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)