move parameters into fields?
481253
private void fillTableWithMatches(VariantGraphRanking ranking, VariantGraph graph, Iterable<Token> witness, Comparator<Token> comparator) {
        Matches matches = Matches.between(graph.vertices(), witness, comparator);
        Set<Token> unique = matches.uniqueInWitness;
        Set<Token> ambiguous = matches.ambiguousInWitness;
        int rowIndex = 0;
        for (Token t : witness) {
            if (unique.contains(t) || ambiguous.contains(t)) {
                List<VariantGraph.Vertex> matchingVertices = matches.allMatches.getOrDefault(t, Collections.emptyList());
                for (VariantGraph.Vertex vgv : matchingVertices) {
                    set(rowIndex, ranking.apply(vgv) - 1, t, vgv);
                }
            }
            rowIndex++;
        }
    }
810890
public static void moveFields(PdfDictionary from, PdfDictionary to) {
        for (Iterator i = from.getKeys().iterator(); i.hasNext();) {
            PdfName key = (PdfName)i.next();
            if (fieldKeys.containsKey(key)) {
                if (to != null)
                    to.put(key, from.get(key));
                i.remove();
            }
        }
    }
963108
function injectFields(string, values) {
	const fieldsModel = parseFields(string);
	const fieldsAmount = fieldsModel.fields.length;

	if (fieldsAmount) {
		values = values.slice();
		if (values.length > fieldsAmount) {
			// More values that output fields: collapse rest values into
			// a single token
			values = values.slice(0, fieldsAmount - 1)
				.concat(values.slice(fieldsAmount - 1).join(', '));
		}

		while (values.length) {
			const value = values.shift();
			const field = fieldsModel.fields.shift();
			const delta = value.length - field.length;

			fieldsModel.string = fieldsModel.string.slice(0, field.location)
				+ value
				+ fieldsModel.string.slice(field.location + field.length);

			// Update location of the rest fields in string
			for (let i = 0, il = fieldsModel.fields.length; i < il; i++) {
				fieldsModel.fields[i].location += delta;
			}
		}
	}

	return fieldsModel;
}
126844
def transform_params(param_node, scope_stack)
      param_node = param_node[1] if param_node[0] == :paren
      if param_node
        positional_1, optional, rest, positional_2, block = param_node[1..5]
        add_variable_list(positional_1, scope_stack, false) if positional_1
        if optional
          optional.each do |var, value|
            # MUST walk value first. (def foo(y=y); end) == (def foo(y=y()); end)
            transform_tree(value, scope_stack)
            add_variables_from_node(var, scope_stack, false)
          end
        end
        if rest && rest[1]
          add_variables_from_node(rest, scope_stack, false)
        end
        add_variable_list(positional_2, scope_stack, false) if positional_2
        add_variables_from_node(block, scope_stack, false) if block
      end
    end
604324
def add_fields(self, **fields):
        """"""
        self.__class__ = type(self.__class__.__name__,
                            (self.__class__,), fields)
        for k, v in fields.items():
            v.init_inst(self)
866489
@SuppressWarnings("unchecked")
	private Map<String, Object> buildParameters(Object parameters) {
		Map<String, Object> parameterMap = new HashMap<String, Object>();

		if (parameters != null) {
			if (parameters.getClass().isArray()) {
				Object[] paramValues = (Object[]) parameters;
				for (int i = 0; i < paramValues.length; i++) {
					if (paramValues[i] == null) {
						paramValues[i] = "";
					}
					parameterMap.put(Integer.toString(i), paramValues[i]);
				}
			} else if (parameters instanceof Map) {
				parameterMap = (Map<String, Object>) parameters;
			} else {
				Class<? extends Object> paramClass = parameters.getClass();
				Field[] fields = paramClass.getDeclaredFields();
				for (Field field : fields) {
					field.setAccessible(true);

					String fieldName = field.getName();
					Object fieldValue = null;
					try {
						fieldValue = field.get(parameters);
					} catch (Exception e) {
						fieldValue = null;
					}
					if (fieldName != null && fieldValue != null) {
						parameterMap.put(fieldName, fieldValue);
					}
				}
			}
		}

		return parameterMap;
	}
854978
public void out2field(Object from, String from_out, Object o, String field) {
        controller.mapOutField(from, from_out, o, field);
    }
736664
def rename_fields(input, **params):
    
    PARAM_RENAME_LIST = 'rename'
    RENAME_SRC_FIELD = 'src.field'
    RENAME_DEST_FIELD = 'dest.field'

    rename_list = params.get(PARAM_RENAME_LIST)
    for row in input:
        for rename in rename_list:
            row[rename[RENAME_DEST_FIELD]] = row[rename[RENAME_SRC_FIELD]]
            row.pop(rename[RENAME_SRC_FIELD])
    return input
196027
def parameter_action(self, text, loc, par):
        """"""
        exshared.setpos(loc, text)
        if DEBUG > 0:
            print("PARAM:",par)
            if DEBUG == 2: self.symtab.display()
            if DEBUG > 2: return
        index = self.symtab.insert_parameter(par.name, par.type)
        self.shared.function_params += 1
        return index
319976
public void field2in(Object o, String field, Object to) {
        field = field.trim();
        if (field.indexOf(' ') > 0) {           // maybe multiple field names given
            String[] fields = field.split("\\s+");
            for (String f : fields) {
                field2in(o, f, to, f);
            }
        } else {
            field2in(o, field, to, field);
        }
    }
293797
def field_or_param(key)

      key = key.to_s

      h.fields[key] || (h.fields['params'] || {})[key]
    end
463576
def _addSortParam(self, field, order=''):
		""""""

		if order != '':
			validSortOrders = {
				'ascend':'ascend',
				'ascending':'ascend',
				'<':'ascend',
				'descend':'descend',
				'descending':'descend',
				'>':'descend'
			}

			if not string.lower(order) in validSortOrders.keys():
				raise FMError, 'Invalid sort order for "' + field + '"'

		self._sortParams.append(
			[field, validSortOrders[string.lower(order)]]
		)
422253
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, CLASS_INFO_CLASS_NAME, 40, null, null);
        field = new FieldInfo(this, CLASS_INFO_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, CLASS_FIELD_CLASS, 60, null, null);
        field = new FieldInfo(this, CLASS_FIELD_SEQUENCE, 10, null, new Integer(0));
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, CLASS_FIELD_NAME, 40, null, null);
        field = new FieldInfo(this, CLASS_FIELD_DESC, 30, null, null);
        field = new FieldInfo(this, CLASS_FIELD_PROTECT, 30, null, null);
        field = new FieldInfo(this, CLASS_FIELD_INITIAL, 32000, null, null);
        field = new FieldInfo(this, CLASS_FIELD_INITIAL_VALUE, 32000, null, null);
        field = new FieldInfo(this, CLASS_FIELDS_TYPE, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field = new FieldInfo(this, INCLUDE_SCOPE, 10, null, new Integer(0x004));
        field.setDataClass(Integer.class);
    }
1312149
def add_parameter(self, parameter):
        """"""
        if parameter.name.lower() not in self.paramorder:
            self.paramorder.append(parameter.name.lower())
        self._parameters[parameter.name.lower()] = parameter
883618
public static void fieldsToString (
            StringBuilder buf, Object object, String sep)
    {
        Class<?> clazz = object.getClass();
        Field[] fields = clazz.getFields();
        int written = 0;

        // we only want non-static fields
        for (Field field : fields) {
            int mods = field.getModifiers();
            if ((mods & Modifier.PUBLIC) == 0 || (mods & Modifier.STATIC) != 0) {
                continue;
            }

            if (written > 0) {
                buf.append(sep);
            }

            // look for a toString() method for this field
            buf.append(field.getName()).append("=");
            try {
                try {
                    Method meth = clazz.getMethod(field.getName() + "ToString", new Class<?>[0]);
                    buf.append(meth.invoke(object, (Object[]) null));
                } catch (NoSuchMethodException nsme) {
                    toString(buf, field.get(object));
                }
            } catch (Exception e) {
                buf.append("<error: " + e + ">");
            }
            written++;
        }
    }
713169
def _param_fields(kwargs, fields):
  
  if fields is None:
    return
  if type(fields) in [list, set, frozenset, tuple]:
    fields = {x: True for x in fields}
  if type(fields) == dict:
    fields.setdefault("_id", False)
  kwargs["projection"] = fields
1278997
protected void appendParameters(StringBuilder buffer,String parameters)
    {
        if((parameters!=null)&&(parameters.length()>0))
        {
            String updatedParameters=parameters;
            if(parameters.startsWith("?"))
            {
                updatedParameters=parameters.substring(1);
            }
            
            if(updatedParameters.length()>0)
            {
                int currentLength=buffer.length();
                if((currentLength>0)&&(buffer.charAt(currentLength-1)=='/'))
                {
                    int length=currentLength;
                    buffer.delete(length-1,length);
                }
                
                //add separator
                buffer.append("?");
    
                try
                {
                    String[] parameterPairs=updatedParameters.split("&");
                    int amount=parameterPairs.length;
                    String parameterPair=null;
                    String[] values=null;
                    boolean addedParameters=false;
                    for(int index=0;index<amount;index++)
                    {
                        //get next element
                        parameterPair=parameterPairs[index];
                        
                        //split to key/value
                        values=parameterPair.split("=");
                        if(values.length==2)
                        {
                            if(addedParameters)
                            {
                                buffer.append("&");
                            }
                            
                            buffer.append(URLEncoder.encode(values[0],"UTF-8"));
                            buffer.append("=");
                            buffer.append(URLEncoder.encode(values[1],"UTF-8"));
                            
                            //set flag
                            addedParameters=true;
                        }
                    }
                }
                catch(Exception exception)
                {
                    throw new FaxException("Unable to encode parameters.",exception);
                }
            }
        }
    }