<commit_before>$('nav a').live('click', function() {
	$('nav a.active').removeClass('active');
	$(this).addClass('active');
	$('section').hide();
	$('#' + this.hash.substr(1)).show();
	return false;
});
$('#signin button').live('click', function() {
	$('#signin button, #signin input').attr('disabled', true);

	$.getJSON('/api/signin?callback=?', {email: $('#signin-email').val(), password: $('#signin-password').val()}, function(response) {
		if (response.success) {
			localStorage.setItem('session_email', $('#signin-email').val());
			localStorage.setItem('session_id', response.response);

			$('#email').text($('#signin-email').val());
			$('#signout').show();
			$('#anonymous, #signin').hide();
			$('#signedin').show();
		} else {
			$('#signin .error').text(response.error);
		}

		$('#signin button, #signin input').attr('disabled', false);
	});

	return false;
});
$('#register button').live('click', function() {
	if ($('#register-email').val() == $('#register-confirm').val()) {
		$('#register button, #register input').attr('disabled', true);

		$.getJSON('/api/requestpassword?callback=?', {email: $('#register-email').val()}, function(response) {
			if (response.success) {
				$('#register .error').text('');
				$('#register .success').show();
				$('#register input').val('');
			} else {
				$('#register .success').hide();
				$('#register .error').text(response.error);
			}

			$('#register button, #register input').attr('disabled', false);
		});
	} else {
		$('#register .error').text('The two email addresses you entered do not match. Please try again.')
	}

	return false;
});<commit_msg>Added check for existing email addresses.<commit_after>$('nav a').live('click', function() {
	$('nav a.active').removeClass('active');
	$(this).addClass('active');
	$('section').hide();
	$('#' + this.hash.substr(1)).show();
	return false;
});

$('#signin button').live('click', function() {
	$('#signin button, #signin input').attr('disabled', true);

	$.getJSON('/api/signin?callback=?', {email: $('#signin-email').val(), password: $('#signin-password').val()}, function(response) {
		if (response.success) {
			localStorage.setItem('session_email', $('#signin-email').val());
			localStorage.setItem('session_id', response.response);

			$('#email').text($('#signin-email').val());
			$('#signout').show();
			$('#anonymous, #signin').hide();
			$('#signedin').show();
		} else {
			$('#signin .error').text(response.error);
		}

		$('#signin button, #signin input').attr('disabled', false);
	});

	return false;
});

$('#register button').live('click', function() {
	if ($('#register-email').val() == $('#register-confirm').val()) {
		$('#register button, #register input').attr('disabled', true);

		$.getJSON('/api/registered?callback=?', {email: $('#register-email').val()}, function(response) {
			if (!response.response) {
				$.getJSON('/api/requestpassword?callback=?', {email: $('#register-email').val()}, function(response) {
					if (response.success) {
						$('#register .error').text('');
						$('#register .success').show();
						$('#register input').val('');
					} else {
						$('#register .success').hide();
						$('#register .error').text(response.error);
					}
				});
			} else {
				$('#register .success').hide();
				$('#register .error').text('This email address has already been registered.');
			}

			$('#register button, #register input').attr('disabled', false);
		});
	} else {
		$('#register .error').text('The two email addresses you entered do not match. Please try again.')
	}

	return false;
});
{'fraction_non_alphanumeric': 0.2652601969057665, 'fraction_numerical': 0.0005625879043600563, 'mean_word_length': 4.7540453074433655, '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': '2313130', 'n_tokens_mistral': 1197, 'n_tokens_neox': 1096, 'n_words': 210}