A param and its value.
@classdesc
@param {module:eclairjs/ml/param.Param} param
@param {object} value
@class
@memberof module:eclairjs/ml/param
438747
function (param, value) {
        var jvmObject;
        if (arguments[0] instanceof org.apache.spark.ml.param.ParamPair) {
            jvmObject = arguments[0];
        } else {
            jvmObject = new org.apache.spark.ml.param.ParamPair(param, value);
        }
        this.logger = Logger.getLogger("ParamPair_js");
        JavaWrapper.call(this, jvmObject);

    }
145435
function(value) {
      var args = [].slice.call(arguments, 1);
      if (typeof value === 'function') {
        value = value.apply(null, args);
      }
      return value;
    }
808054
@Override
    public InitParamDef initParam(String name, Object value) {
        Node init = child.createChild("init-param");
        init.createChild("param-name").text(name);
        init.createChild("param-value").text(String.valueOf(value));
        return this;
    }
262022
function(value, attr, fn, model, computed) {
        if(_.isString(fn)){
          fn = model[fn];
        }
        return fn.call(model, value, attr, computed);
      }
893375
function Parens(value,open,close){
	this.setup();
	this._open = open;
	this._close = close;
	this._value = this.load(value);
}
765192
function setDescription( $value, $params=FALSE ) {
    $description['value']  = $value;
    $description['params'] = $this->_setParams( $params );
    $this->description[]   = $description;
  }
588679
function (values, schema, options, callback) {
    var newValues = {}
        , errors = []
        , modelList = find(schema)
        , val;

    for (var model in modelList) {
        if (_.isArray(modelList[model])) {

            if (values === undefined) {
                val = undefined;
            }
            else {
                val = values[model];
            }

            // Empty array defined in schema
            if (_.isEmpty(modelList[model])) {
                if (val) {
                    newValues[model] = val;
                }
            }
            else {
                // Set value to empty array if empty given
                if (val == undefined) {
                    if (options && options.partial == true) {
                        // Do nothing
                    }
                    else {
                        newValues[model] = [];
                    }
                }
                else {
                    // Sub model defined in schema
                    for (var thisSubSchema in modelList[model]) {
                        if (_.isArray(val)) {
                            for (var thisValue in val) {

                                // Check if type array or plain array
                                if (typeof val[thisValue] == "object") {
                                    modelCompare(val[thisValue], modelList[model][thisSubSchema], options, function (err, data) {
                                        if (err) {
                                            errors = _.union(errors, err);
                                        }
                                        if (data !== null) {
                                            if (!newValues[model]) {
                                                newValues[model] = [];
                                            }
                                            newValues[model][thisValue] = data;
                                        }
                                    });
                                }
                                else {
                                    rulesMatch(thisValue, val[thisValue], modelList[model][thisSubSchema], options, function (err, data) {
                                        if (err) {
                                            errors.push(err);
                                        }
                                        if (data !== undefined) {
                                            if (!newValues[model]) {
                                                newValues[model] = [];
                                            }
                                            newValues[model][thisValue] = data;
                                        }
                                    });
                                }
                            }
                        }
                        else {
                            modelCompare(val, modelList[model][thisSubSchema], options, function (err, data) {
                                if (err) {
                                    errors = _.union(errors, err);
                                }
                                if (data !== null) {
                                    newValues[model] = data;
                                }
                            });
                        }
                    }
                }
            }
        } else {
            // Check for definition of {} in model to allow any data for this node without validation
            if (_.isEmpty(modelList[model])) {
                for (var index in values) {
                    var filter = new RegExp("^" + model);
                    if (index.match(filter)) {
                        newValues[index] = values[index];
                    }
                }
            }
            else {
                if (values === undefined) {
                    val = undefined;
                }
                else {
                    val = values[model];
                }

                rulesMatch(model, val, modelList[model], options, function (err, data) {
                    if (err) {
                        errors.push(err);
                    }
                    if (data !== undefined) {
                        newValues[model] = data;
                    }
                });
            }
        }
    }

    if (_.isEmpty(errors)) {
        errors = null;
    }
    else {
        errors = {name: 'ValidationError', err: errors};
    }
    if (_.isEmpty(newValues)) {
        newValues = null;
    }
    callback(errors, newValues);
}
55829
private static Object getParam(final Object param) {
		final StringBuilder sb = new StringBuilder();
		if(param instanceof String){
			sb.append("'");
			sb.append((String)param);
			sb.append("'");
		}
		else if(param instanceof Boolean){
			sb.append(String.valueOf((Boolean)param));			
		}
        else if(param instanceof Integer){
            sb.append(String.valueOf((Integer)param));
        }
        else if(param instanceof DBRegExp){
            sb.append('/');
            sb.append(((DBRegExp) param).toString());
            sb.append('/');
        }
		
		return sb.toString();
	}
648511
function Param(name,defaults,typ){
	// could have introduced bugs by moving back to identifier here
	this._traversed = false;
	this._name = name;
	this._defaults = defaults;
	this._typ = typ;
	this._variable = null;
}
1331497
function(params) {

                            var that = this;
                            var paramsDefinition = this.getParamsDefinition();
                            var parameterProcessor = this.getParameterProcessor();

                            _.each(params, function(value, param) {
                                if (!(param in paramsDefinition)) {
                                    throw new Error('Parameter "' + param + '" does not defined!');
                                }
                                params[param] = parameterProcessor.process(value, paramsDefinition[param], param, that);
                            });

                            return params;
                        }
896041
function (parameters, result) {
                var
                    len,
                    idx,
                    parameter,
                    name,
                    value;
                len = parameters.length;
                for (idx = 0; idx < len; ++idx) {
                    parameter = parameters[idx];
                    name = parameter._name;
                    if (undefined === result[name]) {
                        if (parameter._required) {
                            gpf.Error.paramsRequiredMissing({
                                name: name
                            });
                        }
                        value = parameter._defaultValue;
                        if (undefined !== value) {
                            if (parameter._multiple) {
                                value = [value];
                            }
                            result[name] = value;
                        } else if (parameter._multiple) {
                            result[name] = [];
                        }
                    }
                }
            }
580567
public Object func(String param) {
		ReqInfo reqInfo = ContextUtils.getReqInfo();

		StringBuffer sb = new StringBuffer();
		// if (reqInfo.m_bUseAjax)
		// sb.append("document.");
		sb.append(param);
		sb.append(reqInfo.getRequestId());
		return sb.toString();
	}
1163524
function getValParams(params) {
  const dealParamsFunc = dealParams.bind(this);
  const localData = this.localeData ? this.localeData() : {
    em_range_relation: _.template('${desc?desc+"\'s ":""}relationship of values has error'),
    em_choices       : _.template('must choice ${force?"":"at least "}${count} from [`${fields.join("`,`")}`]'),
    em_equals        : _.template('[`${fields.join("`,`")}`] must be equal'),
    em_compares      : _.template('[`${fields.join("`,`")}`] must be progressive increase'),
    em_cases         : opt => {
      opt.when = opt.when || [];
      opt.then = opt.then || [];
      opt.not = opt.not || [];
      _.map(opt.when, (whenField, idx) => {
        if (typeof whenField === 'string') {
          whenField = { field: whenField };
        } else {
          opt.when[idx] = `${whenField.field} = ${whenField.value}`;
        }
      });
      return _.template(
        'when pass ${when.join("`,`")}, ${then.length?"must pass params: "+then.join("`,`"):""}${then.length&&not.length?",and ":""}${not.length?" cann\'t pass params: "+not.join("`,`"):""}')(
        opt);
    },
  };

  const req       = params.req;
  const all       = params.all || true;
  const validate  = params.validate;
  const options   = params.options || {};
  const val       = getParams(req, all);
  const allParams = val.all;
  let errParams   = [];
  const retParams = {
    query : {},
    body  : {},
    params: {},
    all   : {},
    raw   : { query: {}, body: {}, params: {}, all: {} },
  };
  const keymap    = {};
  // 参数验证
  for (const key in validate) {
    validate[key].desc = validate[key].desc || key;
    // 一些默认选项
    // type string
    // required false
    // alias 默认是键名 即key 设置了别名外部输入参数就只能用别名
    // 讨论 应该只能用别名还是两者均能用？
    // 160421想法 应该两个均能用：缩写用于query 全称用于post
    // 180809想法 只能用其一：不产生歧义，采用严格点的方式
    //
    if (validate[key].trim === undefined) {
      validate[key].trim = false;
    }
    if (validate[key].type === undefined) {
      validate[key].type = 'string';
    }
    if (validate[key].required === undefined) {
      // 兼容旧参数must
      if (validate[key].must !== undefined) {
        validate[key].required = validate[key].must;
      } else {
        validate[key].required = false;
      }
    }
    if (rangeTypes.indexOf(validate[key].type) >= 0) {
      const aliasMin = `${key}>`;
      const aliasMax = `${key}<`;
      keymap[key] = key;
      const type     = validate[key].type === 'range' ? 'all' : validate[key].type.replace('Range', '');
      let ret;
      let success    = false;
      const errmsg     = [];
      // 是否必选和默认值不在dealParams判断，后面得到ret的时候判断
      const resulteq = dealParamsFunc({
        desc         : validate[key].desc,
        value        : allParams[key],
        allowEmptyStr: validate[key].allowEmptyStr || false,
        type,
        range        : validate[key].range,
        required     : false,
        defValue     : undefined,
        trim         : validate[key].trim,
      });
      if (resulteq.success && resulteq.value !== undefined) {
        ret = resulteq.value;
        errmsg.push({ key, type, value: allParams[key], err: resulteq.errmsg });
      }
      success = success || resulteq.success;
      if (ret === undefined) {
        if (allParams[aliasMin]) {
          ret = ret || {};
          let value   = allParams[aliasMin];
          let equalgt = false;
          if (/^:/.test(value)) {
            equalgt = true;
            value = allParams[aliasMin].slice(1);
          }
          const resultgt = dealParamsFunc({
            desc         : validate[key].desc,
            value,
            allowEmptyStr: validate[key].allowEmptyStr || false,
            type,
            range        : validate[key].range,
            required     : false,
            defValue     : undefined,
            trim         : validate[key].trim,
          });
          if (resultgt.success && resultgt.value !== undefined) {
            if (equalgt) {
              ret[Op.gte] = resultgt.value;
            } else {
              ret[Op.gt] = resultgt.value;
            }
          }
          success ? success = resultgt.success : 1;
          !resultgt.success ? errmsg.push({
            key: aliasMin + (equalgt ? '=' : ''),
            type,
            value,
            err: resultgt.errmsg,
          }) : 1;
        }
        if (allParams[aliasMax]) {
          ret = ret || {};
          let value   = allParams[aliasMax];
          let equallt = false;
          if (/^:/.test(value)) {
            equallt = true;
            value = allParams[aliasMax].slice(1);
          }
          const resultlt = dealParamsFunc({
            desc         : validate[key].desc,
            value,
            allowEmptyStr: validate[key].allowEmptyStr || false,
            type,
            range        : validate[key].range,
            required     : false,
            defValue     : undefined,
            trim         : validate[key].trim,
          });
          if (resultlt.success && resultlt.value !== undefined) {
            if (equallt) {
              ret[Op.lte] = resultlt.value;
            } else {
              ret[Op.lt] = resultlt.value;
            }
          }
          success ? success = resultlt.success : 1;
          !resultlt.success ? errmsg.push({
            key: aliasMax + (equallt ? '=' : ''),
            type,
            value,
            err: resultlt.errmsg,
          }) : 1;
        }
        if (success && ret) {
          // 简单判断成功了，这里还要检测>=6&&<=4这种矛盾的情况
          if (!(ret[Op.gte] && ret[Op.lte] && ret[Op.gte] === ret[Op.lte])) {
            const gtData = ret[Op.gte] || ret[Op.gt];
            const ltData = ret[Op.lte] || ret[Op.lt];
            if (gtData && ltData && gtData >= ltData) {
              errmsg.push(localData.em_range_relation({ desc: validate[key].desc }));
              success = false;
            }
          }
        }
      }
      if (ret !== undefined) {
        retParams.all[key] = ret;
      }
      if (!success) {
        errParams.push({ key, desc: validate[key].desc, type: validate[key].type, err: errmsg });
      }
    } else {
      const alias    = validate[key].alias || key;
      keymap[key] = alias;
      const result = dealParamsFunc({
        desc         : validate[key].desc,
        value        : allParams[alias],
        allowEmptyStr: validate[key].allowEmptyStr || false,
        type         : validate[key].type,
        range        : validate[key].range,
        required     : validate[key].required,
        defValue     : validate[key].defValue,
        trim         : validate[key].trim,
      });
      if (result.success) {
        if (result.value !== undefined) {
          retParams.all[key] = result.value;
        }
      } else {
        errParams.push(
          { key, desc: validate[key].desc, type: validate[key].type, value: allParams[alias], err: result.errmsg });
      }
    }
  }

  // 参数关系验证
  // M 选 N 关系
  if (options.choices && options.choices.length) {
    const errList = [];
    _.map(options.choices, choice => {
      if (Array.isArray(choice)) {
        choice = { fields: choice, force: false, count: 1 };
      }
      choice.count = Number(choice.count) || 1;
      if (choice.count) {
        let cnt = 0;
        for (let i = 0; i < choice.fields.length; i++) {
          if (!_.isUndefined(retParams.all[choice.fields[i]])) {
            cnt++;
          }
        }
        let flag = false;
        if (choice.force) {
          if (cnt !== choice.count) {
            flag = true;
          }
        } else if (cnt < choice.count) {
          flag = true;
        }
        if (flag) {
          const emOpts    = {
            fields: choice.fields,
            count : choice.count,
            force : choice.force,
          };
          emOpts.fields = _.map(choice.fields, field => {
            return validate[field] ? validate[field].desc : field;
          });
          errList.push(localData.em_choices(emOpts));
        }
      }
    });
    if (errList.length) {
      errParams.push({ type: 'choices', err: errList });
    }
  }
  // 相等关系
  if (options.equals && options.equals.length) {
    const errList = [];
    _.map(options.equals, fields => {
      if (fields.length >= 2) {
        let flag  = true;
        const value = retParams.all[fields[0]];
        for (let i = 1; i < fields.length; i++) {
          if (_.isUndefined(retParams.all[fields[i]])) {
            continue;
          }
          if (retParams.all[fields[i]] !== value) {
            flag = false;
            break;
          }
        }
        if (!flag) {
          const emFields = _.map(fields, field => {
            return validate[field] ? validate[field].desc : field;
          });
          errList.push(localData.em_equals({ fields: emFields }));
        }
      }
    });
    if (errList.length) {
      errParams.push({ type: 'equals', err: errList });
    }
  }
  // 比较关系
  if (options.compares && options.compares.length) {
    const errList = [];
    _.map(options.compares, fields => {
      if (fields.length >= 2) {
        let flag  = true;
        let value = retParams.all[fields[0]];
        for (let i = 1; i < fields.length; i++) {
          if (_.isUndefined(retParams.all[fields[i]])) {
            continue;
          }
          if (retParams.all[fields[i]] < value) {
            flag = false;
            break;
          }
          value = retParams.all[fields[i]];
        }
        if (!flag) {
          const emFields = _.map(fields, field => {
            return validate[field] ? validate[field].desc : field;
          });
          errList.push(localData.em_compares({ fields: emFields }));
        }
      }
    });
    if (errList.length) {
      errParams.push({ type: 'compares', err: errList });
    }
  }
  // 条件关系
  if (options.cases && options.cases.length) {
    const errList = [];
    _.map(options.cases, caseInfo => {
      let flag = true;
      let hit  = true;
      if (caseInfo.when) {
        for (let i = 0; i < caseInfo.when.length; i++) {
          let whenField = caseInfo.when[i];
          if (typeof whenField === 'string') {
            // 只要检测是否存在值
            whenField = { field: whenField };
          }
          // 需要判断值是否符合条件
          if (_.isUndefined(retParams.all[whenField.field])) {
            hit = false;
            break;
          } else if (whenField.value && retParams.all[whenField.field] !== whenField.value) {
            hit = false;
            break;
          }
        }
        if (hit) {
          if (caseInfo.then) {
            for (let i = 0; i < caseInfo.then.length; i++) {
              const thenField = caseInfo.then[i];
              if (_.isUndefined(retParams.all[thenField])) {
                flag = false;
                break;
              }
            }
          }
          if (flag && caseInfo.not) {
            for (let i = 0; i < caseInfo.not.length; i++) {
              const notField = caseInfo.not[i];
              if (!_.isUndefined(retParams.all[notField])) {
                flag = false;
                break;
              }
            }
          }
        }
      }
      if (!flag) {
        const emOpt  = {};
        emOpt.when = _.map(caseInfo.when, whenField => {
          if (typeof whenField === 'string') {
            return validate[whenField] ? validate[whenField].desc : whenField;
          }
          return validate[whenField.field] ? validate[whenField.field].desc : whenField.field;
        });
        emOpt.then = _.map(caseInfo.then, thenField => {
          return validate[thenField] ? validate[thenField].desc : thenField;
        });
        emOpt.not = _.map(caseInfo.not, notField => {
          return validate[notField] ? validate[notField].desc : notField;
        });
        errList.push(localData.em_cases(emOpt));
      }
    });
    if (errList.length) {
      errParams.push({ type: 'cases', err: errList });
    }
  }

  if (!errParams.length) {
    errParams = null;
  }
  // 处理retParams里面的query和body、params
  const method = req.method;
  for (const item in retParams.all) {
    retParams.raw.all[keymap[item]] = retParams.all[item];
    let flag                        = false;
    if (val.query[keymap[item]] !== undefined) {
      retParams.query[item] = retParams.all[item];
      retParams.raw.query[keymap[item]] = retParams.all[item];
      flag = true;
    }
    if (val.body[keymap[item]] !== undefined) {
      retParams.body[item] = retParams.all[item];
      retParams.raw.body[keymap[item]] = retParams.all[item];
      flag = true;
    }
    if (val.params[keymap[item]] !== undefined) {
      retParams.params[item] = retParams.all[item];
      retParams.raw.params[keymap[item]] = retParams.all[item];
      flag = true;
    }
    if (!flag) {
      // flag为false的时候说明这个参数存在于all里面但不存在与querybodyparams，也就是说这个参数属于可选参数,并且有·默认值·
      // 此时根据method来赋值给query或body， get->query, other(post,patch,delete)->body
      if (method === 'GET') {
        retParams.query[item] = retParams.all[item];
        retParams.raw.query[item] = retParams.all[item];
        flag = true;
      } else {
        retParams.body[item] = retParams.all[item];
        retParams.raw.body[item] = retParams.all[item];
        flag = true;
      }
    }
  }
  return { err: errParams, ret: retParams };
}
538690
function find(param) {
  var fn
    , asInt = Number(param);

  fn = isNaN(asInt) ? findBySlug : findById;
  fn.apply(null, arguments);
}
840925
function val (params, spec, errs) {
  for (var key in params) {
    if (key in spec && isFunction(spec[key].val) && !spec[key].val(params[key])) valError(key, errs)
  }
}
923005
function find(param) {
  var fn, asInt = parseInt(param, 10);
  fn = isNaN(asInt) ? findByUsername : findById;
  fn.apply(null, arguments);
}
833650
def param_value(param_values, slug):
    
    for val in param_values:
        if val.param.slug == slug:
            return val.value
    return None