<commit_before># Show network statistics for all active interfaces found.

run_segment() {
	type ifstat >/dev/null 2>&1
	if [ "$?" -ne 0 ]; then
		return 1
	fi

	data=$(ifstat -S -q 1 1)
	interfaces=$(echo -e "${data}" | head -n 1)
	flow_data=$(echo -e "${data}" | tail -n 1 | sed "s/\s\{1,\}/,/g")
	index=1
	for inf in ${interfaces}; do
		type=""
		case ${inf} in
			eth*) type="⎆"
				;;
			wlan*) type="☫"
				;;
		esac
		if [ -n "${type}" ]; then
			formate=$(echo "${formate} ${type} ⇊ %.2f⇈ %.2f")
			holder=$(echo "${holder},\$$((index)),\$$((index+1))")
		fi
		index=$((index+2))
	done
	if [ -n "${formate}" ]; then
		echo $(echo "${flow_data#,}" | awk -F"," "{printf(\"${formate}\"${holder})}")
	fi
	return 0
}<commit_msg>update ifstat to work on OS X<commit_after># Show network statistics for all active interfaces found.

run_segment() {
	type ifstat >/dev/null 2>&1
	if [ "$?" -ne 0 ]; then
		return 1
	fi

	data=$(ifstat -S -q 1 1)
	interfaces=$(echo -e "${data}" | head -n 1)
	flow_data=$(echo -e "${data}" | tail -n 1 | sed "s/\s\{1,\}/,/g")
	index=1
	for inf in ${interfaces}; do
		type=""
		case ${inf} in
			eth*) type="⎆"
				;;
			wlan*) type="☫"
				;;
			en*) type=" "
				;;
		esac
		if [ -n "${type}" ]; then
			formate=$(echo "${formate} ${type} ⇊ %.2f ⇈ %.2f")
			holder=$(echo "${holder},\$$((index)),\$$((index+1))")
		fi
		index=$((index+2))
	done
	if [ -n "${formate}" ]; then
		echo $(echo "${flow_data#,}" | awk -F"," "{printf(\"${formate}\"${holder})}")
	fi
	return 0
}
{'fraction_non_alphanumeric': 0.260146373918829, 'fraction_numerical': 0.01996007984031936, 'mean_word_length': 3.1432506887052343, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4695422', 'n_tokens_mistral': 684, 'n_tokens_neox': 606, 'n_words': 175}