将生成的item对象合并到结果对象中
972637
private synchronized void merge(Identity identity, Map<Class, BatchObject> data, Object item) {
        Class clazz = item.getClass();
        BatchObject batchObject = data.get(clazz);
        // 初始化一下对象
        if (batchObject == null) {
            batchObject = initBatchObject(identity, clazz);
            data.put(clazz, batchObject);
        }

        // 进行merge处理
        if (batchObject instanceof RowBatch) {
            ((RowBatch) batchObject).merge((EventData) item);
        } else if (batchObject instanceof FileBatch) {
            ((FileBatch) batchObject).getFiles().add((FileData) item);
        } else {
            throw new TransformException("no support Data[" + clazz.getName() + "]");
        }
    }
1266233
def append_item *args
      options = args.extract_options!
      target = args.first
      self.items.create options.slice(:position).merge(:target => target)
    end
1120296
public function actionAdditem(){
        // Kieu item duoc sap xep
        $type = Yii::$app->request->post('type');
        
        // Id cua diy
        $diyId = Yii::$app->request->post('diyId');
        
        // Id cua container khi sap xep position, widget, them moi position
        $containerId = Yii::$app->request->post('containerId');
        
        // Id cua position khi sap xep, them moi widget
        $positionId = Yii::$app->request->post('positionId');
        
        // So cot cua mot position
        $numberColumn = Yii::$app->request->post('numberColumn');
        
        // Id cua widget
        $draggable_id = Yii::$app->request->post('draggable_id');
        
        // Generate random item id by type
        $itemId = uniqid($type . '_');
        
        // Check type item
        switch ($type) {
            case Diy::Container:
                $template = $this->addContainer($diyId, $itemId);
                break;
            case Diy::Position:
                $template = $this->addPosition($diyId, $itemId, $containerId, $numberColumn);
                break;
            case Diy::Widget:
                $template = $this->addWidget($diyId, $itemId, $containerId, $positionId, $draggable_id);
                break;
        }
        
        echo $template;
    }
996715
function create(item, h)
{
	if (h === 0)
	{
		return {
			ctor: '_Array',
			height: 0,
			table: [item]
		};
	}
	return {
		ctor: '_Array',
		height: h,
		table: [create(item, h - 1)],
		lengths: [1]
	};
}
662178
function mergeDetail(allEle, addEle, attrName, type) {

    if (allEle[attrName] && addEle[attrName]) {
        if (type == 1) {
            for (var k in allEle[attrName]) {
                //todo 现在没有考虑两个文件中同一项覆盖率的统计行数不一致的问题
                if ( parseInt(allEle[attrName][k])==0 &&  parseInt(addEle[attrName][k]) ==1) {
                    allEle[attrName][k] = 1;
                }
            }
        }
        else if (type == 2) {
            for (var k in allEle[attrName]) {
                //todo 现在没有考虑两个文件中同一项覆盖率的统计行数不一致的问题
                if (addEle[attrName][k]) {
                    if (parseInt(allEle[attrName][k][0])==0 &&parseInt(addEle[attrName][k][0])==1 ) {
                        allEle[attrName][k][0] = 1;
                    }
                    if (parseInt(allEle[attrName][k][1])==0 &&parseInt(addEle[attrName][k][1])==1 ) {
                        allEle[attrName][k][1] = 1;
                    }
                }
            }
        }
    }
    return allEle;
}
1033143
def items(self):
        
        for c in self._all_combos():
            _, value = _getitem(self.cube, c)
            yield c, value
283403
def add_item(self, item, **options):
        
        export_item = {
            "item": item.url,
        }
        export_item.update(options)
        self.items.append(export_item)
        return self
695740
function combine(source) {
    var targets = Array.prototype.slice.call(arguments, 1);

    targets.forEach(function (target) {
        target.forEach(function (item) {
            if (source.indexOf(item) < 0) {
                source.push(item);
            }
        });
    });

    return source;
}
319014
function createRows(items, columns, columnNames, paddingChr) {
  return items.map(item => {
    let row = []
    let numLines = 0
    columnNames.forEach(columnName => {
      numLines = Math.max(numLines, item[columnName].length)
    })
    // combine matching lines of each rows
    for (let i = 0; i < numLines; i++) {
      row[i] = row[i] || []
      columnNames.forEach(columnName => {
        let column = columns[columnName]
        let val = item[columnName][i] || '' // || '' ensures empty columns get padded
        if (column.align === 'right') row[i].push(padLeft(val, column.width, paddingChr))
        else if (column.align === 'center' || column.align === 'centre') row[i].push(padCenter(val, column.width, paddingChr))
        else row[i].push(padRight(val, column.width, paddingChr))
      })
    }
    return row
  })
}
494644
function(item) {
        var terms = this.term.replace(/[\-\[\]\{\}()*+?.,\\^$|#]/g, '\\$&').split(' '),
            options = this.options,
            callback = function(match) {
                return this.render(options.highlightTemplate).html(match).toString();
            }.bind(this);

        for (var i = 0, t; t = terms[i]; i++) {
            item = item.replace(new RegExp(t, 'ig'), callback);
        }

        return item;
    }
30159
def create_item(self, item):
        
        item_dict = {
            'project_id': item.project_id,
            'from_user_id': item.from_user_id,
            'to_user_id': item.to_user_id,
            'role': item.auth_role,
            'user_message': item.user_message
        }
        if item.share_user_ids:
            item_dict['share_user_ids'] = item.share_user_ids
        data = json.dumps(item_dict)
        resp = requests.post(self.make_url(item.destination), headers=self.json_headers, data=data)
        self.check_response(resp)
        return resp
949104
function combine(file) {
      if (!file) return;

      if (pathArr.indexOf(file.path) < 0) {
        pathArr.push(file.path);

        if (file.caculateContents) {
          cont = file.caculateContents
        } else {
          return;
        }

        contents.push(cont);

        size += cont.length;
      }

      if (file.children) {
        // 遍历依赖文件并且合并
        file.children.forEach(function(fc) {
          combine(denps[fc] || {path: fc});
        });
      }
    }
904062
function pHandle(e) {
            const $selectionElem = editor.selection.getSelectionContainerElem()
            const $parentElem = $selectionElem.parent()

            if ($parentElem.html() === '<code><br></code>') {
                // 回车之前光标所在一个 <p><code>.....</code></p> ，忽然回车生成一个空的 <p><code><br></code></p>
                // 而且继续回车跳不出去，因此只能特殊处理
                insertEmptyP($selectionElem)
                return
            }

            if (!$parentElem.equal($textElem)) {
                // 不是顶级标签
                return
            }

            const nodeName = $selectionElem.getNodeName()
            if (nodeName === 'P') {
                // 当前的标签是 P ，不用做处理
                return
            }

            if ($selectionElem.text()) {
                // 有内容，不做处理
                return
            }

            // 插入 <p> ，并将选取定位到 <p>，删除当前标签
            insertEmptyP($selectionElem)
        }
1062920
function generatorEntry(routeConfig = []) {
    const pages = {};


    routeConfig.forEach((route) => {
      const res = mustache.render(entryTpl, route);
      const entry = getPagesPath(`${route.key}/index.js`);
      // fs.openSync(entry, 'w+');
      // console.log('文件创建成功！');
      dirExists(path.parse(entry).dir);
      fs.writeFileSync(entry, res, 'utf-8');
      pages[route.key] = entry;
    });
    return pages;
  }
1078466
public static void createPairKey() {
		try {
			// 根据特定的算法一个密钥对生成器
			KeyPairGenerator keygen = KeyPairGenerator.getInstance("DSA");
			// 加密随机数生成器 (RNG)
			SecureRandom random = new SecureRandom();
			// 重新设置此随机对象的种子
			random.setSeed(1000);
			// 使用给定的随机源（和默认的参数集合）初始化确定密钥大小的密钥对生成器
			keygen.initialize(512, random);// keygen.initialize(512);
			// 生成密钥组
			KeyPair keys = keygen.generateKeyPair();
			// 得到公匙
			PublicKey pubkey = keys.getPublic();
			// 得到私匙
			PrivateKey prikey = keys.getPrivate();
			// 将公匙私匙写入到文件当中
			doObjToFile("mykeys.bat", new Object[] { prikey, pubkey });
		} catch (NoSuchAlgorithmException e) {
			e.printStackTrace();
		}
	}
17649
function build(previousFileSizes) {
    let packText = userDevConfig ? '启动测试环境打包编译...' : '启动生产环境打包压缩...';
    let startTime = Date.now();
    let timer;
    let logProgress = function(stop) {
        var text = packText + '已耗时：' + ((Date.now() - startTime) / 1000).toFixed(3) + 's';

        if (stop) {
            clearTimeout(timer);
            spinner.succeed(chalk.green(text));
        } else {
            spinner.text = chalk.cyan(text);

            timer = setTimeout(logProgress, 100);
        }
    };

    clearConsole();
    logProgress();

    let compiler = webpack(config);

    return new Promise((resolve, reject) => {
        compiler.run((err, stats) => {
            let messages;

            logProgress(true); // 停止
            console.log();

            if (err) {
                if (!err.message) {
                    return reject(err);
                }

                messages = formatWebpackMessages({
                    errors: [err.message],
                    warnings: []
                });
            } else {
                messages = formatWebpackMessages(stats.toJson({ all: false, warnings: true, errors: true }));
            }

            if (messages.errors.length) {
                if (messages.errors.length > 1) {
                    messages.errors.length = 1;
                }

                return reject(new Error(messages.errors.join('\n\n')));
            }

            const resolveArgs = {
                stats,
                previousFileSizes,
                warnings: messages.warnings
            };

            return resolve(resolveArgs);
        });
    });
}
142149
def create(handler, item_document):
    """"""
    data = {'operation': 'create',
            'item': json.load(item_document)}
    handler.invoke(data)