<commit_before>import random
from itertools import izip_longest, groupby, chain

from wa.framework.configuration.core import (MetaConfiguration, RunConfiguration,
                                             JobGenerator, Status, settings)
from wa.framework.configuration.parsers import ConfigParser
from wa.framework.configuration.plugin_cache import PluginCache
from wa.framework.exception import NotFoundError
from wa.framework.job import Job
from wa.utils import log


class CombinedConfig(object):

    @staticmethod
    def from_pod(pod):
        instance = CombinedConfig()
        instance.settings = MetaConfiguration.from_pod(pod.get('settings', {}))
        instance.run_config = RunConfiguration.from_pod(pod.get('run_config', {}))
        return instance

    def __init__(self, settings=None, run_config=None):
        self.settings = settings
        self.run_config = run_config

    def to_pod(self):
        return {'settings': self.settings.to_pod(),
                'run_config': self.run_config.to_pod()}


class ConfigManager(object):
    """
    Represents run-time state of WA. Mostly used as a container for loaded
    configuration and discovered plugins.

    This exists outside of any command or run and is associated with the running
    instance of wA itself.
    """

    def from_pod(self, pod):
        return None # TODO

    @property
    def enabled_instruments(self):
        return self.jobs_config.enabled_instruments

    @property
    def enabled_processors(self):
        return self.jobs_config.enabled_processors

    @property
    def job_specs(self):
        if not self._jobs_generated:
            msg = 'Attempting to access job specs before '\
                  'jobs have been generated'
            raise RuntimeError(msg)
        return [j.spec for j in self._jobs]

    @property
    def jobs(self):
        if not self._jobs_generated:
            msg = 'Attempting to access jobs before '\<commit_msg>Revert "DO NOT MERGE: stub out broken method"<commit_after>import random
from itertools import izip_longest, groupby, chain

from wa.framework.configuration.core import (MetaConfiguration, RunConfiguration,
                                             JobGenerator, Status, settings)
from wa.framework.configuration.parsers import ConfigParser
from wa.framework.configuration.plugin_cache import PluginCache
from wa.framework.exception import NotFoundError
from wa.framework.job import Job
from wa.utils import log


class CombinedConfig(object):

    @staticmethod
    def from_pod(pod):
        instance = CombinedConfig()
        instance.settings = MetaConfiguration.from_pod(pod.get('settings', {}))
        instance.run_config = RunConfiguration.from_pod(pod.get('run_config', {}))
        return instance

    def __init__(self, settings=None, run_config=None):
        self.settings = settings
        self.run_config = run_config

    def to_pod(self):
        return {'settings': self.settings.to_pod(),
                'run_config': self.run_config.to_pod()}


class ConfigManager(object):
    """
    Represents run-time state of WA. Mostly used as a container for loaded
    configuration and discovered plugins.

    This exists outside of any command or run and is associated with the running
    instance of wA itself.
    """

    @property
    def enabled_instruments(self):
        return self.jobs_config.enabled_instruments

    @property
    def enabled_processors(self):
        return self.jobs_config.enabled_processors

    @property
    def job_specs(self):
        if not self._jobs_generated:
            msg = 'Attempting to access job specs before '\
                  'jobs have been generated'
            raise RuntimeError(msg)
        return [j.spec for j in self._jobs]

    @property
    def jobs(self):
        if not self._jobs_generated:
            msg = 'Attempting to access jobs before '\
{'fraction_non_alphanumeric': 0.0765869956309432, 'fraction_numerical': 0.0, 'mean_word_length': 2.8231827111984282, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1774272', 'n_tokens_mistral': 1037, 'n_tokens_neox': 990, 'n_words': 307}