<commit_before><?php
if ($modx->getOption('queeg.active', null, true)) {
    switch ($modx->event->name) {
        case 'OnWebPagePrerender':

            if ($modx->context->get('key') === "mgr") {
                break;
            }

            if ($modx->user->hasSessionContext('mgr')) {
                $appname =  'queeg';
                $contentArray = array();
                $systemArray = array();

                // get queeg version
                $package = $modx->getObject('transport.modTransportPackage', array('package_name' => 'queeg'));
                if ($package) {
                    $major = $package->get('version_major');
                }

                // get user's language
                $userSettings = $modx->user->getSettings();
                $lang = $userSettings['manager_language'];

                if (!$lang) {
                    $lang = $modx->getOption('manager_language', null, 'en');
                }

                $modx->setOption('cultureKey', $lang);
                $modx->lexicon->load('core:default');

                // Initialize system settings
                $api =  $major;
                $param['id'] =  true;
                $param['published'] = (boolean) $modx->getOption('queeg.published', null, true);
                $param['editedon'] = (boolean) $modx->getOption('queeg.editedon', null, true);
                $param['editedby'] = (boolean) $modx->getOption('queeg.editedby', null, true);<commit_msg>Fix php notice when user settings are not set #2<commit_after><?php
if ($modx->getOption('queeg.active', null, true)) {
    switch ($modx->event->name) {
        case 'OnWebPagePrerender':

            if ($modx->context->get('key') === "mgr") {
                break;
            }

            if ($modx->user->hasSessionContext('mgr')) {
                $appname =  'queeg';
                $contentArray = array();
                $systemArray = array();

                // get queeg version
                $package = $modx->getObject('transport.modTransportPackage', array('package_name' => 'queeg'));
                if ($package) {
                    $major = $package->get('version_major');
                }

                // get user's language
                $userSettings = $modx->user->getSettings();
                if (is_array($userSettings) && isset($userSettings['manager_language'])) {
                    $lang = $userSettings['manager_language'];
                }

                if (!$lang) {
                    $lang = $modx->getOption('manager_language', null, 'en');
                }

                $modx->setOption('cultureKey', $lang);
                $modx->lexicon->load('core:default');

                // Initialize system settings
                $api =  $major;
                $param['id'] =  true;
                $param['published'] = (boolean) $modx->getOption('queeg.published', null, true);
                $param['editedon'] = (boolean) $modx->getOption('queeg.editedon', null, true);
                $param['editedby'] = (boolean) $modx->getOption('queeg.editedby', null, true);
{'fraction_non_alphanumeric': 0.16206675224646983, 'fraction_numerical': 0.00032092426187419767, 'mean_word_length': 1.6641025641025642, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 41, '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': '1885505', 'n_tokens_mistral': 883, 'n_tokens_neox': 814, 'n_words': 151}