<commit_before><?php
	include '../util.php.inc';
	
	$dir = $_GET['dir'];
	$path = bespin_get_file_name($dir);
	
	// Open a known directory, and proceed to read its contents
	if (is_dir($path)) {
	    if ($dh = opendir($path)) {
	        echo '<ul class="jqueryFileTree" style="display: none;">';
	        while (($file = readdir($dh)) !== false) {
	            if (substr($file, 0, 1) == '.') { continue; }
                $class_name = is_dir("$path/$file") ? 'directory' : 'file ext_css';
	            $postfix = is_dir("$path/$file") ? '/' : '';
	            echo "<li class=\"$class_name collapsed\"><a href=\"#\" rel=\"$dir/$file$postfix\">$file</a></li>";	                
	        }
	        closedir($dh);
	    }
	}
?><commit_msg>Sort the results from ls<commit_after><?php
	include '../util.php.inc';
	
	$dir = $_GET['dir'];
	$path = bespin_get_file_name($dir);
	
    $folder_array = array();
    $file_array = array();

	if (is_dir($path)) {
	    if ($dh = opendir($path)) {
	        while (($entry = readdir($dh)) !== false) {
	            if (substr($entry, 0, 1) == '.') { continue; }
                if (is_dir("$path/$entry")) {
                    $folder_array[] = $entry;
                } else {
                    $file_array[] = $entry;
                }
            }
            closedir($dh);
        }
    }

    sort($folder_array);
    sort($file_array);

    echo '<ul class="jqueryFileTree" style="display: none;">';
    foreach ($folder_array as $folder) {
        echo "<li class=\"directory collapsed\"><a href=\"#\" rel=\"$dir/$folder/\">$folder</a></li>";
    }
    foreach ($file_array as $file) {
        echo "<li class=\"file ext_css\"><a href=\"#\" rel=\"$dir/$file/\">$file</a></li>";
    }
    echo '</ul>'
?>
{'fraction_non_alphanumeric': 0.21758994860079955, 'fraction_numerical': 0.002284408909194746, 'mean_word_length': 2.117437722419929, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, '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': '4512393', 'n_tokens_mistral': 600, 'n_tokens_neox': 566, 'n_words': 116}