<commit_before>import uuid

from django.conf import settings
from django.conf.urls.defaults import patterns, url
from django.contrib.auth import authenticate, login
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.core.exceptions import ImproperlyConfigured
from django.core.mail import EmailMessage
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import Context, loader
from django.utils.translation import ugettext as _

from organizations.backends.tokens import RegistrationTokenGenerator
from organizations.backends.forms import InvitationRegistrationForm


class InvitationBackend(object):
    """
    Defines the base functionality of an InvitationBackend
    """
    invitation_subject = 'organizations/invitation_subject.txt'
    invitation_body = 'organizations/invitation_body.html'
    reminder_subject = 'organizations/reminder_subject.txt'
    reminder_body = 'organizations/reminder_body.html'
    form_class = InvitationRegistrationForm

    def get_register_form(self, **kwargs):
        """
        Returns the form class to be used for registering based on an
        invitation
        """
        return self.form_class(**kwargs)

    def get_success_url(self):
        return reverse('organization_list')

    def get_urls(self):
        return patterns('',
            url(r'^(?P<user_id>[\d]+)-(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
                view=self.activate_view, name="invitations_register"),
        )
    backend_urls = get_urls

    def invite_by_email(self, email, sender=None, **kwargs):
        """
        Returns a User object filled with dummy data and not active, and sends
        an invitation email.
        """
        try:
            user = User.objects.get(email=email)<commit_msg>Remove superfluous method name<commit_after>import uuid

from django.conf import settings
from django.conf.urls.defaults import patterns, url
from django.contrib.auth import authenticate, login
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.core.exceptions import ImproperlyConfigured
from django.core.mail import EmailMessage
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import Context, loader
from django.utils.translation import ugettext as _

from organizations.backends.tokens import RegistrationTokenGenerator
from organizations.backends.forms import InvitationRegistrationForm


class InvitationBackend(object):
    """
    Defines the base functionality of an InvitationBackend
    """
    invitation_subject = 'organizations/invitation_subject.txt'
    invitation_body = 'organizations/invitation_body.html'
    reminder_subject = 'organizations/reminder_subject.txt'
    reminder_body = 'organizations/reminder_body.html'
    form_class = InvitationRegistrationForm

    def get_register_form(self, **kwargs):
        """
        Returns the form class to be used for registering based on an
        invitation
        """
        return self.form_class(**kwargs)

    def get_success_url(self):
        return reverse('organization_list')

    def get_urls(self):
        return patterns('',
            url(r'^(?P<user_id>[\d]+)-(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
                view=self.activate_view, name="invitations_register"),
        )

    def invite_by_email(self, email, sender=None, **kwargs):
        """
        Returns a User object filled with dummy data and not active, and sends
        an invitation email.
        """
        try:
            user = User.objects.get(email=email)
{'fraction_non_alphanumeric': 0.08818011257035648, 'fraction_numerical': 0.006968641114982578, 'mean_word_length': 3.7061790668348045, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5197133', 'n_tokens_mistral': 1033, 'n_tokens_neox': 1019, 'n_words': 266}