<commit_before>class Hackbot::Dispatcher
  CONVERSATION_TYPES = [
    Hackbot::Conversations::Attendance,
    Hackbot::Conversations::Mention
  ].freeze

  def handle(event, slack_team)
    wranglers = convos_needing_handling(event)

    return wranglers.each { |w| w.handle(event); w.save! } unless wranglers.empty?

    to_create = CONVERSATION_TYPES.select { |c| c.should_start? event }
    created = to_create.map { |c| c.new(team: slack_team) }

    created.map { |c| c.handle(event); c.save! }
  end

  protected

  def convos_needing_handling(event)
    Hackbot::Conversation.where.not(state: :finish)
                         .select { |c| c.part_of_convo? event }
  end
end<commit_msg>Fix formatting of Hackbot::Dispatcher<commit_after>module Hackbot
  class Dispatcher
    CONVERSATION_TYPES = [
      Hackbot::Conversations::Attendance,
      Hackbot::Conversations::Mention
    ].freeze

    def handle(event, slack_team)
      wranglers = convos_needing_handling(event)

      return wranglers.each { |w| run_convo(w, event) } unless wranglers.empty?

      to_create = CONVERSATION_TYPES.select { |c| c.should_start? event }
      created = to_create.map { |c| c.new(team: slack_team) }

      created.each { |c| run_convo(c, event) }
    end

    private

    def run_convo(convo, event)
      convo.handle(event)
      convo.save!
    end

    def convos_needing_handling(event)
      Hackbot::Conversation.where.not(state: :finish)
                           .select { |c| c.part_of_convo? event }
    end
  end
end
{'fraction_non_alphanumeric': 0.10966057441253264, 'fraction_numerical': 0.0, 'mean_word_length': 3.1432432432432433, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1985324', 'n_tokens_mistral': 559, 'n_tokens_neox': 531, 'n_words': 99}