<commit_before>$(function () {
  function show_message(text, alert_class) {
    $("#message").empty();
    $("#message").append($("<div class='alert alert-" + (alert_class || "success") + "'><button type='button' class='close' data-dismiss='alert'>×</button>" + text + "</div>"));
    $(".alert").alert();
  }

  $("#signin_form").submit(function (e) {
    e.preventDefault();
    $(".alert").alert("close");
    var username = $("input[name=username]").val();
    var password = $("input[name=password]").val();
    var url = "/signin?email=" + username + "&password=" + password;
    $.post(url, {}, function (data) {
      if (data.status == "error") {
        show_message(data.message, "error");
        $("input[name=password]").val("");
        $("input[name=password_confirmation]").val("");
        $("input[name=password]").focus();
      } else {
        $.cookie("admin", data.session["@admin"], { expires: 1 });
        $.cookie("authToken", data.session["@authToken"], { expires: 1 });
        $.cookie("username", username, { expires: 1 });
        window.location.href = "widgets.html"
      }
    });
  });

  $("#signup_form").submit(function (e) {
    e.preventDefault();
    $(".alert").alert("close");

    var error = false;
    $.each($("#signup_form input.required"), function (index, object) {
      if ($(object).val() == "") {
        error = true;
        $(object).addClass("error");
      }
    });

    if (error) return;

    var password = $("input[name=password]").val();
    var password_confirmation = $("input[name=password_confirmation]").val();

    if (password != password_confirmation) {
      show_message("Passwords do not match", "error");
      $("input[name=password_confirmation]").val("");
      $("input[name=password_confirmation]").focus();
      return
    }

    var username = $("input[name=username]").val();
    var password = $("input[name=password]").val();
    var firstname = $("input[name=firstname]").val();
    var lastname = $("input[name=lastname]").val();
    url = "/signup?email=" + username + "&password=" + password + "&firstname=" + firstname + "&lastname=" + lastname;
    $.post(url, {}, function (data) {
      if (data.status == "error") {<commit_msg>#0 fixing decleration of a variable.<commit_after>$(function () {
  function show_message(text, alert_class) {
    $("#message").empty();
    $("#message").append($("<div class='alert alert-" + (alert_class || "success") + "'><button type='button' class='close' data-dismiss='alert'>×</button>" + text + "</div>"));
    $(".alert").alert();
  }

  $("#signin_form").submit(function (e) {
    e.preventDefault();
    $(".alert").alert("close");
    var username = $("input[name=username]").val();
    var password = $("input[name=password]").val();
    var url = "/signin?email=" + username + "&password=" + password;
    $.post(url, {}, function (data) {
      if (data.status == "error") {
        show_message(data.message, "error");
        $("input[name=password]").val("");
        $("input[name=password_confirmation]").val("");
        $("input[name=password]").focus();
      } else {
        $.cookie("admin", data.session["@admin"], { expires: 1 });
        $.cookie("authToken", data.session["@authToken"], { expires: 1 });
        $.cookie("username", username, { expires: 1 });
        window.location.href = "widgets.html"; // /admin/widgets.html
      }
    });
  });

  $("#signup_form").submit(function (e) {
    e.preventDefault();
    $(".alert").alert("close");

    var error = false;
    $.each($("#signup_form input.required"), function (index, object) {
      if ($(object).val() == "") {
        error = true;
        $(object).addClass("error");
      }
    });

    if (error) return;

    var password = $("input[name=password]").val();
    var password_confirmation = $("input[name=password_confirmation]").val();

    if (password != password_confirmation) {
      show_message("Passwords do not match", "error");
      $("input[name=password_confirmation]").val("");
      $("input[name=password_confirmation]").focus();
      return
    }

    var username = $("input[name=username]").val();
    var password = $("input[name=password]").val();
    var firstname = $("input[name=firstname]").val();
    var lastname = $("input[name=lastname]").val();
    var url = "/signup?email=" + username + "&password=" + password + "&firstname=" + firstname + "&lastname=" + lastname;
    $.post(url, {}, function (data) {
      if (data.status == "error") {
{'fraction_non_alphanumeric': 0.23218645948945615, 'fraction_numerical': 0.0015538290788013318, 'mean_word_length': 3.5014985014985016, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '6939396', 'n_tokens_mistral': 1400, 'n_tokens_neox': 1381, 'n_words': 253}