<commit_before># Encoding: utf-8

class Formula < ChemistryKit::Formula::Base

attr_reader :driver

  def initialize(driver)
    @driver = driver
  end

  def visit(destination_url)
    if destination_url.include? 'http'
      url = destination_url
    else
      url = ENV['BASE_URL'] + destination_url
    end
    driver.get url unless current_url == url
  end

  def find(locator)
    driver.find_element(locator)
  end

  def type(locator, text)
    find(locator).send_keys text
  end

  def click_on(locator)
    if locator.is_a? Hash
      find(locator).click
    else
      locator.click
    end
  end

  def submit(locator)
    find(locator).submit
  end<commit_msg>Added a missing helper method<commit_after># Encoding: utf-8

class Formula < ChemistryKit::Formula::Base

attr_reader :driver

  def initialize(driver)
    @driver = driver
  end

  def current_url
    driver.current_url
  end

  def visit(destination_url)
    if destination_url.include? 'http'
      url = destination_url
    else
      url = ENV['BASE_URL'] + destination_url
    end
    driver.get url unless current_url == url
  end

  def find(locator)
    driver.find_element(locator)
  end

  def type(locator, text)
    find(locator).send_keys text
  end

  def click_on(locator)
    if locator.is_a? Hash
      find(locator).click
    else
      locator.click
    end
  end

  def submit(locator)
    find(locator).submit
  end
{'fraction_non_alphanumeric': 0.08002832861189801, 'fraction_numerical': 0.00141643059490085, 'mean_word_length': 2.957983193277311, 'pattern_counts': {'":': 0, '<': 5, '<?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': '218746', 'n_tokens_mistral': 482, 'n_tokens_neox': 466, 'n_words': 117}