<commit_before><?php
namespace Databox;

/**
 *
 * @author <NAME>
 *        
 */
class KPI
{
    /**
     * Name of key
     * @var string
     */
    public $key;

    /**
     * Set value
     * @var string
     */
    public $value;

    /**
     * Set date
     * @var DateTime
     */
    public $date;

    /**
     * The prescribed date format
     */
    const DATE_FORMAT = 'Y-m-d\TH:i:s';

    public function __construct($key, $value, $date = null)
    {
        $this->key = $key;
        $this->value = $value;
        if (is_null($date) || ! ($date instanceof \DateTime)) {
            $UTC = new \DateTimeZone("UTC");
            $date = new \DateTime("now", $UTC);
        }
        $this->date = $date->format(self::DATE_FORMAT);
    }

    /**
     * Gets the key
     * @return string The key.
     */
    public function getKey()
    {
        return $key;
    }

    /**
     * Sets the key
     * @param string $key The key to be set
     */
    public function setKey($key)    
    {
        $this->key = $key;
    }

    /**
     * Gets the value
     * @return string The value.
     */
    public function getValue()
    {
        return $this->value;
    }

    public function setValue($value)
    {
        $this->value = $value;
    }

    public function getDate()
    {
        return $this->date;
    }

    public function setDate($date)
    {
        $this->date = $date;
    }
}

?><commit_msg>KPI updated with metric operation<commit_after><?php
namespace Databox;

/**
 *
 * @author <NAME>
 *
 */
class KPI
{

    /**
     * Name of key
     * @var string
     */
    public $key;

    /**
     * Set value
     * @var string
     */
    public $value;

    /**
     * Set date
     * @var DateTime
     */
    public $date;

    /**
     *
     * @var string
     */
    public $operation;

    /**
     * The prescribed date format
     */
    const DATE_FORMAT = 'Y-m-d\TH:i:s';

    public function __construct($key, $value, $date = null, $metricOperation = null)
    {
        $this->key = $key;
        $this->value = $value;
        if (is_null($date) || ! ($date instanceof \DateTime)) {
            $UTC = new \DateTimeZone("UTC");
            $date = new \DateTime("now", $UTC);
        }
        $this->date = $date->format(self::DATE_FORMAT);
        if (! is_null($metricOperation)) {
            if (in_array($metricOperation, [
                'None',
                'Sum'
            ])) {
                $this->operation = $metricOperation;
            }
        }
    }

    /**
     * Gets the key
     * @return string The key.
     */
    public function getKey()
    {
        return $key;
    }

    /**
     * Sets the key
     * @param string $key The key to be set
     */
    public function setKey($key)
    {
        $this->key = $key;
    }

    /**
     * Gets the value
     * @return string The value.
     */
    public function getValue()
    {
        return $this->value;
    }

    public function setValue($value)
    {
        $this->value = $value;
    }

    public function getDate()
    {
        return $this->date;
    }

    public function setDate($date)
    {
        $this->date = $date;
    }

    public function getMetricOperation()
    {
        return $this->operation;
    }

    public function setMetricOperation(string $operation)
    {
        $this->operation = $operation;
    }

}

?>
{'fraction_non_alphanumeric': 0.14437555358724535, 'fraction_numerical': 0.0, 'mean_word_length': 1.493009565857248, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 28, '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': '5961420', 'n_tokens_mistral': 1087, 'n_tokens_neox': 1056, 'n_words': 253}