<commit_before>'''
Performance Testing Base Module.  Defines the AbstractTest that will be inherited by all performance test classes.

Created on Apr 21, 2015

@author: arbennett
'''
import re
import os
import operator
import matplotlib.pyplot as pyplot
import numpy as np
import glob
import jinja2
from abc import ABCMeta, abstractmethod
from collections import Counter

import util.variables
from test.test_index import minsize

# A mapping of the options to the test cases that can be run
cases = {'none' : [],
         'dome' : ['dome'],
         'gis' : ['gis'],
         'all' : ['dome', 'gis']}

''' Return a list of options '''
def choices():
    return list( cases.keys() )

''' Return the tests associated with an option '''
def choose(key):
    return cases[key] if cases.has_key(key) else None

'''
AbstractTest provides base functionality for a Performance test

Each test within LIVV needs to be able to run specific test code, and
generate its output.  Tests inherit a common method of generating 
scaling plots
'''
class AbstractTest(object):
    __metaclass__ = ABCMeta

    ''' Constructor '''
    def __init__(self):
        self.name = "n/a"    # A name for the test<commit_msg>Remove extranious import.<commit_after>'''
Performance Testing Base Module.  Defines the AbstractTest that will be inherited by all performance test classes.

Created on Apr 21, 2015

@author: arbennett
'''
import re
import os
import operator
import matplotlib.pyplot as pyplot
import numpy as np
import glob
import jinja2
from abc import ABCMeta, abstractmethod
from collections import Counter

import util.variables

# A mapping of the options to the test cases that can be run
cases = {'none' : [],
         'dome' : ['dome'],
         'gis' : ['gis'],
         'all' : ['dome', 'gis']}

''' Return a list of options '''
def choices():
    return list( cases.keys() )

''' Return the tests associated with an option '''
def choose(key):
    return cases[key] if cases.has_key(key) else None

'''
AbstractTest provides base functionality for a Performance test

Each test within LIVV needs to be able to run specific test code, and
generate its output.  Tests inherit a common method of generating 
scaling plots
'''
class AbstractTest(object):
    __metaclass__ = ABCMeta

    ''' Constructor '''
    def __init__(self):
        self.name = "n/a"    # A name for the test
{'fraction_non_alphanumeric': 0.09190556492411467, 'fraction_numerical': 0.005902192242833052, 'mean_word_length': 3.7365269461077846, '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': '7206253', 'n_tokens_mistral': 684, 'n_tokens_neox': 656, 'n_words': 301}