<commit_before><?php defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * @author <NAME> <<EMAIL>>, 2014
 * @license The MIT License, http://opensource.org/licenses/MIT
 */

class Mustache_controller extends Base_Controller {

    public function __construct() {

        parent::__construct();

        $this->load->parser();

        $this->template
            ->title('Mustache Parser Test')
        ;

        $this->registry->set('nav', 'playground/mustache');
    }

    public function index() {

        $data = $this->_get_data();
        $mustache_template = $this->_get_template();

        $this->template
            ->set('data', $data)
            ->set('mustache_template', $mustache_template)
            ->set_partial('scripts', 'mustache_scripts')
            ->build('mustache');
    }

    protected function _get_data() {

        $csv = (string) @ file_get_contents(APPPATH.'demo_data/countries.csv');

        $items = preg_split('/\r\n|\r|\n/m', $csv, null, PREG_SPLIT_NO_EMPTY);

        foreach ($items as & $item) {

            $values = explode(';', $item);
            $item = (array('code' => $values[0], 'name' => $values[1]));
        }

        $data = array(
            'BASE_URI' => BASE_URI,
            'data' => $items
        );

        return $data;
    }

    protected function _get_template() {

        return $this->load->view('countries.mustache', null, true);
    }

}<commit_msg>Updating "Mustache Parser Test".<commit_after><?php defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * @author <NAME> <<EMAIL>>, 2014 - 2016
 * @license The MIT License, http://opensource.org/licenses/MIT
 */

class Mustache_controller extends Base_Controller {

    public function __construct() {

        parent::__construct();

        $this->load->parser();

        $this->template
            ->title('Mustache Parser Test')
        ;

        $this->registry->set('nav', 'playground/mustache');
    }

    public function index() {

        $data = $this->_get_data();
        $parsed_template_view_name = 'countries.mustache';
        $parsed_template_path = $this->load->path($parsed_template_view_name);
        $mustache_template = file_get_contents($parsed_template_path);

        $this->template
            ->set('data', $data)
            ->set('mustache_template', $mustache_template)
            ->set_partial('scripts', 'mustache_scripts')
            ->build('mustache');
    }

    protected function _get_data() {

        $csv = (string) @ file_get_contents(APPPATH.'demo_data/countries.csv');

        $items = preg_split('/\r\n|\r|\n/m', $csv, null, PREG_SPLIT_NO_EMPTY);

        foreach ($items as & $item) {

            $values = explode(';', $item);
            $item = (array('code' => $values[0], 'name' => $values[1]));
        }

        $data = array(
            'BASE_URI' => BASE_URI,
            'data' => $items
        );

        return $data;
    }

}
{'fraction_non_alphanumeric': 0.1651499831479609, 'fraction_numerical': 0.005392652510953826, 'mean_word_length': 2.3727272727272726, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 46, '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': '6649821', 'n_tokens_mistral': 927, 'n_tokens_neox': 889, 'n_words': 171}