<commit_before># -*- coding: utf-8 -*-
from django.utils.html import escape

from sentry.models import Activity, User, Event


ICON = 'https://s3.amazonaws.com/f.cl.ly/items/0X2q0W011B1i1m2D140m/sentry-icon.png'
ICON2X = 'https://s3.amazonaws.com/f.cl.ly/items/0X2q0W011B1i1m2D140m/sentry-icon.png'
ICON_SM = 'https://beta.getsentry.com/_static/sentry/images/favicon.ico'

COLORS = {
    'ALERT': 'red',
    'ERROR': 'red',
    'WARNING': 'yellow',
    'INFO': 'green',
    'DEBUG': 'purple',
}


def _format_user(user):
    if user is None:
        name = 'system'
    elif user.first_name:
        name = user.first_name
    else:
        parts = user.username.split('@')
        if len(parts) == 1:
            name = user.username
        else:
            name = parts[0].lower()
    return '<em>%s</em>' % escape(name)


def _make_event_card(group, event, title=None, subtitle=None,
                     event_target=False, new=False, description=None,
                     compact=False):
    project = event.project
    link = group.get_absolute_url()
    if event_target:
        link = '%s/events/%s/' % (
            link.rstrip('/'),
            event.id
        )

    event_title = '%sSentry %s Issue' % (
        new and 'New ' or '',<commit_msg>first_name => name<commit_after># -*- coding: utf-8 -*-
from django.utils.html import escape

from sentry.models import Activity, User, Event


ICON = 'https://s3.amazonaws.com/f.cl.ly/items/0X2q0W011B1i1m2D140m/sentry-icon.png'
ICON2X = 'https://s3.amazonaws.com/f.cl.ly/items/0X2q0W011B1i1m2D140m/sentry-icon.png'
ICON_SM = 'https://beta.getsentry.com/_static/sentry/images/favicon.ico'

COLORS = {
    'ALERT': 'red',
    'ERROR': 'red',
    'WARNING': 'yellow',
    'INFO': 'green',
    'DEBUG': 'purple',
}


def _format_user(user):
    if user is None:
        name = 'system'
    elif user.name:
        name = user.name
    else:
        parts = user.username.split('@')
        if len(parts) == 1:
            name = user.username
        else:
            name = parts[0].lower()
    return '<em>%s</em>' % escape(name)


def _make_event_card(group, event, title=None, subtitle=None,
                     event_target=False, new=False, description=None,
                     compact=False):
    project = event.project
    link = group.get_absolute_url()
    if event_target:
        link = '%s/events/%s/' % (
            link.rstrip('/'),
            event.id
        )

    event_title = '%sSentry %s Issue' % (
        new and 'New ' or '',
{'fraction_non_alphanumeric': 0.1550695825049702, 'fraction_numerical': 0.02385685884691849, 'mean_word_length': 2.3061760840998686, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 6, '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': '3071259', 'n_tokens_mistral': 915, 'n_tokens_neox': 886, 'n_words': 167}