<commit_before>class CPU:
    psutil = None
    cpu_count = {}
    cpu_passthrough = 0

    def __init__(self, psutil):
        self.psutil = psutil

    def snapshot(self):
        """
        Generate a snapshot of the current CPU state
        """
        cpu_time = self.psutil.cpu_times()

        # Only update the CPU counts every 100th pass through
        if self.cpu_count == {} or self.cpu_passthrough % 100 == 0:
            self.cpu_count = {
                "virtual": self.psutil.cpu_count(),
                "physical": self.psutil.cpu_count(logical=False)
            }

        return {
            "cpu_percent": self.psutil.cpu_percent(interval=1, percpu=True),
            "cpu_times": {
                "user": cpu_time[0],
                "system": cpu_time[1],
                "idle": cpu_time[2]
            },
            "cpu_count": self.cpu_count,
            "load_average": {

            }
        }
<commit_msg>adds load average catting<commit_after>import subprocess

class CPU:
    psutil = None
    cpu_count = {}
    cpu_passthrough = 0

    def __init__(self, psutil):
        self.psutil = psutil

    def snapshot(self):
        """
        Generate a snapshot of the current CPU state
        """
        cpu_time = self.psutil.cpu_times()

        # Only update the CPU counts every 100th pass through
        if self.cpu_count == {} or self.cpu_passthrough % 100 == 0:
            self.cpu_count = {
                "virtual": self.psutil.cpu_count(),
                "physical": self.psutil.cpu_count(logical=False)
            }

        return {
            "cpu_percent": self.psutil.cpu_percent(interval=1, percpu=True),
            "cpu_times": {
                "user": cpu_time[0],
                "system": cpu_time[1],
                "idle": cpu_time[2]
            },
            "cpu_count": self.cpu_count,
            "load_average": subprocess.Popen(["cat", "/proc/loadavg"])
        }

{'fraction_non_alphanumeric': 0.11039283938339135, 'fraction_numerical': 0.011934361014420686, 'mean_word_length': 1.5308176100628932, 'pattern_counts': {'":': 18, '<': 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': '6087317', 'n_tokens_mistral': 645, 'n_tokens_neox': 574, 'n_words': 123}