'Returns an instance of the form to be used in this view.'

def get_form(self, form_class):

    self.email_addresses = collections.OrderedDict()
    form = super(SignupView, self).get_form(form_class)
    form.fields['email'].label = _('Email    address')
    self.matching_user = None
    initial_username = form.initial.get('username', None)
    assert (self.sociallogin.account.provider == 'github')
    User = get_user_model()
    try:
        self.matching_user = User.objects.get(username=initial_username)
        del form.initial['username']
    except User.DoesNotExist:
        pass
    email = (self.sociallogin.account.extra_data.get('email') or None)
    email_data = (self.sociallogin.account.extra_data.get('email_addresses') or [])
    extra_email_addresses = []
    for data in email_data:
        try:
            validate_email(data['email'])
        except ValidationError:
            pass
        else:
            extra_email_addresses.append(data)
    if ((not extra_email_addresses) and (email is not None)):
        form.fields['email'].widget = forms.HiddenInput()
    else:
        for email_address in extra_email_addresses:
            self.email_addresses[email_address['email']] = email_address
        if ((email is not None) and (email not in self.email_addresses)):
            self.email_addresses[email] = {'email': email, 'verified': False, 'primary': False}
        choices = []
        verified_emails = []
        for email_data in self.email_addresses.values():
            email_address = email_data['email']
            if email_data['verified']:
                verified_emails.append(email_address)
            choices.append((email_address, email_address))
        if extra_email_addresses:
            choices.append((form.other_email_value, _('Other:')))
        else:
            choices.append((form.other_email_value, _('Email:')))
        email_select = forms.RadioSelect(choices=choices, attrs={'id': 'email'})
        form.fields['email'].widget = email_select
        if ((not email) and (len(verified_emails) == 1)):
            form.initial.update(email=verified_emails[0])
    return form
