<commit_before><?php

$blog = new MicroBlog;
$blog->route();

class MicroBlog {
	public function route() {
		if ($_GET['cache'] == 'rebuild')
			$this->rebuildCache(true);
		elseif ($post = rtrim(preg_replace('/^\/blog\/|\?.*$/', '', $_SERVER['REQUEST_URI']), '/'))
			$this->showPost($post);
		elseif (isset($_GET['ajax']))
			$this->getPosts();
		else
			$this->listPosts();
	}

	public function listPosts($cat = false) {
		global $page, $import;
		$page = 'blog/posts-list';
		$import = [
			'posts' => $this->getPosts(false, $cat),
			'categories' => $this->getCategories()
		];
		require('index.php');
	}

	public function getPosts($output = true, $cat = false) {<commit_msg>added category to imports for posts list<commit_after><?php

$blog = new MicroBlog;
$blog->route();

class MicroBlog {
	public function route() {
		if ($_GET['cache'] == 'rebuild')
			$this->rebuildCache(true);
		elseif ($post = rtrim(preg_replace('/^\/blog\/|\?.*$/', '', $_SERVER['REQUEST_URI']), '/'))
			$this->showPost($post);
		elseif (isset($_GET['ajax']))
			$this->getPosts();
		else
			$this->listPosts();
	}

	public function listPosts($cat = false) {
		global $page, $import;
		$page = 'blog/posts-list';
		$import = [
			'cat' => $cat,
			'posts' => $this->getPosts(false, $cat),
			'categories' => $this->getCategories()
		];
		require('index.php');
	}

	public function getPosts($output = true, $cat = false) {
{'fraction_non_alphanumeric': 0.2277580071174377, 'fraction_numerical': 0.0, 'mean_word_length': 4.1881918819188195, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 22, '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': '6353820', 'n_tokens_mistral': 554, 'n_tokens_neox': 495, 'n_words': 100}