<commit_before>from django.test import LiveServerTestCase
from django.utils import unittest
import adagios.settings
import adagios.utils
import os

try:
    from selenium import webdriver
except ImportError:
    webdriver = None

def get_remote_webdriver(capabilities=None):
    """Get remote webdriver. Configured using environment variables
    to setup where the remote webdriver is. options could be a local
    install or using the setup at saucelabs"""

    if not capabilities:
        capabilities = webdriver.DesiredCapabilities.FIREFOX

    # Saucelabs setup,
    capabilities["build"] = os.environ.get("TRAVIS_BUILD_NUMBER")
    capabilities["tags"] = [os.environ.get("TRAVIS_PYTHON_VERSION"), "CI"]
    capabilities["tunnel-identifier"] = os.environ.get("TRAVIS_JOB_NUMBER")

    username = os.environ.get("SAUCE_USERNAME")
    access_key = os.environ.get("SAUCE_ACCESS_KEY")
    hub_url = os.environ.get('SAUCE_HUBURL', "ondemand.saucelabs.com/wd/hub")

    if username and access_keys:
        hub_url = "%s:%s@%s" % (username, access_key, hub_url)

    return webdriver.Remote(desired_capabilities=capabilities,
                            command_executor="http://%s" % hub_url)

class SeleniumTestCase(LiveServerTestCase):<commit_msg>Invalid variable name access_keys, fixed<commit_after>from django.test import LiveServerTestCase
from django.utils import unittest
import adagios.settings
import adagios.utils
import os

try:
    from selenium import webdriver
except ImportError:
    webdriver = None

def get_remote_webdriver(capabilities=None):
    """Get remote webdriver. Configured using environment variables
    to setup where the remote webdriver is. options could be a local
    install or using the setup at saucelabs"""

    if not capabilities:
        capabilities = webdriver.DesiredCapabilities.FIREFOX

    # Saucelabs setup,
    capabilities["build"] = os.environ.get("TRAVIS_BUILD_NUMBER")
    capabilities["tags"] = [os.environ.get("TRAVIS_PYTHON_VERSION"), "CI"]
    capabilities["tunnel-identifier"] = os.environ.get("TRAVIS_JOB_NUMBER")

    username = os.environ.get("SAUCE_USERNAME")
    access_key = os.environ.get("SAUCE_ACCESS_KEY")
    hub_url = os.environ.get('SAUCE_HUBURL', "ondemand.saucelabs.com/wd/hub")

    if username and access_key:
        hub_url = "%s:%s@%s" % (username, access_key, hub_url)

    return webdriver.Remote(desired_capabilities=capabilities,
                            command_executor="http://%s" % hub_url)

class SeleniumTestCase(LiveServerTestCase):
{'fraction_non_alphanumeric': 0.0992879746835443, 'fraction_numerical': 0.0, 'mean_word_length': 4.257796257796258, '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': '3793662', 'n_tokens_mistral': 776, 'n_tokens_neox': 783, 'n_words': 177}