<commit_before><?php
class Filter extends Form {
	private $limiters=array();
	function init(){
		parent::init();
		$this->api->addHook('post-init',array($this,'recallAll'));
	}
	function recallAll(){
		foreach(array_keys($this->elements) as $x){
			$o=$this->set($x, $this->recall($x));
		}
	}
	function memorizeAll(){
		//by Camper: memorize() method doesn't memorize anything if value is null
		foreach(array_keys($this->elements) as $x){
			if($this->isClicked('Clear')||is_null($this->get($x)))$this->forget($x);
			else $this->memorize($x,$this->get($x));
		}
	}
	function submitted(){
		if(parent::submitted()){
			if($this->isClicked('Clear')){
				$this->clearData();
			}
			$this->memorizeAll();
			return true;
		}
	}
	function useDQ($dq){
		$this->limiters[]=$dq;
		$this->api->addHook('post-submit',array($this,'applyHook'));
	}
	function applyHook(){
		foreach($this->limiters as $key=>$dq){<commit_msg>do not use ajax for filter by defalut. It's designed to refresh a page.<commit_after><?php
class Filter extends Form {
	private $limiters=array();
	function init(){
		parent::init();
		$this->js_widget=null;
		$this->api->addHook('post-init',array($this,'recallAll'));
	}
	function recallAll(){
		foreach(array_keys($this->elements) as $x){
			$o=$this->set($x, $this->recall($x));
		}
	}
	function memorizeAll(){
		//by Camper: memorize() method doesn't memorize anything if value is null
		foreach(array_keys($this->elements) as $x){
			if($this->isClicked('Clear')||is_null($this->get($x)))$this->forget($x);
			else $this->memorize($x,$this->get($x));
		}
	}
	function submitted(){
		if(parent::submitted()){
			if($this->isClicked('Clear')){
				$this->clearData();
			}
			$this->memorizeAll();
			return true;
		}
	}
	function useDQ($dq){
		$this->limiters[]=$dq;
		$this->api->addHook('post-submit',array($this,'applyHook'));
	}
	function applyHook(){
		foreach($this->limiters as $key=>$dq){
{'fraction_non_alphanumeric': 0.22117892540427753, 'fraction_numerical': 0.0, 'mean_word_length': 5.147435897435898, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 42, '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': '1623562', 'n_tokens_mistral': 758, 'n_tokens_neox': 688, 'n_words': 121}