idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
947,823 | final SetIpAddressTypeResult executeSetIpAddressType(SetIpAddressTypeRequest setIpAddressTypeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(setIpAddressTypeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SetIpAddressTypeRequest> request = null;<NEW_LINE>Response<SetIpAddressTypeResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new SetIpAddressTypeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(setIpAddressTypeRequest));<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, "Lightsail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SetIpAddressType");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<SetIpAddressTypeResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new SetIpAddressTypeResultJsonUnmarshaller());<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,541,395 | public StagingData retrieveStagingData(@NonNull final ImmutableList<I_C_Flatrate_Term> commissionTermRecords) {<NEW_LINE>// 1. load the actual records<NEW_LINE>//<NEW_LINE>// C_Flatrate_Term<NEW_LINE>final ImmutableMap<Integer, I_C_Flatrate_Term> //<NEW_LINE>id2TermRecord = Maps.uniqueIndex(commissionTermRecords, I_C_Flatrate_Term::getC_Flatrate_Term_ID);<NEW_LINE>//<NEW_LINE>// C_Flatrate_Conditions<NEW_LINE>final ImmutableSet<Integer> conditionsRecordIds = ImmutableSet.copyOf(CollectionUtils.extractDistinctElements(commissionTermRecords, I_C_Flatrate_Term::getC_Flatrate_Conditions_ID));<NEW_LINE>final List<I_C_Flatrate_Conditions> conditionsRecords = InterfaceWrapperHelper.loadByIdsOutOfTrx(conditionsRecordIds, I_C_Flatrate_Conditions.class);<NEW_LINE>final ImmutableMap<Integer, I_C_Flatrate_Conditions> //<NEW_LINE>id2ConditionsRecord = Maps.uniqueIndex(conditionsRecords, I_C_Flatrate_Conditions::getC_Flatrate_Conditions_ID);<NEW_LINE>//<NEW_LINE>// C_HierarchyCommissionSettings<NEW_LINE>final ImmutableSet<Integer> settingsRecordIds = ImmutableSet.copyOf(CollectionUtils.extractDistinctElements(conditionsRecords, I_C_Flatrate_Conditions::getC_HierarchyCommissionSettings_ID));<NEW_LINE>final List<I_C_HierarchyCommissionSettings> settingsRecords = InterfaceWrapperHelper.loadByIdsOutOfTrx(settingsRecordIds, I_C_HierarchyCommissionSettings.class);<NEW_LINE>final ImmutableMap<Integer, I_C_HierarchyCommissionSettings> //<NEW_LINE>id2SettingsRecord = Maps.uniqueIndex(settingsRecords, I_C_HierarchyCommissionSettings::getC_HierarchyCommissionSettings_ID);<NEW_LINE>//<NEW_LINE>// C_CommissionSettingsLine<NEW_LINE>final List<I_C_CommissionSettingsLine> settingsLineRecords = retrieveHierarchySettings(settingsRecordIds);<NEW_LINE>final ImmutableMap<Integer, I_C_CommissionSettingsLine> //<NEW_LINE>id2SettingsLineRecord = Maps.uniqueIndex(settingsLineRecords, I_C_CommissionSettingsLine::getC_CommissionSettingsLine_ID);<NEW_LINE>// 2. create additional mappings between different records' IDs<NEW_LINE>//<NEW_LINE>final ListMultimap<Integer, Integer> settingsId2termIds = MultimapBuilder.hashKeys().arrayListValues().build();<NEW_LINE>final ImmutableListMultimap.Builder<Integer, BPartnerId> conditionRecordId2BPartnerIds = ImmutableListMultimap.builder();<NEW_LINE>final ImmutableListMultimap.Builder<BPartnerId, FlatrateTermId> bpartnerId2FlatrateTermId = ImmutableListMultimap.builder();<NEW_LINE>for (final I_C_Flatrate_Term commissionTermRecord : commissionTermRecords) {<NEW_LINE>final I_C_Flatrate_Conditions conditionsRecord = id2ConditionsRecord.get(commissionTermRecord.getC_Flatrate_Conditions_ID());<NEW_LINE>settingsId2termIds.put(conditionsRecord.getC_HierarchyCommissionSettings_ID(), commissionTermRecord.getC_Flatrate_Term_ID());<NEW_LINE>conditionRecordId2BPartnerIds.put(commissionTermRecord.getC_Flatrate_Conditions_ID(), BPartnerId.ofRepoId<MASK><NEW_LINE>bpartnerId2FlatrateTermId.put(BPartnerId.ofRepoId(commissionTermRecord.getBill_BPartner_ID()), FlatrateTermId.ofRepoId(commissionTermRecord.getC_Flatrate_Term_ID()));<NEW_LINE>}<NEW_LINE>final ImmutableListMultimap.Builder<Integer, Integer> settingsId2settingsLineIds = // the list is and arraylist, so the settingsLines' ordering is preserved<NEW_LINE>ImmutableListMultimap.builder();<NEW_LINE>for (final I_C_CommissionSettingsLine settingsLineRecord : settingsLineRecords) {<NEW_LINE>settingsId2settingsLineIds.put(settingsLineRecord.getC_HierarchyCommissionSettings_ID(), settingsLineRecord.getC_CommissionSettingsLine_ID());<NEW_LINE>}<NEW_LINE>return StagingData.builder().id2TermRecord(id2TermRecord).id2ConditionsRecord(id2ConditionsRecord).id2SettingsRecord(id2SettingsRecord).id2SettingsLineRecord(id2SettingsLineRecord).settingsId2termIds(ImmutableMultimap.copyOf(settingsId2termIds)).conditionRecordId2BPartnerIds(conditionRecordId2BPartnerIds.build()).bPartnerId2FlatrateTermIds(bpartnerId2FlatrateTermId.build()).settingsId2settingsLineIds(settingsId2settingsLineIds.build()).build();<NEW_LINE>} | (commissionTermRecord.getBill_BPartner_ID())); |
1,512,561 | public FeedResponse handle(HttpRequest request, RouteMetricSet.ProgressCallback callback, int numThreads) {<NEW_LINE>MessagePropertyProcessor.PropertySetter properties = getPropertyProcessor().buildPropertySetter(request);<NEW_LINE>String route = properties.getRoute().toString();<NEW_LINE>FeedResponse response = new FeedResponse(new RouteMetricSet(route, callback));<NEW_LINE>SingleSender sender = new SingleSender<MASK><NEW_LINE>sender.addMessageProcessor(properties);<NEW_LINE>ThreadedFeedAccess feedAccess = new ThreadedFeedAccess(numThreads, sender);<NEW_LINE>Feeder feeder = createFeeder(feedAccess, request);<NEW_LINE>feeder.setAbortOnDocumentError(properties.getAbortOnDocumentError());<NEW_LINE>feeder.setCreateIfNonExistent(properties.getCreateIfNonExistent());<NEW_LINE>response.setAbortOnFeedError(properties.getAbortOnFeedError());<NEW_LINE>List<String> errors = feeder.parse();<NEW_LINE>for (String s : errors) {<NEW_LINE>response.addXMLParseError(s);<NEW_LINE>}<NEW_LINE>sender.done();<NEW_LINE>feedAccess.close();<NEW_LINE>long millis = getTimeoutMillis(request);<NEW_LINE>boolean completed = sender.waitForPending(millis);<NEW_LINE>if (!completed) {<NEW_LINE>response.addError(Error.TIMEOUT, "Timed out after " + millis + " ms waiting for responses");<NEW_LINE>}<NEW_LINE>response.done();<NEW_LINE>return response;<NEW_LINE>} | (response, getSharedSender(route)); |
1,552,822 | private void initSearchActions() {<NEW_LINE>myResultsList.addMouseListener(new MouseAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mouseClicked(MouseEvent e) {<NEW_LINE>onMouseClicked(e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>DumbAwareAction.create(e -> RunAnythingUtil.jumpNextGroup(true, myResultsList)).registerCustomShortcutSet(CustomShortcutSet.fromString("TAB"), (JComponent) TargetAWT.to(mySearchField), this);<NEW_LINE>DumbAwareAction.create(e -> RunAnythingUtil.jumpNextGroup(false, myResultsList)).registerCustomShortcutSet(CustomShortcutSet.fromString("shift TAB"), (JComponent) TargetAWT.to(mySearchField), this);<NEW_LINE>AnAction escape = ActionManager.getInstance().getAction("EditorEscape");<NEW_LINE>DumbAwareAction.create(__ -> {<NEW_LINE>triggerUsed();<NEW_LINE>searchFinishedHandler.run();<NEW_LINE>}).registerCustomShortcutSet(escape == null ? CommonShortcuts.ESCAPE : escape.getShortcutSet(), this);<NEW_LINE>DumbAwareAction.create(e -> executeCommand()).registerCustomShortcutSet(CustomShortcutSet.fromString("ENTER", "shift ENTER", "alt ENTER", "alt shift ENTER", "meta ENTER"), (JComponent) TargetAWT.to(mySearchField), this);<NEW_LINE>DumbAwareAction.create(e -> {<NEW_LINE>RunAnythingSearchListModel model = getSearchingModel(myResultsList);<NEW_LINE>if (model == null)<NEW_LINE>return;<NEW_LINE>Object selectedValue = myResultsList.getSelectedValue();<NEW_LINE>int index = myResultsList.getSelectedIndex();<NEW_LINE>if (!(selectedValue instanceof RunAnythingItem) || isMoreItem(index))<NEW_LINE>return;<NEW_LINE>RunAnythingCache.getInstance(getProject()).getState().getCommands().remove(((RunAnythingItem) selectedValue).getCommand());<NEW_LINE>model.remove(index);<NEW_LINE>model.shiftIndexes(index, -1);<NEW_LINE>if (model.getSize() > 0)<NEW_LINE>ScrollingUtil.selectItem(myResultsList, index < model.getSize(<MASK><NEW_LINE>Application.get().invokeLater(() -> {<NEW_LINE>if (myCalcThread != null) {<NEW_LINE>myCalcThread.updatePopup();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}).registerCustomShortcutSet(CustomShortcutSet.fromString("shift BACK_SPACE"), (JComponent) TargetAWT.to(mySearchField), this);<NEW_LINE>myProject.getMessageBus().connect(this).subscribe(DumbService.DUMB_MODE, new DumbService.DumbModeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void exitDumbMode() {<NEW_LINE>Application.get().invokeLater(() -> rebuildList());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | ) ? index : index - 1); |
222,045 | public void refreshContent(Entry e, Highlight highlight) {<NEW_LINE>Object[] extraData = (Object[]) e.getData();<NEW_LINE>ScaleMeasurement measurement = (ScaleMeasurement) extraData[0];<NEW_LINE>ScaleMeasurement prevMeasurement = (ScaleMeasurement) extraData[1];<NEW_LINE>FloatMeasurementView measurementView = (FloatMeasurementView) extraData[2];<NEW_LINE>SpannableStringBuilder markerText = new SpannableStringBuilder();<NEW_LINE>if (measurement != null) {<NEW_LINE>measurementView.loadFrom(measurement, prevMeasurement);<NEW_LINE>DateFormat dateFormat = DateFormat.getDateInstance();<NEW_LINE>markerText.append(dateFormat.format(measurement.getDateTime()));<NEW_LINE>markerText.setSpan(new RelativeSizeSpan(0.8f), 0, markerText.<MASK><NEW_LINE>markerText.append("\n");<NEW_LINE>if (measurement.isAverageValue()) {<NEW_LINE>markerText.append(getContext().getString(R.string.label_trend) + " ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>markerText.append(measurementView.getValueAsString(true));<NEW_LINE>if (prevMeasurement != null) {<NEW_LINE>markerText.append("\n");<NEW_LINE>int textPosAfterSymbol = markerText.length() + 1;<NEW_LINE>measurementView.appendDiffValue(markerText, false);<NEW_LINE>// set color diff value to text color<NEW_LINE>if (markerText.length() > textPosAfterSymbol) {<NEW_LINE>markerText.setSpan(new ForegroundColorSpan(ColorUtil.COLOR_WHITE), textPosAfterSymbol, markerText.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>markerText.setSpan(new AlignmentSpan.Standard(Layout.Alignment.ALIGN_CENTER), 0, markerText.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);<NEW_LINE>markerTextField.setText(markerText);<NEW_LINE>super.refreshContent(e, highlight);<NEW_LINE>} | length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); |
1,684,139 | private void showFilterMenu() {<NEW_LINE>List<Notification.Type> notificationsList = Notification.Type.Companion.getAsList();<NEW_LINE>List<String> list = new ArrayList<>();<NEW_LINE>for (Notification.Type type : notificationsList) {<NEW_LINE>list.add(getNotificationText(type));<NEW_LINE>}<NEW_LINE>ArrayAdapter<String> adapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_multiple_choice, list);<NEW_LINE>PopupWindow window = new PopupWindow(getContext());<NEW_LINE>View view = LayoutInflater.from(getContext()).inflate(R.layout.notifications_filter, (ViewGroup) getView(), false);<NEW_LINE>final ListView listView = view.findViewById(R.id.listView);<NEW_LINE>view.findViewById(R.id.buttonApply).setOnClickListener(v -> {<NEW_LINE>SparseBooleanArray checkedItems = listView.getCheckedItemPositions();<NEW_LINE>Set<Notification.Type> excludes = new HashSet<>();<NEW_LINE>for (int i = 0; i < notificationsList.size(); i++) {<NEW_LINE>if (!checkedItems.get(i, false))<NEW_LINE>excludes.add<MASK><NEW_LINE>}<NEW_LINE>window.dismiss();<NEW_LINE>applyFilterChanges(excludes);<NEW_LINE>});<NEW_LINE>listView.setAdapter(adapter);<NEW_LINE>listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);<NEW_LINE>for (int i = 0; i < notificationsList.size(); i++) {<NEW_LINE>if (!notificationFilter.contains(notificationsList.get(i)))<NEW_LINE>listView.setItemChecked(i, true);<NEW_LINE>}<NEW_LINE>window.setContentView(view);<NEW_LINE>window.setFocusable(true);<NEW_LINE>window.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT);<NEW_LINE>window.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);<NEW_LINE>window.showAsDropDown(buttonFilter);<NEW_LINE>} | (notificationsList.get(i)); |
1,725,068 | final ExportCertificateResult executeExportCertificate(ExportCertificateRequest exportCertificateRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(exportCertificateRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ExportCertificateRequest> request = null;<NEW_LINE>Response<ExportCertificateResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ExportCertificateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(exportCertificateRequest));<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, "ACM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ExportCertificate");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ExportCertificateResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ExportCertificateResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
226,021 | private void coloredMap() {<NEW_LINE>// tile size<NEW_LINE>int size = 1;<NEW_LINE>int W = (getAppWidth() + 200) / size;<NEW_LINE>int H = (getAppHeight() + 200) / size;<NEW_LINE>Grid<HeightMapGenerator.HeightData> map = new Grid<>(HeightMapGenerator.HeightData.class, W, H, new CustomHeightMapGenerator(W, H));<NEW_LINE>AnimatedColor water = new AnimatedColor(Color.DARKBLUE, Color.AQUA);<NEW_LINE>AnimatedColor land = new AnimatedColor(Color.DARKGREEN, Color.LIGHTGREEN);<NEW_LINE>AnimatedColor desert = new AnimatedColor(Color.GREENYELLOW, Color.LIGHTYELLOW);<NEW_LINE>AnimatedColor snow = new AnimatedColor(Color.GREEN, Color.WHITESMOKE);<NEW_LINE>WritableImage image = new WritableImage(W, H);<NEW_LINE>map.forEach(cell -> {<NEW_LINE>AnimatedColor anim;<NEW_LINE>double adjustedValue;<NEW_LINE>if (cell.getHeight() < 0.2) {<NEW_LINE>anim = water;<NEW_LINE>adjustedValue = map(cell.getHeight(), 0.0, 0.2, 0.0, 1.0);<NEW_LINE>} else if (cell.getHeight() < 0.4) {<NEW_LINE>anim = land;<NEW_LINE>adjustedValue = map(cell.getHeight(), 0.2, 0.4, 0.0, 1.0);<NEW_LINE>} else if (cell.getHeight() < 0.9) {<NEW_LINE>anim = desert;<NEW_LINE>adjustedValue = map(cell.getHeight(), 0.4, 0.9, 0.0, 1.0);<NEW_LINE>} else {<NEW_LINE>anim = snow;<NEW_LINE>adjustedValue = map(cell.getHeight(), 0.9, 1.0, 0.0, 1.0);<NEW_LINE>}<NEW_LINE>image.getPixelWriter().setColor(cell.getX(), cell.getY(), anim.getValue(adjustedValue<MASK><NEW_LINE>});<NEW_LINE>getGameScene().getViewport().bindToEntity(new Entity(), 0, 0);<NEW_LINE>var t = new Texture(image);<NEW_LINE>t.setTranslateX(-100);<NEW_LINE>t.setTranslateY(-100);<NEW_LINE>getGameScene().addGameView(new GameView(t, 0));<NEW_LINE>} | , interpolator.EASE_OUT())); |
1,703,553 | public String updateTranslation(HttpServletRequest request, HttpServletResponse response, Model model, @ModelAttribute(value = "entityForm") EntityForm entityForm, BindingResult result) throws Exception {<NEW_LINE>final TranslationForm form = getTranslationForm(entityForm);<NEW_LINE>adminRemoteSecurityService.securityCheck(form.getCeilingEntity(), EntityOperationType.UPDATE);<NEW_LINE>SectionCrumb sectionCrumb = new SectionCrumb();<NEW_LINE>sectionCrumb.setSectionIdentifier(TranslationImpl.class.getName());<NEW_LINE>sectionCrumb.setSectionId(String.valueOf(form.getTranslationId()));<NEW_LINE>List<SectionCrumb> sectionCrumbs = Arrays.asList(sectionCrumb);<NEW_LINE>entityForm.setCeilingEntityClassname(Translation.class.getName());<NEW_LINE>entityForm.setEntityType(TranslationImpl.class.getName());<NEW_LINE>Field id = new Field();<NEW_LINE>id.setName("id");<NEW_LINE>id.setValue(String.valueOf(form.getTranslationId()));<NEW_LINE>entityForm.getFields().put("id", id);<NEW_LINE>entityForm.setId(String.valueOf(form.getTranslationId()));<NEW_LINE>populateTranslationFields(entityForm, form);<NEW_LINE>String[] sectionCriteria = customCriteriaService.mergeSectionCustomCriteria(form.<MASK><NEW_LINE>service.updateEntity(entityForm, sectionCriteria, sectionCrumbs).getEntity();<NEW_LINE>return viewTranslation(request, response, model, form, result);<NEW_LINE>} | getCeilingEntity(), getSectionCustomCriteria()); |
1,247,196 | public int notifyStarted(@NonNull MediaFormat format) {<NEW_LINE>synchronized (mControllerLock) {<NEW_LINE>if (mMediaMuxerStarted) {<NEW_LINE>throw new IllegalStateException("Trying to start but muxer started already");<NEW_LINE>}<NEW_LINE>int track = mMediaMuxer.addTrack(format);<NEW_LINE>LOG.w("notifyStarted:", "Assigned track", track, "to format", format.getString(MediaFormat.KEY_MIME));<NEW_LINE>if (++mStartedEncodersCount == mEncoders.size()) {<NEW_LINE>LOG.<MASK><NEW_LINE>// Go out of this thread since it might be very important for the<NEW_LINE>// encoders and we don't want to perform expensive operations here.<NEW_LINE>mControllerThread.run(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>mMediaMuxer.start();<NEW_LINE>mMediaMuxerStarted = true;<NEW_LINE>if (mListener != null) {<NEW_LINE>mListener.onEncodingStart();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return track;<NEW_LINE>}<NEW_LINE>} | w("notifyStarted:", "All encoders have started.", "Starting muxer and dispatching onEncodingStart()."); |
1,553,202 | public J.ForLoop visitForLoop(J.ForLoop forLoop, ExecutionContext ctx) {<NEW_LINE>J.ForLoop elem = super.visitForLoop(forLoop, ctx);<NEW_LINE>boolean hasAllowableBodyType = needBracesStyle.getAllowEmptyLoopBody() ? elem.getBody() instanceof J.Block || elem.getBody() instanceof J.Empty : elem.getBody() instanceof J.Block;<NEW_LINE>if (!needBracesStyle.getAllowEmptyLoopBody() && elem.getBody() instanceof J.Empty) {<NEW_LINE>J.Block b = buildBlock(elem.getBody());<NEW_LINE>elem = maybeAutoFormat(elem, elem.withBody(b), ctx, getCursor().dropParentUntil(J.class::isInstance));<NEW_LINE>} else if (!needBracesStyle.getAllowSingleLineStatement() && !hasAllowableBodyType) {<NEW_LINE>J.Block b = <MASK><NEW_LINE>elem = maybeAutoFormat(elem, elem.withBody(b), ctx, getCursor().dropParentUntil(J.class::isInstance));<NEW_LINE>}<NEW_LINE>return elem;<NEW_LINE>} | buildBlock(elem.getBody()); |
186,390 | public static TablesExtRecord convertToTablesExtRecord(TableRule newTableRule, String tableSchema, String tableName, boolean isGsi, boolean isAutoPartition) {<NEW_LINE>TablesExtRecord record = new TablesExtRecord();<NEW_LINE>record.tableSchema = tableSchema;<NEW_LINE>record.tableName = tableName;<NEW_LINE>record.newTableName = EMPTY_CONTENT;<NEW_LINE>record.dbPartitionKey = concat(newTableRule.getDbPartitionKeys());<NEW_LINE>record.dbPartitionPolicy = getDbPartitionPolicy(newTableRule);<NEW_LINE>record.dbPartitionCount = newTableRule.getActualDbCount();<NEW_LINE>record<MASK><NEW_LINE>record.dbRule = concat(newTableRule.getDbRuleStrs());<NEW_LINE>record.dbMetaMap = convertShardFunctionMetaToJSON(newTableRule.getDbShardFunctionMeta());<NEW_LINE>record.tbPartitionKey = concat(newTableRule.getTbPartitionKeys());<NEW_LINE>record.tbPartitionPolicy = getTbPartitionPolicy(newTableRule);<NEW_LINE>record.tbPartitionCount = newTableRule.getActualTopology().values().iterator().next().size();<NEW_LINE>record.tbNamePattern = newTableRule.getTbNamePattern();<NEW_LINE>record.tbRule = concat(newTableRule.getTbRulesStrs());<NEW_LINE>record.tbMetaMap = convertShardFunctionMetaToJSON(newTableRule.getTbShardFunctionMeta());<NEW_LINE>record.extPartitions = convertExtPartitionsToJSON(newTableRule.getExtPartitions());<NEW_LINE>record.fullTableScan = newTableRule.isAllowFullTableScan() ? 1 : 0;<NEW_LINE>record.broadcast = newTableRule.isBroadcast() ? 1 : 0;<NEW_LINE>record.version = 1;<NEW_LINE>record.status = TableStatus.ABSENT.getValue();<NEW_LINE>record.flag = isAutoPartition ? TablesExtRecord.FLAG_AUTO_PARTITION : 0;<NEW_LINE>setTableType(isGsi, record);<NEW_LINE>return record;<NEW_LINE>} | .dbNamePattern = newTableRule.getDbNamePattern(); |
421,508 | final UpdateGatewayResult executeUpdateGateway(UpdateGatewayRequest updateGatewayRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateGatewayRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateGatewayRequest> request = null;<NEW_LINE>Response<UpdateGatewayResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateGatewayRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateGatewayRequest));<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, "Alexa For Business");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateGateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateGatewayResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateGatewayResultJsonUnmarshaller());<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()); |
1,134,306 | private static void extractAcceptedFile(ArchiveInputStream input, File file) throws AnalysisException {<NEW_LINE>LOGGER.debug("Extracting '{}'", file.getPath());<NEW_LINE>final File parent = file.getParentFile();<NEW_LINE>if (!parent.isDirectory() && !parent.mkdirs()) {<NEW_LINE>final String msg = String.format(<MASK><NEW_LINE>throw new AnalysisException(msg);<NEW_LINE>}<NEW_LINE>try (FileOutputStream fos = new FileOutputStream(file)) {<NEW_LINE>IOUtils.copy(input, fos);<NEW_LINE>} catch (FileNotFoundException ex) {<NEW_LINE>LOGGER.debug("", ex);<NEW_LINE>final String msg = String.format("Unable to find file '%s'.", file.getName());<NEW_LINE>throw new AnalysisException(msg, ex);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>LOGGER.debug("", ex);<NEW_LINE>final String msg = String.format("IO Exception while parsing file '%s'.", file.getName());<NEW_LINE>throw new AnalysisException(msg, ex);<NEW_LINE>}<NEW_LINE>} | "Unable to build directory '%s'.", parent.getAbsolutePath()); |
1,050,709 | public List<Fix> run(CompilationInfo info, String diagnosticKey, int offset, TreePath treePath, Data<Void> data) {<NEW_LINE>List<Fix> result = new ArrayList<Fix>();<NEW_LINE>Element ex = info.getTrees().getElement(treePath);<NEW_LINE>if (treePath.getLeaf().getKind() == Kind.METHOD && ex != null && ex.getKind() == ElementKind.METHOD) {<NEW_LINE>Set<Modifier> desiredAccess = EnumSet.noneOf(Modifier.class);<NEW_LINE>ExecutableElement overridden = info.getElementUtilities().getOverriddenMethod((ExecutableElement) ex);<NEW_LINE>if (overridden != null) {<NEW_LINE>desiredAccess.addAll(overridden.getModifiers());<NEW_LINE>desiredAccess.retainAll(ACCESS_RIGHT_MASK);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>Set<Modifier> toRemove = EnumSet.noneOf(Modifier.class);<NEW_LINE>toRemove.addAll(ex.getModifiers());<NEW_LINE>toRemove.retainAll(ACCESS_RIGHT_MASK);<NEW_LINE>String name = ex.getSimpleName().toString();<NEW_LINE>String modifier = desiredAccess.isEmpty() ? Bundle.FIX_DefaultAccess(name) : Bundle.FIX_ChangeModifiers(name, desiredAccess.iterator().next().name().toLowerCase());<NEW_LINE>result.add(FixFactory.changeModifiersFix(info, new TreePath(treePath, ((MethodTree) treePath.getLeaf()).getModifiers()), desiredAccess, toRemove, modifier));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | desiredAccess.add(Modifier.PUBLIC); |
1,548,880 | public Void execute(CommandContext commandContext) {<NEW_LINE>// check that the new process definition is just another version of the same<NEW_LINE>// process definition that the process instance is using<NEW_LINE>ExecutionEntityManager executionManager = commandContext.getExecutionEntityManager();<NEW_LINE>ExecutionEntity processInstance = executionManager.findExecutionById(processInstanceId);<NEW_LINE>if (processInstance == null) {<NEW_LINE>throw new ActivitiObjectNotFoundException("No process instance found for id = '" + processInstanceId + "'.", ProcessInstance.class);<NEW_LINE>} else if (!processInstance.isProcessInstanceType()) {<NEW_LINE>throw new ActivitiIllegalArgumentException("A process instance id is required, but the provided id " + "'" + processInstanceId + "' " + "points to a child execution of process instance " + "'" + processInstance.getProcessInstanceId() + "'. " + "Please invoke the " + getClass().getSimpleName() + " with a root execution id.");<NEW_LINE>}<NEW_LINE>ProcessDefinitionImpl currentProcessDefinitionImpl = processInstance.getProcessDefinition();<NEW_LINE>DeploymentManager deploymentCache = commandContext.getProcessEngineConfiguration().getDeploymentManager();<NEW_LINE>ProcessDefinition currentProcessDefinition = null;<NEW_LINE>if (currentProcessDefinitionImpl instanceof ProcessDefinitionEntity) {<NEW_LINE>currentProcessDefinition = (ProcessDefinitionEntity) currentProcessDefinitionImpl;<NEW_LINE>} else {<NEW_LINE>currentProcessDefinition = deploymentCache.findDeployedProcessDefinitionById(currentProcessDefinitionImpl.getId());<NEW_LINE>}<NEW_LINE>ProcessDefinitionEntity newProcessDefinition = (ProcessDefinitionEntity) deploymentCache.findDeployedProcessDefinitionByKeyAndVersion(<MASK><NEW_LINE>validateAndSwitchVersionOfExecution(commandContext, processInstance, newProcessDefinition);<NEW_LINE>// switch the historic process instance to the new process definition version<NEW_LINE>commandContext.getHistoryManager().recordProcessDefinitionChange(processInstanceId, newProcessDefinition.getId());<NEW_LINE>// switch all sub-executions of the process instance to the new process definition version<NEW_LINE>List<ExecutionEntity> childExecutions = executionManager.findChildExecutionsByProcessInstanceId(processInstanceId);<NEW_LINE>for (ExecutionEntity executionEntity : childExecutions) {<NEW_LINE>validateAndSwitchVersionOfExecution(commandContext, executionEntity, newProcessDefinition);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | currentProcessDefinition.getKey(), processDefinitionVersion); |
89,883 | // end main()<NEW_LINE>public boolean trainClassifier(String path) throws IOException {<NEW_LINE>// build dataset of training data featurized<NEW_LINE>Pair<GeneralDataset<String, String>, List<String[]>> dataInfo = readAndReturnTrainingExamples(path);<NEW_LINE>GeneralDataset<String, String> train = dataInfo.first();<NEW_LINE>List<String[]<MASK><NEW_LINE>// For things like cross validation, we may well need to sort data! Data sets are often ordered by class.<NEW_LINE>if (globalFlags.shuffleTrainingData) {<NEW_LINE>long seed;<NEW_LINE>if (globalFlags.shuffleSeed != 0) {<NEW_LINE>seed = globalFlags.shuffleSeed;<NEW_LINE>} else {<NEW_LINE>seed = System.nanoTime();<NEW_LINE>}<NEW_LINE>train.shuffleWithSideInformation(seed, lineInfos);<NEW_LINE>}<NEW_LINE>// print any binned value histograms<NEW_LINE>for (int i = 0; i < flags.length; i++) {<NEW_LINE>if (flags[i] != null && flags[i].binnedValuesCounter != null) {<NEW_LINE>logger.info("BinnedValuesStatistics for column " + i);<NEW_LINE>logger.info(flags[i].binnedValuesCounter.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// print any binned length histograms<NEW_LINE>for (int i = 0; i < flags.length; i++) {<NEW_LINE>if (flags[i] != null && flags[i].binnedLengthsCounter != null) {<NEW_LINE>logger.info("BinnedLengthsStatistics for column " + i);<NEW_LINE>logger.info(flags[i].binnedLengthsCounter.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// print the training data in SVMlight format if desired<NEW_LINE>if (globalFlags.printSVMLightFormatTo != null) {<NEW_LINE>PrintWriter pw = IOUtils.getPrintWriter(globalFlags.printSVMLightFormatTo, globalFlags.encoding);<NEW_LINE>train.printSVMLightFormat(pw);<NEW_LINE>IOUtils.closeIgnoringExceptions(pw);<NEW_LINE>train.featureIndex().saveToFilename(globalFlags.printSVMLightFormatTo + ".featureIndex");<NEW_LINE>train.labelIndex().saveToFilename(globalFlags.printSVMLightFormatTo + ".labelIndex");<NEW_LINE>}<NEW_LINE>if (globalFlags.crossValidationFolds > 1) {<NEW_LINE>crossValidate(train, lineInfos);<NEW_LINE>}<NEW_LINE>if (globalFlags.exitAfterTrainingFeaturization) {<NEW_LINE>// ENDS PROCESSING<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// build the classifier<NEW_LINE>classifier = makeClassifier(train);<NEW_LINE>printClassifier(classifier);<NEW_LINE>// serialize the classifier<NEW_LINE>String serializeTo = globalFlags.serializeTo;<NEW_LINE>if (serializeTo != null) {<NEW_LINE>serializeClassifier(serializeTo);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | > lineInfos = dataInfo.second(); |
244,317 | private void enableLiveUpdates(boolean enable) {<NEW_LINE>if (!Algorithms.isEmpty(adapter.mapsList)) {<NEW_LINE>AlarmManager alarmMgr = (AlarmManager) app.getSystemService(Context.ALARM_SERVICE);<NEW_LINE>List<LocalIndexInfo> mapsToUpdate = getMapsToUpdate(adapter.mapsList, settings);<NEW_LINE>for (LocalIndexInfo li : mapsToUpdate) {<NEW_LINE>String fileName = li.getFileName();<NEW_LINE>PendingIntent alarmIntent = getPendingIntent(app, fileName);<NEW_LINE>if (enable) {<NEW_LINE>final CommonPreference<Integer> <MASK><NEW_LINE>final CommonPreference<Integer> timeOfDayPreference = preferenceTimeOfDayToUpdate(fileName, settings);<NEW_LINE>UpdateFrequency updateFrequency = UpdateFrequency.values()[updateFrequencyPreference.get()];<NEW_LINE>TimeOfDay timeOfDayToUpdate = TimeOfDay.values()[timeOfDayPreference.get()];<NEW_LINE>setAlarmForPendingIntent(alarmIntent, alarmMgr, updateFrequency, timeOfDayToUpdate);<NEW_LINE>} else {<NEW_LINE>alarmMgr.cancel(alarmIntent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | updateFrequencyPreference = preferenceUpdateFrequency(fileName, settings); |
510,180 | public void run(ExportMessagesCommand command, Consumer<SimpleMessageChunk> chunkCollector) {<NEW_LINE>boolean isFirstChunk = true;<NEW_LINE>int totalCount = 0;<NEW_LINE>while (true) {<NEW_LINE>List<SearchResult.Hit<Map, Void>> hits = search(command);<NEW_LINE>if (hits.isEmpty()) {<NEW_LINE>publishChunk(chunkCollector, hits, command.fieldsInOrder(), command.timeZone(), SimpleMessageChunk.ChunkOrder.LAST);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean success = publishChunk(chunkCollector, hits, command.fieldsInOrder(), command.timeZone(), isFirstChunk ? SimpleMessageChunk.ChunkOrder.FIRST : SimpleMessageChunk.ChunkOrder.INTERMEDIATE);<NEW_LINE>if (!success) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>totalCount += hits.size();<NEW_LINE>if (command.limit().isPresent() && totalCount >= command.limit().getAsInt()) {<NEW_LINE>LOG.info("Limit of {} reached. Stopping message retrieval.", command.<MASK><NEW_LINE>publishChunk(chunkCollector, Collections.emptyList(), command.fieldsInOrder(), command.timeZone(), SimpleMessageChunk.ChunkOrder.LAST);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>isFirstChunk = false;<NEW_LINE>}<NEW_LINE>} | limit().getAsInt()); |
897,934 | public List<BakedQuad> modifyQuads(BlockState object, List<BakedQuad> quads) {<NEW_LINE>float lowerHeight = slopePosition / (float) totalLength;<NEW_LINE>float upperHeight <MASK><NEW_LINE>double lowerV = 16 * lowerHeight;<NEW_LINE>double upperV = 16 * upperHeight;<NEW_LINE>TextureAtlasSprite tas = quads.get(0).a();<NEW_LINE>VertexFormat format = DefaultVertexFormat.BLOCK;<NEW_LINE>quads = new ArrayList<>();<NEW_LINE>Matrix4 mat = new Matrix4(getFacing());<NEW_LINE>Vec3[] vertices;<NEW_LINE>{<NEW_LINE>float y03 = onCeiling ? 1 : upperHeight;<NEW_LINE>float y12 = onCeiling ? 1 : lowerHeight;<NEW_LINE>float y47 = onCeiling ? 1 - upperHeight : 0;<NEW_LINE>float y56 = onCeiling ? 1 - lowerHeight : 0;<NEW_LINE>vertices = new Vec3[] { // 0<NEW_LINE>// 1<NEW_LINE>new Vec3(0, y03, 0), // 2<NEW_LINE>new Vec3(0, y12, 1), // 3<NEW_LINE>new Vec3(1, y12, 1), // 4<NEW_LINE>new Vec3(1, y03, 0), // 5<NEW_LINE>new Vec3(0, y47, 0), // 6<NEW_LINE>new Vec3(0, y56, 1), // 7<NEW_LINE>new Vec3(1, y56, 1), new Vec3(1, y47, 0) };<NEW_LINE>}<NEW_LINE>for (int i = 0; i < vertices.length; i++) vertices[i] = mat.apply(vertices[i]);<NEW_LINE>// TOP<NEW_LINE>addCulledQuad(quads, format, Arrays.copyOf(vertices, 4), UP, tas, new double[] { 0, 0, 16, 16 }, new float[] { 1, 1, 1, 1 });<NEW_LINE>// BOTTOM<NEW_LINE>addCulledQuad(quads, format, getArrayByIndices(vertices, 7, 6, 5, 4), DOWN, tas, new double[] { 0, 0, 16, 16 }, new float[] { 1, 1, 1, 1 });<NEW_LINE>// SIDES<NEW_LINE>addSides(quads, vertices, tas, lowerV, upperV, false);<NEW_LINE>addSides(quads, vertices, tas, lowerV, upperV, true);<NEW_LINE>if (isAtEnd(true))<NEW_LINE>// HIGHER END<NEW_LINE>addCulledQuad(quads, format, getArrayByIndices(vertices, 0, 3, 7, 4), NORTH, tas, new double[] { 0, 0, 16, 16 }, new float[] { 1, 1, 1, 1 });<NEW_LINE>return quads;<NEW_LINE>} | = (slopePosition + 1F) / totalLength; |
123,476 | public Iterator<Tuple2<T, U>> call(Integer v1, Iterator<Tuple2<T, U>> iter) throws Exception {<NEW_LINE>long thisRngSeed = baseRngSeed + v1;<NEW_LINE>Random r = new Random(thisRngSeed);<NEW_LINE>List<Integer> list = new ArrayList<>();<NEW_LINE>for (int i = 0; i < numSplits; i++) {<NEW_LINE>list.add(i);<NEW_LINE>}<NEW_LINE>List<Tuple2<T, U>> outputList = new ArrayList<>();<NEW_LINE>int i = 0;<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>if (i % numSplits == 0)<NEW_LINE><MASK><NEW_LINE>Tuple2<T, U> next = iter.next();<NEW_LINE>if (list.get(i % numSplits) == splitIndex)<NEW_LINE>outputList.add(next);<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>return outputList.iterator();<NEW_LINE>} | Collections.shuffle(list, r); |
1,272,512 | public void onBindViewHolder(@NonNull ViewHolder viewHolder, int position) {<NEW_LINE>final Room searchResult = getItem(position);<NEW_LINE>viewHolder.binding.name.setText(searchResult.getName());<NEW_LINE>final String description = searchResult.getDescription();<NEW_LINE>final String language = searchResult.getLanguage();<NEW_LINE>if (TextUtils.isEmpty(description)) {<NEW_LINE>viewHolder.binding.description.setVisibility(View.GONE);<NEW_LINE>} else {<NEW_LINE>viewHolder.<MASK><NEW_LINE>viewHolder.binding.description.setVisibility(View.VISIBLE);<NEW_LINE>}<NEW_LINE>if (language == null || language.length() != 2) {<NEW_LINE>viewHolder.binding.language.setVisibility(View.GONE);<NEW_LINE>} else {<NEW_LINE>viewHolder.binding.language.setText(language.toUpperCase(Locale.ENGLISH));<NEW_LINE>viewHolder.binding.language.setVisibility(View.VISIBLE);<NEW_LINE>}<NEW_LINE>final Jid room = searchResult.getRoom();<NEW_LINE>viewHolder.binding.room.setText(room != null ? room.asBareJid().toString() : "");<NEW_LINE>AvatarWorkerTask.loadAvatar(searchResult, viewHolder.binding.avatar, R.dimen.avatar);<NEW_LINE>final View root = viewHolder.binding.getRoot();<NEW_LINE>root.setTag(searchResult);<NEW_LINE>root.setOnClickListener(v -> listener.onChannelSearchResult(searchResult));<NEW_LINE>root.setOnCreateContextMenuListener(this);<NEW_LINE>} | binding.description.setText(description); |
629,174 | public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {<NEW_LINE>String mname = method.getName();<NEW_LINE>if (mname.equals("toString")) {<NEW_LINE>return "SpunPhadhail<" + ph + ">";<NEW_LINE>} else if (mname.equals("lock")) {<NEW_LINE>return Locks.event();<NEW_LINE>} else if (mname.equals("equals")) {<NEW_LINE>return args[0] == ph ? Boolean.TRUE : Boolean.FALSE;<NEW_LINE>} else if (mname.equals("hashCode")) {<NEW_LINE>return new Integer(ph.hashCode());<NEW_LINE>} else if (mname.endsWith("PhadhailListener")) {<NEW_LINE>// Can do this synch - it's thread-safe and fast.<NEW_LINE>assert args != null;<NEW_LINE>assert args.length == 1;<NEW_LINE>// Need to wrap this too!<NEW_LINE>Spin spin = new SpunPhadhailListener((PhadhailListener) args[<MASK><NEW_LINE>PhadhailListener l = (PhadhailListener) spin.getProxy();<NEW_LINE>if (mname.equals("addPhadhailListener")) {<NEW_LINE>ph.addPhadhailListener(l);<NEW_LINE>} else {<NEW_LINE>assert mname.equals("removePhadhailListener") : mname;<NEW_LINE>ph.removePhadhailListener(l);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>assert EventQueue.isDispatchThread() : mname;<NEW_LINE>Object result = super.invoke(proxy, method, args);<NEW_LINE>if (result instanceof Phadhail) {<NEW_LINE>return forPhadhail((Phadhail) result);<NEW_LINE>} else if (result instanceof List) {<NEW_LINE>// I.e. from getChildren(). Need to wrap result phadhails.<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>List<Phadhail> l = (List<Phadhail>) result;<NEW_LINE>return new SpunChildrenList(l);<NEW_LINE>} else {<NEW_LINE>// Just pass on the call.<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | 0], (Phadhail) proxy); |
1,478,805 | private Object pushNewFile(final String groupName, final String path, final String fileHash, final String hashRef, final File file, final Connection connection) {<NEW_LINE>final String groupNameLC = groupName.toLowerCase();<NEW_LINE>final String pathLC = path.toLowerCase();<NEW_LINE>final <MASK><NEW_LINE>try (final FileByteSplitter fileSplitter = new FileByteSplitter(file, Config.getIntProperty(DB_STORAGE_CHUNK_SIZE, 2048))) {<NEW_LINE>final HashBuilder objectHashBuilder = Encryptor.Hashing.sha256();<NEW_LINE>final List<String> chunkHashes = new LinkedList<>();<NEW_LINE>for (final Tuple2<byte[], Integer> bytesRead : fileSplitter) {<NEW_LINE>objectHashBuilder.append(bytesRead._1(), bytesRead._2());<NEW_LINE>final String chunkHash = Encryptor.Hashing.sha256().append(bytesRead._1(), bytesRead._2()).buildUnixHash();<NEW_LINE>chunkHashes.add(chunkHash);<NEW_LINE>upsertDelegate.pushDataChunk(connection, chunkHash, bytesRead._1().length == bytesRead._2() ? bytesRead._1() : chunkBytes(bytesRead._2(), bytesRead._1()));<NEW_LINE>}<NEW_LINE>final String objectHash = objectHashBuilder.buildUnixHash();<NEW_LINE>assert objectHash.equals(fileHash) : "File hash and objectHash must match.";<NEW_LINE>upsertDelegate.pushHashReference(connection, objectHash, chunkHashes);<NEW_LINE>upsertDelegate.pushObjectReference(connection, objectHash, pathLC, groupNameLC, hashRef);<NEW_LINE>return true;<NEW_LINE>} catch (DotDataException | NoSuchAlgorithmException | IOException e) {<NEW_LINE>Logger.error(DataBaseStoragePersistenceAPIImpl.class, e.getMessage(), e);<NEW_LINE>throw new DotRuntimeException(String.format("Exception pushing new file. group=[%s], path=[%s], fileHash=[%s]", groupNameLC, pathLC, fileHash), e);<NEW_LINE>}<NEW_LINE>} | UpsertDelegate upsertDelegate = UpsertDelegate.newInstance(); |
1,531,840 | private Mono<Response<Flux<ByteBuffer>>> updateWithResponseAsync(String resourceGroupName, String clusterName, ClusterResourceInner body, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (clusterName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (body == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>} else {<NEW_LINE>body.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, this.client.getApiVersion(), body, accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter body is required and cannot be null.")); |
754,102 | protected List<File> pickBundles(File[] files) {<NEW_LINE>ArrayList<File> jars = new ArrayList<>();<NEW_LINE>boolean foundVersion = false;<NEW_LINE>if (files != null) {<NEW_LINE>Arrays.sort(files);<NEW_LINE>for (File file : files) {<NEW_LINE>String name = file.getName().toLowerCase();<NEW_LINE>// Avoid loading the wrong persistence module<NEW_LINE>if (!dse && (name.contains("persistence-dse") || (name.contains("persistence-cassandra") && !name.contains("persistence-cassandra-" + version))))<NEW_LINE>continue;<NEW_LINE>if (dse && (name.contains("persistence-cassandra") || (name.contains("persistence-dse") && !name.contains("persistence-dse-" + version))))<NEW_LINE>continue;<NEW_LINE>if (name.contains("persistence-cassandra") || name.contains("persistence-dse")) {<NEW_LINE>System.out.println("Loading persistence backend " + name);<NEW_LINE>foundVersion = true;<NEW_LINE>// Put the persistence bundle first in the list<NEW_LINE>jars.add(0, file);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (name.endsWith(".jar") && !name.startsWith("stargate-starter-")) {<NEW_LINE>jars.add(file);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!foundVersion)<NEW_LINE>throw new IllegalArgumentException(String.format("No persistence backend found for %s %s", (dse ? <MASK><NEW_LINE>return jars;<NEW_LINE>} | "dse" : "cassandra"), version)); |
706,366 | public void main() {<NEW_LINE>RVec4 srcColor = new RVec4("srcColor");<NEW_LINE>srcColor.assign(texture2D(uTexture, vTextureCoord));<NEW_LINE>switch(mMode) {<NEW_LINE>case LIGHTNESS:<NEW_LINE><MASK><NEW_LINE>least.assign(min(srcColor.g(), min(srcColor.r(), srcColor.b())));<NEW_LINE>RFloat most = new RFloat("most");<NEW_LINE>most.assign(max(srcColor.g(), max(srcColor.r(), srcColor.b())));<NEW_LINE>RFloat lightness = new RFloat("lightness");<NEW_LINE>lightness.assign("(least + most) / 2.0");<NEW_LINE>GL_FRAG_COLOR.assign(uOpacity.multiply(castVec4("lightness, lightness, lightness, srcColor.a")));<NEW_LINE>break;<NEW_LINE>case LUMA:<NEW_LINE>RFloat luma = new RFloat("luma");<NEW_LINE>luma.assign(0);<NEW_LINE>luma.assignAdd(srcColor.r().multiply(0.2126f));<NEW_LINE>luma.assignAdd(srcColor.g().multiply(0.7152f));<NEW_LINE>luma.assignAdd(srcColor.b().multiply(0.0722f));<NEW_LINE>GL_FRAG_COLOR.assign(uOpacity.multiply(castVec4("luma, luma, luma, srcColor.a")));<NEW_LINE>break;<NEW_LINE>case VALUE:<NEW_LINE>RFloat value = new RFloat("value");<NEW_LINE>value.assign(max(srcColor.g(), max(srcColor.r(), srcColor.b())));<NEW_LINE>GL_FRAG_COLOR.assign(uOpacity.multiply(castVec4("value, value, value, srcColor.a")));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>RFloat average = new RFloat("average");<NEW_LINE>average.assign("(srcColor.r + srcColor.g + srcColor.b) / 3.0");<NEW_LINE>GL_FRAG_COLOR.assign(uOpacity.multiply(castVec4("average, average, average, srcColor.a")));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | RFloat least = new RFloat("least"); |
670,369 | public int findShortestSubArray(int[] nums) {<NEW_LINE>Map<Integer, Integer> count = new HashMap<>();<NEW_LINE>Map<Integer, Integer> left = new HashMap<>();<NEW_LINE>Map<Integer, Integer> <MASK><NEW_LINE>for (int i = 0; i < nums.length; i++) {<NEW_LINE>count.put(nums[i], count.getOrDefault(nums[i], 0) + 1);<NEW_LINE>if (!left.containsKey(nums[i])) {<NEW_LINE>left.put(nums[i], i);<NEW_LINE>}<NEW_LINE>right.put(nums[i], i);<NEW_LINE>}<NEW_LINE>int result = nums.length;<NEW_LINE>int degree = Collections.max(count.values());<NEW_LINE>for (int num : count.keySet()) {<NEW_LINE>if (count.get(num) == degree) {<NEW_LINE>result = Math.min(result, right.get(num) - left.get(num) + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | right = new HashMap<>(); |
1,510,101 | final GetJobOutputResult executeGetJobOutput(GetJobOutputRequest getJobOutputRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getJobOutputRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetJobOutputRequest> request = null;<NEW_LINE>Response<GetJobOutputResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetJobOutputRequestProtocolMarshaller(protocolFactory).marshall<MASK><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, "Glacier");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetJobOutput");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetJobOutputResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(false).withHasStreamingSuccessResponse(true), new GetJobOutputResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>request.addHandlerContext(HandlerContextKey.HAS_STREAMING_OUTPUT, Boolean.TRUE);<NEW_LINE>GetJobOutputResult result = response.getAwsResponse();<NEW_LINE>// wrapping the response with the LengthCheckInputStream.<NEW_LINE>result.setBody(new LengthCheckInputStream(result.getBody(), Long.parseLong(response.getHttpResponse().getHeaders().get("Content-Length")), com.amazonaws.util.LengthCheckInputStream.INCLUDE_SKIPPED_BYTES));<NEW_LINE>// wrapping the response with the service client holder input stream to avoid client being GC'ed.<NEW_LINE>result.setBody(new ServiceClientHolderInputStream(result.getBody(), this));<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | (super.beforeMarshalling(getJobOutputRequest)); |
1,699,208 | private DBWHandlerConfiguration parseNetworkHandlerConfig(@Nullable DataSourceDescriptor dataSource, @Nullable DBWNetworkProfile profile, @NotNull Map.Entry<String, Map<String, Object>> handlerObject) {<NEW_LINE><MASK><NEW_LINE>Map<String, Object> handlerCfg = handlerObject.getValue();<NEW_LINE>NetworkHandlerDescriptor handlerDescriptor = NetworkHandlerRegistry.getInstance().getDescriptor(handlerId);<NEW_LINE>if (handlerDescriptor == null) {<NEW_LINE>log.warn("Can't find network handler '" + handlerId + "'");<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>DBWHandlerConfiguration curNetworkHandler = new DBWHandlerConfiguration(handlerDescriptor, dataSource);<NEW_LINE>curNetworkHandler.setEnabled(JSONUtils.getBoolean(handlerCfg, RegistryConstants.ATTR_ENABLED));<NEW_LINE>curNetworkHandler.setSavePassword(JSONUtils.getBoolean(handlerCfg, RegistryConstants.ATTR_SAVE_PASSWORD));<NEW_LINE>if (!passwordReadCanceled) {<NEW_LINE>final SecureCredentials creds = readSecuredCredentials(dataSource, profile, "network/" + handlerId + (profile == null ? "" : "/profile/" + profile.getProfileName()));<NEW_LINE>curNetworkHandler.setUserName(creds.getUserName());<NEW_LINE>if (curNetworkHandler.isSavePassword()) {<NEW_LINE>curNetworkHandler.setPassword(creds.getUserPassword());<NEW_LINE>}<NEW_LINE>if (creds.getProperties() != null) {<NEW_LINE>curNetworkHandler.setSecureProperties(creds.getProperties());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>{<NEW_LINE>// Still try to read credentials directly from configuration (#6564)<NEW_LINE>String userName = JSONUtils.getString(handlerCfg, RegistryConstants.ATTR_USER);<NEW_LINE>if (!CommonUtils.isEmpty(userName))<NEW_LINE>curNetworkHandler.setUserName(userName);<NEW_LINE>String userPassword = JSONUtils.getString(handlerCfg, RegistryConstants.ATTR_PASSWORD);<NEW_LINE>if (!CommonUtils.isEmpty(userPassword))<NEW_LINE>curNetworkHandler.setPassword(userPassword);<NEW_LINE>}<NEW_LINE>Map<String, Object> properties = JSONUtils.deserializeProperties(handlerCfg, RegistryConstants.TAG_PROPERTIES);<NEW_LINE>if (properties != null) {<NEW_LINE>curNetworkHandler.setProperties(properties);<NEW_LINE>}<NEW_LINE>return curNetworkHandler;<NEW_LINE>}<NEW_LINE>} | String handlerId = handlerObject.getKey(); |
1,365,544 | public boolean incrementToken() throws IOException {<NEW_LINE>if (tokens.isEmpty() == false) {<NEW_LINE>assert current != null;<NEW_LINE>DelimitedToken token = tokens.removeFirst();<NEW_LINE>// keep all other attributes untouched<NEW_LINE>restoreState(current);<NEW_LINE>termAtt.setEmpty().append(token.charSequence());<NEW_LINE>offsetAtt.setOffset(token.startOffset(), token.endOffset());<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// not really needed, but for safety<NEW_LINE>current = null;<NEW_LINE>if (input.incrementToken()) {<NEW_LINE>if (isStripAccents) {<NEW_LINE>stripAccent();<NEW_LINE>}<NEW_LINE>if (neverSplitSet.contains(termAtt)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// split punctuation and maybe cjk chars!!!<NEW_LINE>LinkedList<DelimitedToken> splits = split();<NEW_LINE>// There is nothing to merge, nothing to store, simply return<NEW_LINE>if (splits.size() == 1) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>tokens.addAll(mergeSplits(splits));<NEW_LINE>this.current = captureState();<NEW_LINE><MASK><NEW_LINE>termAtt.setEmpty().append(token.charSequence());<NEW_LINE>offsetAtt.setOffset(token.startOffset(), token.endOffset());<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | DelimitedToken token = tokens.removeFirst(); |
983,907 | public void instanceCodegen(CodegenInstanceAux instance, CodegenClassScope classScope, CodegenCtor factoryCtor, List<CodegenTypedParam> factoryMembers) {<NEW_LINE>instance.getMethods().addMethod(SelectExprProcessor.EPTYPE, "getSelectExprProcessor", Collections.emptyList(), this.getClass(), classScope, methodNode -> methodNode.getBlock().methodReturn(MEMBER_SELECTEXPRPROCESSOR));<NEW_LINE>instance.getMethods().addMethod(AggregationService.EPTYPE, "getAggregationService", Collections.emptyList(), this.getClass(), classScope, methodNode -> methodNode.getBlock().methodReturn(MEMBER_AGGREGATIONSVC));<NEW_LINE>instance.getMethods().addMethod(ExprEvaluatorContext.EPTYPE, "getExprEvaluatorContext", Collections.emptyList(), this.getClass(), classScope, methodNode -> methodNode.getBlock<MASK><NEW_LINE>instance.getMethods().addMethod(EPTypePremade.BOOLEANPRIMITIVE.getEPType(), "hasHavingClause", Collections.emptyList(), this.getClass(), classScope, methodNode -> methodNode.getBlock().methodReturn(constant(optionalHavingNode != null)));<NEW_LINE>instance.getMethods().addMethod(EPTypePremade.BOOLEANPRIMITIVE.getEPType(), "isSelectRStream", Collections.emptyList(), ResultSetProcessorRowForAll.class, classScope, methodNode -> methodNode.getBlock().methodReturn(constant(isSelectRStream)));<NEW_LINE>ResultSetProcessorUtil.evaluateHavingClauseCodegen(optionalHavingNode, classScope, instance);<NEW_LINE>ResultSetProcessorAggregateGroupedImpl.removedAggregationGroupKeyCodegen(classScope, instance);<NEW_LINE>generateGroupKeySingle = ResultSetProcessorGroupedUtil.generateGroupKeySingleCodegen(groupKeyNodeExpressions, multiKeyClassRef, classScope, instance);<NEW_LINE>generateGroupKeyArrayView = generateGroupKeyArrayViewCodegen(generateGroupKeySingle, classScope, instance);<NEW_LINE>generateGroupKeyArrayJoin = ResultSetProcessorGroupedUtil.generateGroupKeyArrayJoinCodegen(generateGroupKeySingle, classScope, instance);<NEW_LINE>ResultSetProcessorAggregateGroupedImpl.generateOutputBatchedSingleCodegen(this, classScope, instance);<NEW_LINE>ResultSetProcessorAggregateGroupedImpl.generateOutputBatchedViewUnkeyedCodegen(this, classScope, instance);<NEW_LINE>ResultSetProcessorAggregateGroupedImpl.generateOutputBatchedJoinUnkeyedCodegen(this, classScope, instance);<NEW_LINE>ResultSetProcessorAggregateGroupedImpl.generateOutputBatchedJoinPerKeyCodegen(this, classScope, instance);<NEW_LINE>ResultSetProcessorAggregateGroupedImpl.generateOutputBatchedViewPerKeyCodegen(this, classScope, instance);<NEW_LINE>} | ().methodReturn(MEMBER_EXPREVALCONTEXT)); |
1,633,151 | public static GetIoTCloudConnectorGatewayResponse unmarshall(GetIoTCloudConnectorGatewayResponse getIoTCloudConnectorGatewayResponse, UnmarshallerContext _ctx) {<NEW_LINE>getIoTCloudConnectorGatewayResponse.setRequestId(_ctx.stringValue("GetIoTCloudConnectorGatewayResponse.RequestId"));<NEW_LINE>getIoTCloudConnectorGatewayResponse.setSpec(_ctx.stringValue("GetIoTCloudConnectorGatewayResponse.Spec"));<NEW_LINE>getIoTCloudConnectorGatewayResponse.setResourceUid(_ctx.longValue("GetIoTCloudConnectorGatewayResponse.ResourceUid"));<NEW_LINE>getIoTCloudConnectorGatewayResponse.setDescription(_ctx.stringValue("GetIoTCloudConnectorGatewayResponse.Description"));<NEW_LINE>getIoTCloudConnectorGatewayResponse.setState(_ctx.stringValue("GetIoTCloudConnectorGatewayResponse.State"));<NEW_LINE>getIoTCloudConnectorGatewayResponse.setScheduleFactor(_ctx.mapValue("GetIoTCloudConnectorGatewayResponse.ScheduleFactor"));<NEW_LINE>getIoTCloudConnectorGatewayResponse.setApn(_ctx.stringValue("GetIoTCloudConnectorGatewayResponse.Apn"));<NEW_LINE>getIoTCloudConnectorGatewayResponse.setForwardingUnitCount(_ctx.integerValue("GetIoTCloudConnectorGatewayResponse.ForwardingUnitCount"));<NEW_LINE>getIoTCloudConnectorGatewayResponse.setName(_ctx.stringValue("GetIoTCloudConnectorGatewayResponse.Name"));<NEW_LINE>getIoTCloudConnectorGatewayResponse.setIsp(_ctx.stringValue("GetIoTCloudConnectorGatewayResponse.Isp"));<NEW_LINE>getIoTCloudConnectorGatewayResponse.setIoTCloudConnectorGatewayId(_ctx.stringValue("GetIoTCloudConnectorGatewayResponse.IoTCloudConnectorGatewayId"));<NEW_LINE>List<String> forwardingUnitIds = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetIoTCloudConnectorGatewayResponse.ForwardingUnitIds.Length"); i++) {<NEW_LINE>forwardingUnitIds.add(_ctx.stringValue<MASK><NEW_LINE>}<NEW_LINE>getIoTCloudConnectorGatewayResponse.setForwardingUnitIds(forwardingUnitIds);<NEW_LINE>List<String> featureList = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetIoTCloudConnectorGatewayResponse.FeatureList.Length"); i++) {<NEW_LINE>featureList.add(_ctx.stringValue("GetIoTCloudConnectorGatewayResponse.FeatureList[" + i + "]"));<NEW_LINE>}<NEW_LINE>getIoTCloudConnectorGatewayResponse.setFeatureList(featureList);<NEW_LINE>List<String> zoneList = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetIoTCloudConnectorGatewayResponse.ZoneList.Length"); i++) {<NEW_LINE>zoneList.add(_ctx.stringValue("GetIoTCloudConnectorGatewayResponse.ZoneList[" + i + "]"));<NEW_LINE>}<NEW_LINE>getIoTCloudConnectorGatewayResponse.setZoneList(zoneList);<NEW_LINE>return getIoTCloudConnectorGatewayResponse;<NEW_LINE>} | ("GetIoTCloudConnectorGatewayResponse.ForwardingUnitIds[" + i + "]")); |
567,286 | final BatchGetJobsResult executeBatchGetJobs(BatchGetJobsRequest batchGetJobsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(batchGetJobsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<BatchGetJobsRequest> request = null;<NEW_LINE>Response<BatchGetJobsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new BatchGetJobsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(batchGetJobsRequest));<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, "Glue");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "BatchGetJobs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<BatchGetJobsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new BatchGetJobsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
1,528,397 | public static Map<String, Object> expand(Map<String, Object> flatMap) {<NEW_LINE>Map<String, Object> <MASK><NEW_LINE>for (String key : flatMap.keySet()) {<NEW_LINE>String[] splitKey = key.split("/");<NEW_LINE>Object value = flatMap.get(key);<NEW_LINE>// In this case, we have a composite key i.e. A/B/C which needs to be expanded<NEW_LINE>if (splitKey.length > 1) {<NEW_LINE>// Split the key into the first part A and child part B/C<NEW_LINE>String parentKey = splitKey[0];<NEW_LINE>String childKey = key.replace(parentKey + "/", "");<NEW_LINE>// Make a new child map which would contain the value keyed by the child key<NEW_LINE>// i.e. B/C => Value<NEW_LINE>Map<String, Object> childMap = new HashMap<>();<NEW_LINE>childMap.put(childKey, value);<NEW_LINE>// It may be that we already have a sub map, mapped to this key,<NEW_LINE>// in that case get it<NEW_LINE>Map<String, Object> existingMap = expandedMap.get(parentKey) instanceof Map ? (Map) expandedMap.get(parentKey) : new HashMap<>();<NEW_LINE>// Expand the child map recursively and merge it with the existing map<NEW_LINE>existingMap.putAll(expand(childMap));<NEW_LINE>// Add existing map back in if necessary<NEW_LINE>expandedMap.put(parentKey, existingMap);<NEW_LINE>} else {<NEW_LINE>expandedMap.put(key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return expandedMap;<NEW_LINE>} | expandedMap = new HashMap<>(); |
190,518 | public void run(MessageReply reply) {<NEW_LINE>if (!reply.isSuccess()) {<NEW_LINE>completion.fail(reply.getError());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>KVMHostAsyncHttpCallReply hreply = reply.castReply();<NEW_LINE>CreateVlanBridgeResponse rsp = hreply.toResponse(CreateVlanBridgeResponse.class);<NEW_LINE>if (!rsp.isSuccess()) {<NEW_LINE>ErrorCode err = operr("failed to create bridge[%s] for l2Network[uuid:%s, type:%s, vlan:%s] on kvm host[uuid:%s], because %s", cmd.getBridgeName(), l2Network.getUuid(), l2Network.getType(), l2vlan.getVlan(), hostUuid, rsp.getError());<NEW_LINE>completion.fail(err);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String info = String.format("successfully realize bridge[%s] for l2Network[uuid:%s, type:%s, vlan:%s] on kvm host[uuid:%s]", cmd.getBridgeName(), l2Network.getUuid(), l2Network.getType(), l2vlan.getVlan(), hostUuid);<NEW_LINE>logger.debug(info);<NEW_LINE>SystemTagCreator creator = KVMSystemTags.L2_BRIDGE_NAME.newSystemTagCreator(l2Network.getUuid());<NEW_LINE>creator.inherent = true;<NEW_LINE>creator.ignoreIfExisting = true;<NEW_LINE>creator.setTagByTokens(map(e(KVMSystemTags.L2_BRIDGE_NAME_TOKEN, <MASK><NEW_LINE>creator.create();<NEW_LINE>completion.success();<NEW_LINE>} | cmd.getBridgeName()))); |
1,265,231 | public boolean onCreateOptionsMenu(final Menu menu) {<NEW_LINE>super.onCreateOptionsMenu(menu);<NEW_LINE>getMenuInflater().inflate(R.menu.main_activity_menu, menu);<NEW_LINE>// setup the video blocker notification icon which will be displayed in the tool bar<NEW_LINE>videoBlockerPlugin.setupIconForToolBar(menu);<NEW_LINE>onOptionsMenuCreated(menu);<NEW_LINE>// setup the SearchView (actionbar)<NEW_LINE>final MenuItem searchItem = menu.findItem(R.id.menu_search);<NEW_LINE>final SearchView searchView = (SearchView) searchItem.getActionView();<NEW_LINE>searchView.setQueryHint(getString(R.string.search_videos));<NEW_LINE>AutoCompleteTextView autoCompleteTextView = searchView.findViewById(androidx.<MASK><NEW_LINE>autoCompleteTextView.setThreshold(0);<NEW_LINE>// ... and change/init the cursor... but not clear the search area, so the user can modify the previous one.<NEW_LINE>getSearchHistoryAdapter(searchView);<NEW_LINE>// set the query hints to be equal to the previously searched text<NEW_LINE>searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onQueryTextChange(final String newText) {<NEW_LINE>if (newText == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onQueryTextSubmit(String query) {<NEW_LINE>if (!SkyTubeApp.getSettings().isDisableSearchHistory()) {<NEW_LINE>// Save this search string into the Search History Database (for Suggestions)<NEW_LINE>SearchHistoryDb.getSearchHistoryDb().insertSearchText(query).subscribe();<NEW_LINE>}<NEW_LINE>displaySearchResults(query, searchView);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return true;<NEW_LINE>} | appcompat.R.id.search_src_text); |
564,756 | public void draw(Graphics2D graphics) {<NEW_LINE>if (features != null) {<NEW_LINE>Map<Double, float[]> spectralInfoSubMap = features.subMap(cs.getMin(Axis.X) / 1000.0, cs.getMax(Axis.X) / 1000.0);<NEW_LINE>double currentMaxSpectralEnergy = 0;<NEW_LINE>for (Map.Entry<Double, float[]> column : spectralInfoSubMap.entrySet()) {<NEW_LINE>float[] spectralEnergy = column.getValue();<NEW_LINE>for (int i = 0; i < spectralEnergy.length; i++) {<NEW_LINE>currentMaxSpectralEnergy = Math.max(currentMaxSpectralEnergy, spectralEnergy[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Map.Entry<Double, float[]> column : spectralInfoSubMap.entrySet()) {<NEW_LINE>// in seconds<NEW_LINE>double timeStart = column.getKey();<NEW_LINE>// in cents<NEW_LINE>float[] spectralEnergy = column.getValue();<NEW_LINE>// draw the pixels<NEW_LINE>for (int i = 0; i < spectralEnergy.length; i++) {<NEW_LINE>Color color = Color.black;<NEW_LINE>float centsStartingPoint = binStartingPointsInCents[i];<NEW_LINE>// only draw the visible frequency range<NEW_LINE>if (centsStartingPoint >= cs.getMin(Axis.Y) && centsStartingPoint <= cs.getMax(Axis.Y)) {<NEW_LINE>int greyValue = 255 - (int) (Math.log1p(spectralEnergy[i]) / Math.log1p(currentMaxSpectralEnergy) * 255);<NEW_LINE>greyValue = <MASK><NEW_LINE>color = new Color(greyValue, greyValue, greyValue);<NEW_LINE>graphics.setColor(color);<NEW_LINE>graphics.fillRect((int) Math.round(timeStart * 1000), Math.round(centsStartingPoint), (int) Math.round(binWith * 1000), (int) Math.ceil(binHeight));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Math.max(0, greyValue); |
1,716,230 | private boolean canMoveModerately(Reference initialization, Reference reference) {<NEW_LINE>// Check if declaration can be inlined without passing<NEW_LINE>// any side-effect causing nodes.<NEW_LINE>Iterator<Node> it;<NEW_LINE>if (NodeUtil.isNameDeclaration(initialization.getParent())) {<NEW_LINE>it = // NAME<NEW_LINE>NodeIterators.LocalVarMotion.// NAME<NEW_LINE>forVar(// NAME<NEW_LINE>compiler, // VAR/LET/CONST<NEW_LINE>initialization.getNode(), // VAR/LET/CONST container<NEW_LINE>initialization.getParent(), initialization.getGrandparent());<NEW_LINE>} else if (initialization.getParent().isAssign()) {<NEW_LINE>checkState(initialization.<MASK><NEW_LINE>it = // NAME<NEW_LINE>NodeIterators.LocalVarMotion.// NAME<NEW_LINE>forAssign(// NAME<NEW_LINE>compiler, // ASSIGN<NEW_LINE>initialization.getNode(), // EXPR_RESULT<NEW_LINE>initialization.getParent(), // EXPR container<NEW_LINE>initialization.getGrandparent(), initialization.getGrandparent().getParent());<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Unexpected initialization parent\n" + initialization.getParent().toStringTree());<NEW_LINE>}<NEW_LINE>Node targetName = reference.getNode();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>Node curNode = it.next();<NEW_LINE>if (curNode == targetName) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | getGrandparent().isExprResult()); |
1,529,957 | public void updateConversationRead(final String currentId, final boolean isGroup) {<NEW_LINE>if (getActivity() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.getActivity().runOnUiThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>Message message = null;<NEW_LINE>if (isGroup) {<NEW_LINE>message = latestMessageForEachContact.get(ConversationUIService.GROUP + currentId);<NEW_LINE>} else {<NEW_LINE>message = latestMessageForEachContact.get(currentId);<NEW_LINE>}<NEW_LINE>if (message != null) {<NEW_LINE>int index = messageList.indexOf(message);<NEW_LINE>if (index != -1) {<NEW_LINE>View view = recyclerView.getChildAt(index - linearLayoutManager.findFirstVisibleItemPosition());<NEW_LINE>if (view != null) {<NEW_LINE>TextView unreadCountTextView = (TextView) view.<MASK><NEW_LINE>unreadCountTextView.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Utils.printLog(getActivity(), "AL", "Exception while updating Unread count...");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | findViewById(R.id.unreadSmsCount); |
612,392 | private static void processSensorRxMessage(SensorRxMessage sensorRx) {<NEW_LINE>if (sensorRx == null)<NEW_LINE>return;<NEW_LINE>// TODO, is this accurate or needed?<NEW_LINE>int sensor_battery_level = 0;<NEW_LINE>if (sensorRx.status == TransmitterStatus.BRICKED) {<NEW_LINE>// will give message "EMPTY"<NEW_LINE>sensor_battery_level = 206;<NEW_LINE>} else if (sensorRx.status == TransmitterStatus.LOW) {<NEW_LINE>// will give message "LOW"<NEW_LINE>sensor_battery_level = 209;<NEW_LINE>} else {<NEW_LINE>// no message, just system status "OK"<NEW_LINE>sensor_battery_level = 216;<NEW_LINE>}<NEW_LINE>UserError.Log.d(TAG, "SUCCESS!! unfiltered: " + sensorRx.unfiltered + " filtered: " + sensorRx.filtered + " timestamp: " + sensorRx.timestamp + " " + JoH.qs((double) sensorRx.timestamp / 86400, 1) + " days :: (" + sensorRx.status + ")");<NEW_LINE>DexTimeKeeper.updateAge(<MASK><NEW_LINE>Ob1G5CollectionService.setLast_transmitter_timestamp(sensorRx.timestamp);<NEW_LINE>if (sensorRx.unfiltered == 0) {<NEW_LINE>UserError.Log.e(TAG, "Transmitter sent raw sensor value of 0 !! This isn't good. " + JoH.hourMinuteString());<NEW_LINE>} else {<NEW_LINE>// final boolean g6 = usingG6();<NEW_LINE>// final boolean g6r2 = g6 && FirmwareCapability.isTransmitterG6Rev2(getTransmitterID());<NEW_LINE>// processNewTransmitterData(g6 ? (int)(sensorRx.unfiltered * (g6r2 ? G6_REV2_SCALING : G6_SCALING)) : sensorRx.unfiltered, g6 ? (int)(sensorRx.filtered * (g6r2 ? G6_REV2_SCALING : G6_SCALING)) : sensorRx.filtered, sensor_battery_level, new Date().getTime());<NEW_LINE>processNewTransmitterData((int) RawScaling.scale(sensorRx.unfiltered, getTransmitterID(), false), (int) RawScaling.scale(sensorRx.filtered, getTransmitterID(), true), sensor_battery_level, new Date().getTime());<NEW_LINE>}<NEW_LINE>if (WholeHouse.isLive()) {<NEW_LINE>Mimeograph.poll(false);<NEW_LINE>}<NEW_LINE>} | getTransmitterID(), sensorRx.timestamp); |
41,206 | public List<String> onTabComplete(CMDSender sender, Arguments arguments) {<NEW_LINE>Optional<String> <MASK><NEW_LINE>List<String> options = new ArrayList<>();<NEW_LINE>if (gotAlias.isPresent()) {<NEW_LINE>subcommandsLoop: for (Subcommand subcommand : subcommands) {<NEW_LINE>if (sender.isMissingPermissionsFor(subcommand)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (String alias : subcommand.getAliases()) {<NEW_LINE>if (alias.equals(gotAlias.get())) {<NEW_LINE>options.addAll(subcommand.getArgumentResolver().apply(sender, arguments.removeFirst()));<NEW_LINE>break subcommandsLoop;<NEW_LINE>} else if (alias.startsWith(gotAlias.get())) {<NEW_LINE>options.add(alias);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (Subcommand subcommand : subcommands) {<NEW_LINE>options.add(subcommand.getPrimaryAlias());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Collections.sort(options);<NEW_LINE>return options;<NEW_LINE>} | gotAlias = arguments.get(0); |
522,620 | protected double computePrefWidth(double height) {<NEW_LINE>final Side side = getEffectiveSide();<NEW_LINE>if (side.isVertical()) {<NEW_LINE>// we need to first auto range as this may/will effect tick marks<NEW_LINE>Object range = autoRange(height);<NEW_LINE>// calculate max tick label width<NEW_LINE>double maxLabelWidth = 0;<NEW_LINE>// calculate the new tick marks<NEW_LINE>if (isTickLabelsVisible()) {<NEW_LINE>final List<T> newTickValues = calculateTickValues(height, range);<NEW_LINE>for (T value : newTickValues) {<NEW_LINE>maxLabelWidth = Math.max(maxLabelWidth, measureTickMarkSize(value, range).getWidth());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// calculate tick mark length<NEW_LINE>final double tickMarkLength = isTickMarkVisible() ? (getTickLength() > 0) <MASK><NEW_LINE>// calculate label height<NEW_LINE>final double labelHeight = axisLabel.getText() == null || axisLabel.getText().length() == 0 ? 0 : axisLabel.prefHeight(-1);<NEW_LINE>return maxLabelWidth + getTickLabelGap() + tickMarkLength + labelHeight;<NEW_LINE>} else {<NEW_LINE>// HORIZONTAL<NEW_LINE>// TODO for now we have no hard and fast answer here, I guess it should work<NEW_LINE>// TODO out the minimum size needed to display min, max and zero tick mark labels.<NEW_LINE>return 100;<NEW_LINE>}<NEW_LINE>} | ? getTickLength() : 0 : 0; |
382,586 | public void reset() {<NEW_LINE>for (int i = 0; i < best_ref_mv_sb.length; i++) {<NEW_LINE>best_ref_mv_sb[i].setZero();<NEW_LINE>}<NEW_LINE>for (int i = 0; i < mode_mv_sb.length; i++) {<NEW_LINE>for (int j = 0; j < mode_mv_sb[i].length; j++) {<NEW_LINE>mode_mv_sb[i<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>best_ref_mv.setZero();<NEW_LINE>mvp.setZero();<NEW_LINE>CommonUtils.vp8_zero(nearsad);<NEW_LINE>CommonUtils.vp8_copy(nearsaddx_proto, nearsad);<NEW_LINE>for (MBPredictionMode m : MBPredictionMode.nonBlockPred) pred_error.get(m)[0] = 0;<NEW_LINE>} | ][j].setZero(); |
1,705,286 | private void checkAggregateShareRatio() {<NEW_LINE>if (max_aggregate_share_ratio > 0) {<NEW_LINE>// don't do anything if we are in the process of deleting torrents - in particular we<NEW_LINE>// want to avoid resuming a download that is about to be deleted along with others<NEW_LINE>// that contribute to the same ratio. We'll come back here and recheck anyway<NEW_LINE>if (TorrentUtils.isTorrentDeleting() || TorrentUtils.getMillisecondsSinceLastTorrentDelete() < 10 * 1000) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>updateStuff();<NEW_LINE>if (aggregate_sr >= max_aggregate_share_ratio) {<NEW_LINE>Set<DownloadManager> dms = new HashSet<>(getTaggedDownloads());<NEW_LINE>Iterator<DownloadManager> it = dms.iterator();<NEW_LINE>// don't pause incomplete downloads!<NEW_LINE>while (it.hasNext()) {<NEW_LINE>DownloadManager dm = it.next();<NEW_LINE>if (dm.isForceStart() || !dm.isDownloadComplete(false)) {<NEW_LINE>it.remove();<NEW_LINE>} else {<NEW_LINE>if ((!max_aggregate_share_ratio_priority) && max_share_ratio > 0) {<NEW_LINE>int sr = dm.getStats().getShareRatio();<NEW_LINE>if (sr < max_share_ratio) {<NEW_LINE>// individual has priority over aggregate and this download hasn't met<NEW_LINE>// its ratio yet<NEW_LINE>it.remove();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<Tag> all_tags = getTagType().getTagManager().getTagsForTaggable(dm);<NEW_LINE>for (Tag tag : all_tags) {<NEW_LINE>if (tag != this && tag instanceof TagDownloadWithState) {<NEW_LINE>TagDownloadWithState other_tag = (TagDownloadWithState) tag;<NEW_LINE>if (!other_tag.isAggregateShareRatioMet()) {<NEW_LINE>it.remove();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>performOperation(max_aggregate_share_ratio_action == TagFeatureRateLimit.SR_ACTION_PAUSE ? TagFeatureRunState.<MASK><NEW_LINE>} else {<NEW_LINE>performOperation(max_aggregate_share_ratio_action == TagFeatureRateLimit.SR_ACTION_PAUSE ? TagFeatureRunState.RSC_RESUME : TagFeatureRunState.RSC_START);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | RSC_PAUSE : TagFeatureRunState.RSC_STOP, dms); |
807,387 | private void checkAggregationFunction(Map<String, Integer> columnToIds, Set<CallOperator> aggregatedColumnsInQueryOutput, Map<Long, MaterializedIndexMeta> candidateIndexIdToMeta, boolean disableSPJGMV, boolean isSPJQuery) {<NEW_LINE>Iterator<Map.Entry<Long, MaterializedIndexMeta>> iterator = candidateIndexIdToMeta.entrySet().iterator();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>Map.Entry<Long, MaterializedIndexMeta> entry = iterator.next();<NEW_LINE>MaterializedIndexMeta candidateIndexMeta = entry.getValue();<NEW_LINE>List<CallOperator> indexAggColumnExprList = mvAggColumnsToExprList(columnToIds, candidateIndexMeta);<NEW_LINE>// When the candidate index is SPJ type, it passes the verification directly<NEW_LINE>if (indexAggColumnExprList.size() == 0 && candidateIndexMeta.getKeysType() == KeysType.DUP_KEYS) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// When the query is SPJ type but the candidate index is SPJG type, it will not pass directly.<NEW_LINE>if (disableSPJGMV || isSPJQuery) {<NEW_LINE>iterator.remove();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// The query is SPJG. The candidate index is SPJG too.<NEW_LINE>if (aggregatedColumnsInQueryOutput == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>// The aggregated columns in query output must be subset of the aggregated columns in view<NEW_LINE>if (!aggFunctionsMatchAggColumns(columnToIds, candidateIndexMeta, entry.getKey(), aggregatedColumnsInQueryOutput, indexAggColumnExprList)) {<NEW_LINE>iterator.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | keyColumnsToExprList(columnToIds, candidateIndexMeta, indexAggColumnExprList); |
644,176 | public final void mDOUBLE_QUOTE_STRING(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {<NEW_LINE>int _ttype;<NEW_LINE>Token _token = null;<NEW_LINE>int _begin = text.length();<NEW_LINE>_ttype = DOUBLE_QUOTE_STRING;<NEW_LINE>int _saveIndex;<NEW_LINE>char delimiter = '\0';<NEW_LINE>char end = '\0';<NEW_LINE>delimiter = LA(1);<NEW_LINE>_saveIndex = text.length();<NEW_LINE>match('\"');<NEW_LINE>text.setLength(_saveIndex);<NEW_LINE>{<NEW_LINE>_loop509: do {<NEW_LINE>if ((((LA(1) >= '\u0000' && LA(1) <= '\ufffe')) && ((LA(2) >= '\u0000' && LA(2) <= '\ufffe'))) && (LA(1) != delimiter && !expressionSubstitutionIsNext())) {<NEW_LINE>mSTRING_CHAR(false);<NEW_LINE>} else {<NEW_LINE>break _loop509;<NEW_LINE>}<NEW_LINE>} while (true);<NEW_LINE>}<NEW_LINE>end = LA(1);<NEW_LINE>_saveIndex = text.length();<NEW_LINE>matchNot(EOF_CHAR);<NEW_LINE>text.setLength(_saveIndex);<NEW_LINE>if (end != delimiter) {<NEW_LINE>_ttype = STRING_BEFORE_EXPRESSION_SUBSTITUTION;<NEW_LINE>setCurrentSpecialStringDelimiter(delimiter, 1);<NEW_LINE>}<NEW_LINE>if (_createToken && _token == null && _ttype != Token.SKIP) {<NEW_LINE>_token = makeToken(_ttype);<NEW_LINE>_token.setText(new String(text.getBuffer(), _begin, text<MASK><NEW_LINE>}<NEW_LINE>_returnToken = _token;<NEW_LINE>} | .length() - _begin)); |
1,743,431 | private void checkOverlapPrivateIpRange(long podId, String startIp, String endIp) {<NEW_LINE>HostPodVO pod = _podDao.findById(podId);<NEW_LINE>if (pod == null) {<NEW_LINE>throw new CloudRuntimeException("Cannot find pod " + podId);<NEW_LINE>}<NEW_LINE>final String[] existingPodIpRanges = pod.getDescription().split(",");<NEW_LINE>for (String podIpRange : existingPodIpRanges) {<NEW_LINE>final String[] existingPodIpRange = podIpRange.split("-");<NEW_LINE>if (existingPodIpRange.length > 1) {<NEW_LINE>if (!NetUtils.isValidIp4(existingPodIpRange[0]) || !NetUtils.isValidIp4(existingPodIpRange[1])) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (NetUtils.ipRangesOverlap(startIp, endIp, existingPodIpRange[0], existingPodIpRange[1])) {<NEW_LINE>throw new InvalidParameterValueException("The Storage network Start IP and endIP address range overlap with private IP :" + existingPodIpRange[0] <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | + ":" + existingPodIpRange[1]); |
1,760,093 | private State mapToState(double value, String itemName) {<NEW_LINE>if (itemRegistry != null) {<NEW_LINE>try {<NEW_LINE>Item item = itemRegistry.getItem(itemName);<NEW_LINE>if (item instanceof SwitchItem && !(item instanceof DimmerItem)) {<NEW_LINE>return value == 0.0d ? OnOffType.OFF : OnOffType.ON;<NEW_LINE>} else if (item instanceof ContactItem) {<NEW_LINE>return value == 0.0d ? OpenClosedType.CLOSED : OpenClosedType.OPEN;<NEW_LINE>} else if (item instanceof DimmerItem || item instanceof RollershutterItem) {<NEW_LINE>// make sure Items that need PercentTypes instead of<NEW_LINE>// DecimalTypes<NEW_LINE>// do receive the right information<NEW_LINE>return new PercentType((int) Math.round(value * 100));<NEW_LINE>}<NEW_LINE>} catch (ItemNotFoundException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// just return a DecimalType as a fallback<NEW_LINE>return new DecimalType(value);<NEW_LINE>} | logger.debug("Could not find item '{}' in registry", itemName); |
427,576 | protected void calculatePostCombatActions(Game game) {<NEW_LINE>if (!getNextAction(game)) {<NEW_LINE>currentScore = <MASK><NEW_LINE>Game sim = createSimulation(game);<NEW_LINE>SimulationNode.resetCount();<NEW_LINE>root = new SimulationNode(null, sim, playerId);<NEW_LINE>logger.debug("simulating post combat actions ----------------------------------------------------------------------------------------");<NEW_LINE>if (!isTestMode)<NEW_LINE>addActionsTimed();<NEW_LINE>else<NEW_LINE>addActions(root, Integer.MIN_VALUE, Integer.MAX_VALUE);<NEW_LINE>logger.info(name + " simulated " + nodeCount + " nodes in " + thinkTime / 1000000000.0 + "s - average " + nodeCount / (thinkTime / 1000000000.0) + " nodes/s");<NEW_LINE>if (!root.children.isEmpty()) {<NEW_LINE>root = root.children.get(0);<NEW_LINE>actions = new LinkedList<>(root.abilities);<NEW_LINE>combat = root.combat;<NEW_LINE>if (logger.isDebugEnabled())<NEW_LINE>logger.debug("adding post-combat actions:" + actions);<NEW_LINE>} else<NEW_LINE>logger.debug("no post-combat actions added");<NEW_LINE>}<NEW_LINE>} | GameStateEvaluator.evaluate(playerId, game); |
646,232 | public static Comment fromCursor(final Cursor cursor) {<NEW_LINE>Comment comment = new Comment();<NEW_LINE>comment.date = cursor.getString(cursor.getColumnIndex(DatabaseConstants.COMMENT_DATE));<NEW_LINE>comment.sharedDate = cursor.getString(cursor.getColumnIndex(DatabaseConstants.COMMENT_SHAREDDATE));<NEW_LINE>comment.commentText = cursor.getString(cursor.getColumnIndex(DatabaseConstants.COMMENT_TEXT));<NEW_LINE>comment.storyId = cursor.getString(cursor.getColumnIndex(DatabaseConstants.COMMENT_STORYID));<NEW_LINE>comment.userId = cursor.getString(cursor<MASK><NEW_LINE>comment.byFriend = Boolean.parseBoolean(cursor.getString(cursor.getColumnIndex(DatabaseConstants.COMMENT_BYFRIEND)));<NEW_LINE>String likingUsers = cursor.getString(cursor.getColumnIndex(DatabaseConstants.COMMENT_LIKING_USERS));<NEW_LINE>comment.likingUsers = TextUtils.split(likingUsers, ",");<NEW_LINE>comment.sourceUserId = cursor.getString(cursor.getColumnIndex(DatabaseConstants.COMMENT_SOURCE_USERID));<NEW_LINE>comment.id = cursor.getString(cursor.getColumnIndex(DatabaseConstants.COMMENT_ID));<NEW_LINE>comment.isPseudo = Boolean.parseBoolean(cursor.getString(cursor.getColumnIndex(DatabaseConstants.COMMENT_ISPSEUDO)));<NEW_LINE>comment.isPlaceholder = Boolean.parseBoolean(cursor.getString(cursor.getColumnIndex(DatabaseConstants.COMMENT_ISPLACEHOLDER)));<NEW_LINE>return comment;<NEW_LINE>} | .getColumnIndex(DatabaseConstants.COMMENT_USERID)); |
1,355,153 | private Process createProcess(InstanceProperties ip) {<NEW_LINE>org.netbeans.api.extexecution.base.ProcessBuilder builder = org.netbeans.api.extexecution.base.ProcessBuilder.getLocal();<NEW_LINE>setupEnvironment(ip, builder.getEnvironment());<NEW_LINE>builder = setupBinary(ip, builder);<NEW_LINE>if (builder == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>File rootFile = null;<NEW_LINE>String rootDir = ip.getProperty(WildflyPluginProperties.PROPERTY_ROOT_DIR);<NEW_LINE>if (rootDir != null) {<NEW_LINE>// NOI18N<NEW_LINE>rootFile <MASK><NEW_LINE>}<NEW_LINE>if (rootFile != null && !rootFile.isDirectory()) {<NEW_LINE>rootFile = null;<NEW_LINE>}<NEW_LINE>builder.setWorkingDirectory(rootFile.getAbsolutePath());<NEW_LINE>return builder.call();<NEW_LINE>} catch (java.io.IOException ioe) {<NEW_LINE>Logger.getLogger("global").log(Level.WARNING, null, ioe);<NEW_LINE>final String serverLocation = ip.getProperty(WildflyPluginProperties.PROPERTY_ROOT_DIR);<NEW_LINE>final String serverRunFileName = getServerRunFileName(serverLocation);<NEW_LINE>fireStartProgressEvent(StateType.FAILED, createProgressMessage("MSG_START_SERVER_FAILED_PD", serverRunFileName));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | = new File(rootDir, "bin"); |
275,214 | public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = "c0,c1".split(",");<NEW_LINE>String epl = "@Name('s0') select a.theString as c0, b.theString as c1 from pattern [every (a=SupportBean(intPrimitive>0) and b=SupportBean(intPrimitive<0))]";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>env.milestone(0);<NEW_LINE>sendSupportBean(env, "E1", 1);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.milestone(1);<NEW_LINE>sendSupportBean(env, "E2", 1);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>sendSupportBean(env, "E3", -1);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "E1", "E3" });<NEW_LINE>env.milestone(2);<NEW_LINE>sendSupportBean(env, "E4", -2);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.milestone(3);<NEW_LINE><MASK><NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "E5", "E4" });<NEW_LINE>env.undeployAll();<NEW_LINE>} | sendSupportBean(env, "E5", 2); |
279,946 | private void handleInvoices(final I_C_Printing_Queue queueItem, final I_C_Invoice invoice) {<NEW_LINE>queueItem.setBill_BPartner_ID(invoice.getC_BPartner_ID());<NEW_LINE>queueItem.setBill_User_ID(invoice.getAD_User_ID());<NEW_LINE>queueItem.setBill_Location_ID(invoice.getC_BPartner_Location_ID());<NEW_LINE>queueItem.setC_BPartner_ID(invoice.getC_BPartner_ID());<NEW_LINE>queueItem.setC_BPartner_Location_ID(invoice.getC_BPartner_Location_ID());<NEW_LINE>final IBPartnerDAO bpartnerDAO = Services.get(IBPartnerDAO.class);<NEW_LINE>final I_C_BPartner partner = bpartnerDAO.getById(invoice.getC_BPartner_ID());<NEW_LINE>final int documentCopies = partner.getDocumentCopies();<NEW_LINE>if (documentCopies > 0) {<NEW_LINE>// updating to the partner's preference<NEW_LINE>queueItem.setCopies(documentCopies);<NEW_LINE>}<NEW_LINE>logger.debug("Setting columns of C_Printing_Queue {} from C_Invoice {}: [Bill_BPartner_ID={}, Bill_Location_ID={}, C_BPartner_ID={}, C_BPartner_Location_ID={}, Copies={}]", queueItem, invoice, invoice.getC_BPartner_ID(), invoice.getC_BPartner_Location_ID(), invoice.getC_BPartner_ID(), invoice.getC_BPartner_Location_ID(<MASK><NEW_LINE>} | ), queueItem.getCopies()); |
141,707 | protected Map<Volume, StoragePool> buildMapUsingUserInformation(VirtualMachineProfile profile, Host targetHost, Map<Long, Long> userDefinedVolumeToStoragePoolMap) {<NEW_LINE>Map<Volume, StoragePool> volumeToPoolObjectMap = new HashMap<>();<NEW_LINE>if (MapUtils.isEmpty(userDefinedVolumeToStoragePoolMap)) {<NEW_LINE>return volumeToPoolObjectMap;<NEW_LINE>}<NEW_LINE>for (Long volumeId : userDefinedVolumeToStoragePoolMap.keySet()) {<NEW_LINE>VolumeVO volume = _volsDao.findById(volumeId);<NEW_LINE>Long poolId = userDefinedVolumeToStoragePoolMap.get(volumeId);<NEW_LINE>StoragePoolVO targetPool = _storagePoolDao.findById(poolId);<NEW_LINE>StoragePoolVO currentPool = _storagePoolDao.<MASK><NEW_LINE>executeManagedStorageChecksWhenTargetStoragePoolProvided(currentPool, volume, targetPool);<NEW_LINE>if (targetHost != null && _poolHostDao.findByPoolHost(targetPool.getId(), targetHost.getId()) == null) {<NEW_LINE>throw new CloudRuntimeException(String.format("Cannot migrate the volume [%s] to the storage pool [%s] while migrating VM [%s] to target host [%s]. The host does not have access to the storage pool entered.", volume.getUuid(), targetPool.getUuid(), profile.getUuid(), targetHost.getUuid()));<NEW_LINE>}<NEW_LINE>if (currentPool.getId() == targetPool.getId()) {<NEW_LINE>s_logger.info(String.format("The volume [%s] is already allocated in storage pool [%s].", volume.getUuid(), targetPool.getUuid()));<NEW_LINE>}<NEW_LINE>volumeToPoolObjectMap.put(volume, targetPool);<NEW_LINE>}<NEW_LINE>return volumeToPoolObjectMap;<NEW_LINE>} | findById(volume.getPoolId()); |
989,904 | public StringBuilder notifyHook(String url, String id, String action, String streamName, String category, String vodName, String vodId, String metadata) {<NEW_LINE>StringBuilder response = null;<NEW_LINE>logger.info("Running notify hook url:{} stream id: {} action:{} vod name:{} vod id:{}", url, id, action, vodName, vodId);<NEW_LINE>if (url != null && url.length() > 0) {<NEW_LINE>Map<String, String> <MASK><NEW_LINE>variables.put("id", id);<NEW_LINE>variables.put("action", action);<NEW_LINE>if (streamName != null) {<NEW_LINE>variables.put("streamName", streamName);<NEW_LINE>}<NEW_LINE>if (category != null) {<NEW_LINE>variables.put("category", category);<NEW_LINE>}<NEW_LINE>if (vodName != null) {<NEW_LINE>variables.put("vodName", vodName);<NEW_LINE>}<NEW_LINE>if (vodId != null) {<NEW_LINE>variables.put("vodId", vodId);<NEW_LINE>}<NEW_LINE>if (metadata != null) {<NEW_LINE>variables.put("metadata", metadata);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>response = sendPOST(url, variables);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// Make Exception generi<NEW_LINE>logger.error(ExceptionUtils.getStackTrace(e));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>} | variables = new HashMap<>(); |
194,434 | public J visitUnary(J.Unary unary, ExecutionContext ctx) {<NEW_LINE>if (unary.getOperator() == J.Unary.Type.Not && unary.getExpression() instanceof J.Parentheses) {<NEW_LINE>J.Parentheses<?> expr = (J.Parentheses<?>) unary.getExpression();<NEW_LINE>if (expr.getTree() instanceof J.Binary) {<NEW_LINE>J.Binary binary = (J.Binary) expr.getTree();<NEW_LINE>switch(binary.getOperator()) {<NEW_LINE>case LessThan:<NEW_LINE>return super.visit(binary.withOperator(J.Binary.Type.GreaterThanOrEqual), ctx).withPrefix(unary.getPrefix());<NEW_LINE>case GreaterThan:<NEW_LINE>return super.visit(binary.withOperator(J.Binary.Type.LessThanOrEqual), ctx).withPrefix(unary.getPrefix());<NEW_LINE>case LessThanOrEqual:<NEW_LINE>return super.visit(binary.withOperator(J.Binary.Type.GreaterThan), ctx).withPrefix(unary.getPrefix());<NEW_LINE>case GreaterThanOrEqual:<NEW_LINE>return super.visit(binary.withOperator(J.Binary.Type.LessThan), ctx).withPrefix(unary.getPrefix());<NEW_LINE>case Equal:<NEW_LINE>return super.visit(binary.withOperator(J.Binary.Type.NotEqual), ctx).<MASK><NEW_LINE>case NotEqual:<NEW_LINE>return super.visit(binary.withOperator(J.Binary.Type.Equal), ctx).withPrefix(unary.getPrefix());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return super.visitUnary(unary, ctx);<NEW_LINE>} | withPrefix(unary.getPrefix()); |
985,929 | private static List<BlockPos> findBlockCandidatesInTaxicabArea(FabricClientCommandSource source, ClientBlockPredicate blockMatcher, int radius) {<NEW_LINE>World world <MASK><NEW_LINE>assert world != null;<NEW_LINE>BlockPos senderPos = new BlockPos(source.getPosition());<NEW_LINE>ChunkPos chunkPos = new ChunkPos(senderPos);<NEW_LINE>List<BlockPos> blockCandidates = new ArrayList<>();<NEW_LINE>// search in each chunk with an increasing radius, until we increase the radius<NEW_LINE>// past an already found block<NEW_LINE>int chunkRadius = (radius >> 4) + 1;<NEW_LINE>for (int r = 0; r < chunkRadius; r++) {<NEW_LINE>for (int chunkX = chunkPos.x - r; chunkX <= chunkPos.x + r; chunkX++) {<NEW_LINE>int chunkZ = chunkPos.z - (r - Math.abs(chunkPos.x - chunkX));<NEW_LINE>for (int i = 0; i < 2; i++) {<NEW_LINE>Chunk chunk = world.getChunk(chunkX, chunkZ);<NEW_LINE>if (searchChunkForBlockCandidates(chunk, senderPos.getY(), blockMatcher, blockCandidates)) {<NEW_LINE>// update new, potentially shortened, radius<NEW_LINE>int newChunkRadius = Math.abs(chunkPos.x - chunkX) + Math.abs(chunkPos.z - chunkZ) + 1;<NEW_LINE>if (newChunkRadius < chunkRadius) {<NEW_LINE>chunkRadius = newChunkRadius;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>chunkZ = chunkPos.z + (r - Math.abs(chunkPos.x - chunkX));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return blockCandidates;<NEW_LINE>} | = MinecraftClient.getInstance().world; |
279,388 | public boolean updateCurrentState() {<NEW_LINE>// TODO avoid updating one layout model by multiple designers<NEW_LINE>if (logTestCode()) {<NEW_LINE>// NOI18N<NEW_LINE>testCode.add("// > UPDATE CURRENT STATE");<NEW_LINE>}<NEW_LINE>Object changeMark = layoutModel.getChangeMark();<NEW_LINE>List<LayoutComponent> updatedContainers = // e.g. after undo we should not try to change anything in the model<NEW_LINE>updateDataAfterBuild ? // e.g. after undo we should not try to change anything in the model<NEW_LINE>new LinkedList<LayoutComponent>() : null;<NEW_LINE>updateCurrentState(updatedContainers);<NEW_LINE>preferredSizeChanged = false;<NEW_LINE>updateDataAfterBuild = false;<NEW_LINE>designerResized = null;<NEW_LINE>if (updatedContainers != null && !updatedContainers.isEmpty()) {<NEW_LINE>for (LayoutComponent comp : updatedContainers) {<NEW_LINE>rebuildLayoutRecursively(comp);<NEW_LINE>}<NEW_LINE>updateCurrentState(null);<NEW_LINE>}<NEW_LINE>if (logTestCode()) {<NEW_LINE>// NOI18N<NEW_LINE>testCode.add("ld.updateCurrentState();");<NEW_LINE>// NOI18N<NEW_LINE>testCode.add("// < UPDATE CURRENT STATE");<NEW_LINE>}<NEW_LINE>visualStateUpToDate = true;<NEW_LINE>return !changeMark.<MASK><NEW_LINE>} | equals(layoutModel.getChangeMark()); |
1,264,541 | public void onClick(View arg0) {<NEW_LINE>switch(arg0.getId()) {<NEW_LINE>case (R.id.bLogin):<NEW_LINE>String unsanitizeName = username.getText().toString();<NEW_LINE>String unsanitizePass = password.getText().toString();<NEW_LINE>String sanitizeName = unsanitizeName.replace("OR", " ");<NEW_LINE>sanitizeName = sanitizeName.replace("or", " ");<NEW_LINE>sanitizeName = sanitizeName.replace("SELECT", " ");<NEW_LINE>sanitizeName = sanitizeName.replace("AND", " ");<NEW_LINE>sanitizeName = sanitizeName.replace("UPDATE", " ");<NEW_LINE>sanitizeName = sanitizeName.replace("DROP", " ");<NEW_LINE>sanitizeName = sanitizeName.replace("1=1", " ");<NEW_LINE>sanitizeName = sanitizeName.replace("1 = 1", " ");<NEW_LINE>String sanitizePass = unsanitizePass.replace("OR", " ");<NEW_LINE>sanitizePass = sanitizePass.replace("or", " ");<NEW_LINE>sanitizePass = sanitizePass.replace("SELECT", " ");<NEW_LINE>sanitizePass = sanitizePass.replace("AND", " ");<NEW_LINE>sanitizePass = sanitizePass.replace("UPDATE", " ");<NEW_LINE>sanitizePass = <MASK><NEW_LINE>sanitizePass = sanitizePass.replace("1=1", " ");<NEW_LINE>sanitizePass = sanitizePass.replace("1 = 1", " ");<NEW_LINE>try {<NEW_LINE>if (login(sanitizeName, sanitizePass) == true) {<NEW_LINE>outputKey(this, dbPassword);<NEW_LINE>Toast loggedin = Toast.makeText(CSInjection1.this, "Logged in!", Toast.LENGTH_LONG);<NEW_LINE>loggedin.show();<NEW_LINE>}<NEW_LINE>} catch (IOException e1) {<NEW_LINE>Toast error = Toast.makeText(CSInjection1.this, "An error occurred!", Toast.LENGTH_LONG);<NEW_LINE>error.show();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (login(sanitizeName, sanitizePass) == false) {<NEW_LINE>Toast invalid = Toast.makeText(CSInjection1.this, "Invalid Credentials, " + sanitizeName, Toast.LENGTH_LONG);<NEW_LINE>invalid.show();<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>// TODO Auto-generated catch block<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>if (sanitizeName.contentEquals("") || sanitizePass.contentEquals("")) {<NEW_LINE>Toast blank = Toast.makeText(CSInjection1.this, "Empty Fields Detected.", Toast.LENGTH_SHORT);<NEW_LINE>blank.show();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | sanitizePass.replace("DROP", " "); |
1,309,327 | public static void execWithErrorMessage(Project project, Action<ExecSpec> execSpecAction) {<NEW_LINE>List<String> <MASK><NEW_LINE>ByteArrayOutputStream output = new ByteArrayOutputStream();<NEW_LINE>ExecResult execResult = project.exec(execSpec -> {<NEW_LINE>execSpecAction.execute(execSpec);<NEW_LINE>execSpec.setIgnoreExitValue(true);<NEW_LINE>execSpec.setStandardOutput(new TeeOutputStream(System.out, output));<NEW_LINE>execSpec.setErrorOutput(new TeeOutputStream(System.err, output));<NEW_LINE>commandLine.addAll(execSpec.getCommandLine());<NEW_LINE>});<NEW_LINE>if (execResult.getExitValue() != 0) {<NEW_LINE>throw new GradleException(String.format("The command '%s' failed with exit code %d. Output:\n%s", commandLine, execResult.getExitValue(), new String(output.toByteArray(), StandardCharsets.UTF_8)));<NEW_LINE>}<NEW_LINE>} | commandLine = new ArrayList<>(); |
1,259,975 | public static void vertical11(Kernel1D_S32 kernel, GrayS32 src, GrayS32 dst, int divisor, @Nullable GrowArray<DogArray_I32> workspaces) {<NEW_LINE>final int[] dataSrc = src.data;<NEW_LINE>final int[] dataDst = dst.data;<NEW_LINE>final int k1 = kernel.data[0];<NEW_LINE>final int k2 = kernel.data[1];<NEW_LINE>final int k3 = kernel.data[2];<NEW_LINE>final int k4 = kernel.data[3];<NEW_LINE>final int <MASK><NEW_LINE>final int k6 = kernel.data[5];<NEW_LINE>final int k7 = kernel.data[6];<NEW_LINE>final int k8 = kernel.data[7];<NEW_LINE>final int k9 = kernel.data[8];<NEW_LINE>final int k10 = kernel.data[9];<NEW_LINE>final int k11 = kernel.data[10];<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final int imgWidth = dst.getWidth();<NEW_LINE>final int imgHeight = dst.getHeight();<NEW_LINE>final int halfDivisor = divisor / 2;<NEW_LINE>final int yEnd = imgHeight - radius;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(radius, yEnd, y -> {<NEW_LINE>for (int y = radius; y < yEnd; y++) {<NEW_LINE>int indexDst = dst.startIndex + y * dst.stride;<NEW_LINE>int i = src.startIndex + (y - radius) * src.stride;<NEW_LINE>final int iEnd = i + imgWidth;<NEW_LINE>for (; i < iEnd; i++) {<NEW_LINE>int indexSrc = i;<NEW_LINE>int total = (dataSrc[indexSrc]) * k1;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k2;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k3;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k4;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k5;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k6;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k7;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k8;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k9;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k10;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k11;<NEW_LINE>dataDst[indexDst++] = ((total + halfDivisor) / divisor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} | k5 = kernel.data[4]; |
389,885 | public boolean removeMessageDestination(WildflyMessageDestination destination) throws IOException {<NEW_LINE>try {<NEW_LINE>WildflyDeploymentFactory.WildFlyClassLoader cl = WildflyDeploymentFactory.getInstance().getWildFlyClassLoader(ip);<NEW_LINE>LinkedHashMap<Object, Object> values = new LinkedHashMap<>();<NEW_LINE>values.<MASK><NEW_LINE>values.put(getMessagingServerType(), "default");<NEW_LINE>if (destination.getType() == Type.QUEUE) {<NEW_LINE>values.put("jms-queue", destination.getName());<NEW_LINE>} else {<NEW_LINE>values.put("jms-topic", destination.getName());<NEW_LINE>}<NEW_LINE>Object address = createPathAddressAsModelNode(cl, values);<NEW_LINE>Object operation = createRemoveOperation(cl, address);<NEW_LINE>Object response = executeOnModelNode(cl, operation);<NEW_LINE>return (isSuccessfulOutcome(cl, response));<NEW_LINE>} catch (ClassNotFoundException | IllegalAccessException | NoSuchMethodException | InvocationTargetException ex) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | put(SUBSYSTEM, getMessagingSubsystem()); |
800,714 | private UnionDataSchema parseUnion(UnionDeclarationContext union, boolean withinTypref) throws ParseException {<NEW_LINE>UnionDataSchema schema = new UnionDataSchema();<NEW_LINE>List<UnionMemberDeclarationContext> members = union.typeParams.members;<NEW_LINE>List<UnionDataSchema.Member> unionMembers = new ArrayList<>(members.size());<NEW_LINE>for (UnionMemberDeclarationContext memberDecl : members) {<NEW_LINE>// Get union member type assignment<NEW_LINE>TypeAssignmentContext memberType = memberDecl.member;<NEW_LINE>DataSchema dataSchema = toDataSchema(memberType);<NEW_LINE>if (dataSchema != null) {<NEW_LINE>UnionDataSchema.Member unionMember = new UnionDataSchema.Member(dataSchema);<NEW_LINE>recordLocation(unionMember, memberDecl);<NEW_LINE>unionMember.setDeclaredInline(isDeclaredInline(memberDecl.member));<NEW_LINE>// Get union member alias, if any<NEW_LINE>UnionMemberAliasContext alias = memberDecl.unionMemberAlias();<NEW_LINE>if (alias != null) {<NEW_LINE>// Set union member alias<NEW_LINE>boolean isAliasValid = unionMember.setAlias(alias.name.value, startCalleeMessageBuilder());<NEW_LINE>if (!isAliasValid) {<NEW_LINE>appendCalleeMessage(unionMember);<NEW_LINE>}<NEW_LINE>// Set union member docs and properties<NEW_LINE>if (alias.doc != null) {<NEW_LINE>unionMember.<MASK><NEW_LINE>}<NEW_LINE>final Map<String, Object> properties = new HashMap<>();<NEW_LINE>for (PropDeclarationContext prop : alias.props) {<NEW_LINE>addPropertiesAtPath(properties, prop);<NEW_LINE>}<NEW_LINE>unionMember.setProperties(properties);<NEW_LINE>}<NEW_LINE>unionMembers.add(unionMember);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>schema.setMembers(unionMembers, errorMessageBuilder());<NEW_LINE>return schema;<NEW_LINE>} | setDoc(alias.doc.value); |
1,709,856 | private void refreshStatistics2DB(ZkCluster zkCluster) {<NEW_LINE>log.info("start refresh statistics by zkClusterKey:{}", zkCluster.getZkClusterKey());<NEW_LINE>Date start = new Date();<NEW_LINE>StatisticsModel statisticsModel = initStatisticsModel();<NEW_LINE>List<Callable<Boolean>> <MASK><NEW_LINE>try {<NEW_LINE>if (callableList != null && !callableList.isEmpty()) {<NEW_LINE>statExecutorService.invokeAll(callableList);<NEW_LINE>}<NEW_LINE>statisticsPersistence.persist(statisticsModel, zkCluster);<NEW_LINE>postRefreshStatistics2DB(statisticsModel, zkCluster);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>log.warn("the refreshStatistics2DB thread is interrupted", e);<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>}<NEW_LINE>log.info("end refresh statistics by zkClusterKey:{}, takes {}", zkCluster.getZkClusterKey(), new Date().getTime() - start.getTime());<NEW_LINE>} | callableList = getStatCallableList(zkCluster, statisticsModel); |
1,518,602 | public Table executionDisplay(@ShellOption(help = "the job execution id") long id) {<NEW_LINE>JobExecutionResource jobExecutionResource = jobOperations().jobExecution(id);<NEW_LINE>TableModelBuilder<Object> modelBuilder = new TableModelBuilder<>();<NEW_LINE>modelBuilder.addRow().addValue("Key ").addValue("Value ");<NEW_LINE>modelBuilder.addRow().addValue("Job Execution Id ").addValue(jobExecutionResource.getExecutionId());<NEW_LINE>modelBuilder.addRow().addValue("Task Execution Id ").<MASK><NEW_LINE>modelBuilder.addRow().addValue("Task Instance Id ").addValue(jobExecutionResource.getJobExecution().getJobInstance().getInstanceId());<NEW_LINE>modelBuilder.addRow().addValue("Job Name ").addValue(jobExecutionResource.getJobExecution().getJobInstance().getJobName());<NEW_LINE>modelBuilder.addRow().addValue("Create Time ").addValue(jobExecutionResource.getJobExecution().getCreateTime());<NEW_LINE>modelBuilder.addRow().addValue("Start Time ").addValue(jobExecutionResource.getJobExecution().getStartTime());<NEW_LINE>modelBuilder.addRow().addValue("End Time ").addValue(jobExecutionResource.getJobExecution().getEndTime());<NEW_LINE>modelBuilder.addRow().addValue("Running ").addValue(jobExecutionResource.getJobExecution().isRunning());<NEW_LINE>modelBuilder.addRow().addValue("Stopping ").addValue(jobExecutionResource.getJobExecution().isStopping());<NEW_LINE>modelBuilder.addRow().addValue("Step Execution Count ").addValue(jobExecutionResource.getJobExecution().getStepExecutions().size());<NEW_LINE>modelBuilder.addRow().addValue("Execution Status ").addValue(jobExecutionResource.getJobExecution().getStatus().name());<NEW_LINE>modelBuilder.addRow().addValue("Exit Status ").addValue(jobExecutionResource.getJobExecution().getExitStatus().getExitCode());<NEW_LINE>modelBuilder.addRow().addValue("Exit Message ").addValue(jobExecutionResource.getJobExecution().getExitStatus().getExitDescription());<NEW_LINE>modelBuilder.addRow().addValue("Definition Status ").addValue(jobExecutionResource.isDefined() ? "Created" : "Destroyed");<NEW_LINE>modelBuilder.addRow().addValue("Job Parameters ").addValue("");<NEW_LINE>for (Map.Entry<String, JobParameter> jobParameterEntry : jobExecutionResource.getJobExecution().getJobParameters().getParameters().entrySet()) {<NEW_LINE>String key = org.springframework.util.StringUtils.trimLeadingCharacter(jobParameterEntry.getKey(), '-');<NEW_LINE>if (!jobParameterEntry.getValue().isIdentifying()) {<NEW_LINE>key = "-" + key;<NEW_LINE>}<NEW_LINE>String updatedKey = String.format("%s(%s) ", key, jobParameterEntry.getValue().getType().name());<NEW_LINE>modelBuilder.addRow().addValue(updatedKey).addValue(new ArgumentSanitizer().sanitize(key, String.valueOf(jobParameterEntry.getValue())));<NEW_LINE>}<NEW_LINE>TableBuilder builder = new TableBuilder(modelBuilder.build());<NEW_LINE>DataFlowTables.applyStyle(builder);<NEW_LINE>return builder.build();<NEW_LINE>} | addValue(jobExecutionResource.getTaskExecutionId()); |
1,643,573 | public void marshall(SearchPlaceIndexForTextSummary searchPlaceIndexForTextSummary, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (searchPlaceIndexForTextSummary == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(searchPlaceIndexForTextSummary.getBiasPosition(), BIASPOSITION_BINDING);<NEW_LINE>protocolMarshaller.marshall(searchPlaceIndexForTextSummary.getDataSource(), DATASOURCE_BINDING);<NEW_LINE>protocolMarshaller.marshall(searchPlaceIndexForTextSummary.getFilterBBox(), FILTERBBOX_BINDING);<NEW_LINE>protocolMarshaller.marshall(searchPlaceIndexForTextSummary.getFilterCountries(), FILTERCOUNTRIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(searchPlaceIndexForTextSummary.getLanguage(), LANGUAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(searchPlaceIndexForTextSummary.getMaxResults(), MAXRESULTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(searchPlaceIndexForTextSummary.getResultBBox(), RESULTBBOX_BINDING);<NEW_LINE>protocolMarshaller.marshall(searchPlaceIndexForTextSummary.getText(), TEXT_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>} | e.getMessage(), e); |
334,295 | public synchronized void open() throws IOException {<NEW_LINE>HugeConfig config = this.config();<NEW_LINE>String hosts = config.get(HbaseOptions.HBASE_HOSTS);<NEW_LINE>int port = config.get(HbaseOptions.HBASE_PORT);<NEW_LINE>String znodeParent = config.get(HbaseOptions.HBASE_ZNODE_PARENT);<NEW_LINE>boolean isEnableKerberos = config.get(HbaseOptions.HBASE_KERBEROS_ENABLE);<NEW_LINE>Configuration hConfig = HBaseConfiguration.create();<NEW_LINE>hConfig.set(HConstants.ZOOKEEPER_QUORUM, hosts);<NEW_LINE>hConfig.set(HConstants.ZOOKEEPER_CLIENT_PORT, String.valueOf(port));<NEW_LINE>hConfig.set(HConstants.ZOOKEEPER_ZNODE_PARENT, znodeParent);<NEW_LINE>hConfig.setInt("zookeeper.recovery.retry", config.get(HbaseOptions.HBASE_ZK_RETRY));<NEW_LINE>// Set hbase.hconnection.threads.max 64 to avoid OOM(default value: 256)<NEW_LINE>hConfig.setInt("hbase.hconnection.threads.max", config.get(HbaseOptions.HBASE_THREADS_MAX));<NEW_LINE>String hbaseSite = config.get(HbaseOptions.HBASE_HBASE_SITE);<NEW_LINE>hConfig.addResource(new Path(hbaseSite));<NEW_LINE>if (isEnableKerberos) {<NEW_LINE>String krb5Conf = config.get(HbaseOptions.HBASE_KRB5_CONF);<NEW_LINE>System.setProperty("java.security.krb5.conf", krb5Conf);<NEW_LINE>String principal = config.get(HbaseOptions.HBASE_KERBEROS_PRINCIPAL);<NEW_LINE>String keyTab = <MASK><NEW_LINE>hConfig.set("hadoop.security.authentication", "kerberos");<NEW_LINE>hConfig.set("hbase.security.authentication", "kerberos");<NEW_LINE>// login/authenticate using keytab<NEW_LINE>UserGroupInformation.setConfiguration(hConfig);<NEW_LINE>UserGroupInformation.loginUserFromKeytab(principal, keyTab);<NEW_LINE>}<NEW_LINE>this.hbase = ConnectionFactory.createConnection(hConfig);<NEW_LINE>} | config.get(HbaseOptions.HBASE_KERBEROS_KEYTAB); |
1,798,021 | public static ListSkillGroupStatesResponse unmarshall(ListSkillGroupStatesResponse listSkillGroupStatesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listSkillGroupStatesResponse.setRequestId(_ctx.stringValue("ListSkillGroupStatesResponse.RequestId"));<NEW_LINE>listSkillGroupStatesResponse.setHttpStatusCode(_ctx.integerValue("ListSkillGroupStatesResponse.HttpStatusCode"));<NEW_LINE>listSkillGroupStatesResponse.setCode<MASK><NEW_LINE>listSkillGroupStatesResponse.setMessage(_ctx.stringValue("ListSkillGroupStatesResponse.Message"));<NEW_LINE>listSkillGroupStatesResponse.setSuccess(_ctx.booleanValue("ListSkillGroupStatesResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageNumber(_ctx.integerValue("ListSkillGroupStatesResponse.Data.PageNumber"));<NEW_LINE>data.setPageSize(_ctx.integerValue("ListSkillGroupStatesResponse.Data.PageSize"));<NEW_LINE>data.setTotalCount(_ctx.integerValue("ListSkillGroupStatesResponse.Data.TotalCount"));<NEW_LINE>List<RealTimeSkillGroupState> list = new ArrayList<RealTimeSkillGroupState>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListSkillGroupStatesResponse.Data.List.Length"); i++) {<NEW_LINE>RealTimeSkillGroupState realTimeSkillGroupState = new RealTimeSkillGroupState();<NEW_LINE>realTimeSkillGroupState.setWorkingAgents(_ctx.longValue("ListSkillGroupStatesResponse.Data.List[" + i + "].WorkingAgents"));<NEW_LINE>realTimeSkillGroupState.setLoggedInAgents(_ctx.longValue("ListSkillGroupStatesResponse.Data.List[" + i + "].LoggedInAgents"));<NEW_LINE>realTimeSkillGroupState.setBreakingAgents(_ctx.longValue("ListSkillGroupStatesResponse.Data.List[" + i + "].BreakingAgents"));<NEW_LINE>realTimeSkillGroupState.setLongestCall(_ctx.longValue("ListSkillGroupStatesResponse.Data.List[" + i + "].LongestCall"));<NEW_LINE>realTimeSkillGroupState.setWaitingCalls(_ctx.longValue("ListSkillGroupStatesResponse.Data.List[" + i + "].WaitingCalls"));<NEW_LINE>realTimeSkillGroupState.setTalkingAgents(_ctx.longValue("ListSkillGroupStatesResponse.Data.List[" + i + "].TalkingAgents"));<NEW_LINE>realTimeSkillGroupState.setSkillGroupName(_ctx.stringValue("ListSkillGroupStatesResponse.Data.List[" + i + "].SkillGroupName"));<NEW_LINE>realTimeSkillGroupState.setSkillGroupId(_ctx.stringValue("ListSkillGroupStatesResponse.Data.List[" + i + "].SkillGroupId"));<NEW_LINE>realTimeSkillGroupState.setReadyAgents(_ctx.longValue("ListSkillGroupStatesResponse.Data.List[" + i + "].ReadyAgents"));<NEW_LINE>realTimeSkillGroupState.setInstanceId(_ctx.stringValue("ListSkillGroupStatesResponse.Data.List[" + i + "].InstanceId"));<NEW_LINE>list.add(realTimeSkillGroupState);<NEW_LINE>}<NEW_LINE>data.setList(list);<NEW_LINE>listSkillGroupStatesResponse.setData(data);<NEW_LINE>return listSkillGroupStatesResponse;<NEW_LINE>} | (_ctx.stringValue("ListSkillGroupStatesResponse.Code")); |
933,097 | protected void configureGroup(ResourceGroup group, ResourceGroupSpec match) {<NEW_LINE>if (match.getSoftMemoryLimit().isPresent()) {<NEW_LINE>group.setSoftMemoryLimit(match.getSoftMemoryLimit().get());<NEW_LINE>} else {<NEW_LINE>synchronized (generalPoolMemoryFraction) {<NEW_LINE>double fraction = match.getSoftMemoryLimitFraction().get();<NEW_LINE>generalPoolMemoryFraction.put(group, fraction);<NEW_LINE>group.setSoftMemoryLimit(new DataSize(generalPoolBytes * fraction, BYTE));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>group.<MASK><NEW_LINE>group.setSoftConcurrencyLimit(match.getSoftConcurrencyLimit().orElse(match.getHardConcurrencyLimit()));<NEW_LINE>group.setHardConcurrencyLimit(match.getHardConcurrencyLimit());<NEW_LINE>group.setPerQueryLimits(match.getPerQueryLimits());<NEW_LINE>match.getSchedulingPolicy().ifPresent(group::setSchedulingPolicy);<NEW_LINE>match.getSchedulingWeight().ifPresent(group::setSchedulingWeight);<NEW_LINE>match.getJmxExport().filter(isEqual(group.getJmxExport()).negate()).ifPresent(group::setJmxExport);<NEW_LINE>match.getSoftCpuLimit().ifPresent(group::setSoftCpuLimit);<NEW_LINE>match.getHardCpuLimit().ifPresent(group::setHardCpuLimit);<NEW_LINE>if (match.getSoftCpuLimit().isPresent() || match.getHardCpuLimit().isPresent()) {<NEW_LINE>// This will never throw an exception if the validateRootGroups method succeeds<NEW_LINE>checkState(getCpuQuotaPeriod().isPresent(), "Must specify hard CPU limit in addition to soft limit");<NEW_LINE>Duration limit;<NEW_LINE>if (match.getHardCpuLimit().isPresent()) {<NEW_LINE>limit = match.getHardCpuLimit().get();<NEW_LINE>} else {<NEW_LINE>limit = match.getSoftCpuLimit().get();<NEW_LINE>}<NEW_LINE>long rate = (long) Math.min(1000.0 * limit.toMillis() / (double) getCpuQuotaPeriod().get().toMillis(), Long.MAX_VALUE);<NEW_LINE>rate = Math.max(1, rate);<NEW_LINE>group.setCpuQuotaGenerationMillisPerSecond(rate);<NEW_LINE>}<NEW_LINE>} | setMaxQueuedQueries(match.getMaxQueued()); |
890,856 | final Cluster executePauseCluster(PauseClusterRequest pauseClusterRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(pauseClusterRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PauseClusterRequest> request = null;<NEW_LINE>Response<Cluster> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PauseClusterRequestMarshaller().marshall(super.beforeMarshalling(pauseClusterRequest));<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, "Redshift");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PauseCluster");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<Cluster> responseHandler = new StaxResponseHandler<Cluster>(new ClusterStaxUnmarshaller());<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.ADVANCED_CONFIG, advancedConfig); |
1,814,793 | public void reverseDraftIssue(@NonNull final I_PP_Order_Qty candidate) {<NEW_LINE>if (candidate.isProcessed()) {<NEW_LINE>throw new HUException("Cannot reverse candidate because it's already processed: " + candidate);<NEW_LINE>}<NEW_LINE>final I_M_HU huToIssue = candidate.getM_HU();<NEW_LINE>final IContextAware <MASK><NEW_LINE>final IHUContext huContext = handlingUnitsBL.createMutableHUContext(contextProvider);<NEW_LINE>huStatusBL.setHUStatus(huContext, huToIssue, X_M_HU.HUSTATUS_Active);<NEW_LINE>handlingUnitsDAO.saveHU(huToIssue);<NEW_LINE>// Delete PP_Order_ProductAttributes for issue candidate's HU<NEW_LINE>ppOrderProductAttributeDAO.deleteForHU(candidate.getPP_Order_ID(), huToIssue.getM_HU_ID());<NEW_LINE>//<NEW_LINE>// Delete the candidate<NEW_LINE>huPPOrderQtyDAO.delete(candidate);<NEW_LINE>// Make sure the HU is marked as source<NEW_LINE>sourceHuService.addSourceHuMarker(HuId.ofRepoId(huToIssue.getM_HU_ID()));<NEW_LINE>} | contextProvider = InterfaceWrapperHelper.getContextAware(candidate); |
450,473 | public static WKTReader extract(String geometryLiteral) throws DatatypeFormatException {<NEW_LINE>WKTTextSRS wktTextSRS = new WKTTextSRS(geometryLiteral);<NEW_LINE>String srsURI = wktTextSRS.srsURI;<NEW_LINE>String wktText = wktTextSRS.wktText;<NEW_LINE>String goemetryType = "point";<NEW_LINE>String dimension = "";<NEW_LINE>String coordinates = "";<NEW_LINE>if (!wktText.equals("")) {<NEW_LINE>wktText = wktText.trim();<NEW_LINE>wktText = wktText.toLowerCase();<NEW_LINE>String[] parts = wktText.split("\\(", 2);<NEW_LINE>String remainder;<NEW_LINE>if (parts.length == 1) {<NEW_LINE>// Check for "empty" keyword and remove.<NEW_LINE>remainder = parts[0].replace("empty", "").trim();<NEW_LINE>} else {<NEW_LINE>int coordinatesStart = wktText.indexOf("(");<NEW_LINE>coordinates = wktText.substring(coordinatesStart);<NEW_LINE>remainder = parts[0].trim();<NEW_LINE>}<NEW_LINE>int firstSpace = remainder.indexOf(" ");<NEW_LINE>if (firstSpace != -1) {<NEW_LINE>goemetryType = remainder.substring(0, firstSpace);<NEW_LINE>dimension = remainder.substring(firstSpace + 1);<NEW_LINE>} else {<NEW_LINE>goemetryType = remainder;<NEW_LINE>// dimension = ""; //Dimension already set to empty, but kept as a reminder.<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new WKTReader(<MASK><NEW_LINE>} | goemetryType, dimension, coordinates, srsURI); |
463,122 | final StartSentimentDetectionJobResult executeStartSentimentDetectionJob(StartSentimentDetectionJobRequest startSentimentDetectionJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(startSentimentDetectionJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<StartSentimentDetectionJobRequest> request = null;<NEW_LINE>Response<StartSentimentDetectionJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StartSentimentDetectionJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(startSentimentDetectionJobRequest));<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, "Comprehend");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartSentimentDetectionJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StartSentimentDetectionJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartSentimentDetectionJobResultJsonUnmarshaller());<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.ClientExecuteTime); |
1,464,260 | public Object execute(VirtualFrame frame) {<NEW_LINE>JSDynamicObject functionObject = JSFrameUtil.getFunctionObject(frame);<NEW_LINE>ResolveElementArgs args = (ResolveElementArgs) getArgs.getValue(functionObject);<NEW_LINE>if (args.alreadyCalled) {<NEW_LINE>return Undefined.instance;<NEW_LINE>}<NEW_LINE>args.alreadyCalled = true;<NEW_LINE>Object <MASK><NEW_LINE>JSDynamicObject obj = objectCreateNode.execute(frame);<NEW_LINE>createStatusPropertyNode.executeVoid(obj, Strings.REJECTED);<NEW_LINE>createReasonPropertyNode.executeVoid(obj, value);<NEW_LINE>args.values.set(args.index, obj);<NEW_LINE>args.remainingElements.value--;<NEW_LINE>if (args.remainingElements.value == 0) {<NEW_LINE>JSDynamicObject valuesArray = JSArray.createConstantObjectArray(context, getRealm(), args.values.toArray());<NEW_LINE>return callResolve.executeCall(JSArguments.createOneArg(Undefined.instance, args.capability.getResolve(), valuesArray));<NEW_LINE>}<NEW_LINE>return Undefined.instance;<NEW_LINE>} | value = valueNode.execute(frame); |
983,741 | public void testGetString() throws Exception {<NEW_LINE>byte[] bytes = new byte[] { 0x41, 0x42, 0x43, 0x44, 0x00, 0x45, 0x46, 0x47 };<NEW_LINE>RandomAccessReader reader = createReader(bytes);<NEW_LINE>assertEquals("", reader.getString(0, 0, Charsets.UTF_8));<NEW_LINE>assertEquals("A", reader.getString(0, 1, Charsets.UTF_8));<NEW_LINE>assertEquals("AB", reader.getString(0, 2, Charsets.UTF_8));<NEW_LINE>assertEquals("ABC", reader.getString(0, 3, Charsets.UTF_8));<NEW_LINE>assertEquals("ABCD", reader.getString(0, 4, Charsets.UTF_8));<NEW_LINE>assertEquals("ABCD\0", reader.getString(0, 5, Charsets.UTF_8));<NEW_LINE>assertEquals("ABCD\0E", reader.getString(0, 6, Charsets.UTF_8));<NEW_LINE>assertEquals("BCD", reader.getString(1, 3, Charsets.UTF_8));<NEW_LINE>assertEquals("BCD\0", reader.getString(1, 4, Charsets.UTF_8));<NEW_LINE>assertEquals("BCD\0E", reader.getString(1<MASK><NEW_LINE>assertEquals("\0EF", reader.getString(4, 3, Charsets.UTF_8));<NEW_LINE>} | , 5, Charsets.UTF_8)); |
1,261,472 | public static void horizontal11(Kernel1D_S32 kernel, GrayS32 image, GrayS32 dest) {<NEW_LINE>final int[] dataSrc = image.data;<NEW_LINE>final int[] dataDst = dest.data;<NEW_LINE>final int k1 = kernel.data[0];<NEW_LINE>final int k2 = kernel.data[1];<NEW_LINE>final int k3 = kernel.data[2];<NEW_LINE>final int k4 = kernel.data[3];<NEW_LINE>final int k5 = kernel.data[4];<NEW_LINE>final int k6 = kernel.data[5];<NEW_LINE>final int k7 = kernel.data[6];<NEW_LINE>final int k8 = kernel.data[7];<NEW_LINE>final int k9 = kernel.data[8];<NEW_LINE>final int k10 = kernel.data[9];<NEW_LINE>final int k11 = kernel.data[10];<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final <MASK><NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, image.height, i -> {<NEW_LINE>for (int i = 0; i < image.height; i++) {<NEW_LINE>int indexDst = dest.startIndex + i * dest.stride + radius;<NEW_LINE>int j = image.startIndex + i * image.stride - radius;<NEW_LINE>final int jEnd = j + width - radius;<NEW_LINE>for (j += radius; j < jEnd; j++) {<NEW_LINE>int indexSrc = j;<NEW_LINE>int total = (dataSrc[indexSrc++]) * k1;<NEW_LINE>total += (dataSrc[indexSrc++]) * k2;<NEW_LINE>total += (dataSrc[indexSrc++]) * k3;<NEW_LINE>total += (dataSrc[indexSrc++]) * k4;<NEW_LINE>total += (dataSrc[indexSrc++]) * k5;<NEW_LINE>total += (dataSrc[indexSrc++]) * k6;<NEW_LINE>total += (dataSrc[indexSrc++]) * k7;<NEW_LINE>total += (dataSrc[indexSrc++]) * k8;<NEW_LINE>total += (dataSrc[indexSrc++]) * k9;<NEW_LINE>total += (dataSrc[indexSrc++]) * k10;<NEW_LINE>total += (dataSrc[indexSrc]) * k11;<NEW_LINE>dataDst[indexDst++] = total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} | int width = image.getWidth(); |
1,367,701 | public static GetMetaCategoryResponse unmarshall(GetMetaCategoryResponse getMetaCategoryResponse, UnmarshallerContext _ctx) {<NEW_LINE>getMetaCategoryResponse.setRequestId(_ctx.stringValue("GetMetaCategoryResponse.RequestId"));<NEW_LINE>getMetaCategoryResponse.setErrorCode(_ctx.stringValue("GetMetaCategoryResponse.ErrorCode"));<NEW_LINE>getMetaCategoryResponse.setErrorMessage(_ctx.stringValue("GetMetaCategoryResponse.ErrorMessage"));<NEW_LINE>getMetaCategoryResponse.setHttpStatusCode(_ctx.integerValue("GetMetaCategoryResponse.HttpStatusCode"));<NEW_LINE>getMetaCategoryResponse.setSuccess(_ctx.booleanValue("GetMetaCategoryResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageNum(_ctx.integerValue("GetMetaCategoryResponse.Data.PageNum"));<NEW_LINE>data.setPageSize(_ctx.integerValue("GetMetaCategoryResponse.Data.PageSize"));<NEW_LINE>data.setTotalCount(_ctx.longValue("GetMetaCategoryResponse.Data.TotalCount"));<NEW_LINE>List<DataEntityListItem> dataEntityList = new ArrayList<DataEntityListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetMetaCategoryResponse.Data.DataEntityList.Length"); i++) {<NEW_LINE>DataEntityListItem dataEntityListItem = new DataEntityListItem();<NEW_LINE>dataEntityListItem.setCategoryId(_ctx.longValue("GetMetaCategoryResponse.Data.DataEntityList[" + i + "].CategoryId"));<NEW_LINE>dataEntityListItem.setName(_ctx.stringValue("GetMetaCategoryResponse.Data.DataEntityList[" + i + "].Name"));<NEW_LINE>dataEntityListItem.setCreateTime(_ctx.longValue("GetMetaCategoryResponse.Data.DataEntityList[" + i + "].CreateTime"));<NEW_LINE>dataEntityListItem.setModifiedTime(_ctx.longValue("GetMetaCategoryResponse.Data.DataEntityList[" + i + "].ModifiedTime"));<NEW_LINE>dataEntityListItem.setComment(_ctx.stringValue("GetMetaCategoryResponse.Data.DataEntityList[" + i + "].Comment"));<NEW_LINE>dataEntityListItem.setOwnerId(_ctx.stringValue("GetMetaCategoryResponse.Data.DataEntityList[" + i + "].OwnerId"));<NEW_LINE>dataEntityListItem.setLastOperatorId(_ctx.stringValue("GetMetaCategoryResponse.Data.DataEntityList[" + i + "].LastOperatorId"));<NEW_LINE>dataEntityListItem.setParentCategoryId(_ctx.longValue<MASK><NEW_LINE>dataEntityListItem.setDepth(_ctx.integerValue("GetMetaCategoryResponse.Data.DataEntityList[" + i + "].Depth"));<NEW_LINE>dataEntityList.add(dataEntityListItem);<NEW_LINE>}<NEW_LINE>data.setDataEntityList(dataEntityList);<NEW_LINE>getMetaCategoryResponse.setData(data);<NEW_LINE>return getMetaCategoryResponse;<NEW_LINE>} | ("GetMetaCategoryResponse.Data.DataEntityList[" + i + "].ParentCategoryId")); |
11,009 | private String base64Encode(String userInfo) {<NEW_LINE>ClassLoader loader = getClass().getClassLoader();<NEW_LINE>try {<NEW_LINE>Method getEncoderMethod = loader.loadClass<MASK><NEW_LINE>Method encodeMethod = loader.loadClass("java.util.Base64$Encoder").getMethod("encodeToString", byte[].class);<NEW_LINE>Object encoder = getEncoderMethod.invoke(null);<NEW_LINE>return (String) encodeMethod.invoke(encoder, new Object[] { userInfo.getBytes("UTF-8") });<NEW_LINE>} catch (Exception java7OrEarlier) {<NEW_LINE>try {<NEW_LINE>Method encodeMethod = loader.loadClass("javax.xml.bind.DatatypeConverter").getMethod("printBase64Binary", byte[].class);<NEW_LINE>return (String) encodeMethod.invoke(null, new Object[] { userInfo.getBytes("UTF-8") });<NEW_LINE>} catch (Exception java5OrEarlier) {<NEW_LINE>throw new RuntimeException("Downloading Gradle distributions with HTTP Basic Authentication is not supported on your JVM.", java5OrEarlier);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ("java.util.Base64").getMethod("getEncoder"); |
1,334,966 | public static <L, T1, T2, T3, T4, T5, T6, T7> For7Either<L, T1, T2, T3, T4, T5, T6, T7> For(Either<L, T1> ts1, Either<L, T2> ts2, Either<L, T3> ts3, Either<L, T4> ts4, Either<L, T5> ts5, Either<L, T6> ts6, Either<L, T7> ts7) {<NEW_LINE>Objects.requireNonNull(ts1, "ts1 is null");<NEW_LINE>Objects.requireNonNull(ts2, "ts2 is null");<NEW_LINE>Objects.requireNonNull(ts3, "ts3 is null");<NEW_LINE>Objects.requireNonNull(ts4, "ts4 is null");<NEW_LINE>Objects.requireNonNull(ts5, "ts5 is null");<NEW_LINE>Objects.requireNonNull(ts6, "ts6 is null");<NEW_LINE><MASK><NEW_LINE>return new For7Either<>(ts1, ts2, ts3, ts4, ts5, ts6, ts7);<NEW_LINE>} | Objects.requireNonNull(ts7, "ts7 is null"); |
1,335,868 | public int compare(final RuleViolation r1, final RuleViolation r2) {<NEW_LINE>int cmp = r1.getFilename().compareTo(r2.getFilename());<NEW_LINE>if (cmp == 0) {<NEW_LINE>cmp = r1.getBeginLine<MASK><NEW_LINE>if (cmp == 0) {<NEW_LINE>cmp = compare(r1.getDescription(), r2.getDescription());<NEW_LINE>if (cmp == 0) {<NEW_LINE>cmp = r1.getBeginColumn() - r2.getBeginColumn();<NEW_LINE>if (cmp == 0) {<NEW_LINE>cmp = r1.getEndLine() - r2.getEndLine();<NEW_LINE>if (cmp == 0) {<NEW_LINE>cmp = r1.getEndColumn() - r2.getEndColumn();<NEW_LINE>if (cmp == 0) {<NEW_LINE>cmp = r1.getRule().getName().compareTo(r2.getRule().getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return cmp;<NEW_LINE>} | () - r2.getBeginLine(); |
126,765 | public static // d632906<NEW_LINE>// d632906<NEW_LINE>ScheduleExpression // d632906<NEW_LINE>copyBase(ScheduleExpression schedule) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "copy copyBase: " + Util.identity(schedule));<NEW_LINE>// 'schedule' could be a subclass of ScheduleExpression.<NEW_LINE>// Use only the base class constructor.<NEW_LINE>return new ScheduleExpression().start(schedule.getStart() == null ? null : new Date(schedule.getStart().getTime())).end(schedule.getEnd() == null ? null : new Date(schedule.getEnd().getTime())).timezone(schedule.getTimezone()).second(schedule.getSecond()).minute(schedule.getMinute()).hour(schedule.getHour()).dayOfMonth(schedule.getDayOfMonth()).dayOfWeek(schedule.getDayOfWeek()).month(schedule.getMonth()).<MASK><NEW_LINE>} | year(schedule.getYear()); |
747,706 | protected void loadFromStreamToKit(StyledDocument doc, InputStream stream, EditorKit kit) throws IOException, BadLocationException {<NEW_LINE>if (guardedEditor == null) {<NEW_LINE>guardedEditor = new BIGES();<NEW_LINE>GuardedSectionsFactory gFactory = GuardedSectionsFactory.find(((DataEditorSupport.Env) env).getMimeType());<NEW_LINE>if (gFactory != null) {<NEW_LINE>guardedProvider = gFactory.create(guardedEditor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (guardedProvider != null) {<NEW_LINE>guardedEditor.doc = doc;<NEW_LINE>Charset c = FileEncodingQuery.getEncoding(this.getDataObject().getPrimaryFile());<NEW_LINE>Reader reader = guardedProvider.createGuardedReader(stream, c);<NEW_LINE>try {<NEW_LINE>kit.read(reader, doc, 0);<NEW_LINE>} finally {<NEW_LINE>reader.close();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>super.<MASK><NEW_LINE>}<NEW_LINE>} | loadFromStreamToKit(doc, stream, kit); |
407,245 | public static String usage() {<NEW_LINE>StringWriter sb = new StringWriter();<NEW_LINE>PrintWriter out = new PrintWriter(sb);<NEW_LINE>out.println("Usage: " + CMD + " config initial-token --server SERVER --realm REALM [--delete | TOKEN] [ARGUMENTS]");<NEW_LINE>out.println();<NEW_LINE>out.println("Command to configure an initial access token to be used with '" + CMD + " create' command. Even if an ");<NEW_LINE>out.println("authenticated session exists as a result of '" + CMD + " config credentials' its access token will not");<NEW_LINE>out.println("be used - initial access token will be used instead. By default, current server, and realm will");<NEW_LINE>out.println("be set to the new values thus subsequent commands will use these values as default.");<NEW_LINE>out.println();<NEW_LINE>out.println("Arguments:");<NEW_LINE>out.println();<NEW_LINE>out.println(" Global options:");<NEW_LINE>out.println(" -x Print full stack trace when exiting with error");<NEW_LINE>out.println(" --config Path to the config file (" + DEFAULT_CONFIG_FILE_STRING + " by default)");<NEW_LINE>out.println();<NEW_LINE>out.println(" Command specific options:");<NEW_LINE>out.println(" --server SERVER Server endpoint url (e.g. 'http://localhost:8080/auth')");<NEW_LINE>out.println(" --realm REALM Realm name to use");<NEW_LINE>out.println(" -k, --keep-domain Don't overwrite default server and realm");<NEW_LINE>out.println(" -d, --delete Indicates that initial access token should be removed");<NEW_LINE>out.println(" TOKEN Initial access token (prompted for if not specified, unless -d is used)");<NEW_LINE>out.println();<NEW_LINE>out.println();<NEW_LINE>out.println("Examples:");<NEW_LINE>out.println();<NEW_LINE>out.println("Specify initial access token for server, and realm. Token is passed via env variable:");<NEW_LINE>out.println(" " + PROMPT + " " + CMD + " config initial-token --server http://localhost:9080/auth --realm master " <MASK><NEW_LINE>out.println();<NEW_LINE>out.println("Remove initial access token:");<NEW_LINE>out.println(" " + PROMPT + " " + CMD + " config initial-token --server http://localhost:9080/auth --realm master --delete");<NEW_LINE>out.println();<NEW_LINE>out.println();<NEW_LINE>out.println("Use '" + CMD + " help' for general information and a list of commands");<NEW_LINE>return sb.toString();<NEW_LINE>} | + OS_ARCH.envVar("TOKEN")); |
383,501 | protected void layoutGrid(PrintElementIndex parentElementIndex, List<JRPrintElement> elements) {<NEW_LINE>boolean createXCuts = (xCuts == null);<NEW_LINE>xCuts = createXCuts ? new CutsInfo() : xCuts;<NEW_LINE>yCuts = nature.isIgnoreLastRow() ? new CutsInfo(0) : new CutsInfo(height);<NEW_LINE>if (// FIXMEXLS left and right margins are not ignored when all pages on a single sheet<NEW_LINE>!isNested && nature.isIgnorePageMargins()) {<NEW_LINE>// TODO lucianc this is an extra virtualization iteration<NEW_LINE>setMargins(elements);<NEW_LINE>if (createXCuts) {<NEW_LINE>if (hasLeftMargin) {<NEW_LINE>xCuts.removeCutOffset(0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hasTopMargin) {<NEW_LINE>yCuts.removeCutOffset(0);<NEW_LINE>}<NEW_LINE>if (hasBottomMargin) {<NEW_LINE>yCuts.removeCutOffset(height);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>createCuts(elements, offsetX, offsetY, createXCuts);<NEW_LINE>// add a cut at the width if it's a nested grid, or if the right margin<NEW_LINE>// is not to be removed and no element goes beyond the width<NEW_LINE>if (createXCuts && (isNested || (!(nature.isIgnorePageMargins() && hasRightMargin) && !(xCuts.hasCuts() && xCuts.getLastCutOffset() >= width)))) {<NEW_LINE>xCuts.addCutOffset(width);<NEW_LINE>}<NEW_LINE>xCuts.use();<NEW_LINE>yCuts.use();<NEW_LINE>int colCount = Math.max(xCuts.size() - 1, 0);<NEW_LINE>int rowCount = Math.max(yCuts.size() - 1, 0);<NEW_LINE>grid <MASK><NEW_LINE>for (int row = 0; row < rowCount; row++) {<NEW_LINE>for (int col = 0; col < colCount; col++) {<NEW_LINE>GridCellSize size = cellSize(xCuts.getCutOffset(col + 1) - xCuts.getCutOffset(col), yCuts.getCutOffset(row + 1) - yCuts.getCutOffset(row), 1, 1);<NEW_LINE>grid.set(row, col, emptyCell(size, null));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setGridElements(parentElementIndex, elements, offsetX, offsetY, 0, 0, rowCount, colCount);<NEW_LINE>width = xCuts.getTotalLength();<NEW_LINE>height = yCuts.getTotalLength();<NEW_LINE>} | = new Grid(rowCount, colCount); |
1,493,780 | protected void initializeHistogramsAndCachedValues() {<NEW_LINE>int maxTokens = 0;<NEW_LINE>int totalTokens = 0;<NEW_LINE>int seqLen;<NEW_LINE>for (int doc = 0; doc < data.size(); doc++) {<NEW_LINE>FeatureSequence fs = (FeatureSequence) data.get(doc).instance.getData();<NEW_LINE>seqLen = fs.getLength();<NEW_LINE>if (seqLen > maxTokens)<NEW_LINE>maxTokens = seqLen;<NEW_LINE>totalTokens += seqLen;<NEW_LINE>}<NEW_LINE>// Initialize the smoothing-only sampling bucket<NEW_LINE>smoothingOnlyMass = 0;<NEW_LINE>for (int topic = 0; topic < numTopics; topic++) smoothingOnlyMass += alpha[topic] * beta / (tokensPerTopic[topic] + betaSum);<NEW_LINE>// Initialize the cached coefficients, using only smoothing.<NEW_LINE>cachedCoefficients = new double[numTopics];<NEW_LINE>for (int topic = 0; topic < numTopics; topic++) cachedCoefficients[topic] = alpha[topic] / (tokensPerTopic[topic] + betaSum);<NEW_LINE>System.err.println("max tokens: " + maxTokens);<NEW_LINE>System.err.println("total tokens: " + totalTokens);<NEW_LINE>docLengthCounts = new int[maxTokens + 1];<NEW_LINE>topicDocCounts = new int<MASK><NEW_LINE>} | [numTopics][maxTokens + 1]; |
361,146 | public final Logic_factorContext logic_factor() throws RecognitionException {<NEW_LINE>Logic_factorContext _localctx = new <MASK><NEW_LINE>enterRule(_localctx, 18, RULE_logic_factor);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(147);<NEW_LINE>_localctx.arithmetic = arithmetic();<NEW_LINE>_localctx.result = _localctx.arithmetic.result;<NEW_LINE>setState(153);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>switch(getInterpreter().adaptivePredict(_input, 9, _ctx)) {<NEW_LINE>case 1:<NEW_LINE>{<NEW_LINE>setState(149);<NEW_LINE>_localctx.op = _input.LT(1);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (!((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__16) | (1L << T__17) | (1L << T__18) | (1L << T__19) | (1L << T__20) | (1L << T__21))) != 0))) {<NEW_LINE>_localctx.op = _errHandler.recoverInline(this);<NEW_LINE>} else {<NEW_LINE>if (_input.LA(1) == Token.EOF)<NEW_LINE>matchedEOF = true;<NEW_LINE>_errHandler.reportMatch(this);<NEW_LINE>consume();<NEW_LINE>}<NEW_LINE>setState(150);<NEW_LINE>_localctx.arithmetic = arithmetic();<NEW_LINE>_localctx.result = factory.createBinary(_localctx.op, _localctx.result, _localctx.arithmetic.result);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>} | Logic_factorContext(_ctx, getState()); |
1,332,779 | public void onLoadFinished(Loader<QueryDeparturesResult> loader, @Nullable QueryDeparturesResult departures) {<NEW_LINE>if (departures != null && departures.status == OK && departures.stationDepartures.size() > 0) {<NEW_LINE>for (StationDepartures s : departures.stationDepartures) {<NEW_LINE>adapter.addAll(s.departures);<NEW_LINE>}<NEW_LINE>if (searchState == SearchState.INITIAL) {<NEW_LINE>LceAnimator.showContent(progressBar, list, errorLayout);<NEW_LINE>} else {<NEW_LINE>// scroll smoothly up or down when we have new trips<NEW_LINE>list.smoothScrollBy(0, searchState == SearchState.BOTTOM ? 150 : -150);<NEW_LINE>}<NEW_LINE>swipe.setEnabled(true);<NEW_LINE>} else {<NEW_LINE>int errorMsg = R.string.error_departures;<NEW_LINE>if (!TransportrUtils.hasInternet(this)) {<NEW_LINE>errorMsg = R.string.error_no_internet;<NEW_LINE>}<NEW_LINE>if (searchState == SearchState.INITIAL) {<NEW_LINE>errorText.setText(errorMsg);<NEW_LINE>LceAnimator.<MASK><NEW_LINE>swipe.setEnabled(false);<NEW_LINE>} else {<NEW_LINE>Toast.makeText(this, errorMsg, Toast.LENGTH_SHORT).show();<NEW_LINE>swipe.setEnabled(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>swipe.setRefreshing(false);<NEW_LINE>} | showErrorView(progressBar, list, errorLayout); |
940,707 | public void onActivityResult(final JavaFileStorage.FileStorageSetupActivity setupAct, int requestCode, int resultCode, Intent data) {<NEW_LINE>logDebug("ActivityResult: " + requestCode + "/" + resultCode);<NEW_LINE>switch(requestCode) {<NEW_LINE>case REQUEST_SIGN_IN:<NEW_LINE>Activity activity = (Activity) setupAct;<NEW_LINE>Task<GoogleSignInAccount> completedTask = GoogleSignIn.getSignedInAccountFromIntent(data);<NEW_LINE>Log.d(TAG, "handleSignInResult:" + completedTask.isSuccessful());<NEW_LINE>try {<NEW_LINE>// Signed in successfully<NEW_LINE>GoogleSignInAccount account = completedTask.getResult(ApiException.class);<NEW_LINE>if (GoogleSignIn.hasPermissions(account, getScope())) {<NEW_LINE>initializeAccountOrPath(setupAct, account.getAccount().name);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (ApiException e) {<NEW_LINE>// Signed out, show unauthenticated UI.<NEW_LINE>Log.w(TAG, "handleSignInResult:error", e);<NEW_LINE>}<NEW_LINE>((Activity) setupAct).setResult(Activity.RESULT_CANCELED, data);<NEW_LINE>((<MASK><NEW_LINE>break;<NEW_LINE>case REQUEST_ACCOUNT_PICKER:<NEW_LINE>logDebug("ActivityResult: REQUEST_ACCOUNT_PICKER");<NEW_LINE>if (resultCode == Activity.RESULT_OK && data != null && data.getExtras() != null) {<NEW_LINE>String accountName = data.getStringExtra(AccountManager.KEY_ACCOUNT_NAME);<NEW_LINE>if (accountName != null) {<NEW_LINE>logDebug("Initialize Account name=" + accountName);<NEW_LINE>initializeAccountOrPath(setupAct, accountName);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logDebug("Error selecting account");<NEW_LINE>// Intent retData = new Intent();<NEW_LINE>// retData.putExtra(EXTRA_ERROR_MESSAGE, t.getMessage());<NEW_LINE>((Activity) setupAct).setResult(Activity.RESULT_CANCELED, data);<NEW_LINE>((Activity) setupAct).finish();<NEW_LINE>case REQUEST_AUTHORIZATION:<NEW_LINE>if (resultCode == Activity.RESULT_OK) {<NEW_LINE>// for (String k: data.getExtras().keySet())<NEW_LINE>// {<NEW_LINE>// logDebug(data.getExtras().get(k).toString());<NEW_LINE>// }<NEW_LINE>String accountName = data.getStringExtra(AccountManager.KEY_ACCOUNT_NAME);<NEW_LINE>if (accountName != null) {<NEW_LINE>logDebug("Account name=" + accountName);<NEW_LINE>initializeAccountOrPath(setupAct, accountName);<NEW_LINE>} else {<NEW_LINE>logDebug("Account name is null");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logDebug("Error authenticating");<NEW_LINE>// Intent retData = new Intent();<NEW_LINE>// retData.putExtra(EXTRA_ERROR_MESSAGE, t.getMessage());<NEW_LINE>((Activity) setupAct).setResult(Activity.RESULT_CANCELED, data);<NEW_LINE>((Activity) setupAct).finish();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Activity) setupAct).finish(); |
633,637 | public static List<CachableRenderStatement> computeFluidOutlineToCache(@Nonnull CollidableComponent component, @Nonnull Fluid fluid, double scaleFactor, float outlineWidth) {<NEW_LINE>Map<Fluid, List<CachableRenderStatement>> cache0 = cache.get(component);<NEW_LINE>if (cache0 == null) {<NEW_LINE>cache0 = new HashMap<Fluid, List<CachableRenderStatement>>();<NEW_LINE>cache.put(component, cache0);<NEW_LINE>}<NEW_LINE>List<CachableRenderStatement> data = cache0.get(fluid);<NEW_LINE>if (data != null) {<NEW_LINE>return data;<NEW_LINE>}<NEW_LINE>data = new ArrayList<CachableRenderStatement>();<NEW_LINE>cache0.put(fluid, data);<NEW_LINE>TextureAtlasSprite texture = RenderUtil.getStillTexture(fluid);<NEW_LINE>int color = fluid.getColor();<NEW_LINE>Vector4f colorv = new Vector4f((color >> 16 & 0xFF) / 255d, (color >> 8 & 0xFF) / 255d, (color & 0xFF) / 255d, 1);<NEW_LINE>BoundingBox bbb;<NEW_LINE>double width = outlineWidth;<NEW_LINE>scaleFactor = scaleFactor - 0.05;<NEW_LINE>final EnumFacing componentDirection = component.getDirection();<NEW_LINE>double xScale = Math.abs(componentDirection.getFrontOffsetX()) == 1 ? width : scaleFactor;<NEW_LINE>double yScale = Math.abs(componentDirection.getFrontOffsetY(<MASK><NEW_LINE>double zScale = Math.abs(componentDirection.getFrontOffsetZ()) == 1 ? width : scaleFactor;<NEW_LINE>double offSize = (0.5 - width) / 2 - width / 2;<NEW_LINE>double xOff = componentDirection.getFrontOffsetX() * offSize;<NEW_LINE>double yOff = componentDirection.getFrontOffsetY() * offSize;<NEW_LINE>double zOff = componentDirection.getFrontOffsetZ() * offSize;<NEW_LINE>bbb = component.bound.scale(xScale, yScale, zScale);<NEW_LINE>bbb = bbb.translate(new Vector3d(xOff, yOff, zOff));<NEW_LINE>for (NNIterator<EnumFacing> itr = NNList.FACING.fastIterator(); itr.hasNext(); ) {<NEW_LINE>EnumFacing face = itr.next();<NEW_LINE>if (face != componentDirection && face != componentDirection.getOpposite()) {<NEW_LINE>List<Vertex> corners = bbb.getCornersWithUvForFace(face, texture.getMinU(), texture.getMaxU(), texture.getMinV(), texture.getMaxV());<NEW_LINE>for (Vertex corner : corners) {<NEW_LINE>data.add(new CachableRenderStatement.AddVertexWithUV(corner.x(), corner.y(), corner.z(), corner.uv.x, corner.uv.y, colorv));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return data;<NEW_LINE>} | )) == 1 ? width : scaleFactor; |
1,731,915 | public IdToken create(ClientDetails clientDetails, UaaUser uaaUser, UserAuthenticationData userAuthenticationData) throws IdTokenCreationException {<NEW_LINE>Date expiryDate = tokenValidityResolver.resolve(clientDetails.getClientId());<NEW_LINE><MASK><NEW_LINE>String givenName = getIfScopeContainsProfile(uaaUser.getGivenName(), userAuthenticationData.scopes);<NEW_LINE>String familyName = getIfScopeContainsProfile(uaaUser.getFamilyName(), userAuthenticationData.scopes);<NEW_LINE>String phoneNumber = getIfScopeContainsProfile(uaaUser.getPhoneNumber(), userAuthenticationData.scopes);<NEW_LINE>String issuerUrl = tokenEndpointBuilder.getTokenEndpoint(identityZoneManager.getCurrentIdentityZone());<NEW_LINE>String identityZoneId = identityZoneManager.getCurrentIdentityZoneId();<NEW_LINE>Map<String, List<String>> userAttributes = buildUserAttributes(userAuthenticationData, uaaUser);<NEW_LINE>Set<String> roles = buildRoles(userAuthenticationData, uaaUser);<NEW_LINE>String clientTokenSalt = (String) clientDetails.getAdditionalInformation().get(ClientConstants.TOKEN_SALT);<NEW_LINE>String revSig = getRevocableTokenSignature(uaaUser, clientTokenSalt, clientDetails.getClientId(), clientDetails.getClientSecret());<NEW_LINE>return new IdToken(getIfNotExcluded(uaaUser.getId(), USER_ID), getIfNotExcluded(newArrayList(clientDetails.getClientId()), AUD), getIfNotExcluded(issuerUrl, ISS), getIfNotExcluded(expiryDate, EXPIRY_IN_SECONDS), getIfNotExcluded(issuedAt, IAT), getIfNotExcluded(userAuthenticationData.authTime, AUTH_TIME), getIfNotExcluded(userAuthenticationData.authenticationMethods, AMR), getIfNotExcluded(userAuthenticationData.contextClassRef, ACR), getIfNotExcluded(clientDetails.getClientId(), AZP), getIfNotExcluded(givenName, GIVEN_NAME), getIfNotExcluded(familyName, FAMILY_NAME), getIfNotExcluded(uaaUser.getPreviousLogonTime(), PREVIOUS_LOGON_TIME), getIfNotExcluded(phoneNumber, PHONE_NUMBER), getIfNotExcluded(roles, ROLES), getIfNotExcluded(userAttributes, USER_ATTRIBUTES), getIfNotExcluded(uaaUser.isVerified(), EMAIL_VERIFIED), getIfNotExcluded(userAuthenticationData.nonce, NONCE), getIfNotExcluded(uaaUser.getEmail(), EMAIL), getIfNotExcluded(clientDetails.getClientId(), CID), getIfNotExcluded(userAuthenticationData.grantType, GRANT_TYPE), getIfNotExcluded(uaaUser.getUsername(), USER_NAME), getIfNotExcluded(identityZoneId, ZONE_ID), getIfNotExcluded(uaaUser.getOrigin(), ORIGIN), getIfNotExcluded(userAuthenticationData.jti, JTI), getIfNotExcluded(revSig, REVOCATION_SIGNATURE));<NEW_LINE>} | Date issuedAt = timeService.getCurrentDate(); |
1,046,611 | public CreateDirectConnectGatewayAssociationResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateDirectConnectGatewayAssociationResult createDirectConnectGatewayAssociationResult = new CreateDirectConnectGatewayAssociationResult();<NEW_LINE><MASK><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 createDirectConnectGatewayAssociationResult;<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("directConnectGatewayAssociation", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createDirectConnectGatewayAssociationResult.setDirectConnectGatewayAssociation(DirectConnectGatewayAssociationJsonUnmarshaller.getInstance().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 createDirectConnectGatewayAssociationResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
920,783 | public Dialog createDialog(Activity activity, Bundle args) {<NEW_LINE>AlertDialog.Builder builder = new AlertDialog.Builder(mapActivity);<NEW_LINE>builder.setTitle(R.string.gps_status);<NEW_LINE>LinearLayout ll = new LinearLayout(activity);<NEW_LINE>final ListView lv = new ListView(activity);<NEW_LINE>final int dp24 = AndroidUtils.dpToPx(mapActivity, 24f);<NEW_LINE>final int dp12 = AndroidUtils.dpToPx(mapActivity, 12f);<NEW_LINE>final int dp8 = AndroidUtils.dpToPx(mapActivity, 8f);<NEW_LINE>lv.setPadding(0, dp8, 0, dp8);<NEW_LINE>final AppCompatCheckBox cb = new AppCompatCheckBox(activity);<NEW_LINE>cb.setText(R.string.shared_string_remember_my_choice);<NEW_LINE>LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);<NEW_LINE>AndroidUtils.setMargins(lp, dp24, dp8, dp8, dp24);<NEW_LINE>cb.setLayoutParams(lp);<NEW_LINE>cb.setPadding(dp8, 0, 0, 0);<NEW_LINE>int textColorPrimary = ColorUtilities.getPrimaryTextColor(activity, isNightMode());<NEW_LINE>int selectedModeColor = getSettings().getApplicationMode().getProfileColor(isNightMode());<NEW_LINE>cb.setTextColor(textColorPrimary);<NEW_LINE>UiUtilities.setupCompoundButton(isNightMode(), selectedModeColor, cb);<NEW_LINE>final int layout = R.layout.list_menu_item_native;<NEW_LINE>final ArrayAdapter<GpsStatusApps> adapter = new ArrayAdapter<GpsStatusApps>(mapActivity, layout, GpsStatusApps.values()) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public View getView(int position, View convertView, ViewGroup parent) {<NEW_LINE>View v = mapActivity.getLayoutInflater().inflate(layout, null);<NEW_LINE>TextView tv = (TextView) v.findViewById(R.id.title);<NEW_LINE>tv.setPadding(dp12, 0, dp24, 0);<NEW_LINE>tv.setText(getItem(position).stringRes);<NEW_LINE>v.findViewById(R.id.toggle_item).setVisibility(View.INVISIBLE);<NEW_LINE>return v;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>lv.setAdapter(adapter);<NEW_LINE>ll.setOrientation(LinearLayout.VERTICAL);<NEW_LINE>ll.addView(lv);<NEW_LINE>ll.addView(cb);<NEW_LINE>final <MASK><NEW_LINE>lv.setOnItemClickListener(new OnItemClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onItemClick(AdapterView<?> parent, View view, int position, long id) {<NEW_LINE>boolean remember = cb.isChecked();<NEW_LINE>GpsStatusApps item = adapter.getItem(position);<NEW_LINE>if (remember) {<NEW_LINE>getSettings().GPS_STATUS_APP.set(item.appName);<NEW_LINE>}<NEW_LINE>dlg.dismiss();<NEW_LINE>runChosenGPSStatus(item);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>dlg.setView(ll);<NEW_LINE>return dlg;<NEW_LINE>} | AlertDialog dlg = builder.create(); |
1,411,615 | public static synchronized PhysicalPlan convertFromString(String str) {<NEW_LINE>String[] <MASK><NEW_LINE>switch(words[0]) {<NEW_LINE>case "2":<NEW_LINE>return new MeasurementMNodePlan(words[1], "".equals(words[2]) ? null : words[2], Long.parseLong(words[words.length - 2]), Integer.parseInt(words[words.length - 1]), new MeasurementSchema(words[1], TSDataType.values()[Integer.parseInt(words[3])], TSEncoding.values()[Integer.parseInt(words[4])], CompressionType.values()[Integer.parseInt(words[5])]));<NEW_LINE>case "1":<NEW_LINE>return new StorageGroupMNodePlan(words[1], Long.parseLong(words[2]), Integer.parseInt(words[3]));<NEW_LINE>case "0":<NEW_LINE>return new MNodePlan(words[1], Integer.parseInt(words[2]));<NEW_LINE>default:<NEW_LINE>logger.error("unknown cmd {}", str);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | words = str.split(","); |
548,795 | final ListAnomalyGroupSummariesResult executeListAnomalyGroupSummaries(ListAnomalyGroupSummariesRequest listAnomalyGroupSummariesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listAnomalyGroupSummariesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListAnomalyGroupSummariesRequest> request = null;<NEW_LINE>Response<ListAnomalyGroupSummariesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListAnomalyGroupSummariesRequestProtocolMarshaller(protocolFactory).marshall<MASK><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, "LookoutMetrics");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListAnomalyGroupSummaries");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListAnomalyGroupSummariesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListAnomalyGroupSummariesResultJsonUnmarshaller());<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>} | (super.beforeMarshalling(listAnomalyGroupSummariesRequest)); |
469,345 | public String createBeforeSysLabelStart(LogicalVertex logicalVertex, String tag) {<NEW_LINE>if (vertexBeforeLabelList.containsKey(logicalVertex.getId())) {<NEW_LINE>return vertexBeforeLabelList.get(logicalVertex.getId());<NEW_LINE>} else {<NEW_LINE>String labelName = generateLabel(tag);<NEW_LINE>int labelId = getSysLabelId();<NEW_LINE>updateLabelIndexList(labelName, labelId);<NEW_LINE>QueryFlowOuterClass.RequirementValue.Builder labelStartBuilder = null;<NEW_LINE>for (QueryFlowOuterClass.RequirementValue.Builder builder : logicalVertex.getBeforeRequirementList()) {<NEW_LINE>if (builder.getReqType() == QueryFlowOuterClass.RequirementType.LABEL_START) {<NEW_LINE>labelStartBuilder = builder;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (null == labelStartBuilder) {<NEW_LINE>labelStartBuilder = QueryFlowOuterClass.RequirementValue.newBuilder().setReqType(QueryFlowOuterClass.RequirementType.LABEL_START);<NEW_LINE>logicalVertex.<MASK><NEW_LINE>}<NEW_LINE>labelStartBuilder.getReqArgumentBuilder().addIntValueList(labelId);<NEW_LINE>vertexBeforeLabelList.put(logicalVertex.getId(), labelName);<NEW_LINE>return labelName;<NEW_LINE>}<NEW_LINE>} | getBeforeRequirementList().add(labelStartBuilder); |
194,434 | public J visitUnary(J.Unary unary, ExecutionContext ctx) {<NEW_LINE>if (unary.getOperator() == J.Unary.Type.Not && unary.getExpression() instanceof J.Parentheses) {<NEW_LINE>J.Parentheses<?> expr = (J.Parentheses<?>) unary.getExpression();<NEW_LINE>if (expr.getTree() instanceof J.Binary) {<NEW_LINE>J.Binary binary = (J.Binary) expr.getTree();<NEW_LINE>switch(binary.getOperator()) {<NEW_LINE>case LessThan:<NEW_LINE>return super.visit(binary.withOperator(J.Binary.Type.GreaterThanOrEqual), ctx).withPrefix(unary.getPrefix());<NEW_LINE>case GreaterThan:<NEW_LINE>return super.visit(binary.withOperator(J.Binary.Type.LessThanOrEqual), ctx).withPrefix(unary.getPrefix());<NEW_LINE>case LessThanOrEqual:<NEW_LINE>return super.visit(binary.withOperator(J.Binary.Type.GreaterThan), ctx).withPrefix(unary.getPrefix());<NEW_LINE>case GreaterThanOrEqual:<NEW_LINE>return super.visit(binary.withOperator(J.Binary.Type.LessThan), ctx).withPrefix(unary.getPrefix());<NEW_LINE>case Equal:<NEW_LINE>return super.visit(binary.withOperator(J.Binary.Type.NotEqual), ctx).withPrefix(unary.getPrefix());<NEW_LINE>case NotEqual:<NEW_LINE>return super.visit(binary.withOperator(J.Binary.Type.Equal), ctx).<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return super.visitUnary(unary, ctx);<NEW_LINE>} | withPrefix(unary.getPrefix()); |
309,153 | public void generateBindPose() {<NEW_LINE>VertexBuffer pos = getBuffer(Type.Position);<NEW_LINE>if (pos == null || getBuffer(Type.BoneIndex) == null) {<NEW_LINE>// ignore, this mesh doesn't have positional data<NEW_LINE>// or it doesn't have bone-vertex assignments, so it's not animated<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>VertexBuffer bindPos = new VertexBuffer(Type.BindPosePosition);<NEW_LINE>bindPos.setupData(Usage.CpuOnly, pos.getNumComponents(), pos.getFormat(), BufferUtils.clone(pos.getData()));<NEW_LINE>setBuffer(bindPos);<NEW_LINE>// XXX: note that this method also sets stream mode<NEW_LINE>// so that animation is faster. this is not needed for hardware skinning<NEW_LINE>pos.setUsage(Usage.Stream);<NEW_LINE>VertexBuffer norm = getBuffer(Type.Normal);<NEW_LINE>if (norm != null) {<NEW_LINE>VertexBuffer bindNorm = new VertexBuffer(Type.BindPoseNormal);<NEW_LINE>bindNorm.setupData(Usage.CpuOnly, norm.getNumComponents(), norm.getFormat(), BufferUtils.clone(norm.getData()));<NEW_LINE>setBuffer(bindNorm);<NEW_LINE>norm.setUsage(Usage.Stream);<NEW_LINE>}<NEW_LINE>VertexBuffer tangents = getBuffer(Type.Tangent);<NEW_LINE>if (tangents != null) {<NEW_LINE>VertexBuffer bindTangents = new VertexBuffer(Type.BindPoseTangent);<NEW_LINE>bindTangents.setupData(Usage.CpuOnly, tangents.getNumComponents(), tangents.getFormat(), BufferUtils.clone(tangents.getData()));<NEW_LINE>setBuffer(bindTangents);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// else hardware setup does nothing, mesh already in bind pose<NEW_LINE>} | tangents.setUsage(Usage.Stream); |
1,132,958 | private void initWallet() {<NEW_LINE>log.info("Init wallet");<NEW_LINE><MASK><NEW_LINE>Runnable walletPasswordHandler = () -> {<NEW_LINE>log.info("Wallet password required");<NEW_LINE>bisqSetupListeners.forEach(BisqSetupListener::onRequestWalletPassword);<NEW_LINE>if (p2pNetworkReady.get())<NEW_LINE>p2PNetworkSetup.setSplashP2PNetworkAnimationVisible(true);<NEW_LINE>if (requestWalletPasswordHandler != null) {<NEW_LINE>requestWalletPasswordHandler.accept(aesKey -> {<NEW_LINE>walletsManager.setAesKey(aesKey);<NEW_LINE>walletsManager.maybeAddSegwitKeychains(aesKey);<NEW_LINE>if (getResyncSpvSemaphore()) {<NEW_LINE>if (showFirstPopupIfResyncSPVRequestedHandler != null)<NEW_LINE>showFirstPopupIfResyncSPVRequestedHandler.run();<NEW_LINE>} else {<NEW_LINE>// TODO no guarantee here that the wallet is really fully initialized<NEW_LINE>// We would need a new walletInitializedButNotEncrypted state to track<NEW_LINE>// Usually init is fast and we have our wallet initialized at that state though.<NEW_LINE>walletInitialized.set(true);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>};<NEW_LINE>walletAppSetup.init(chainFileLockedExceptionHandler, spvFileCorruptedHandler, getResyncSpvSemaphore(), showFirstPopupIfResyncSPVRequestedHandler, showPopupIfInvalidBtcConfigHandler, walletPasswordHandler, () -> {<NEW_LINE>if (allBasicServicesInitialized) {<NEW_LINE>checkForLockedUpFunds();<NEW_LINE>checkForInvalidMakerFeeTxs();<NEW_LINE>}<NEW_LINE>}, () -> walletInitialized.set(true));<NEW_LINE>} | bisqSetupListeners.forEach(BisqSetupListener::onInitWallet); |
1,361,432 | private static List<List<Object>> parseExcelData(BridgeInfo info, List<CellRangeAddress> cellRangeAddresses) {<NEW_LINE>List<List<Object>> <MASK><NEW_LINE>List<BridgeInfo.ClassInfo> classInfo = info.getClassInfo();<NEW_LINE>int clzLen = classInfo.size();<NEW_LINE>int firstRow = 1, lastRow = 1;<NEW_LINE>for (int i = 0; i < clzLen; i++) {<NEW_LINE>BridgeInfo.ClassInfo ci = classInfo.get(i);<NEW_LINE>List<Object> line = new ArrayList<>();<NEW_LINE>line.add(ci.getName());<NEW_LINE>result.add(line);<NEW_LINE>List<Object> firstLine = line;<NEW_LINE>List<BridgeInfo.MethodInfo> methodInfo = ci.getMethodInfo();<NEW_LINE>int methodLen = methodInfo.size();<NEW_LINE>for (int j = 0; j < methodLen; j++) {<NEW_LINE>BridgeInfo.MethodInfo mi = methodInfo.get(j);<NEW_LINE>if (j != 0) {<NEW_LINE>line = new ArrayList<>();<NEW_LINE>line.add(null);<NEW_LINE>result.add(line);<NEW_LINE>}<NEW_LINE>line.add(mi.getName());<NEW_LINE>line.add(mi.getAllCount());<NEW_LINE>line.add(mi.getAllTime());<NEW_LINE>line.add(mi.getAvTime());<NEW_LINE>}<NEW_LINE>firstLine.add(ci.getAllBridgeCount());<NEW_LINE>firstLine.add(ci.getAllTime());<NEW_LINE>if (cellRangeAddresses != null && methodLen > 1) {<NEW_LINE>lastRow = firstRow + methodLen - 1;<NEW_LINE>cellRangeAddresses.add(new CellRangeAddress(firstRow, lastRow, 0, 0));<NEW_LINE>cellRangeAddresses.add(new CellRangeAddress(firstRow, lastRow, 5, 5));<NEW_LINE>cellRangeAddresses.add(new CellRangeAddress(firstRow, lastRow, 6, 6));<NEW_LINE>}<NEW_LINE>firstRow += methodLen;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | result = new ArrayList<>(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.