Parses the `.gitignore` file represented by the *lines*.
173045
def parse(self, lines):
    

    if isinstance(lines, str):
      lines = lines.split('\n')
    sub = _re.sub
    for line in lines:
      if line.endswith('\n'):
        line = line[:-1]
      line = line.lstrip()
      if not line.startswith('#'):
        invert = False
        if line.startswith('!'):
          line = line[1:]
          invert = True
        while line.endswith(' ') and line[-2:] != '\ ':
          line = line[:-1]
        line = sub(r'\\([!# ])', r'\1', line)
        if '/' in line and not line.startswith('/'):
          # Patterns with a slash can only be matched absolute.
          line = '/' + line
        self.patterns.append(Pattern(line, invert))
867267
function filter_lines_for_parsing(lines)
{
	// filter out blank lines
	lines = lines.filter(line => !is_blank(line.line))

	lines.forEach(function(line)
	{
		// remove single line comments
		line.line = line.line.replace(/^\s*\/\/.*/, '')
		// remove any trailing whitespace
		line.line = line.line.trim()
	})

	return lines
}
39754
def parse_line(self, line: str):
        
        for i in KEYPAIR_RE.finditer(line):
            key = i.group(1)
            value = urllib.parse.unquote(i.group(2))
            self[key] = value
732338
def parse_file(path)
      {}.tap do |hash|
        File.readlines(path).each do |line|
          key, value = line.split(SEPARATOR)
          hash[key] = value.strip
        end
      end
    end
884667
def _ParseFile(self, file_obj, line_parser):
    
    lines = [
        l.strip() for l in utils.ReadFileBytesAsUnicode(file_obj).splitlines()
    ]
    try:
      for index, line in enumerate(lines):
        if line:
          line_parser(line)
    except (IndexError, KeyError) as e:
      raise parser.ParseError("Invalid file at line %d: %s" % (index + 1, e))
588625
def process_file(vcs, commit, force, gitlint_config, file_data):
    
    filename, extra_data = file_data

    if force:
        modified_lines = None
    else:
        modified_lines = vcs.modified_lines(
            filename, extra_data, commit=commit)
    result = linters.lint(filename, modified_lines, gitlint_config)
    result = result[filename]

    return filename, result
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
228459
def parse_line(self, line):
        """"""
        match = re.findall(self.date_regex, line)
        if match:
            fields = self.fields
        elif self.backup_format_regex and not match:
            match = re.findall(self.backup_date_regex, line)
            fields = self.backup_fields

        if match:
            entry = {}
            entry['raw_text'] = line
            entry['parser'] = self.name

            matchlist = list(zip(fields, match[0]))
            for f, v in matchlist:
                entry[f] = v

            if 'date_stamp' in entry.keys():
                if self.datestamp_type == 'standard':
                    entry = logdissect.utils.convert_standard_datestamp(entry)
                elif self.datestamp_type == 'iso':
                    entry = logdissect.utils.convert_iso_datestamp(
                            entry)
                elif self.datestamp_type == 'webaccess':
                    entry = logdissect.utils.convert_webaccess_datestamp(
                            entry)
                elif self.datestamp_type == 'nodate':
                    entry, self.datedata = \
                            logdissect.utils.convert_nodate_datestamp(
                            entry, self.datedata)
                elif self.datestamp_type == 'unix':
                    entry = logdissect.utils.convert_unix_datestamp(
                            entry)
            if self.datestamp_type == 'now':
                entry = logdissect.utils.convert_now_datestamp(
                        entry)

            entry = self.post_parse_action(entry)
            return entry

        else:
            return None
662812
def process_line(line, line_number, filename)
      warnings = all_warnings_for_line(line, line_number, filename)
      fix_input(warnings, line, line_number, filename) if @settings[:fix]
      warnings
    end
885003
def parse_show_server_lines(server, lines)
      s = Server.new(server)
      lines.each do |l|
        key, value = l.gsub("\t","").split(": ")
        case key.chomp
        when "active"
          s.active = value.to_bool
        when "ssh_command"
          s.ssh_cmd = value
        when "conninfo"
          s.conn_info = value
        when "backup_directory"
          s.backup_dir = value
        when "basebackups_directory"
          s.base_backups_dir = value
        when "wals_directory"
          s.wals_dir = value
        when "server_txt_version"
          s.pg_version = value
        end
      end
      return s
    end
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
527282
def parse_line(line, &block) # :yields: request
      if request_data = file_format.parse_line(line) { |wt, message| warn(wt, message) }
        @parsed_lines += 1
        update_current_request(request_data.merge(source: @current_source, lineno: @current_lineno), &block)
      end
    end
1374825
def parse(self, fileobj, name_hint='', parser=None):
        """"""
        self.current_block = None  # Reset current block
        parser = parser or Parser()
        for line in parser.parse(fileobj, name_hint=name_hint):
            self.handle_line(line)
659171
function parse(line) {
  assert_str(line)

  return Either.either(pipe, noop, Right(line).chain(is_inlined).chain(is_native).chain(is_not_inlined))
}
823966
def parse_line(line):
  
  columns = line.split()
  token = columns.pop(0)
  values = [float(column) for column in columns]
  return token, values
933744
def parse(self, lines):
        '''
        
        '''
        signature = None

        for line in lines:
            # Split at the first comment delimiter (if any) and strip the
            # result
            line = line.split('#')[0].strip()
            # Ignore blank lines and lines that are nothing but comments.
            # We also don't support the '!mime' style line entries.
            if line and line[0] != '!':
                # Parse this signature line
                sigline = SignatureLine(line)
                # Level 0 means the first line of a signature entry
                if sigline.level == 0:
                    # If there is an existing signature, append it to the signature list,
                    # unless the text in its title field has been filtered by user-defined
                    # filter rules.
                    if signature and not self._filtered(signature.title):
                        self.signatures.append(signature)

                    # Create a new signature object; use the size of self.signatures to
                    # assign each signature a unique ID.
                    signature = Signature(len(self.signatures), sigline)
                # Else, just append this line to the existing signature
                elif signature:
                    # signature.append(sigline)
                    signature.lines.append(sigline)
                # If this is not the first line of a signature entry and there is no other
                # existing signature entry, something is very wrong with the
                # signature file.
                else:
                    raise ParserException("Invalid signature line: '%s'" % line)

        # Add the final signature to the signature list
        if signature:
            if not self._filtered(signature.lines[0].format):
                self.signatures.append(signature)

        # Sort signatures by confidence (aka, length of their magic bytes),
        # largest first
        self.signatures.sort(key=lambda x: x.confidence, reverse=True)
1369724
def parse(self, lines):
        ''''''
        if self.type == 'msdos':
            return self.parse_msdos(lines)
        elif self.type == 'unix':
            return self.parse_unix(lines)
        elif self.type == 'nlst':
            return self.parse_nlst(lines)
        else:
            raise UnknownListingError('Unsupported listing type.')