<commit_before>function 7zip_installed {
	try { gcm 7z -ea stop } catch { return $false }
	$true
}

function requires_7zip($fname) {
	$fname -match '(\.gz)|(\.tar)|(\.lzma)|(\.bz2)|(\.7z)$'
}

function extract_7zip($path, $to, $recurse) {
	if(!$recurse) { write-host "extracting..." -nonewline }
	$output = 7z x "$path" -o"$to" -y
	if($lastexitcode -ne 0) { abort "exit code was $lastexitcode" }

	# recursively extract files, e.g. for .tar.gz
	$output | sls '^Extracting\s+(.*)$' | % {
		$fname = $_.matches[0].groups[1].value
		if(requires_7zip $fname) { extract_7zip "$to\$fname" $to $true }
	}

	rm $path
	if(!$recurse) { write-host "done" }
}<commit_msg>include .rar in list of files 7zip extracts<commit_after>function 7zip_installed {
	try { gcm 7z -ea stop } catch { return $false }
	$true
}

function requires_7zip($fname) {
	$fname -match '\.(gz)|(tar)|(lzma)|(bz2)|(7z)|(rar)$'
}

function extract_7zip($path, $to, $recurse) {
	if(!$recurse) { write-host "extracting..." -nonewline }
	$output = 7z x "$path" -o"$to" -y
	if($lastexitcode -ne 0) { abort "exit code was $lastexitcode" }

	# recursively extract files, e.g. for .tar.gz
	$output | sls '^Extracting\s+(.*)$' | % {
		$fname = $_.matches[0].groups[1].value
		if(requires_7zip $fname) { extract_7zip "$to\$fname" $to $true }
	}

	rm $path
	if(!$recurse) { write-host "done" }
}
{'fraction_non_alphanumeric': 0.2065378900445765, 'fraction_numerical': 0.018573551263001486, 'mean_word_length': 3.970479704797048, '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': '612034', 'n_tokens_mistral': 592, 'n_tokens_neox': 564, 'n_words': 127}