<commit_before>'use strict';
var defaults = require('lodash/defaults');
var find = require('lodash/find');
var includes = require('lodash/includes');
var multimatch = require('multimatch');
var slash = require('slash');
var pick = require('lodash/pick');

var header = [
    '<?xml version="1.0" encoding="UTF-8"?>',
    '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'
];

var headerHref = [
    '<?xml version="1.0" encoding="UTF-8"?>',
    '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">'
];

var footer = ['</urlset>'];
var allowedProperties = ['getLoc', 'lastmod', 'priority', 'changefreq', 'hreflang'];

function getEntryConfig(file, siteConfig) {
    var relativePath = file.relative;
    var mappingsForFile = find(siteConfig.mappings, function(item) {
        return multimatch(relativePath, item.pages).length > 0;
    }) || {};

    var entry = defaults(
        {},
        pick(mappingsForFile, allowedProperties),
        pick(siteConfig, allowedProperties)
    );

    if (entry.lastmod === null) {
        // calculate mtime manually
        entry.lastmod = file.stat && file.stat.mtime || Date.now();
    } else if (typeof entry.lastmod === 'function') {
        entry.lastmod = entry.lastmod(file);
    }

    const indexRegex = /(\/|^)index\.html?$/;
    //turn index.html into -> /
    var relativeFile = relativePath.replace(indexRegex, function(string, match) {
        return match.slice(0, 1) === '/' ? '/' : '';
    }, 'i');
    //url location. Use slash to convert windows \\ or \ to /
    var adjustedFile = slash(relativeFile);
    entry.loc = siteConfig.siteUrl + adjustedFile;
    entry.file = adjustedFile;

    return entry;
}

function wrapTag(tag, value) {
    return '<' + tag + '>' + value + '</' + tag + '>';
}<commit_msg>Change const back to var<commit_after>'use strict';
var defaults = require('lodash/defaults');
var find = require('lodash/find');
var includes = require('lodash/includes');
var multimatch = require('multimatch');
var slash = require('slash');
var pick = require('lodash/pick');

var header = [
    '<?xml version="1.0" encoding="UTF-8"?>',
    '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'
];

var headerHref = [
    '<?xml version="1.0" encoding="UTF-8"?>',
    '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">'
];

var footer = ['</urlset>'];
var allowedProperties = ['getLoc', 'lastmod', 'priority', 'changefreq', 'hreflang'];

function getEntryConfig(file, siteConfig) {
    var relativePath = file.relative;
    var mappingsForFile = find(siteConfig.mappings, function(item) {
        return multimatch(relativePath, item.pages).length > 0;
    }) || {};

    var entry = defaults(
        {},
        pick(mappingsForFile, allowedProperties),
        pick(siteConfig, allowedProperties)
    );

    if (entry.lastmod === null) {
        // calculate mtime manually
        entry.lastmod = file.stat && file.stat.mtime || Date.now();
    } else if (typeof entry.lastmod === 'function') {
        entry.lastmod = entry.lastmod(file);
    }

    var indexRegex = /(\/|^)index\.html?$/;
    //turn index.html into -> /
    var relativeFile = relativePath.replace(indexRegex, function(string, match) {
        return match.slice(0, 1) === '/' ? '/' : '';
    }, 'i');
    //url location. Use slash to convert windows \\ or \ to /
    var adjustedFile = slash(relativeFile);
    entry.loc = siteConfig.siteUrl + adjustedFile;
    entry.file = adjustedFile;

    return entry;
}

function wrapTag(tag, value) {
    return '<' + tag + '>' + value + '</' + tag + '>';
}
{'fraction_non_alphanumeric': 0.18152085036794766, 'fraction_numerical': 0.009811937857726901, 'mean_word_length': 3.302461899179367, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 4, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 10}, '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': '6149623', 'n_tokens_mistral': 1215, 'n_tokens_neox': 1155, 'n_words': 252}