Map the param property of given candidate to contain only the values and resolve any references to other arguments
@name    parameterize
@access  internal
@param   Object candidate
@return  Object candidate (with resolved params)
498340
function parameterize(candidate) {
		candidate.param = candidate.param.map(function(param) {
			var value;

			if ('value' in param) {
				value = param.value;
			}
			else if ('reference' in param) {
				value = candidate.param.reduce(function(p, c) {
					return c !== param && !p && param.reference === c.name && 'value' in c ? c.value : p;
				}, null);
			}

			return value;
		});

		return candidate;
	}
550071
public function setParam($key, $value = null)
    {
        if (!$this->hasParam($key)) {
            throw new \InvalidArgumentException(sprintf('Cannot set %s as parameter cause this key does not exist.', $key));
        }

        if (is_object($value)) {
            throw new \InvalidArgumentException('Parameter\'s value cannot be type of object.');
        }

        $currentValue = $this->getParamValue($key);
        if (
            (null !== $value && null !== $currentValue)
            && (
                gettype($value) !== gettype($currentValue)
                && (
                    !(is_string($value) || is_integer($value))
                    || !(is_string($currentValue) || is_integer($currentValue))
                )
            )
        ) {
            throw new \InvalidArgumentException(sprintf(
                'Cannot replace %s\'s value, %s expected and %s given.',
                $key,
                gettype($currentValue),
                gettype($value)
            ));
        }

        if (null === $value) {
            unset($this->_parameters[$key]);
        } else {
            $this->_parameters[$key] = ['value' => $value];
        }

        return $this->getContentInstance();
    }
364520
function parameterBuilder(paramName) {
    // 
    return function (key) {
        // console.log("Declaration");
        // console.log({ key:key});
        // 
        return function (target, propertyKey, parameterIndex) {
            // console.log("Instance");
            // console.log({ key:key, propertyKey: propertyKey,parameterIndex: parameterIndex });
            target.methods = target.methods || {};
            var a = target.methods[propertyKey];
            if (!a) {
                a = [];
                target.methods[propertyKey] = a;
            }
            a[parameterIndex] = new WebAtoms.Rest.ServiceParameter(paramName, key);
        };
    };
}
1329064
def _parameter_values(parameter_values_from_pillars, parameter_value_overrides):
    '''
    
    '''
    from_pillars = copy.deepcopy(__salt__['pillar.get'](parameter_values_from_pillars))
    from_pillars.update(parameter_value_overrides)
    parameter_values = _standardize(from_pillars)
    return _properties_from_dict(parameter_values, key_name='id')
1000614
private function bindTypedParameters()
    {
        $streams = $values = [];
        $types   = $this->types;

        foreach ($this->_bindedValues as $parameter => $value) {
            if (! isset($types[$parameter - 1])) {
                $types[$parameter - 1] = static::$_paramTypeMap[ParameterType::STRING];
            }

            if ($types[$parameter - 1] === static::$_paramTypeMap[ParameterType::LARGE_OBJECT]) {
                if (is_resource($value)) {
                    if (get_resource_type($value) !== 'stream') {
                        throw new InvalidArgumentException('Resources passed with the LARGE_OBJECT parameter type must be stream resources.');
                    }
                    $streams[$parameter] = $value;
                    $values[$parameter]  = null;
                    continue;
                }

                $types[$parameter - 1] = static::$_paramTypeMap[ParameterType::STRING];
            }

            $values[$parameter] = $value;
        }

        if (! $this->_stmt->bind_param($types, ...$values)) {
            throw new MysqliException($this->_stmt->error, $this->_stmt->sqlstate, $this->_stmt->errno);
        }

        $this->sendLongData($streams);
    }
685315
@Override
    protected Object[] convertParameters(Object[] params) {
        List<Object> converted = getBinding().getKeyBinding().getKeyParameters(Arrays.asList(params));
        return converted.toArray(new Object[converted.size()]);
    }
1364785
function getName(candidate) {
  var proto   = getProto(candidate),
      isValid = !!proto && !isPlainObject(candidate) && !Array.isArray(candidate);
  if (isValid) {
    for (var key in require.cache) {
      var exports = require.cache[key].exports,
          result  = isPlainObject(exports) ? Object.keys(exports).reduce(test.bind(null, key), null) : test(key);
      if (result) {
        return result;
      }
    }
  }
  return null;

  function test(filename, result, field) {
    if (result) {
      return result;
    } else {
      var candidate    = field ? exports[field] : exports,
          qualified    = [filename, field].filter(Boolean).join('::'),
          isDefinition = (typeof candidate === 'function') && !!candidate.prototype &&
            (typeof candidate.prototype === 'object') && (candidate.prototype === proto);
      return isDefinition && qualified || null;
    }
  }
}
436413
function(params) {
		var me = this;

		if (Object.keys(model.columns).length == 0) {
			logger.error("Attempting to initialize `" + model.ident + "` instance before filling schema!");
			return null;
		} else if (model.primary === undefined) {
			logger.error("No primary key found for `" + model.ident + "`!");
			return null;
		}

		Object.defineProperty(me, 'values', {
			value: {},
			enumerable: false,
			writable: true,
			configurable: true,
		}); // Raw column values, accessed by setter/getter functions.

		params = params || {};

		/* --- Instance Methods --- */

		/**
		 * Saves the object's properties corresponding to table columns into the database.
		 */
		function save() {
			var act = new NobleMachine(function() {
				setStrs = [];

				for (var key in model.columns) {
					if ([model.primary].indexOf(key) == -1 && me[key] !== undefined) {
						setStrs.push('`' + key + '`' + " = " + nrutil.serialize(me[key]));
					}
				}

				if (model.columns['updatedAt'])
					setStrs.push('`updatedAt` = NOW()');

				var sql;
				if (me[model.primary]) {
					sql = "UPDATE " + model.table
							+ " SET " + setStrs.join(',')
							+ " WHERE `" + model.primary + "` = " + me[model.primary];
				} else {
					if (model.columns['createdAt'])
						setStrs.push('`createdAt` = NOW()');

					sql = "INSERT"
							+ " INTO " + model.table
							+ " SET " + setStrs.join(',');
				}


				act.toNext(db_query(sql));
			});

			act.next(function(result) {
				//log.debug("RESULT: " + JSON.stringify(result));

				if (result.insert_id) {
					me[model.primary] = result.insert_id;
				} else if (!me[model.primary]) {
					act.toError("No insert_id, and no extant primary key!");
					return;
				}

				
				logger.log("Successfully saved `" + model.ident + "` record `" + me[model.primary] + "`");

				act.toNext(me);
			});

			act.error(function(err) {
				logger.error("Error saving `" + model.ident + "` record: " + JSON.stringify(err));
				act.emitError(err);
			});

			return act;
		}

		/**
		 * Reloads the object's properties with the current database values.
		 */
		function reload() {
			var params = {}

			params[model.primary] = me[model.primary]
		
			var act = new NobleMachine(model.find(params));

			act.next(function(newInst) {
				if (newInst) {
					for (var col in model.columns) {
						me[col] = newInst[col];
					}

					act.toNext(me);
				} else {
					for (var key in model.columns) {
						me[key] = undefined
					}

					act.toNext(null);
				}
			});

			return act;
		}

		/**
		 * Removes this object's corresponding database row.
		 */
		function destroy() {
			var act = new NobleMachine(function() {
				if (me.onDestroy) {
					var preact = me.onDestroy();
					if (preact && preact.start instanceof Function) {
						act.toNext(preact)
						return;
					}
				}
			});

			act.next(function() {
				var sql = "DELETE FROM " + model.table
						+ " WHERE `" + model.primary + "` = " + me[model.primary];

				act.toNext(db_query(sql));
			});

			act.next(function() {
				logger.log("Successfully deleted `" + model.ident + "` record `" + me[model.primary] + "`");

				for (var param in me) {
					delete me[param];	
				}
			});

			act.error(function(err) {
				logger.error("Error deleting `" + model.ident + "` record: " + JSON.stringify(err));
				act.emitError(err);
			});

			return act;
		}

		// Generic setter for SQL-correspondent values. Forces typecasting for database compatibility.
		function setValue(key, val) {
			//util.log(key + ": " + JSON.stringify(val));

			if (val === null) {
				me.values[key] = null;
			} else if (val === undefined) {
				me.values[key] = undefined;
			} else {
				type = model.columns[key]['DATA_TYPE'];

				switch (type) {
					case 'datetime':
					case 'timestamp':
						me.values[key] = new Date(val);
						break;
					case 'text':
					case 'varchar':
						me.values[key] = val.toString();
						break;
					case 'int':
					case 'tinyint':
						if (model.columns[key]['COLUMN_TYPE'] == 'tinyint(1)') {
							me.values[key] = !!val // Boolean
						} else {
							me.values[key] = parseInt(val);
						}
						break;
					default:
						me.values[key] = val;
				}
			}
		}

		// Generic getter for SQL-correspondent values.
		function getValue(key) {
			return me.values[key];
		}

		for (var key in model.columns) {
			me.__defineSetter__(key, setValue.bind(me, key));
			me.__defineGetter__(key, getValue.bind(me, key));

			if (params[key] !== undefined) {
				setValue(key, params[key]);
			}
		}

		_.extend(me, {
			save: save,
			reload: reload,
			destroy: destroy,
			setValue: setValue
		});

		if (defFunc !== undefined) {
			defFunc(me);
		}

		return me;
	}
458998
function _parseParams(params) {
  return params.map((param) => {
    let result;
    switch (param.type) {
      case 'Identifier':
        result = new Param(param.name);
        break;
      case 'AssignmentPattern':
        result = new Param(param.left.name, true);
        break;
      case 'ObjectPattern': {
        const objParams = param.properties.map((objParam) => objParam.value);
        result = new Param('arguments', false, _parseParams(objParams));
        break;
      }
      default:
    }
    return result;
  });
}
1322743
function(parameters) {
            var that = this;
            _.each(parameters, function(params, property) {
                that.__setPropertyParam(property, params);
            });
            return that;
        }
803160
public static Map<String, Object> getParamMap(final Condition condition) {
    final Map<String, Object> params = new HashMap<String, Object>();
    if (!Strings.contains(condition.getContent(), "?")) {
      final List<String> paramNames = condition.getParamNames();
      /*
       * Abort check param and names for it will updated by params invocation
       * if (paramNames.size() > condition.getParams().size()) { throw new RuntimeException(
       * "condition params not set [" + condition.getContent() + "] with value:" +
       * condition.getParams()); }
       */
      for (int i = 0; i < paramNames.size(); i++) {
        if (i >= condition.getParams().size()) break;
        params.put(paramNames.get(i), condition.getParams().get(i));
      }
    }
    return params;
  }
869338
function (param, idx, all) {
        // helps handle weird edge cases such as "/get?a=b&&"
        if (param === EMPTY && // if param is empty
            _.isNumber(idx) && // this and the next condition ensures that this is part of a map call
            _.isArray(all) &&
            idx !== (all && (all.length - 1))) { // not last parameter in the array
            return { key: null, value: null };
        }

        var index = (typeof param === STRING) ? param.indexOf(EQUALS) : -1,
            paramObj = {};

        // this means that there was no value for this key (not even blank, so we store this info) and the value is set
        // to null
        if (index < 0) {
            paramObj.key = param.substr(0, param.length);
            paramObj.value = null;
        }
        else {
            paramObj.key = param.substr(0, index);
            paramObj.value = param.substr(index + 1);
        }

        return paramObj;
    }
1155679
@Override
    public Object convertParameter(Iterator<Object> parameters) {
        return binding.toColumnValue(parameters.next());
    }
518037
private Map<String, Object> bindParams(CallableSignatureContext sig, CallableInvocationContext inv) {
    
    if(inv == null) {
      return Collections.emptyMap();
    }

    Map<String, Object> vals = new HashMap<>();
    
    if (inv.posParams != null) {

      //
      // Ensure legality of call
      //

      // Can only use positional or named; not both
      if (inv.namedParams != null) {
        throw new InvocationException("only positional or named parameters are allowed", getLocation(inv));
      }

      //
      // Match up parameters
      //

      ListIterator<ParameterDeclContext> paramDeclIter = sig.paramDecls.listIterator();
      ListIterator<ExpressionContext> paramExprIter = inv.posParams.exprs.listIterator();
      
      ParameterDeclContext allDecl = null;

      while (paramDeclIter.hasNext()) {

        ParameterDeclContext paramDecl = paramDeclIter.next();

        if (paramDecl.flag != null && paramDecl.flag.getText().equals("*")) {
          if (allDecl != null) {
            throw new ExecutionException("only a single parameter can be marked with '*'", getLocation(paramDecl));
          }
          allDecl = paramDecl;
          continue;
        }
        
        String paramName = name(paramDecl);
        
        // Find expression (or use default)
        ExpressionContext paramExpr = paramExprIter.hasNext() ? paramExprIter.next() : paramDecl.expr;

        // Evaluate expression -> value
        Object paramVal = eval(paramExpr);

        vals.put(paramName, paramVal);
        
      }
      
      //
      // Add rest of parameters (if requested)
      //
      
      if (allDecl != null) {
        
        Map<String, Object> otherParams = new LinkedHashMap<>();
        
        while (paramExprIter.hasNext()) {
          
          int paramIdx = paramExprIter.nextIndex();
          
          ExpressionContext paramExpr = paramExprIter.next();
          
          Object paramVal = eval(paramExpr);
          
          otherParams.put(Integer.toString(paramIdx), paramVal);
        }
        
        vals.put(allDecl.id.getText(), otherParams);
      }
      
    }
    else if (inv.namedParams != null) {

      //
      // Ensure legality of call
      //

      // Can only use positional or named; not both
      if (inv.posParams != null) {
        throw new InvocationException("only positional or named parameters are allowed", getLocation(inv));
      }

      //
      // Load parameters
      //

      List<NamedValueContext> namedParameters = new ArrayList<>(inv.namedParams.namedValues);
      Iterator<ParameterDeclContext> paramDeclIter = sig.paramDecls.iterator();
      
      ParameterDeclContext allDecl = null;

      while (paramDeclIter.hasNext()) {

        ParameterDeclContext paramDecl = paramDeclIter.next();
        
        if (paramDecl.flag != null && paramDecl.flag.getText().equals("*")) {
          allDecl = paramDecl;
          continue;
        }
        
        String paramName = name(paramDecl);

        // Find expression
        ExpressionContext paramExpr = findAndRemoveValue(namedParameters, paramName);

        // Assign default (is needed)
        paramExpr = paramExpr != null ? paramExpr : paramDecl.expr;

        // Evaluate expression -> value
        Object paramVal = eval(paramExpr);

        vals.put(paramName, paramVal);
        
      }
      
      //
      // Add rest of parameters (if requested)
      //
      
      if (allDecl != null) {
        
        Map<String, Object> otherParams = new LinkedHashMap<>();
        
        for (NamedValueContext namedValue : namedParameters) {
          
          String paramName = namedValue.name.getText();
          
          Object paramVal = eval(namedValue.expr);
          
          otherParams.put(paramName, paramVal);
          
        }

        vals.put(allDecl.id.getText(), otherParams);
      }
      

    }

    return vals;
  }
1056504
public function parameterize($method)
    {
        $parameterArray = array();
        switch ($method) {
            case 'create':
                if(!is_null($this->getUrl())){
                    $parameterArray['url'] = $this->getUrl();
                }else{
                    $parameterArray['email'] = $this->getEmail();
                }
                $parameterArray['event_types'] = $this->getEventTypes();
                if (!is_null($this->getActive())) {
                    $parameterArray['active'] = $this->getActive();
                }
                break;
            case 'update':
                if(!is_null($this->getUrl())){
                    $parameterArray['url'] = $this->getUrl();
                }else{
                    $parameterArray['email'] = $this->getEmail();
                }
                $parameterArray['event_types'] = $this->getEventTypes();
                if (!is_null($this->getActive())) {
                    $parameterArray['active'] = $this->getActive();
                }
                break;
            case 'delete':
                break;
            case 'getOne':
                $parameterArray['count'] = 1;
                $parameterArray['offset'] = 0;
                break;
            case 'getAll':
                $parameterArray = $this->getFilter();
                break;
        }

        return $parameterArray;
    }
935384
protected function prepareParams($object,&$params) {
        //Get all readble object properties
        $properties = get_object_vars($object);
    
        /**
         * For each property, if it is instance of AbstractRequest, recursive function called
         * Else if value of property is scalar we assign it
         */
        foreach ($properties as $p=>$v){
            if(is_object($v) && $v instanceof AbstractRequest){
                
                $this->prepareParams($v,$params);
            }
            if(is_scalar($v)){
                $params[$p] = $v;
            }
        }
    
    }
295670
@Override
	public SqlContext paramList(final String parameterName, final Object... value) {
		return param(new Parameter(parameterName, Arrays.asList(value)));
	}