<commit_before>/**
 * @file HTTP headers parser helper
 */
/*#ifndef(UMD)*/
"use strict";
/*exported _gpfHttpParseHeaders*/ // Parse HTTP response headers
/*#endif*/

var _gpfHttpHeadersParserRE = new RegExp("([^:\\s]+)\\s*: ?([^\\r]*)", "gm");

/**
 * Parse HTTP response headers
 *
 * @param {String} headers Response headers
 * @return {Object} headers dictionary
 */
function _gpfHttpParseHeaders (headers) {
    _gpfHttpHeadersParserRE.lastIndex = 0;
    var match = _gpfHttpHeadersParserRE.exec(headers),
        result = {};
    while (match) {
        result[match[1]] = match[2];
        match = _gpfHttpHeadersParserRE.exec(headers);
    }<commit_msg>Improves maintainability<commit_after>/**
 * @file HTTP headers parser helper
 */
/*#ifndef(UMD)*/
"use strict";
/*global _gpfRegExpForEach*/ // Executes the callback for each match of the regular expression
/*exported _gpfHttpParseHeaders*/ // Parse HTTP response headers
/*#endif*/

var _gpfHttpHeadersParserRE = new RegExp("([^:\\s]+)\\s*: ?([^\\r]*)", "gm");

/**
 * Parse HTTP response headers
 *
 * @param {String} headers Response headers
 * @return {Object} headers dictionary
 */
function _gpfHttpParseHeaders (headers) {
    var result = {};
    _gpfHttpHeadersParserRE.lastIndex = 0;
    _gpfRegExpForEach(_gpfHttpHeadersParserRE, headers, function (match) {
        result[match[1]] = match[2];
    });
{'fraction_non_alphanumeric': 0.15927272727272726, 'fraction_numerical': 0.004363636363636364, 'mean_word_length': 4.04029304029304, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4184671', 'n_tokens_mistral': 435, 'n_tokens_neox': 429, 'n_words': 111}