<commit_before><script language="javascript">

	// function to obtain the HTML id for the files container
	function getFilesDiv(dataset_id) {
		id = "files_"+dataset_id;
		return document.getElementById(id);
	}
	
	// function to retrieve the files belonging to a given dataset
	function showFiles(dataset_id, index_node, project) {
		
		fdiv = getFilesDiv(dataset_id);
			
		// only execute invocation for this dataset if not done laready
		if (fdiv.innerHTML.length==0) {
				
			// relative path to COG application
			// note: cannot execute HTTP requests to other hosts because of javascript security restrictions
			var url = "/search_files/"+dataset_id+"/"+index_node+"/";
		
			// pass in project short name as extra argument to callback functions
			callback.argument[0] = project
			
			// execute asynchronous GET request
			var transaction = YAHOO.util.Connect.asyncRequest('GET', url, callback, null);
		}
		
	}
	
	// function called if Ajax request succeded to create the files display widget
	var handleSuccess = function(o) {
		
		// retrieve project short name from callback extra argument
		project = o.argument[0]
		
		// parse JSON response into object		
		var jsonResponse = eval('(' + o.responseText + ')');
		var numFound = jsonResponse.response.numFound;
		var docs = jsonResponse.response.docs;
		var dataset_id = null;
		for (var k=0; k<jsonResponse.responseHeader.params.fq.length; k++) {
			var fqArray = jsonResponse.responseHeader.params.fq[k].split(":");
			if (fqArray[0]=='dataset_id') {
				dataset_id = fqArray[1].replace(/\"/g,'');
			}	
		}
		
		// populate files container
		var fdiv = getFilesDiv(dataset_id);
		fdiv.innerHTML = "<b>Total Number of Files</b>:"+numFound;
		if (numFound>0) {
			var html = "<table>";
			for (var i=0; i<docs.length; i++) {
				var doc = docs[i];
				html += "<tr><td><b>"+doc.title+"</b>";
				
				// display additional file-level metadata 
				var keys = []
				for (var field in doc) {
					if (field != 'data_node' && field != 'index_node' && field != 'type' 
						&& field != 'id' && field != 'dataset_id' && field != 'score' 
						&& field != 'url' && field != 'subtype'
						&& field != 'dataset_id_template_' 
						&& field != 'instance_id' && field != 'master_id'
						&& field != 'metadata_format' && field != 'timestamp'
						&& field != 'latest' && field != 'replica') {
						keys[keys.length] = field;
					}
				}
				// loop over metadata keys in alphabetical order
				keys = keys.sort();
				for (var j=0; j<keys.length; j++) {
					key = keys[j];
					html += "<br/><span style='text-transform:capitalize;'>"+key +"</span>: "+doc[key];
				}
				
				if (doc.subtype == 'image') {
					html += "<br/><a href='/metadata_display/"+project
					     +"?id="+doc.id
					     +"&dataset_id="+doc.dataset_id
					     +"&index_node="+doc.index_node
					     +"&type="+doc.type
					     +"&subtype="+doc.subtype
					     +"'>Full Image Metadata</a>";
				}
				
				html += "</td><td>";
				
				// file access
				if (doc.url) {
					
					var thumbnailUrl = null;
					var imageUrl = null;
					
					// loop over file access URLs, create hyperlinks
					for (var j=0; j<doc.url.length; j++) {
						var urlArray = doc.url[j].split('|');
						
						// special case: 'Thumbnail' service
						if (urlArray[2].toLowerCase() == 'thumbnail') {
							thumbnailUrl = urlArray[0]; // store thumbnail URL for later replacement
							
						} else {
							
							// images: create hyperlink with graphic
							if (urlArray[1].indexOf("image")>=0) {
								html += "<a href='"+urlArray[0]+"'><img src='IMAGE_URL' width='50px'/></a>&nbsp;"; // 'IMAGE_URL'
								imageUrl = urlArray[0]; // always store reference to image URL
								
							// non-images: create hyperlink with text
							} else {
								html += "<a href='"+urlArray[0]+"'>"+urlArray[2]+"</a>&nbsp;";
							}
						}						
					} // loop over URLs
					
					// replace placeholder with thumbnail of full image
					if (html.indexOf("IMAGE_URL")>0) {
						if (thumbnailUrl!=null) {
							html = html.replace("IMAGE_URL",thumbnailUrl);								
						} else {
							html = html.replace("IMAGE_URL",imageUrl);
						}
					}

				} // file access
				 
				html += "</td></tr>";
			}
			html += "</table>";
		}
		fdiv.innerHTML = html;
	}

	// function called if Ajax request failed
	var handleFailure = function(o) {
		showMessage("An Error Occurred",
				    "HTTP Status Code: "+o.status+"<br/>Message: "+o.statusText);
	}

	var callback =
	{
	  success:handleSuccess,
	  failure: handleFailure,
	  cache:false,
	  timeout:5000,
	  argument: [],
	};
	
</script><commit_msg>Removing title from file metadata display.<commit_after><script language="javascript">

	// function to obtain the HTML id for the files container
	function getFilesDiv(dataset_id) {
		id = "files_"+dataset_id;
		return document.getElementById(id);
	}
	
	// function to retrieve the files belonging to a given dataset
	function showFiles(dataset_id, index_node, project) {
		
		fdiv = getFilesDiv(dataset_id);
			
		// only execute invocation for this dataset if not done laready
		if (fdiv.innerHTML.length==0) {
				
			// relative path to COG application
			// note: cannot execute HTTP requests to other hosts because of javascript security restrictions
			var url = "/search_files/"+dataset_id+"/"+index_node+"/";
		
			// pass in project short name as extra argument to callback functions
			callback.argument[0] = project
			
			// execute asynchronous GET request
			var transaction = YAHOO.util.Connect.asyncRequest('GET', url, callback, null);
		}
		
	}
	
	// function called if Ajax request succeded to create the files display widget
	var handleSuccess = function(o) {
		
		// retrieve project short name from callback extra argument
		project = o.argument[0]
		
		// parse JSON response into object		
		var jsonResponse = eval('(' + o.responseText + ')');
		var numFound = jsonResponse.response.numFound;
		var docs = jsonResponse.response.docs;
		var dataset_id = null;
		for (var k=0; k<jsonResponse.responseHeader.params.fq.length; k++) {
			var fqArray = jsonResponse.responseHeader.params.fq[k].split(":");
			if (fqArray[0]=='dataset_id') {
				dataset_id = fqArray[1].replace(/\"/g,'');
			}	
		}
		
		// populate files container
		var fdiv = getFilesDiv(dataset_id);
		fdiv.innerHTML = "<b>Total Number of Files</b>:"+numFound;
		if (numFound>0) {
			var html = "<table>";
			for (var i=0; i<docs.length; i++) {
				var doc = docs[i];
				html += "<tr><td><b>"+doc.title+"</b>";
				
				// display additional file-level metadata 
				var keys = []
				for (var field in doc) {
					if (field != 'data_node' && field != 'index_node' && field != 'type' 
						&& field != 'id' && field != 'dataset_id' && field != 'score' 
						&& field != 'url' && field != 'subtype'
						&& field != 'dataset_id_template_' 
						&& field != 'instance_id' && field != 'master_id'
						&& field != 'metadata_format' && field != 'timestamp'
						&& field != 'title'
						&& field != 'latest' && field != 'replica') {
						keys[keys.length] = field;
					}
				}
				// loop over metadata keys in alphabetical order
				keys = keys.sort();
				for (var j=0; j<keys.length; j++) {
					key = keys[j];
					html += "<br/><span style='text-transform:capitalize;'>"+key +"</span>: "+doc[key];
				}
				
				if (doc.subtype == 'image') {
					html += "<br/><a href='/metadata_display/"+project
					     +"?id="+doc.id
					     +"&dataset_id="+doc.dataset_id
					     +"&index_node="+doc.index_node
					     +"&type="+doc.type
					     +"&subtype="+doc.subtype
					     +"'>Full Image Metadata</a>";
				}
				
				html += "</td><td>";
				
				// file access
				if (doc.url) {
					
					var thumbnailUrl = null;
					var imageUrl = null;
					
					// loop over file access URLs, create hyperlinks
					for (var j=0; j<doc.url.length; j++) {
						var urlArray = doc.url[j].split('|');
						
						// special case: 'Thumbnail' service
						if (urlArray[2].toLowerCase() == 'thumbnail') {
							thumbnailUrl = urlArray[0]; // store thumbnail URL for later replacement
							
						} else {
							
							// images: create hyperlink with graphic
							if (urlArray[1].indexOf("image")>=0) {
								html += "<a href='"+urlArray[0]+"'><img src='IMAGE_URL' width='50px'/></a>&nbsp;"; // 'IMAGE_URL'
								imageUrl = urlArray[0]; // always store reference to image URL
								
							// non-images: create hyperlink with text
							} else {
								html += "<a href='"+urlArray[0]+"'>"+urlArray[2]+"</a>&nbsp;";
							}
						}						
					} // loop over URLs
					
					// replace placeholder with thumbnail of full image
					if (html.indexOf("IMAGE_URL")>0) {
						if (thumbnailUrl!=null) {
							html = html.replace("IMAGE_URL",thumbnailUrl);								
						} else {
							html = html.replace("IMAGE_URL",imageUrl);
						}
					}

				} // file access
				 
				html += "</td></tr>";
			}
			html += "</table>";
		}
		fdiv.innerHTML = html;
	}

	// function called if Ajax request failed
	var handleFailure = function(o) {
		showMessage("An Error Occurred",
				    "HTTP Status Code: "+o.status+"<br/>Message: "+o.statusText);
	}

	var callback =
	{
	  success:handleSuccess,
	  failure: handleFailure,
	  cache:false,
	  timeout:5000,
	  argument: [],
	};
	
</script>
{'fraction_non_alphanumeric': 0.15721787589754582, 'fraction_numerical': 0.005358482477762298, 'mean_word_length': 2.638206627680312, 'pattern_counts': {'":': 2, '<': 63, '<?xml version=': 0, '>': 61, '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': '3733365', 'n_tokens_mistral': 3839, 'n_tokens_neox': 2883, 'n_words': 760}