<commit_before>var CONFIG               = require("./config"),
    nodemailer           = require("nodemailer"),
    API_URL              = "https://api.teksavvy.com/web/Usage/UsageRecords?$skip=40",
    urllib               = require('urllib'),
    onPeakDownloadTotal  = 0,
    onPeakUploadTotal    = 0,
    offPeakDownloadTotal = 0,
    offPeakUploadTotal   = 0;

function downloadData (url) {
	urllib.request(url, {
		headers: {
			"TekSavvy-APIKey": CONFIG.API_KEY
		}
	}, function (err, rawData, res) {
		if (err) {
			throw err; // you need to handle error 
		}

		var functionStop  = false;

		JSON.parse(rawData.toString()).value.reverse().forEach (function (currentDataElement, index, array) {
			var year          = currentDataElement.Date.split("T")[0].split("-")[0],
			    month         = currentDataElement.Date.split("T")[0].split("-")[1],
			    day           = currentDataElement.Date.split("T")[0].split("-")[2],
			    previousMonth = index >= 1 ? array[ index - 1 ].Date.split("T")[0].split("-")[1] : null;

			if (index > 1 && month != previousMonth) {
				functionStop = true;
			}

			if (!functionStop) {
				onPeakDownloadTotal  += currentDataElement.OnPeakDownload,
				onPeakUploadTotal    += currentDataElement.OnPeakUpload,
				offPeakDownloadTotal += currentDataElement.OffPeakDownload,
				offPeakUploadTotal   += currentDataElement.OffPeakUpload;
			}
		});

		dataOverage = onPeakDownloadTotal - CONFIG.DATA_CAP;

		// data is Buffer instance
		console.log ("Data provided in GB and OnPeak/OffPeak\n  " +
			         "D: " + onPeakDownloadTotal.toFixed(2) + "/" + offPeakDownloadTotal.toFixed(2) + "\n  " +
			         "U: " + onPeakUploadTotal.toFixed(2)   + "/" + offPeakUploadTotal.toFixed(2));

		if (onPeakDownloadTotal > CONFIG.DATA_CAP) {
			var message = "** Warning Data limit exceded by " + dataOverage.toFixed(2) + "GB",
		        transporter  = nodemailer.createTransport({
		    	service: CONFIG.EMAIL_PROVIDER,
		    	auth: {
		    		user: CONFIG.EMAIL_USER,
		    		pass: CONFIG.EMAIL_PASSWORD
		    	}
		    });

			var mailOptions = { 							// setup e-mail data with unicode symbols
				from: "TekSavvy Data Watch ✔ <<EMAIL>>",	// sender address
				to: "<EMAIL>",							// list of receivers
				subject: "ALERT you have exceeded your data usage",		// Subject line
				text: message, 							// plaintext body
				html: message 								// html body
			};

			// send mail with defined transport object
			transporter.sendMail(mailOptions, function(error, info){
				if (error){
					console.log(error);
				} else {
					if (verbose) console.log("Message sent: " + info.response);
				}
			});<commit_msg>fixed verbose undefined error<commit_after>var CONFIG               = require("./config"),
    nodemailer           = require("nodemailer"),
    API_URL              = "https://api.teksavvy.com/web/Usage/UsageRecords?$skip=40",
    urllib               = require('urllib'),
    onPeakDownloadTotal  = 0,
    onPeakUploadTotal    = 0,
    offPeakDownloadTotal = 0,
    offPeakUploadTotal   = 0;

function downloadData (url) {
	urllib.request(url, {
		headers: {
			"TekSavvy-APIKey": CONFIG.API_KEY
		}
	}, function (err, rawData, res) {
		if (err) {
			throw err; // you need to handle error 
		}

		var functionStop  = false;

		JSON.parse(rawData.toString()).value.reverse().forEach (function (currentDataElement, index, array) {
			var year          = currentDataElement.Date.split("T")[0].split("-")[0],
			    month         = currentDataElement.Date.split("T")[0].split("-")[1],
			    day           = currentDataElement.Date.split("T")[0].split("-")[2],
			    previousMonth = index >= 1 ? array[ index - 1 ].Date.split("T")[0].split("-")[1] : null;

			if (index > 1 && month != previousMonth) {
				functionStop = true;
			}

			if (!functionStop) {
				onPeakDownloadTotal  += currentDataElement.OnPeakDownload,
				onPeakUploadTotal    += currentDataElement.OnPeakUpload,
				offPeakDownloadTotal += currentDataElement.OffPeakDownload,
				offPeakUploadTotal   += currentDataElement.OffPeakUpload;
			}
		});

		dataOverage = onPeakDownloadTotal - CONFIG.DATA_CAP;

		// data is Buffer instance
		console.log ("Data provided in GB and OnPeak/OffPeak\n  " +
			         "D: " + onPeakDownloadTotal.toFixed(2) + "/" + offPeakDownloadTotal.toFixed(2) + "\n  " +
			         "U: " + onPeakUploadTotal.toFixed(2)   + "/" + offPeakUploadTotal.toFixed(2));

		if (onPeakDownloadTotal > CONFIG.DATA_CAP) {
			var message = "** Warning Data limit exceded by " + dataOverage.toFixed(2) + "GB",
		        transporter  = nodemailer.createTransport({
		    	service: CONFIG.EMAIL_PROVIDER,
		    	auth: {
		    		user: CONFIG.EMAIL_USER,
		    		pass: <PASSWORD>
		    	}
		    });

			var mailOptions = { 							// setup e-mail data with unicode symbols
				from: "TekSavvy Data Watch ✔ <<EMAIL>>",	// sender address
				to: "<EMAIL>",							// list of receivers
				subject: "ALERT you have exceeded your data usage",		// Subject line
				text: message, 							// plaintext body
				html: message 								// html body
			};

			// send mail with defined transport object
			transporter.sendMail(mailOptions, function(error, info){
				if (error){
					console.log(error);
				} else {
					console.log("Message sent: " + info.response);
				}
			});
{'fraction_non_alphanumeric': 0.13782051282051283, 'fraction_numerical': 0.008295625942684766, 'mean_word_length': 2.651066758430833, 'pattern_counts': {'":': 2, '<': 10, '<?xml version=': 0, '>': 16, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 22, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5250023', 'n_tokens_mistral': 2018, 'n_tokens_neox': 1712, 'n_words': 353}