print template.render(title = key, kvps = data[key])

def compare(old,new):
    mod = old
    if len(old) is not len(new):
        temp = new.keys()
        for key in old.keys():
            temp.pop(temp.index(key))
        print("The following blocks are missing in your config.\n Please select an option for changing the configuratoin to the optimal value. [Y/n]")
        print(temp)
        dec = str(raw_input())

    

if __name__ == "__main__":
    global data
    parser = argparse.ArgumentParser(description = "Accepts addresses of config file")
    parser.add_argument("--path1",dest = "path1")
    parser.add_argument("--path2",dest = "path2")
    paths = parser.parse_args()
    if paths.path1 is None or paths.path2 is None:
        print("Paths incomplete")
        sys.exit()
    if not os.path.exists(paths.path1) or not os.path.exists(paths.path2):
        print("Files do not exist.")
        sys.exit()
    data1 = test_parser.parse(paths.path1)#"/home/akarsh/Documents/tmp/config2.conf")
    data2 = test_parser.parse(paths.path2)#"/home/akarsh/Documents/git/NetApp-PESIT-Configuration-Validation-Tool/output/output.conf")
    render_template(data1)
    print data1 == data2
Example #2
0
        sys.exit(1)
    else:
        path = argv.pop(0)

    debug_testno = [-1]
    breakAt = -1
    
    while argv:
        arg = argv.pop(0)
        if arg == '-b':
            if argv: breakAt = int(argv.pop(0))
            else: breakAt = 1
        elif arg == '-l': debug_testno = argv[1:]
        else: raise Exception('unknown flag')
        
    server, tests = parse(path)

    tlength = len(tests)
    
    print
    print 'Executing %d tests using %s' % (tlength, server)

    completed = 0
    for i, test in enumerate(tests):
        i += 1
        print '-'*80

        debug = True if str(i) in debug_testno or '*' in debug_testno else False 

        if debug:
            print
Example #3
0
        print("\n # Processing...")
        parser(dataset_path)
        print("\n # output.csv created\n")
        print(" # Training...")
        x = dataset_path + '/output.csv'
        func(x)
        print("\n # Train finished\n")

        # python3 train.py ./data/consumer_complaints.csv.zip ./parameters.json

    elif menu_choice == '2':
        print(" ------------      ------------")
        print(" Choose classification method (default SVC)\n")
        print(" 1. Multinomial Naive Bayes")
        print(" 2. Linear Support Vector Clusters")
        print(" 3. Support Vector Clusters with ratio \n")

        classification_choice = input(" Enter an input: ")

        print(" Enter the path for folder (ex. format = ./dataset )")

        document_path = input(" Enter an input: ")
        parse(document_path)
        print("# Classifying...")
        predict('./test_output.csv', classification_choice)

    elif menu_choice == '0':

        break
    else:
        print("\n")