<commit_before>from behave import *
import json
import server


@when(u'I visit the "home page"')
def step_impl(context):
    context.resp = context.app.get('/')


@then(u'I should see "{message}"')
def step_impl(context, message):
    assert message in context.resp.data


@then(u'I should not see "{message}"')
def step_impl(context, message):
    assert message not in context.resp.data


@given(u'the following products')
def step_impl(context):
    # server.data_reset()
    server.conn.execute("TRUNCATE TABLE `recommendations`")
    for row in context.table:
        server.conn.execute("INSERT INTO `recommendations` VALUES (%d, %d, %d, '%s\', %d)" % (int(row["id"]), int(row["parent_product_id"]), int(row["related_product_id"]), row["type"], int(row["priority"])))


@when(u'I visit "{url}"')
def step_impl(context, url):
    context.resp = context.app.get(url)
    assert context.resp.status_code == 200
<commit_msg>I hate long lines.<commit_after>from behave import *
import json
import server


@when(u'I visit the "home page"')
def step_impl(context):
    context.resp = context.app.get('/')


@then(u'I should see "{message}"')
def step_impl(context, message):
    assert message in context.resp.data


@then(u'I should not see "{message}"')
def step_impl(context, message):
    assert message not in context.resp.data


@given(u'the following products')
def step_impl(context):
    # server.data_reset()
    server.conn.execute("TRUNCATE TABLE `recommendations`")
    for row in context.table:
        server.conn.execute("INSERT INTO `recommendations` VALUES (%d, %d, %d,\
                '%s\', %d)" % (int(row["id"]), int(row["parent_product_id"]),
                               int(row["related_product_id"]), row["type"],
                               int(row["priority"])))


@when(u'I visit "{url}"')
def step_impl(context, url):
    context.resp = context.app.get(url)
    assert context.resp.status_code == 200

{'fraction_non_alphanumeric': 0.1609907120743034, 'fraction_numerical': 0.0030959752321981426, 'mean_word_length': 3.9464285714285716, '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': '1773481', 'n_tokens_mistral': 647, 'n_tokens_neox': 618, 'n_words': 159}