<commit_before># -*- encoding: utf-8 -*-
'''
Loader and primary interface for nova modules

:maintainer: basepi
:maturity: 20160218
:platform: All
:requires: SaltStack

TODO: High level documentation

Configuration:
    - hubblestack.nova.dir
    - hubblestack.nova.saltenv
'''
from __future__ import absolute_import
import logging

log = logging.getLogger(__name__)

import imp
import os
import sys
import six
import inspect

import salt
import salt.utils
from salt.exceptions import CommandExecutionError
from salt.loader import LazyLoader

__nova__ = {}


def audit(modules=None, tag='*', first_load=True, always_load=False):
    '''
    Primary entry point for audit calls.

    modules
        List (comma-separated or python list) of modules/directories to search
        for audit modules. Directories are dot-separated, much in the same way
        as Salt states. For individual module names, leave the .py extension
        off.  If a given path resolves to a python file, it will be treated as
        a single module. Otherwise it will be treated as a directory. All
        modules found in a recursive search of the specified directories will
        be included in the audit.

    tags
        Glob pattern string for tags to include in the audit. This way you can
        give a directory, and tell the system to only run the `CIS*`-tagged
        audit modules, for example.

    first_load
        If set to True and no modules have been loaded, will load before
        auditing. Default is True.

    always_load
        If set to True, always do a fresh load before auditing. Default
        is False
    '''
    if (not __nova__ and first_load) or always_load:
        load()
    if not __nova__:
        return False, 'No nova modules have been loaded.'
<commit_msg>Better default argument for nova.audit modules<commit_after># -*- encoding: utf-8 -*-
'''
Loader and primary interface for nova modules

:maintainer: basepi
:maturity: 20160218
:platform: All
:requires: SaltStack

TODO: High level documentation

Configuration:
    - hubblestack.nova.dir
    - hubblestack.nova.saltenv
'''
from __future__ import absolute_import
import logging

log = logging.getLogger(__name__)

import imp
import os
import sys
import six
import inspect

import salt
import salt.utils
from salt.exceptions import CommandExecutionError
from salt.loader import LazyLoader

__nova__ = {}


def audit(modules='', tag='*', first_load=True, always_load=False):
    '''
    Primary entry point for audit calls.

    modules
        List (comma-separated or python list) of modules/directories to search
        for audit modules. Directories are dot-separated, much in the same way
        as Salt states. For individual module names, leave the .py extension
        off.  If a given path resolves to a python file, it will be treated as
        a single module. Otherwise it will be treated as a directory. All
        modules found in a recursive search of the specified directories will
        be included in the audit.

    tags
        Glob pattern string for tags to include in the audit. This way you can
        give a directory, and tell the system to only run the `CIS*`-tagged
        audit modules, for example.

    first_load
        If set to True and no modules have been loaded, will load before
        auditing. Default is True.

    always_load
        If set to True, always do a fresh load before auditing. Default
        is False
    '''
    if (not __nova__ and first_load) or always_load:
        load()
    if not __nova__:
        return False, 'No nova modules have been loaded.'

{'fraction_non_alphanumeric': 0.057356608478802994, 'fraction_numerical': 0.004987531172069825, 'mean_word_length': 2.936750272628135, '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': '1824648', 'n_tokens_mistral': 998, 'n_tokens_neox': 962, 'n_words': 455}