<commit_before>module RequestHelpers
  def stub_oauth_edit
    # Stub out the posting of content to Wikipedia
    # First the request for edit tokens for a user
    fake_tokens = "{\"query\":{\"tokens\":{\"csrftoken\":\"faketoken+\\\\\"}}}"
    stub_request(:get, /.*wikipedia.*/)
      .to_return(status: 200, body: fake_tokens, headers: {})
    # Then the edit request itself
    stub_request(:post, /.*wikipedia.*/)
      .to_return(status: 200, body: 'success', headers: {})
  end
end<commit_msg>Fix spec<commit_after>module RequestHelpers
  def stub_oauth_edit
    # Stub out the posting of content to Wikipedia
    # First the request for edit tokens for a user
    fake_tokens = "{\"query\":{\"tokens\":{\"csrftoken\":\"faketoken+\\\\\"}}}"
    stub_request(:get, /.*wikipedia.*/)
      .to_return(status: 200, body: fake_tokens, headers: {})
    # Then the edit request itself
    success = '{"edit"=>
                {"result"=>"Success",
                 "pageid"=>11543696,
                 "title"=>"User:Ragesock",
                 "contentmodel"=>"wikitext",
                 "oldrevid"=>671572777,
                 "newrevid"=>674946741,
                 "newtimestamp"=>"2015-08-07T05:27:43Z"}}'
    stub_request(:post, /.*wikipedia.*/)
      .to_return(status: 200, body: success, headers: {})
  end
end
{'fraction_non_alphanumeric': 0.16515151515151516, 'fraction_numerical': 0.03939393939393939, 'mean_word_length': 2.689944134078212, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 11, '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': '4128673', 'n_tokens_mistral': 454, 'n_tokens_neox': 421, 'n_words': 97}