idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
564,288
public void writeToParcel(Parcel dest, int flags) {<NEW_LINE>dest.writeInt(this.id);<NEW_LINE>dest.writeString(this.name);<NEW_LINE>dest.writeString(this.fullName);<NEW_LINE>dest.writeByte(this.repPrivate ? (byte) 1 : (byte) 0);<NEW_LINE>dest.writeString(this.htmlUrl);<NEW_LINE>dest.writeString(this.description);<NEW_LINE>dest.writeString(this.language);<NEW_LINE>dest.writeParcelable(this.owner, flags);<NEW_LINE>dest.writeString(this.defaultBranch);<NEW_LINE>dest.writeLong(this.createdAt != null ? this.createdAt.getTime() : -1);<NEW_LINE>dest.writeLong(this.updatedAt != null ? this.updatedAt.getTime() : -1);<NEW_LINE>dest.writeLong(this.pushedAt != null ? this.pushedAt.getTime() : -1);<NEW_LINE>dest.writeString(this.gitUrl);<NEW_LINE>dest.writeString(this.sshUrl);<NEW_LINE><MASK><NEW_LINE>dest.writeString(this.svnUrl);<NEW_LINE>dest.writeLong(this.size);<NEW_LINE>dest.writeInt(this.stargazersCount);<NEW_LINE>dest.writeInt(this.watchersCount);<NEW_LINE>dest.writeInt(this.forksCount);<NEW_LINE>dest.writeInt(this.openIssuesCount);<NEW_LINE>dest.writeInt(this.subscribersCount);<NEW_LINE>dest.writeByte(this.fork ? (byte) 1 : (byte) 0);<NEW_LINE>dest.writeParcelable(this.parent, flags);<NEW_LINE>dest.writeParcelable(this.permissions, flags);<NEW_LINE>dest.writeByte(this.hasIssues ? (byte) 1 : (byte) 0);<NEW_LINE>dest.writeByte(this.hasProjects ? (byte) 1 : (byte) 0);<NEW_LINE>dest.writeByte(this.hasDownloads ? (byte) 1 : (byte) 0);<NEW_LINE>dest.writeByte(this.hasWiki ? (byte) 1 : (byte) 0);<NEW_LINE>dest.writeByte(this.hasPages ? (byte) 1 : (byte) 0);<NEW_LINE>dest.writeInt(this.sinceStargazersCount);<NEW_LINE>dest.writeInt(this.since == null ? -1 : this.since.ordinal());<NEW_LINE>}
dest.writeString(this.cloneUrl);
1,720,431
private void addCrusherBlackstoneRecipes(Consumer<FinishedRecipe> consumer, String basePath) {<NEW_LINE>// Polished Blackstone -> Blackstone<NEW_LINE>ItemStackToItemStackRecipeBuilder.crushing(IngredientCreatorAccess.item().from(Blocks.POLISHED_BLACKSTONE), new ItemStack(Blocks.BLACKSTONE)).build(consumer, Mekanism.rl(basePath + "from_polished"));<NEW_LINE>// Polished Blackstone Wall -> Blackstone Wall<NEW_LINE>ItemStackToItemStackRecipeBuilder.crushing(IngredientCreatorAccess.item().from(Blocks.POLISHED_BLACKSTONE_WALL), new ItemStack(Blocks.BLACKSTONE_WALL)).build(consumer, Mekanism.rl(basePath + "polished_wall_to_wall"));<NEW_LINE>// Polished Blackstone Stairs -> Blackstone Stairs<NEW_LINE>ItemStackToItemStackRecipeBuilder.crushing(IngredientCreatorAccess.item().from(Blocks.POLISHED_BLACKSTONE_STAIRS), new ItemStack(Blocks.BLACKSTONE_STAIRS)).build(consumer, Mekanism<MASK><NEW_LINE>// Polished Blackstone Slabs -> Blackstone Slabs<NEW_LINE>ItemStackToItemStackRecipeBuilder.crushing(IngredientCreatorAccess.item().from(Blocks.POLISHED_BLACKSTONE_SLAB), new ItemStack(Blocks.BLACKSTONE_SLAB)).build(consumer, Mekanism.rl(basePath + "polished_slabs_to_slabs"));<NEW_LINE>// Chiseled Polished Blackstone Bricks -> Polished Blackstone Bricks<NEW_LINE>ItemStackToItemStackRecipeBuilder.crushing(IngredientCreatorAccess.item().from(Blocks.CHISELED_POLISHED_BLACKSTONE), new ItemStack(Blocks.POLISHED_BLACKSTONE_BRICKS)).build(consumer, Mekanism.rl(basePath + "chiseled_bricks_to_bricks"));<NEW_LINE>// Polished Blackstone Bricks -> Cracked Polished Blackstone Bricks<NEW_LINE>ItemStackToItemStackRecipeBuilder.crushing(IngredientCreatorAccess.item().from(Blocks.POLISHED_BLACKSTONE_BRICKS), new ItemStack(Blocks.CRACKED_POLISHED_BLACKSTONE_BRICKS)).build(consumer, Mekanism.rl(basePath + "bricks_to_cracked_bricks"));<NEW_LINE>// Cracked Polished Blackstone Bricks -> Polished Blackstone<NEW_LINE>ItemStackToItemStackRecipeBuilder.crushing(IngredientCreatorAccess.item().from(Blocks.CRACKED_POLISHED_BLACKSTONE_BRICKS), new ItemStack(Blocks.POLISHED_BLACKSTONE)).build(consumer, Mekanism.rl(basePath + "from_cracked_bricks"));<NEW_LINE>}
.rl(basePath + "polished_stairs_to_stairs"));
956,268
private void printJobPlacements(FlowNetwork flowNetwork, int maxFlowValue, SeparateChainingHashST<Integer, String> idToNameMap, int numberOfStudents) {<NEW_LINE>StdOut.println("*** Job placements ***");<NEW_LINE>int source = flowNetwork.vertices() - 2;<NEW_LINE>int target = source + 1;<NEW_LINE>for (int vertex = 0; vertex < flowNetwork.vertices(); vertex++) {<NEW_LINE>for (FlowEdge edge : flowNetwork.adjacent(vertex)) {<NEW_LINE>if (edge.from() == source || edge.to() == target) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (vertex == edge.from() && edge.flow() > 0) {<NEW_LINE>String student = idToNameMap.get(edge.from());<NEW_LINE>String company = idToNameMap.get(edge.to());<NEW_LINE>StdOut.printf("%5s - %8s\n", student, company);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>StdOut.<MASK><NEW_LINE>StdOut.println("All students matched with a job: " + (numberOfStudents == maxFlowValue) + " Expected: true");<NEW_LINE>}
println("\nNumber of jobs filled: " + maxFlowValue + " Expected: 6");
30,386
private void enlargeArraysIfNeeded(int size, boolean preserveData) {<NEW_LINE>int allocSize = (size + (2 * ALLOCATE_UNIT - 1)<MASK><NEW_LINE>long[] curInfo = mCachedGroupPosInfo;<NEW_LINE>int[] curId = mCachedGroupId;<NEW_LINE>long[] newInfo = curInfo;<NEW_LINE>int[] newId = curId;<NEW_LINE>if (curInfo == null || curInfo.length < size) {<NEW_LINE>newInfo = new long[allocSize];<NEW_LINE>}<NEW_LINE>if (curId == null || curId.length < size) {<NEW_LINE>newId = new int[allocSize];<NEW_LINE>}<NEW_LINE>if (preserveData) {<NEW_LINE>if (curInfo != null && curInfo != newInfo) {<NEW_LINE>System.arraycopy(curInfo, 0, newInfo, 0, curInfo.length);<NEW_LINE>}<NEW_LINE>if (curId != null && curId != newId) {<NEW_LINE>System.arraycopy(curId, 0, newId, 0, curId.length);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mCachedGroupPosInfo = newInfo;<NEW_LINE>mCachedGroupId = newId;<NEW_LINE>}
) & ~(ALLOCATE_UNIT - 1);
753,706
private void printSummary() {<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("****** SUMMARY ******");<NEW_LINE><MASK><NEW_LINE>for (String server : _servers) {<NEW_LINE>System.out.printf("%s : %d\n", server, _testRingState.getTotalRequestsNum().get(server));<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("Request distribution on the consistent hash ring: ");<NEW_LINE>for (String server : _servers) {<NEW_LINE>System.out.printf("%s : %d\n", server, _consistentRingState.getTotalRequestsNum().get(server));<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("Average latency (actual) on the testing hash ring: ");<NEW_LINE>for (String server : _servers) {<NEW_LINE>Integer averageLatency = _testRingState.getAverageLatency().get(server);<NEW_LINE>System.out.printf("%s, %d\n", server, averageLatency);<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("Average latency (actual) on the consistent hash ring: ");<NEW_LINE>for (String server : _servers) {<NEW_LINE>Integer averageLatency = _consistentRingState.getAverageLatency().get(server);<NEW_LINE>System.out.printf("%s, %d\n", server, averageLatency);<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>System.out.printf("Percentage of consistent requests: %.2f", (double) _consistencyCount.get() / _callCount.get());<NEW_LINE>}
System.out.println("Request distribution on the testing hash ring: ");
1,345,701
// GEN-LAST:event_methodDetailsButtonActionPerformed<NEW_LINE>private void propertyDetailsButtonActionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>// GEN-FIRST:event_propertyDetailsButtonActionPerformed<NEW_LINE>PropertyPicker propertyPicker = new PropertyPicker(formModel, null, valueType);<NEW_LINE>propertyPicker.setSelectedComponent(selectedComponent);<NEW_LINE>propertyPicker.setSelectedProperty(selectedProperty);<NEW_LINE>String title = // NOI18N<NEW_LINE>FormUtils.// NOI18N<NEW_LINE>getFormattedBundleString("CTL_FMT_CW_SelectProperty", new Object[] <MASK><NEW_LINE>final DialogDescriptor dd = new DialogDescriptor(propertyPicker, title);<NEW_LINE>dd.setValid(propertyPicker.isPickerValid());<NEW_LINE>propertyPicker.addPropertyChangeListener("pickerValid", new // NOI18N<NEW_LINE>PropertyChangeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void propertyChange(PropertyChangeEvent evt2) {<NEW_LINE>dd.setValid(((Boolean) evt2.getNewValue()).booleanValue());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);<NEW_LINE>dialog.setVisible(true);<NEW_LINE>if (dd.getValue() == DialogDescriptor.OK_OPTION) {<NEW_LINE>selectedComponent = propertyPicker.getSelectedComponent();<NEW_LINE>PropertyPicker.PropertyPickerItem selectedItem = propertyPicker.getSelectedProperty();<NEW_LINE>propertyField.setEnabled(true);<NEW_LINE>if (selectedComponent == formModel.getTopRADComponent())<NEW_LINE>propertyField.setText(selectedItem.getPropertyName());<NEW_LINE>else<NEW_LINE>// NOI18N<NEW_LINE>propertyField.setText(selectedComponent.getName() + "." + selectedItem.getPropertyName());<NEW_LINE>selectedProperty = selectedItem.getPropertyDescriptor();<NEW_LINE>if (selectedProperty == null)<NEW_LINE>propertyEditor.setValue(new RADConnectionPropertyEditor.RADConnectionDesignValue(selectedItem.getReadMethodName()));<NEW_LINE>else if (selectedComponent != null)<NEW_LINE>propertyEditor.setValue(new RADConnectionPropertyEditor.RADConnectionDesignValue(selectedComponent, selectedProperty));<NEW_LINE>else<NEW_LINE>propertyEditor.setValue(BeanSupport.NO_VALUE);<NEW_LINE>}<NEW_LINE>}
{ valueType.getSimpleName() });
1,134,532
private static double[] readValues(TokenBuffer buffer, int size, TensorAddress address, TensorType type) {<NEW_LINE>int index = 0;<NEW_LINE>double[] values = new double[size];<NEW_LINE>if (buffer.currentToken() == JsonToken.VALUE_STRING) {<NEW_LINE>values = decodeHexString(buffer.currentText(), type.valueType());<NEW_LINE>index = values.length;<NEW_LINE>} else {<NEW_LINE>expectArrayStart(buffer.currentToken());<NEW_LINE>int initNesting = buffer.nesting();<NEW_LINE>for (buffer.next(); buffer.nesting() >= initNesting; buffer.next()) values[<MASK><NEW_LINE>expectCompositeEnd(buffer.currentToken());<NEW_LINE>}<NEW_LINE>if (index != size)<NEW_LINE>throw new IllegalArgumentException((address != null ? "At " + address.toString(type) + ": " : "") + "Expected " + size + " values, but got " + index);<NEW_LINE>return values;<NEW_LINE>}
index++] = readDouble(buffer);
937,148
protected RequestMeta createRequestMeta(String httpMethod, URI uri) {<NEW_LINE><MASK><NEW_LINE>MicroserviceReferenceConfig microserviceReferenceConfig = SCBEngine.getInstance().createMicroserviceReferenceConfig(microserviceName);<NEW_LINE>MicroserviceMeta microserviceMeta = microserviceReferenceConfig.getLatestMicroserviceMeta();<NEW_LINE>ServicePathManager servicePathManager = ServicePathManager.getServicePathManager(microserviceMeta);<NEW_LINE>if (servicePathManager == null) {<NEW_LINE>throw new Error(String.format("no schema defined for %s:%s", microserviceMeta.getAppId(), microserviceMeta.getMicroserviceName()));<NEW_LINE>}<NEW_LINE>OperationLocator locator = servicePathManager.consumerLocateOperation(path, httpMethod);<NEW_LINE>RestOperationMeta swaggerRestOperation = locator.getOperation();<NEW_LINE>OperationMeta operationMeta = locator.getOperation().getOperationMeta();<NEW_LINE>ReferenceConfig referenceConfig = microserviceReferenceConfig.createReferenceConfig(operationMeta);<NEW_LINE>Map<String, String> pathParams = locator.getPathVarMap();<NEW_LINE>return new RequestMeta(referenceConfig, swaggerRestOperation, pathParams);<NEW_LINE>}
String microserviceName = uri.getAuthority();
1,369,384
public void executeViewEvent(String path, String key, ViewChangeType changeType) throws Exception {<NEW_LINE>String[] childNameInfo = <MASK><NEW_LINE>String schema = childNameInfo[0];<NEW_LINE>String viewName = childNameInfo[1];<NEW_LINE>String serverId = changeType.getInstanceName();<NEW_LINE>String instanceName = SystemConfig.getInstance().getInstanceName();<NEW_LINE>if (instanceName.equals(serverId)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String optionType = changeType.getType();<NEW_LINE>ClusterDelayProvider.delayWhenReponseViewNotic();<NEW_LINE>if (Repository.DELETE.equals(optionType)) {<NEW_LINE>LOGGER.info("delete view " + path + ":" + changeType);<NEW_LINE>if (!ProxyMeta.getInstance().getTmManager().getCatalogs().get(schema).getViewMetas().containsKey(viewName)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ProxyMeta.getInstance().getTmManager().getCatalogs().get(schema).getViewMetas().remove(viewName);<NEW_LINE>ClusterDelayProvider.delayBeforeReponseView();<NEW_LINE>clusterHelper.createSelfTempNode(path, FeedBackType.SUCCESS);<NEW_LINE>} else if (Repository.UPDATE.equals(optionType)) {<NEW_LINE>LOGGER.info("update view " + path + ":" + changeType);<NEW_LINE>ClusterDelayProvider.delayBeforeReponseGetView();<NEW_LINE>String stmt = clusterHelper.getPathValue(ClusterMetaUtil.getViewPath(schema, viewName)).map(ClusterValue::getData).map(ViewType::getCreateSql).orElse(null);<NEW_LINE>if (ProxyMeta.getInstance().getTmManager().getCatalogs().get(schema).getViewMetas().get(viewName) != null && ProxyMeta.getInstance().getTmManager().getCatalogs().get(schema).getViewMetas().get(viewName).getCreateSql().equals(stmt)) {<NEW_LINE>ClusterDelayProvider.delayBeforeReponseView();<NEW_LINE>clusterHelper.createSelfTempNode(path, FeedBackType.SUCCESS);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ViewMeta vm = new ViewMeta(schema, stmt, ProxyMeta.getInstance().getTmManager());<NEW_LINE>vm.init();<NEW_LINE>vm.addMeta(false);<NEW_LINE>Map<String, Map<String, String>> viewCreateSqlMap = ProxyMeta.getInstance().getTmManager().getRepository().getViewCreateSqlMap();<NEW_LINE>Map<String, String> schemaMap = viewCreateSqlMap.get(schema);<NEW_LINE>schemaMap.put(viewName, stmt);<NEW_LINE>ClusterDelayProvider.delayBeforeReponseView();<NEW_LINE>clusterHelper.createSelfTempNode(path, FeedBackType.SUCCESS);<NEW_LINE>}<NEW_LINE>}
key.split(Repository.SCHEMA_VIEW_SPLIT);
1,613,665
public void run() {<NEW_LINE>final AtomicLong busy = new AtomicLong(0);<NEW_LINE>Timer totalTimer = Time.startTimer();<NEW_LINE>final Timer executionTimer = Time.startTimer();<NEW_LINE>boolean releaseLeaseOnCompletion;<NEW_LINE>if (workerLease == null) {<NEW_LINE>workerLease = workerLeaseService.getWorkerLease();<NEW_LINE>releaseLeaseOnCompletion = true;<NEW_LINE>} else {<NEW_LINE>releaseLeaseOnCompletion = false;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>WorkItem workItem = getNextItem(workerLease);<NEW_LINE>if (workItem == null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>Node node = workItem.selection.getNode();<NEW_LINE>LOGGER.info("{} ({}) started.", node, Thread.currentThread());<NEW_LINE>executionTimer.reset();<NEW_LINE>execute(node, <MASK><NEW_LINE>long duration = executionTimer.getElapsedMillis();<NEW_LINE>busy.addAndGet(duration);<NEW_LINE>if (LOGGER.isInfoEnabled()) {<NEW_LINE>LOGGER.info("{} ({}) completed. Took {}.", node, Thread.currentThread(), TimeFormatting.formatDurationVerbose(duration));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (releaseLeaseOnCompletion) {<NEW_LINE>coordinationService.withStateLock(() -> workerLease.unlock());<NEW_LINE>}<NEW_LINE>long total = totalTimer.getElapsedMillis();<NEW_LINE>if (LOGGER.isDebugEnabled()) {<NEW_LINE>LOGGER.debug("Execution worker [{}] finished, busy: {}, idle: {}", Thread.currentThread(), TimeFormatting.formatDurationVerbose(busy.get()), TimeFormatting.formatDurationVerbose(total - busy.get()));<NEW_LINE>}<NEW_LINE>}
workItem.plan, workItem.executor);
169,037
private Map<String, List<String>> verticesOutputTo() {<NEW_LINE>// Key: vertex. Values: vertices that this node is an input for<NEW_LINE>Map<String, List<String>> verticesOutputTo = new HashMap<>();<NEW_LINE>for (Map.Entry<String, GraphVertex> entry : vertices.entrySet()) {<NEW_LINE><MASK><NEW_LINE>List<String> vertexInputNames;<NEW_LINE>vertexInputNames = vertexInputs.get(vertexName);<NEW_LINE>if (vertexInputNames == null)<NEW_LINE>continue;<NEW_LINE>// Build reverse network structure:<NEW_LINE>for (String s : vertexInputNames) {<NEW_LINE>List<String> list = verticesOutputTo.get(s);<NEW_LINE>if (list == null) {<NEW_LINE>list = new ArrayList<>();<NEW_LINE>verticesOutputTo.put(s, list);<NEW_LINE>}<NEW_LINE>// Edge: s -> vertexName<NEW_LINE>list.add(vertexName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return verticesOutputTo;<NEW_LINE>}
String vertexName = entry.getKey();
1,644,259
public Pair<Gradient, INDArray> backpropGradient(INDArray epsilon, LayerWorkspaceMgr workspaceMgr) {<NEW_LINE>assertInputSet(true);<NEW_LINE>if (input.rank() != 3) {<NEW_LINE>throw new UnsupportedOperationException("Input is not rank 3. RnnOutputLayer expects rank 3 input with shape [minibatch, layerInSize, sequenceLength]." + " Got input with rank " + input.rank() + " and shape " + Arrays.toString(input.shape()) + " - " + layerId());<NEW_LINE>}<NEW_LINE>RNNFormat format = layerConf().getRnnDataFormat();<NEW_LINE>int td = (format == RNNFormat.NCW) ? 2 : 1;<NEW_LINE>Preconditions.checkState(labels.rank() == 3, "Expected rank 3 labels array, got label array with shape %ndShape", labels);<NEW_LINE>Preconditions.checkState(input.size(td) == labels.size(td), <MASK><NEW_LINE>INDArray inputTemp = input;<NEW_LINE>if (layerConf().getRnnDataFormat() == RNNFormat.NWC) {<NEW_LINE>this.input = input.permute(0, 2, 1);<NEW_LINE>}<NEW_LINE>this.input = TimeSeriesUtils.reshape3dTo2d(input, workspaceMgr, ArrayType.BP_WORKING_MEM);<NEW_LINE>// Edge case: we skip OutputLayer forward pass during training as this isn't required to calculate gradients<NEW_LINE>applyDropOutIfNecessary(true, workspaceMgr);<NEW_LINE>// Also applies dropout<NEW_LINE>Pair<Gradient, INDArray> gradAndEpsilonNext = super.backpropGradient(epsilon, workspaceMgr);<NEW_LINE>this.input = inputTemp;<NEW_LINE>INDArray epsilon2d = gradAndEpsilonNext.getSecond();<NEW_LINE>INDArray epsilon3d = TimeSeriesUtils.reshape2dTo3d(epsilon2d, input.size(0), workspaceMgr, ArrayType.ACTIVATION_GRAD);<NEW_LINE>if (layerConf().getRnnDataFormat() == RNNFormat.NWC) {<NEW_LINE>epsilon3d = epsilon3d.permute(0, 2, 1);<NEW_LINE>}<NEW_LINE>weightNoiseParams.clear();<NEW_LINE>// epsilon3d = backpropDropOutIfPresent(epsilon3d);<NEW_LINE>return new Pair<>(gradAndEpsilonNext.getFirst(), epsilon3d);<NEW_LINE>}
"Sequence lengths do not match for RnnOutputLayer input and labels:" + "Arrays should be rank 3 with shape [minibatch, size, sequenceLength] - mismatch on dimension 2 (sequence length) - input=%ndShape vs. label=%ndShape", input, labels);
304,571
public Result visitCall(RexCall call) {<NEW_LINE>if (rexResultMap.containsKey(call)) {<NEW_LINE>return rexResultMap.get(call);<NEW_LINE>}<NEW_LINE>SqlOperator operator = call.getOperator();<NEW_LINE>if (operator == PREV) {<NEW_LINE>return implementPrev(call);<NEW_LINE>}<NEW_LINE>if (operator == CASE) {<NEW_LINE>return implementCaseWhen(call);<NEW_LINE>}<NEW_LINE>if (operator == SEARCH) {<NEW_LINE>return RexUtil.expandSearch(builder, program, call).accept(this);<NEW_LINE>}<NEW_LINE>if (operator.getName().equalsIgnoreCase("<=>")) {<NEW_LINE>operator = StrictEqualFunction.INSTANCE;<NEW_LINE>}<NEW_LINE>RexImpTable.RexCallImplementor implementor = RexImpTable.INSTANCE.get(operator);<NEW_LINE>if (implementor == null) {<NEW_LINE>throw new RuntimeException("cannot translate call " + call);<NEW_LINE>}<NEW_LINE>final List<RexNode> operandList = call.getOperands();<NEW_LINE>final List<Type> storageTypes = EnumUtils.internalTypes(operandList);<NEW_LINE>final List<Result> operandResults = new ArrayList<>();<NEW_LINE>for (int i = 0; i < operandList.size(); i++) {<NEW_LINE>final Result operandResult = implementCallOperand(operandList.get(i), storageTypes.get(i), this);<NEW_LINE>operandResults.add(operandResult);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>final Result result = implementor.implement(this, call, operandResults);<NEW_LINE>rexResultMap.put(call, result);<NEW_LINE>return result;<NEW_LINE>}
callOperandResultMap.put(call, operandResults);
1,177,017
protected void encodeMarkup(FacesContext context, Timeline timeline) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>String clientId = timeline.getClientId(context);<NEW_LINE>writer.startElement("div", timeline);<NEW_LINE>writer.<MASK><NEW_LINE>if (timeline.getStyle() != null) {<NEW_LINE>writer.writeAttribute("style", timeline.getStyle(), "style");<NEW_LINE>}<NEW_LINE>if (timeline.getStyleClass() != null) {<NEW_LINE>writer.writeAttribute("class", timeline.getStyleClass(), "styleClass");<NEW_LINE>}<NEW_LINE>UIComponent menuFacet = timeline.getFacet("menu");<NEW_LINE>if (ComponentUtils.shouldRenderFacet(menuFacet)) {<NEW_LINE>writer.startElement("div", null);<NEW_LINE>StringBuilder cssMenu = new StringBuilder("timeline-menu");<NEW_LINE>if ("top".equals(timeline.getOrientationAxis())) {<NEW_LINE>cssMenu.append(" timeline-menu-axis-top");<NEW_LINE>} else if ("both".equals(timeline.getOrientationAxis())) {<NEW_LINE>cssMenu.append(" timeline-menu-axis-both");<NEW_LINE>}<NEW_LINE>if (ComponentUtils.isRTL(context, timeline)) {<NEW_LINE>cssMenu.append(" timeline-menu-rtl");<NEW_LINE>}<NEW_LINE>writer.writeAttribute("class", cssMenu.toString(), null);<NEW_LINE>// It will be displayed when timeline is displayed<NEW_LINE>writer.writeAttribute("style", "display:none;", null);<NEW_LINE>menuFacet.encodeAll(context);<NEW_LINE>writer.endElement("div");<NEW_LINE>}<NEW_LINE>writer.endElement("div");<NEW_LINE>}
writeAttribute("id", clientId, "id");
1,655,078
private synchronized void loadImage(AbstractFile file) throws IOException {<NEW_LINE>presenter.getWindowFrame().setCursor(<MASK><NEW_LINE>int read;<NEW_LINE>byte[] buffer = new byte[1024];<NEW_LINE>ByteArrayOutputStream bout = new ByteArrayOutputStream();<NEW_LINE>InputStream in = file.getInputStream();<NEW_LINE>while ((read = in.read(buffer, 0, buffer.length)) != -1) bout.write(buffer, 0, read);<NEW_LINE>byte[] imageBytes = bout.toByteArray();<NEW_LINE>bout.close();<NEW_LINE>in.close();<NEW_LINE>this.scaledImage = null;<NEW_LINE>this.image = imageViewerImpl.getToolkit().createImage(imageBytes);<NEW_LINE>waitForImage(image);<NEW_LINE>int width = image.getWidth(null);<NEW_LINE>int height = image.getHeight(null);<NEW_LINE>this.zoomFactor = 1.0;<NEW_LINE>Dimension d = Toolkit.getDefaultToolkit().getScreenSize();<NEW_LINE>while (width > d.width || height > d.height) {<NEW_LINE>width = width / 2;<NEW_LINE>height = height / 2;<NEW_LINE>zoomFactor = zoomFactor / 2;<NEW_LINE>}<NEW_LINE>if (zoomFactor == 1.0)<NEW_LINE>this.scaledImage = image;<NEW_LINE>else<NEW_LINE>zoom(zoomFactor);<NEW_LINE>checkZoom();<NEW_LINE>presenter.getWindowFrame().setCursor(Cursor.getDefaultCursor());<NEW_LINE>}
new Cursor(Cursor.WAIT_CURSOR));
643,294
public void deleteElement(@Nonnull DataContext dataContext) {<NEW_LINE>// noinspection unchecked<NEW_LINE>final List<<MASK><NEW_LINE>if (shelvedChangeLists.isEmpty())<NEW_LINE>return;<NEW_LINE>String message = (shelvedChangeLists.size() == 1) ? VcsBundle.message("shelve.changes.delete.confirm", shelvedChangeLists.get(0).DESCRIPTION) : VcsBundle.message("shelve.changes.delete.multiple.confirm", shelvedChangeLists.size());<NEW_LINE>int rc = Messages.showOkCancelDialog(myProject, message, VcsBundle.message("shelvedChanges.delete.title"), CommonBundle.message("button.delete"), CommonBundle.getCancelButtonText(), Messages.getWarningIcon());<NEW_LINE>if (rc != 0)<NEW_LINE>return;<NEW_LINE>for (ShelvedChangeList changeList : shelvedChangeLists) {<NEW_LINE>ShelveChangesManager.getInstance(myProject).deleteChangeList(changeList);<NEW_LINE>}<NEW_LINE>}
ShelvedChangeList> shelvedChangeLists = getLists(dataContext);
203,901
private <T> void trackRequestCharge(RxDocumentServiceRequest request, T response) {<NEW_LINE>try {<NEW_LINE>// Read lock is enough here.<NEW_LINE>this.throughputReadLock.lock();<NEW_LINE>double requestCharge = 0;<NEW_LINE>boolean failedRequest = false;<NEW_LINE>if (response instanceof StoreResponse) {<NEW_LINE>requestCharge = ((StoreResponse) response).getRequestCharge();<NEW_LINE>} else if (response instanceof RxDocumentServiceResponse) {<NEW_LINE>requestCharge = ((<MASK><NEW_LINE>} else if (response instanceof Throwable) {<NEW_LINE>CosmosException cosmosException = Utils.as(Exceptions.unwrap((Throwable) response), CosmosException.class);<NEW_LINE>if (cosmosException != null) {<NEW_LINE>requestCharge = cosmosException.getRequestCharge();<NEW_LINE>failedRequest = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ThroughputControlTrackingUnit trackingUnit = trackingDictionary.get(request.getOperationType());<NEW_LINE>if (trackingUnit != null) {<NEW_LINE>if (failedRequest) {<NEW_LINE>trackingUnit.increaseFailedResponse();<NEW_LINE>} else {<NEW_LINE>trackingUnit.increaseSuccessResponse();<NEW_LINE>trackingUnit.trackRRuUsage(requestCharge);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If the response comes back in a different cycle, discard it.<NEW_LINE>if (StringUtils.equals(this.cycleId, request.requestContext.throughputControlCycleId)) {<NEW_LINE>this.availableThroughput.getAndAccumulate(requestCharge, (available, consumed) -> available - consumed);<NEW_LINE>} else {<NEW_LINE>if (trackingUnit != null) {<NEW_LINE>trackingUnit.increaseOutOfCycleResponse();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>this.throughputReadLock.unlock();<NEW_LINE>}<NEW_LINE>}
RxDocumentServiceResponse) response).getRequestCharge();
1,484,879
// default invoke<NEW_LINE>public void doFilter(RsfRequest request, RsfResponse response) throws Throwable {<NEW_LINE>if (response.isResponse())<NEW_LINE>return;<NEW_LINE>RsfBindInfo<?<MASK><NEW_LINE>Supplier<?> targetProvider = request.getContext().getServiceProvider(bindInfo);<NEW_LINE>Object target = targetProvider == null ? null : targetProvider.get();<NEW_LINE>//<NEW_LINE>if (target == null) {<NEW_LINE>response.sendStatus(ProtocolStatus.NotFound, "service " + bindInfo.getBindID() + " not exist.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>try {<NEW_LINE>Method refMethod = request.getMethod();<NEW_LINE>// Method targetMethod = target.getClass().getMethod(refMethod.getName(), refMethod.getParameterTypes());<NEW_LINE>Object[] pObjects = request.getParameterObject();<NEW_LINE>Object resData = refMethod.invoke(target, pObjects);<NEW_LINE>response.sendData(resData);<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>throw e.getTargetException();<NEW_LINE>}<NEW_LINE>}
> bindInfo = request.getBindInfo();
371,801
public void run() {<NEW_LINE>Thread.currentThread().setContextClassLoader(TaskThread.class.getClassLoader());<NEW_LINE>executorDriver.sendStatusUpdate(Protos.TaskStatus.newBuilder().setTaskId(taskInfo.getTaskId()).setState(Protos.TaskState.TASK_RUNNING).build());<NEW_LINE>Map<String, Object> data = SerializationUtils.deserialize(taskInfo.getData().toByteArray());<NEW_LINE>ShardingContexts shardingContexts = (ShardingContexts) data.get("shardingContext");<NEW_LINE>JobConfiguration jobConfig = YamlEngine.unmarshal(data.get("jobConfigContext").toString(), JobConfigurationPOJO.class).toJobConfiguration();<NEW_LINE>try {<NEW_LINE>JobFacade jobFacade = new CloudJobFacade(shardingContexts, jobConfig, jobTracingEventBus);<NEW_LINE>if (isTransient(jobConfig)) {<NEW_LINE>getJobExecutor(jobFacade).execute();<NEW_LINE>executorDriver.sendStatusUpdate(Protos.TaskStatus.newBuilder().setTaskId(taskInfo.getTaskId()).setState(Protos.TaskState.TASK_FINISHED).build());<NEW_LINE>} else {<NEW_LINE>new DaemonTaskScheduler(elasticJob, elasticJobType, jobConfig, jobFacade, executorDriver, taskInfo.<MASK><NEW_LINE>}<NEW_LINE>// CHECKSTYLE:OFF<NEW_LINE>} catch (final Throwable ex) {<NEW_LINE>// CHECKSTYLE:ON<NEW_LINE>log.error("ElasticJob-Cloud Executor error:", ex);<NEW_LINE>executorDriver.sendStatusUpdate(Protos.TaskStatus.newBuilder().setTaskId(taskInfo.getTaskId()).setState(Protos.TaskState.TASK_ERROR).setMessage(ExceptionUtils.transform(ex)).build());<NEW_LINE>executorDriver.stop();<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>}
getTaskId()).init();
1,521,598
public void execute() throws CFGBuilderException {<NEW_LINE><MASK><NEW_LINE>Method[] methods = jclass.getMethods();<NEW_LINE>if (DEBUG) {<NEW_LINE>System.out.println("Class has " + methods.length + " methods");<NEW_LINE>}<NEW_LINE>// Add call graph nodes for all methods<NEW_LINE>for (Method method : methods) {<NEW_LINE>callGraph.addNode(method);<NEW_LINE>}<NEW_LINE>if (DEBUG) {<NEW_LINE>System.out.println("Added " + callGraph.getNumVertices() + " nodes to graph");<NEW_LINE>}<NEW_LINE>// Scan methods for self calls<NEW_LINE>for (Method method : methods) {<NEW_LINE>MethodGen mg = classContext.getMethodGen(method);<NEW_LINE>if (mg == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>scan(callGraph.getNodeForMethod(method));<NEW_LINE>}<NEW_LINE>if (DEBUG) {<NEW_LINE>System.out.println("Found " + callGraph.getNumEdges() + " self calls");<NEW_LINE>}<NEW_LINE>}
JavaClass jclass = classContext.getJavaClass();
223,524
private void initLayers(@NonNull Style loadedMapStyle) {<NEW_LINE>LineLayer routeLayer = new LineLayer(ROUTE_LAYER_ID, ROUTE_SOURCE_ID);<NEW_LINE>// Add the LineLayer to the map. This layer will display the directions route.<NEW_LINE>routeLayer.setProperties(lineCap(Property.LINE_CAP_ROUND), lineJoin(Property.LINE_JOIN_ROUND), lineWidth(5f), lineColor(Color.parseColor("#006eff")));<NEW_LINE>loadedMapStyle.addLayer(routeLayer);<NEW_LINE>// Add the red marker icon image to the map<NEW_LINE>loadedMapStyle.addImage(RED_PIN_ICON_ID, BitmapUtils.getBitmapFromDrawable(getResources().getDrawable(<MASK><NEW_LINE>// Add the red marker icon SymbolLayer to the map<NEW_LINE>loadedMapStyle.addLayer(new SymbolLayer(ICON_LAYER_ID, ICON_SOURCE_ID).withProperties(iconImage(RED_PIN_ICON_ID), iconIgnorePlacement(true), iconAllowOverlap(true), iconOffset(new Float[] { 0f, -9f })));<NEW_LINE>}
R.drawable.red_marker)));
479,368
final DisassociateBudgetFromResourceResult executeDisassociateBudgetFromResource(DisassociateBudgetFromResourceRequest disassociateBudgetFromResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(disassociateBudgetFromResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DisassociateBudgetFromResourceRequest> request = null;<NEW_LINE>Response<DisassociateBudgetFromResourceResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DisassociateBudgetFromResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(disassociateBudgetFromResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Service Catalog");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisassociateBudgetFromResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DisassociateBudgetFromResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DisassociateBudgetFromResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
16,322
public static String prettyXmlWithIndentType(String originalXml, int indentType) {<NEW_LINE>try {<NEW_LINE>Source xmlInput = new StreamSource(new StringReader(originalXml));<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>StreamResult xmlOutput = new StreamResult(stringWriter);<NEW_LINE>TransformerFactory transformerFactory = TransformerFactory.newInstance();<NEW_LINE>// This statement works with JDK 6<NEW_LINE>transformerFactory.setAttribute("indent-number", indentType);<NEW_LINE>Transformer transformer = transformerFactory.newTransformer();<NEW_LINE>transformer.setOutputProperty(OutputKeys.INDENT, "yes");<NEW_LINE>transformer.transform(xmlInput, xmlOutput);<NEW_LINE>return xmlOutput.getWriter().toString();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>// You'll come here if you are using JDK 1.5<NEW_LINE>// you are getting an the following exeption<NEW_LINE>// java.lang.IllegalArgumentException: Not supported: indent-number<NEW_LINE>// Use this code (Set the output property in transformer.<NEW_LINE>try {<NEW_LINE>Source xmlInput = new StreamSource(new StringReader(originalXml));<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>StreamResult xmlOutput = new StreamResult(stringWriter);<NEW_LINE>TransformerFactory transformerFactory = TransformerFactory.newInstance();<NEW_LINE><MASK><NEW_LINE>transformer.setOutputProperty(OutputKeys.INDENT, "yes");<NEW_LINE>transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", String.valueOf(indentType));<NEW_LINE>transformer.transform(xmlInput, xmlOutput);<NEW_LINE>return xmlOutput.getWriter().toString();<NEW_LINE>} catch (Throwable t) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return originalXml;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Transformer transformer = transformerFactory.newTransformer();
1,804,965
public void train(TimeSeries.DataSequence data) {<NEW_LINE>this.data = data;<NEW_LINE><MASK><NEW_LINE>DataPoint dp = null;<NEW_LINE>DataSet observedData = new DataSet();<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>dp = new Observation(data.get(i).value);<NEW_LINE>dp.setIndependentValue("x", i);<NEW_LINE>observedData.add(dp);<NEW_LINE>}<NEW_LINE>observedData.setTimeVariable("x");<NEW_LINE>// TODO: Make weights configurable.<NEW_LINE>forecaster = new net.sourceforge.openforecast.models.WeightedMovingAverageModel(new double[] { 0.75, 0.25 });<NEW_LINE>forecaster.init(observedData);<NEW_LINE>initForecastErrors(forecaster, data);<NEW_LINE>logger.debug(getBias() + "\t" + getMAD() + "\t" + getMAPE() + "\t" + getMSE() + "\t" + getSAE() + "\t" + 0 + "\t" + 0);<NEW_LINE>}
int n = data.size();
1,691,806
private void completeAndNotifyIfNeeded(@Nullable Exception failure) {<NEW_LINE>final State prevState = state.getAndSet(State.COMPLETED);<NEW_LINE>if (prevState == State.COMPLETED) {<NEW_LINE>logger.warn("attempt to complete task [{}] with id [{}] in the [{}] state", getAction(), getPersistentTaskId(), prevState);<NEW_LINE>} else {<NEW_LINE>if (failure != null) {<NEW_LINE>logger.warn(() -> new ParameterizedMessage("task {} failed with an exception", getPersistentTaskId()), failure);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>this.failure = failure;<NEW_LINE>if (prevState == State.STARTED) {<NEW_LINE>logger.trace("sending notification for completed task [{}] with id [{}]", getAction(), getPersistentTaskId());<NEW_LINE>persistentTasksService.sendCompletionRequest(getPersistentTaskId(), getAllocationId(), failure, new ActionListener<PersistentTasksCustomMetaData.PersistentTask<?>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponse(PersistentTasksCustomMetaData.PersistentTask<?> persistentTask) {<NEW_LINE>logger.trace("notification for task [{}] with id [{}] was successful", <MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(Exception e) {<NEW_LINE>logger.warn(() -> new ParameterizedMessage("notification for task [{}] with id [{}] failed", getAction(), getPersistentTaskId()), e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>taskManager.unregister(this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getAction(), getPersistentTaskId());
1,099,608
public Map<String, SecuritySchemeDefinition> generateSecuritySchemeDefinitions() throws GenerateException {<NEW_LINE>Map<String, SecuritySchemeDefinition> map = new HashMap<String, SecuritySchemeDefinition>();<NEW_LINE>Map<String, JsonNode> securityDefinitions = new HashMap<String, JsonNode>();<NEW_LINE>if (json != null || jsonPath != null) {<NEW_LINE>securityDefinitions = loadSecurityDefintionsFromJsonFile();<NEW_LINE>} else {<NEW_LINE>JsonNode tree = mapper.valueToTree(this);<NEW_LINE>securityDefinitions.put(tree.get("name").asText(), tree);<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, JsonNode> securityDefinition : securityDefinitions.entrySet()) {<NEW_LINE><MASK><NEW_LINE>SecuritySchemeDefinition ssd = getSecuritySchemeDefinitionByType(definition.get("type").asText(), definition);<NEW_LINE>tryFillNameField(ssd, securityDefinition.getKey());<NEW_LINE>if (ssd != null) {<NEW_LINE>map.put(securityDefinition.getKey(), ssd);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>}
JsonNode definition = securityDefinition.getValue();
1,479,785
private void importUsersFromSO(List<Map<String, Object>> objs, List<ParaObject> toImport) throws ParseException {<NEW_LINE>logger.info("Importing {} users...", objs.size());<NEW_LINE>for (Map<String, Object> obj : objs) {<NEW_LINE>User u = new User();<NEW_LINE>u.setId("user_" + (Integer) obj.get("id"));<NEW_LINE>u.setTimestamp(DateUtils.parseDate((String) obj.get("creationDate"), soDateFormat1, soDateFormat2).getTime());<NEW_LINE>u.setActive(true);<NEW_LINE>u.setCreatorid(((Integer) obj.get(<MASK><NEW_LINE>u.setGroups("admin".equalsIgnoreCase((String) obj.get("userTypeId")) ? User.Groups.ADMINS.toString() : User.Groups.USERS.toString());<NEW_LINE>u.setEmail(u.getId() + "@scoold.com");<NEW_LINE>u.setIdentifier(u.getEmail());<NEW_LINE>u.setName((String) obj.get("realName"));<NEW_LINE>String lastLogin = (String) obj.get("lastLoginDate");<NEW_LINE>u.setUpdated(StringUtils.isBlank(lastLogin) ? null : DateUtils.parseDate(lastLogin, soDateFormat1, soDateFormat2).getTime());<NEW_LINE>u.setPicture((String) obj.get("profileImageUrl"));<NEW_LINE>u.setPassword(Utils.generateSecurityToken(10));<NEW_LINE>Profile p = Profile.fromUser(u);<NEW_LINE>p.setVotes((Integer) obj.get("reputation"));<NEW_LINE>p.setAboutme((String) obj.getOrDefault("title", ""));<NEW_LINE>p.setLastseen(u.getUpdated());<NEW_LINE>toImport.add(u);<NEW_LINE>toImport.add(p);<NEW_LINE>}<NEW_LINE>pc.createAll(toImport);<NEW_LINE>}
"accountId")).toString());
1,522,062
@Override<NEW_LINE>public View onCreateView3(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {<NEW_LINE>View view = inflater.inflate(R.layout.scene_label_list, container, false);<NEW_LINE>mRecyclerView = (EasyRecyclerView) ViewUtils.$$(view, R.id.recycler_view);<NEW_LINE>TextView tip = (TextView) ViewUtils.$$(view, R.id.tip);<NEW_LINE>mViewTransition = new ViewTransition(mRecyclerView, tip);<NEW_LINE>Context context = getContext2();<NEW_LINE>AssertUtils.assertNotNull(context);<NEW_LINE>Drawable drawable = DrawableManager.getVectorDrawable(context, R.drawable.big_label);<NEW_LINE>drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());<NEW_LINE>tip.setCompoundDrawables(null, drawable, null, null);<NEW_LINE>tip.<MASK><NEW_LINE>// drag & drop manager<NEW_LINE>RecyclerViewDragDropManager dragDropManager = new RecyclerViewDragDropManager();<NEW_LINE>dragDropManager.setDraggingItemShadowDrawable((NinePatchDrawable) context.getResources().getDrawable(R.drawable.shadow_8dp));<NEW_LINE>RecyclerView.Adapter adapter = new LabelAdapter();<NEW_LINE>adapter.setHasStableIds(true);<NEW_LINE>// wrap for dragging<NEW_LINE>adapter = dragDropManager.createWrappedAdapter(adapter);<NEW_LINE>mAdapter = adapter;<NEW_LINE>final GeneralItemAnimator animator = new SwipeDismissItemAnimator();<NEW_LINE>mRecyclerView.setLayoutManager(new LinearLayoutManager(context));<NEW_LINE>mRecyclerView.setAdapter(adapter);<NEW_LINE>mRecyclerView.setItemAnimator(animator);<NEW_LINE>dragDropManager.attachRecyclerView(mRecyclerView);<NEW_LINE>updateView();<NEW_LINE>return view;<NEW_LINE>}
setText(R.string.no_download_label);
389,952
public static String findGlobalExecutable(String fileName, String packageName) {<NEW_LINE>String path = globalExecutableCache.get(fileName);<NEW_LINE>if (path == null) {<NEW_LINE>String globalPackagesDir = NPM_DIR.getAbsolutePath();<NEW_LINE>Stream<Path> searchPaths = null;<NEW_LINE>try {<NEW_LINE>searchPaths = Files.walk(Paths.get(globalPackagesDir));<NEW_LINE>if (isWindows()) {<NEW_LINE>File programFilesPath = new File(System.getenv<MASK><NEW_LINE>if (programFilesPath.isDirectory()) {<NEW_LINE>searchPaths = Stream.concat(searchPaths, Files.walk(Paths.get(programFilesPath.getAbsolutePath()), FileVisitOption.FOLLOW_LINKS));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>path = //<NEW_LINE>searchPaths.//<NEW_LINE>filter(Files::isRegularFile).filter((f) -> {<NEW_LINE>String file = f.toFile().getName();<NEW_LINE>return file.equals(fileName);<NEW_LINE>}).//<NEW_LINE>map(//<NEW_LINE>f -> f.toFile().getAbsolutePath()).findFirst().orElse(null);<NEW_LINE>globalExecutableCache.put(fileName, path);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException("cannot find global executable", e);<NEW_LINE>} finally {<NEW_LINE>if (searchPaths != null) {<NEW_LINE>searchPaths.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return path;<NEW_LINE>}
("ProgramFiles") + "/nodejs/node_modules/" + packageName);
502,316
private void doPrintEntries(PrintStream out) throws Exception {<NEW_LINE>// Adjust displayed keystore type if needed.<NEW_LINE>String keystoreTypeToPrint = keyStore.getType();<NEW_LINE>if ("JKS".equalsIgnoreCase(keystoreTypeToPrint)) {<NEW_LINE>if (ksfile != null && ksfile.exists()) {<NEW_LINE>String realType = keyStoreType(ksfile);<NEW_LINE>// If the magic number does not conform to JKS<NEW_LINE>// then it must be PKCS12<NEW_LINE>if (!"JKS".equalsIgnoreCase(realType)) {<NEW_LINE>keystoreTypeToPrint = P12KEYSTORE;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.println(rb.getString("Keystore.type.") + keystoreTypeToPrint);<NEW_LINE>out.println(rb.getString("Keystore.provider.") + keyStore.getProvider().getName());<NEW_LINE>out.println();<NEW_LINE>MessageFormat form;<NEW_LINE>form = (keyStore.size() == 1) ? new MessageFormat(rb.getString("Your.keystore.contains.keyStore.size.entry")) : new MessageFormat(rb.getString("Your.keystore.contains.keyStore.size.entries"));<NEW_LINE>Object[] source = { new Integer(keyStore.size()) };<NEW_LINE>out.println(form.format(source));<NEW_LINE>out.println();<NEW_LINE>List<String> aliases = Collections.list(keyStore.aliases());<NEW_LINE>aliases.sort(String::compareTo);<NEW_LINE>for (String alias : aliases) {<NEW_LINE>doPrintEntry("<" + alias + ">", alias, out);<NEW_LINE>if (verbose || rfc) {<NEW_LINE>out.println(rb.getString("NEWLINE"));<NEW_LINE>out.println(rb.getString("STAR"));<NEW_LINE>out.println<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(rb.getString("STARNN"));
1,409,948
public static void main(String[] args) {<NEW_LINE>createEmptyDynamicsWorld();<NEW_LINE>btBoxShape groundShape = new btBoxShape(new btVector3(50, 50, 50));<NEW_LINE>btTransform groundTransform = new btTransform();<NEW_LINE>groundTransform.setIdentity();<NEW_LINE>groundTransform.setOrigin(new btVector3(0, -50, 0));<NEW_LINE>createRigidBody(0, groundTransform, groundShape);<NEW_LINE>btBoxShape colShape = new btBoxShape(new btVector3(1, 1, 1));<NEW_LINE>float mass = 1.0f;<NEW_LINE>colShape.calculateLocalInertia(mass, new btVector3(0, 0, 0));<NEW_LINE>btTransform startTransform = new btTransform();<NEW_LINE>startTransform.setIdentity();<NEW_LINE>startTransform.setOrigin(new btVector3(0, 3, 0));<NEW_LINE>btRigidBody box = createRigidBody(mass, startTransform, colShape);<NEW_LINE>for (int i = 0; i < 10; ++i) {<NEW_LINE>m_dynamicsWorld.stepSimulation(0.1f, 10, 0.01f);<NEW_LINE>btVector3 position = box.getWorldTransform().getOrigin();<NEW_LINE>System.out.println(position.y());<NEW_LINE>}<NEW_LINE>System.out.println("\n" + <MASK><NEW_LINE>}
"This sample simulates falling of a rigid box, followed by \n" + "an inelastic collision with a ground plane.\n" + "The numbers show height of the box at each simulation step. \n" + "It should start around 3.0 and end up around 1.0.\n");
1,225,804
public Request<RemoveRoleFromInstanceProfileRequest> marshall(RemoveRoleFromInstanceProfileRequest removeRoleFromInstanceProfileRequest) {<NEW_LINE>if (removeRoleFromInstanceProfileRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<RemoveRoleFromInstanceProfileRequest> request = new DefaultRequest<RemoveRoleFromInstanceProfileRequest>(removeRoleFromInstanceProfileRequest, "AmazonIdentityManagement");<NEW_LINE>request.addParameter("Action", "RemoveRoleFromInstanceProfile");<NEW_LINE>request.addParameter("Version", "2010-05-08");<NEW_LINE><MASK><NEW_LINE>if (removeRoleFromInstanceProfileRequest.getInstanceProfileName() != null) {<NEW_LINE>request.addParameter("InstanceProfileName", StringUtils.fromString(removeRoleFromInstanceProfileRequest.getInstanceProfileName()));<NEW_LINE>}<NEW_LINE>if (removeRoleFromInstanceProfileRequest.getRoleName() != null) {<NEW_LINE>request.addParameter("RoleName", StringUtils.fromString(removeRoleFromInstanceProfileRequest.getRoleName()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.setHttpMethod(HttpMethodName.POST);
474,695
final GetIpamAddressHistoryResult executeGetIpamAddressHistory(GetIpamAddressHistoryRequest getIpamAddressHistoryRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getIpamAddressHistoryRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetIpamAddressHistoryRequest> request = null;<NEW_LINE>Response<GetIpamAddressHistoryResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetIpamAddressHistoryRequestMarshaller().marshall(super.beforeMarshalling(getIpamAddressHistoryRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<GetIpamAddressHistoryResult> responseHandler = new StaxResponseHandler<GetIpamAddressHistoryResult>(new GetIpamAddressHistoryResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetIpamAddressHistory");
422,240
public void process(Node externs, Node root) {<NEW_LINE>NodeTraversal.traverse(compiler, root, this);<NEW_LINE>for (Entry<JSChunk, List<Node>> entry : Multimaps.asMap(functions).entrySet()) {<NEW_LINE>Node addingRoot = compiler.getNodeForCodeInsertion(entry.getKey());<NEW_LINE>List<Node> fnNodes = Lists.reverse(entry.getValue());<NEW_LINE>if (!fnNodes.isEmpty()) {<NEW_LINE>for (Node n : fnNodes) {<NEW_LINE>Node parent = n.getParent();<NEW_LINE>n.detach();<NEW_LINE>compiler.reportChangeToEnclosingScope(parent);<NEW_LINE>Node nameNode = n.getFirstChild();<NEW_LINE>String name = nameNode.getString();<NEW_LINE>nameNode.setString("");<NEW_LINE>addingRoot.addChildToFront(IR.var(IR.name(name), n).srcrefTreeIfMissing(n));<NEW_LINE>compiler.reportChangeToEnclosingScope(nameNode);<NEW_LINE>}<NEW_LINE>compiler.reportChangeToEnclosingScope(addingRoot);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Node n : classes) {<NEW_LINE>// rewrite CLASS > NAME ... => VAR > NAME > CLASS > EMPTY ...<NEW_LINE>Node originalNameNode = n.getFirstChild();<NEW_LINE>originalNameNode.<MASK><NEW_LINE>Node var = IR.var(originalNameNode);<NEW_LINE>n.replaceWith(var);<NEW_LINE>originalNameNode.addChildToFront(n);<NEW_LINE>compiler.reportChangeToEnclosingScope(n);<NEW_LINE>}<NEW_LINE>}
replaceWith(IR.empty());
1,757,935
public final void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException, ELException {<NEW_LINE>if (parent == null || !(parent instanceof ValueHolder)) {<NEW_LINE>throw new TagException(this.tag, "Parent not an instance of ValueHolder: " + parent);<NEW_LINE>}<NEW_LINE>// only process if it's been created<NEW_LINE>if (parent.getParent() == null) {<NEW_LINE>// cast to a ValueHolder<NEW_LINE>ValueHolder vh = (ValueHolder) parent;<NEW_LINE>ValueExpression ve = null;<NEW_LINE>Converter c = null;<NEW_LINE>if (this.binding != null) {<NEW_LINE>ve = this.binding.getValueExpression(ctx, Converter.class);<NEW_LINE>c = (<MASK><NEW_LINE>}<NEW_LINE>if (c == null) {<NEW_LINE>c = this.createConverter(ctx);<NEW_LINE>if (ve != null) {<NEW_LINE>ve.setValue(ctx, c);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (c == null) {<NEW_LINE>throw new TagException(this.tag, "No Converter was created");<NEW_LINE>}<NEW_LINE>this.setAttributes(ctx, c);<NEW_LINE>vh.setConverter(c);<NEW_LINE>Object lv = vh.getLocalValue();<NEW_LINE>FacesContext faces = ctx.getFacesContext();<NEW_LINE>if (lv instanceof String) {<NEW_LINE>vh.setValue(c.getAsObject(faces, parent, (String) lv));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Converter) ve.getValue(ctx);
1,078,847
public int[][] merge(int[][] intervals) {<NEW_LINE>if (intervals.length <= 1) {<NEW_LINE>return intervals;<NEW_LINE>}<NEW_LINE>List<int[]> result = new ArrayList<>();<NEW_LINE>List<int[]> nextList = new ArrayList<>();<NEW_LINE>int<MASK><NEW_LINE>boolean doCombine = false;<NEW_LINE>for (int i = 1; i < intervals.length; i++) {<NEW_LINE>if (temp[1] < intervals[i][1]) {<NEW_LINE>if (temp[1] >= intervals[i][0] && temp[1] <= intervals[i][1]) {<NEW_LINE>temp[0] = Math.min(temp[0], intervals[i][0]);<NEW_LINE>temp[1] = Math.max(temp[1], intervals[i][1]);<NEW_LINE>doCombine = true;<NEW_LINE>} else {<NEW_LINE>nextList.add(intervals[i]);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (intervals[i][1] >= temp[0] && intervals[i][1] <= temp[1]) {<NEW_LINE>temp[0] = Math.min(temp[0], intervals[i][0]);<NEW_LINE>temp[1] = Math.max(temp[1], intervals[i][1]);<NEW_LINE>doCombine = true;<NEW_LINE>} else {<NEW_LINE>nextList.add(intervals[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (doCombine) {<NEW_LINE>nextList.add(temp);<NEW_LINE>} else {<NEW_LINE>result.add(temp);<NEW_LINE>}<NEW_LINE>if (nextList.size() > 0) {<NEW_LINE>int[][] nextResult = merge(nextList.toArray(new int[nextList.size()][]));<NEW_LINE>result.addAll(Arrays.asList(nextResult));<NEW_LINE>}<NEW_LINE>return result.toArray(new int[result.size()][]);<NEW_LINE>}
[] temp = intervals[0];
1,676,784
public void decode16x16(MBlock mBlock, Picture mb, Frame[][] refs, PartPred p0) {<NEW_LINE>int mbX = mapper.getMbX(mBlock.mbIdx);<NEW_LINE>int mbY = mapper.getMbY(mBlock.mbIdx);<NEW_LINE>boolean leftAvailable = mapper.leftAvailable(mBlock.mbIdx);<NEW_LINE>boolean topAvailable = mapper.topAvailable(mBlock.mbIdx);<NEW_LINE>boolean topLeftAvailable = mapper.topLeftAvailable(mBlock.mbIdx);<NEW_LINE>boolean topRightAvailable = <MASK><NEW_LINE>int address = mapper.getAddress(mBlock.mbIdx);<NEW_LINE>int xx = mbX << 2;<NEW_LINE>for (int list = 0; list < 2; list++) {<NEW_LINE>predictInter16x16(mBlock, mbb[list], refs, mbX, mbY, leftAvailable, topAvailable, topLeftAvailable, topRightAvailable, mBlock.x, xx, list, p0);<NEW_LINE>}<NEW_LINE>PredictionMerger.mergePrediction(sh, mBlock.x.mv0R(0), mBlock.x.mv1R(0), p0, 0, mbb[0].getPlaneData(0), mbb[1].getPlaneData(0), 0, 16, 16, 16, mb.getPlaneData(0), refs, poc);<NEW_LINE>mBlock.partPreds[0] = mBlock.partPreds[1] = mBlock.partPreds[2] = mBlock.partPreds[3] = p0;<NEW_LINE>predictChromaInter(refs, mBlock.x, mbX << 3, mbY << 3, 1, mb, mBlock.partPreds);<NEW_LINE>predictChromaInter(refs, mBlock.x, mbX << 3, mbY << 3, 2, mb, mBlock.partPreds);<NEW_LINE>residualInter(mBlock, refs, leftAvailable, topAvailable, mbX, mbY, mapper.getAddress(mBlock.mbIdx));<NEW_LINE>saveMvs(di, mBlock.x, mbX, mbY);<NEW_LINE>mergeResidual(mb, mBlock.ac, mBlock.transform8x8Used ? COMP_BLOCK_8x8_LUT : COMP_BLOCK_4x4_LUT, mBlock.transform8x8Used ? COMP_POS_8x8_LUT : COMP_POS_4x4_LUT);<NEW_LINE>collectPredictors(s, mb, mbX);<NEW_LINE>di.mbTypes[address] = mBlock.curMbType;<NEW_LINE>}
mapper.topRightAvailable(mBlock.mbIdx);
368,017
public Request<ListEventsDetectionJobsRequest> marshall(ListEventsDetectionJobsRequest listEventsDetectionJobsRequest) {<NEW_LINE>if (listEventsDetectionJobsRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(ListEventsDetectionJobsRequest)");<NEW_LINE>}<NEW_LINE>Request<ListEventsDetectionJobsRequest> request = new DefaultRequest<ListEventsDetectionJobsRequest>(listEventsDetectionJobsRequest, "AmazonComprehend");<NEW_LINE>String target = "Comprehend_20171127.ListEventsDetectionJobs";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (listEventsDetectionJobsRequest.getFilter() != null) {<NEW_LINE>EventsDetectionJobFilter filter = listEventsDetectionJobsRequest.getFilter();<NEW_LINE>jsonWriter.name("Filter");<NEW_LINE>EventsDetectionJobFilterJsonMarshaller.getInstance().marshall(filter, jsonWriter);<NEW_LINE>}<NEW_LINE>if (listEventsDetectionJobsRequest.getNextToken() != null) {<NEW_LINE>String nextToken = listEventsDetectionJobsRequest.getNextToken();<NEW_LINE>jsonWriter.name("NextToken");<NEW_LINE>jsonWriter.value(nextToken);<NEW_LINE>}<NEW_LINE>if (listEventsDetectionJobsRequest.getMaxResults() != null) {<NEW_LINE>Integer maxResults = listEventsDetectionJobsRequest.getMaxResults();<NEW_LINE>jsonWriter.name("MaxResults");<NEW_LINE>jsonWriter.value(maxResults);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.addHeader("Content-Type", "application/x-amz-json-1.1");
1,672,286
public Stream<WebuiRelatedProcessDescriptor> streamDocumentRelatedProcesses(@NonNull final WebuiPreconditionsContext preconditionsContext, @NonNull final IUserRolePermissions userRolePermissions) {<NEW_LINE>final String tableName = preconditionsContext.getTableName();<NEW_LINE>final AdTableId adTableId = !Check.isEmpty(tableName) ? AdTableId.ofRepoId(adTableDAO.retrieveTableId(tableName)) : null;<NEW_LINE>final <MASK><NEW_LINE>final AdTabId adTabId = preconditionsContext.getAdTabId();<NEW_LINE>Stream<RelatedProcessDescriptor> relatedProcessDescriptors = preconditionsContext.getAdditionalRelatedProcessDescriptors().stream();<NEW_LINE>if (preconditionsContext.isConsiderTableRelatedProcessDescriptors()) {<NEW_LINE>final Stream<RelatedProcessDescriptor> tableRelatedProcessDescriptors = adProcessService.getRelatedProcessDescriptors(adTableId, adWindowId, adTabId).stream();<NEW_LINE>relatedProcessDescriptors = Stream.concat(relatedProcessDescriptors, tableRelatedProcessDescriptors);<NEW_LINE>}<NEW_LINE>return relatedProcessDescriptors.collect(GuavaCollectors.distinctBy(RelatedProcessDescriptor::getProcessId)).filter(relatedProcess -> isEligible(relatedProcess, preconditionsContext, userRolePermissions)).map(relatedProcess -> toWebuiRelatedProcessDescriptor(relatedProcess, preconditionsContext));<NEW_LINE>}
AdWindowId adWindowId = preconditionsContext.getAdWindowId();
460,234
private static int[] algB(int m, int n, String a, String b) {<NEW_LINE>// Step 1<NEW_LINE>int[][] k = new int[2][n + 1];<NEW_LINE>for (int j = 0; j <= n; j++) {<NEW_LINE>k[1][j] = 0;<NEW_LINE>}<NEW_LINE>// Step 2<NEW_LINE>for (int i = 1; i <= m; i++) {<NEW_LINE>// Step 3<NEW_LINE>for (int j = 0; j <= n; j++) {<NEW_LINE>k[0][j] = k[1][j];<NEW_LINE>}<NEW_LINE>// Step 4<NEW_LINE>for (int j = 1; j <= n; j++) {<NEW_LINE>if (a.charAt(i - 1) == b.charAt(j - 1)) {<NEW_LINE>k[1][j] = k[0<MASK><NEW_LINE>} else {<NEW_LINE>k[1][j] = Math.max(k[1][j - 1], k[0][j]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Step 5<NEW_LINE>return k[1];<NEW_LINE>}
][j - 1] + 1;
915,628
protected ActivityInstanceImpl createActivityInstance(PvmExecutionImpl scopeExecution, ScopeImpl scope, String activityInstanceId, String parentActivityInstanceId, Map<String, List<Incident>> incidentsByExecution) {<NEW_LINE>ActivityInstanceImpl actInst = new ActivityInstanceImpl();<NEW_LINE>actInst.setId(activityInstanceId);<NEW_LINE>actInst.setParentActivityInstanceId(parentActivityInstanceId);<NEW_LINE>actInst.setProcessInstanceId(scopeExecution.getProcessInstanceId());<NEW_LINE>actInst.setProcessDefinitionId(scopeExecution.getProcessDefinitionId());<NEW_LINE>actInst.setBusinessKey(scopeExecution.getBusinessKey());<NEW_LINE>actInst.setActivityId(scope.getId());<NEW_LINE>String name = scope.getName();<NEW_LINE>if (name == null) {<NEW_LINE>name = (<MASK><NEW_LINE>}<NEW_LINE>actInst.setActivityName(name);<NEW_LINE>if (scope.getId().equals(scopeExecution.getProcessDefinition().getId())) {<NEW_LINE>actInst.setActivityType("processDefinition");<NEW_LINE>} else {<NEW_LINE>actInst.setActivityType((String) scope.getProperty("type"));<NEW_LINE>}<NEW_LINE>List<String> executionIds = new ArrayList<String>();<NEW_LINE>List<String> incidentIds = new ArrayList<>();<NEW_LINE>List<Incident> incidents = new ArrayList<>();<NEW_LINE>executionIds.add(scopeExecution.getId());<NEW_LINE>ActivityImpl executionActivity = scopeExecution.getActivity();<NEW_LINE>// do not collect incidents if scopeExecution is a compacted subtree<NEW_LINE>// and we currently create the scope activity instance<NEW_LINE>if (executionActivity == null || executionActivity == scope) {<NEW_LINE>incidentIds.addAll(getIncidentIds(incidentsByExecution, scopeExecution));<NEW_LINE>incidents.addAll(getIncidents(incidentsByExecution, scopeExecution));<NEW_LINE>}<NEW_LINE>for (PvmExecutionImpl childExecution : scopeExecution.getNonEventScopeExecutions()) {<NEW_LINE>// add all concurrent children that are not in an activity<NEW_LINE>if (childExecution.isConcurrent() && childExecution.getActivityId() == null) {<NEW_LINE>executionIds.add(childExecution.getId());<NEW_LINE>incidentIds.addAll(getIncidentIds(incidentsByExecution, childExecution));<NEW_LINE>incidents.addAll(getIncidents(incidentsByExecution, childExecution));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>actInst.setExecutionIds(executionIds.toArray(new String[executionIds.size()]));<NEW_LINE>actInst.setIncidentIds(incidentIds.toArray(new String[incidentIds.size()]));<NEW_LINE>actInst.setIncidents(incidents.toArray(new Incident[0]));<NEW_LINE>return actInst;<NEW_LINE>}
String) scope.getProperty("name");
739,055
@Consumes(MediaType.APPLICATION_JSON)<NEW_LINE>@Produces(MediaType.APPLICATION_JSON)<NEW_LINE>@ApiOperation(value = "Updates a managed user.", response = ManagedUser.class)<NEW_LINE>@ApiResponses(value = { @ApiResponse(code = 400, message = "Missing required field"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 404, message = "The user could not be found") })<NEW_LINE>@PermissionRequired(Permissions.Constants.ACCESS_MANAGEMENT)<NEW_LINE>public Response updateManagedUser(ManagedUser jsonUser) {<NEW_LINE>try (QueryManager qm = new QueryManager()) {<NEW_LINE>ManagedUser user = qm.getManagedUser(jsonUser.getUsername());<NEW_LINE>if (user != null) {<NEW_LINE>if (StringUtils.isBlank(jsonUser.getFullname())) {<NEW_LINE>return Response.status(Response.Status.BAD_REQUEST).entity("The users full name is missing.").build();<NEW_LINE>}<NEW_LINE>if (StringUtils.isBlank(jsonUser.getEmail())) {<NEW_LINE>return Response.status(Response.Status.BAD_REQUEST).entity("The users email address is missing.").build();<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotBlank(jsonUser.getNewPassword()) && StringUtils.isNotBlank(jsonUser.getConfirmPassword()) && jsonUser.getNewPassword().equals(jsonUser.getConfirmPassword())) {<NEW_LINE>user.setPassword(String.valueOf(PasswordService.createHash(jsonUser.getNewPassword().toCharArray())));<NEW_LINE>}<NEW_LINE>user.setFullname(jsonUser.getFullname());<NEW_LINE>user.setEmail(jsonUser.getEmail());<NEW_LINE>user.setForcePasswordChange(jsonUser.isForcePasswordChange());<NEW_LINE>user.setNonExpiryPassword(jsonUser.isNonExpiryPassword());<NEW_LINE>user.setSuspended(jsonUser.isSuspended());<NEW_LINE><MASK><NEW_LINE>super.logSecurityEvent(LOGGER, SecurityMarkers.SECURITY_AUDIT, "Managed user updated: " + jsonUser.getUsername());<NEW_LINE>return Response.ok(user).build();<NEW_LINE>} else {<NEW_LINE>return Response.status(Response.Status.NOT_FOUND).entity("The user could not be found.").build();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
user = qm.updateManagedUser(user);
938,434
protected AutologinRequest readInternal(Class<? extends AutologinRequest> clazz, HttpInputMessage inputMessage) throws IOException, HttpMessageNotReadableException {<NEW_LINE>AutologinRequest result = new AutologinRequest();<NEW_LINE>UnaryOperator<String> getValue;<NEW_LINE>if (isJsonContent(inputMessage.getHeaders().get(HttpHeaders.CONTENT_TYPE))) {<NEW_LINE>Map<String, String> map = JsonUtils.readValue(stringConverter.read(String.class, inputMessage), new TypeReference<Map<String, String>>() {<NEW_LINE>});<NEW_LINE>if (map == null) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>getValue = map::get;<NEW_LINE>} else {<NEW_LINE>MultiValueMap<String, String> map = formConverter.read(null, inputMessage);<NEW_LINE>getValue = map::getFirst;<NEW_LINE>}<NEW_LINE>result.setUsername(getValue.apply(USERNAME));<NEW_LINE>result.setPassword<MASK><NEW_LINE>return result;<NEW_LINE>}
(getValue.apply(PASSWORD));
1,249,132
protected void runTool(JavaSparkContext ctx) {<NEW_LINE>// TODO remove me when https://github.com/broadinstitute/gatk/issues/4303 are fixed<NEW_LINE>if (output.endsWith(FileExtensions.BCF) || output.endsWith(FileExtensions.BCF + ".gz")) {<NEW_LINE>throw new UserException.UnimplementedFeature("It is currently not possible to write a BCF file on spark. See https://github.com/broadinstitute/gatk/issues/4303 for more details .");<NEW_LINE>}<NEW_LINE>Utils.validateArg(hcArgs.dbsnp.dbsnp == null, "HaplotypeCallerSpark does not yet support -D or --dbsnp arguments");<NEW_LINE>Utils.validateArg(hcArgs.comps.isEmpty(), "HaplotypeCallerSpark does not yet support -comp or --comp arguments");<NEW_LINE>Utils.validateArg(hcArgs.bamOutputPath == null, "HaplotypeCallerSpark does not yet support -bamout or --bamOutput");<NEW_LINE>Utils.validate(getHeaderForReads().getSortOrder() == SAMFileHeader.SortOrder.coordinate, "The reads must be coordinate sorted.");<NEW_LINE>logger.info("********************************************************************************");<NEW_LINE>logger.info("The output of this tool DOES NOT match the output of HaplotypeCaller. ");<NEW_LINE>logger.info("It is under development and should not be used for production work. ");<NEW_LINE>logger.info("For evaluation only.");<NEW_LINE>logger.info("Use the non-spark HaplotypeCaller if you care about the results. ");<NEW_LINE>logger.info("********************************************************************************");<NEW_LINE>try {<NEW_LINE>super.runTool(ctx);<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (e.getCause() instanceof UserException) {<NEW_LINE>throw <MASK><NEW_LINE>} else {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(UserException) e.getCause();
818,936
public static DescribeReservedResourceResponse unmarshall(DescribeReservedResourceResponse describeReservedResourceResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeReservedResourceResponse.setRequestId(_ctx.stringValue("DescribeReservedResourceResponse.RequestId"));<NEW_LINE>describeReservedResourceResponse.setCode(_ctx.integerValue("DescribeReservedResourceResponse.Code"));<NEW_LINE>List<Image> images = new ArrayList<Image>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeReservedResourceResponse.Images.Length"); i++) {<NEW_LINE>Image image = new Image();<NEW_LINE>image.setImageName(_ctx.stringValue("DescribeReservedResourceResponse.Images[" + i + "].ImageName"));<NEW_LINE>image.setImageId(_ctx.stringValue("DescribeReservedResourceResponse.Images[" + i + "].ImageId"));<NEW_LINE>images.add(image);<NEW_LINE>}<NEW_LINE>describeReservedResourceResponse.setImages(images);<NEW_LINE>List<SupportResource> supportResources = new ArrayList<SupportResource>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeReservedResourceResponse.SupportResources.Length"); i++) {<NEW_LINE>SupportResource supportResource = new SupportResource();<NEW_LINE>supportResource.setEnsRegionId(_ctx.stringValue("DescribeReservedResourceResponse.SupportResources[" + i + "].EnsRegionId"));<NEW_LINE>supportResource.setSupportResourcesCount(_ctx.stringValue("DescribeReservedResourceResponse.SupportResources[" + i + "].SupportResourcesCount"));<NEW_LINE>supportResource.setInstanceSpec(_ctx.stringValue<MASK><NEW_LINE>List<String> dataDiskSizes = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeReservedResourceResponse.SupportResources[" + i + "].DataDiskSizes.Length"); j++) {<NEW_LINE>dataDiskSizes.add(_ctx.stringValue("DescribeReservedResourceResponse.SupportResources[" + i + "].DataDiskSizes[" + j + "]"));<NEW_LINE>}<NEW_LINE>supportResource.setDataDiskSizes(dataDiskSizes);<NEW_LINE>List<String> systemDiskSizes = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeReservedResourceResponse.SupportResources[" + i + "].SystemDiskSizes.Length"); j++) {<NEW_LINE>systemDiskSizes.add(_ctx.stringValue("DescribeReservedResourceResponse.SupportResources[" + i + "].SystemDiskSizes[" + j + "]"));<NEW_LINE>}<NEW_LINE>supportResource.setSystemDiskSizes(systemDiskSizes);<NEW_LINE>supportResources.add(supportResource);<NEW_LINE>}<NEW_LINE>describeReservedResourceResponse.setSupportResources(supportResources);<NEW_LINE>return describeReservedResourceResponse;<NEW_LINE>}
("DescribeReservedResourceResponse.SupportResources[" + i + "].InstanceSpec"));
1,357,345
public void marshall(ListTrackersResponseEntry listTrackersResponseEntry, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (listTrackersResponseEntry == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(listTrackersResponseEntry.getCreateTime(), CREATETIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(listTrackersResponseEntry.getPricingPlan(), PRICINGPLAN_BINDING);<NEW_LINE>protocolMarshaller.marshall(listTrackersResponseEntry.getPricingPlanDataSource(), PRICINGPLANDATASOURCE_BINDING);<NEW_LINE>protocolMarshaller.marshall(listTrackersResponseEntry.getTrackerName(), TRACKERNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(listTrackersResponseEntry.getUpdateTime(), UPDATETIME_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
listTrackersResponseEntry.getDescription(), DESCRIPTION_BINDING);
1,300,177
private void updateMenuState() {<NEW_LINE>m_appendAnd.setEnabled(m_criteriumNode<MASK><NEW_LINE>m_appendOr.setEnabled(m_criteriumNode.allowAppend(COrCriterium.class));<NEW_LINE>m_appendNot.setEnabled(m_criteriumNode.allowAppend(CNotCriterium.class));<NEW_LINE>m_insertAnd.setEnabled(m_criteriumNode.allowInsert(CAndCriterium.class));<NEW_LINE>m_insertOr.setEnabled(m_criteriumNode.allowInsert(COrCriterium.class));<NEW_LINE>m_insertNot.setEnabled(m_criteriumNode.allowInsert(CNotCriterium.class));<NEW_LINE>m_conditionSubmenu.setEnabled(m_criteriumNode.allowAppend(CConditionCriterium.class));<NEW_LINE>m_remove.setEnabled(!m_criteriumNode.isRoot());<NEW_LINE>m_removeAll.setEnabled(m_criteriumNode.getChildCount() != 0);<NEW_LINE>}
.allowAppend(CAndCriterium.class));
1,854,805
public void request(long n) {<NEW_LINE>if (!sub.isOpen) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (processAll) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (wip.compareAndSet(0, 1)) {<NEW_LINE>// if processAll the demand is self-sustaining, passed on in onComplete<NEW_LINE>if (n == Long.MAX_VALUE || sub.requested.get() == Long.MAX_VALUE) {<NEW_LINE>processAll = true;<NEW_LINE>Subscription sa = null;<NEW_LINE>Subscription nextLocal = null;<NEW_LINE>do {<NEW_LINE>sa = active.get();<NEW_LINE>if (sa != null) {<NEW_LINE>sa.request(Long.MAX_VALUE);<NEW_LINE>}<NEW_LINE>nextLocal = next.get();<NEW_LINE>if (nextLocal != null) {<NEW_LINE>nextLocal.request(Long.MAX_VALUE);<NEW_LINE>}<NEW_LINE>} while (sa == null && nextLocal == null && !complete);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>requested.accumulateAndGet(n, (a<MASK><NEW_LINE>Subscription local = active.get();<NEW_LINE>if (decrementAndCheckActive()) {<NEW_LINE>addMissingRequests();<NEW_LINE>}<NEW_LINE>if (local != null) {<NEW_LINE>local.request(n);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>queued.accumulateAndGet(n, (a, b) -> a + b);<NEW_LINE>if (incrementAndCheckInactive()) {<NEW_LINE>addMissingRequests();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, b) -> a + b);
436,736
public KeySelectorResult select(@Nullable KeyInfo keyInfo, KeySelector.Purpose purpose, AlgorithmMethod method, XMLCryptoContext context) throws KeySelectorException {<NEW_LINE>if (keyInfo == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>for (Object keyInfoChild : keyInfo.getContent()) {<NEW_LINE>if (keyInfoChild instanceof X509Data) {<NEW_LINE>X509Data x509Data = (X509Data) keyInfoChild;<NEW_LINE>for (Object x509DataChild : x509Data.getContent()) {<NEW_LINE>if (x509DataChild instanceof X509Certificate) {<NEW_LINE>X509Certificate cert = (X509Certificate) x509DataChild;<NEW_LINE>try {<NEW_LINE>tmchCertificateAuthority.verify(cert);<NEW_LINE>} catch (SignatureException e) {<NEW_LINE>throw new KeySelectorException(new CertificateSignatureException(e.getMessage()));<NEW_LINE>} catch (GeneralSecurityException e) {<NEW_LINE>throw new KeySelectorException(e);<NEW_LINE>}<NEW_LINE>return new <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new KeySelectorException("No public key found.");<NEW_LINE>}
SimpleKeySelectorResult(cert.getPublicKey());
591,258
// borrowed from commons-lang StringUtils<NEW_LINE>private static CharSequence replaceImpl(final String str, String sub, final String repl, int max, final boolean ignoreCase) {<NEW_LINE>if (str.length() == 0 || sub.length() == 0)<NEW_LINE>return str;<NEW_LINE>String search = str;<NEW_LINE>if (ignoreCase) {<NEW_LINE>search = str.toLowerCase();<NEW_LINE>sub = sub.toLowerCase();<NEW_LINE>}<NEW_LINE>int start = 0;<NEW_LINE>int end = search.indexOf(sub, start);<NEW_LINE>if (end == -1)<NEW_LINE>return str;<NEW_LINE>final int replLength = sub.length();<NEW_LINE>int increase = repl.length() - replLength;<NEW_LINE>increase = increase < 0 ? 0 : increase;<NEW_LINE>increase *= max < 0 ? 16 : max > 64 ? 64 : max;<NEW_LINE>final StringBuilder buf = new StringBuilder(str.length() + increase);<NEW_LINE>while (end != -1) {<NEW_LINE>buf.append(str, start<MASK><NEW_LINE>start = end + replLength;<NEW_LINE>if (--max == 0)<NEW_LINE>break;<NEW_LINE>end = search.indexOf(sub, start);<NEW_LINE>}<NEW_LINE>buf.append(str, start, str.length());<NEW_LINE>return buf;<NEW_LINE>}
, end).append(repl);
240,899
private Mono<Checkpoint> convertToCheckpoint(BlobItem blobItem) {<NEW_LINE>String[] names = blobItem.getName().split(BLOB_PATH_SEPARATOR);<NEW_LINE>LOGGER.atVerbose().addKeyValue(BLOB_NAME_LOG_KEY, blobItem.getName()).log(Messages.FOUND_BLOB_FOR_PARTITION);<NEW_LINE>if (names.length == 5) {<NEW_LINE>// Blob names should be of the pattern<NEW_LINE>// fullyqualifiednamespace/eventhub/consumergroup/checkpoints/<partitionId><NEW_LINE>// While we can further check if the partition id is numeric, it may not necessarily be the case in future.<NEW_LINE>if (CoreUtils.isNullOrEmpty(blobItem.getMetadata())) {<NEW_LINE>LOGGER.atWarning().addKeyValue(BLOB_NAME_LOG_KEY, blobItem.getName()).log(Messages.NO_METADATA_AVAILABLE_FOR_BLOB);<NEW_LINE>return Mono.empty();<NEW_LINE>}<NEW_LINE>Map<String, String> metadata = blobItem.getMetadata();<NEW_LINE>LOGGER.atVerbose().addKeyValue(BLOB_NAME_LOG_KEY, blobItem.getName()).addKeyValue(SEQUENCE_NUMBER_LOG_KEY, metadata.get(SEQUENCE_NUMBER)).addKeyValue(OFFSET_LOG_KEY, metadata.get(OFFSET)<MASK><NEW_LINE>Long sequenceNumber = null;<NEW_LINE>Long offset = null;<NEW_LINE>if (!CoreUtils.isNullOrEmpty(metadata.get(SEQUENCE_NUMBER))) {<NEW_LINE>sequenceNumber = Long.parseLong(metadata.get(SEQUENCE_NUMBER));<NEW_LINE>}<NEW_LINE>if (!CoreUtils.isNullOrEmpty(metadata.get(OFFSET))) {<NEW_LINE>offset = Long.parseLong(metadata.get(OFFSET));<NEW_LINE>}<NEW_LINE>Checkpoint checkpoint = // names[3] is "checkpoint"<NEW_LINE>new Checkpoint().setFullyQualifiedNamespace(names[0]).setEventHubName(names[1]).setConsumerGroup(names[2]).setPartitionId(names[4]).setSequenceNumber(sequenceNumber).setOffset(offset);<NEW_LINE>return Mono.just(checkpoint);<NEW_LINE>}<NEW_LINE>return Mono.empty();<NEW_LINE>}
).log(Messages.CHECKPOINT_INFO);
888,766
private Text appendAntiSpam(Text text, int index) {<NEW_LINE>List<ChatHudLine<OrderedText>> visibleMessages = ((ChatHudAccessor) mc.inGameHud.<MASK><NEW_LINE>if (visibleMessages.isEmpty() || index < 0 || index > visibleMessages.size() - 1)<NEW_LINE>return null;<NEW_LINE>ChatHudLine<OrderedText> visibleMessage = visibleMessages.get(index);<NEW_LINE>LiteralText parsed = new LiteralText("");<NEW_LINE>visibleMessage.getText().accept((i, style, codePoint) -> {<NEW_LINE>parsed.append(new LiteralText(new String(Character.toChars(codePoint))).setStyle(style));<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>String oldMessage = parsed.getString();<NEW_LINE>String newMessage = text.getString();<NEW_LINE>if (oldMessage.equals(newMessage)) {<NEW_LINE>return parsed.append(new LiteralText(" (2)").formatted(Formatting.GRAY));<NEW_LINE>} else {<NEW_LINE>Matcher matcher = Pattern.compile(".*(\\([0-9]+\\)$)").matcher(oldMessage);<NEW_LINE>if (!matcher.matches())<NEW_LINE>return null;<NEW_LINE>String group = matcher.group(matcher.groupCount());<NEW_LINE>int number = Integer.parseInt(group.substring(1, group.length() - 1));<NEW_LINE>String counter = " (" + number + ")";<NEW_LINE>if (oldMessage.substring(0, oldMessage.length() - counter.length()).equals(newMessage)) {<NEW_LINE>for (int i = 0; i < counter.length(); i++) parsed.getSiblings().remove(parsed.getSiblings().size() - 1);<NEW_LINE>return parsed.append(new LiteralText(" (" + (number + 1) + ")").formatted(Formatting.GRAY));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
getChatHud()).getVisibleMessages();
1,808,997
public static PrunedTag[] parse(final String value) {<NEW_LINE>return split(value, ",").get(stream -> stream.filter(StringUtil::isNotBlank).map(v -> {<NEW_LINE>final Pattern pattern = Pattern.compile("(\\w+)(\\[[^\\]]+\\])?(\\.[\\w\\-]+)?(#[\\w\\-]+)?");<NEW_LINE>final Matcher matcher = pattern.matcher(v.trim());<NEW_LINE>if (matcher.matches()) {<NEW_LINE>final PrunedTag tag = new PrunedTag(matcher.group(1));<NEW_LINE>if (matcher.group(2) != null) {<NEW_LINE>final String attrPair = matcher.group(2).substring(1, matcher.group(2).length() - 1);<NEW_LINE>final Matcher equalMatcher = Pattern.compile<MASK><NEW_LINE>if (equalMatcher.matches()) {<NEW_LINE>tag.setAttr(equalMatcher.group(1), equalMatcher.group(2));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (matcher.group(3) != null) {<NEW_LINE>tag.setCss(matcher.group(3).substring(1));<NEW_LINE>}<NEW_LINE>if (matcher.group(4) != null) {<NEW_LINE>tag.setId(matcher.group(4).substring(1));<NEW_LINE>}<NEW_LINE>return tag;<NEW_LINE>}<NEW_LINE>throw new FessSystemException("Invalid pruned tag: " + v);<NEW_LINE>}).toArray(n -> new PrunedTag[n]));<NEW_LINE>}
("([\\w\\-]+)=(\\S+)").matcher(attrPair);
1,213,282
// Performs linear interpolation to increase or decrease the size of array x to newLength<NEW_LINE>public static double[] interpolate(double[] x, int newLength) {<NEW_LINE>double[] y = null;<NEW_LINE>if (newLength > 0) {<NEW_LINE>int N = x.length;<NEW_LINE>if (N == 1) {<NEW_LINE>y = new double[1];<NEW_LINE>y[0] = x[0];<NEW_LINE>return y;<NEW_LINE>} else if (newLength == 1) {<NEW_LINE>y = new double[1];<NEW_LINE>int ind = (int) Math.floor(N * 0.5 + 0.5);<NEW_LINE>ind = Math.max(1, ind);<NEW_LINE>ind = Math.min(ind, N);<NEW_LINE>y[0] = x[ind - 1];<NEW_LINE>return y;<NEW_LINE>} else {<NEW_LINE>y = new double[newLength];<NEW_LINE>int leftInd;<NEW_LINE>double ratio = ((double) x.length) / newLength;<NEW_LINE>for (int i = 0; i < newLength; i++) {<NEW_LINE>leftInd = (int) Math.floor(i * ratio);<NEW_LINE>if (leftInd < x.length - 1)<NEW_LINE>y[i] = interpolatedSample(leftInd, i * ratio, leftInd + 1, x[leftInd]<MASK><NEW_LINE>else {<NEW_LINE>if (leftInd > 0)<NEW_LINE>y[i] = interpolatedSample(leftInd, i * ratio, leftInd + 1, x[leftInd], 2 * x[leftInd] - x[leftInd - 1]);<NEW_LINE>else<NEW_LINE>y[i] = x[leftInd];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return y;<NEW_LINE>}
, x[leftInd + 1]);
1,370,298
final ListTemplateVersionsResult executeListTemplateVersions(ListTemplateVersionsRequest listTemplateVersionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTemplateVersionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTemplateVersionsRequest> request = null;<NEW_LINE>Response<ListTemplateVersionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTemplateVersionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTemplateVersionsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "QuickSight");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTemplateVersions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTemplateVersionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTemplateVersionsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
856,280
/*<NEW_LINE>* External API<NEW_LINE>*/<NEW_LINE>protected ArrayList<FileSystem.Classpath> handleClasspath(ArrayList<String> classpaths, String customEncoding) {<NEW_LINE>ArrayList<FileSystem.Classpath> initial = new ArrayList<>(DEFAULT_SIZE_CLASSPATH);<NEW_LINE>if (classpaths != null && classpaths.size() > 0) {<NEW_LINE>for (String path : classpaths) {<NEW_LINE>processPathEntries(DEFAULT_SIZE_CLASSPATH, initial, path, customEncoding, false, true);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// no user classpath specified.<NEW_LINE>// $NON-NLS-1$<NEW_LINE>String classProp = System.getProperty("java.class.path");<NEW_LINE>if ((classProp == null) || (classProp.length() == 0)) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>addPendingErrors(this.bind("configure.noClasspath"));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>final Classpath classpath = FileSystem.getClasspath(System.getProperty("user.dir"), customEncoding, null, <MASK><NEW_LINE>if (classpath != null) {<NEW_LINE>initial.add(classpath);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>StringTokenizer tokenizer = new StringTokenizer(classProp, File.pathSeparator);<NEW_LINE>String token;<NEW_LINE>while (tokenizer.hasMoreTokens()) {<NEW_LINE>token = tokenizer.nextToken();<NEW_LINE>FileSystem.Classpath currentClasspath = FileSystem.getClasspath(token, customEncoding, null, this.options, this.releaseVersion);<NEW_LINE>if (currentClasspath != null) {<NEW_LINE>initial.add(currentClasspath);<NEW_LINE>} else if (token.length() != 0) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>addPendingErrors(this.bind("configure.incorrectClasspath", token));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ArrayList<Classpath> result = new ArrayList<>();<NEW_LINE>HashMap<String, Classpath> knownNames = new HashMap<>();<NEW_LINE>FileSystem.ClasspathSectionProblemReporter problemReporter = new FileSystem.ClasspathSectionProblemReporter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void invalidClasspathSection(String jarFilePath) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>addPendingErrors(bind("configure.invalidClasspathSection", jarFilePath));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void multipleClasspathSections(String jarFilePath) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>addPendingErrors(bind("configure.multipleClasspathSections", jarFilePath));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>while (!initial.isEmpty()) {<NEW_LINE>Classpath current = initial.remove(0);<NEW_LINE>String currentPath = current.getPath();<NEW_LINE>if (knownNames.get(currentPath) == null) {<NEW_LINE>knownNames.put(currentPath, current);<NEW_LINE>result.add(current);<NEW_LINE>List<Classpath> linkedJars = current.fetchLinkedJars(problemReporter);<NEW_LINE>if (linkedJars != null) {<NEW_LINE>initial.addAll(0, linkedJars);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
this.options, this.releaseVersion);
1,391,261
public boolean applyRule(String query, BibEntry bibEntry) {<NEW_LINE>Pattern pattern;<NEW_LINE>try {<NEW_LINE>pattern = Pattern.compile(query, searchFlags.contains(SearchRules.SearchFlags.CASE_SENSITIVE<MASK><NEW_LINE>} catch (PatternSyntaxException ex) {<NEW_LINE>LOGGER.debug("Could not compile regex {}", query, ex);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>for (Field field : bibEntry.getFields()) {<NEW_LINE>Optional<String> fieldOptional = bibEntry.getField(field);<NEW_LINE>if (fieldOptional.isPresent()) {<NEW_LINE>String fieldContentNoBrackets = bibEntry.getLatexFreeField(field).get();<NEW_LINE>Matcher m = pattern.matcher(fieldContentNoBrackets);<NEW_LINE>if (m.find()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return getFulltextResults(query, bibEntry).numSearchResults() > 0;<NEW_LINE>}
) ? 0 : Pattern.CASE_INSENSITIVE);
1,544,775
public RemoteConfiguration createRemoteConfiguration(ConfigManager.Configuration configuration) {<NEW_LINE>configuration.putValue(TYPE, FTP_CONNECTION_TYPE);<NEW_LINE>// NOI18N<NEW_LINE>configuration.putValue(HOST, "");<NEW_LINE>configuration.putValue(PORT, String.valueOf(DEFAULT_PORT));<NEW_LINE>configuration.putValue(ENCRYPTION, DEFAULT_ENCRYPTION.name());<NEW_LINE>configuration.putValue(ONLY_LOGIN_ENCRYPTED, String.valueOf(DEFAULT_ONLY_LOGIN_ENCRYPTED));<NEW_LINE>// NOI18N<NEW_LINE>configuration.putValue(USER, "");<NEW_LINE>// NOI18N<NEW_LINE>configuration.putValue(PASSWORD, "");<NEW_LINE>configuration.putValue(ANONYMOUS_LOGIN, String.valueOf(false));<NEW_LINE>configuration.putValue(INITIAL_DIRECTORY, DEFAULT_INITIAL_DIRECTORY);<NEW_LINE>configuration.putValue(TIMEOUT, String.valueOf(DEFAULT_TIMEOUT));<NEW_LINE>configuration.putValue(KEEP_ALIVE_INTERVAL, String.valueOf(DEFAULT_KEEP_ALIVE_INTERVAL));<NEW_LINE>configuration.putValue(PASSIVE_MODE, String.valueOf(true));<NEW_LINE><MASK><NEW_LINE>configuration.putValue(ACTIVE_PORT_MIN, "");<NEW_LINE>configuration.putValue(ACTIVE_PORT_MAX, "");<NEW_LINE>configuration.putValue(IGNORE_DISCONNECT_ERRORS, String.valueOf(true));<NEW_LINE>assert accept(configuration) : "Not my configuration?!";<NEW_LINE>return new FtpConfiguration(configuration);<NEW_LINE>}
configuration.putValue(ACTIVE_EXTERNAL_IP, "");
203,867
public NonCompliantResource unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AwsJsonReader reader = context.getReader();<NEW_LINE>if (!reader.isContainer()) {<NEW_LINE>reader.skipValue();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>NonCompliantResource nonCompliantResource = new NonCompliantResource();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE><MASK><NEW_LINE>if (name.equals("resourceType")) {<NEW_LINE>nonCompliantResource.setResourceType(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("resourceIdentifier")) {<NEW_LINE>nonCompliantResource.setResourceIdentifier(ResourceIdentifierJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("additionalInfo")) {<NEW_LINE>nonCompliantResource.setAdditionalInfo(new MapUnmarshaller<String>(StringJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return nonCompliantResource;<NEW_LINE>}
String name = reader.nextName();
466,212
String configFiles(Request req, Response res) {<NEW_LINE>ConfigRepoPlugin repoPlugin = pluginFromRequest(req);<NEW_LINE>File folder = null;<NEW_LINE>try {<NEW_LINE>JsonReader jsonReader = GsonTransformer.getInstance().jsonReaderFrom(req.body());<NEW_LINE>ConfigHelperOptions options = new ConfigHelperOptions(goConfigService.getCurrentConfig(), passwordDeserializer);<NEW_LINE>MaterialConfig materialConfig = MaterialsRepresenter.fromJSON(jsonReader, options);<NEW_LINE>if (!(materialConfig instanceof ScmMaterialConfig)) {<NEW_LINE>res.status(HttpStatus.UNPROCESSABLE_ENTITY.value());<NEW_LINE>return MessageJson.create(format("This material check requires an SCM repository; instead, supplied material was of type: %s", materialConfig.getType()));<NEW_LINE>}<NEW_LINE>validateMaterial(materialConfig);<NEW_LINE>if (materialConfig.errors().present()) {<NEW_LINE>res.status(HttpStatus.UNPROCESSABLE_ENTITY.value());<NEW_LINE>return MessageJson.create(format("Please fix the following SCM configuration errors: %s", materialConfig.errors().asString()));<NEW_LINE>}<NEW_LINE>if (configRepoService.hasConfigRepoByFingerprint(materialConfig.getFingerprint())) {<NEW_LINE>res.status(HttpStatus.CONFLICT.value());<NEW_LINE>return MessageJson.create("Material is already being used as a config repository");<NEW_LINE>}<NEW_LINE>folder = FileUtil.createTempFolder();<NEW_LINE>checkoutFromMaterialConfig(materialConfig, folder);<NEW_LINE>final Map<String, ConfigFileList> pacPluginFiles = Collections.singletonMap(repoPlugin.id(), repoPlugin.getConfigFiles(folder, new ArrayList<>()));<NEW_LINE>return jsonizeAsTopLevelObject(req, w -> ConfigFileListsRepresenter.toJSON(w, pacPluginFiles));<NEW_LINE>} catch (TimeoutException e) {<NEW_LINE>res.status(HttpStatus.PAYLOAD_TOO_LARGE.value());<NEW_LINE>return MessageJson.create("Aborted check because cloning the SCM repository took too long");<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>res.status(HttpStatus.INTERNAL_SERVER_ERROR.value());<NEW_LINE>// unwrap these exceptions thrown by the future<NEW_LINE>return MessageJson.create(e.<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>res.status(HttpStatus.INTERNAL_SERVER_ERROR.value());<NEW_LINE>return MessageJson.create(e.getMessage());<NEW_LINE>} finally {<NEW_LINE>if (null != folder) {<NEW_LINE>FileUtils.deleteQuietly(folder);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getCause().getMessage());
1,268,071
final CloneReceiptRuleSetResult executeCloneReceiptRuleSet(CloneReceiptRuleSetRequest cloneReceiptRuleSetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(cloneReceiptRuleSetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CloneReceiptRuleSetRequest> request = null;<NEW_LINE>Response<CloneReceiptRuleSetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CloneReceiptRuleSetRequestMarshaller().marshall(super.beforeMarshalling(cloneReceiptRuleSetRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SES");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CloneReceiptRuleSet");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>StaxResponseHandler<CloneReceiptRuleSetResult> responseHandler = new StaxResponseHandler<CloneReceiptRuleSetResult>(new CloneReceiptRuleSetResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
474,456
public Object createFont(int face, int style, int size) {<NEW_LINE>Typeface typeface = null;<NEW_LINE>switch(face) {<NEW_LINE>case Font.FACE_MONOSPACE:<NEW_LINE>typeface = Typeface.MONOSPACE;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>typeface = Typeface.DEFAULT;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>int fontstyle = Typeface.NORMAL;<NEW_LINE>if ((style & Font.STYLE_BOLD) != 0) {<NEW_LINE>fontstyle |= Typeface.BOLD;<NEW_LINE>}<NEW_LINE>if ((style & Font.STYLE_ITALIC) != 0) {<NEW_LINE>fontstyle |= Typeface.ITALIC;<NEW_LINE>}<NEW_LINE>int height = this.defaultFontHeight;<NEW_LINE>int diff = height / 3;<NEW_LINE>switch(size) {<NEW_LINE>case Font.SIZE_SMALL:<NEW_LINE>height -= diff;<NEW_LINE>break;<NEW_LINE>case Font.SIZE_LARGE:<NEW_LINE>height += diff;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>Paint font = new CodenameOneTextPaint(Typeface.create(typeface, fontstyle));<NEW_LINE>font.setAntiAlias(true);<NEW_LINE>font.setUnderlineText((style <MASK><NEW_LINE>font.setTextSize(height);<NEW_LINE>return new NativeFont(face, style, size, font);<NEW_LINE>}
& Font.STYLE_UNDERLINED) != 0);
948,251
private void updatePosition(Drawing drawing) {<NEW_LINE>double size = ResizeControl.SIZE / drawing.getScale();<NEW_LINE>double halfSize = size / 2d;<NEW_LINE>double arcSize = ResizeControl.ARC_SIZE / drawing.getScale();<NEW_LINE>this.shape.setRoundRect(0, 0, size, size, arcSize, arcSize);<NEW_LINE>// Create transformation for where to position the controller in relative space<NEW_LINE>AffineTransform t = getSelectionManager().getTransform();<NEW_LINE>Rectangle2D bounds = getSelectionManager()<MASK><NEW_LINE>t.translate(bounds.getX(), bounds.getY());<NEW_LINE>t.translate(bounds.getWidth() / 2, bounds.getHeight() / 2);<NEW_LINE>// Transform the position from relative space to real space<NEW_LINE>Point2D center = new Point2D.Double();<NEW_LINE>t.transform(new Point2D.Double(0, 0), center);<NEW_LINE>this.transform = new AffineTransform();<NEW_LINE>this.transform.translate(center.getX() - halfSize, center.getY() - halfSize);<NEW_LINE>}
.getRelativeShape().getBounds2D();
36,228
private void cleanupStaleBlobs(Collection<SnapshotId> deletedSnapshots, Map<String, BlobContainer> foundIndices, Map<String, BlobMetadata> rootBlobs, RepositoryData newRepoData, ActionListener<DeleteResult> listener) {<NEW_LINE>final GroupedActionListener<DeleteResult> groupedListener = new GroupedActionListener<>(ActionListener.wrap(deleteResults -> {<NEW_LINE>DeleteResult deleteResult = DeleteResult.ZERO;<NEW_LINE>for (DeleteResult result : deleteResults) {<NEW_LINE>deleteResult = deleteResult.add(result);<NEW_LINE>}<NEW_LINE>listener.onResponse(deleteResult);<NEW_LINE>}, listener::onFailure), 2);<NEW_LINE>final Executor executor = threadPool.executor(ThreadPool.Names.SNAPSHOT);<NEW_LINE>final List<String> staleRootBlobs = staleRootBlobs(newRepoData, rootBlobs.keySet());<NEW_LINE>if (staleRootBlobs.isEmpty()) {<NEW_LINE>groupedListener.onResponse(DeleteResult.ZERO);<NEW_LINE>} else {<NEW_LINE>executor.execute(ActionRunnable.supply(groupedListener, () -> {<NEW_LINE>List<String> deletedBlobs = cleanupStaleRootFiles(newRepoData.getGenId() - 1, deletedSnapshots, staleRootBlobs);<NEW_LINE>return new DeleteResult(deletedBlobs.size(), deletedBlobs.stream().mapToLong(name -> rootBlobs.get(name).length<MASK><NEW_LINE>}));<NEW_LINE>}<NEW_LINE>final Set<String> survivingIndexIds = newRepoData.getIndices().values().stream().map(IndexId::getId).collect(Collectors.toSet());<NEW_LINE>if (foundIndices.keySet().equals(survivingIndexIds)) {<NEW_LINE>groupedListener.onResponse(DeleteResult.ZERO);<NEW_LINE>} else {<NEW_LINE>executor.execute(ActionRunnable.supply(groupedListener, () -> cleanupStaleIndices(foundIndices, survivingIndexIds)));<NEW_LINE>}<NEW_LINE>}
()).sum());
991,523
private DefinitionProtos.Body writeBody(ExpressionSerialization defSerializer, @NotNull Body body) {<NEW_LINE>DefinitionProtos.Body.Builder bodyBuilder = DefinitionProtos.Body.newBuilder();<NEW_LINE>if (body instanceof IntervalElim) {<NEW_LINE>IntervalElim intervalElim = (IntervalElim) body;<NEW_LINE>DefinitionProtos.Body.IntervalElim.Builder intervalBuilder = DefinitionProtos.Body.IntervalElim.newBuilder();<NEW_LINE>for (Pair<Expression, Expression> pair : intervalElim.getCases()) {<NEW_LINE>DefinitionProtos.Body.ExpressionPair.Builder pairBuilder = DefinitionProtos.Body.ExpressionPair.newBuilder();<NEW_LINE>if (pair.proj1 != null) {<NEW_LINE>pairBuilder.setLeft(defSerializer.writeExpr(pair.proj1));<NEW_LINE>}<NEW_LINE>if (pair.proj2 != null) {<NEW_LINE>pairBuilder.setRight(defSerializer<MASK><NEW_LINE>}<NEW_LINE>intervalBuilder.addCase(pairBuilder);<NEW_LINE>}<NEW_LINE>if (intervalElim.getOtherwise() != null) {<NEW_LINE>intervalBuilder.setOtherwise(defSerializer.writeElimBody(intervalElim.getOtherwise()));<NEW_LINE>}<NEW_LINE>bodyBuilder.setIntervalElim(intervalBuilder);<NEW_LINE>} else if (body instanceof ElimBody) {<NEW_LINE>bodyBuilder.setElimBody(defSerializer.writeElimBody((ElimBody) body));<NEW_LINE>} else if (body instanceof Expression) {<NEW_LINE>bodyBuilder.setExpression(defSerializer.writeExpr((Expression) body));<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}<NEW_LINE>return bodyBuilder.build();<NEW_LINE>}
.writeExpr(pair.proj2));
1,603,042
private String recalculate() {<NEW_LINE>MProduct product = MProduct.get(getCtx(), getM_Product_ID());<NEW_LINE>MAcctSchema as = MClient.get(getCtx()).getAcctSchema();<NEW_LINE>MCostType ct = MCostType.getByMethodCosting(as, as.getCostingMethod());<NEW_LINE>String costingLevel = product.getCostingLevel(as);<NEW_LINE>if (!as.getM_CostType().getCostingMethod().equals(MCostType.COSTINGMETHOD_StandardCosting))<NEW_LINE>return "";<NEW_LINE>int AD_Org_ID = costingLevel.equals(MAcctSchema.<MASK><NEW_LINE>int M_Warehouse_ID = costingLevel.equals(MAcctSchema.COSTINGLEVEL_Warehouse) ? getM_Locator().getM_Warehouse_ID() : 0;<NEW_LINE>if (!as.getM_CostType().getCostingMethod().equals(MCostType.COSTINGMETHOD_StandardCosting))<NEW_LINE>return "";<NEW_LINE>ProcessInfo processInfo = ProcessBuilder.create(getCtx()).process(53062).withRecordId(MProduction.Table_ID, getM_Product_ID()).withParameter("C_AcctSchema_ID", as.getC_AcctSchema_ID()).withParameter("S_Resource_ID", as.getC_AcctSchema_ID()).withParameter("", as.getCostingMethod()).withParameter("M_CostType_ID", ct.getM_CostType_ID()).withParameter("ADOrg_ID", AD_Org_ID).withParameter("M_Warehouse_ID", M_Warehouse_ID).withParameter("CostingMethod", as.getCostingMethod()).withoutTransactionClose().execute(get_TrxName());<NEW_LINE>if (processInfo.isError())<NEW_LINE>throw new AdempiereException(processInfo.getSummary());<NEW_LINE>// Log<NEW_LINE>log.info(processInfo.getSummary());<NEW_LINE>return "";<NEW_LINE>}
COSTINGLEVEL_Organization) ? getAD_Org_ID() : 0;
24,642
public ApiResponse handleApiView(String name, JSONObject params) throws ApiException {<NEW_LINE>log.debug("handleApiView " + name + " " + params.toString());<NEW_LINE>switch(name) {<NEW_LINE>case VIEW_GET_AUTHENTICATION:<NEW_LINE>return getContext(params).getAuthenticationMethod().getApiResponseRepresentation();<NEW_LINE>case VIEW_GET_LOGGED_IN_INDICATOR:<NEW_LINE>Pattern loggedInPattern = getContext(params).getAuthenticationMethod().getLoggedInIndicatorPattern();<NEW_LINE>if (loggedInPattern != null)<NEW_LINE>return new ApiResponseElement("logged_in_regex", loggedInPattern.toString());<NEW_LINE>else<NEW_LINE>return new ApiResponseElement("logged_in_regex", "");<NEW_LINE>case VIEW_GET_LOGGED_OUT_INDICATOR:<NEW_LINE>Pattern loggedOutPattern = getContext(params).getAuthenticationMethod().getLoggedOutIndicatorPattern();<NEW_LINE>if (loggedOutPattern != null)<NEW_LINE>return new ApiResponseElement("logged_out_regex", loggedOutPattern.toString());<NEW_LINE>else<NEW_LINE>return new ApiResponseElement("logged_out_regex", "");<NEW_LINE>case VIEW_GET_SUPPORTED_METHODS:<NEW_LINE>ApiResponseList supportedMethods = new ApiResponseList("supportedMethods");<NEW_LINE>for (AuthMethodEntry entry : loadedAuthenticationMethodActions.values()) supportedMethods.addItem(new ApiResponseElement("methodName", entry.getApi().getName()));<NEW_LINE>return supportedMethods;<NEW_LINE>case VIEW_GET_METHOD_CONFIG_PARAMETERS:<NEW_LINE>ApiDynamicActionImplementor a = getSetMethodActionImplementor(params).getApi();<NEW_LINE>return a.buildParamsDescription();<NEW_LINE>default:<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>}
ApiException(ApiException.Type.BAD_VIEW);
969,117
public TimeBasedCanary unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>TimeBasedCanary timeBasedCanary = new TimeBasedCanary();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("canaryPercentage", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>timeBasedCanary.setCanaryPercentage(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("canaryInterval", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>timeBasedCanary.setCanaryInterval(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return timeBasedCanary;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,782,846
final DeleteNetworkInsightsAccessScopeAnalysisResult executeDeleteNetworkInsightsAccessScopeAnalysis(DeleteNetworkInsightsAccessScopeAnalysisRequest deleteNetworkInsightsAccessScopeAnalysisRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteNetworkInsightsAccessScopeAnalysisRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteNetworkInsightsAccessScopeAnalysisRequest> request = null;<NEW_LINE>Response<DeleteNetworkInsightsAccessScopeAnalysisResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DeleteNetworkInsightsAccessScopeAnalysisRequestMarshaller().marshall(super.beforeMarshalling(deleteNetworkInsightsAccessScopeAnalysisRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteNetworkInsightsAccessScopeAnalysis");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeleteNetworkInsightsAccessScopeAnalysisResult> responseHandler = new StaxResponseHandler<DeleteNetworkInsightsAccessScopeAnalysisResult>(new DeleteNetworkInsightsAccessScopeAnalysisResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1,320,826
public MariaDbParameters unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>MariaDbParameters mariaDbParameters = new MariaDbParameters();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Host", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>mariaDbParameters.setHost(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("Port", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>mariaDbParameters.setPort(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Database", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>mariaDbParameters.setDatabase(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return mariaDbParameters;<NEW_LINE>}
class).unmarshall(context));
344,135
public WorkResult execute(T spec) {<NEW_LINE>if (!recompilationSpecProvider.isIncremental()) {<NEW_LINE>LOG.info("Full recompilation is required because no incremental change information is available. This is usually caused by clean builds or changing compiler arguments.");<NEW_LINE>return rebuildAllCompiler.execute(spec);<NEW_LINE>}<NEW_LINE>File previousCompilationDataFile = Objects.requireNonNull(spec.getCompileOptions().getPreviousCompilationDataFile());<NEW_LINE>if (!previousCompilationDataFile.exists()) {<NEW_LINE>LOG.info("Full recompilation is required because no previous compilation result is available.");<NEW_LINE>return rebuildAllCompiler.execute(spec);<NEW_LINE>}<NEW_LINE>if (spec.getSourceRoots().isEmpty()) {<NEW_LINE>LOG.info("Full recompilation is required because the source roots could not be inferred.");<NEW_LINE>return rebuildAllCompiler.execute(spec);<NEW_LINE>}<NEW_LINE>Timer clock = Time.startTimer();<NEW_LINE>CurrentCompilation currentCompilation = new CurrentCompilation(spec, classpathSnapshotter);<NEW_LINE>PreviousCompilationData previousCompilationData = previousCompilationAccess.readPreviousCompilationData(previousCompilationDataFile);<NEW_LINE><MASK><NEW_LINE>RecompilationSpec recompilationSpec = recompilationSpecProvider.provideRecompilationSpec(currentCompilation, previousCompilation);<NEW_LINE>if (recompilationSpec.isFullRebuildNeeded()) {<NEW_LINE>LOG.info("Full recompilation is required because {}. Analysis took {}.", recompilationSpec.getFullRebuildCause(), clock.getElapsed());<NEW_LINE>return rebuildAllCompiler.execute(spec);<NEW_LINE>}<NEW_LINE>boolean cleanedOutput = recompilationSpecProvider.initializeCompilation(spec, recompilationSpec);<NEW_LINE>if (Iterables.isEmpty(spec.getSourceFiles()) && spec.getClasses().isEmpty()) {<NEW_LINE>LOG.info("None of the classes needs to be compiled! Analysis took {}. ", clock.getElapsed());<NEW_LINE>return new RecompilationNotNecessary(previousCompilationData, recompilationSpec);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>WorkResult result = recompilationSpecProvider.decorateResult(recompilationSpec, previousCompilationData, cleaningCompiler.getCompiler().execute(spec));<NEW_LINE>return result.or(WorkResults.didWork(cleanedOutput));<NEW_LINE>} finally {<NEW_LINE>Collection<String> classesToCompile = recompilationSpec.getClassesToCompile();<NEW_LINE>LOG.info("Incremental compilation of {} classes completed in {}.", classesToCompile.size(), clock.getElapsed());<NEW_LINE>LOG.debug("Recompiled classes {}", classesToCompile);<NEW_LINE>}<NEW_LINE>}
PreviousCompilation previousCompilation = new PreviousCompilation(previousCompilationData);
719,362
public VirtualFile createFile(String path) {<NEW_LINE>if (path.startsWith("/")) {<NEW_LINE>path = path.substring(1);<NEW_LINE>}<NEW_LINE>if (path.contains(File.separator)) {<NEW_LINE>String newName = path.substring(0, path.indexOf(File.separator));<NEW_LINE>if (files.containsKey(newName)) {<NEW_LINE>VirtualFile virtualFile = files.get(newName);<NEW_LINE>return virtualFile.createFile(path.substring(path.indexOf(File.separator) + 1));<NEW_LINE>} else {<NEW_LINE>VirtualFile virtualFile <MASK><NEW_LINE>files.put(newName, virtualFile);<NEW_LINE>return virtualFile.createFile(path.substring(path.indexOf(File.separator) + 1));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>VirtualFile virtualFile = new VirtualFile(this, path);<NEW_LINE>if (path.endsWith(".java")) {<NEW_LINE>sourceFiles.add(virtualFile);<NEW_LINE>}<NEW_LINE>files.put(path, virtualFile);<NEW_LINE>return virtualFile;<NEW_LINE>}<NEW_LINE>}
= new VirtualFile(this, newName);
846,205
private static void squareGraphFromSlides() {<NEW_LINE>int n = 9;<NEW_LINE>List<List<Edge>> g = createEmptyGraph(n);<NEW_LINE>addUndirectedEdge(g, 0, 1, 6);<NEW_LINE>addUndirectedEdge(g, 0, 3, 3);<NEW_LINE>addUndirectedEdge(g, 1, 2, 4);<NEW_LINE>addUndirectedEdge(g, 1, 4, 2);<NEW_LINE>addUndirectedEdge(g, 2, 5, 12);<NEW_LINE>addUndirectedEdge(g, 3, 4, 1);<NEW_LINE>addUndirectedEdge(g, 3, 6, 8);<NEW_LINE>addUndirectedEdge(g, 4, 5, 7);<NEW_LINE>addUndirectedEdge(g, 4, 7, 9);<NEW_LINE>addUndirectedEdge(g, 5, 8, 10);<NEW_LINE>addUndirectedEdge(g, 6, 7, 11);<NEW_LINE>addUndirectedEdge(g, 7, 8, 5);<NEW_LINE><MASK><NEW_LINE>Long cost = solver.getMstCost();<NEW_LINE>if (cost == null) {<NEW_LINE>System.out.println("No MST does not exists");<NEW_LINE>} else {<NEW_LINE>System.out.println("MST cost: " + cost);<NEW_LINE>for (Edge e : solver.getMst()) {<NEW_LINE>System.out.println(String.format("from: %d, to: %d, cost: %d", e.from, e.to, e.cost));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
LazyPrimsAdjacencyList solver = new LazyPrimsAdjacencyList(g);
805,620
public Oql visit(Call call) {<NEW_LINE>final Operator op = call.operator();<NEW_LINE>final List<Expression> args = call.arguments();<NEW_LINE>if (op == Operators.NOT_IN || op == IterableOperators.NOT_EMPTY) {<NEW_LINE>// geode doesn't understand syntax foo not in [1, 2, 3]<NEW_LINE>// convert "foo not in [1, 2, 3]" into "not (foo in [1, 2, 3])"<NEW_LINE>return visit(Expressions.not(Expressions.call(inverseOp(op), <MASK><NEW_LINE>}<NEW_LINE>if (op == Operators.AND || op == Operators.OR) {<NEW_LINE>Preconditions.checkArgument(!args.isEmpty(), "Size should be >=1 for %s but was %s", op, args.size());<NEW_LINE>final String join = ") " + op.name() + " (";<NEW_LINE>final String newOql = "(" + args.stream().map(a -> a.accept(this)).map(Oql::oql).collect(Collectors.joining(join)) + ")";<NEW_LINE>return new Oql(variables, newOql);<NEW_LINE>}<NEW_LINE>if (op.arity() == Operator.Arity.BINARY) {<NEW_LINE>return binaryOperator(call);<NEW_LINE>}<NEW_LINE>if (op.arity() == Operator.Arity.UNARY) {<NEW_LINE>return unaryOperator(call);<NEW_LINE>}<NEW_LINE>throw new UnsupportedOperationException("Don't know how to handle " + call);<NEW_LINE>}
call.arguments())));
989,888
public File runFilter(File file, Map<String, String[]> parameters) {<NEW_LINE>Double h = parameters.get(getPrefix() + "h") != null ? Double.parseDouble(parameters.get(getPrefix() + <MASK><NEW_LINE>Double s = parameters.get(getPrefix() + "s") != null ? Double.parseDouble(parameters.get(getPrefix() + "s")[0]) : 0.0;<NEW_LINE>Double b = parameters.get(getPrefix() + "b") != null ? Double.parseDouble(parameters.get(getPrefix() + "b")[0]) : 0.0;<NEW_LINE>File resultFile = getResultsFile(file, parameters);<NEW_LINE>if (!overwrite(resultFile, parameters)) {<NEW_LINE>return resultFile;<NEW_LINE>}<NEW_LINE>HSBAdjustFilter filter = new HSBAdjustFilter();<NEW_LINE>filter.setBFactor(b.floatValue());<NEW_LINE>filter.setHFactor(h.floatValue());<NEW_LINE>filter.setSFactor(s.floatValue());<NEW_LINE>try {<NEW_LINE>BufferedImage src = ImageIO.read(file);<NEW_LINE>BufferedImage dst = filter.filter(src, null);<NEW_LINE>ImageIO.write(dst, "png", resultFile);<NEW_LINE>dst.flush();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new DotRuntimeException("unable to convert file:" + file + " : " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>return resultFile;<NEW_LINE>}
"h")[0]) : 0.0;
554,069
public SessionLoader.WorkerResult apply(EmbeddedCacheManager embeddedCacheManager) {<NEW_LINE>Cache<Object, Object> workCache = embeddedCacheManager.getCache(cacheName);<NEW_LINE>if (log.isTraceEnabled()) {<NEW_LINE>log.tracef("Running computation for segment %s with worker %s", workerCtx.getSegment(), workerCtx.getWorkerId());<NEW_LINE>}<NEW_LINE>KeycloakSessionFactory sessionFactory = workCache.getAdvancedCache().getComponentRegistry().getComponent(KeycloakSessionFactory.class);<NEW_LINE>if (sessionFactory == null) {<NEW_LINE>log.debugf("KeycloakSessionFactory not yet set in cache. Worker skipped");<NEW_LINE>return sessionLoader.createFailedWorkerResult(loaderCtx, workerCtx);<NEW_LINE>}<NEW_LINE>SessionLoader.WorkerResult[] ref <MASK><NEW_LINE>KeycloakModelUtils.runJobInTransaction(sessionFactory, new KeycloakSessionTask() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(KeycloakSession session) {<NEW_LINE>ref[0] = sessionLoader.loadSessions(session, loaderCtx, workerCtx);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return ref[0];<NEW_LINE>}
= new SessionLoader.WorkerResult[1];
292,135
public void mouseDown(MouseEvent e) {<NEW_LINE>double x = xyGraph.primaryXAxis.getPositionValue(e.x, false);<NEW_LINE>double y = xyGraph.primaryYAxis.getPositionValue(e.y, false);<NEW_LINE>if (x < 0 || y < 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>double minDistance = 30.0d;<NEW_LINE>long time = 0;<NEW_LINE>double max = 0;<NEW_LINE>double value = 0;<NEW_LINE>Iterator<Integer> keys = dataMap.keySet().iterator();<NEW_LINE>while (keys.hasNext()) {<NEW_LINE>int objHash = keys.next();<NEW_LINE>TracePair tp = dataMap.get(objHash);<NEW_LINE>Trace t1 = tp.totalTrace;<NEW_LINE>ISample s1 = ScouterUtil.getNearestPoint(t1.getDataProvider(), x);<NEW_LINE>Trace t2 = tp.activeTrace;<NEW_LINE>ISample s2 = ScouterUtil.getNearestPoint(t2.getDataProvider(), x);<NEW_LINE>if (s1 != null && s2 != null) {<NEW_LINE>int x1 = xyGraph.primaryXAxis.getValuePosition(s1.getXValue(), false);<NEW_LINE>int y1 = xyGraph.primaryYAxis.getValuePosition(s1.getYValue(), false);<NEW_LINE>int x2 = xyGraph.primaryXAxis.getValuePosition(s2.getXValue(), false);<NEW_LINE>int y2 = xyGraph.primaryYAxis.getValuePosition(s2.getYValue(), false);<NEW_LINE>double distance1 = ScouterUtil.getPointDistance(e.x, e.y, x1, y1);<NEW_LINE>double distance2 = ScouterUtil.getPointDistance(e.x, e.y, x2, y2);<NEW_LINE>double distance = distance1 > distance2 ? distance2 : distance1;<NEW_LINE>if (minDistance > distance) {<NEW_LINE>minDistance = distance;<NEW_LINE>nearestTracePair = tp;<NEW_LINE>time = (long) s1.getXValue();<NEW_LINE>max = s1.getYValue();<NEW_LINE>value = s2.getYValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (nearestTracePair != null) {<NEW_LINE>int width = PManager.getInstance().getInt(PreferenceConstants.P_CHART_LINE_WIDTH);<NEW_LINE>nearestTracePair.setLineWidth(width + 2);<NEW_LINE>toolTip.setText(TextProxy.object.getText(nearestTracePair.objHash) + "\nTime : " + DateUtil.format(time, "HH:mm:ss") + "\nMax : " + FormatUtil.print(max, "#,###.##") + "\nValue : " + FormatUtil<MASK><NEW_LINE>toolTip.show(new Point(e.x, e.y));<NEW_LINE>}<NEW_LINE>}
.print(value, "#,###.##"));
677,684
private I_AD_UI_Element createUIElement(final I_AD_UI_ElementGroup uiElementGroup, final I_AD_Field adField, final AtomicInteger nextSeqNo, final AtomicInteger nextSeqNoGrid) {<NEW_LINE>// might not be saved<NEW_LINE>final UIElementGroupId uiElementGroupId = UIElementGroupId.ofRepoIdOrNull(uiElementGroup.getAD_UI_ElementGroup_ID());<NEW_LINE>final I_AD_UI_Element uiElement = createUIElementNoSave(uiElementGroupId, adField);<NEW_LINE>final <MASK><NEW_LINE>uiElement.setIsDisplayed(displayed);<NEW_LINE>if (displayed) {<NEW_LINE>final int seqNo = nextSeqNo.getAndAdd(10);<NEW_LINE>uiElement.setSeqNo(seqNo);<NEW_LINE>}<NEW_LINE>final boolean displayedGrid = adField.isDisplayedGrid();<NEW_LINE>uiElement.setIsDisplayedGrid(displayedGrid);<NEW_LINE>if (displayedGrid) {<NEW_LINE>final int seqNoGrid = nextSeqNoGrid.getAndAdd(10);<NEW_LINE>uiElement.setSeqNoGrid(seqNoGrid);<NEW_LINE>}<NEW_LINE>consumer.consume(uiElement, uiElementGroup);<NEW_LINE>return uiElement;<NEW_LINE>}
boolean displayed = adField.isDisplayed();
1,528,336
public void readFrom(StreamInput in) throws IOException {<NEW_LINE>name = in.readString();<NEW_LINE>generation = Long.parseLong(name.substring(1), Character.MAX_RADIX);<NEW_LINE>committed = in.readBoolean();<NEW_LINE>search = in.readBoolean();<NEW_LINE>docCount = in.readInt();<NEW_LINE>delDocCount = in.readInt();<NEW_LINE>sizeInBytes = in.readLong();<NEW_LINE>version = Lucene.parseVersionLenient(<MASK><NEW_LINE>compound = in.readOptionalBoolean();<NEW_LINE>mergeId = in.readOptionalString();<NEW_LINE>memoryInBytes = in.readLong();<NEW_LINE>if (in.readBoolean()) {<NEW_LINE>// verbose mode<NEW_LINE>ramTree = readRamTree(in);<NEW_LINE>}<NEW_LINE>if (in.getVersion().onOrAfter(Version.V_6_0_0_alpha1)) {<NEW_LINE>segmentSort = readSegmentSort(in);<NEW_LINE>} else {<NEW_LINE>segmentSort = null;<NEW_LINE>}<NEW_LINE>if (in.getVersion().onOrAfter(Version.V_6_1_0) && in.readBoolean()) {<NEW_LINE>attributes = in.readMap(StreamInput::readString, StreamInput::readString);<NEW_LINE>} else {<NEW_LINE>attributes = null;<NEW_LINE>}<NEW_LINE>}
in.readOptionalString(), null);
1,823,120
public ISetDeltaMonitor monitorDelta(ICause propagator) {<NEW_LINE>ISetDeltaMonitor[] deltaMonitors = new ISetDeltaMonitor[variables.length];<NEW_LINE>for (int i = 0; i < variables.length; i++) {<NEW_LINE>deltaMonitors[i] = variables[i].monitorDelta(propagator);<NEW_LINE>}<NEW_LINE>return new SetViewOnSetsDeltaMonitor(deltaMonitors) {<NEW_LINE><NEW_LINE>final ISet remove = new SetUnion(removedValues);<NEW_LINE><NEW_LINE>final ISet added = SetFactory.makeStoredSet(SetType.<MASK><NEW_LINE><NEW_LINE>final ISet add = new SetDifference(new SetUnion(addedValues), added);<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void forEach(IntProcedure proc, SetEventType evt) throws ContradictionException {<NEW_LINE>fillValues();<NEW_LINE>if (evt == SetEventType.ADD_TO_KER) {<NEW_LINE>for (int v : add) {<NEW_LINE>proc.execute(v);<NEW_LINE>}<NEW_LINE>for (int v : add) {<NEW_LINE>added.add(v);<NEW_LINE>}<NEW_LINE>} else if (evt == SetEventType.REMOVE_FROM_ENVELOPE) {<NEW_LINE>for (int v : remove) {<NEW_LINE>if (!getUB().contains(v)) {<NEW_LINE>proc.execute(v);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
RANGESET, 0, getModel());
715,190
private static void tryOpenFile(@NonNull Context context, @NonNull Uri uri, @NonNull String fileName, boolean isDirectory) {<NEW_LINE>try {<NEW_LINE>if (isDirectory) {<NEW_LINE>try {<NEW_LINE>openFileWithIntent(context, uri, DocumentsContract.Document.MIME_TYPE_DIR);<NEW_LINE>} catch (ActivityNotFoundException e1) {<NEW_LINE>try {<NEW_LINE>openFileWithIntent(context, uri, "resource/folder");<NEW_LINE>} catch (ActivityNotFoundException e2) {<NEW_LINE>ToastHelper.toast(R.string.select_file_manager);<NEW_LINE>openFileWithIntent(context, uri, "*/*");<NEW_LINE>// TODO if it also crashes after this call, tell the user to get DocumentsUI.apk ? (see #670)<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else<NEW_LINE>openFileWithIntent(context, uri, MimeTypeMap.getSingleton().<MASK><NEW_LINE>} catch (ActivityNotFoundException e) {<NEW_LINE>Timber.e(e, "No activity found to open %s", uri.toString());<NEW_LINE>ToastHelper.toastLong(context, R.string.error_open, Toast.LENGTH_LONG);<NEW_LINE>}<NEW_LINE>}
getMimeTypeFromExtension(getExtension(fileName)));
879,809
private int bound(IntVar var, int val) {<NEW_LINE><MASK><NEW_LINE>int cost;<NEW_LINE>// // if decision is '<=' ('>='), UB (LB) should be ignored to avoid infinite loop<NEW_LINE>if (dop == DecisionOperatorFactory.makeIntSplit() && val == var.getUB() || dop == DecisionOperatorFactory.makeIntReverseSplit() && val == var.getLB()) {<NEW_LINE>return Integer.MAX_VALUE;<NEW_LINE>}<NEW_LINE>model.getEnvironment().worldPush();<NEW_LINE>try {<NEW_LINE>dop.apply(var, val, Cause.Null);<NEW_LINE>model.getSolver().getEngine().propagate();<NEW_LINE>ResolutionPolicy rp = model.getSolver().getObjectiveManager().getPolicy();<NEW_LINE>if (rp == ResolutionPolicy.SATISFACTION) {<NEW_LINE>cost = 1;<NEW_LINE>} else if (rp == ResolutionPolicy.MINIMIZE) {<NEW_LINE>cost = ((IntVar) model.getObjective()).getLB();<NEW_LINE>} else {<NEW_LINE>cost = -((IntVar) model.getObjective()).getUB();<NEW_LINE>}<NEW_LINE>} catch (ContradictionException cex) {<NEW_LINE>cost = Integer.MAX_VALUE;<NEW_LINE>}<NEW_LINE>model.getSolver().getEngine().flush();<NEW_LINE>model.getEnvironment().worldPop();<NEW_LINE>return cost;<NEW_LINE>}
Model model = var.getModel();
1,602,866
public JsonElement serialize(EntityData.Entity src, Type typeOfSrc, JsonSerializationContext context) {<NEW_LINE>JsonObject result = new JsonObject();<NEW_LINE>if (src.hasId()) {<NEW_LINE>result.addProperty("id", src.getId());<NEW_LINE>}<NEW_LINE>if (src.hasParentPrefab() && !src.getParentPrefab().isEmpty()) {<NEW_LINE>result.addProperty("parentPrefab", src.getParentPrefab());<NEW_LINE>}<NEW_LINE>if (src.hasAlwaysRelevant()) {<NEW_LINE>result.addProperty("alwaysRelevant", src.getAlwaysRelevant());<NEW_LINE>}<NEW_LINE>if (src.hasOwner()) {<NEW_LINE>result.addProperty("owner", src.getOwner());<NEW_LINE>}<NEW_LINE>for (EntityData.Component component : src.getComponentList()) {<NEW_LINE>result.add(component.getType()<MASK><NEW_LINE>}<NEW_LINE>if (src.getRemovedComponentCount() > 0) {<NEW_LINE>JsonArray removedComponentArray = new JsonArray();<NEW_LINE>for (String removedComponent : src.getRemovedComponentList()) {<NEW_LINE>removedComponentArray.add(new JsonPrimitive(removedComponent));<NEW_LINE>}<NEW_LINE>result.add("removedComponent", removedComponentArray);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
, context.serialize(component));
1,151,673
public void initialize(Server server, Injector injector) {<NEW_LINE>final ServletContextHandler root = new ServletContextHandler(ServletContextHandler.SESSIONS);<NEW_LINE>root.addServlet(new ServletHolder(new DefaultServlet()), "/*");<NEW_LINE>// Add LimitRequestsFilter as first in the chain if enabled.<NEW_LINE>if (serverConfig.isEnableRequestLimit()) {<NEW_LINE>// To reject xth request, limit should be set to x-1 because (x+1)st request wouldn't reach filter<NEW_LINE>// but rather wait on jetty queue.<NEW_LINE>Preconditions.checkArgument(serverConfig.getNumThreads() > 1, "numThreads must be > 1 to enable Request Limit Filter.");<NEW_LINE>log.info("Enabling Request Limit Filter with limit [%d].", serverConfig.getNumThreads() - 1);<NEW_LINE>root.addFilter(new FilterHolder(new LimitRequestsFilter(serverConfig.getNumThreads() - 1)), "/*", null);<NEW_LINE>}<NEW_LINE>final ObjectMapper jsonMapper = injector.getInstance(Key.get(ObjectMapper.class, Json.class));<NEW_LINE>final AuthenticatorMapper authenticatorMapper = injector.getInstance(AuthenticatorMapper.class);<NEW_LINE>AuthenticationUtils.addSecuritySanityCheckFilter(root, jsonMapper);<NEW_LINE>// perform no-op authorization for these resources<NEW_LINE>AuthenticationUtils.addNoopAuthenticationAndAuthorizationFilters(root, UNSECURED_PATHS);<NEW_LINE>AuthenticationUtils.addNoopAuthenticationAndAuthorizationFilters(root, authConfig.getUnsecuredPaths());<NEW_LINE>List<Authenticator> authenticators = authenticatorMapper.getAuthenticatorChain();<NEW_LINE>AuthenticationUtils.addAuthenticationFilterChain(root, authenticators);<NEW_LINE>AuthenticationUtils.addAllowOptionsFilter(root, authConfig.isAllowUnauthenticatedHttpOptions());<NEW_LINE>JettyServerInitUtils.addAllowHttpMethodsFilter(root, serverConfig.getAllowedHttpMethods());<NEW_LINE>JettyServerInitUtils.addExtensionFilters(root, injector);<NEW_LINE>// Check that requests were authorized before sending responses<NEW_LINE>AuthenticationUtils.addPreResponseAuthorizationCheckFilter(root, authenticators, jsonMapper);<NEW_LINE>root.addFilter(GuiceFilter.class, "/*", null);<NEW_LINE><MASK><NEW_LINE>// Do not change the order of the handlers that have already been added<NEW_LINE>for (Handler handler : server.getHandlers()) {<NEW_LINE>handlerList.addHandler(handler);<NEW_LINE>}<NEW_LINE>handlerList.addHandler(JettyServerInitUtils.getJettyRequestLogHandler());<NEW_LINE>// Add all extension handlers<NEW_LINE>for (Handler handler : extensionHandlers) {<NEW_LINE>handlerList.addHandler(handler);<NEW_LINE>}<NEW_LINE>// Add Gzip handler at the very end<NEW_LINE>handlerList.addHandler(JettyServerInitUtils.wrapWithDefaultGzipHandler(root, serverConfig.getInflateBufferSize(), serverConfig.getCompressionLevel()));<NEW_LINE>final StatisticsHandler statisticsHandler = new StatisticsHandler();<NEW_LINE>statisticsHandler.setHandler(handlerList);<NEW_LINE>server.setHandler(statisticsHandler);<NEW_LINE>}
final HandlerList handlerList = new HandlerList();
672,493
public Object calculate(Context ctx) {<NEW_LINE>JobSpace js = ctx.getJobSpace();<NEW_LINE>if (js != null && js.getAppHome() != null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException(mm.getMessage("license.fpNotSupport") + "system");<NEW_LINE>}<NEW_LINE>if (param == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("system" + mm.getMessage("function.missingParam"));<NEW_LINE>}<NEW_LINE>String cmd = null;<NEW_LINE>String[] cmds = null;<NEW_LINE>if (param.isLeaf()) {<NEW_LINE>Object cmdObj = param.getLeafExpression().calculate(ctx);<NEW_LINE>if (!(cmdObj instanceof String)) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("system" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>cmd = (String) cmdObj;<NEW_LINE>} else {<NEW_LINE>int count = param.getSubSize();<NEW_LINE>cmds = new String[count];<NEW_LINE>for (int i = 0; i < count; ++i) {<NEW_LINE>IParam sub = param.getSub(i);<NEW_LINE>if (sub == null || !sub.isLeaf()) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("system" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>Object cmdObj = sub.getLeafExpression().calculate(ctx);<NEW_LINE>if (!(cmdObj instanceof String)) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("system" <MASK><NEW_LINE>}<NEW_LINE>cmds[i] = (String) cmdObj;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Runtime runtime = Runtime.getRuntime();<NEW_LINE>Process process;<NEW_LINE>if (cmds == null) {<NEW_LINE>process = runtime.exec(cmd);<NEW_LINE>} else {<NEW_LINE>process = runtime.exec(cmds);<NEW_LINE>}<NEW_LINE>StringBuffer errBuf = new StringBuffer(1024);<NEW_LINE>StringBuffer outBuf = new StringBuffer(1024);<NEW_LINE>Grabber g1 = new Grabber(errBuf, process.getErrorStream());<NEW_LINE>Grabber g2 = new Grabber(outBuf, process.getInputStream());<NEW_LINE>g1.start();<NEW_LINE>g2.start();<NEW_LINE>if (option == null || option.indexOf('p') == -1) {<NEW_LINE>int n = process.waitFor();<NEW_LINE>g1.join();<NEW_LINE>g2.join();<NEW_LINE>if (g1.buf.length() > 0)<NEW_LINE>Logger.info(g1.buf);<NEW_LINE>if (g2.buf.length() > 0)<NEW_LINE>Logger.info(g2.buf);<NEW_LINE>return new Integer(n);<NEW_LINE>} else {<NEW_LINE>return Boolean.TRUE;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RQException(e);<NEW_LINE>}<NEW_LINE>}
+ mm.getMessage("function.paramTypeError"));
1,071,491
protected final void parse(byte[] data) {<NEW_LINE>RLPList list = (RLPList) RLP.decode2OneItem(data, 0);<NEW_LINE>if (list.size() < 2) {<NEW_LINE>throw new PeerDiscoveryException(MORE_DATA);<NEW_LINE>}<NEW_LINE>RLPList nodesRLP = (RLPList) list.get(0);<NEW_LINE>for (int i = 0; i < nodesRLP.size(); ++i) {<NEW_LINE>RLPList nodeRLP = (<MASK><NEW_LINE>Node node = new Node(nodeRLP.getRLPData());<NEW_LINE>nodes.add(node);<NEW_LINE>}<NEW_LINE>RLPItem chk = (RLPItem) list.get(1);<NEW_LINE>this.messageId = extractMessageId(chk);<NEW_LINE>this.setNetworkIdWithRLP(list.size() > 2 ? list.get(2) : null);<NEW_LINE>}
RLPList) nodesRLP.get(i);
1,642,165
private File process(File file) throws IOException {<NEW_LINE>if (!properties.containsKey("mainName")) {<NEW_LINE>throw new IllegalStateException("Properties must contain mainName property");<NEW_LINE>}<NEW_LINE>if (!properties.containsKey("packageName")) {<NEW_LINE>throw new IllegalStateException("Properties must contains pacakgeName property");<NEW_LINE>}<NEW_LINE>properties.put("packagePath", properties.getProperty("packageName").replace('.', File.separatorChar));<NEW_LINE>String name = file.getName();<NEW_LINE>if (file.isFile()) {<NEW_LINE>String contents = FileUtils.readFileToString(file, "UTF-8");<NEW_LINE>String newContent = processContent(contents);<NEW_LINE>if (!contents.equals(newContent)) {<NEW_LINE>FileUtils.writeStringToFile(file, newContent, "UTF-8");<NEW_LINE>}<NEW_LINE>File newFile = processFileName(file);<NEW_LINE>if (!newFile.equals(file)) {<NEW_LINE>newFile.getParentFile().mkdirs();<NEW_LINE>FileUtils.moveFile(file, newFile);<NEW_LINE>if (isDirectoryEmpty(file.getParentFile())) {<NEW_LINE>file.getParentFile().delete();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newFile;<NEW_LINE>} else if (file.isDirectory()) {<NEW_LINE>File newFile = processFileName(file);<NEW_LINE>if (!newFile.equals(file)) {<NEW_LINE>newFile.getParentFile().mkdirs();<NEW_LINE><MASK><NEW_LINE>if (isDirectoryEmpty(file.getParentFile())) {<NEW_LINE>file.getParentFile().delete();<NEW_LINE>}<NEW_LINE>file = newFile;<NEW_LINE>}<NEW_LINE>for (File child : file.listFiles()) {<NEW_LINE>File moved = process(child);<NEW_LINE>}<NEW_LINE>return file;<NEW_LINE>} else {<NEW_LINE>return file;<NEW_LINE>}<NEW_LINE>}
FileUtils.moveDirectory(file, newFile);
1,837,491
static State calculateIndexState(ClusterState state, SystemIndexDescriptor descriptor) {<NEW_LINE>final IndexMetadata indexMetadata = state.metadata().index(descriptor.getPrimaryIndex());<NEW_LINE>if (indexMetadata == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final boolean isIndexUpToDate = INDEX_FORMAT_SETTING.get(indexMetadata.getSettings(<MASK><NEW_LINE>final boolean isMappingIsUpToDate = checkIndexMappingUpToDate(descriptor, indexMetadata);<NEW_LINE>final String concreteIndexName = indexMetadata.getIndex().getName();<NEW_LINE>final ClusterHealthStatus indexHealth;<NEW_LINE>final IndexMetadata.State indexState = indexMetadata.getState();<NEW_LINE>if (indexState == IndexMetadata.State.CLOSE) {<NEW_LINE>indexHealth = null;<NEW_LINE>logger.warn("Index [{}] (alias [{}]) is closed. This is likely to prevent some features from functioning correctly", concreteIndexName, descriptor.getAliasName());<NEW_LINE>} else {<NEW_LINE>final IndexRoutingTable routingTable = state.getRoutingTable().index(indexMetadata.getIndex());<NEW_LINE>indexHealth = new ClusterIndexHealth(indexMetadata, routingTable).getStatus();<NEW_LINE>}<NEW_LINE>return new State(indexState, indexHealth, isIndexUpToDate, isMappingIsUpToDate);<NEW_LINE>}
)) == descriptor.getIndexFormat();
884,996
public static FabOptions parse(Context context, JSONObject json) {<NEW_LINE>FabOptions options = new FabOptions();<NEW_LINE>if (json == null)<NEW_LINE>return options;<NEW_LINE>options.id = TextParser.parse(json, "id");<NEW_LINE>options.backgroundColor = ThemeColour.parse(context, json.optJSONObject("backgroundColor"));<NEW_LINE>options.clickColor = ThemeColour.parse(context, json.optJSONObject("clickColor"));<NEW_LINE>options.rippleColor = ThemeColour.parse(context, json.optJSONObject("rippleColor"));<NEW_LINE>options.visible = BoolParser.parse(json, "visible");<NEW_LINE>if (json.has("icon")) {<NEW_LINE>options.icon = TextParser.parse(json.optJSONObject("icon"), "uri");<NEW_LINE>}<NEW_LINE>options.iconColor = ThemeColour.parse(context<MASK><NEW_LINE>if (json.has("actions")) {<NEW_LINE>JSONArray fabsArray = json.optJSONArray("actions");<NEW_LINE>for (int i = 0; i < fabsArray.length(); i++) {<NEW_LINE>options.actionsArray.add(FabOptions.parse(context, fabsArray.optJSONObject(i)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>options.alignHorizontally = TextParser.parse(json, "alignHorizontally");<NEW_LINE>options.alignVertically = TextParser.parse(json, "alignVertically");<NEW_LINE>options.hideOnScroll = BoolParser.parse(json, "hideOnScroll");<NEW_LINE>options.size = TextParser.parse(json, "size");<NEW_LINE>return options;<NEW_LINE>}
, json.optJSONObject("iconColor"));
1,503,750
public static Expr buildExpr(Item item) {<NEW_LINE>// Before testing for a list because of RDF terms that are lists: (qtriple).<NEW_LINE>if (item.isNode())<NEW_LINE>return ExprLib.nodeToExpr(item.getNode());<NEW_LINE>Expr expr = null;<NEW_LINE>if (item.isList()) {<NEW_LINE>ItemList list = item.getList();<NEW_LINE>if (list.size() == 0)<NEW_LINE><MASK><NEW_LINE>Item head = list.get(0);<NEW_LINE>if (head.isNode()) {<NEW_LINE>if (head.getNode().isVariable() && list.size() == 1)<NEW_LINE>// The case of (?z)<NEW_LINE>return new ExprVar(Var.alloc(head.getNode()));<NEW_LINE>return buildFunctionCall(list);<NEW_LINE>} else if (head.isList())<NEW_LINE>BuilderLib.broken(item, "Head is a list");<NEW_LINE>else if (head.isSymbol()) {<NEW_LINE>if (item.isTagged(Tags.tagExpr)) {<NEW_LINE>BuilderLib.checkLength(2, list, "Wrong length: " + item.shortString());<NEW_LINE>item = list.get(1);<NEW_LINE>return buildExpr(item);<NEW_LINE>}<NEW_LINE>return buildExpr(list);<NEW_LINE>}<NEW_LINE>throw new ARQInternalErrorException();<NEW_LINE>}<NEW_LINE>if (item.isSymbolIgnoreCase(Tags.tagTrue))<NEW_LINE>return NodeValue.TRUE;<NEW_LINE>if (item.isSymbolIgnoreCase(Tags.tagFalse))<NEW_LINE>return NodeValue.FALSE;<NEW_LINE>BuilderLib.broken(item, "Not a list or a node or recognized symbol: " + item);<NEW_LINE>return null;<NEW_LINE>}
BuilderLib.broken(item, "Empty list for expression");
696,352
public String bulkDrop(@Sender EntityRef sender, @CommandParam("blockName") String blockName, @CommandParam("value") int value) {<NEW_LINE>// This is a loop which gives the particular amount of block the player wants to spawn<NEW_LINE>ClientComponent clientComponent = sender.getComponent(ClientComponent.class);<NEW_LINE>LocationComponent characterLocation = clientComponent.character.getComponent(LocationComponent.class);<NEW_LINE>Vector3f spawnPos = characterLocation.getWorldPosition(new Vector3f());<NEW_LINE>Vector3f offset = characterLocation.getWorldDirection(new Vector3f());<NEW_LINE>offset.mul(3);<NEW_LINE>spawnPos.add(5, 10, 0);<NEW_LINE>BlockFamily <MASK><NEW_LINE>if (block == null) {<NEW_LINE>return "Sorry, your block is not found";<NEW_LINE>}<NEW_LINE>BlockItemFactory blockItemFactory = new BlockItemFactory(entityManager);<NEW_LINE>if (value > 5000) {<NEW_LINE>return "Value exceeds the maximum limit of 5000 blocks. your value: " + value + " blocks";<NEW_LINE>}<NEW_LINE>for (int i = 0; i < value; i++) {<NEW_LINE>EntityRef blockItem = blockItemFactory.newInstance(block);<NEW_LINE>blockItem.send(new DropItemEvent(spawnPos));<NEW_LINE>}<NEW_LINE>// this returns the block you have spawned and the amount<NEW_LINE>return "Dropped " + value + " " + blockName + " Blocks :)";<NEW_LINE>}
block = blockManager.getBlockFamily(blockName);
1,332,885
public ListCertificatesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListCertificatesResult listCertificatesResult = new ListCertificatesResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listCertificatesResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listCertificatesResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("CertificateSummaryList", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listCertificatesResult.setCertificateSummaryList(new ListUnmarshaller<CertificateSummary>(CertificateSummaryJsonUnmarshaller.getInstance(<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listCertificatesResult;<NEW_LINE>}
)).unmarshall(context));
1,123,588
protected void testAnnotationInsertion() {<NEW_LINE>if (root == null || !checker.hasOption("ajavaChecks")) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>CompilationUnit originalAst;<NEW_LINE>try (InputStream originalInputStream = root.getSourceFile().openInputStream()) {<NEW_LINE>originalAst = JavaParserUtil.parseCompilationUnit(originalInputStream);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new BugInCF("Error while reading Java file: " + root.getSourceFile(<MASK><NEW_LINE>}<NEW_LINE>CompilationUnit astWithoutAnnotations = originalAst.clone();<NEW_LINE>JavaParserUtil.clearAnnotations(astWithoutAnnotations);<NEW_LINE>String withoutAnnotations = new DefaultPrettyPrinter().print(astWithoutAnnotations);<NEW_LINE>String withAnnotations;<NEW_LINE>try (InputStream annotationInputStream = root.getSourceFile().openInputStream()) {<NEW_LINE>// This check only runs on files from the Checker Framework test suite, which should all use<NEW_LINE>// UNIX line separators. Using System.lineSeparator instead of "\n" could cause the test to<NEW_LINE>// fail on Mac or Windows.<NEW_LINE>withAnnotations = new InsertAjavaAnnotations(elements).insertAnnotations(annotationInputStream, withoutAnnotations, "\n");<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new BugInCF("Error while reading Java file: " + root.getSourceFile().toUri(), e);<NEW_LINE>}<NEW_LINE>CompilationUnit modifiedAst = null;<NEW_LINE>try {<NEW_LINE>modifiedAst = JavaParserUtil.parseCompilationUnit(withAnnotations);<NEW_LINE>} catch (ParseProblemException e) {<NEW_LINE>throw new BugInCF("Failed to parse annotation insertion:\n" + withAnnotations, e);<NEW_LINE>}<NEW_LINE>AnnotationEqualityVisitor visitor = new AnnotationEqualityVisitor();<NEW_LINE>originalAst.accept(visitor, modifiedAst);<NEW_LINE>if (!visitor.getAnnotationsMatch()) {<NEW_LINE>throw new BugInCF(String.join(System.lineSeparator(), "Sanity check of erasing then reinserting annotations produced a different AST.", "File: " + root.getSourceFile(), "Original node: " + visitor.getMismatchedNode1(), "Node with annotations re-inserted: " + visitor.getMismatchedNode2(), "Original annotations: " + visitor.getMismatchedNode1().getAnnotations(), "Re-inserted annotations: " + visitor.getMismatchedNode2().getAnnotations(), "Original AST:", originalAst.toString(), "Ast with annotations re-inserted: " + modifiedAst));<NEW_LINE>}<NEW_LINE>}
).toUri(), e);
853,682
ConverterConfiguration createConverterConfiguration() {<NEW_LINE>if (!useNativeDriverJavaTimeCodecs) {<NEW_LINE>return new ConverterConfiguration(STORE_CONVERSIONS, this.customConverters, <MASK><NEW_LINE>}<NEW_LINE>List<Object> converters = new ArrayList<>(STORE_CONVERTERS.size() + 3);<NEW_LINE>converters.add(DateToUtcLocalDateConverter.INSTANCE);<NEW_LINE>converters.add(DateToUtcLocalTimeConverter.INSTANCE);<NEW_LINE>converters.add(DateToUtcLocalDateTimeConverter.INSTANCE);<NEW_LINE>converters.addAll(STORE_CONVERTERS);<NEW_LINE>StoreConversions storeConversions = StoreConversions.of(new SimpleTypeHolder(JAVA_DRIVER_TIME_SIMPLE_TYPES, MongoSimpleTypes.HOLDER), converters);<NEW_LINE>return new ConverterConfiguration(storeConversions, this.customConverters, convertiblePair -> {<NEW_LINE>// Avoid default registrations<NEW_LINE>if (JAVA_DRIVER_TIME_SIMPLE_TYPES.contains(convertiblePair.getSourceType()) && Date.class.isAssignableFrom(convertiblePair.getTargetType())) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}, this.propertyValueConversions);<NEW_LINE>}
convertiblePair -> true, this.propertyValueConversions);
1,248,392
void maybePrecompile(TreeLogger logger) throws UnableToCompleteException {<NEW_LINE>if (options.getNoPrecompile()) {<NEW_LINE>publish(recompiler.initWithoutPrecompile(logger), null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// TODO: each box will have its own binding properties<NEW_LINE>Map<String, String> defaultProps = new <MASK><NEW_LINE>defaultProps.put("user.agent", "safari");<NEW_LINE>defaultProps.put("locale", "en");<NEW_LINE>// Create a dummy job for the first compile.<NEW_LINE>// Its progress is not visible externally but will still be logged.<NEW_LINE>JobEventTable dummy = new JobEventTable();<NEW_LINE>Job job = makeJob(defaultProps, logger);<NEW_LINE>job.onSubmitted(dummy);<NEW_LINE>publish(recompiler.precompile(job), job);<NEW_LINE>if (options.isCompileTest()) {<NEW_LINE>// Listener errors are fatal in compile tests<NEW_LINE>Throwable error = job.getListenerFailure();<NEW_LINE>if (error != null) {<NEW_LINE>UnableToCompleteException e = new UnableToCompleteException();<NEW_LINE>e.initCause(error);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
HashMap<String, String>();
1,809,554
public boolean balanceLayerMinMemory(LayerInterface layer, long frameMaxRss) {<NEW_LINE>long maxrss = getJdbcTemplate().queryForObject("SELECT int_max_rss FROM layer_mem WHERE pk_layer=?", Long.class, layer.getLayerId());<NEW_LINE>if (maxrss < frameMaxRss) {<NEW_LINE>maxrss = frameMaxRss;<NEW_LINE>}<NEW_LINE>if (maxrss < Dispatcher.MEM_RESERVED_MIN) {<NEW_LINE>maxrss = Dispatcher.MEM_RESERVED_MIN;<NEW_LINE>} else {<NEW_LINE>maxrss = maxrss + CueUtil.MB256;<NEW_LINE>}<NEW_LINE>boolean result = getJdbcTemplate().update(BALANCE_MEM, maxrss, layer.getLayerId(), maxrss) == 1;<NEW_LINE>if (result) {<NEW_LINE>logger.info(layer.<MASK><NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
getName() + " was balanced to " + maxrss);
198,989
public void execute(@Nonnull MinecraftServer server, @Nonnull ICommandSender sender, @Nonnull String[] args) throws CommandException {<NEW_LINE>if (match(args, "config", "set", null, null, null)) {<NEW_LINE>doSet(server, sender, args[2], args[3], args[4]);<NEW_LINE>} else if (match(args, "config", "get", null, null)) {<NEW_LINE>doGet(server, sender, args[2], args[3]);<NEW_LINE>} else if (match(args, "config", "list", null)) {<NEW_LINE>doList(server, sender, args[2]);<NEW_LINE>} else if (match(args, "config", "list")) {<NEW_LINE>doList(server, sender);<NEW_LINE>} else if (match(args, "config", "save")) {<NEW_LINE>doSave(server, sender);<NEW_LINE>} else if (match(args, "config", "help", null)) {<NEW_LINE>doHelp(server, sender, args[2]);<NEW_LINE>} else if (match(args, "config", "help")) {<NEW_LINE>doHelp(server, sender, "0");<NEW_LINE>} else<NEW_LINE>throw <MASK><NEW_LINE>}
new WrongUsageException(getUsage(sender));
753,346
public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String expression = "@public create expression cc { (a,v1,b,v2,c) -> a.p00 || v1 || b.p00 || v2 || c.p00}";<NEW_LINE>env.compileDeploy(expression, path);<NEW_LINE>String epl = "@name('s0') select cc(e2, 'x', e3, 'y', e1) as c0 from \n" + "SupportBean_S0(id=1)#lastevent as e1, SupportBean_S0(id=2)#lastevent as e2, SupportBean_S0(id=3)#lastevent as e3;\n" + "@name('s1') select cc(e2, 'x', e3, 'y', e1) as c0 from \n" + "SupportBean_S0(id=1)#lastevent as e3, SupportBean_S0(id=2)#lastevent as e2, SupportBean_S0(id=3)#lastevent as e1;\n" + "@name('s2') select cc(e1, 'x', e2, 'y', e3) as c0 from \n" + "SupportBean_S0(id=1)#lastevent as e3, SupportBean_S0(id=2)#lastevent as e2, SupportBean_S0(id=3)#lastevent as e1;\n";<NEW_LINE>env.compileDeploy(epl, path).addListener("s0").addListener("s1").addListener("s2");<NEW_LINE>assertTypeExpected(env, String.class);<NEW_LINE>env.sendEventBean(new SupportBean_S0(1, "A"));<NEW_LINE>env.sendEventBean(new SupportBean_S0(3, "C"));<NEW_LINE>env.sendEventBean(new SupportBean_S0(2, "B"));<NEW_LINE>env.<MASK><NEW_LINE>env.assertEqualsNew("s1", "c0", "BxAyC");<NEW_LINE>env.assertEqualsNew("s2", "c0", "CxByA");<NEW_LINE>env.undeployAll();<NEW_LINE>}
assertEqualsNew("s0", "c0", "BxCyA");
1,529,933
public ProcessStatus preProcessCheck(final PwmRequest pwmRequest) throws PwmUnrecoverableException, IOException, ServletException {<NEW_LINE>// fetch the required beans / managers<NEW_LINE>final PwmDomain pwmDomain = pwmRequest.getPwmDomain();<NEW_LINE>final PwmSession pwmSession = pwmRequest.getPwmSession();<NEW_LINE>final DomainConfig config = pwmDomain.getConfig();<NEW_LINE><MASK><NEW_LINE>if (setupOtpProfile == null || !setupOtpProfile.readSettingAsBoolean(PwmSetting.OTP_ALLOW_SETUP)) {<NEW_LINE>final String errorMsg = "setup OTP is not enabled";<NEW_LINE>final ErrorInformation errorInformation = new ErrorInformation(PwmError.ERROR_SERVICE_NOT_AVAILABLE, errorMsg);<NEW_LINE>LOGGER.error(pwmRequest, errorInformation);<NEW_LINE>pwmRequest.respondWithError(errorInformation);<NEW_LINE>return ProcessStatus.Halt;<NEW_LINE>}<NEW_LINE>// check whether the setup can be stored<NEW_LINE>if (!canSetupOtpSecret(config)) {<NEW_LINE>LOGGER.error(pwmRequest, () -> "OTP Secret cannot be setup");<NEW_LINE>pwmRequest.respondWithError(PwmError.ERROR_INVALID_CONFIG.toInfo());<NEW_LINE>return ProcessStatus.Halt;<NEW_LINE>}<NEW_LINE>if (pwmSession.getLoginInfoBean().getType() == AuthenticationType.AUTH_WITHOUT_PASSWORD) {<NEW_LINE>LOGGER.error(pwmRequest, () -> "OTP Secret requires a password login");<NEW_LINE>throw new PwmUnrecoverableException(PwmError.ERROR_PASSWORD_REQUIRED);<NEW_LINE>}<NEW_LINE>final SetupOtpBean otpBean = getSetupOtpBean(pwmRequest);<NEW_LINE>initializeBean(pwmRequest, otpBean);<NEW_LINE>return ProcessStatus.Continue;<NEW_LINE>}
final SetupOtpProfile setupOtpProfile = getSetupOtpProfile(pwmRequest);
905,564
public AttentionVertex build() {<NEW_LINE>this.nHeads = nHeads == 0 ? 1 : nHeads;<NEW_LINE>this.weightInit = weightInit == null ? WeightInit.XAVIER : weightInit;<NEW_LINE>Preconditions.<MASK><NEW_LINE>Preconditions.checkArgument(nInKeys > 0, "You have to set nInKeys");<NEW_LINE>Preconditions.checkArgument(nInQueries > 0, "You have to set nInQueries");<NEW_LINE>Preconditions.checkArgument(nInValues > 0, "You have to set nInValues");<NEW_LINE>Preconditions.checkArgument(headSize > 0 || nOut % this.nHeads == 0, "You have to set a head size if nOut isn't cleanly divided by nHeads");<NEW_LINE>Preconditions.checkArgument(projectInput || (nInQueries == nInKeys && nInKeys == nInValues && nInValues == nOut && nHeads == 1), "You may only disable projectInput if all nIn* equal to nOut and you want to use only a single attention head");<NEW_LINE>this.headSize = headSize == 0 ? nOut / nHeads : headSize;<NEW_LINE>return new AttentionVertex(this);<NEW_LINE>}
checkArgument(nOut > 0, "You have to set nOut");