<commit_before>class ExampleContent
  include Routing

  def self.add_to_group(group)
    example_content = self.new
    bot = example_content.helper_bot
    bot_membership = group.add_member! bot
    introduction_thread = example_content.introduction_thread(group)
    how_it_works_thread = example_content.how_it_works_thread(group)
    example_content.first_comment(how_it_works_thread, introduction_thread)
    first_proposal = example_content.first_proposal(how_it_works_thread)
    first_vote = example_content.first_vote(first_proposal)
    bot_membership.destroy
  end

  def helper_bot
    email = ENV['HELPER_BOT_EMAIL'] || '<EMAIL>'
    bot = User.find_by_email(email)
    unless bot
      bot = User.new
      bot.name = 'Loomio Helper Bot'
      bot.email = email
      bot.password = <PASSWORD>)
      bot.uses_markdown = true
      bot.avatar_kind = 'gravatar'
      bot.save!
    end
    bot
  end

  def introduction_thread_content(group)
    {
      title: I18n.t('introduction_thread.title', group_name: group.name),
      description: I18n.t('introduction_thread.description'),
      group: group,
      author: helper_bot,
      private: !!group.discussion_private_default,
      uses_markdown: true
    }
  end<commit_msg>Tidy up helper bot creation<commit_after>class ExampleContent
  include Routing

  def self.add_to_group(group)
    example_content = self.new
    bot = example_content.helper_bot
    bot_membership = group.add_member! bot
    introduction_thread = example_content.introduction_thread(group)
    how_it_works_thread = example_content.how_it_works_thread(group)
    example_content.first_comment(how_it_works_thread, introduction_thread)
    first_proposal = example_content.first_proposal(how_it_works_thread)
    first_vote = example_content.first_vote(first_proposal)
    bot_membership.destroy
  end

  def helper_bot
    email = ENV['HELPER_BOT_EMAIL'] || '<EMAIL>'
    bot = User.find_by(email: email) ||
          User.create!(email: email,
                       name: 'Loomio <NAME>',
                       password: <PASSWORD>(20),
                       uses_markdown: true,
                       avatar_kind: 'gravatar')
  end

  def introduction_thread_content(group)
    {
      title: I18n.t('introduction_thread.title', group_name: group.name),
      description: I18n.t('introduction_thread.description'),
      group: group,
      author: helper_bot,
      private: !!group.discussion_private_default,
      uses_markdown: true
    }
  end
{'fraction_non_alphanumeric': 0.08433253397282174, 'fraction_numerical': 0.003996802557953637, 'mean_word_length': 3.3682373472949387, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '4013073', 'n_tokens_mistral': 796, 'n_tokens_neox': 767, 'n_words': 134}