<commit_before> requirejs.config({
    baseUrl: "/js",
    paths: {
      "analytics": "/bower/webmaker-analytics/analytics",
      "jquery": "../bower/jquery/jquery.min",
      "webmaker-auth-client": "/bower/webmaker-auth-client/dist/webmaker-auth-client.min",
      "languages": "/bower/webmaker-language-picker/js/languages",
      "list": "/bower/listjs/dist/list.min",
      "fuzzySearch": "/bower/list.fuzzysearch.js/dist/list.fuzzysearch.min",
      "selectize": "../bower/selectize/dist/js/standalone/selectize.min",
      "text": "../bower/text/text"
    }
  });
  require([ "jquery", "languages", "webmaker-auth-client", "selectize" ], function ($, Languages, WebmakerAuthClient, Selectize) {
    var langSelector = document.querySelector('#lang-picker'),
        csrf_token = $( "meta[name='csrf-token']" ).attr( "content" );

    var webmakerAuthClient = new WebmakerAuthClient({
      csrfToken:csrf_token
    });

    //initialized language selectize -- used in signup for webmaker-auth-client
    $('#supportedLocales').selectize();

    // CRSF Protection
    $.ajaxSetup({
      beforeSend: function( request ) {
       request.setRequestHeader( "X-CSRF-Token", csrf_token ); // express.js uses a non-standard name for csrf-token
      }
    });

    var loginEl = $('.webmaker-login');
    var logoutEl = $('.webmaker-logout');

    function toggleUserData(userData) {
      var placeHolder = $('#identity');
      var userElement = $('div.user-name');
      var lang = $('html').attr('lang') || 'en-US';

      if (userData) {
        placeHolder.html('<img src="' + userData.avatar + '" alt="">' +
          '<a href="/' + lang + '/account">' + userData.username + "</a>");
      } else {
        userElement.html('<span id="identity"></span>');
      }
    }

    function onLogin( user ) {
      $('#webmaker-nav').addClass('loggedin');
      toggleUserData(user);
      loginEl.hide();
      logoutEl.show();

      $( "#logout-message" ).hide();
      $( ".wm-logged-out-panel" ).hide();
      $( ".wm-user-panel" ).fadeIn();
      $( ".wm-email" ).text( user.email );
      $( ".wm-page").html( '<a href="//' + user.username + "{{ profile }}" +'">' + user.username + "{{ profile }}" + '</a>');
      $( ".wm-username" ).text( user.username );
      $( "#user-avatar" ).css( "background-image", "url(https://secure.gravatar.com/avatar/" + user.emailHash + "?s=200&d=https%3A%2F%2Fstuff.webmaker.org%2Favatars%2Fwebmaker-avatar-200x200.png)" );

      $( "#sendEventCreationEmailsCheckbox" ).prop( "checked", user.sendEventCreationEmails );
      $( "#sendMentorRequestEmailsCheckbox" ).prop( "checked", user.sendMentorRequestEmails );
      $( "#sendCoorganizerRequestEmailsCheckbox" ).prop( "checked", user.sendCoorganizerRequestEmails );
    }

    function onLogout() {
      $('#webmaker-nav').removeClass('loggedin');
      toggleUserData();
      loginEl.show();
      logoutEl.hide();
      $( ".wm-user-panel" ).hide();
      $( ".wm-logged-out-panel" ).fadeIn();
      $( "#confirm-delete" ).hide();
    }

    webmakerAuthClient.on( "login", onLogin );
    webmakerAuthClient.on( "logout", onLogout );

    loginEl.click( webmakerAuthClient.login );
    logoutEl.click( webmakerAuthClient.logout );

    webmakerAuthClient.verify();

    $( "#delete-account" ).click(function( e ){
      e.preventDefault();
      $( "#confirm-delete" ).fadeIn();
    });
    $( "#delete-me" ).click(function( e ){
      if ( $( "#email-check" ).val() === $( ".wm-email" ).text() ) {
        $.post( "/account/delete", function( data ) {
          if ( !data.error ) {
            webmakerAuthClient.off( "logout", onLogout );
            webmakerAuthClient.on( "logout", function onDelete() {
              setTimeout(function() {
                window.location.href = "{{ WEBMAKERORG }}";
              }, 2000);
            });
            webmakerAuthClient.on( "error", function onError( error ) {
              webmakerAuthClient.off( "error", onError );
              webmakerAuthClient.off( "logout", onDelete );
              webmakerAuthClient.on( "logout", onLogout );
              alert( error );
            });
            webmakerAuthClient.logout();
          }
        });
      } else {
        $( "#wrong-email" ).fadeIn();
        setTimeout(function() {
          $( "#wrong-email" ).fadeOut();
        }, 3000);
      }
    });

    // The button to close the confirm-delete box
    $( "#boxclose" ).click(function() {
      $( "#confirm-delete" ).fadeOut();
    });

    $( "#sendEventCreationEmailsCheckbox" ).change(function(e) {
      var checked = $( this ).prop( "checked" ) ? true : false;

      $.ajax({<commit_msg>Link to ?userDel=1 to show account deleted notif<commit_after> requirejs.config({
    baseUrl: "/js",
    paths: {
      "analytics": "/bower/webmaker-analytics/analytics",
      "jquery": "../bower/jquery/jquery.min",
      "webmaker-auth-client": "/bower/webmaker-auth-client/dist/webmaker-auth-client.min",
      "languages": "/bower/webmaker-language-picker/js/languages",
      "list": "/bower/listjs/dist/list.min",
      "fuzzySearch": "/bower/list.fuzzysearch.js/dist/list.fuzzysearch.min",
      "selectize": "../bower/selectize/dist/js/standalone/selectize.min",
      "text": "../bower/text/text"
    }
  });
  require([ "jquery", "languages", "webmaker-auth-client", "selectize" ], function ($, Languages, WebmakerAuthClient, Selectize) {
    var langSelector = document.querySelector('#lang-picker'),
        csrf_token = $( "meta[name='csrf-token']" ).attr( "content" );

    var webmakerAuthClient = new WebmakerAuthClient({
      csrfToken:csrf_token
    });

    //initialized language selectize -- used in signup for webmaker-auth-client
    $('#supportedLocales').selectize();

    // CRSF Protection
    $.ajaxSetup({
      beforeSend: function( request ) {
       request.setRequestHeader( "X-CSRF-Token", csrf_token ); // express.js uses a non-standard name for csrf-token
      }
    });

    var loginEl = $('.webmaker-login');
    var logoutEl = $('.webmaker-logout');

    function toggleUserData(userData) {
      var placeHolder = $('#identity');
      var userElement = $('div.user-name');
      var lang = $('html').attr('lang') || 'en-US';

      if (userData) {
        placeHolder.html('<img src="' + userData.avatar + '" alt="">' +
          '<a href="/' + lang + '/account">' + userData.username + "</a>");
      } else {
        userElement.html('<span id="identity"></span>');
      }
    }

    function onLogin( user ) {
      $('#webmaker-nav').addClass('loggedin');
      toggleUserData(user);
      loginEl.hide();
      logoutEl.show();

      $( "#logout-message" ).hide();
      $( ".wm-logged-out-panel" ).hide();
      $( ".wm-user-panel" ).fadeIn();
      $( ".wm-email" ).text( user.email );
      $( ".wm-page").html( '<a href="//' + user.username + "{{ profile }}" +'">' + user.username + "{{ profile }}" + '</a>');
      $( ".wm-username" ).text( user.username );
      $( "#user-avatar" ).css( "background-image", "url(https://secure.gravatar.com/avatar/" + user.emailHash + "?s=200&d=https%3A%2F%2Fstuff.webmaker.org%2Favatars%2Fwebmaker-avatar-200x200.png)" );

      $( "#sendEventCreationEmailsCheckbox" ).prop( "checked", user.sendEventCreationEmails );
      $( "#sendMentorRequestEmailsCheckbox" ).prop( "checked", user.sendMentorRequestEmails );
      $( "#sendCoorganizerRequestEmailsCheckbox" ).prop( "checked", user.sendCoorganizerRequestEmails );
    }

    function onLogout() {
      $('#webmaker-nav').removeClass('loggedin');
      toggleUserData();
      loginEl.show();
      logoutEl.hide();
      $( ".wm-user-panel" ).hide();
      $( ".wm-logged-out-panel" ).fadeIn();
      $( "#confirm-delete" ).hide();
    }

    webmakerAuthClient.on( "login", onLogin );
    webmakerAuthClient.on( "logout", onLogout );

    loginEl.click( webmakerAuthClient.login );
    logoutEl.click( webmakerAuthClient.logout );

    webmakerAuthClient.verify();

    $( "#delete-account" ).click(function( e ){
      e.preventDefault();
      $( "#confirm-delete" ).fadeIn();
    });
    $( "#delete-me" ).click(function( e ){
      if ( $( "#email-check" ).val() === $( ".wm-email" ).text() ) {
        $.post( "/account/delete", function( data ) {
          if ( !data.error ) {
            webmakerAuthClient.off( "logout", onLogout );
            webmakerAuthClient.on( "logout", function onDelete() {
              setTimeout(function() {
                window.location.href = "{{ WEBMAKERORG }}?userDel=1";
              }, 2000);
            });
            webmakerAuthClient.on( "error", function onError( error ) {
              webmakerAuthClient.off( "error", onError );
              webmakerAuthClient.off( "logout", onDelete );
              webmakerAuthClient.on( "logout", onLogout );
              alert( error );
            });
            webmakerAuthClient.logout();
          }
        });
      } else {
        $( "#wrong-email" ).fadeIn();
        setTimeout(function() {
          $( "#wrong-email" ).fadeOut();
        }, 3000);
      }
    });

    // The button to close the confirm-delete box
    $( "#boxclose" ).click(function() {
      $( "#confirm-delete" ).fadeOut();
    });

    $( "#sendEventCreationEmailsCheckbox" ).change(function(e) {
      var checked = $( this ).prop( "checked" ) ? true : false;

      $.ajax({
{'fraction_non_alphanumeric': 0.1934520635597739, 'fraction_numerical': 0.004905620134371334, 'mean_word_length': 2.61526599845798, 'pattern_counts': {'":': 16, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 2, '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': '5296507', 'n_tokens_mistral': 3016, 'n_tokens_neox': 2985, 'n_words': 495}