<commit_before>import unittest
import random, sys, time, os
sys.path.extend(['.','..','py'])

import h2o, h2o_cmd, h2o_hosts, h2o_browse as h2b, h2o_import as h2i, h2o_exec as h2e

def write_syn_dataset(csvPathname, rowCount, SEED):
    # 8 random generatators, 1 per column
    r1 = random.Random(SEED)
    dsf = open(csvPathname, "w+")
    for i in range(rowCount):
        rowData = "%s,%s,%s,%s,%s,%s,%s,%s" % (
            r1.randint(0,1),
            r1.randint(0,2),
            r1.randint(-4,4),
            r1.randint(0,8),
            r1.randint(-16,16),
            r1.randint(-32,32),
            0,
            r1.randint(0,1))
        dsf.write(rowData + "\n")
    dsf.close()

zeroList = [
        'Result2 = 0',
        'Result1 = 0',
        'Result0 = 0',
        'Result.hex = 0',
]

exprList = [
        'Result<n> = <keyX>[<col1>] + <keyX>[<col2>] + <keyX>[2]' ,
        'Result<n> = randomFilter(<keyX>,<col1>,<row>)',
    ]

class Basic(unittest.TestCase):
    def tearDown(self):
        h2o.check_sandbox_for_errors()

    @classmethod
    def setUpClass(cls):
        global SEED
        SEED = random.randint(0, sys.maxint)

        # if you have to force to redo a test
        # SEED = 
        random.seed(SEED)
        print "\nUsing random seed:", SEED
        localhost = h2o.decide_if_localhost()
        if (localhost):
            h2o.build_cloud(1,java_heap_GB=4)
        else:
            h2o_hosts.build_cloud_with_hosts()


    @classmethod
    def tearDownClass(cls):
        # wait while I inspect things
        # time.sleep(1500)
        h2o.tear_down_cloud()

    def test_factor_with_syn(self):
        SYNDATASETS_DIR = h2o.make_syn_dir()
        # use SEED so the file isn't cached?
        csvFilenameAll = [
            ('syn_1mx8_' + str(SEED) + '.csv', 'cA', 5),<commit_msg>forced the SEED to be a constant to match failing jenkins<commit_after>import unittest
import random, sys, time, os
sys.path.extend(['.','..','py'])

import h2o, h2o_cmd, h2o_hosts, h2o_browse as h2b, h2o_import as h2i, h2o_exec as h2e

def write_syn_dataset(csvPathname, rowCount, SEED):
    # 8 random generatators, 1 per column
    r1 = random.Random(SEED)
    dsf = open(csvPathname, "w+")
    for i in range(rowCount):
        rowData = "%s,%s,%s,%s,%s,%s,%s,%s" % (
            r1.randint(0,1),
            r1.randint(0,2),
            r1.randint(-4,4),
            r1.randint(0,8),
            r1.randint(-16,16),
            r1.randint(-32,32),
            0,
            r1.randint(0,1))
        dsf.write(rowData + "\n")
    dsf.close()

zeroList = [
        'Result2 = 0',
        'Result1 = 0',
        'Result0 = 0',
        'Result.hex = 0',
]

exprList = [
        'Result<n> = <keyX>[<col1>] + <keyX>[<col2>] + <keyX>[2]' ,
        'Result<n> = randomFilter(<keyX>,<col1>,<row>)',
    ]

class Basic(unittest.TestCase):
    def tearDown(self):
        h2o.check_sandbox_for_errors()

    @classmethod
    def setUpClass(cls):
        global SEED
        SEED = random.randint(0, sys.maxint)

        # if you have to force to redo a test
        SEED = 6019110937119320453
        random.seed(SEED)
        print "\nUsing random seed:", SEED
        localhost = h2o.decide_if_localhost()
        if (localhost):
            h2o.build_cloud(1,java_heap_GB=4)
        else:
            h2o_hosts.build_cloud_with_hosts()


    @classmethod
    def tearDownClass(cls):
        # wait while I inspect things
        # time.sleep(1500)
        h2o.tear_down_cloud()

    def test_factor_with_syn(self):
        SYNDATASETS_DIR = h2o.make_syn_dir()
        # use SEED so the file isn't cached?
        csvFilenameAll = [
            ('syn_1mx8_' + str(SEED) + '.csv', 'cA', 5),
{'fraction_non_alphanumeric': 0.14408833827093995, 'fraction_numerical': 0.04012927551844869, 'mean_word_length': 2.163543441226576, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '3301865', 'n_tokens_mistral': 1470, 'n_tokens_neox': 1375, 'n_words': 274}