<commit_before>from __future__ import print_function
from __future__ import unicode_literals
from rtmbot.core import Plugin
import json
import re
import requests
import time
import pyrebase
import os
from secrets import secrets

firebaseConfig = secrets["firebase"]

fire = pyrebase.initialize_app(firebaseConfig)


class KnockKnock(Plugin):
  
    def process_message(self, msg):
      text = msg.get("text", "")
      channel = msg.get("channel", "")
      match = re.findall(r"!knockknock( .*)?", text)
      if not match:
        return
      query = text.split(" ", 1)
      eventName = query[1]
      #users = self.getUsers()
      self.distribute(channel, eventName)
      self.output(channel, "Done!")

    def distribute(self, users, eventName):
      # for n in users:
      #   self.sendMessage(n, eventName)
      self.sendMessage(users, eventName)

    def getUsers(self):
      db = fire.database()
      userList = []
      user = db.child("users").get()
      for n in user.each():
        try:
          dmInfo = n.val()["dmIM"]
          userList.append(dmInfo)
        except Exception as e:
          pass
      #return userList

    def sendMessage(self, channel, eventName):
      message = "Hi, the " + eventName + " is coming up soon!"
      as_user = True
      attachments = [{'text': 'Will you be able to attend?', 'callback_id': 'knockknock~' + eventName, 'color': '#36a64f', 'actions': [{'name': 'Yes', 'text': 'Yes', 'type': 'button', 'value': 'Yes', 'style': 'primary'}, {'name': 'No', 'text': 'No', 'type': 'button', 'value': 'No', 'style': 'danger'}, {'name': 'Maybe', 'text': 'Maybe', 'type': 'button', 'value': 'Maybe'}]}]
      result = self.slack_client.api_call("chat.postMessage", channel=channel, text=message, as_user=as_user, attachments=json.dumps(attachments))

    def output(self, channel, message):
      self.outputs.append([channel, message])
      return<commit_msg>few test changes<commit_after>from __future__ import print_function
from __future__ import unicode_literals
from rtmbot.core import Plugin
import json
import re
import requests
import time
import pyrebase
import os
from secrets import secrets

firebaseConfig = secrets["firebase"]

fire = pyrebase.initialize_app(firebaseConfig)


class KnockKnock(Plugin):
  
    def process_message(self, msg):
      text = msg.get("text", "")
      channel = msg.get("channel", "")
      match = re.findall(r"!knockknock( .*)?", text)
      if not match:
        return
      query = text.split(" ", 1)
      eventName = query[1]
      #users = self.getUsers()
      #self.distribute(users, eventName)
      self.distribute(channel, eventName)
      self.output(channel, "Done!")

    def distribute(self, users, eventName):
      # for n in users:
      #   self.sendMessage(n, eventName)
      self.sendMessage(users, eventName)

    def getUsers(self):
      db = fire.database()
      userList = []
      user = db.child("users").get()
      for n in user.each():
        try:
          dmInfo = n.val()["dmIM"]
          userList.append(dmInfo)
        except Exception as e:
          pass
      return userList

    def sendMessage(self, channel, eventName):
      message = "Hi, the " + eventName + " is coming up soon!"
      as_user = True
      attachments = [{'text': 'Will you be able to attend?', 'callback_id': 'knockknock~' + eventName, 'color': '#36a64f', 'actions': [{'name': 'Yes', 'text': 'Yes', 'type': 'button', 'value': 'Yes', 'style': 'primary'}, {'name': 'No', 'text': 'No', 'type': 'button', 'value': 'No', 'style': 'danger'}, {'name': 'Maybe', 'text': 'Maybe', 'type': 'button', 'value': 'Maybe'}]}]
      result = self.slack_client.api_call("chat.postMessage", channel=channel, text=message, as_user=as_user, attachments=json.dumps(attachments))

    def output(self, channel, message):
      self.outputs.append([channel, message])
      return
{'fraction_non_alphanumeric': 0.15483870967741936, 'fraction_numerical': 0.003096774193548387, 'mean_word_length': 3.364864864864865, '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': '7221341', 'n_tokens_mistral': 1232, 'n_tokens_neox': 1190, 'n_words': 327}