# Path: lightbulb/core/base.py
# def options_as_dictionary(meta):
#     """
#     Transforms a list of tuples to a dictionary
#     Args:
#         meta (list): A list ot option tuples
#     Retuns:
#         dict: A dictionary of options key - values
#     """
#     module_config = {}
#     for seltuple in meta:
#         module_config.update({seltuple[0]: seltuple[1]})
#     return  module_config
# 
# Path: lightbulb/core/operate.py
# def manage(module_name, configuration):
#     """
#     This function manages the module initialization and execution
#     Args:
#         module_name (class): The module class to be initiated
#         configuration (dict): The module options
#     Returns:
#        list: A list with the results and stats as tuples
#     """
# 
#     module = __import__(module_name)
#     classmembers = [classmodule for classmodule in inspect.getmembers(module, inspect.isclass)
#                     if classmodule[0] == 'Module' or classmodule[0] == 'Module_A'
#                     or classmodule[0] == 'Module_B']
#     if len(classmembers) == 1:
#         return  operate_learn(classmembers[0][1], configuration)
#     else:
#         if classmembers[0][0] == "Module_A":
#             return operate_diff(classmembers[0][1], configuration, classmembers[1][1], configuration)
#         else:
#             return operate_diff(classmembers[1][1], configuration, classmembers[0][1], configuration)
# 
# Path: lightbulb/core/utils/common.py
# def findlibrary(path):
#     path = re.sub('.*my_saved_models/', expanduser("~") + "/.LightBulb/models/", path)
#     path = re.sub('.*my_saved_regex/', expanduser("~") + "/.LightBulb/regex/", path)
#     path = re.sub('.*my_saved_trees/', expanduser("~") + "/.LightBulb/trees/", path)
#     path = re.sub('.*my_saved_grammars/', expanduser("~") + "/.LightBulb/grammars/", path)
#     path = path.replace('{library}', imp.find_module('lightbulb')[1]+"/data/")
#     return path


from lightbulb.core.base import options_as_dictionary
from collections import OrderedDict
from lightbulb.core.operate import manage
from lightbulb.core.utils.common import findlibrary
import json


META = {
    'author': 'George Argyros, Ioannis Stais',
    'description': 'Verifies a distinguish tree for a list of WAF filters',
    'type':'Distinguisher',
    'options': [
        ('WAFCONF', None, True, 'File containting the WAFs configuration'),
        ('FILE', None, True, 'The generated distinguish string'),
        ('PROXY_SCHEME', None, False, 'The proxy scheme (e.g. http, https'),
        ('PROXY_HOST', None, False, 'The proxy host'),
        ('PROXY_PORT', None, False, 'The proxy port'),
        ('PROXY_USERNAME', None, False, 'The proxy username'),
        ('PROXY_PASSWORD', None, False, 'The proxy password'),
        ('USER_AGENT', "Mozilla/5.0", True, 'The request user agent'),
        ('REFERER', "http://google.com", True, 'The request referrer'),
    ],
    'comments': ['Sample comment 1', 'Sample comment 2']
}




class Module():



# Path: lightbulb/core/base.py
# def options_as_dictionary(meta):
#     """
#     Transforms a list of tuples to a dictionary
#     Args:
#         meta (list): A list ot option tuples
#     Retuns:
#         dict: A dictionary of options key - values
#     """
#     module_config = {}
#     for seltuple in meta:
#         module_config.update({seltuple[0]: seltuple[1]})
#     return  module_config
# 
# Path: lightbulb/core/operate.py
# def manage(module_name, configuration):
#     """
#     This function manages the module initialization and execution
#     Args:
#         module_name (class): The module class to be initiated
#         configuration (dict): The module options
#     Returns:
#        list: A list with the results and stats as tuples
#     """
# 
#     module = __import__(module_name)
#     classmembers = [classmodule for classmodule in inspect.getmembers(module, inspect.isclass)
#                     if classmodule[0] == 'Module' or classmodule[0] == 'Module_A'
#                     or classmodule[0] == 'Module_B']
#     if len(classmembers) == 1:
#         return  operate_learn(classmembers[0][1], configuration)
#     else:
#         if classmembers[0][0] == "Module_A":
#             return operate_diff(classmembers[0][1], configuration, classmembers[1][1], configuration)
#         else:
#             return operate_diff(classmembers[1][1], configuration, classmembers[0][1], configuration)
# 
# Path: lightbulb/core/utils/common.py
# def findlibrary(path):
#     path = re.sub('.*my_saved_models/', expanduser("~") + "/.LightBulb/models/", path)
#     path = re.sub('.*my_saved_regex/', expanduser("~") + "/.LightBulb/regex/", path)
#     path = re.sub('.*my_saved_trees/', expanduser("~") + "/.LightBulb/trees/", path)
#     path = re.sub('.*my_saved_grammars/', expanduser("~") + "/.LightBulb/grammars/", path)
#     path = path.replace('{library}', imp.find_module('lightbulb')[1]+"/data/")
#     return path


# Path: lightbulb/modules/verify_waf_tree.py
from lightbulb.core.base import options_as_dictionary
from collections import OrderedDict
from lightbulb.core.operate import manage
from lightbulb.core.utils.common import findlibrary
import json



META = {
    'author': 'George Argyros, Ioannis Stais',
    'description': 'Verifies a distinguish tree for a list of WAF filters',
    'type':'Distinguisher',
    'options': [
        ('WAFCONF', None, True, 'File containting the WAFs configuration'),
        ('FILE', None, True, 'The generated distinguish string'),
        ('PROXY_SCHEME', None, False, 'The proxy scheme (e.g. http, https'),
        ('PROXY_HOST', None, False, 'The proxy host'),
        ('PROXY_PORT', None, False, 'The proxy port'),
        ('PROXY_USERNAME', None, False, 'The proxy username'),
        ('PROXY_PASSWORD', None, False, 'The proxy password'),
        ('USER_AGENT', "Mozilla/5.0", True, 'The request user agent'),
        ('REFERER', "http://google.com", True, 'The request referrer'),
    ],
    'comments': ['Sample comment 1', 'Sample comment 2']
}




class Module():



    def __init__(self, configuration):