<commit_before>/*
Mag.JS AddOns v0.1.7
(c) <NAME>
https://github.com/magnumjs/mag.js
*/
mag.addons = {};
// helper function for non proxy supported browser i.e. NOT firefox
// state.fom = mag.addons.binds(state)
mag.addons.binds = function(data, attachTo, callback) {
  var handler = function(e) {
    var val = e.target.type == 'checkbox' ? e.target.checked : e.target.value
    var name = e.target.name
    if (data[name] && data[name].type == 'fun' && typeof data[name] == 'function') {
        data[name](val)
    } else if(name) {
      //necessary ?
      if(data.name && data.name._text)
        data.name._text=val
      else 
        data[name]=val
    }
      
    if(typeof Object.observe !== 'undefined'){
      Object.observe(data, function(changes) {
        // update target with changes
        changes.forEach(function(change) {
          if (change.type == 'update' || change.type == 'add') {
              // update the related dom
            if (e.target.name == change.name)
                e.target.value = change.object[change.name]
          }
        })
      })
    }
    if (callback && typeof callback == 'function') callback()
  }
  var addThis = {}

  var events = ['_onclick', '_onchange', '_oninput']
  for (var k in events) addThis[events[k]] = handler<commit_msg>Update mag.addons.js<commit_after>/*
Mag.JS AddOns v0.1.7
(c) <NAME>
https://github.com/magnumjs/mag.js
*/
mag.addons = {};
// helper function for non proxy supported browser i.e. NOT firefox
// state.fom = mag.addons.binds(state)
mag.addons.binds = function(data, attachTo, callback) {
  var handler = function(e) {
    var val = e.target.type == 'checkbox' ? e.target.checked : e.target.value
    var name = e.target.name
    if (data[name] && data[name].type == 'fun' && typeof data[name] == 'function') {
        data[name](val)
    } else if(name) {
      //necessary ?
      if(data[name] && data[name]._text)
        data[name]._text=val
      else 
        data[name]=val
    }
      
    if(typeof Object.observe !== 'undefined'){
      Object.observe(data, function(changes) {
        // update target with changes
        changes.forEach(function(change) {
          if (change.type == 'update' || change.type == 'add') {
              // update the related dom
            if (e.target.name == change.name)
                e.target.value = change.object[change.name]
          }
        })
      })
    }
    if (callback && typeof callback == 'function') callback()
  }
  var addThis = {}

  var events = ['_onclick', '_onchange', '_oninput']
  for (var k in events) addThis[events[k]] = handler
{'fraction_non_alphanumeric': 0.15848042977743668, 'fraction_numerical': 0.0023023791250959325, 'mean_word_length': 2.3552123552123554, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '462846', 'n_tokens_mistral': 844, 'n_tokens_neox': 835, 'n_words': 192}