<commit_before># Helpers for browser junk
module IntegrationHelper
  def t(string, options={})
    I18n.t(string, options={})
  end
  
  def sign_in(user)
    post user_session_path \
      'user[email]' => user.email,
      'user[password]' => user.password
  end

  def choose_line(line)
    post lines_path, params: { line: line.to_s }
  end

  def log_in_as(user, line = 'DC')
    log_in user
    select_line line
  end

  def log_in(user)
    visit root_path
    fill_in 'Email', with: user.email
    fill_in 'Password', with: <PASSWORD>
    click_button 'Sign in with password'
  end

  def select_line(line = 'DC')
    wait_for_element line
    choose line
    click_button 'Get started'
  end

  def wait_for_element(text)
    has_content? text
  end

  def wait_for_no_element(text)
    has_no_content? text
  end

  def wait_for_css(selector)
    has_css? selector
  end

  def wait_for_no_css(selector)
    has_no_css? selector
  end

  def sign_out
    click_link @user.name
    click_link 'Sign Out'
  end

  def log_out
    sign_out
  end

  def wait_for_ajax
    Timeout.timeout(Capybara.default_max_wait_time) do
      loop until _finished_all_ajax_requests?
    end
  end

  def _finished_all_ajax_requests?
    page.evaluate_script('jQuery.active').zero?
  end

  def go_to_dashboard
    click_link "DARIA - #{FUND_FULL}"
  end

  def click_away_from_field
    find('nav').click
    wait_for_ajax
  end<commit_msg>username is a button now, not a link<commit_after># Helpers for browser junk
module IntegrationHelper
  def t(string, options={})
    I18n.t(string, options={})
  end
  
  def sign_in(user)
    post user_session_path \
      'user[email]' => user.email,
      'user[password]' => <PASSWORD>
  end

  def choose_line(line)
    post lines_path, params: { line: line.to_s }
  end

  def log_in_as(user, line = 'DC')
    log_in user
    select_line line
  end

  def log_in(user)
    visit root_path
    fill_in 'Email', with: user.email
    fill_in 'Password', with: <PASSWORD>
    click_button 'Sign in with password'
  end

  def select_line(line = 'DC')
    wait_for_element line
    choose line
    click_button 'Get started'
  end

  def wait_for_element(text)
    has_content? text
  end

  def wait_for_no_element(text)
    has_no_content? text
  end

  def wait_for_css(selector)
    has_css? selector
  end

  def wait_for_no_css(selector)
    has_no_css? selector
  end

  def sign_out
    click_button @user.name
    click_link 'Sign Out'
  end

  def log_out
    sign_out
  end

  def wait_for_ajax
    Timeout.timeout(Capybara.default_max_wait_time) do
      loop until _finished_all_ajax_requests?
    end
  end

  def _finished_all_ajax_requests?
    page.evaluate_script('jQuery.active').zero?
  end

  def go_to_dashboard
    click_link "DARIA - #{FUND_FULL}"
  end

  def click_away_from_field
    find('nav').click
    wait_for_ajax
  end
{'fraction_non_alphanumeric': 0.07830907830907831, 'fraction_numerical': 0.001386001386001386, 'mean_word_length': 3.1539568345323743, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 10, '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': '6244512', 'n_tokens_mistral': 1060, 'n_tokens_neox': 1021, 'n_words': 254}