<commit_before>#pylint: disable=C0111
#pylint: disable=W0621

from lettuce import world, step
from nose.tools import assert_false, assert_equal, assert_regexp_matches  # pylint: disable=E0611
from common import type_in_codemirror, press_the_notification_button

KEY_CSS = '.key input.policy-key'
VALUE_CSS = 'textarea.json'
DISPLAY_NAME_KEY = "display_name"
DISPLAY_NAME_VALUE = '"Robot Super Course"'


@step('I select the Advanced Settings$')
def i_select_advanced_settings(step):
    world.click_course_settings()
    link_css = 'li.nav-course-settings-advanced a'
    world.css_click(link_css)
    world.wait_for_requirejs(
        ["jquery", "js/models/course", "js/models/settings/advanced",
         "js/views/settings/advanced", "codemirror"])
    # this shouldn't be necessary, but we experience sporadic failures otherwise
    world.wait(1)<commit_msg>Fix for advanced settings failure<commit_after>#pylint: disable=C0111
#pylint: disable=W0621

from lettuce import world, step
from nose.tools import assert_false, assert_equal, assert_regexp_matches  # pylint: disable=E0611
from common import type_in_codemirror, press_the_notification_button

KEY_CSS = '.key input.policy-key'
VALUE_CSS = 'textarea.json'
DISPLAY_NAME_KEY = "display_name"
DISPLAY_NAME_VALUE = '"Robot Super Course"'


@step('I select the Advanced Settings$')
def i_select_advanced_settings(step):

    world.click_course_settings()

    # The click handlers are set up so that if you click <body>
    # the menu disappears.  This means that if we're even a *little*
    # bit off on the last item ('Advanced Settings'), the menu
    # will close and the test will fail.
    # For this reason, we retrieve the link and visit it directly
    # This is what the browser *should* be doing, since it's just a native
    # link with no JavaScript involved.
    link_css = 'li.nav-course-settings-advanced a'
    world.wait_for_visible(link_css)
    link = world.css_find(link_css).first['href']
    world.visit(link)
{'fraction_non_alphanumeric': 0.09246231155778895, 'fraction_numerical': 0.01256281407035176, 'mean_word_length': 4.80466472303207, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '2765580', 'n_tokens_mistral': 651, 'n_tokens_neox': 613, 'n_words': 182}