<commit_before><?php

namespace Matze\Core\Twig;

/**
 * @TwigExtension
 */
class UtilExtension extends \Twig_Extension {

	public function getFunctions() {
		return [
			'print_r' => new \Twig_Function_Method($this, 'print_r', ['is_safe' => ['all']])
		];
	}

	/**
	 * @param mixed $variable
	 * @return string mixed
	 */
	public function print_r($variable) {
		return print_r($variable, true);
	}

	/**
	 * {@inheritdoc}
	 */
	public function getName() {
		return 'util';
	}
}<commit_msg>added twig filter "sum" alias array_sum<commit_after><?php

namespace Matze\Core\Twig;

use Twig_SimpleFilter;

/**
 * @TwigExtension
 */
class UtilExtension extends \Twig_Extension {

	/**
	 * {@inheritdoc}
	 */
	public function getFunctions() {
		return [
			'print_r' => new \Twig_Function_Method($this, 'print_r', ['is_safe' => ['all']])
		];
	}

	/**
	 * {@inheritdoc}
	 */
	public function getFilters() {
		return [
			new Twig_SimpleFilter('sum', 'array_sum'),
		];
	}
	/**
	 * @param mixed $variable
	 * @return string mixed
	 */
	public function print_r($variable) {
		return print_r($variable, true);
	}

	/**
	 * {@inheritdoc}
	 */
	public function getName() {
		return 'util';
	}
}
{'fraction_non_alphanumeric': 0.17075232459847844, 'fraction_numerical': 0.0, 'mean_word_length': 3.6070038910505837, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '4008887', 'n_tokens_mistral': 446, 'n_tokens_neox': 411, 'n_words': 88}