合并系统变量(-D)，环境变量 和默认值，以系统变量优先
340370
public static String getString(String propertyName, String envName, String defaultValue) {
		checkEnvName(envName);
		String propertyValue = System.getProperty(propertyName);
		if (propertyValue != null) {
			return propertyValue;
		} else {
			propertyValue = System.getenv(envName);
			return propertyValue != null ? propertyValue : defaultValue;
		}
	}
1049989
function(param) {
      var step, start, res;
      //如果无参数 当成是获取第一个元素
      if (!param || !(param = param.replace(/\s+/g, ""))) {
        return {
          start: 1,
          step: 0
        };
      }
      if (res = nthCache.get(param)) return res;
      // 对even odd等转化为标准的a，b组合(即step与start)
      if (param == "even") {
        start = 2;
        step = 2;
      } else if (param == "odd") {
        step = 2;
        start = 1;
      } else {
        res = param.match(nthValueReg);
        // 对错误的nth参数抛出错误
        if (!res) step = null; // 无论其他参数，如果step为null，则永远为false
        else {
          if (res[1]) {
            step = 0;
            start = parseInt(res[1]);
          } else {
            if (res[2] == "-") res[2] = "-1";
            step = res[2] ? parseInt(res[2]) : 1;
            start = res[3] ? parseInt(res[3]) : 0;
          }
        }
      }
      if (start < 1) {
        if (step < 1) {
          step = null; //标志false
        } else {
          start = -(-start) % step + step;
        }
      }
      return nthCache.set(param, {
        start: start,
        step: step
      });
    }
1102730
def _D(self, R):
        """"""
        return (0.3 * self._HNn**2 / self._sin_alpha / R
                + self._HNn + R * self._sin_alpha) / (0.3 * self._HNn + R * self._sin_alpha)
1198991
function getFormat0Segment(glyfUnicodes) {
            var unicodes = [];
            glyfUnicodes.forEach(function (u) {
                if (u.unicode !== undefined && u.unicode < 256) {
                    unicodes.push([u.unicode, u.id]);
                }
            });

            // 按编码排序
            unicodes.sort(function (a, b) {
                return a[0] - b[0];
            });

            return unicodes;
        }
1008607
function(d2) {

      var w = this['w'];
      var x = this['x'];
      var y = this['y'];
      var z = this['z'];

      var n = w * w + x * x + y * y + z * z;
      var s = n === 0 ? 0 : 2 / n;
      var wx = s * w * x, wy = s * w * y, wz = s * w * z;
      var xx = s * x * x, xy = s * x * y, xz = s * x * z;
      var yy = s * y * y, yz = s * y * z, zz = s * z * z;

      if (d2) {
        return [
          [1 - (yy + zz), xy - wz, xz + wy],
          [xy + wz, 1 - (xx + zz), yz - wx],
          [xz - wy, yz + wx, 1 - (xx + yy)]];
      }

      return [
        1 - (yy + zz), xy - wz, xz + wy,
        xy + wz, 1 - (xx + zz), yz - wx,
        xz - wy, yz + wx, 1 - (xx + yy)];
    }
1220437
function getNewImageDimentions(img, width, height) {
    var detImg = img.width / img.height;
    if (width > 0 && height > 0) {
      // 同时指定了宽高，按原图缩放
      if (width / height > detImg) {
        height = width / detImg;
      } else {
        width = height * detImg;
      }
      return [ width, height ];
    } else if (width > 0) {
      // 只指定宽度的情况
      return [ width, width / detImg ];
    } else if (height > 0) {
      // 只指定高度的情况
      return [ height * detImg, height ];
    } else {
      // 否则原 size 返回
      return [ img.width, img.height ];
    }
  }
451976
public static DictionaryMaker combineWithNormalization(String[] pathArray)
    {
        DictionaryMaker dictionaryMaker = new DictionaryMaker();
        logger.info("正在处理主词典" + pathArray[0]);
        dictionaryMaker.addAll(DictionaryMaker.loadAsItemList(pathArray[0]));
        for (int i = 1; i < pathArray.length; ++i)
        {
            logger.info("正在处理副词典" + pathArray[i] + "，将执行新词合并模式");
            dictionaryMaker.addAllNotCombine(DictionaryMaker.loadAsItemList(pathArray[i]));
        }
        return dictionaryMaker;
    }
1072419
function getCustomDeps(info) {
    var res = [];

    if (info.modules && Array.isArray(info.modules)) {
        info = info.modules;
    }
    else {
        info = [];
    }

    info.forEach(function (item) {
        // 只包含额外需要包含的模块
        // 对额外排除的模块不做处理
        if (item.charAt(0) === '~') {
            res.push(item.substring(1));
        }
    });

    return res;
}
850598
private static final void divmod(byte[] q, byte[] r, int n, byte[] d, int t) {
		int rn = 0;
		int dt = ((d[t-1] & 0xFF) << 8);
		if (t>1) {
			dt |= (d[t-2] & 0xFF);
		}
		while (n-- >= t) {
			int z = (rn << 16) | ((r[n] & 0xFF) << 8);
			if (n>0) {
				z |= (r[n-1] & 0xFF);
			}
			z/=dt;
			rn += mula_small(r,r, n-t+1, d, t, -z);
			q[n-t+1] = (byte)((z + rn) & 0xFF); /* rn is 0 or -1 (underflow) */
			mula_small(r,r, n-t+1, d, t, -rn);
			rn = (r[n] & 0xFF);
			r[n] = 0;
		}
		r[t-1] = (byte)rn;
	}
1365067
def merge_moments(m_a, m_a2, m_a3, m_a4, n_a, m_b, m_b2, m_b3, m_b4, n_b):
    '''
    
    '''
    delta = m_b - m_a
    delta_2 = delta * delta
    delta_3 = delta * delta_2
    delta_4 = delta * delta_3
    n_x = n_a + n_b
    m_x = m_a + delta * n_b / n_x
    m_x2 = m_a2 + m_b2 + delta_2 * n_a * n_b / n_x
    m_x3 = m_a3 + m_b3 + delta_3 * n_a * n_b * (n_a - n_b) + 3 * delta * (n_a * m_2b - n_b * m_2a) / n_x
    m_x4 = (m_a4 + m_b4 + delta_4 * (n_a * n_b * (n_a * n_a - n_a * n_b + n_b * n_b)) / (n_x ** 3) +
            6 * delta_2 * (n_a * n_a * m_b2 + n_b * n_b * m_a2) / (n_x ** 2) +
            4 * delta * (n_a * m_b3 - n_b * m_a3) / n_x )
    return m_x, m_x2, m_x3, m_x4, n_x
575812
function (a, b, c, d, e, ...args) {
	return [a, b, c, d, e].concat(args);
}
1237142
function otfContours2ttfContours(otfContours) {
            if (!otfContours || !otfContours.length) {
                return otfContours;
            }
            var contours = [];
            for (var i = 0, l = otfContours.length; i < l; i++) {

                // 这里可能由于转换错误导致空轮廓，需要去除
                if (otfContours[i][0]) {
                    contours.push(transformContour(otfContours[i]));
                }
            }

            return contours;
        }
273939
function getSegments(glyfUnicodes, bound) {

            var prevGlyph = null;
            var result = [];
            var segment = {};

            glyfUnicodes.forEach(function (glyph) {

                if (bound === undefined || glyph.unicode <= bound) {
                    // 初始化编码头部，这里unicode和graph id 都必须连续
                    if (prevGlyph === null
                        || glyph.unicode !== prevGlyph.unicode + 1
                        || glyph.id !== prevGlyph.id + 1
                    ) {
                        if (prevGlyph !== null) {
                            segment.end = prevGlyph.unicode;
                            result.push(segment);
                            segment = {
                                start: glyph.unicode,
                                startId: glyph.id,
                                delta: encodeDelta(glyph.id - glyph.unicode)
                            };
                        }
                        else {
                            segment.start = glyph.unicode;
                            segment.startId = glyph.id;
                            segment.delta = encodeDelta(glyph.id - glyph.unicode);
                        }
                    }

                    prevGlyph = glyph;
                }
            });

            // need to finish the last segment
            if (prevGlyph !== null) {
                segment.end = prevGlyph.unicode;
                result.push(segment);
            }

            // 返回编码范围
            return result;
        }
1126947
private Viterbi<PersonNode> getPersonNodeViterbi(Term[] terms) {
        Term first;
        PersonNatureAttr fPna;
        Term second;
        Term third;
        Term from;
        for (int i = 0; i < terms.length - 1; i++) {
            first = terms[i];

            if (first == null) {
                continue;
            }

            fPna = getPersonNature(first);
            setNode(first, A);

            if (fPna.getY() > 0) {
                setNode(first, Y);
            }

            if (!fPna.isActive()) {
                continue;
            }

            second = first.to();
            if (second.getOffe() == terms.length || second.getName().length() > 2) { //说明到结尾了,或者后面长度不符合规则
                continue;
            }

            third = second.to();
            from = first.from();


            //XD
            if (first.getName().length() == 2) {
                setNode(from, K);
                setNode(from, M);
                setNode(first, X);
                setNode(second, D);
                setNode(third, M);
                setNode(third, L);
                continue;
            }

            setNode(from, K);
            setNode(from, M);
            setNode(first, B);
            setNode(third, M);
            setNode(third, L);
            //BZ
            if (second.getName().length() == 2) {
                setNode(second, Z);
                continue;
            } else {//BE
                setNode(second, E);
            }


            if (third.getOffe() == terms.length || third.getName().length() > 1) { //说明到结尾了,或者后面长度不符合规则
                continue;
            }

            //BCD
            setNode(first, B);
            setNode(second, C);
            setNode(third, D);
            setNode(third.to(), M);
            setNode(third.to(), L);

        }
        PersonNatureAttr begin = DATDictionary.person("BEGIN");

        nodes[0][6] = null;
        nodes[0][4] = new PersonNode(4, "B", -Math.log(begin.getK()));
        nodes[0][10] = new PersonNode(10, "B", -Math.log(begin.getA()));

        PersonNatureAttr end = DATDictionary.person("END");
        nodes[terms.length][5] = new PersonNode(5, "E", -Math.log(end.getL()));
        nodes[terms.length][6] = null;
        nodes[terms.length][10] = new PersonNode(10, "E", -Math.log(end.getA()));

        return new Viterbi<PersonNode>(nodes, new Values<PersonNode>() {
            @Override
            public int step(Node<PersonNode> node) {
                return node.getObj().name.length();
            }

            @Override
            public double selfSscore(Node<PersonNode> node) {
                return node.getObj().score;
            }

        });
    }
557638
def join(C, *args, **kwargs):
        """"""
        u = C('/'.join([str(arg).strip('/') for arg in args]), **kwargs)
        return u
1027790
private void select(int dataIndex, String[] resultList, int resultIndex, List<String[]> result) {
		int resultLen = resultList.length;
		int resultCount = resultIndex + 1;
		if (resultCount > resultLen) { // 全部选择完时，输出组合结果
			result.add(Arrays.copyOf(resultList, resultList.length));
			return;
		}

		// 递归选择下一个
		for (int i = dataIndex; i < datas.length + resultCount - resultLen; i++) {
			resultList[resultIndex] = datas[i];
			select(i + 1, resultList, resultIndex + 1, result);
		}
	}
264507
function redundant(prev, p, next) {

            // 是否重合的点, 只有两个点同在曲线上或者同不在曲线上移出
            if (
                (p.onCurve && next.onCurve || !p.onCurve && !next.onCurve)
                && Math.pow(p.x - next.x, 2) + Math.pow(p.y - next.y, 2) <= 1
            ) {
                return true;
            }

            // 三点同线 检查直线点
            if (
                (p.onCurve && prev.onCurve && next.onCurve)
                && Math.abs((next.y - p.y) * (prev.x - p.x) - (prev.y - p.y) * (next.x - p.x)) <= 0.001
            ) {
                return true;
            }

            // 三点同线 检查控制点
            if (
                (!p.onCurve && prev.onCurve && next.onCurve)
                && Math.abs((next.y - p.y) * (prev.x - p.x) - (prev.y - p.y) * (next.x - p.x)) <= 0.001
            ) {
                return true;
            }

            return false;
        }