<commit_before><!DOCTYPE HTML/>

<html>
	<head>
		<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
		<script src="js/jquery.cookie.js"></script>
		<script src="js/json_request.js"></script>

		<script src="js/jquery.jsonview.js"></script>

		<link rel='stylesheet' href="css/jquery.jsonview.css"></link>

		<script>
			function getCookie(name)
			{
				var cookieValue = null;
				if (document.cookie && document.cookie != '') {
					var cookies = document.cookie.split(';');
					for (var i = 0; i < cookies.length; i++) {
						var cookie = jQuery.trim(cookies[i]);
						// Does this cookie string begin with the name we want?

						if (cookie.substring(0, name.length + 1) == (name + '=')) {
							cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
							break;
						}
					}
				}
				return cookieValue;
			}

			function setCookie(name,value,expires,path,domain,secure) {
				var cookieString = name + "=" +escape(value) +
				( (expires) ? ";expires=" + expires.toGMTString() : "") +
				( (path) ? ";path=" + path : "") +
				( (domain) ? ";domain=" + domain : "") +
				( (secure) ? ";secure" : "");
				document.cookie = cookieString;
			}

			JsonRequest.send('vendor/', 'GET', null, function(data){

				$.ajaxSetup({ 
					beforeSend: function(xhr, settings) {
						if (!(/^http:.*/.test(settings.url) || /^https:.*/.test(settings.url))) {
							// Only send the token to relative URLs i.e. locally.
							xhr.setRequestHeader("X-CSRFToken", $.cookie('csrftoken'));
						}
					} 
				});
			})
			function login(){
				JsonRequest.send("auth/Login/", "POST",{username: "admin", password: "<PASSWORD>"},function (data){
					console.log(data);
					$('#result').val(JSON.stringify(data));
				});
			}

			function logout(){
				JsonRequest.send("auth/Logout/", "GET", null, function(data){
					console.log(data);
					$('#result').val(JSON.stringify(data));
				});
			}

		function getItem(){

			JsonRequest.send('repo/item/', 'GET', null, function(data){
				console.log(data);
				$('#result').val(JSON.stringify(data));
			});
		}

		function getMedCondition(){

			JsonRequest.send('repo/medical_condition/', 'GET', null, function(data){
				console.log(data);
				$('#result').val(JSON.stringify(data));
			});
		}

		function sendRequest(){
			url = $("#url").val()
			method = $("#method").val()
			data = JSON.parse($("#data").val())

			JsonRequest.send(url, method, data, function(result){
				console.log(result);
				$("#result").val(JSON.stringify(result));
				$("#json").JSONView(JSON.stringify(result), {collapsed: true});
			});
		}
	</script>
</head>

<body>
	<button onclick="login()" >Login</button>
	<button onclick="logout()" >Logout</button>
	<button onclick="getItem()">Get Items</button>
	<button onclick="getMedCondition()">Get Medical Condition</button>
	<br/>
	<label for='url'> http://23.92.220.46/ </label>
	<input type="text" id='url'></input>
	<select id='method'>
		<option value='GET'>GET</option>
		<option value='POST'>POST</option>
		<option value='PUT'>PUT</option>
		<option value='DELETE'>DELETE</option>
		<option value='OPTIONS'>OPTIONS</option>
	</select>
	<br/>
	<label for='data'> Data </label>
	<textarea id='data'  style="width:100%; height:100px;"></textarea> 
	<br/>
	<button onclick="sendRequest()">Send</button>
	<br/>
	<hr/>
	<label for='result'> Result </label>
	<textarea id='result' type='textarea' style="width:100%; height:300px;"></textarea>
	<hr/>
	<div id='json'></div>
</body>
</html>
<commit_msg>removing get/set cookie function<commit_after><!DOCTYPE HTML/>

<html>
	<head>
		<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
		<script src="js/jquery.cookie.js"></script>
		<script src="js/json_request.js"></script>

		<script src="js/jquery.jsonview.js"></script>

		<link rel='stylesheet' href="css/jquery.jsonview.css"></link>

		<script>

			JsonRequest.send('vendor/', 'GET', null, function(data){

				$.ajaxSetup({ 
					beforeSend: function(xhr, settings) {
						if (!(/^http:.*/.test(settings.url) || /^https:.*/.test(settings.url))) {
							// Only send the token to relative URLs i.e. locally.
							xhr.setRequestHeader("X-CSRFToken", $.cookie('csrftoken'));
						}
					} 
				});
			})
			function login(){
				JsonRequest.send("auth/Login/", "POST",{username: "admin", password: "<PASSWORD>"},function (data){
					console.log(data);
					$('#result').val(JSON.stringify(data));
				});
			}

			function logout(){
				JsonRequest.send("auth/Logout/", "GET", null, function(data){
					console.log(data);
					$('#result').val(JSON.stringify(data));
				});
			}

		function getItem(){

			JsonRequest.send('repo/item/', 'GET', null, function(data){
				console.log(data);
				$('#result').val(JSON.stringify(data));
			});
		}

		function getMedCondition(){

			JsonRequest.send('repo/medical_condition/', 'GET', null, function(data){
				console.log(data);
				$('#result').val(JSON.stringify(data));
			});
		}

		function sendRequest(){
			url = $("#url").val()
			method = $("#method").val()
			data = JSON.parse($("#data").val())

			JsonRequest.send(url, method, data, function(result){
				console.log(result);
				$("#result").val(JSON.stringify(result));
				$("#json").JSONView(JSON.stringify(result), {collapsed: true});
			});
		}
	</script>
</head>

<body>
	<button onclick="login()" >Login</button>
	<button onclick="logout()" >Logout</button>
	<button onclick="getItem()">Get Items</button>
	<button onclick="getMedCondition()">Get Medical Condition</button>
	<br/>
	<label for='url'> http://23.92.220.46/ </label>
	<input type="text" id='url'></input>
	<select id='method'>
		<option value='GET'>GET</option>
		<option value='POST'>POST</option>
		<option value='PUT'>PUT</option>
		<option value='DELETE'>DELETE</option>
		<option value='OPTIONS'>OPTIONS</option>
	</select>
	<br/>
	<label for='data'> Data </label>
	<textarea id='data'  style="width:100%; height:100px;"></textarea> 
	<br/>
	<button onclick="sendRequest()">Send</button>
	<br/>
	<hr/>
	<label for='result'> Result </label>
	<textarea id='result' type='textarea' style="width:100%; height:300px;"></textarea>
	<hr/>
	<div id='json'></div>
</body>
</html>

{'fraction_non_alphanumeric': 0.22315382134795228, 'fraction_numerical': 0.00838439213157046, 'mean_word_length': 3.8536776212832553, 'pattern_counts': {'":': 0, '<': 128, '<?xml version=': 0, '>': 127, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '4568772', 'n_tokens_mistral': 2507, 'n_tokens_neox': 2086, 'n_words': 372}