<commit_before><?php

defined('BASEPATH') OR exit('No direct script access allowed');


/**
* Sa
* 
* @package      Smart Appliances
* @author       <NAME> <<EMAIL>>
*/
class Sa extends CI_Controller
{
	protected $data = array();
	protected $client;
	protected $averages;

	/**
	* Classes constructor
	*
	* @return null
	*/
	public function __construct()
	{
		parent::__construct();
		
		$this->output->enable_profiler(FALSE);
		$this->benchmark->mark("starting_point");

		// To stop PHP from moaning as we're manipulating and displaying times from unix time
		date_default_timezone_set("UTC");
	}

	/**
	* Dash - Displays the dash page
	*
	* @param integer $device The device to be displayed
	* @return null
	*/
	public function dash($device = NULL)
	{
		if($device)
		{
			$_GET["device"] = $device;
		}

		$this->load->model("average");
		$averages = $this->average->calculate();

		$this->client = $this->user->newUser();

		// Require login
		// If logged in display the requested page
		if($this->session->logged_in)
		{
			$this->load->view("header");
			$this->load->view("pages/dash", array("user" => $this->client, "averages" => $averages));
			$this->load->view("footer");
		}
		else
		{
			redirect("/login");
		}
	}
	
	/**
	* API - Displays the API page
	*
	* @return null
	*/
	public function api()
	{
		$this->load->model("average");
		$averages = $this->average->calculate();
	
		$this->load->view("pages/api", array("averages" => $averages));
	}

	/**
	* Email - Send an email to Group 11
	*
	* @return null
	*/
	public function email()
	{
		// Load the email library
		$this->load->library("email");

		// Set the email headers
		$this->email->from("<EMAIL>", $this->input->post("from_name"));
		$this->email->to("<EMAIL>");
		$this->email->subject($this->input->post("subject"));
		$this->email->message($this->input->post("message"));

		// Send the email
		$this->email->send();

		redirect("/");
	}
}<commit_msg>Don't need to work averages out from dash<commit_after><?php

defined('BASEPATH') OR exit('No direct script access allowed');


/**
* Sa
* 
* @package      Smart Appliances
* @author       <NAME> <<EMAIL>>
*/
class Sa extends CI_Controller
{
	protected $data = array();
	protected $client;
	protected $averages;
	
	/**
	* Classes constructor
	*
	* @return null
	*/
	public function __construct()
	{
		parent::__construct();
		
		$this->output->enable_profiler(FALSE);
		$this->benchmark->mark("starting_point");
		
		// To stop PHP from moaning as we're manipulating and displaying times from unix time
		date_default_timezone_set("UTC");
	}
	
	/**
	* Dash - Displays the dash page
	*
	* @param integer $device The device to be displayed
	* @return null
	*/
	public function dash($device = NULL)
	{
		if($device)
		{
			$_GET["device"] = $device;
		}
		
		$this->client = $this->user->newUser();
		
		// Require login
		// If logged in display the requested page
		if($this->session->logged_in)
		{
			$this->load->view("header");
			$this->load->view("pages/dash", array("user" => $this->client, "averages" => $averages));
			$this->load->view("footer");
		}
		else
		{
			redirect("/login");
		}
	}
	
	/**
	* API - Displays the API page
	*
	* @return null
	*/
	public function api()
	{
		$this->load->model("average");
		$averages = $this->average->calculate();
	
		$this->load->view("pages/api", array("averages" => $averages));
	}
	
	/**
	* Email - Send an email to Group 11
	*
	* @return null
	*/
	public function email()
	{
		// Load the email library
		$this->load->library("email");
		
		// Set the email headers
		$this->email->from("<EMAIL>", $this->input->post("from_name"));
		$this->email->to("<EMAIL>");
		$this->email->subject($this->input->post("subject"));
		$this->email->message($this->input->post("message"));
		
		// Send the email
		$this->email->send();
		
		redirect("/");
	}
}
{'fraction_non_alphanumeric': 0.19473409801876956, 'fraction_numerical': 0.0010427528675703858, 'mean_word_length': 3.472027972027972, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 103, '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': '3204499', 'n_tokens_mistral': 1444, 'n_tokens_neox': 1282, 'n_words': 292}