<commit_before>import logging
import urllib2

import pyramid_airbrake

log = logging.getLogger(__name__)

AIRBRAKE_URL_TMPL = '{scheme}://hoptoadapp.com/notifier_api/v2/notices'

def submit_payload(settings, payload, timeout=5):
    """
    Send an XML notification to Airbrake.

    The setting `airbrake.use_ssl` controls whether an SSL connection is
    attempted and defaults to True.

    The setting `airbrake.notification_url`

    """
    headers = {'Content-Type': 'text/xml'}

    notification_url = settings.get('notification_url', None)

    if notification_url:
        use_ssl = notification_url.startswith('https://')
    else:
        use_ssl = settings.get('use_ssl', True)
        scheme = 'https' if use_ssl else 'http'<commit_msg>Add a warning about not yet verifying SSL certs.<commit_after>import logging
import urllib2

import pyramid_airbrake

log = logging.getLogger(__name__)

AIRBRAKE_URL_TMPL = '{scheme}://hoptoadapp.com/notifier_api/v2/notices'

# XXX oh my goodness, urllib2 does not verify certificates, nor does it provide
# an easy way to do so
# SSL is useless until a work-around is implemented.

def submit_payload(settings, payload, timeout=5):
    """
    Send an XML notification to Airbrake.

    The setting `airbrake.use_ssl` controls whether an SSL connection is
    attempted and defaults to True.

    The setting `airbrake.notification_url`

    """
    headers = {'Content-Type': 'text/xml'}

    notification_url = settings.get('notification_url', None)

    if notification_url:
        use_ssl = notification_url.startswith('https://')
    else:
        use_ssl = settings.get('use_ssl', True)
        scheme = 'https' if use_ssl else 'http'
{'fraction_non_alphanumeric': 0.09810874704491726, 'fraction_numerical': 0.004137115839243499, 'mean_word_length': 3.769014084507042, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '2252807', 'n_tokens_mistral': 530, 'n_tokens_neox': 515, 'n_words': 148}