default consts of excheck
554076
function(setting, zTreeTools) {
		zTreeTools.checkNode = function(node, checked, checkTypeFlag, callbackFlag) {
			var checkedKey = this.setting.data.key.checked;
			if (node.chkDisabled === true) return;
			if (checked !== true && checked !== false) {
				checked = !node[checkedKey];
			}
			callbackFlag = !!callbackFlag;

			if (node[checkedKey] === checked && !checkTypeFlag) {
				return;
			} else if (callbackFlag && tools.apply(this.setting.callback.beforeCheck, [this.setting.treeId, node], true) == false) {
				return;
			}
			if (tools.uCanDo(this.setting) && this.setting.check.enable && node.nocheck !== true) {
				node[checkedKey] = checked;
				var checkObj = $$(node, consts.id.CHECK, this.setting);
				if (checkTypeFlag || this.setting.check.chkStyle === consts.radio.STYLE) view.checkNodeRelation(this.setting, node);
				view.setChkClass(this.setting, checkObj, node);
				view.repairParentChkClassWithSelf(this.setting, node);
				if (callbackFlag) {
					this.setting.treeObj.trigger(consts.event.CHECK, [null, this.setting.treeId, node]);
				}
			}
		}

		zTreeTools.checkAllNodes = function(checked) {
			view.repairAllChk(this.setting, !!checked);
		}

		zTreeTools.getCheckedNodes = function(checked) {
			var childKey = this.setting.data.key.children;
			checked = (checked !== false);
			return data.getTreeCheckedNodes(this.setting, data.getRoot(this.setting)[childKey], checked);
		}

		zTreeTools.getChangeCheckedNodes = function() {
			var childKey = this.setting.data.key.children;
			return data.getTreeChangeCheckedNodes(this.setting, data.getRoot(this.setting)[childKey]);
		}

		zTreeTools.setChkDisabled = function(node, disabled, inheritParent, inheritChildren) {
			disabled = !!disabled;
			inheritParent = !!inheritParent;
			inheritChildren = !!inheritChildren;
			view.repairSonChkDisabled(this.setting, node, disabled, inheritChildren);
			view.repairParentChkDisabled(this.setting, node.getParentNode(), disabled, inheritParent);
		}

		var _updateNode = zTreeTools.updateNode;
		zTreeTools.updateNode = function(node, checkTypeFlag) {
			if (_updateNode) _updateNode.apply(zTreeTools, arguments);
			if (!node || !this.setting.check.enable) return;
			var nObj = $$(node, this.setting);
			if (nObj.get(0) && tools.uCanDo(this.setting)) {
				var checkObj = $$(node, consts.id.CHECK, this.setting);
				if (checkTypeFlag == true || this.setting.check.chkStyle === consts.radio.STYLE) view.checkNodeRelation(this.setting, node);
				view.setChkClass(this.setting, checkObj, node);
				view.repairParentChkClassWithSelf(this.setting, node);
			}
		}
	}
435732
function defaultGetCallingScript(offset = 0) {
	const stack = (new Error).stack.split(/$/m);
	const line = stack[(/^Error/).test(stack[0]) + 1 + offset];
	const parts = line.split(/@(?![^/]*?\.xpi)|\(|\s+/g);
	return parts[parts.length - 1].replace(/:\d+(?::\d+)?\)?$/, '');
}
257133
function conditionalReturnToGuards(path) {
    const { node } = path;

    if (
      !path.inList ||
      !path.get("consequent").isBlockStatement() ||
      node.alternate
    ) {
      return;
    }

    let ret;
    let test;
    const exprs = [];
    const statements = node.consequent.body;

    for (let i = 0, statement; (statement = statements[i]); i++) {
      if (t.isExpressionStatement(statement)) {
        exprs.push(statement.expression);
      } else if (t.isIfStatement(statement)) {
        if (i < statements.length - 1) {
          // This isn't the last statement. Bail.
          return;
        }
        if (statement.alternate) {
          return;
        }
        if (!t.isReturnStatement(statement.consequent)) {
          return;
        }
        ret = statement.consequent;
        test = statement.test;
      } else {
        return;
      }
    }

    if (!test || !ret) {
      return;
    }

    exprs.push(test);

    const expr = exprs.length === 1 ? exprs[0] : t.sequenceExpression(exprs);

    const replacement = t.logicalExpression("&&", node.test, expr);

    path.replaceWith(t.ifStatement(replacement, ret, null));
  }
1333004
function conditionalExtend(user, args) {
    var extra = _.omit(args, options.updateUser.omit)
    _.map(extra, function(val, key) {
      if (!key.match(/\$/)) {
        user[key] = val
      }
    })
  }
940746
def setChecked(src, ids=[], dpth = 0, key = ''):
    
    #tabs = lambda n: ' ' * n * 4 # or 2 or 8 or...
    #brace = lambda s, n: '%s%s%s' % ('['*n, s, ']'*n)

    if isinstance(src, dict):
        for key, value in src.iteritems():
            setChecked(value, ids, dpth + 1, key)
    elif isinstance(src, list):
        for litem in src:
            if isinstance(litem, types.DictType):
	            if "id" in litem and litem["id"] in ids:
	            	litem["checked"] = True
	            	litem["select"] = True
            setChecked(litem, ids, dpth + 2)
220057
function defaultUngrep(targets) {
    if (targets && targets.length) {
        var ungreps = [], target, len = targets.length;

        for (var i = 0; i < len; i++) {
            target = targets[i];
            target = '(?:^' + path.dirname(target) + sep + '){1}';
            target += '(?:/?.*/?)*' + NM_SEG;
            ungreps.push(new RegExp(escape(target)));
        }
        return ungreps;
    }
    return [new RegExp(escape(NM_SEG))];
}
1010247
private SemanticType checkConstant(Expr.Constant expr, Environment env) {
		Value item = expr.getValue();
		switch (item.getOpcode()) {
		case ITEM_null:
			return Type.Null;
		case ITEM_bool:
			return Type.Bool;
		case ITEM_int:
			return Type.Int;
		case ITEM_byte:
			return Type.Byte;
		case ITEM_utf8:
			// FIXME: this is not an optimal solution. The reason being that we
			// have lost nominal information regarding whether it is an instance
			// of std::ascii or std::utf8, for example.
			return new SemanticType.Array(Type.Int);
		default:
			return internalFailure("unknown constant encountered: " + expr, expr);
		}
	}
159367
private Object evaluateDefaultValue()
    {
        Object val = _defaultValue;

        List defaults = null;
        if (val instanceof String) {
            if ("checked".equals(val)) {
                _defaultSingleton = true;
                _defaultSingleValue = true;
                return null;
            }
            else if ("unchecked".equals(val)) {
                _defaultSingleton = true;
                _defaultSingleValue = false;
                return null;
            }

            defaults = new ArrayList();
            defaults.add(val);
            return defaults;
        }

        Iterator optionsIterator = null;
        optionsIterator = IteratorFactory.createIterator(val);

        // log an error, default value is optional so only warn
        if (optionsIterator == null && _defaultValue != null) {
            logger.warn(Bundle.getString("Tags_IteratorError",
                    new Object[]{getTagName(), "defaultValue", _defaultValue}));
        }
        if (optionsIterator == null)
            optionsIterator = IteratorFactory.EMPTY_ITERATOR;

        defaults = new ArrayList();
        while (optionsIterator.hasNext()) {
            defaults.add(optionsIterator.next());
        }

        return defaults;
    }
1191791
function checkOpts(config, cb) {
  // jshint eqnull: true

  var prefix = "ragents.createSession(): "

  if (config == null) throw Error(prefix + "config is null")

  if (config.url == null) throw Error(prefix + "config.url is null")
  if (config.key == null) throw Error(prefix + "config.key is null")

  if (null == cb)        throw Error(prefix + "callback is null")
  if (!_.isFunction(cb)) throw Error(prefix + "callback is not a function")
}
92854
function applyDefaults (obj, defaults){
	if (typeof obj === 'undefined'){
		console.log('WARNING! an applyDefaults object is undefined, these defaults were not applied:\n', defaults);
		return false;
	}

	for (var property in defaults) {
		if (defaults.hasOwnProperty(property)) {
			obj[property] = defaultTo(obj[property], defaults[property])
		}
	}

	return obj;
}
47254
def match_const(self, tokens, item):
        """"""
        match, = tokens
        if match in const_vars:
            self.add_check(item + " is " + match)
        else:
            self.add_check(item + " == " + match)
830221
function buildMock (defaults, args) {
    // mock object to be build
    var mock = {}
    // iterate over defaults
    _.each(defaults, (val, key) => {
        mock[key] = buildMockAttribute(val)
    })
    // iterate over args, overriding defaults
    _.each(args, (val, key) => {
        mock[key] = buildMockAttribute(val)
    })
    // return mock object
    return mock
}
245921
function getConstList($include_default = false)
    {
        if (isset($this->_c__consts))
            return $this->_c__consts;

        $reflection = new ReflectionClass($this);
        $consts     = $reflection->getConstants();
        if ((bool)$include_default === false)
            unset($consts['__default']);

        return $this->_c__consts = $consts;
    }
720070
function defaultComp(a,b) {
		var as = '' + a,
			bs = '' + b;

		if (as < bs) {
			return -1;
		} else if (as > bs) {
			return 1;
		} else {
			return 0;
		}
	}
60515
def set_defaults(self):
        """"""

        for const_name, c in file_classes.items():
            if c.multiplicity == '1':
                f = self.file(const_name)
                if not f.record.unpacked_contents:
                    f.setcontent(f.default)
245942
function buildExcludeCheck (transpileDependencies = []) {
  const dependencyChecks = transpileDependencies.map((dependency) => (
    new RegExp(`node_modules.${dependency}`)
  ))

  // see: https://webpack.js.org/configuration/module/#condition
  return function (assetPath) {
    const shouldTranspile = dependencyChecks
      .reduce((result, check) => result || assetPath.match(check), false)

    if (shouldTranspile) { return false }
    return !!assetPath.match(/node_modules/)
  }
}
831333
function (defaults, configure) {
        for (var key in defaults) {
            if (defaults.hasOwnProperty(key)) {
                if (typeof defaults[key] === 'object') {
                    // recursive
                    if (typeof configure[key] === 'object') {
                        overwriteConfig(defaults[key], configure[key]);
                    }
                } else {
                    // copy directly
                    if (typeof configure[key] !== 'undefined') {
                        defaults[key] = configure[key];
                    }
                }
            }
        }
    }