<commit_before>import logging
log = logging.getLogger(__name__)

import hmac
import hashlib
import json
import ircbot.plugin


class GithubPlugin(ircbot.plugin.Plugin):
	def __init__(self, bot, channel):
		super().__init__(bot, channel)
		self.secret = bot.config['github_secret'].encode('ascii')

	@ircbot.plugin.http_handler(method='POST', path='/github')
	def handle_github_hook(self, body, headers):
		event = headers['X-GitHub-Event']
		guid = headers['X-GitHub-Delivery']
		log.info('Received github event: %s - GUID: %s', event, guid)

		signature = headers['X-Hub-Signature']
		self.check_hmac(body, signature)

		data = json.loads(body)
		ret = None

		if event == 'issues':
			ret = self.handle_issue(data)
		elif event == 'pull_request':
			ret = self.handle_pr(data)
		elif event == 'push':
			ret = self.handle_push(data)
<commit_msg>add a debug log statement<commit_after>import logging
log = logging.getLogger(__name__)

import hmac
import hashlib
import json
import ircbot.plugin


class GithubPlugin(ircbot.plugin.Plugin):
	def __init__(self, bot, channel):
		super().__init__(bot, channel)
		self.secret = bot.config['github_secret'].encode('ascii')

	@ircbot.plugin.http_handler(method='POST', path='/github')
	def handle_github_hook(self, body, headers):
		event = headers['X-GitHub-Event']
		guid = headers['X-GitHub-Delivery']
		log.info('Received github event: %s - GUID: %s', event, guid)

		signature = headers['X-Hub-Signature']
		self.check_hmac(body, signature)

		data = json.loads(body)
		ret = None

		if event == 'issues':
			ret = self.handle_issue(data)
		elif event == 'pull_request':
			ret = self.handle_pr(data)
		elif event == 'push':
			ret = self.handle_push(data)

		log.info('Returning from Github hook: %s', ret)
{'fraction_non_alphanumeric': 0.14464692482915717, 'fraction_numerical': 0.0, 'mean_word_length': 4.817880794701987, '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': '3466636', 'n_tokens_mistral': 648, 'n_tokens_neox': 589, 'n_words': 136}