<commit_before>from django.contrib.sites.models import Site
from django.core import urlresolvers
from django.conf import settings
from django.template.loader import get_template
from django.template import Context
from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponse, HttpResponseRedirect
from gather.models import Event
import requests
import logging
import json

logger = logging.getLogger(__name__)

def mailgun_send(mailgun_data):
	logger.debug("Mailgun send: %s" % mailgun_data)
	if settings.DEBUG:
		# When this is true you will see this message in the mailgun logs but
		# nothing will actually be delivered
		mailgun_data["o:testmode"] = "yes"
	resp = requests.post("https://api.mailgun.net/v2/%s/messages" % settings.LIST_DOMAIN,
		auth=("api", settings.MAILGUN_API_KEY),
		data=mailgun_data
	)
	logger.debug("Mailgun response: %s" % resp.text)
	return HttpResponse(status=200)

def new_event_notification(event, location):
	# notify the event admins
	admin_group = event.admin
	recipients = [admin.email for admin in admin_group.users.all()]
	event_short_title = event.title[0:50]
	if len(event.title) > 50:<commit_msg>missing import<commit_after>from django.contrib.sites.models import Site
from django.core import urlresolvers
from django.conf import settings
from django.template.loader import get_template
from django.template import Context
from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponse, HttpResponseRedirect
from gather.models import Event, EventAdminGroup, EventSeries
import requests
import logging
import json

logger = logging.getLogger(__name__)

def mailgun_send(mailgun_data):
	logger.debug("Mailgun send: %s" % mailgun_data)
	if settings.DEBUG:
		# When this is true you will see this message in the mailgun logs but
		# nothing will actually be delivered
		mailgun_data["o:testmode"] = "yes"
	resp = requests.post("https://api.mailgun.net/v2/%s/messages" % settings.LIST_DOMAIN,
		auth=("api", settings.MAILGUN_API_KEY),
		data=mailgun_data
	)
	logger.debug("Mailgun response: %s" % resp.text)
	return HttpResponse(status=200)

def new_event_notification(event, location):
	# notify the event admins
	admin_group = event.admin
	recipients = [admin.email for admin in admin_group.users.all()]
	event_short_title = event.title[0:50]
	if len(event.title) > 50:
{'fraction_non_alphanumeric': 0.09225560727888278, 'fraction_numerical': 0.00761743546339399, 'mean_word_length': 5.7542857142857144, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '4178417', 'n_tokens_mistral': 745, 'n_tokens_neox': 726, 'n_words': 206}