<commit_before>import os.path
import os
import sys
import logging
import argparse

paths = [
    os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'devops'),
]
sys.path[:0] = paths

import nose
import nose.config
import integration

logger = logging.getLogger('integration')

def prepare(ci, destroy_after=False, iso=None):

    if not destroy_after:
        ci.tearDown = lambda:None

    if iso:
        ci.iso = iso


if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="Integration test suite")
    parser.add_argument("-i", "--iso", dest="iso",
                      help="iso image path or http://url", required=True)
    parser.add_argument("-l", "--level", dest="log_level", type=str,
                      help="log level", choices=["DEBUG", "INFO", "WARNING", "ERROR"],
                      default="ERROR", metavar="LEVEL")
    parser.add_argument("-d", "--destroy-after", dest="destroy_after", action="store_true",
                      help="destroy environment after testing", default=False)
    parser.add_argument("-c", "--destroy-before", dest="destroy_before", action="store_true",
                      help="destroy environment before testing", default=False)
    parser.add_argument("-n", "--dry-run", dest="dry_run", action="store_true",
                      help="do not run real testing", default=False)

    namespace = parser.parse_args()

    numeric_level = getattr(logging, namespace.log_level.upper())
    logging.basicConfig(level=numeric_level)

    for o, v in namespace._get_kwargs():
        logger.debug("Parsed option: %s = %s" % (o, v))

    ci = integration.Ci()

    if namespace.destroy_before:
        ci.destroy()

    if not namespace.dry_run:
        logger.debug("Preparing for real testing")<commit_msg>added prefix option in integration.py<commit_after>import os.path
import os
import sys
import logging
import argparse

paths = [
    os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'devops'),
]
sys.path[:0] = paths

import nose
import nose.config
import integration

logger = logging.getLogger('integration')

def prepare(ci, destroy_after=False, iso=None):

    if not destroy_after:
        ci.tearDown = lambda:None

    if iso:
        ci.iso = iso


if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="Integration test suite")
    parser.add_argument("-i", "--iso", dest="iso",
                      help="iso image path or http://url", required=True)
    parser.add_argument("-l", "--level", dest="log_level", type=str,
                      help="log level", choices=["DEBUG", "INFO", "WARNING", "ERROR"],
                      default="ERROR", metavar="LEVEL")
    parser.add_argument("-p", "--prefix", dest="ci_prefix", type=str, metavar="PREFIX",
                      help="use this prefix when creating ci environment", default="ci")
    parser.add_argument("-d", "--destroy-after", dest="destroy_after", action="store_true",
                      help="destroy environment after testing", default=False)
    parser.add_argument("-c", "--destroy-before", dest="destroy_before", action="store_true",
                      help="destroy environment before testing", default=False)
    parser.add_argument("-n", "--dry-run", dest="dry_run", action="store_true",
                      help="do not run real testing", default=False)

    namespace = parser.parse_args()

    numeric_level = getattr(logging, namespace.log_level.upper())
    logging.basicConfig(level=numeric_level)

    for o, v in namespace._get_kwargs():
        logger.debug("Parsed option: %s = %s" % (o, v))

    ci = integration.Ci()
    ci.envname = namespace.ci_prefix

    if namespace.destroy_before:
        ci.destroy()

    if not namespace.dry_run:
        logger.debug("Preparing for real testing")
{'fraction_non_alphanumeric': 0.14460656591974988, 'fraction_numerical': 0.0005211047420531526, 'mean_word_length': 3.136853448275862, 'pattern_counts': {'":': 2, '<': 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': '5731182', 'n_tokens_mistral': 1131, 'n_tokens_neox': 1092, 'n_words': 260}