创建并返回一个驱动对象
此函数创建的对象，非单列对象
424630
public static function create(...$args) {
        $alias = get_called_class();

        $config = end($args)?:[];
        $class = self::parse($alias,$config);

        return Pool::make($class,$args);
    }
910284
public T get(Object key) {
		if (circle.isEmpty()) {
			return null;
		}
		int hash = hashFunc.hash(key);
		if (!circle.containsKey(hash)) {
			SortedMap<Integer, T> tailMap = circle.tailMap(hash);	//返回此映射的部分视图，其键大于等于 hash
			hash = tailMap.isEmpty() ? circle.firstKey() : tailMap.firstKey();
		}
		//正好命中
		return circle.get(hash);
	}
187176
private synchronized static Forest init(String key, KV<String, Forest> kv, boolean reload) {
        Forest forest = kv.getV();
        if (forest != null) {
            if (reload) {
                forest.clear();
            } else {
                return forest;
            }
        } else {
            forest = new Forest();
        }
        try {

            LOG.debug("begin init dic !");
            long start = System.currentTimeMillis();
            String temp = null;
            String[] strs = null;
            Value value = null;
            try (BufferedReader br = IOUtil.getReader(PathToStream.stream(kv.getK()), "UTF-8")) {
                while ((temp = br.readLine()) != null) {
                    if (StringUtil.isNotBlank(temp)) {
                        temp = StringUtil.trim(temp);
                        strs = temp.split("\t");
                        strs[0] = strs[0].toLowerCase();
                        // 如何核心辞典存在那么就放弃
                        if (MyStaticValue.isSkipUserDefine && DATDictionary.getId(strs[0]) > 0) {
                            continue;
                        }
                        if (strs.length != 3) {
                            value = new Value(strs[0], DEFAULT_NATURE, DEFAULT_FREQ_STR);
                        } else {
                            value = new Value(strs[0], strs[1], strs[2]);
                        }
                        Library.insertWord(forest, value);
                    }
                }
            }
            LOG.info("load dic use time:" + (System.currentTimeMillis() - start) + " path is : " + kv.getK());
            kv.setV(forest);
            return forest;
        } catch (Exception e) {
            LOG.error("Init dic library error :" + e.getMessage() + ", path: " + kv.getK());
            DIC.remove(key);
            return null;
        }
    }
50518
@Override
	public void run() {
		int maxNewConnections;

		while (run) {
			maxNewConnections = 0;
			try {
				if (this.lazyInit) { // 无视第一次的信号量
					this.thriftConnectionPartition.getPoolWatchThreadSignalQueue().take();
				}

				maxNewConnections = this.thriftConnectionPartition.getMaxConnections()
						- this.thriftConnectionPartition.getCreatedConnections();

				while (maxNewConnections == 0 || (this.thriftConnectionPartition.getAvailableConnections() * 100
						/ this.thriftConnectionPartition.getMaxConnections() > this.poolAvailabilityThreshold)) {
					if (maxNewConnections == 0) {
						this.thriftConnectionPartition.setUnableToCreateMoreTransactions(true);
					}

					this.thriftConnectionPartition.getPoolWatchThreadSignalQueue().take();
					if (!run) {
						break;
					}
					maxNewConnections = this.thriftConnectionPartition.getMaxConnections()
							- this.thriftConnectionPartition.getCreatedConnections();

				}

				if (maxNewConnections > 0 && !this.thriftConnectionPool.poolShuttingDown) {
					fillConnections(Math.min(maxNewConnections, this.thriftConnectionPartition.getAcquireIncrement()));

					if (this.thriftConnectionPartition.getCreatedConnections() < this.thriftConnectionPartition
							.getMinConnections()) {
						fillConnections(this.thriftConnectionPartition.getMinConnections()
								- this.thriftConnectionPartition.getCreatedConnections());

					}
				}

				if (this.thriftConnectionPool.poolShuttingDown) {
					return;
				}

			} catch (InterruptedException e) {
				// 发生中断事件 停止运行监听器
				if (logger.isDebugEnabled()) {
					logger.debug("Terminating pool watch thread");
				}
				return;
			}
		}
	}
844338
function() {
			if(index < count) {
				inspectors[index++].inspect(this); // 执行递归，进行下一轮检查
			} else if(index++ === count) {
				ctrler.execute(); // 当inspector 被执行完时，执行 controller
				end();
			}
		}
292525
public void loadData() throws Exception{

		System.out.print("Loading training data ...");
		long beginTime = System.currentTimeMillis();

		Pipe pipe = createProcessor();


		trainSet = new InstanceSet(pipe, factory);
		labels = factory.DefaultLabelAlphabet();
		features = factory.DefaultFeatureAlphabet();
		features.setStopIncrement(false);
		labels.setStopIncrement(false);

		// 训练集
		trainSet.loadThruStagePipes(new SequenceReader(train, true));

		long endTime = System.currentTimeMillis();
		System.out.println(" done!");
		System.out.println("Time escape: " + (endTime - beginTime) / 1000 + "s");
		System.out.println();

		// 输出
		System.out.println("Training Number: " + trainSet.size());
		System.out.println("Label Number: " + labels.size()); // 标签个数
		System.out.println("Feature Number: " + features.size()); // 特征个数
		System.out.println();

		// 冻结特征集
		features.setStopIncrement(true);
		labels.setStopIncrement(true);


		// 读入测试数据
		if (testfile != null) {
			System.out.print("Loading test data ...");
			boolean hasTarget = true;;
			if (!hasTarget) {// 如果test data没有标注
				pipe = featurePipe;
			} 

			// 测试集
			testSet = new InstanceSet(pipe);
			testSet.loadThruStagePipes(new SequenceReader(testfile, hasTarget, "utf8"));
			System.out.println("Test Number: " + testSet.size()); // 样本个数
		}
	}
680410
function(data){
			//console.log(data);
			//丢弃data的第一行
			var res = '', i = 1, len = data.length;
			for(; i < len; i++){
				res += data[i].replace(/^[\t ]+/, '');
			}
			return res;
		}
1300243
synchronized public void initSingle() {
		if (setting == null) {
			try {
				setting = new Setting(MONGO_CONFIG_PATH, true);
			} catch (Exception e) {
				// 在single模式下，可以没有配置文件。
			}
		}

		String group = StrUtil.EMPTY;
		if (null == this.serverAddress) {
			//存在唯一分组
			if (groups != null && groups.length == 1) {
				group = groups[0];
			}
			serverAddress = createServerAddress(group);
		}

		final MongoCredential credentail = createCredentail(group);
		try {
			if (null == credentail) {
				mongo = new MongoClient(serverAddress, buildMongoClientOptions(group));
			} else {
				mongo = new MongoClient(serverAddress, credentail, buildMongoClientOptions(group));
			}
		} catch (Exception e) {
			throw new DbRuntimeException(StrUtil.format("Init MongoDB pool with connection to [{}] error!", serverAddress), e);
		}

		log.info("Init MongoDB pool with connection to [{}]", serverAddress);
	}
772461
public synchronized void  loadAll(){
		group.clear();
		count=0;

		List<File> files = MyFiles.getAllFiles(fileName, ".txt");
		if(files==null||files.size()==0){
			System.err.println("模板为空");
		}
		try {
			for(int i=0;i<files.size();i++){
					read(files.get(i).toString());
					//记录文件修改时间
					lastModTime.put(files.get(i).toString(),files.get(i).lastModified());

			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		System.out.println("总模板数: " +count);
	}
656516
private void select(String[] resultList, int resultIndex, List<String[]> result) {
		int resultLen = resultList.length;
		if (resultIndex >= resultLen) { // 全部选择完时，输出排列结果
			result.add(Arrays.copyOf(resultList, resultList.length));
			return;
		}

		// 递归选择下一个
		for (int i = 0; i < datas.length; i++) {
			// 判断待选项是否存在于排列结果中
			boolean exists = false;
			for (int j = 0; j < resultIndex; j++) {
				if (datas[i].equals(resultList[j])) {
					exists = true;
					break;
				}
			}
			if (false == exists) { // 排列结果不存在该项，才可选择
				resultList[resultIndex] = datas[i];
				select(resultList, resultIndex + 1, result);
			}
		}
	}
710653
@Override
	public Object call(Object[] args, Context context) {
		// 只能有一个参数且只能为字符串
		if ((args.length >= 1) && (args[0] instanceof String) && (args[0] != null)) {
			String spel = (String) args[0];
			Expression expression = getExpression(spel);
			// 如果有第二参数，取他作为根对象
			if ((args.length >= 2) && (args[1] != null)) {
				return expression.getValue(createEvaluationContext(args[1], context));
			} else {
				return expression.getValue(createEvaluationContext(Collections.emptyMap(), context));
			}
		}
		return null;
	}
347157
public boolean tryLock() throws KeeperException {
        // 可能初始化的时候就失败了
        if (exception != null) {
            throw exception;
        }

        if (isOwner()) {// 锁重入
            return true;
        }

        acquireLock(null);

        if (exception != null) {
            unlock();
            throw exception;
        }

        if (interrupt != null) {
            unlock();
            Thread.currentThread().interrupt();
        }

        if (other != null) {
            unlock();
            throw new NestableRuntimeException(other);
        }

        return isOwner();
    }
875001
private static Object getFieldValue(Class<?> cls, String fieldName, String strValue) {
		try {
			Class<?> type = Reflections.getDeclaredField(cls, fieldName).getType();
			// 是数字类型
			if (Number.class.isAssignableFrom(type)) {
				return type.getMethod("valueOf", String.class).invoke(null, strValue);
			}
			// 字符类型
			if (Character.class.isAssignableFrom(type)) {
				return strValue.charAt(0);
			}
			// 字符串类型
			if (String.class.isAssignableFrom(type)) {
				return strValue;
			}
			// 日期类型
			if (Date.class.isAssignableFrom(type)) {
				// TODO 日期类型处理
				return null;
			}
		} catch (Exception e) {
			e.printStackTrace();
		}

		return null;
	}
969768
function (cmd) {
        if (!this._saveData) {
            return;
        }

        var data = this.data;
        if (this._len + arguments.length > data.length) {
            // 因为之前的数组已经转换成静态的 Float32Array
            // 所以不够用时需要扩展一个新的动态数组
            this._expandData();
            data = this.data;
        }
        for (var i = 0; i < arguments.length; i++) {
            data[this._len++] = arguments[i];
        }

        this._prevCmd = cmd;
    }
540938
public void set(Object key, Object value) {
		for (Scope cur=this; true; cur=cur.parent) {
			// HashMap 允许有 null 值 value，必须要做 containsKey 判断
			if (cur.data != null && cur.data.containsKey(key)) {
				cur.data.put(key, value);
				return ;
			}
			
			if (cur.parent == null) {
				if (cur.data == null) {			// 支持顶层 data 为 null 值
					cur.data = new HashMap();
				}
				cur.data.put(key, value);
				return ;
			}
		}
	}
774012
private void init(Object object) throws JSONException{
		if (object instanceof CharSequence) {
			// JSON字符串
			init((CharSequence) object);
		} else {
			Iterator<?> iter;
			if (object.getClass().isArray()) {// 数组
				iter = new ArrayIter<>(object);
			} else if (object instanceof Iterator<?>) {// Iterator
				iter = ((Iterator<?>) object);
			} else if (object instanceof Iterable<?>) {// Iterable
				iter = ((Iterable<?>) object).iterator();
			} else {
				throw new JSONException("JSONArray initial value should be a string or collection or array.");
			}
			while (iter.hasNext()) {
				this.add(iter.next());
			}
		}
	}
855650
function(itemSet){

            this.closureCount = this.closureCount || 0;
            this.closureCount++;

            var self = this,
            closureItemSet = new DataTypes.ItemSet();

            var set = itemSet,
                itemQueue;
            do{         //C0
                itemQueue = new DataTypes.ItemSet();
                closureItemSet.union(set);

                _.each(set.subItems, function(item){        //each closureItems
                    if(item.dotSymbol && self.nonterminals[item.dotSymbol]){
                        /*
                        if(!closureSymbolHash[item.dotSymbol]){         //exists un derivation nonterminal
                        */
                            var afterRhs = item.production.rhs.slice(item.dotPosition+1);
                            lookaheads = self._first(afterRhs);
                            if(lookaheads.length === 0 || item.production.nullable || self._nullable(afterRhs)){
                                lookaheads = _.union(lookaheads, item.lookaheads);
                            }

                            _.each(self.nonterminals[item.dotSymbol].productions, function(p){
                                    var item = new DataTypes.Item(p, 0, lookaheads);
                                    if(!closureItemSet.contains(item) && !itemQueue.contains(item)){
                                        itemQueue.push(item); //new clsoure-item
                                    }
                            });


                            /**
                             * 求闭包的项的输入点非终结符后面的RHS 和 求闭包的项的每个lookahead符号 连接
                             * 然后进行FIRSTS运算，拿到lookaheads
                             * 每个lookaheads，进行并集运算，得到最终的lookaheads
                             */
                            /*
                            var lookaheads = [];
                            _.each(item.lookaheads, function(fchr){
                                var afterRHS = item.production.rhs.slice(item.dotPosition+1)
                                    afterRHS.push(fchr);
                                    lookaheads = _.union(lookaheads, self._first(afterRHS));
                            });
                            */

                            //求闭包的项的输入点非终结符，的每个产生式p
                            //查找闭包集合中是否已经存在相同核心的产生式
                            //存在则合并lookaheads
                            //不存在则创建
                            /*
                            _.each(self.nonterminals[item.dotSymbol].productions, function(p){
                                    var item = new DataTypes.Item(p, 0, lookaheads),
                                    itemIdx;
                                    if((itemIdx = closureItemSet.coreIndexOf(item)) === -1){
                                        itemSet.push(item); //new clsoure-item
                                        cont = true;                            //C0不动点循环继续
                                    }else{
                                        item = closureItemSet.subItems[itemIdx];
                                        item.lookaheads = _.union(item.lookaheads, lookaheads);
                                    }
                            });
                            */
                            //closureSymbolHash[item.dotSymbol] = true;   //cur nonterminal derivated
                            /*
                        }
                        */
                    }
                });
                set = itemQueue;
            }while(set.subItems.length);

            return closureItemSet;
        }