def _send_email(self, confirmation_profile, url,
                    subject, text_template, html_template,
                    send_to, **kwargs):
        current_site = Site.objects.get_current()
        email_kwargs = {'activation_key': confirmation_profile.activation_key,
                        'domain': current_site.domain,
                        'activate_url': url,
                        'login_url': reverse('users.login'),
                        'reg': 'main'}
        email_kwargs.update(kwargs)

        # RegistrationProfile doesn't have a locale attribute. So if
        # we get one of those, then we have to get the real profile
        # from the user.
        if hasattr(confirmation_profile, 'locale'):
            locale = confirmation_profile.locale
        else:
            locale = confirmation_profile.user.profile.locale

        @email_utils.safe_translation
        def _make_mail(locale):
            mail = email_utils.make_mail(
                subject=subject,
                text_template=text_template,
                html_template=html_template,
                context_vars=email_kwargs,
                from_email=settings.DEFAULT_FROM_EMAIL,
                to_email=send_to)

            return mail

        email_utils.send_messages([_make_mail(locale)])
Check nova-instance-instance-xxx exists
dataset/ETHPy150Open mozilla/kitsune/kitsune/users/models.py/ConfirmationManager._send_email--crossover with--dataset/ETHPy150Open nii-cloud/dodai-compute/nova/virt/libvirt/firewall.py/FirewallDriver.instance_filter_exists