<commit_before>Given /^I am in the project called "([^"]*)" the following comments:$/ do |project, table|
  Given %(I am in the project called "#{project}")

  @project = Project.find_by_name(project)

  table.hashes.collect{ |c| c[:conversation] }.uniq.each do |conversation|
    Factory(:conversation, :name => conversation, :project => @project) unless Conversation.find_by_name(conversation)
  end

  table.hashes.each do |hash|
    Factory(:comment,
      :body => hash[:body],
      :target => Conversation.find_by_name(hash[:conversation]),
      :project => @project
    )
  end
end

Given /^(\d+) comments are created in the project "([^"]*)"$/ do |count, project|
  @conversation = Factory(:simple_conversation, :project => Project.find_by_name(project))

  (1..count.to_i).each do
    Factory(:comment, :target => @conversation)
  end
end

Then /^I should see "([^"]*)" only once$/ do |text|
  all(:xpath,"//*[.='#{text}']").size.should == 1
end<commit_msg>remove duplicate step 'I should see * only once'<commit_after>Given /^I am in the project called "([^"]*)" the following comments:$/ do |project, table|
  Given %(I am in the project called "#{project}")

  @project = Project.find_by_name(project)

  table.hashes.collect{ |c| c[:conversation] }.uniq.each do |conversation|
    Factory(:conversation, :name => conversation, :project => @project) unless Conversation.find_by_name(conversation)
  end

  table.hashes.each do |hash|
    Factory(:comment,
      :body => hash[:body],
      :target => Conversation.find_by_name(hash[:conversation]),
      :project => @project
    )
  end
end

Given /^(\d+) comments are created in the project "([^"]*)"$/ do |count, project|
  @conversation = Factory(:simple_conversation, :project => Project.find_by_name(project))

  (1..count.to_i).each do
    Factory(:comment, :target => @conversation)
  end
end
{'fraction_non_alphanumeric': 0.16738197424892703, 'fraction_numerical': 0.001609442060085837, 'mean_word_length': 4.359195402298851, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '4142122', 'n_tokens_mistral': 618, 'n_tokens_neox': 595, 'n_words': 159}