<commit_before>from django.conf import settings
from django.template import loader, Context, TemplateDoesNotExist
from livesettings import config_value

from socket import error as SocketError

import logging
log = logging.getLogger('satchmo_store.mail')

if "mailer" in settings.INSTALLED_APPS:
    from mailer import send_mail
else:
    from django.core.mail import send_mail

from django.core.mail import EmailMultiAlternatives

class NoRecipientsException(StandardError):
    pass

def send_store_mail_template_decorator(template_base):
    """
    This decorator sets the arguments ``template`` and ``template_html``
    when the decorated function is called.
    """
    def dec(func):
        def newfunc(*args, **kwargs):
            default_kwargs = {
                'template': '%s.txt' % template_base,
                'template_html': '%s.html' % template_base
            }
            default_kwargs.update(kwargs)
            return func(*args, **default_kwargs)
        return newfunc
    return dec

def send_store_mail(subject, context, template='', recipients_list=None,
                    format_subject=False, send_to_store=False,
                    template_html='', fail_silently=False):
    """
    :parameter: subject: A string.

    :parameter: format_subject: Determines whether the *subject* parameter
     is formatted. Only the %(shop_name)s specifier is supported now.

    :parameter: context: A dictionary to use when rendering the message body.
      This dictionary overwrites an internal dictionary which provides the key
      `shop_name`.

    :parameter: template: The path of the plain text template to use when
      rendering the message body.

    :parameter: template_html: The path of the HTML template to use when
      rendering the message body; this will only be used if the config
      ``SHOP.HTML_EMAIL`` is true.
    """
    from satchmo_store.shop.models import Config

    shop_config = Config.objects.get_current()<commit_msg>mail.send_store_mail: some docstring changes<commit_after>from django.conf import settings
from django.template import loader, Context, TemplateDoesNotExist
from livesettings import config_value

from socket import error as SocketError

import logging
log = logging.getLogger('satchmo_store.mail')

if "mailer" in settings.INSTALLED_APPS:
    from mailer import send_mail
else:
    from django.core.mail import send_mail

from django.core.mail import EmailMultiAlternatives

class NoRecipientsException(StandardError):
    pass

def send_store_mail_template_decorator(template_base):
    """
    This decorator sets the arguments ``template`` and ``template_html``
    when the decorated function is called.
    """
    def dec(func):
        def newfunc(*args, **kwargs):
            default_kwargs = {
                'template': '%s.txt' % template_base,
                'template_html': '%s.html' % template_base
            }
            default_kwargs.update(kwargs)
            return func(*args, **default_kwargs)
        return newfunc
    return dec

def send_store_mail(subject, context, template='', recipients_list=None,
                    format_subject=False, send_to_store=False,
                    template_html='', fail_silently=False):
    """
    :param subject: A string.

    :param format_subject: Determines whether the *subject* parameter is
      formatted. Only the %(shop_name)s specifier is supported now.

    :param context: A dictionary to use when rendering the message body. This
      overwrites an internal dictionary with a single entry, `shop_name`.

    :param template: The path of the plain text template to use when rendering
      the message body.

    :param template_html: The path of the HTML template to use when rendering
      the message body; this will only be used if the config ``SHOP.HTML_EMAIL``
      is true.
    """
    from satchmo_store.shop.models import Config

    shop_config = Config.objects.get_current()
{'fraction_non_alphanumeric': 0.07579585649317837, 'fraction_numerical': 0.0, 'mean_word_length': 3.225186766275347, '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': '5430805', 'n_tokens_mistral': 1069, 'n_tokens_neox': 1043, 'n_words': 359}