<commit_before><?php
    /**
     * Class: Trigger
     * Controls and keeps track of all of the Triggers and events.
     */
    class Trigger {
        # Array: $priorities
        # Custom prioritized callbacks.
        public $priorities = array();

        # Array: $called
        # Keeps track of called Triggers.
        private $called = array();

        # Array: $exists
        # Caches trigger exist states.
        private $exists = array();

        /**
         * Function: __construct
         * Add predefined filters to implement Unicode emoji and Markdown support.
         */
        private function __construct() {
            $config = Config::current();

            if ($config->enable_emoji)
                $this->priorities["markup_text"][] = array("priority" => 10, "function" => "emote");   

            if ($config->enable_markdown)
                $this->priorities["markup_text"][] = array("priority" => 5, "function" => "markdown"); 
        }

        /**
         * Function: cmp
         * Sorts actions by priority when used with usort.
         */
        private function cmp($a, $b) {
            if (empty($a) or empty($b))
                return 0;

            return ($a["priority"] < $b["priority"]) ? -1 : 1 ;
        }

        /**
         * Function: call
         * Calls a trigger, passing any additional arguments to it.
         *
         * Parameters:
         *     $name - The name of the trigger, or an array of triggers to call.
         */
        public function call($name) {
            if (is_array($name)) {
                $return = null;

                foreach ($name as $index => $call) {
                    $args = func_get_args();
                    $args[0] = $call;
                    if ($index + 1 == count($name))
                        return $this->exists($call) ? call_user_func_array(array($this, "call"), $args) : $return ;
                    else
                        $return = $this->exists($call) ? call_user_func_array(array($this, "call"), $args) : $return ;
                }
            }

            if (!$this->exists($name))
                return false;<commit_msg>Trigger: code cleaning<commit_after><?php
    /**
     * Class: Trigger
     * Controls and keeps track of all of the Triggers and events.
     */
    class Trigger {
        # Array: $priorities
        # Custom prioritized callbacks.
        public $priorities = array();

        # Array: $called
        # Keeps track of called Triggers.
        private $called = array();

        # Array: $exists
        # Caches trigger exist states.
        private $exists = array();

        /**
         * Function: __construct
         * Add predefined filters to implement Unicode emoji and Markdown support.
         */
        private function __construct() {
            $config = Config::current();

            if ($config->enable_emoji)
                $this->priorities["markup_text"][] = array("priority" => 10, "function" => "emote");   

            if ($config->enable_markdown)
                $this->priorities["markup_text"][] = array("priority" => 5, "function" => "markdown"); 
        }

        /**
         * Function: cmp
         * Sorts actions by priority when used with usort.
         */
        private function cmp($a, $b) {
            if (empty($a) or empty($b))
                return 0;

            return ($a["priority"] < $b["priority"]) ? -1 : 1 ;
        }

        /**
         * Function: call
         * Calls a trigger, passing any additional arguments to it.
         *
         * Parameters:
         *     $name - The name of the trigger, or an array of triggers to call.
         */
        public function call($name) {
            if (is_array($name)) {
                $return = null;

                foreach ($name as $index => $call) {
                    $args = func_get_args();
                    $args[0] = $call;

                    if ($index + 1 == count($name))
                        return $this->exists($call) ? call_user_func_array(array($this, "call"), $args) : $return ;
                    else
                        $return = $this->exists($call) ? call_user_func_array(array($this, "call"), $args) : $return ;
                }
            }

            if (!$this->exists($name))
                return false;
{'fraction_non_alphanumeric': 0.12804597701149426, 'fraction_numerical': 0.0036781609195402297, 'mean_word_length': 1.497703788748565, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 27, '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': '2070032', 'n_tokens_mistral': 1193, 'n_tokens_neox': 1118, 'n_words': 323}