<commit_before># -*- coding: utf-8 -*-
import subprocess
import yaml
import os

from .ansible_handler import AnsibleHandler
from .vagrant_handler import VagrantHandler
from .serverspec_handler import ServerspecHandler

from contextlib import contextmanager



class Messier(AnsibleHandler, VagrantHandler, ServerspecHandler):
    """
    Messier object for running multi-VM test suites. Interfaces with Vagrant
    for VM management, assumes Ansible as provisioner, and uses `ansible_spec`
    to run Serverspec tests.
    """

    def __init__(self, config_file=".messier", vms=None, provider="virtualbox"):
        #self.args = args
        AnsibleHandler.__init__(self)
        VagrantHandler.__init__(self)
        ServerspecHandler.__init__(self)
        self.config = self.parse_messier_config(config_filepath=config_file)
        if not vms:
            vms = []
        self.vms = vms
        self.provider = provider


    def parse_messier_config(self, config_filepath=".messier"):
        """
        Read YAML config file for Messier. Defaults to .messier.
        Supported options include:

          `serverspec_commands`: list of shell commands to run for Serverspec
          `serverspec_base_directory`: directory to cd into prior to running Serverspec
        """
        try:
            config_file = open(config_filepath,'r')<commit_msg>Fixes parsing of vm= attribute to config object<commit_after># -*- coding: utf-8 -*-
import subprocess
import yaml
import os

from .ansible_handler import AnsibleHandler
from .vagrant_handler import VagrantHandler
from .serverspec_handler import ServerspecHandler

from contextlib import contextmanager



class Messier(AnsibleHandler, VagrantHandler, ServerspecHandler):
    """
    Messier object for running multi-VM test suites. Interfaces with Vagrant
    for VM management, assumes Ansible as provisioner, and uses `ansible_spec`
    to run Serverspec tests.
    """

    def __init__(self, config_file=".messier", vms=None, provider="virtualbox"):
        #self.args = args
        AnsibleHandler.__init__(self)
        VagrantHandler.__init__(self)
        ServerspecHandler.__init__(self)
        self.config = self.parse_messier_config(config_filepath=config_file)
        if not vms:
            vms = []
        self.vms = vms
        # Convert VM names to VM objects
        self.vms = self.available_vms()
        self.provider = provider


    def parse_messier_config(self, config_filepath=".messier"):
        """
        Read YAML config file for Messier. Defaults to .messier.
        Supported options include:

          `serverspec_commands`: list of shell commands to run for Serverspec
          `serverspec_base_directory`: directory to cd into prior to running Serverspec
        """
        try:
            config_file = open(config_filepath,'r')
{'fraction_non_alphanumeric': 0.07589128132721497, 'fraction_numerical': 0.0007059654076950229, 'mean_word_length': 3.07183908045977, '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': '763396', 'n_tokens_mistral': 822, 'n_tokens_neox': 784, 'n_words': 232}