special treatment of array values was suggested by 'lizongbo'
339099
private static void deeplyAppendParameter(StringBuffer sbuf, Object o,
                                            Map<Object[], Void> seenMap) {
    if (o == null) {
      sbuf.append("null");
      return;
    }
    if (!o.getClass().isArray()) {
      safeObjectAppend(sbuf, o);
    } else {
      // check for primitive array types because they
      // unfortunately cannot be cast to Object[]
      if (o instanceof boolean[]) {
        booleanArrayAppend(sbuf, (boolean[]) o);
      } else if (o instanceof byte[]) {
        byteArrayAppend(sbuf, (byte[]) o);
      } else if (o instanceof char[]) {
        charArrayAppend(sbuf, (char[]) o);
      } else if (o instanceof short[]) {
        shortArrayAppend(sbuf, (short[]) o);
      } else if (o instanceof int[]) {
        intArrayAppend(sbuf, (int[]) o);
      } else if (o instanceof long[]) {
        longArrayAppend(sbuf, (long[]) o);
      } else if (o instanceof float[]) {
        floatArrayAppend(sbuf, (float[]) o);
      } else if (o instanceof double[]) {
        doubleArrayAppend(sbuf, (double[]) o);
      } else {
        objectArrayAppend(sbuf, (Object[]) o, seenMap);
      }
    }
1117279
function arrayHasValue(arr, value) {
        var idx = arr.indexOf(value);
        if (idx !== -1) {
            return true;
        }
        return false;
    }
1126368
function setArray(array, newArray) {
    error_if_values_are_not_arrays_1.errorIfValuesAreNotArrays([array, newArray]);
    // These 2 lines make sure any memory reference to array is not broken:
    array.length = 0;
    array.push.apply(array, newArray);
}
858086
def sumai(array):
    
    n = ctypes.c_int(len(array))
    array = stypes.toIntVector(array)
    return libspice.sumai_c(array, n)
124243
def optimizer_array(self, p):
        
        f = None
        if self.has_parent() and self.constraints[__fixed__].size != 0:
            f = np.ones(self.size).astype(bool)
            f[self.constraints[__fixed__]] = FIXED
        elif self._has_fixes():
            f = self._fixes_
        if f is None:
            self.param_array.flat = p
            [np.put(self.param_array, ind, c.f(self.param_array.flat[ind]))
             #py3 fix
             #for c, ind in self.constraints.iteritems() if c != __fixed__]
             for c, ind in self.constraints.items() if c != __fixed__]
        else:
            self.param_array.flat[f] = p
            [np.put(self.param_array, ind[f[ind]], c.f(self.param_array.flat[ind[f[ind]]]))
             #py3 fix
             #for c, ind in self.constraints.iteritems() if c != __fixed__]
             for c, ind in self.constraints.items() if c != __fixed__]
        #self._highest_parent_.tie.propagate_val()

        self._optimizer_copy_transformed = False
        self.trigger_update()
490092
private Value[] compactValues( Value[] inputValues ) {
        if (inputValues == null) {
            return null;
        }
        List<Value> compactedList = new ArrayList<Value>();
        for (Value inputValue : inputValues) {
            if (inputValue != null) {
                compactedList.add(inputValue);
            }
        }
        return compactedList.toArray(new Value[0]);
    }
1198405
function dealArr(arr, isFromDefine, mName) {
        arr = String(arr).split(',');
        var len = arr.length;
        if(len === 0) {
            return arr[0] === '' ? _emptyArr : arr;
        }
        var back = [],
            obj = {},
            val;
        for(var i = 0; i < len; i++) {
            val = arr[i];

            if(val !== '' && !obj[val]) {
                obj[val] = 1;
                back.push(val);

                isFromDefine === 'define' && (Module.parentModule[val] = mName); //定义父模块               
            }
        }
        obj = null;
        return back;
    }
1265292
private static int argmax(final double[] values) {
        double max = -Double.MAX_VALUE;
        int max_index = -1;
        for (int i = 0; i < values.length; i++) {
            if (values[i] > max) {
                max = values[i];
                max_index = i;
            }
        }

        return max_index;
    }
1310563
public static Object toPrimitiveArray(Object[] array) {
        Class primitiveType;
        if (array.length > 0) {
            LOG.debug("很可能array是用new Object[length]()构造的，这个时候array.getClass().getComponentType()返回的是Object类型，这不是我们期望的" +
                    "我们希望使用元素的实际类型，这里有一个风险点，即数组类型不一致,后面可能就会抛出类型转换异常");
            primitiveType = Reflection.getPrimitiveType(array[0].getClass());
        } else {
            primitiveType = Reflection.getPrimitiveType(array.getClass().getComponentType());
        }
        Object primitiveArray = Array.newInstance(primitiveType, array.length);
        for (int i = 0; i < array.length; i++) {
            Array.set(primitiveArray, i, array[i]);
        }
        return primitiveArray;
    }
1159087
private static void exch(long[] values, int i, int j) {
        long k = values[i];
        values[i] = values[j];
        values[j] = k;
    }
368365
function(array) {
    var length = array.length;

    array[0] += array[1];

    var headNode, tailNode, topNode, temp;
    for (headNode = 0, tailNode = 1, topNode = 2;
         tailNode < (length - 1);
         tailNode++) {
      if ((topNode >= length) || (array[headNode] < array[topNode])) {
        temp = array[headNode];
        array[headNode++] = tailNode;
      } else {
        temp = array[topNode++];
      }

      if ((topNode >= length) ||
          ((headNode < tailNode) && (array[headNode] < array[topNode]))) {
        temp += array[headNode];
        array[headNode++] = tailNode + length;
      } else {
        temp += array[topNode++];
      }

      array[tailNode] = temp;
    }
  }
1006428
function iteratorToArray(iterator) {
        var data,
            result = [];

        while (!(data = iterator.next()).done) {
            result.push(data.value);
        }
        return result;
    }
1292481
private void buildValuePartForIN(StringBuilder conditionStrBuilder, List<Object> paramValues) {
		conditionStrBuilder.append(" (");
		final Object value = this.value;
		if (isPlaceHolder()) {
			List<?> valuesForIn;
			// 占位符对应值列表
			if (value instanceof CharSequence) {
				valuesForIn = StrUtil.split((CharSequence) value, ',');
			} else {
				valuesForIn = Arrays.asList(Convert.convert(String[].class, value));
				if (null == valuesForIn) {
					valuesForIn = CollUtil.newArrayList(Convert.toStr(value));
				}
			}
			conditionStrBuilder.append(StrUtil.repeatAndJoin("?", valuesForIn.size(), ","));
			if(null != paramValues) {
				paramValues.addAll(valuesForIn);
			}
		} else {
			conditionStrBuilder.append(StrUtil.join(",", value));
		}
		conditionStrBuilder.append(')');
	}
29827
function _Array_forEach(array, block, context) {
  if (array == null) array = global;
  var length = array.length || 0, i; // preserve length
  if (typeof array == "string") {
    for (i = 0; i < length; i++) {
      block.call(context, array.charAt(i), i, array);
    }
  } else { // Cater for sparse arrays.
    for (i = 0; i < length; i++) {    
    /*@cc_on @*/
    /*@if (@_jscript_version < 5.2)
      if ($Legacy.has(array, i))
    @else @*/
      if (i in array)
    /*@end @*/
        block.call(context, array[i], i, array);
    }
  }
}
795571
def p_array(self,t):
    
    if len(t)==4: t[0] = ArrayLit(t[2].children)
    elif len(t)==5: t[0] = ArrayLit(t[3].children)
    else: raise NotImplementedError('unk_len',len(t)) # pragma: no cover
945969
public void update(int[] goldIndex, int[] predictIndex)
    {
        for (int i = 0; i < goldIndex.length; ++i)
        {
            if (goldIndex[i] == predictIndex[i])
                continue;
            else // 预测与答案不一致
            {
                parameter[goldIndex[i]]++; // 奖励正确的特征函数（将它的权值加一）
                if (predictIndex[i] >= 0 && predictIndex[i] < parameter.length)
                    parameter[predictIndex[i]]--; // 惩罚招致错误的特征函数（将它的权值减一）
                else
                {
                    throw new IllegalArgumentException("更新参数时传入了非法的下标");
                }
            }
        }
    }
327927
function () {
        var data = this.data;
        if (data instanceof Array) {
            data.length = this._len;
            if (hasTypedArray) {
                this.data = new Float32Array(data);
            }
        }
    }