<commit_before>/* global window document console _ */

console.log('init underscore (remove me)', _);

window.time = 120;

(function windowMess(window) {
  'use strict';

  // Vars
  var DEBUG = true
    , audioContext = new window.AudioContext()
    , MIN_SAMPLES = 0  // will be initialized when AudioContext is created.
    , analyser
    , buflen = 1024
    , buf = new Float32Array( buflen )
    , noteStrings = ['C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'B']
    , BASE_URL = window.location.protocol + '//' + window.location.host
    , FULL_URL = window.location.href
    , ROOM_URL_ID = Number(window.location.hash.replace('#', ''))
    , ROOM_URL = BASE_URL + '/room.html#' + ROOM_URL_ID
    , ROOM_ROUTE = 'room.html'
    , WS_URL = 'ws://mkvd.net:9876'
    , userdataReadyEvent = new window.CustomEvent('userdata:ready')
    , section
    , log = function log() {

        if (DEBUG) {

          var fun = Function.prototype.bind.call(window.console.log, window.console);
          fun.apply(window.console, arguments);
        }
      }
    , isStudentOrTeacher = function isStudentOrTeacher() {

        window.sessionStorage.roomID = ROOM_URL_ID;
        if (ROOM_URL_ID === Number(window.sessionStorage.myRoomID)) {

          // can be set to 1 for production env
          //
          // if (window.NODE_ENV === "development") {

          if (document.querySelector('video')) {
            document.querySelector('video').volume = 0;
          }

          // }

          window.sessionStorage.userType = 'teacher';
        } else {


          // if (window.NODE_ENV === "development") {

          if (document.querySelector('video')) {
            document.querySelector('video').volume = 0;
          }

          // }

          window.sessionStorage.userType = 'student';
        }
      }
    , createRoom = function createRoom() {

        window.sessionStorage.myRoomID = Math.floor(Math.random() * 10000);
        window.location.href = BASE_URL + '/room.html#' + window.sessionStorage.myRoomID;
      }
    , isRoom = function isRoom() {

        if (FULL_URL.indexOf(ROOM_ROUTE) !== -1) {

          return true;
        }
      }
    , userdataIsReady = function userdataIsReady() {

        if (isRoom()) {

          window.dispatchEvent(userdataReadyEvent);
        }
      }
    , retrieveToken = function retrieveToken() {

        window.$.get('/token', function onResponse(token) {

          log('got token', token);<commit_msg>video<commit_after>/* global window document console _ */

console.log('init underscore (remove me)', _);

window.time = 120;

(function windowMess(window) {
  'use strict';

  // Vars
  var DEBUG = true
    , audioContext = new window.AudioContext()
    , MIN_SAMPLES = 0  // will be initialized when AudioContext is created.
    , analyser
    , buflen = 1024
    , buf = new Float32Array( buflen )
    , noteStrings = ['C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'B']
    , BASE_URL = window.location.protocol + '//' + window.location.host
    , FULL_URL = window.location.href
    , ROOM_URL_ID = Number(window.location.hash.replace('#', ''))
    , ROOM_URL = BASE_URL + '/room.html#' + ROOM_URL_ID
    , ROOM_ROUTE = 'room.html'
    , WS_URL = 'ws://mkvd.net:9876'
    , userdataReadyEvent = new window.CustomEvent('userdata:ready')
    , section
    , log = function log() {

        if (DEBUG) {

          var fun = Function.prototype.bind.call(window.console.log, window.console);
          fun.apply(window.console, arguments);
        }
      }
    , isStudentOrTeacher = function isStudentOrTeacher() {

        window.sessionStorage.roomID = ROOM_URL_ID;
        if (ROOM_URL_ID === Number(window.sessionStorage.myRoomID)) {

          // can be set to 1 for production env
          //
          // if (window.NODE_ENV === "development") {

          if (document.querySelector('video')) {
            document.querySelector('video').volume = 0;
          }

          // }

          window.sessionStorage.userType = 'teacher';
        } else {


          // if (window.NODE_ENV === "development") {

          // if (document.querySelector('video')) {
          //   document.querySelector('video').volume = 0;
          // }

          // }

          window.sessionStorage.userType = 'student';
        }
      }
    , createRoom = function createRoom() {

        window.sessionStorage.myRoomID = Math.floor(Math.random() * 10000);
        window.location.href = BASE_URL + '/room.html#' + window.sessionStorage.myRoomID;
      }
    , isRoom = function isRoom() {

        if (FULL_URL.indexOf(ROOM_ROUTE) !== -1) {

          return true;
        }
      }
    , userdataIsReady = function userdataIsReady() {

        if (isRoom()) {

          window.dispatchEvent(userdataReadyEvent);
        }
      }
    , retrieveToken = function retrieveToken() {

        window.$.get('/token', function onResponse(token) {

          log('got token', token);
{'fraction_non_alphanumeric': 0.14868394615230057, 'fraction_numerical': 0.009242515571629495, 'mean_word_length': 2.2116129032258063, 'pattern_counts': {'":': 0, '<': 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': '7124157', 'n_tokens_mistral': 1599, 'n_tokens_neox': 1518, 'n_words': 297}