<commit_before><?php

require_once 'smarty/Smarty.class.php';

/**
 * Smarty template example
 *
 * Using Smarty for representation generation
 *
 * @namespace Tonic\Examples\Filesystem
 * @uri /smarty
 */
class SmartyResource extends Resource {
    
    protected $smarty;
    
    function __construct() {
        
        $this->smarty = new Smarty();
        $this->smarty->template_dir = '../examples/smarty/representations';
        $this->smarty->compile_dir = sys_get_temp_dir();
        
    }
    
    function get($request) {
        
        $response = new Response($request);
        
        $this->smarty->assign('title', 'Smarty template');
        $body = $this->render('default');
        
        $etag = md5($body);
        if ($request->ifNoneMatch($etag)) {
            <commit_msg>Don't blow up if Smarty does not exist<commit_after><?php

@include_once 'smarty/Smarty.class.php';

/**
 * Smarty template example
 *
 * Using Smarty for representation generation
 *
 * @namespace Tonic\Examples\Filesystem
 * @uri /smarty
 */
class SmartyResource extends Resource {
    
    protected $smarty;
    
    function __construct() {
        
        $this->smarty = new Smarty();
        $this->smarty->template_dir = '../examples/smarty/representations';
        $this->smarty->compile_dir = sys_get_temp_dir();
        
    }
    
    function get($request) {
        
        $response = new Response($request);
        
        $this->smarty->assign('title', 'Smarty template');
        $body = $this->render('default');
        
        $etag = md5($body);
        if ($request->ifNoneMatch($etag)) {
            
{'fraction_non_alphanumeric': 0.13814180929095354, 'fraction_numerical': 0.0012224938875305623, 'mean_word_length': 2.274, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '7217745', 'n_tokens_mistral': 490, 'n_tokens_neox': 480, 'n_words': 95}