<commit_before>#!/bin/bash

set -e

if [ "$(id -u)" -ne "0" ]; then
        echo "This script requires root."
        exit 1
fi

print() {
        printf "%-20s: %s %s\n" "$1" "$2 $3" "$4"
}

statprint() {
	local STAT_PATH=/sys/bus/platform/drivers/rk_gmac-dwmac/ff540000.eth/net/eth0/statistics
	local STAT_VALUE=$(cat $STAT_PATH/$1)
	print "$1" $STAT_VALUE
}

all() {
	statprint collisions
	statprint multicast
	statprint rx_bytes
	statprint rx_compressed
	statprint rx_crc_errors
	statprint rx_dropped
	statprint rx_errors
	statprint rx_fifo_errors
	statprint rx_frame_errors
	statprint rx_length_errors
	statprint rx_missed_errors
	statprint rx_over_errors
	statprint rx_packets
	statprint tx_aborted_errors
	statprint tx_bytes
	statprint tx_carrier_errors
	statprint tx_compressed
	statprint tx_dropped
	statprint tx_errors
	statprint tx_fifo_errors
	statprint tx_heartbeat_errors
	statprint tx_packets
	statprint tx_window_errors
}

usage() {
	echo "Usage: $0 [-w] [-h]"
}

WATCH=""
for i in "$@"; do
	case $i in
	-w)
		WATCH=1
		shift
		;;
	-h|--help)
		usage
		exit 0
		;;
	*)
		usage
		exit 1
		;;
	esac
done

if [ -n "$WATCH" ]; then
	exec watch -n0.5 "$0"
else
	all
fi

<commit_msg>Removed root requirement check File system permissions allow 'everyone' to read<commit_after>#!/bin/bash

set -e

print() {
        printf "%-20s: %s %s\n" "$1" "$2 $3" "$4"
}

statprint() {
	local STAT_PATH=/sys/bus/platform/drivers/rk_gmac-dwmac/ff540000.eth/net/eth0/statistics
	local STAT_VALUE=$(cat $STAT_PATH/$1)
	print "$1" $STAT_VALUE
}

all() {
	statprint collisions
	statprint multicast
	statprint rx_bytes
	statprint rx_compressed
	statprint rx_crc_errors
	statprint rx_dropped
	statprint rx_errors
	statprint rx_fifo_errors
	statprint rx_frame_errors
	statprint rx_length_errors
	statprint rx_missed_errors
	statprint rx_over_errors
	statprint rx_packets
	statprint tx_aborted_errors
	statprint tx_bytes
	statprint tx_carrier_errors
	statprint tx_compressed
	statprint tx_dropped
	statprint tx_errors
	statprint tx_fifo_errors
	statprint tx_heartbeat_errors
	statprint tx_packets
	statprint tx_window_errors
}

usage() {
	echo "Usage: $0 [-w] [-h]"
}

WATCH=""
for i in "$@"; do
	case $i in
	-w)
		WATCH=1
		shift
		;;
	-h|--help)
		usage
		exit 0
		;;
	*)
		usage
		exit 1
		;;
	esac
done

if [ -n "$WATCH" ]; then
	exec watch -n0.5 "$0"
else
	all
fi


{'fraction_non_alphanumeric': 0.10216193302246715, 'fraction_numerical': 0.01949978804578211, 'mean_word_length': 3.968421052631579, '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': '1078479', 'n_tokens_mistral': 992, 'n_tokens_neox': 938, 'n_words': 234}