<commit_before>'use strict';

var d       = require('es5-ext/lib/Object/descriptor')
  , forEach = require('es5-ext/lib/Object/for-each')
  , memoize = require('memoizee/lib/regular')

  , defineProperty = Object.defineProperty
  , getItems;

getItems = exports.getItems = memoize(function (rel) {
	var items = {};
	rel.forEach(function self(value, i1, i2, i3, key) { items[key] = value; });
	defineProperty(items, 'ns', d(rel.__ns.__value));
	return items;
});

exports.getSets = function (rel, doSnapshot) {
	var points = [];
	if (!rel.obj.hasOwnProperty('_children_')) return points;
	rel.obj._children_.forEach(function self(child) {
		if (child.hasOwnProperty('_value')) return;
		if ((child.__multiple !== rel) &&
				child.__multiple.hasOwnProperty('_value')) {
			if (child.__multiple.__value) {
				points.push(child);
				if (doSnapshot) points.push(getItems(this));
			}
			return;
		}
		if (child.hasOwnProperty('_children_')) {
			child._children_.forEach(self, child);
		}
	}, rel.obj);
	if (doSnapshot) getItems.clearAll();
	return points;
};

exports.emitSet = function (rel, items, event) {
	var ns = rel.__ns.__value;
	forEach(items, function self(value, key) {
		if (this.hasOwnProperty(key)) {
			if (this[key]._value == null) this[key]._update_();
			return;<commit_msg>Fix set resolution when underlying value is func<commit_after>'use strict';

var d       = require('es5-ext/lib/Object/descriptor')
  , forEach = require('es5-ext/lib/Object/for-each')
  , memoize = require('memoizee/lib/regular')

  , defineProperty = Object.defineProperty
  , getItems;

getItems = exports.getItems = memoize(function (rel) {
	var items = {};
	// If underlying relation is dynamic (function) not configured with triggers,
	// it will not be recognized as set and rel.forEach will throw.
	if (rel._isSet_) {
		rel.forEach(function self(value, i1, i2, i3, key) { items[key] = value; });
	}
	defineProperty(items, 'ns', d(rel.__ns.__value));
	return items;
});

exports.getSets = function (rel, doSnapshot) {
	var points = [];
	if (!rel.obj.hasOwnProperty('_children_')) return points;
	rel.obj._children_.forEach(function self(child) {
		if (child.hasOwnProperty('_value')) return;
		if ((child.__multiple !== rel) &&
				child.__multiple.hasOwnProperty('_value')) {
			if (child.__multiple.__value) {
				points.push(child);
				if (doSnapshot) points.push(getItems(this));
			}
			return;
		}
		if (child.hasOwnProperty('_children_')) {
			child._children_.forEach(self, child);
		}
	}, rel.obj);
	if (doSnapshot) getItems.clearAll();
	return points;
};

exports.emitSet = function (rel, items, event) {
	var ns = rel.__ns.__value;
	forEach(items, function self(value, key) {
		if (this.hasOwnProperty(key)) {
			if (this[key]._value == null) this[key]._update_();
			return;
{'fraction_non_alphanumeric': 0.16229802513464991, 'fraction_numerical': 0.003590664272890485, 'mean_word_length': 4.347408829174664, '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': '4199982', 'n_tokens_mistral': 984, 'n_tokens_neox': 934, 'n_words': 201}