<commit_before>google.load('visualization', '1.1', {
	'packages' : [ 'annotationchart' ]
});

$(function() {
	google.setOnLoadCallback(drawChart);
	


	var activeTab = '#marketStats';

	$('#chartsTab a').click(function(e) {
		e.preventDefault();
		$(this).tab('show');
		activeTab = $(this).attr('href');

		if ($(this).attr('href') == '#marketStats') {
			drawMsChart();
		}

		if ($(this).attr('href') == '#rewards') {
			drawRewardsChart();
		}

		if ($(this).attr('href') == '#hits') {
			drawHitsChart();
		}

		if ($(this).attr('href') == '#groups') {
			drawGroupsChart();
		}
	});

	$.datepicker.setDefaults($.extend({
		dateFormat : 'mm/dd/yy',
		showMonthAfterYear : false
	}));

	// datepickers
	$('#date_from').datepicker();
	$('#date_to').datepicker();

	var pastDate = new Date();
	pastDate.setDate(pastDate.getDate() - 7);

	var maxDate = new Date();
	maxDate.setDate(maxDate.getDate() + 1);

	$('#date_from').datepicker('setDate', pastDate);
	$('#date_to').datepicker('setDate', new Date());
	$('#date_from').datepicker('option', 'maxDate', maxDate);
	$('#date_to').datepicker('option', 'maxDate', maxDate);
	
	

	$('#date_from').on('change', function() {
		drawChart();
	});

	$('#date_to').on('change', function() {
		drawChart();
	});

	// charts
	var options = {
		displayAnnotations : true,
		scaleType : 'allmaximized',
		scaleColumns : [ 0, 1 ]
	};

	var msChart;// marketStatistics chart
	var msChartData = new google.visualization.DataTable();
	msChartData.addColumn('date', 'Date');
	msChartData.addColumn('number', 'HITs available');
	msChartData.addColumn('number', 'HIT groups available');

	var groupsChart;
	var groupsChartData = new google.visualization.DataTable();
	groupsChartData.addColumn('date', 'Date');
	groupsChartData.addColumn('number', 'HIT groups posted');

	var hitsChart;
	var hitsChartData = new google.visualization.DataTable();
	hitsChartData.addColumn('date', 'Date');
	hitsChartData.addColumn('number', 'HITs posted');

	var rewardsChart;
	var rewardsChartData = new google.visualization.DataTable();
	rewardsChartData.addColumn('date', 'Date');
	rewardsChartData.addColumn('number', 'Rewards posted');
	
	var host = window.location.host;
	var protocol = host.indexOf('localhost', 0) == 0 ? 'http' : 'https';
	fillArrivalData(host, protocol);
	fillStatisticsData(host, protocol, null);

	
	function fillArrivalData(host, protocol) {
		var url = protocol + '://' + host<commit_msg>Changing variable type to datetime<commit_after>google.load('visualization', '1.1', {
	'packages' : [ 'annotationchart' ]
});

$(function() {
	google.setOnLoadCallback(drawChart);
	


	var activeTab = '#marketStats';

	$('#chartsTab a').click(function(e) {
		e.preventDefault();
		$(this).tab('show');
		activeTab = $(this).attr('href');

		if ($(this).attr('href') == '#marketStats') {
			drawMsChart();
		}

		if ($(this).attr('href') == '#rewards') {
			drawRewardsChart();
		}

		if ($(this).attr('href') == '#hits') {
			drawHitsChart();
		}

		if ($(this).attr('href') == '#groups') {
			drawGroupsChart();
		}
	});

	$.datepicker.setDefaults($.extend({
		dateFormat : 'mm/dd/yy',
		showMonthAfterYear : false
	}));

	// datepickers
	$('#date_from').datepicker();
	$('#date_to').datepicker();

	var pastDate = new Date();
	pastDate.setDate(pastDate.getDate() - 7);

	var maxDate = new Date();
	maxDate.setDate(maxDate.getDate() + 1);

	$('#date_from').datepicker('setDate', pastDate);
	$('#date_to').datepicker('setDate', new Date());
	$('#date_from').datepicker('option', 'maxDate', maxDate);
	$('#date_to').datepicker('option', 'maxDate', maxDate);
	
	

	$('#date_from').on('change', function() {
		drawChart();
	});

	$('#date_to').on('change', function() {
		drawChart();
	});

	// charts
	var options = {
		displayAnnotations : true,
		scaleType : 'allmaximized',
		scaleColumns : [ 0, 1 ]
	};

	var msChart;// marketStatistics chart
	var msChartData = new google.visualization.DataTable();
	msChartData.addColumn('datetime', 'Date');
	msChartData.addColumn('number', 'HITs available');
	msChartData.addColumn('number', 'HIT groups available');

	var groupsChart;
	var groupsChartData = new google.visualization.DataTable();
	groupsChartData.addColumn('datetime', 'Date');
	groupsChartData.addColumn('number', 'HIT groups posted');

	var hitsChart;
	var hitsChartData = new google.visualization.DataTable();
	hitsChartData.addColumn('datetime', 'Date');
	hitsChartData.addColumn('number', 'HITs posted');

	var rewardsChart;
	var rewardsChartData = new google.visualization.DataTable();
	rewardsChartData.addColumn('datetime', 'Date');
	rewardsChartData.addColumn('number', 'Rewards posted');
	
	var host = window.location.host;
	var protocol = host.indexOf('localhost', 0) == 0 ? 'http' : 'https';
	fillArrivalData(host, protocol);
	fillStatisticsData(host, protocol, null);

	
	function fillArrivalData(host, protocol) {
		var url = protocol + '://' + host
{'fraction_non_alphanumeric': 0.19873495205060193, 'fraction_numerical': 0.0032646398694144052, 'mean_word_length': 5.212927756653992, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2202211', 'n_tokens_mistral': 1758, 'n_tokens_neox': 1611, 'n_words': 305}