<commit_before><?php
	class cache {
		function __construct($app) {
			$this->app = $app;
		}

		function get($file, $freshness=null) {
			$file = $this->app->config['cache'] . $file;
			$data = false;
			if (file_exists($file) && (!$freshness || filemtime($file) > (time() - 60 * $freshness ))) {
				$fh = @fopen($file, "rb");
				if (!$fh)
					return false;
				$data = fread($fh, filesize($file));
				fclose($fh);
			}

			return $data;
		}

		function set($file, $content) {
			$file = preg_replace("/[^A-Za-z0-9_-]/", '', $file);
			
			if (($fp = fopen($this->app->config['cache'] . $file, 'w')) !== false) {
				fwrite($fp, $content);
				fclose($fp);
			}
		}
	}
?><commit_msg>Subdued errors<commit_after><?php
	class cache {
		function __construct($app) {
			$this->app = $app;
		}

		function get($file, $freshness=null) {
			$file = $this->app->config['cache'] . $file;
			$data = false;
			if (file_exists($file) && (!$freshness || filemtime($file) > (time() - 60 * $freshness ))) {
				$fh = @fopen($file, "rb");
				if (!$fh)
					return false;
				$data = fread($fh, filesize($file));
				fclose($fh);
			}

			return $data;
		}

		function set($file, $content) {
			$file = preg_replace("/[^A-Za-z0-9_-]/", '', $file);
			
			if (($fp = @fopen($this->app->config['cache'] . $file, 'w')) !== false) {
				fwrite($fp, $content);
				fclose($fp);
			}
		}
	}
?>
{'fraction_non_alphanumeric': 0.24345930232558138, 'fraction_numerical': 0.005813953488372093, 'mean_word_length': 3.026315789473684, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '2186252', 'n_tokens_mistral': 655, 'n_tokens_neox': 534, 'n_words': 101}