<commit_before>import os
import time
import subprocess

from lib.cuckoo.common.abstracts import Dictionary, MachineManager

class VirtualBox(MachineManager):
    def start(self, label):
        if self.config.getboolean("virtualbox", "headless"):
            subprocess.call(["VBoxHeadless", "-startvm", label])
        else:
            subprocess.call(["VBoxManage", "startvm", label])

    def stop(self, label):
        subprocess.call(["VBoxManage", "controlvm", label, "poweroff"])
        time.sleep(3)
        subprocess.call(["VBoxManage", "snapshot", label, "restorecurrent"])<commit_msg>Redirected VBoxManage stdout to pipe<commit_after>import os
import time
import subprocess

from lib.cuckoo.common.abstracts import Dictionary, MachineManager

class VirtualBox(MachineManager):
    def start(self, label):
        if self.config.getboolean("virtualbox", "headless"):
            subprocess.call(["VBoxHeadless", "-startvm", label], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        else:
            subprocess.call(["VBoxManage", "startvm", label], stdout=subprocess.PIPE, stderr=subprocess.PIPE)

    def stop(self, label):
        subprocess.call(["VBoxManage", "controlvm", label, "poweroff"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        time.sleep(3)
        subprocess.call(["VBoxManage", "snapshot", label, "restorecurrent"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
{'fraction_non_alphanumeric': 0.1346562721474132, 'fraction_numerical': 0.001417434443656981, 'mean_word_length': 4.288389513108614, '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': '350929', 'n_tokens_mistral': 432, 'n_tokens_neox': 433, 'n_words': 87}