<commit_before><?php

class RRD
{
	/**
	 * RRD database file
	 * @var string
	 */
	private $filename = null;

	/**
	 * Class constructor
	 * @param string $filename
	 */
	public function __construct($filename) {
		$this->filename = $filename;
	}

	/**
	 * Create RRD database
	 * @param array $fields
	 * @throws Exception
	 */
	public function create($fields)
	{
		if (!empty($this->filename) && is_array($fields) && !empty($fields)) {
			if (!file_exists($this->filename)) {
				$command = 'rrdtool create ' . $this->filename . ' --step 60 \\';

				foreach ($fields as $field) {
					$command .= 'DS:' . $field['name'] . ':GAUGE:120:' . $field['min'] . ':' . $field['max'] . ' \\';
				}

				$command .= '
					RRA:AVERAGE:0.5:1:1200 \
					RRA:MIN:0.5:12:2400 \
					RRA:MAX:0.5:12:2400 \
					RRA:AVERAGE:0.5:12:2400';

				`$command`;
			}
		} else {
			throw new Exception('Required fields are missing.');
		}
	}
<commit_msg>CBW graphing module<commit_after><?php

class RRD
{
	/**
	 * RRD database file
	 * @var string
	 */
	private $filename = null;

	/**
	 * Class constructor
	 * @param string $filename
	 */
	public function __construct($filename) {
		$this->filename = $filename;
	}

	/**
	 * Create RRD database
	 * @param array $fields
	 * @throws Exception
	 */
	public function create($fields)
	{
		if (!empty($this->filename) && is_array($fields) && !empty($fields)) {
			if (!file_exists($this->filename)) {
				$command = 'rrdtool create ' . $this->filename . ' --step 60 ';

				foreach ($fields as $field) {
					$command .= 'DS:' . $field['name'] . ':GAUGE:120:' . $field['min'] . ':' . $field['max'] . ' ';
				}

				$command .= 'RRA:AVERAGE:0.5:1:1200 RRA:MIN:0.5:12:2400 RRA:MAX:0.5:12:2400 RRA:AVERAGE:0.5:12:2400';

				`$command`;
			}
		} else {
			throw new Exception('Required fields are missing.');
		}
	}

{'fraction_non_alphanumeric': 0.19934818033677348, 'fraction_numerical': 0.03910917979359044, 'mean_word_length': 2.9191489361702128, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '5745372', 'n_tokens_mistral': 798, 'n_tokens_neox': 663, 'n_words': 136}