<commit_before>horizon.alert = function (type, message, extra_tags) {
  safe = false;
  // Check if the message is tagged as safe.
  if (typeof(extra_tags) !== "undefined" && $.inArray('safe', extra_tags.split(' ')) !== -1) {
    safe = true;
  }
  var template = horizon.templates.compiled_templates["#alert_message_template"],
    params = {
      "type": type,
      "type_display": {
        'danger': gettext("Danger: "),
        'warning': gettext("Warning: "),
        'info': gettext("Notice: "),
        'success': gettext("Success: "),
        'error': gettext("Error: ")
      }[type],
      "message": message,
      "safe": safe
    };
  return $(template.render(params)).hide().prependTo("#main_content .messages").fadeIn(100);
};

horizon.clearErrorMessages = function() {
  $('#main_content .messages .alert.alert-danger').remove();
};

horizon.clearSuccessMessages = function() {<commit_msg>Fix alert styling using "error" instead of "danger".<commit_after>horizon.alert = function (type, message, extra_tags) {
  safe = false;
  // Check if the message is tagged as safe.
  if (typeof(extra_tags) !== "undefined" && $.inArray('safe', extra_tags.split(' ')) !== -1) {
    safe = true;
  }

  var type_display = {
    'danger': gettext("Danger: "),
    'warning': gettext("Warning: "),
    'info': gettext("Notice: "),
    'success': gettext("Success: "),
    'error': gettext("Error: ")
  }[type];

  // the "error" type needs to be rewritten as "danger" for correct styling
  if (type === 'error') {
    type = 'danger';
  }

  var template = horizon.templates.compiled_templates["#alert_message_template"],
    params = {
      "type": type,
      "type_display": type_display,
      "message": message,
      "safe": safe
    };
  return $(template.render(params)).hide().prependTo("#main_content .messages").fadeIn(100);
};

horizon.clearErrorMessages = function() {
  $('#main_content .messages .alert.alert-danger').remove();
};

horizon.clearSuccessMessages = function() {
{'fraction_non_alphanumeric': 0.18336673346693386, 'fraction_numerical': 0.004008016032064128, 'mean_word_length': 3.6658878504672896, 'pattern_counts': {'":': 8, '<': 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': '3739417', 'n_tokens_mistral': 645, 'n_tokens_neox': 621, 'n_words': 137}