<commit_before>const {JSDOM} = require('jsdom');
const {window, document} = new JSDOM('<html></html>');
global.window = window;
global.document = document;
const jQuery = require('jquery');

const glob = require('glob');
const fs = require('fs');
const path = require('path');
const mkdirp = require('mkdirp');
const copy = require('copy');
const fsExtra = require('fs-extra');

const prettier = require('prettier');

function copyFilesSync(files, dest) {
    files.forEach(file => fsExtra.copySync(file, dest + '/' + path.basename(file)));
}

function copyGlobSync(globString, dest) {
    copyFilesSync(glob.sync(globString), dest);
}

function phpArrayToJSON(string) {
    if (!string) {
        return {};
    }
    const replaced = string
        .replace(/^, /, '')
        .replace(/'/g, '"')
        .replace(/array\(("\w+"(, )?)+\)/, '[$1]')
        .replace(/array/g, '')
        .replace(/\(/g, '{')
        .replace(/\)/g, '}')
        .replace(/\=\>/g, ':');
    try {<commit_msg>Fix edge case parsing of PHP<commit_after>const {JSDOM} = require('jsdom');
const {window, document} = new JSDOM('<html></html>');
global.window = window;
global.document = document;
const jQuery = require('jquery');

const glob = require('glob');
const fs = require('fs');
const path = require('path');
const mkdirp = require('mkdirp');
const copy = require('copy');
const fsExtra = require('fs-extra');

const prettier = require('prettier');

function copyFilesSync(files, dest) {
    files.forEach(file => fsExtra.copySync(file, dest + '/' + path.basename(file)));
}

function copyGlobSync(globString, dest) {
    copyFilesSync(glob.sync(globString), dest);
}

function phpArrayToJSON(string) {
    if (!string) {
        return {};
    }
    const replaced = string
        .replace(/^, /, '')
        .replace(/'/g, '"')
        .replace(/array\((("\w+"(, )?)+)\)/, '[$1]')
        .replace(/array/g, '')
        .replace(/\(/g, '{')
        .replace(/\)/g, '}')
        .replace(/\=\>/g, ':');
    try {
{'fraction_non_alphanumeric': 0.21889055472263869, 'fraction_numerical': 0.0009995002498750624, 'mean_word_length': 3.3333333333333335, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '4078678', 'n_tokens_mistral': 664, 'n_tokens_neox': 649, 'n_words': 135}