<commit_before>"""Perform hardware operations."""
import os

from mpf.core.config_loader import YamlMultifileConfigLoader

from mpf.commands import MpfCommandLineParser

from mpf.core.machine import MachineController

SUBCOMMAND = True


class Command(MpfCommandLineParser):

    """Performs hardware operations."""

    def __init__(self, args, path):
        """Parse args."""
        command_name = args.pop(1)
        super().__init__(args=args, path=path)

        machine_path, remaining_args = self.parse_args()
        self.machine_path = machine_path
        self.args = remaining_args
        config_loader = YamlMultifileConfigLoader(machine_path, self.args.configfile,
                                                  not self.args.no_load_cache, self.args.create_config_cache)

        config = config_loader.load_mpf_config()

        self.mpf = MachineController({"bcp": False,
                                      "no_load_cache": False,
                                      "mpfconfigfile": os.path.join(self.mpf_path, "mpfconfig.yaml"),
                                      "configfile": ["config"],
                                      "production": False,
                                      "create_config_cache": False,
                                      "force_platform": False,
                                      "text_ui": False
                                      }, config)
        self.mpf.clock.loop.run_until_complete(self.mpf.initialise_core_and_hardware())
        if self.mpf.thread_stopper.is_set():<commit_msg>fix command<commit_after>"""Perform hardware operations."""
import os

from mpf.core.config_loader import YamlMultifileConfigLoader

from mpf.commands import MpfCommandLineParser

from mpf.core.machine import MachineController

SUBCOMMAND = True


class Command(MpfCommandLineParser):

    """Performs hardware operations."""

    def __init__(self, args, path):
        """Parse args."""
        command_name = args.pop(1)
        super().__init__(args=args, path=path)

        machine_path, remaining_args = self.parse_args()
        self.machine_path = machine_path
        self.args = remaining_args
        config_loader = YamlMultifileConfigLoader(machine_path, ["config.yaml"], True, False)

        config = config_loader.load_mpf_config()

        self.mpf = MachineController({"bcp": False,
                                      "no_load_cache": False,
                                      "mpfconfigfile": os.path.join(self.mpf_path, "mpfconfig.yaml"),
                                      "configfile": ["config"],
                                      "production": False,
                                      "create_config_cache": False,
                                      "force_platform": False,
                                      "text_ui": False
                                      }, config)
        self.mpf.clock.loop.run_until_complete(self.mpf.initialise_core_and_hardware())
        if self.mpf.thread_stopper.is_set():
{'fraction_non_alphanumeric': 0.09383289124668436, 'fraction_numerical': 0.000663129973474801, 'mean_word_length': 1.7577696526508226, 'pattern_counts': {'":': 16, '<': 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': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1427065', 'n_tokens_mistral': 790, 'n_tokens_neox': 767, 'n_words': 141}