<commit_before><?php defined('SYSPATH') or die('No direct access allowed.');
/**
 * Anqh Shouts controller
 *
 * @package    Anqh
 * @author     <NAME>
 * @copyright  (c) 2011 <NAME>
 * @license    http://www.opensource.org/licenses/mit-license.php MIT license
 */
class Anqh_Controller_Shouts extends Controller_Page {

	/**
	 * Action: index
	 */
	public function action_index() {

		// Build page
		$this->view = View_Page::factory(__('Shouts'));

		// Shouts
		$this->view->add(View_Page::COLUMN_SIDE, $this->section_shouts());

	}


	/**
	 * Action: shout
	 */
	public function action_shout() {
		$shout  = Model_Shout::factory();
		$errors = array();

		if (Permission::has($shout, Permission_Interface::PERMISSION_CREATE) && Security::csrf_valid()) {
			$shout->author_id = self::$user->id;
			$shout->shout     = $_POST['shout'];
			$shout->created   = time();
			try {
				$shout->save();
			} catch (Validation_Exception $e) {
				$errors = $e->array->errors('validate');
			}
		}

		if ($this->ajax) {
			echo new View_Index_Shouts();
			exit;
		}

		$this->request->redirect(Route::get('shouts')->uri());
	}


	/**
	 * Get shouts.
	 *
	 * @return  View_Shouts
	 */
	public function section_shouts() {
		$section = new View_Index_Shouts();
		$section->title = null;

		return $section;
	}
<commit_msg>Tiny cleanup<commit_after><?php defined('SYSPATH') or die('No direct access allowed.');
/**
 * Anqh Shouts controller
 *
 * @package    Anqh
 * @author     <NAME>
 * @copyright  (c) 2011-2013 <NAME>
 * @license    http://www.opensource.org/licenses/mit-license.php MIT license
 */
class Anqh_Controller_Shouts extends Controller_Page {

	/**
	 * Action: index
	 */
	public function action_index() {

		// Build page
		$this->view = View_Page::factory(__('Shouts'));

		// Shouts
		$this->view->add(View_Page::COLUMN_SIDE, $this->section_shouts());

	}


	/**
	 * Action: shout
	 */
	public function action_shout() {
		$shout = Model_Shout::factory();

		if (Permission::has($shout, Permission_Interface::PERMISSION_CREATE) && Security::csrf_valid()) {
			$shout->author_id = self::$user->id;
			$shout->shout     = $_POST['shout'];
			$shout->created   = time();
			try {
				$shout->save();
			} catch (Validation_Exception $e) {
			}
		}

		if ($this->ajax) {
			$this->response->body($this->section_shouts());

			return;
		}

		$this->request->redirect(Route::get('shouts')->uri());
	}


	/**
	 * Get shouts.
	 *
	 * @return  View_Index_Shouts
	 */
	public function section_shouts() {
		$section = new View_Index_Shouts();

		if (!$this->ajax) {
			$section->title = null;
		}

		return $section;
	}

{'fraction_non_alphanumeric': 0.1827217125382263, 'fraction_numerical': 0.0045871559633027525, 'mean_word_length': 3.4735042735042736, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6880731', 'n_tokens_mistral': 1026, 'n_tokens_neox': 906, 'n_words': 167}