/*!
Coerce an object for specific action: `get`, `set`, `remove`, `exists`
500497
function coerce (type, obj, path, value) {
  if (isNil(path)) return;

  // Turn positive integer into string
  if (isPositiveInteger(path)) path = String(path);

  // Parse string path into an array
  if (isString(path)) {
    path = compact(path.trim().split(SEPERATOR));
  }

  // Return if path is invalid
  if (!path || !isArray(path) || path.length === 0) return;

  // Copy array for future use
  path = path.slice();

  // Shift the first path value
  var key = path.shift();

  // Return `undefined` if obj is `NaN` or `null` or `undefined`
  if (isNil(obj)) return;

  switch (type) {
    case 'get':
      if (path.length === 0) {
        return obj[key];
      }
      break;
    case 'set':
      if (path.length) {
        if (typeof obj[key] === 'undefined') {
          obj[key] = {};
        }

        if (isNil(obj[key])) return false;
      } else {
        obj[key] = value;
        return true;
      }
      break;
    case 'remove':
      if (path.length === 0) {

        if (isArray(obj) && isPositiveInteger(key)) {
          key = Number(key);

          if (obj.length - 1 < key) return false;

          obj.splice(key, 1);
        } else {
          if (!Object.hasOwnProperty.call(obj, key)) return false;

          delete obj[key];
        }

        return true;
      }
      break;
    case 'exists':
      if (path.length === 0) {
        if (isArray(obj) && isPositiveInteger(key)) {
          key = Number(key);
          return obj.length - 1 >= key;
        } else {
          return Object.hasOwnProperty.call(obj, key);
        }
      }
      break;
    default:
      return;
  }

  return coerce(type, obj[key], path, value);
}
149337
function forOwn(object, iteratee) {
    Object.keys(object).forEach(function (key) { return iteratee(object[key], key, object); });
}
101554
function omit(keys, object){
  var ret = {};

  for (var item in object) {
    ret[item] = object[item];
  }

  for (var i = 0; i < keys.length; i++) {
    delete ret[keys[i]];
  }
  return ret;
}
1091979
function(obj, key) {
		var value;
		for (var i = 2; i < arguments.length; i++) {
			value = arguments[i];
			if (value !== undefined) {
				obj[key] = value;
				break;
			}
		}

		if (value === undefined) delete obj[key];

		return obj;
	}
980398
function removeObject (obj, iterate, context) {
  if (obj) {
    if (arguments.length > 1) {
      var removeKeys = []
      var rest = []
      context = context || this
      if (!isFunction(iterate)) {
        iterate = pluckProperty(iterate)
      }
      each(obj, function (item, index, rest) {
        if (iterate.call(context, item, index, rest)) {
          removeKeys.push(index)
        }
      })
      if (isArray(obj)) {
        lastEach(removeKeys, function (item, key) {
          rest.push(obj[item])
          obj.splice(item, 1)
        })
      } else {
        rest = {}
        arrayEach(removeKeys, function (key) {
          rest[key] = obj[key]
          deleteProperty(obj, key)
        })
      }
      return rest
    }
    return clearObject(obj)
  }
  return obj
}
1050384
function(key, value){
    var c = getCache(this.ns)

    // set({foo: "bar"})
    if(arguments.length === 1 && typeof key === "object") {
      Object.keys(key).forEach(function(k){
        c[k] = key[k]
      }, this)
    }

    // set("foo", "bar")
    else {
      c[key] = value
    }

    return setCache(this.ns, c)
  }
427208
function _objectByAttribute(obj, attr, map, action) {
    var subAttrs = attr.split(".");
    var attrValue = obj;
    for (var i = 0; i < subAttrs.length; i++) {
      attrValue = attrValue[subAttrs[i]];
      if (attrValue === undefined) {
        return;
      }
    }

    if ($.isArray(attrValue)) {
      // TODO implement this when we actually need it
    }
    else if ($.isPlainObject(attrValue)) {
      for (var key in attrValue) {
        var val = attrValue[key];
        if (!map[key]) {
          map[key] = {};
        }
        if (action === "DELETED") {
          delete map[key][val];
        }
        else {
          map[key][val] = obj;
        }
      }
    }
    else {
      if (action === "DELETED") {
        delete map[attrValue];
      }
      else {
        map[attrValue] = obj;
      }
    }
  }
52477
function objectSubset (obj, names) {
  let result = {}
  for (let i = 0; i < names.length; i++) {
    if (obj[names[i]] !== undefined) {
      result[names[i]] = obj[names[i]]
    }
  }
  return result
}
537911
function(attrs, attrsToRemove) {
    _.forEach(attrs, function(val, key) {
      // shouldRemove is either an object or a boolean
      var shouldRemove = attrsToRemove[key];
      if (_.isUndefined(shouldRemove)) {
        return;
      }

      // Support nested object
      if (_.isPlainObject(val) && !_.isArray(val) && _.isPlainObject(shouldRemove)) {
        return this._removeExpandableAttributes(val, shouldRemove);
      }

      // Make sure attribute is an object
      // Strip all nested properties except for `_id`
      if (_.isPlainObject(attrs[key]) && shouldRemove) {
        attrs[key] = _.pick(attrs[key], ['_id']);
      }
    }.bind(this));
  }
924826
function set(key, value) {
	if (ns && ns.active) {
		return ns.set(key, value);
	}
}
1231984
function omit(object, keysToOmit) {
  const result = {};

  Object.keys(object).forEach(key => {
    if (keysToOmit.indexOf(key) === -1) {
      result[key] = object[key];
    }
  });

  return result;
}
916965
function(key, value) {
        this._removeRemove(this.sets.remove, key);
        var op = this._getOp(this.sets.removes, key);
        if (op) {
            op.remove.push(value);
        } else {
            this.sets.removes.push({key: key, remove: [value]});
        }
        return this;
    }
955967
function sunion(/* key-1, key-N, req*/) {
  var args = slice.call(arguments, 0)
    , req = typeof args[args.length-1] === 'object' ? args.pop() : null
    , set
    , src
    , i;
  set = new Set();
  for(i = 0;i < args.length;i++) {
    src = this.getKey(args[i], req);
    if(src === undefined) continue;
    set.sadd(src.data);
  }
  return set.data;
}
807361
function(key){
          if(!isObject(key))return false;
          if(!isExtensible(key))return frozenStore(this)['delete'](key);
          return $has(key, WEAK) && $has(key[WEAK], this._i) && delete key[WEAK][this._i];
        }
476836
function remove (from, what) {
  // TODO array coerce trick
  if (!_.isArray(what)) { what = [what] }
  return W.map(what, (p) => {
    return fs.unlinkSync(path.resolve(from, p))
  }
  )
}
1226909
def []=(key, value)
      coerced_value = coercion(key).present? ? coercion(key).call(value) : value
      old_setter(key, coerced_value)
    end
445375
function forEachForKey(object, k, callback) {

  if (!(k in object))
    return;

  if (object[k] instanceof Set)
    object[k].forEach(edgeData => callback(
      edgeData.key,
      edgeData.attributes,
      edgeData.source.key,
      edgeData.target.key,
      edgeData.source.attributes,
      edgeData.target.attributes
    ));
  else {
    const edgeData = object[k];

    callback(
      edgeData.key,
      edgeData.attributes,
      edgeData.source.key,
      edgeData.target.key,
      edgeData.source.attributes,
      edgeData.target.attributes
    );
  }

  return;
}