<commit_before>/**
 * ie userdata adaptor 
 *
 */
Lawnchair.adapter('ie-userdata', {
  valid: function () {
    return typeof(document.body.addBehavior) != 'undefined';
  },
	init:function(){
		var s = document.createElement('span');
		s.style.behavior = 'url(\'#default#userData\')';
		s.style.position = 'absolute';
		s.style.left = 10000;
		document.body.appendChild(s);
		this.storage = s;
		this.storage.load('lawnchair');
	},

	get:function(key, callback){
		
		var obj = JSON.parse(this.storage.getAttribute(key) || 'null');
	        if (obj) {
	            obj.key = key;
	            
	        }
			if (callback)
	                callback(obj);
	},

	save:function(obj, callback){
		var id = obj.key || 'lc' + this.uuid();
	        delete obj.key;		
		this.storage.setAttribute(id, JSON.stringify(obj));
		this.storage.save('lawnchair');		
		if (callback){
			obj.key = id;
			callback(obj);
			}
	},

	all:function(callback){
		var ca = this.storage.XMLDocument.firstChild.attributes;
		var yar = [];
		var v,o;
		// yo ho yo ho a pirates life for me
		for (var i = 0, l = ca.length; i < l; i++) {
			v = ca[i];
			o = JSON.parse(v.nodeValue || 'null');
			if (o) {
				o.key = v.nodeName;
				yar.push(o);
			}
		}
		if (callback)
			callback(yar);
	},
	remove:function(keyOrObj,callback) {
		var key = (typeof keyOrObj == 'string') ?  keyOrObj : keyOrObj.key;		
		this.storage.removeAttribute(key);
		this.storage.save('lawnchair');
		if(callback)
		  callback();
	}, 
	nuke:function(callback) {
		var that = this;		  
		this.all(function(r){
			for (var i = 0, l = r.length; i < l; i++) {
				if (r[i].key)
					that.remove(r[i].key);
			}
			if(callback) 
				callback();
		});
	}
});
<commit_msg>Updates for IE userdata adapter.<commit_after>/**
 * ie userdata adaptor 
 *
 */
Lawnchair.adapter('ie-userdata', {

	valid: function () {
		return typeof(document.body.addBehavior) != 'undefined';
	},

	init:function(options, callback){
		var s = document.createElement('span');
		s.style.behavior = 'url(\'#default#userData\')';
		s.style.position = 'absolute';
		s.style.left = 10000;
		document.body.appendChild(s);
		this.storage = s;
		this.storage.load('lawnchair');
		this.fn(this.name, callback).call(this, this)
	},

	get:function(key, callback){
		
		var obj = JSON.parse(this.storage.getAttribute(key) || 'null');
		if (obj) {
			obj.key = key;
		}
		if (callback) this.lambda(callback).call(this, obj)
		return this;
	},

	save:function(obj, callback){
		var id = obj.key || 'lc' + this.uuid();
	        delete obj.key;		
		this.storage.setAttribute(id, JSON.stringify(obj));
		this.storage.save('lawnchair');		
		obj.key = id;
		if (callback) {
			this.lambda(callback).call(this, obj)
		}
		return this;
	},

	all:function(callback){
		var ca = this.storage.XMLDocument.firstChild.attributes;
		var yar = [];
		var v,o;
		// yo ho yo ho a pirates life for me
		for (var i = 0, l = ca.length; i < l; i++) {
			v = ca[i];
			o = JSON.parse(v.nodeValue || 'null');
			if (o) {
				o.key = v.nodeName;
				yar.push(o);
			}
		}
		if (callback) this.fn(this.name, callback).call(this, yar)
		return this;
	},

	remove:function(keyOrObj,callback) {
		var key = (typeof keyOrObj == 'string') ?  keyOrObj : keyOrObj.key;		
		this.storage.removeAttribute(key);
		this.storage.save('lawnchair');
		if (callback) this.lambda(callback).call(this)
		return this;
	}, 

	nuke:function(callback) {
		var that = this;		  
		this.all(function(r){
			for (var i = 0, l = r.length; i < l; i++) {
				if (r[i].key)
					that.remove(r[i].key);
			}
			if (callback) that.lambda(callback).call(that)
		});
		return this;
	}
});

{'fraction_non_alphanumeric': 0.1800660792951542, 'fraction_numerical': 0.003854625550660793, 'mean_word_length': 2.9879253567508233, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3800481', 'n_tokens_mistral': 1524, 'n_tokens_neox': 1339, 'n_words': 272}