<commit_before><?php
    /**
     * Helper class to load demo data for each module in the application.
     */
    class DemoDataUtil
    {
        protected static $loadedModules = array();

        /**
         * Loads all module demo data based on a dependency tree loading the dependent module data first.
         * @param object $messageLogger
         */
        public static function load(& $messageLogger, $loadMagnitude = null)
        {
            assert('$messageLogger instanceof MessageLogger');
            assert('$loadMagnitude == null || is_int($loadMagnitude)');
            Yii::import('application.extensions.zurmoinc.framework.data.*');
            $loadedModules = array();
            $demoDataHelper = new DemoDataHelper();
            $modules = Module::getModuleObjects();

            foreach ($modules as $module)
            {
                echo "Start:" . memory_get_usage(true) ."\n";
                static::loadByModule($module, $messageLogger, $demoDataHelper, $loadMagnitude);
                echo "End:" . memory_get_usage(true) ."\n";
            }
        }

        protected static function loadByModule($module, & $messageLogger,
                                               & $demoDataHelper, $loadMagnitude = null)
        {
            assert('$module instanceof Module');
            assert('$messageLogger instanceof MessageLogger');
            assert('$demoDataHelper instanceof DemoDataHelper');
            assert('$loadMagnitude == null || is_int($loadMagnitude)');
            $parentModule = $module->getParentModule();
            if ($parentModule != null)
            {
                Yii::import('application.modules.' . $parentModule::getDirectoryName() . '.data.*');
            }
            else
            {
                Yii::import('application.modules.' . $module::getDirectoryName() . '.data.*');
            }
            $demoDataMakerClassName = $module::getDemoDataMakerClassName();
            if ($demoDataMakerClassName != null && !in_array($module->getName(), static::$loadedModules))
            {
                $dependencies = $demoDataMakerClassName::getDependencies();
                foreach ($dependencies as $dependentModuleName)
                {
                    if (!in_array($dependentModuleName, static::$loadedModules))
                    {
                        $dependentModule       = Yii::app()->findModule($dependentModuleName);
                        static::loadByModule($dependentModule, $messageLogger,<commit_msg>Removed echo command after tests completed<commit_after><?php
    /**
     * Helper class to load demo data for each module in the application.
     */
    class DemoDataUtil
    {
        protected static $loadedModules = array();

        /**
         * Loads all module demo data based on a dependency tree loading the dependent module data first.
         * @param object $messageLogger
         */
        public static function load(& $messageLogger, $loadMagnitude = null)
        {
            assert('$messageLogger instanceof MessageLogger');
            assert('$loadMagnitude == null || is_int($loadMagnitude)');
            Yii::import('application.extensions.zurmoinc.framework.data.*');
            $loadedModules = array();
            $demoDataHelper = new DemoDataHelper();
            $modules = Module::getModuleObjects();

            foreach ($modules as $module)
            {
                static::loadByModule($module, $messageLogger, $demoDataHelper, $loadMagnitude);
            }
        }

        protected static function loadByModule($module, & $messageLogger,
                                               & $demoDataHelper, $loadMagnitude = null)
        {
            assert('$module instanceof Module');
            assert('$messageLogger instanceof MessageLogger');
            assert('$demoDataHelper instanceof DemoDataHelper');
            assert('$loadMagnitude == null || is_int($loadMagnitude)');
            $parentModule = $module->getParentModule();
            if ($parentModule != null)
            {
                Yii::import('application.modules.' . $parentModule::getDirectoryName() . '.data.*');
            }
            else
            {
                Yii::import('application.modules.' . $module::getDirectoryName() . '.data.*');
            }
            $demoDataMakerClassName = $module::getDemoDataMakerClassName();
            if ($demoDataMakerClassName != null && !in_array($module->getName(), static::$loadedModules))
            {
                $dependencies = $demoDataMakerClassName::getDependencies();
                foreach ($dependencies as $dependentModuleName)
                {
                    if (!in_array($dependentModuleName, static::$loadedModules))
                    {
                        $dependentModule       = Yii::app()->findModule($dependentModuleName);
                        static::loadByModule($dependentModule, $messageLogger,
{'fraction_non_alphanumeric': 0.11636802899134287, 'fraction_numerical': 0.0, 'mean_word_length': 1.9748502994011976, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2404371', 'n_tokens_mistral': 1173, 'n_tokens_neox': 1136, 'n_words': 250}