<commit_before>def go(browser, direction)
  output(direction)
  browser.send_keys "{#{direction.upcase}}"
end
def output(direction)
  puts ">#{direction}"
end
def pacmans(browser)
  browser.div(:id => "pcm-li").divs.size
end
def pacman_visible?(browser)
  pacman_html(browser) !~ /LEFT: -62px/
end
def pacman_vertical_position(browser) # 8-top, 120-bottom
  pacman_html(browser).split("TOP: ")[1].split("px")[0].to_i
end
def pacman_horizontal_position(browser) # 8-left, 448-right
  pacman_html(browser).split("LEFT: ")[1].split("px")[0].to_i
end
def pacman_html(browser)
  browser.div(:id => "actor0").html
end
def score(browser)
  score = []
  for position in 0..9
    score << digit(browser, position)
  end
  score
end
def digit(browser, position)
  if digit_visible?(browser, position)
  px = digit_html(browser, position).split("LEFT: -")[1].split("px")[0]
  (px.to_i - 12)/10
  else
    nil
  end
end
def digit_visible?(browser, position)
  digit_html(browser, position) !~ /TOP: -2px/
end
def digit_html(browser, position)<commit_msg>bug: html is now downcase<commit_after>def go(browser, direction)
  output(direction)
  browser.send_keys "{#{direction.upcase}}"
end
def output(direction)
  puts ">#{direction}"
end
def pacmans(browser)
  browser.div(:id => "pcm-li").divs.size
end
def pacman_visible?(browser)
  pacman_html(browser) !~ /LEFT: -62px/
end
def pacman_vertical_position(browser) # 8-top, 120-bottom
  pacman_html(browser).split("top: ")[1].split("px")[0].to_i
end
def pacman_horizontal_position(browser) # 8-left, 448-right
  pacman_html(browser).split("left: ")[1].split("px")[0].to_i
end
def pacman_html(browser)
  browser.div(:id => "actor0").html
end
def score(browser)
  score = []
  for position in 0..9
    score << digit(browser, position)
  end
  score
end
def digit(browser, position)
  if digit_visible?(browser, position)
  px = digit_html(browser, position).split("LEFT: -")[1].split("px")[0]
  (px.to_i - 12)/10
  else
    nil
  end
end
def digit_visible?(browser, position)
  digit_html(browser, position) !~ /TOP: -2px/
end
def digit_html(browser, position)
{'fraction_non_alphanumeric': 0.16078244274809161, 'fraction_numerical': 0.022900763358778626, 'mean_word_length': 5.149560117302053, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '5542884', 'n_tokens_mistral': 787, 'n_tokens_neox': 769, 'n_words': 167}