<commit_before># -*- coding: utf-8 -*-
import os
import re
import json
import signal
from contextlib import contextmanager
from django.template.defaultfilters import slugify

from lxml import html

from django.test.client import Client
from django.core.urlresolvers import reverse
from django.core.management import call_command

from aloe import before, after, around, step, world
from aloe_django import django_url
import aloe_webdriver.django
from selenium import webdriver
import vcr

selenium_vcr = vcr.VCR()
# We need to ignore localhost as selenium communicates over local http
# to interact with the 'browser'
selenium_vcr.ignore_localhost = True

@before.each_example
def setup(scenario, outline, steps):
    # TODO Set browser in django.conf.settings
    # world.browser = webdriver.Chrome()
    world.browser = webdriver.PhantomJS()

    with open(os.devnull, "w") as f:
        call_command('loaddata', 'test_routing.json', stdout=f)
        call_command('loaddata', 'newport_council.json', stdout=f)

@step('No errors were thrown')<commit_msg>clean up unused imports<commit_after># -*- coding: utf-8 -*-
import os
import signal
from contextlib import contextmanager
from django.template.defaultfilters import slugify
from django.core.management import call_command
from aloe import before, after, around, step, world
import aloe_webdriver.django
from selenium import webdriver
import vcr

selenium_vcr = vcr.VCR()
# We need to ignore localhost as selenium communicates over local http
# to interact with the 'browser'
selenium_vcr.ignore_localhost = True

@before.each_example
def setup(scenario, outline, steps):
    # TODO Set browser in django.conf.settings
    # world.browser = webdriver.Chrome()
    world.browser = webdriver.PhantomJS()

    with open(os.devnull, "w") as f:
        call_command('loaddata', 'test_routing.json', stdout=f)
        call_command('loaddata', 'newport_council.json', stdout=f)

@step('No errors were thrown')
{'fraction_non_alphanumeric': 0.08788962698007154, 'fraction_numerical': 0.001021972406745018, 'mean_word_length': 4.87987987987988, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, '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': '4549762', 'n_tokens_mistral': 596, 'n_tokens_neox': 571, 'n_words': 190}