<commit_before># -*- coding: utf-8 -*-
"""
    flask.ext.email
    ~~~~~~~~~~~~~

    Flask extension for sending email.

"""
__version__ = '1.4.3'

"""
Tools for sending email.
"""

from flask import current_app as app
from .utils import import_module

# Imported for backwards compatibility, and for the sake
# of a cleaner namespace. These symbols used to be in
# django/core/mail.py before the introduction of email
# backends and the subsequent reorganization (See #10355)
from .utils import CachedDnsName, DNS_NAME
from .message import (
    EmailMessage, EmailMultiAlternatives,
    SafeMIMEText, SafeMIMEMultipart,
    DEFAULT_ATTACHMENT_MIME_TYPE, make_msgid,
    BadHeaderError, forbid_multi_line_headers)


def get_connection(backend=None, fail_silently=False, **kwargs):
    """
    Load an email backend and return an instance of it.

    If backend is None (default) EMAIL_BACKEND is used.

    Both fail_silently and other keyword arguments are used in the
    constructor of the backend.
    """
    path = backend or app.config.get('EMAIL_BACKEND', 'flask.ext.email.backends.locmem.Mail')
    try:
        mod_name, klass_name = path.rsplit('.', 1)
        mod = import_module(mod_name)
    except ImportError, e:
        raise Exception(('Error importing email backend module %s: "%s"'<commit_msg>Add shortcut imports<commit_after># -*- coding: utf-8 -*-
"""
    flask.ext.email
    ~~~~~~~~~~~~~

    Flask extension for sending email.

"""
__version__ = '1.4.3'

"""
Tools for sending email.
"""

from flask import current_app as app
from .utils import import_module

# Imported for backwards compatibility, and for the sake
# of a cleaner namespace. These symbols used to be in
# django/core/mail.py before the introduction of email
# backends and the subsequent reorganization (See #10355)
from .utils import CachedDnsName, DNS_NAME
from .message import (
    EmailMessage, EmailMultiAlternatives,
    SafeMIMEText, SafeMIMEMultipart,
    DEFAULT_ATTACHMENT_MIME_TYPE, make_msgid,
    BadHeaderError, forbid_multi_line_headers)
from .backends.console import Mail as ConsoleMail
from .backends.dummy import Mail as DummyMail
from .backends.filebased import Mail as FilebasedMail
from .backends.locmem import Mail as LocmemMail
from .backends.smtp import Mail as SMTPMail
from .backends.rest import Mail as RESTMail


def get_connection(backend=None, fail_silently=False, **kwargs):
    """
    Load an email backend and return an instance of it.

    If backend is None (default) EMAIL_BACKEND is used.

    Both fail_silently and other keyword arguments are used in the
    constructor of the backend.
    """
    path = backend or app.config.get('EMAIL_BACKEND', 'flask.ext.email.backends.locmem.Mail')
    try:
        mod_name, klass_name = path.rsplit('.', 1)
        mod = import_module(mod_name)
    except ImportError, e:
        raise Exception(('Error importing email backend module %s: "%s"'
{'fraction_non_alphanumeric': 0.09305508039685255, 'fraction_numerical': 0.006842285323297981, 'mean_word_length': 3.86522462562396, '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': '6308440', 'n_tokens_mistral': 889, 'n_tokens_neox': 859, 'n_words': 299}