<commit_before>"""
common.py

"""
__author__ = '<NAME>'
__email__ = '<EMAIL>'
__since__ = '2011-07-22'


def get_consumer_config(config):
    return config.get('Consumers') or config.get('Bindings')

def get_poll_interval(config):
    monitoring = config.get('Monitoring', dict())
    return config.get('poll_interval', monitoring.get('interval', None))

def monitoring_enabled(config):

    # We now want to just enable/disable this
    if config.get('monitor') in [True, False]:<commit_msg>Squash legacy consumers YAML section into the main consumer config section<commit_after>"""
common.py

"""
__author__ = '<NAME>'
__email__ = '<EMAIL>'
__since__ = '2011-07-22'


def get_consumer_config(config):
    config = config.get('Consumers') or config.get('Bindings')

    # Squash the configs down
    for name in config:
        if 'consumers' in config[name]:
            config[name].update(config[name]['consumers'])
            del config[name]['consumers']
    return config


def get_poll_interval(config):
    monitoring = config.get('Monitoring', dict())
    return config.get('poll_interval', monitoring.get('interval', None))

def monitoring_enabled(config):

    # We now want to just enable/disable this
    if config.get('monitor') in [True, False]:
{'fraction_non_alphanumeric': 0.14025356576862125, 'fraction_numerical': 0.012678288431061807, 'mean_word_length': 4.420600858369099, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3903928', 'n_tokens_mistral': 398, 'n_tokens_neox': 378, 'n_words': 100}