idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
460,678
public void visitRelationshipCount(int startLabelId, int relTypeId, int endLabelId, long count) {<NEW_LINE>CountsKey countsKey = relationshipKey(startLabelId, relTypeId, endLabelId);<NEW_LINE>if (relationshipCounter.isValid(startLabelId, relTypeId, endLabelId)) {<NEW_LINE>long expected = unmarkCountVisited(relationshipCounter.get(startLabelId, relTypeId, endLabelId));<NEW_LINE>if (expected != count) {<NEW_LINE>reporter.forCounts(new CountsEntry(countsKey, count)).inconsistentRelationshipCount(expected);<NEW_LINE>}<NEW_LINE>relationshipCounter.set(startLabelId, relTypeId<MASK><NEW_LINE>} else {<NEW_LINE>AtomicLong expected = relationshipCountsStray.remove(countsKey);<NEW_LINE>if (expected != null) {<NEW_LINE>if (expected.longValue() != count) {<NEW_LINE>reporter.forCounts(new CountsEntry(countsKey, count)).inconsistentRelationshipCount(expected.longValue());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>reporter.forCounts(new CountsEntry(countsKey, count)).inconsistentRelationshipCount(0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, endLabelId, markCountVisited(expected));
776,448
private void updateOptionsButtons() {<NEW_LINE>MapActivity mapActivity = getMapActivity();<NEW_LINE>final View mainView = getMainView();<NEW_LINE>if (mapActivity == null || mainView == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final OsmandApplication app = mapActivity.getMyApplication();<NEW_LINE>RoutingHelper routingHelper = app.getRoutingHelper();<NEW_LINE>final ApplicationMode applicationMode = routingHelper.getAppMode();<NEW_LINE>final RouteMenuAppModes mode = app.getRoutingOptionsHelper().getRouteMenuAppMode(applicationMode);<NEW_LINE>boolean isLayoutRTL = AndroidUtils.isLayoutRtl(app);<NEW_LINE>updateControlButtons(mapActivity, mainView);<NEW_LINE>LinearLayout optionsButton = mainView.findViewById(R.id.map_options_route_button);<NEW_LINE>OsmAndAppCustomization customization = app.getAppCustomization();<NEW_LINE>AndroidUiHelper.updateVisibility(optionsButton, customization.isFeatureEnabled(NAVIGATION_OPTIONS_MENU_ID));<NEW_LINE>TextView optionsTitle = mainView.findViewById(R.id.map_options_route_button_title);<NEW_LINE>ImageView optionsIcon = mainView.findViewById(R.id.map_options_route_button_icon);<NEW_LINE>setupButtonIcon(<MASK><NEW_LINE>optionsButton.setOnClickListener(v -> clickRouteParams());<NEW_LINE>AndroidUtils.setBackground(app, optionsButton, nightMode, isLayoutRTL ? R.drawable.route_info_trans_gradient_left_light : R.drawable.route_info_trans_gradient_light, isLayoutRTL ? R.drawable.route_info_trans_gradient_left_dark : R.drawable.route_info_trans_gradient_dark);<NEW_LINE>HorizontalScrollView scrollView = mainView.findViewById(R.id.route_options_scroll_container);<NEW_LINE>scrollView.setVerticalScrollBarEnabled(false);<NEW_LINE>scrollView.setHorizontalScrollBarEnabled(false);<NEW_LINE>LinearLayout optionsContainer = mainView.findViewById(R.id.route_options_container);<NEW_LINE>optionsContainer.removeAllViews();<NEW_LINE>if (mode == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>createRoutingParametersButtons(mapActivity, mode, optionsContainer);<NEW_LINE>int endPadding = mapActivity.getResources().getDimensionPixelSize(R.dimen.action_bar_image_side_margin);<NEW_LINE>if (mode.parameters.size() > 2) {<NEW_LINE>optionsTitle.setVisibility(View.GONE);<NEW_LINE>} else {<NEW_LINE>optionsTitle.setVisibility(View.VISIBLE);<NEW_LINE>endPadding += AndroidUtils.getTextWidth(app.getResources().getDimensionPixelSize(R.dimen.text_button_text_size), app.getString(R.string.shared_string_options));<NEW_LINE>}<NEW_LINE>if (AndroidUtils.isLayoutRtl(app)) {<NEW_LINE>optionsContainer.setPadding(endPadding, optionsContainer.getPaddingTop(), optionsContainer.getPaddingRight(), optionsContainer.getPaddingBottom());<NEW_LINE>} else {<NEW_LINE>// LTR<NEW_LINE>optionsContainer.setPadding(optionsContainer.getPaddingLeft(), optionsContainer.getPaddingTop(), endPadding, optionsContainer.getPaddingBottom());<NEW_LINE>}<NEW_LINE>}
optionsIcon, R.drawable.ic_action_settings);
1,614,410
final CreateLoggerDefinitionVersionResult executeCreateLoggerDefinitionVersion(CreateLoggerDefinitionVersionRequest createLoggerDefinitionVersionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createLoggerDefinitionVersionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateLoggerDefinitionVersionRequest> request = null;<NEW_LINE>Response<CreateLoggerDefinitionVersionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateLoggerDefinitionVersionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createLoggerDefinitionVersionRequest));<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, "Greengrass");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateLoggerDefinitionVersion");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateLoggerDefinitionVersionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateLoggerDefinitionVersionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1,742,305
public void callMessageWizard(ActionRequest request, ActionResponse response) {<NEW_LINE>Model context = request.getContext().asType(Model.class);<NEW_LINE>String model = request.getModel();<NEW_LINE>LOG.debug("Call message wizard for model : {} ", model);<NEW_LINE>String[] decomposeModel = model.split("\\.");<NEW_LINE>String simpleModel = decomposeModel[decomposeModel.length - 1];<NEW_LINE>Query<? extends Template> templateQuery = Beans.get(TemplateRepository.class).all().filter("self.metaModel.fullName = ?1 AND self.isSystem != true", model);<NEW_LINE>try {<NEW_LINE>long templateNumber = templateQuery.count();<NEW_LINE>LOG.debug("Template number : {} ", templateNumber);<NEW_LINE>if (templateNumber == 0) {<NEW_LINE>response.setView(ActionView.define(I18n.get(IExceptionMessage.MESSAGE_3)).model(Message.class.getName()).add("form", "message-form").param("forceEdit", "true").context("_mediaTypeSelect", MessageRepository.MEDIA_TYPE_EMAIL).context("_templateContextModel", model).context("_objectId", context.getId().toString()).map());<NEW_LINE>} else if (templateNumber > 1) {<NEW_LINE>response.setView(ActionView.define(I18n.get(IExceptionMessage.MESSAGE_2)).model(Wizard.class.getName()).add("form", "generate-message-wizard-form").param("show-confirm", "false").context("_objectId", context.getId().toString()).context("_templateContextModel", model).context("_tag"<MASK><NEW_LINE>} else {<NEW_LINE>response.setView(generateMessage(context.getId(), model, simpleModel, templateQuery.fetchOne()));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>TraceBackService.trace(response, e);<NEW_LINE>}<NEW_LINE>}
, simpleModel).map());
1,564,872
protected void processObject(XMLElement e) {<NEW_LINE>imbricatedObjects++;<NEW_LINE>String type = e.getAttribute("type");<NEW_LINE>String data = e.getAttribute("data");<NEW_LINE>if (data != null) {<NEW_LINE>processSrc(e.getName(), data);<NEW_LINE>data = PathUtil.resolveRelativeReference(base, data);<NEW_LINE>}<NEW_LINE>if (type != null && data != null && xrefChecker.isPresent() && !type.equals(xrefChecker.get().getMimeType(data))) {<NEW_LINE>String context = "<object";<NEW_LINE>for (int i = 0; i < e.getAttributeCount(); i++) {<NEW_LINE>XMLAttribute attribute = e.getAttribute(i);<NEW_LINE>context += " " + attribute.getName() + "=\"" <MASK><NEW_LINE>}<NEW_LINE>context += ">";<NEW_LINE>report.message(MessageId.OPF_013, EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber(), context), type, xrefChecker.get().getMimeType(data));<NEW_LINE>}<NEW_LINE>if (type != null) {<NEW_LINE>if (!context.mimeType.equals("image/svg+xml") && type.equals("image/svg+xml")) {<NEW_LINE>allowedProperties.add(ITEM_PROPERTIES.SVG);<NEW_LINE>}<NEW_LINE>if (OPFChecker30.isCoreMediaType(type)) {<NEW_LINE>hasValidFallback = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hasValidFallback) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// check bindings<NEW_LINE>if (xrefChecker.isPresent() && type != null && xrefChecker.get().getBindingHandlerId(type) != null) {<NEW_LINE>hasValidFallback = true;<NEW_LINE>}<NEW_LINE>}
+ attribute.getValue() + "\"";
852,403
private void handleRequest(LinkedList<String> packet) throws Exception {<NEW_LINE>if (packet.get(0).startsWith("DROP")) {<NEW_LINE>jobInProgress = false;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>File requestedFile;<NEW_LINE>String reqFileName = packet.get(0).replaceAll("(^[A-z\\s]+/)|(\\s+?.*$)", "");<NEW_LINE>if (!files.containsKey(reqFileName)) {<NEW_LINE>writeToSocket(NETPacket.getCode404());<NEW_LINE>print("File " + <MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long reqFileSize = files.get(reqFileName).getSize();<NEW_LINE>requestedFile = files.get(reqFileName).getFile();<NEW_LINE>if (!requestedFile.exists() || reqFileSize == 0) {<NEW_LINE>// well.. tell 404 if file exists with 0 length is against standard, but saves time<NEW_LINE>writeToSocket(NETPacket.getCode404());<NEW_LINE>print("File " + requestedFile.getName() + " doesn't exists or have 0 size. Returning 404", EMsgType.FAIL);<NEW_LINE>logPrinter.update(requestedFile, EFileStatus.FAILED);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (packet.get(0).startsWith("HEAD")) {<NEW_LINE>writeToSocket(NETPacket.getCode200(reqFileSize));<NEW_LINE>print("Replying for requested file: " + requestedFile.getName(), EMsgType.INFO);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (packet.get(0).startsWith("GET")) {<NEW_LINE>for (String line : packet) {<NEW_LINE>if (line.toLowerCase().startsWith("range")) {<NEW_LINE>parseGETrange(requestedFile, reqFileName, reqFileSize, line);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
reqFileName + " doesn't exists or have 0 size. Returning 404", EMsgType.FAIL);
326,444
public CurrencyAmount presentValueTheta(ResolvedSwaption swaption, RatesProvider ratesProvider, SwaptionVolatilities swaptionVolatilities) {<NEW_LINE>validate(swaption, ratesProvider, swaptionVolatilities);<NEW_LINE>double expiry = swaptionVolatilities.relativeTime(swaption.getExpiry());<NEW_LINE>ResolvedSwap underlying = swaption.getUnderlying();<NEW_LINE>ResolvedSwapLeg fixedLeg = fixedLeg(underlying);<NEW_LINE>if (expiry < 0d) {<NEW_LINE>// Option has expired already<NEW_LINE>return CurrencyAmount.of(<MASK><NEW_LINE>}<NEW_LINE>double forward = forwardRate(swaption, ratesProvider);<NEW_LINE>double pvbp = getSwapPricer().getLegPricer().pvbp(fixedLeg, ratesProvider);<NEW_LINE>double numeraire = Math.abs(pvbp);<NEW_LINE>double strike = getSwapPricer().getLegPricer().couponEquivalent(fixedLeg, ratesProvider, pvbp);<NEW_LINE>double tenor = swaptionVolatilities.tenor(fixedLeg.getStartDate(), fixedLeg.getEndDate());<NEW_LINE>double volatility = swaptionVolatilities.volatility(expiry, tenor, strike, forward);<NEW_LINE>PutCall putCall = PutCall.ofPut(fixedLeg.getPayReceive().isReceive());<NEW_LINE>double theta = numeraire * swaptionVolatilities.priceTheta(expiry, tenor, putCall, strike, forward, volatility);<NEW_LINE>return CurrencyAmount.of(fixedLeg.getCurrency(), theta * swaption.getLongShort().sign());<NEW_LINE>}
fixedLeg.getCurrency(), 0d);
242,814
public static void main(String[] args) throws Exception {<NEW_LINE>dataLocalPath = DownloaderUtility.MODELIMPORT.Download();<NEW_LINE>final String SIMPLE_MLP = new File(<MASK><NEW_LINE>// Keras Sequential models correspond to DL4J MultiLayerNetworks. We enforce loading the training configuration<NEW_LINE>// of the model as well. If you're only interested in inference, you can safely set this to 'false'.<NEW_LINE>MultiLayerNetwork model = KerasModelImport.importKerasSequentialModelAndWeights(SIMPLE_MLP, true);<NEW_LINE>// Test basic inference on the model.<NEW_LINE>INDArray input = Nd4j.create(256, 100);<NEW_LINE>INDArray output = model.output(input);<NEW_LINE>// Test basic model training.<NEW_LINE>model.fit(input, output);<NEW_LINE>// Sanity checks for import. First, check it optimizer is correct.<NEW_LINE>assert model.conf().getOptimizationAlgo().equals(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT);<NEW_LINE>// The first layer is a dense layer with 100 input and 64 output units, with RELU activation<NEW_LINE>Layer first = model.getLayer(0);<NEW_LINE>DenseLayer firstConf = (DenseLayer) first.conf().getLayer();<NEW_LINE>assert firstConf.getActivationFn().equals(Activation.RELU.getActivationFunction());<NEW_LINE>assert firstConf.getNIn() == 100;<NEW_LINE>assert firstConf.getNOut() == 64;<NEW_LINE>// The second later is a dense layer with 64 input and 10 output units, with Softmax activation.<NEW_LINE>Layer second = model.getLayer(1);<NEW_LINE>DenseLayer secondConf = (DenseLayer) second.conf().getLayer();<NEW_LINE>assert secondConf.getActivationFn().equals(Activation.SOFTMAX.getActivationFunction());<NEW_LINE>assert secondConf.getNIn() == 64;<NEW_LINE>assert secondConf.getNOut() == 10;<NEW_LINE>// The loss function of the Keras model gets translated into a DL4J LossLayer, which is the final<NEW_LINE>// layer in this MLP.<NEW_LINE>Layer loss = model.getLayer(2);<NEW_LINE>LossLayer lossConf = (LossLayer) loss.conf().getLayer();<NEW_LINE>assert lossConf.getLossFn() instanceof LossMCXENT;<NEW_LINE>}
dataLocalPath, "keras/simple_mlp.h5").getAbsolutePath();
1,760,043
public static ConnectionProfile buildDefaultConnectionProfile(Settings settings) {<NEW_LINE>int connectionsPerNodeRecovery = TransportSettings.CONNECTIONS_PER_NODE_RECOVERY.get(settings);<NEW_LINE>int connectionsPerNodeBulk = TransportSettings.CONNECTIONS_PER_NODE_BULK.get(settings);<NEW_LINE>int connectionsPerNodeReg = TransportSettings.CONNECTIONS_PER_NODE_REG.get(settings);<NEW_LINE>int connectionsPerNodeState = TransportSettings.CONNECTIONS_PER_NODE_STATE.get(settings);<NEW_LINE>int connectionsPerNodePing = TransportSettings.CONNECTIONS_PER_NODE_PING.get(settings);<NEW_LINE>Builder builder = new Builder();<NEW_LINE>builder.setConnectTimeout(TransportSettings.CONNECT_TIMEOUT.get(settings));<NEW_LINE>builder.setHandshakeTimeout(TransportSettings<MASK><NEW_LINE>builder.setPingInterval(TransportSettings.PING_SCHEDULE.get(settings));<NEW_LINE>builder.setCompressionEnabled(TransportSettings.TRANSPORT_COMPRESS.get(settings));<NEW_LINE>builder.addConnections(connectionsPerNodeBulk, TransportRequestOptions.Type.BULK);<NEW_LINE>builder.addConnections(connectionsPerNodePing, TransportRequestOptions.Type.PING);<NEW_LINE>// if we are not master eligible we don't need a dedicated channel to publish the state<NEW_LINE>builder.addConnections(DiscoveryNode.isMasterNode(settings) ? connectionsPerNodeState : 0, TransportRequestOptions.Type.STATE);<NEW_LINE>// if we are not a data-node we don't need any dedicated channels for recovery<NEW_LINE>builder.addConnections(DiscoveryNode.isDataNode(settings) ? connectionsPerNodeRecovery : 0, TransportRequestOptions.Type.RECOVERY);<NEW_LINE>builder.addConnections(connectionsPerNodeReg, TransportRequestOptions.Type.REG);<NEW_LINE>return builder.build();<NEW_LINE>}
.CONNECT_TIMEOUT.get(settings));
235,245
protected void writeInternal(Object object, HttpOutputMessage outputMessage) throws IOException, HttpMessageNotWritableException {<NEW_LINE>try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {<NEW_LINE>HttpHeaders headers = outputMessage.getHeaders();<NEW_LINE>int contentLength;<NEW_LINE>if (object instanceof String && JSON.isValidObject((String) object)) {<NEW_LINE>byte[] strBytes = ((String) object).getBytes(config.getCharset());<NEW_LINE>contentLength = strBytes.length;<NEW_LINE>baos.write(strBytes, 0, strBytes.length);<NEW_LINE>} else {<NEW_LINE>contentLength = JSON.writeTo(baos, object, config.getDateFormat(), config.getWriterFilters(), config.getWriterFeatures());<NEW_LINE>}<NEW_LINE>if (headers.getContentLength() < 0 && config.isWriteContentLength()) {<NEW_LINE>headers.setContentLength(contentLength);<NEW_LINE>}<NEW_LINE>baos.writeTo(outputMessage.getBody());<NEW_LINE>} catch (JSONException ex) {<NEW_LINE>throw new HttpMessageNotWritableException("Could not write JSON: " + <MASK><NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new HttpMessageNotWritableException("I/O error while writing output message", ex);<NEW_LINE>}<NEW_LINE>}
ex.getMessage(), ex);
1,142,285
public boolean openForm(int AD_Form_ID) {<NEW_LINE>Properties ctx = Env.getCtx();<NEW_LINE>//<NEW_LINE>String name = null;<NEW_LINE>String className = null;<NEW_LINE>String sql = "SELECT Name, Description, ClassName, Help FROM AD_Form WHERE AD_Form_ID=?";<NEW_LINE>boolean trl = !Env.isBaseLanguage(ctx, "AD_Form");<NEW_LINE>if (trl)<NEW_LINE>sql = "SELECT t.Name, t.Description, f.ClassName, t.Help " + "FROM AD_Form f INNER JOIN AD_Form_Trl t" + " ON (f.AD_Form_ID=t.AD_Form_ID AND AD_Language=?)" + "WHERE f.AD_Form_ID=?";<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, null);<NEW_LINE>if (trl) {<NEW_LINE>pstmt.setString(1, Env.getAD_Language(ctx));<NEW_LINE>pstmt.setInt(2, AD_Form_ID);<NEW_LINE>} else<NEW_LINE>pstmt.setInt(1, AD_Form_ID);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>if (rs.next()) {<NEW_LINE>name = rs.getString(1);<NEW_LINE>m_Description = rs.getString(2);<NEW_LINE>className = rs.getString(3);<NEW_LINE>m_Help = rs.getString(4);<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.log(<MASK><NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>rs = null;<NEW_LINE>pstmt = null;<NEW_LINE>}<NEW_LINE>if (className == null)<NEW_LINE>return false;<NEW_LINE>//<NEW_LINE>return openForm(AD_Form_ID, className, name);<NEW_LINE>}
Level.SEVERE, sql, e);
81,957
public void verifyRubricQuestionDetails(int questionNum, FeedbackRubricQuestionDetails questionDetails) {<NEW_LINE>int numChoices = questionDetails.getNumOfRubricChoices();<NEW_LINE>List<String> choices = questionDetails.getRubricChoices();<NEW_LINE>for (int i = 0; i < numChoices; i++) {<NEW_LINE>assertEquals(choices.get(i), getRubricChoiceInputs(questionNum).get(i).getAttribute("value"));<NEW_LINE>}<NEW_LINE>int numSubQn = questionDetails.getNumOfRubricSubQuestions();<NEW_LINE>List<String> subQuestions = questionDetails.getRubricSubQuestions();<NEW_LINE>List<List<String>> descriptions = questionDetails.getRubricDescriptions();<NEW_LINE>for (int i = 0; i < numSubQn; i++) {<NEW_LINE>List<WebElement> textAreas = getRubricTextareas(questionNum, i + 2);<NEW_LINE>assertEquals(subQuestions.get(i), textAreas.get(<MASK><NEW_LINE>for (int j = 0; j < numChoices; j++) {<NEW_LINE>assertEquals(descriptions.get(i).get(j), textAreas.get(j + 1).getAttribute("value"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (questionDetails.isHasAssignedWeights()) {<NEW_LINE>assertTrue(getWeightCheckbox(questionNum).isSelected());<NEW_LINE>List<List<Double>> weights = questionDetails.getRubricWeights();<NEW_LINE>for (int i = 0; i < numSubQn; i++) {<NEW_LINE>List<WebElement> rubricWeights = getRubricWeights(questionNum, i + 2);<NEW_LINE>for (int j = 0; j < numChoices; j++) {<NEW_LINE>assertEquals(rubricWeights.get(j).getAttribute("value"), getDoubleString(weights.get(i).get(j)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>assertFalse(getWeightCheckbox(questionNum).isSelected());<NEW_LINE>}<NEW_LINE>}
0).getAttribute("value"));
1,284,152
public Object evaluate(PebbleTemplateImpl self, EvaluationContextImpl context) {<NEW_LINE>TestInvocationExpression testInvocation = (TestInvocationExpression) this.getRightExpression();<NEW_LINE>ArgumentsNode args = testInvocation.getArgs();<NEW_LINE>if (this.cachedTest == null) {<NEW_LINE>String testName = testInvocation.getTestName();<NEW_LINE>this.cachedTest = context.getExtensionRegistry().getTest(testInvocation.getTestName());<NEW_LINE>if (this.cachedTest == null) {<NEW_LINE>throw new PebbleException(null, String.format("Test [%s] does not exist.", testName), this.getLineNumber(), self.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Test test = this.cachedTest;<NEW_LINE>Map<String, Object> namedArguments = args.<MASK><NEW_LINE>// This check is not nice, because we use instanceof. However this is<NEW_LINE>// the only test which should not fail in strict mode, when the variable<NEW_LINE>// is not set, because this method should exactly test this. Hence a<NEW_LINE>// generic solution to allow other tests to reuse this feature make no<NEW_LINE>// sense.<NEW_LINE>if (test instanceof DefinedTest) {<NEW_LINE>Object input = null;<NEW_LINE>try {<NEW_LINE>input = this.getLeftExpression().evaluate(self, context);<NEW_LINE>} catch (AttributeNotFoundException e) {<NEW_LINE>input = null;<NEW_LINE>}<NEW_LINE>return test.apply(input, namedArguments, self, context, this.getLineNumber());<NEW_LINE>} else {<NEW_LINE>return test.apply(this.getLeftExpression().evaluate(self, context), namedArguments, self, context, this.getLineNumber());<NEW_LINE>}<NEW_LINE>}
getArgumentMap(self, context, test);
637,026
public NotebookInstanceLifecycleConfigSummary unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>NotebookInstanceLifecycleConfigSummary notebookInstanceLifecycleConfigSummary = new NotebookInstanceLifecycleConfigSummary();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("NotebookInstanceLifecycleConfigName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>notebookInstanceLifecycleConfigSummary.setNotebookInstanceLifecycleConfigName(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("NotebookInstanceLifecycleConfigArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>notebookInstanceLifecycleConfigSummary.setNotebookInstanceLifecycleConfigArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("CreationTime", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>notebookInstanceLifecycleConfigSummary.setCreationTime(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("LastModifiedTime", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>notebookInstanceLifecycleConfigSummary.setLastModifiedTime(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").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 notebookInstanceLifecycleConfigSummary;<NEW_LINE>}
class).unmarshall(context));
211,324
public static void main(String[] args) {<NEW_LINE>Scanner sc = new Scanner(System.in);<NEW_LINE>Queue_LL q = new Queue_LL();<NEW_LINE>boolean flag = true;<NEW_LINE>int val = 0;<NEW_LINE>while (flag) {<NEW_LINE><MASK><NEW_LINE>System.out.println("2. Dequeue()");<NEW_LINE>System.out.println("3. Current Size of Queue");<NEW_LINE>System.out.println("4. Peek()");<NEW_LINE>System.out.println("5. View Queue");<NEW_LINE>System.out.println("6. Exit");<NEW_LINE>System.out.println("Enter Choice");<NEW_LINE>int choice = sc.nextInt();<NEW_LINE>switch(choice) {<NEW_LINE>case 1:<NEW_LINE>System.out.println("Enter value");<NEW_LINE>val = sc.nextInt();<NEW_LINE>q.enqueue(val);<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>System.out.println(q.dequeue());<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>System.out.println(q.count());<NEW_LINE>break;<NEW_LINE>case 4:<NEW_LINE>System.out.println(q.peek());<NEW_LINE>break;<NEW_LINE>case 5:<NEW_LINE>q.viewQ();<NEW_LINE>break;<NEW_LINE>case 6:<NEW_LINE>flag = false;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>System.out.println("invalid choice");<NEW_LINE>}<NEW_LINE>// switch<NEW_LINE>System.out.println();<NEW_LINE>}<NEW_LINE>// while<NEW_LINE>}
System.out.println("1. Enqueue()");
818,393
final GetEnvironmentResult executeGetEnvironment(GetEnvironmentRequest getEnvironmentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getEnvironmentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetEnvironmentRequest> request = null;<NEW_LINE>Response<GetEnvironmentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetEnvironmentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getEnvironmentRequest));<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, "Migration Hub Refactor Spaces");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetEnvironment");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetEnvironmentResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetEnvironmentResultJsonUnmarshaller());<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);
413,300
public boolean updateAfterApprove(List<InlongStreamApproveRequest> streamApproveList, String operator) {<NEW_LINE>if (CollectionUtils.isEmpty(streamApproveList)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (LOGGER.isDebugEnabled()) {<NEW_LINE>LOGGER.debug("begin to update stream after approve={}", streamApproveList);<NEW_LINE>}<NEW_LINE>String groupId = null;<NEW_LINE>for (InlongStreamApproveRequest info : streamApproveList) {<NEW_LINE>// these groupIds are all the same<NEW_LINE>groupId = info.getInlongGroupId();<NEW_LINE>// Modify the inlong stream info after approve<NEW_LINE>InlongStreamEntity streamEntity = streamMapper.selectByIdentifier(groupId, info.getInlongStreamId());<NEW_LINE>streamEntity.setStatus(StreamStatus.CONFIG_ING.getCode());<NEW_LINE>int rowCount = streamMapper.updateByIdentifierSelective(streamEntity);<NEW_LINE>if (rowCount != InlongConstants.AFFECTED_ONE_ROW) {<NEW_LINE>LOGGER.error("stream has already updated with group id={}, stream id={}, curVersion={}", streamEntity.getInlongGroupId(), streamEntity.getInlongStreamId(<MASK><NEW_LINE>throw new BusinessException(ErrorCodeEnum.CONFIG_EXPIRED);<NEW_LINE>}<NEW_LINE>// Modify the sink info after approve, such as update cluster info<NEW_LINE>sinkService.updateAfterApprove(info.getSinkList(), operator);<NEW_LINE>}<NEW_LINE>LOGGER.info("success to update stream after approve for groupId={}", groupId);<NEW_LINE>return true;<NEW_LINE>}
), streamEntity.getVersion());
1,837,143
private static int goAfterLastNewLine(final TokenSequence<JavaTokenId> seq) {<NEW_LINE>int base = seq.offset();<NEW_LINE>seq.movePrevious();<NEW_LINE>while (seq.moveNext() && nonRelevant.contains(seq.token().id())) ;<NEW_LINE>while (seq.movePrevious() && nonRelevant.contains(seq.token().id())) {<NEW_LINE>switch(seq.token().id()) {<NEW_LINE>case LINE_COMMENT:<NEW_LINE>seq.moveNext();<NEW_LINE>return seq.offset();<NEW_LINE>case WHITESPACE:<NEW_LINE>char[] c = seq.token().text().toString().toCharArray();<NEW_LINE>for (int i = c.length; i > 0; ) {<NEW_LINE>if (c[--i] == '\n') {<NEW_LINE>return seq<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if ((seq.index() == 0 || seq.moveNext()) && nonRelevant.contains(seq.token().id())) {<NEW_LINE>return seq.offset();<NEW_LINE>}<NEW_LINE>return base;<NEW_LINE>}
.offset() + i + 1;
938,460
private boolean save() {<NEW_LINE>String name = nameField.getText().trim();<NEW_LINE>TeaVMProfile existingProfile = settings.getProfile(name);<NEW_LINE>if (existingProfile != null && existingProfile != profile) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>profile.setName(name);<NEW_LINE>String mainClass = mainClassField.getText().trim();<NEW_LINE>profile.setMainClass(!mainClass.isEmpty() ? mainClass : null);<NEW_LINE>profile.setTargetDirectory(targetDirectoryField.getText());<NEW_LINE>profile.setTargetFileName(targetFileNameField.getText().trim());<NEW_LINE>profile.setIncremental(incrementalButton.getSelection());<NEW_LINE>profile.setCacheDirectory(cacheDirectoryField.getText());<NEW_LINE>profile.<MASK><NEW_LINE>profile.setSourceMapsGenerated(sourceMapsButton.getSelection());<NEW_LINE>profile.setSourceFilesCopied(sourceFilesCopiedButton.getSelection());<NEW_LINE>Properties properties = new Properties();<NEW_LINE>for (Object item : propertyList) {<NEW_LINE>KeyValue property = (KeyValue) item;<NEW_LINE>properties.setProperty(property.key, property.value);<NEW_LINE>}<NEW_LINE>profile.setProperties(properties);<NEW_LINE>profile.setTransformers(transformersList.getItems());<NEW_LINE>Set<String> classesToPreserve = new HashSet<>();<NEW_LINE>for (int i = 0; i < classAliasesTableViewer.getItemCount(); ++i) {<NEW_LINE>classesToPreserve.add(classAliasesTableViewer.getItem(i));<NEW_LINE>}<NEW_LINE>profile.setClassesToPreserve(classesToPreserve);<NEW_LINE>return true;<NEW_LINE>}
setDebugInformationGenerated(debugInformationButton.getSelection());
1,424,165
final DeleteVpcPeeringConnectionResult executeDeleteVpcPeeringConnection(DeleteVpcPeeringConnectionRequest deleteVpcPeeringConnectionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteVpcPeeringConnectionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteVpcPeeringConnectionRequest> request = null;<NEW_LINE>Response<DeleteVpcPeeringConnectionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteVpcPeeringConnectionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteVpcPeeringConnectionRequest));<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, "GameLift");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteVpcPeeringConnectionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteVpcPeeringConnectionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteVpcPeeringConnection");
1,319,849
public final void zoom(int centerX, int centerY, double factor) {<NEW_LINE>// Cache current fitting<NEW_LINE>boolean fitsWidth = fitsWidth();<NEW_LINE>boolean fitsHeight = fitsHeight();<NEW_LINE>// Both fits, no zoom<NEW_LINE>if (fitsWidth && fitsHeight)<NEW_LINE>return;<NEW_LINE>// Resolve current scale<NEW_LINE>double scaleX = getScaleX();<NEW_LINE>double scaleY = getScaleY();<NEW_LINE>// Bad scale, no zoom<NEW_LINE>if (scaleX * scaleY == 0)<NEW_LINE>return;<NEW_LINE>// Compute new scale<NEW_LINE>double newScaleX = zoomMode == ZOOM_Y || fitsWidth ? scaleX : scaleX * factor;<NEW_LINE>double newScaleY = zoomMode == ZOOM_X || fitsHeight ? scaleY : scaleY * factor;<NEW_LINE>// Cache data at zoom center<NEW_LINE>double dataX = getDataX(centerX);<NEW_LINE>double dataY = getDataY(centerY);<NEW_LINE>// Set new scale<NEW_LINE>setScale(newScaleX, newScaleY);<NEW_LINE>// Cache current offset<NEW_LINE>long offsetX = getOffsetX();<NEW_LINE>long offsetY = getOffsetY();<NEW_LINE>// Update x-offset to centerX if needed<NEW_LINE>if (!fitsWidth && zoomMode != ZOOM_Y) {<NEW_LINE>double dataWidth = dataX - getDataOffsetX();<NEW_LINE>long viewWidth = (long) Math.ceil(getViewWidth(dataWidth));<NEW_LINE>offsetX = isRightBased() ? viewWidth - getWidth() + centerX : viewWidth - centerX;<NEW_LINE>}<NEW_LINE>// Update y-offset to centerY if needed<NEW_LINE>if (!fitsHeight && zoomMode != ZOOM_X) {<NEW_LINE><MASK><NEW_LINE>long viewHeight = (long) Math.ceil(getViewHeight(dataHeight));<NEW_LINE>offsetY = isBottomBased() ? viewHeight - getHeight() + centerY : viewHeight - centerY;<NEW_LINE>}<NEW_LINE>// Set new offset<NEW_LINE>setOffset(offsetX, offsetY);<NEW_LINE>}
double dataHeight = dataY - getDataOffsetY();
763,709
protected List<String> splitTextcontent(String textcontent) {<NEW_LINE>List<String> ret = null;<NEW_LINE>int startPos = 0;<NEW_LINE>int endPos = -1;<NEW_LINE>if ((textcontent != null) && (textcontent.length() > 0)) {<NEW_LINE>while ((startPos < textcontent.length()) && (!Character.isDigit(textcontent.charAt(startPos)))) startPos++;<NEW_LINE>endPos = startPos + 1;<NEW_LINE>while ((endPos < textcontent.length()) && (Character.isDigit(textcontent.charAt(endPos)))) endPos++;<NEW_LINE>if ((startPos < endPos) && (endPos <= textcontent.length())) {<NEW_LINE>ret = new ArrayList<String>();<NEW_LINE>if (startPos > 0)<NEW_LINE>ret.add(textcontent.substring(0, startPos));<NEW_LINE>// marker for the position of the pagenumber<NEW_LINE>ret.add("#");<NEW_LINE>if (endPos < textcontent.length())<NEW_LINE>ret.add<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>}
(textcontent.substring(endPos));
309,706
private boolean hasPreviousSession(ConsoleProxyVO proxy, VMInstanceVO vm) {<NEW_LINE>ConsoleProxyStatus status = null;<NEW_LINE>try {<NEW_LINE>byte[] detailsInBytes = proxy.getSessionDetails();<NEW_LINE>String details = detailsInBytes != null ? new String(detailsInBytes, Charset.forName("US-ASCII")) : null;<NEW_LINE>status = parseJsonToConsoleProxyStatus(details);<NEW_LINE>} catch (JsonParseException e) {<NEW_LINE>s_logger.warn(String.format("Unable to parse proxy [%s] session details [%s] due to [%s].", proxy.toString(), Arrays.toString(proxy.getSessionDetails()), e.getMessage()), e);<NEW_LINE>}<NEW_LINE>if (status != null && status.getConnections() != null) {<NEW_LINE>ConsoleProxyConnectionInfo[] connections = status.getConnections();<NEW_LINE>for (ConsoleProxyConnectionInfo connection : connections) {<NEW_LINE>long taggedVmId = 0;<NEW_LINE>if (connection.tag != null) {<NEW_LINE>try {<NEW_LINE>taggedVmId = Long.parseLong(connection.tag);<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>s_logger.warn(String.format("Unable to parse console proxy connection info passed through tag [%s] due to [%s].", connection.tag, e.getMessage()), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (taggedVmId == vm.getId()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return DateUtil.currentGMTTime().getTime() - vm.getProxyAssignTime().getTime() < proxySessionTimeoutValue;<NEW_LINE>} else {<NEW_LINE>s_logger.warn(String.format("Unable to retrieve load info from proxy [%s] on an overloaded proxy."<MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
, proxy.toString()));
1,079,338
public ResponseData<Integer> putPolicyIntoCpt(Integer cptId, List<Integer> policyIdList, WeIdPrivateKey weIdPrivateKey) {<NEW_LINE>if (!WeIdUtils.isPrivateKeyValid(weIdPrivateKey) || !isPolicyIdListValid(policyIdList) || cptId < 1) {<NEW_LINE>return new ResponseData<>(-1, ErrorCode.ILLEGAL_INPUT);<NEW_LINE>}<NEW_LINE>CptController cptController = reloadContract(fiscoConfig.getCptAddress(), weIdPrivateKey.getPrivateKey(), CptController.class);<NEW_LINE>List<BigInteger> idBigIntList = new ArrayList<>();<NEW_LINE>for (Integer policyId : policyIdList) {<NEW_LINE>idBigIntList.add(new BigInteger(String.valueOf(policyId), 10));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>TransactionReceipt transactionReceipt = cptController.putClaimPoliciesIntoCptMap(new BigInteger(String.valueOf(cptId), 10), idBigIntList).send();<NEW_LINE>ResponseData<CptBaseInfo> response = processRegisterEventLog(cptController, transactionReceipt);<NEW_LINE>if (response.getErrorCode().intValue() == ErrorCode.SUCCESS.getCode()) {<NEW_LINE>return new ResponseData<>(response.getResult().getCptId().<MASK><NEW_LINE>} else {<NEW_LINE>return new ResponseData<>(-1, ErrorCode.UNKNOW_ERROR);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("[register policy] register policy failed. exception message: ", e);<NEW_LINE>return new ResponseData<Integer>(-1, ErrorCode.UNKNOW_ERROR);<NEW_LINE>}<NEW_LINE>}
intValue(), ErrorCode.SUCCESS);
829,224
private Pair<List<? extends CoreMap>, List<T>> applyCompositeRule(SequenceMatchRules.ExtractRule<List<? extends CoreMap>, T> compositeExtractRule, List<? extends CoreMap> merged, List<T> matchedExpressions, int limit) {<NEW_LINE>// Apply higher order rules<NEW_LINE>boolean done = false;<NEW_LINE>// Limit of number of times rules are applied just in case<NEW_LINE>int maxIters = limit;<NEW_LINE>int iters = 0;<NEW_LINE>while (!done) {<NEW_LINE>List<T> newExprs = new ArrayList<>();<NEW_LINE>boolean extracted = compositeExtractRule.extract(merged, newExprs);<NEW_LINE>if (verbose && extracted)<NEW_LINE>log.info("applyCompositeRule() extracting with " + compositeExtractRule + " from " + merged + " gives " + newExprs);<NEW_LINE>if (extracted) {<NEW_LINE>annotateExpressions(merged, newExprs);<NEW_LINE>newExprs = MatchedExpression.removeNullValues(newExprs);<NEW_LINE>if (!newExprs.isEmpty()) {<NEW_LINE>newExprs = MatchedExpression.removeNested(newExprs);<NEW_LINE>newExprs = MatchedExpression.removeOverlapping(newExprs);<NEW_LINE>merged = <MASK><NEW_LINE>// Favor newly matched expressions over older ones<NEW_LINE>newExprs.addAll(matchedExpressions);<NEW_LINE>matchedExpressions = MatchedExpression.removeNested(newExprs);<NEW_LINE>matchedExpressions = MatchedExpression.removeOverlapping(matchedExpressions);<NEW_LINE>} else {<NEW_LINE>extracted = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>done = !extracted;<NEW_LINE>iters++;<NEW_LINE>if (maxIters > 0 && iters >= maxIters) {<NEW_LINE>if (verbose) {<NEW_LINE>log.warn("Aborting application of composite rules: Maximum iteration " + maxIters + " reached");<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Pair<>(merged, matchedExpressions);<NEW_LINE>}
MatchedExpression.replaceMerged(merged, newExprs);
1,168,789
final StopInstanceResult executeStopInstance(StopInstanceRequest stopInstanceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(stopInstanceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StopInstanceRequest> request = null;<NEW_LINE>Response<StopInstanceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StopInstanceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(stopInstanceRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Lightsail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StopInstance");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StopInstanceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StopInstanceResultJsonUnmarshaller());<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.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
1,247,164
public ProcResult fetchResult() throws AnalysisException {<NEW_LINE>BaseProcResult result = new BaseProcResult();<NEW_LINE>result.setNames(TITLE_NAMES);<NEW_LINE>TabletScheduler tabletScheduler = Catalog.getCurrentCatalog().getTabletScheduler();<NEW_LINE>TabletChecker tabletChecker = Catalog.getCurrentCatalog().getTabletChecker();<NEW_LINE>result.addRow(Lists.newArrayList(CLUSTER_LOAD, String.valueOf(tabletScheduler.getStatisticMap(<MASK><NEW_LINE>result.addRow(Lists.newArrayList(WORKING_SLOTS, String.valueOf(tabletScheduler.getBackendsWorkingSlots().size())));<NEW_LINE>result.addRow(Lists.newArrayList(SCHED_STAT, tabletScheduler.getStat().getLastSnapshot() == null ? "0" : "1"));<NEW_LINE>result.addRow(Lists.newArrayList(PRIORITY_REPAIR, String.valueOf(tabletChecker.getPrioPartitionNum())));<NEW_LINE>result.addRow(Lists.newArrayList(PENDING_TABLETS, String.valueOf(tabletScheduler.getPendingNum())));<NEW_LINE>result.addRow(Lists.newArrayList(RUNNING_TABLETS, String.valueOf(tabletScheduler.getRunningNum())));<NEW_LINE>result.addRow(Lists.newArrayList(HISTORY_TABLETS, String.valueOf(tabletScheduler.getHistoryNum())));<NEW_LINE>return result;<NEW_LINE>}
).size())));
1,342,835
protected ByteBuffer map(int prot, int offset, int length) throws ErrnoException {<NEW_LINE>ReflectionHelpers.callInstanceMethod(realObject, "checkOpen");<NEW_LINE>FileDescriptor fileDescriptor = getRealFileDescriptor();<NEW_LINE>int fd = ReflectionHelpers.getField(fileDescriptor, "fd");<NEW_LINE>File file = filesByFd.get(fd);<NEW_LINE>if (file == null) {<NEW_LINE>throw new IllegalStateException("Cannot find the backing file from fd");<NEW_LINE>}<NEW_LINE>try (RandomAccessFile randomAccessFile = new RandomAccessFile(file, "rw")) {<NEW_LINE>// It would be easy to support a MapMode.READ_ONLY type mapping as well except none of the<NEW_LINE>// OsConstants fields are even initialized by robolectric and so "prot" is always zero!<NEW_LINE>return randomAccessFile.getChannel().map(<MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new ErrnoException(e.getMessage(), OsConstants.EIO, e);<NEW_LINE>}<NEW_LINE>}
MapMode.READ_WRITE, offset, length);
652,143
private void writeEnum(XmlWriter writer, Enum enuum) {<NEW_LINE>XmlAttributes attrs = new XmlAttributes();<NEW_LINE>attrs.addAttribute("NAME", enuum.getDisplayName());<NEW_LINE>attrs.addAttribute("NAMESPACE", enuum.getCategoryPath().getPath());<NEW_LINE>attrs.addAttribute("SIZE", enuum.getLength(), true);<NEW_LINE>writer.startElement("ENUM", attrs);<NEW_LINE>writeRegularComment(writer, enuum.getDescription());<NEW_LINE>String[] names = enuum.getNames();<NEW_LINE>for (String name : names) {<NEW_LINE>attrs = new XmlAttributes();<NEW_LINE>attrs.addAttribute("NAME", name);<NEW_LINE>attrs.addAttribute("VALUE", enuum.getValue(name), true);<NEW_LINE>attrs.addAttribute("COMMENT"<MASK><NEW_LINE>writer.startElement("ENUM_ENTRY", attrs);<NEW_LINE>writer.endElement("ENUM_ENTRY");<NEW_LINE>}<NEW_LINE>writer.endElement("ENUM");<NEW_LINE>}
, enuum.getComment(name));
721,618
public Alarm unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Alarm alarm = new Alarm();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("AlarmName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>alarm.setAlarmName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return alarm;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
1,799,115
public boolean visit(SQLShowColumnsStatement x) {<NEW_LINE>final List<SqlNode> operands = new LinkedList<>();<NEW_LINE>final SqlNode like = convertToSqlNode(x.getLike());<NEW_LINE>final SqlNode where = convertToSqlNode(x.getWhere());<NEW_LINE>final List<SqlSpecialIdentifier> specialIdentifiers = new LinkedList<>();<NEW_LINE>if (x.isFull()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>specialIdentifiers.add(SqlSpecialIdentifier.COLUMNS);<NEW_LINE>int tableIndex = -1;<NEW_LINE>final SqlNode table = convertToSqlNode(x.getTable());<NEW_LINE>if (null != table) {<NEW_LINE>operands.add(SqlLiteral.createSymbol(SqlSpecialIdentifier.FROM, SqlParserPos.ZERO));<NEW_LINE>operands.add(table);<NEW_LINE>tableIndex = specialIdentifiers.size() + operands.size() - 1;<NEW_LINE>}<NEW_LINE>int dbIndex = -1;<NEW_LINE>final SqlNode db = convertToSqlNode(x.getDatabase());<NEW_LINE>if (null != db) {<NEW_LINE>operands.add(SqlLiteral.createSymbol(SqlSpecialIdentifier.FROM, SqlParserPos.ZERO));<NEW_LINE>operands.add(db);<NEW_LINE>dbIndex = specialIdentifiers.size() + operands.size() - 1;<NEW_LINE>}<NEW_LINE>this.sqlNode = new SqlShow(SqlParserPos.ZERO, specialIdentifiers, operands, like, where, null, null, tableIndex, dbIndex, true);<NEW_LINE>return false;<NEW_LINE>}
specialIdentifiers.add(SqlSpecialIdentifier.FULL);
1,617,331
private BLangBlockStmt rewriteNestedOnFail(BLangOnFailClause onFailClause, BLangFail fail) {<NEW_LINE>BLangOnFailClause currentOnFail = this.onFailClause;<NEW_LINE>BLangBlockStmt onFailBody = ASTBuilderUtil.createBlockStmt(onFailClause.pos);<NEW_LINE>onFailBody.stmts.addAll(onFailClause.body.stmts);<NEW_LINE>onFailBody.scope = onFailClause.body.scope;<NEW_LINE>onFailBody.mapSymbol = onFailClause.body.mapSymbol;<NEW_LINE>onFailBody.failureBreakMode = onFailClause.body.failureBreakMode;<NEW_LINE>BVarSymbol onFailErrorVariableSymbol = ((BLangSimpleVariableDef) onFailClause.variableDefinitionNode).var.symbol;<NEW_LINE>BLangSimpleVariable errorVar = ASTBuilderUtil.createVariable(onFailErrorVariableSymbol.pos, onFailErrorVariableSymbol.name.value, onFailErrorVariableSymbol.type, rewrite(fail.expr, env), onFailErrorVariableSymbol);<NEW_LINE>BLangSimpleVariableDef errorVarDef = ASTBuilderUtil.<MASK><NEW_LINE>onFailBody.scope.define(onFailErrorVariableSymbol.name, onFailErrorVariableSymbol);<NEW_LINE>onFailBody.stmts.add(0, errorVarDef);<NEW_LINE>int currentOnFailIndex = this.enclosingOnFailClause.indexOf(this.onFailClause);<NEW_LINE>int enclosingOnFailIndex = currentOnFailIndex <= 0 ? this.enclosingOnFailClause.size() - 1 : (currentOnFailIndex - 1);<NEW_LINE>this.onFailClause = this.enclosingOnFailClause.get(enclosingOnFailIndex);<NEW_LINE>onFailBody = rewrite(onFailBody, env);<NEW_LINE>BLangFail failToEndBlock = new BLangFail();<NEW_LINE>if (onFailClause.isInternal && fail.exprStmt != null) {<NEW_LINE>if (fail.exprStmt instanceof BLangPanic) {<NEW_LINE>setPanicErrorToTrue(onFailBody, onFailClause);<NEW_LINE>} else {<NEW_LINE>onFailBody.stmts.add((BLangStatement) fail.exprStmt);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (onFailClause.bodyContainsFail && !onFailClause.isInternal) {<NEW_LINE>onFailBody.stmts.add(failToEndBlock);<NEW_LINE>}<NEW_LINE>this.onFailClause = currentOnFail;<NEW_LINE>return onFailBody;<NEW_LINE>}
createVariableDef(onFailClause.pos, errorVar);
1,114,644
private void buildEnum(StringBuilder resBuf, Enum type, int size) {<NEW_LINE>resBuf.append("<type");<NEW_LINE>appendNameIdAttributes(resBuf, type);<NEW_LINE>long[<MASK><NEW_LINE>String metatype = "uint";<NEW_LINE>for (long key : keys) {<NEW_LINE>if (key < 0) {<NEW_LINE>metatype = "int";<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SpecXmlUtils.encodeStringAttribute(resBuf, "metatype", metatype);<NEW_LINE>SpecXmlUtils.encodeSignedIntegerAttribute(resBuf, "size", type.getLength());<NEW_LINE>SpecXmlUtils.encodeBooleanAttribute(resBuf, "enum", true);<NEW_LINE>resBuf.append(">\n");<NEW_LINE>for (long key : keys) {<NEW_LINE>resBuf.append("<val");<NEW_LINE>SpecXmlUtils.xmlEscapeAttribute(resBuf, "name", type.getName(key));<NEW_LINE>SpecXmlUtils.encodeSignedIntegerAttribute(resBuf, "value", key);<NEW_LINE>resBuf.append("/>");<NEW_LINE>}<NEW_LINE>resBuf.append("</type>");<NEW_LINE>}
] keys = type.getValues();
649,110
private static Matrix apply(BlasFloatMatrix mat, float alpha, IntFloatVector v1, IntDummyVector v2) {<NEW_LINE>float[] data = mat.getData();<NEW_LINE>int m = mat.getNumRows(), n = mat.getNumCols();<NEW_LINE>assert (m == v1.getDim() && n == v2.getDim());<NEW_LINE>if (v1.isDense()) {<NEW_LINE>float[] v1Values = v1.getStorage().getValues();<NEW_LINE>int size = v2.size();<NEW_LINE>for (int i = 0; i < m; i++) {<NEW_LINE>// row<NEW_LINE>int[] v2Idxs = v2.getIndices();<NEW_LINE>for (int k = 0; k < size; k++) {<NEW_LINE>// col<NEW_LINE>int j = v2Idxs[k];<NEW_LINE>data[i * n + j] += alpha * v1Values[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (v1.isSparse()) {<NEW_LINE>int[] v2Idxs = v2.getIndices();<NEW_LINE>ObjectIterator<Int2FloatMap.Entry> iter = v1.getStorage().entryIterator();<NEW_LINE>int size = v2.size();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>Int2FloatMap.Entry entry = iter.next();<NEW_LINE>// row<NEW_LINE>int i = entry.getIntKey();<NEW_LINE>for (int k = 0; k < size; k++) {<NEW_LINE>// col<NEW_LINE>int j = v2Idxs[k];<NEW_LINE>data[i * n + j] += alpha * entry.getFloatValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int[] v1Idxs = v1.getStorage().getIndices();<NEW_LINE>float[] v1Values = v1.getStorage().getValues();<NEW_LINE>int[] v2Idxs = v2.getIndices();<NEW_LINE><MASK><NEW_LINE>int size2 = v2.size();<NEW_LINE>for (int k = 0; k < size1; k++) {<NEW_LINE>int i = v1Idxs[k];<NEW_LINE>for (int t = 0; t < size2; t++) {<NEW_LINE>int j = v2Idxs[t];<NEW_LINE>data[i * n + j] += alpha * v1Values[k];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return mat;<NEW_LINE>}
int size1 = v1.size();
75,385
protected String buildBaseQuery() {<NEW_LINE>final StringBuilder queryBuf = new StringBuilder(255);<NEW_LINE>if (params.hasConditionQuery()) {<NEW_LINE>appendConditions(queryBuf, params.getConditions());<NEW_LINE>} else {<NEW_LINE>final String query = params.getQuery();<NEW_LINE>if (StringUtil.isNotBlank(query)) {<NEW_LINE>if (ComponentUtil.hasRelatedQueryHelper()) {<NEW_LINE>final RelatedQueryHelper relatedQueryHelper = ComponentUtil.getRelatedQueryHelper();<NEW_LINE>final String[] relatedQueries = relatedQueryHelper.getRelatedQueries(query);<NEW_LINE>if (relatedQueries.length == 0) {<NEW_LINE>appendQuery(queryBuf, query);<NEW_LINE>} else {<NEW_LINE>queryBuf.append('(');<NEW_LINE>queryBuf.append(quote(query));<NEW_LINE>for (final String s : relatedQueries) {<NEW_LINE>queryBuf.append(OR);<NEW_LINE>queryBuf.append(quote(s));<NEW_LINE>}<NEW_LINE>queryBuf.append(')');<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>appendQuery(queryBuf, query);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return queryBuf<MASK><NEW_LINE>}
.toString().trim();
1,037,932
private void recreateCells() {<NEW_LINE>if (cellsMap != null) {<NEW_LINE>Collection<Reference<R>> cells = cellsMap.values();<NEW_LINE>Iterator<Reference<R><MASK><NEW_LINE>while (cellsIter.hasNext()) {<NEW_LINE>Reference<R> cellRef = cellsIter.next();<NEW_LINE>R cell = cellRef.get();<NEW_LINE>if (cell != null) {<NEW_LINE>cell.updateIndex(-1);<NEW_LINE>cell.getSkin().dispose();<NEW_LINE>cell.setSkin(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cellsMap.clear();<NEW_LINE>}<NEW_LINE>ObservableList<? extends TableColumnBase> /*<T,?>*/<NEW_LINE>columns = getVisibleLeafColumns();<NEW_LINE>cellsMap = new WeakHashMap<>(columns.size());<NEW_LINE>fullRefreshCounter = DEFAULT_FULL_REFRESH_COUNTER;<NEW_LINE>getChildren().clear();<NEW_LINE>for (TableColumnBase col : columns) {<NEW_LINE>if (cellsMap.containsKey(col)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// create a TableCell for this column and store it in the cellsMap<NEW_LINE>// for future use<NEW_LINE>createCellAndCache(col);<NEW_LINE>}<NEW_LINE>}
> cellsIter = cells.iterator();
150,127
public static AudioFormat parseWavFormat(InputStream inputStream) throws IOException {<NEW_LINE>try {<NEW_LINE>// arbitrary amount, also used by the underlying parsing package from Sun<NEW_LINE>inputStream.mark(200);<NEW_LINE>javax.sound.sampled.AudioFormat format = AudioSystem.getAudioInputStream(inputStream).getFormat();<NEW_LINE>Encoding javaSoundencoding = format.getEncoding();<NEW_LINE>String codecPCMSignedOrUnsigned;<NEW_LINE>if (Encoding.PCM_SIGNED.equals(javaSoundencoding)) {<NEW_LINE>codecPCMSignedOrUnsigned = AudioFormat.CODEC_PCM_SIGNED;<NEW_LINE>} else if (Encoding.PCM_UNSIGNED.equals(javaSoundencoding)) {<NEW_LINE>codecPCMSignedOrUnsigned = AudioFormat.CODEC_PCM_UNSIGNED;<NEW_LINE>} else if (Encoding.ULAW.equals(javaSoundencoding)) {<NEW_LINE>codecPCMSignedOrUnsigned = AudioFormat.CODEC_PCM_ULAW;<NEW_LINE>} else if (Encoding.ALAW.equals(javaSoundencoding)) {<NEW_LINE>codecPCMSignedOrUnsigned = AudioFormat.CODEC_PCM_ALAW;<NEW_LINE>} else {<NEW_LINE>codecPCMSignedOrUnsigned = null;<NEW_LINE>}<NEW_LINE>Integer bitRate = Math.round(format.getFrameRate() * format.getFrameSize(<MASK><NEW_LINE>Long frequency = Float.valueOf(format.getSampleRate()).longValue();<NEW_LINE>return new AudioFormat(AudioFormat.CONTAINER_WAVE, codecPCMSignedOrUnsigned, format.isBigEndian(), format.getSampleSizeInBits(), bitRate, frequency, format.getChannels());<NEW_LINE>} catch (UnsupportedAudioFileException e) {<NEW_LINE>// do not throw exception and assume default format to let a chance for the sink to play the stream.<NEW_LINE>return DEFAULT_WAVE_AUDIO_FORMAT;<NEW_LINE>} finally {<NEW_LINE>inputStream.reset();<NEW_LINE>}<NEW_LINE>}
)) * format.getChannels();
708,217
private int quicksortPartitionWithIndices(final float[] values, int lower, int upper, boolean yDown, short[] originalIndices) {<NEW_LINE>float x = values[lower];<NEW_LINE>float y = values[lower + 1];<NEW_LINE>int up = upper;<NEW_LINE>int down = lower;<NEW_LINE>float temp;<NEW_LINE>short tempIndex;<NEW_LINE>while (down < up) {<NEW_LINE>while (down < up && values[down] <= x) down = down + 2;<NEW_LINE>if (yDown) {<NEW_LINE>while (values[up] > x || (values[up] == x && values[up + 1] < y)) up = up - 2;<NEW_LINE>} else {<NEW_LINE>while (values[up] > x || (values[up] == x && values[up + 1] > <MASK><NEW_LINE>}<NEW_LINE>if (down < up) {<NEW_LINE>temp = values[down];<NEW_LINE>values[down] = values[up];<NEW_LINE>values[up] = temp;<NEW_LINE>temp = values[down + 1];<NEW_LINE>values[down + 1] = values[up + 1];<NEW_LINE>values[up + 1] = temp;<NEW_LINE>tempIndex = originalIndices[down / 2];<NEW_LINE>originalIndices[down / 2] = originalIndices[up / 2];<NEW_LINE>originalIndices[up / 2] = tempIndex;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (x > values[up] || (x == values[up] && (yDown ? y < values[up + 1] : y > values[up + 1]))) {<NEW_LINE>values[lower] = values[up];<NEW_LINE>values[up] = x;<NEW_LINE>values[lower + 1] = values[up + 1];<NEW_LINE>values[up + 1] = y;<NEW_LINE>tempIndex = originalIndices[lower / 2];<NEW_LINE>originalIndices[lower / 2] = originalIndices[up / 2];<NEW_LINE>originalIndices[up / 2] = tempIndex;<NEW_LINE>}<NEW_LINE>return up;<NEW_LINE>}
y)) up = up - 2;
1,584,171
public void newSpace(Location location, SpaceQuality qual) {<NEW_LINE>entry("newSpace", location, qual);<NEW_LINE>if (qual.size == 0) {<NEW_LINE>reportError(location, "Space definition '" + qual.name + "' missing size attribute");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (qual.size <= 0 || qual.size > 8) {<NEW_LINE>throw new SleighError("Space '" + qual.name + "' has unsupported size: " + qual.size, location);<NEW_LINE>}<NEW_LINE>if (qual.wordsize < 1 || qual.wordsize > 8) {<NEW_LINE>throw new SleighError("Space '" + qual.name + "' has unsupported wordsize: " + qual.wordsize, location);<NEW_LINE>}<NEW_LINE>int addressBits = bitsConsumedByUnitSize(qual.wordsize) + (8 * qual.size);<NEW_LINE>if (addressBits > 64) {<NEW_LINE>throw new SleighError("Space '" + qual.name + "' has unsupported dimensions: requires " + addressBits + " bits -- limit is 64 bits", location);<NEW_LINE>}<NEW_LINE>int delay = (qual.type == space_class.register_space) ? 0 : 1;<NEW_LINE>AddrSpace spc = new AddrSpace(this, spacetype.IPTR_PROCESSOR, qual.name, qual.size, qual.wordsize, numSpaces(<MASK><NEW_LINE>insertSpace(spc);<NEW_LINE>if (qual.isdefault) {<NEW_LINE>if (getDefaultSpace() != null) {<NEW_LINE>reportError(location, "Multiple default spaces -- '" + getDefaultSpace().getName() + "', '" + qual.name + "'");<NEW_LINE>} else {<NEW_LINE>// Make the flagged space<NEW_LINE>setDefaultSpace(spc.getIndex());<NEW_LINE>// the default<NEW_LINE>}<NEW_LINE>}<NEW_LINE>addSymbol(new SpaceSymbol(location, spc));<NEW_LINE>}
), AddrSpace.hasphysical, delay);
1,615,716
public static void vertical9(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 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 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 += <MASK><NEW_LINE>dataDst[indexDst++] = ((total + halfDivisor) / divisor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
(dataSrc[indexSrc]) * k9;
569,321
private void loadNode668() {<NEW_LINE>ServerStatusTypeNode node = new ServerStatusTypeNode(this.context, Identifiers.Server_ServerStatus, new QualifiedName(0, "ServerStatus"), new LocalizedText("en", "ServerStatus"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.ServerStatusDataType, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 1000.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerStatus, Identifiers.HasComponent, Identifiers.Server_ServerStatus_StartTime.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerStatus, Identifiers.HasComponent, Identifiers.Server_ServerStatus_CurrentTime.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerStatus, Identifiers.HasComponent, Identifiers.Server_ServerStatus_State.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerStatus, Identifiers.HasComponent, Identifiers.Server_ServerStatus_BuildInfo.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerStatus, Identifiers.HasComponent, Identifiers.Server_ServerStatus_SecondsTillShutdown<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerStatus, Identifiers.HasComponent, Identifiers.Server_ServerStatus_ShutdownReason.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerStatus, Identifiers.HasTypeDefinition, Identifiers.ServerStatusType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerStatus, Identifiers.HasComponent, Identifiers.Server.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), true));
1,205,173
public MutableHttpResponse<JsonError> processResponse(@NonNull ErrorContext errorContext, @NonNull MutableHttpResponse<?> response) {<NEW_LINE>if (errorContext.getRequest().getMethod() == HttpMethod.HEAD) {<NEW_LINE>return (MutableHttpResponse<JsonError>) response;<NEW_LINE>}<NEW_LINE>JsonError error;<NEW_LINE>if (!errorContext.hasErrors()) {<NEW_LINE>error = new JsonError(response.<MASK><NEW_LINE>} else if (errorContext.getErrors().size() == 1 && !alwaysSerializeErrorsAsList) {<NEW_LINE>Error jsonError = errorContext.getErrors().get(0);<NEW_LINE>error = new JsonError(jsonError.getMessage());<NEW_LINE>jsonError.getPath().ifPresent(error::path);<NEW_LINE>} else {<NEW_LINE>error = new JsonError(response.getStatus().getReason());<NEW_LINE>List<Resource> errors = new ArrayList<>();<NEW_LINE>for (Error jsonError : errorContext.getErrors()) {<NEW_LINE>errors.add(new JsonError(jsonError.getMessage()).path(jsonError.getPath().orElse(null)));<NEW_LINE>}<NEW_LINE>error.embedded("errors", errors);<NEW_LINE>}<NEW_LINE>error.link(Link.SELF, Link.of(errorContext.getRequest().getUri()));<NEW_LINE>return response.body(error).contentType(MediaType.APPLICATION_JSON_TYPE);<NEW_LINE>}
getStatus().getReason());
212,239
private Text rawSynopsisUnitText(Help.ColorScheme colorScheme, Set<ArgSpec> outparam_groupArgs) {<NEW_LINE>String infix = exclusive() ? " | " : " ";<NEW_LINE>Text synopsis = colorScheme.ansi().new Text(0);<NEW_LINE>for (ArgSpec arg : args()) {<NEW_LINE>if (synopsis.length > 0) {<NEW_LINE>synopsis = synopsis.concat(infix);<NEW_LINE>}<NEW_LINE>if (arg instanceof OptionSpec) {<NEW_LINE>synopsis = concatOptionText(synopsis, colorScheme, (OptionSpec) arg);<NEW_LINE>} else {<NEW_LINE>synopsis = concatPositionalText(synopsis, colorScheme, (PositionalParamSpec) arg);<NEW_LINE>}<NEW_LINE>outparam_groupArgs.add(arg);<NEW_LINE>}<NEW_LINE>for (ArgGroupSpec subgroup : subgroups()) {<NEW_LINE>if (synopsis.length > 0) {<NEW_LINE>synopsis = synopsis.concat(infix);<NEW_LINE>}<NEW_LINE>synopsis = synopsis.concat(subgroup<MASK><NEW_LINE>}<NEW_LINE>return synopsis;<NEW_LINE>}
.synopsisText(colorScheme, outparam_groupArgs));
638,601
public void start() {<NEW_LINE>if (current != null) {<NEW_LINE>current.show();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Form hi = new Form("Hi World", new GridLayout(1, 2));<NEW_LINE>hi.setScrollable(false);<NEW_LINE>Container draggable = new Container(new FlowLayout()) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void paint(Graphics g) {<NEW_LINE>super.paint(g);<NEW_LINE>g.setColor(0x0);<NEW_LINE>g.setFont(Font.createSystemFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_SMALL));<NEW_LINE>g.drawString("Draggable", 0, 0);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>draggable.getStyle().setBorder(Border.createLineBorder(1, 0xff0000));<NEW_LINE>draggable.setDraggable(true);<NEW_LINE>draggable.addDropListener(evt -> {<NEW_LINE>System.out.println("Dropped");<NEW_LINE>});<NEW_LINE>Container dropTarget = new Container(new FlowLayout()) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void paint(Graphics g) {<NEW_LINE>super.paint(g);<NEW_LINE>g.setColor(0x0);<NEW_LINE>g.setFont(Font.createSystemFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_SMALL));<NEW_LINE>g.drawString("Drop Target", 0, 0);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>dropTarget.getStyle().setBorder(Border.createLineBorder(1, 0x00ff00));<NEW_LINE>dropTarget.setDropTarget(true);<NEW_LINE>dropTarget.<MASK><NEW_LINE>hi.addAll(draggable, dropTarget);<NEW_LINE>hi.show();<NEW_LINE>}
add(new Label("DropTarget"));
1,516,982
// End of variables declaration//GEN-END:variables<NEW_LINE>private void initUserComponents() {<NEW_LINE>treeView = new BeanTreeView();<NEW_LINE>treeView.setRootVisible(false);<NEW_LINE>treeView.setPopupAllowed(false);<NEW_LINE>treeView<MASK><NEW_LINE>treeView.setDefaultActionAllowed(false);<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(11, 11, 0, 11);<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>gridBagConstraints.weighty = 1.0;<NEW_LINE>add(treeView, gridBagConstraints);<NEW_LINE>jLblTreeView.setLabelFor(treeView.getViewport().getView());<NEW_LINE>treeView.getAccessibleContext().setAccessibleName(NbBundle.getMessage(SaasExplorerPanel.class, "ACSD_RESTResourcesTreeView"));<NEW_LINE>treeView.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(SaasExplorerPanel.class, "ACSD_RESTResourcesTreeView"));<NEW_LINE>}
.setBorder(new EtchedBorder());
883,159
protected Object decode(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {<NEW_LINE>Parser parser = new Parser(PATTERN, (String) msg);<NEW_LINE>if (!parser.matches()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next().trim());<NEW_LINE>if (deviceSession == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Position position = new Position(getProtocolName());<NEW_LINE>position.setDeviceId(deviceSession.getDeviceId());<NEW_LINE>if (parser.hasNext()) {<NEW_LINE>position.set(Position.KEY_ALARM, decodeAlarm(parser.next().charAt(0)));<NEW_LINE>}<NEW_LINE>DateBuilder dateBuilder = new DateBuilder().setTime(parser.nextInt(0), parser.nextInt(0), parser.nextInt(0), parser.nextInt(0));<NEW_LINE>position.setValid(parser.next().equals("A"));<NEW_LINE>position.setLatitude(parser.nextCoordinate());<NEW_LINE>position.setLongitude(parser.nextCoordinate());<NEW_LINE>position.setSpeed(parser.nextDouble(0));<NEW_LINE>position.setCourse<MASK><NEW_LINE>dateBuilder.setDateReverse(parser.nextInt(0), parser.nextInt(0), parser.nextInt(0));<NEW_LINE>position.setTime(dateBuilder.getDate());<NEW_LINE>position.set(Position.KEY_HDOP, parser.nextDouble());<NEW_LINE>position.setAltitude(parser.nextDouble(0));<NEW_LINE>return position;<NEW_LINE>}
(parser.nextDouble(0));
220,776
private void jbInit() throws Exception {<NEW_LINE>this.setTitle(Services.get(IMsgBL.class).translate(Env.getCtx(), "About"));<NEW_LINE>//<NEW_LINE>setResizable(false);<NEW_LINE>labelHeading.setFont(new java.awt.Font("Dialog", 1, 14));<NEW_LINE>labelHeading.setHorizontalAlignment(SwingConstants.CENTER);<NEW_LINE>labelHeading.setHorizontalTextPosition(SwingConstants.CENTER);<NEW_LINE>labelHeading.setText(Adempiere.getSubtitle());<NEW_LINE>labelVersion.setHorizontalAlignment(SwingConstants.CENTER);<NEW_LINE>labelVersion.setHorizontalTextPosition(SwingConstants.CENTER);<NEW_LINE>labelVersion.setText(".");<NEW_LINE>labelCopyright.setHorizontalAlignment(SwingConstants.CENTER);<NEW_LINE>labelCopyright.setHorizontalTextPosition(SwingConstants.CENTER);<NEW_LINE>labelCopyright.setText(".");<NEW_LINE>final JLabel labelURL = createURLLabel(Adempiere.getURL());<NEW_LINE>//<NEW_LINE>imageControl.setFont(UIManager.getFont(MetasFreshTheme.KEY_Logo_TextFontSmall));<NEW_LINE>imageControl.setForeground(UIManager.getColor(MetasFreshTheme.KEY_Logo_TextColor));<NEW_LINE>imageControl.setAlignmentX((float) 0.5);<NEW_LINE>imageControl.setHorizontalAlignment(SwingConstants.CENTER);<NEW_LINE>imageControl.setHorizontalTextPosition(SwingConstants.CENTER);<NEW_LINE>final Image productLogo = Adempiere.getProductLogoLarge();<NEW_LINE>if (productLogo != null) {<NEW_LINE>imageControl.setIcon(new ImageIcon(productLogo));<NEW_LINE>}<NEW_LINE>imageControl.setText(Adempiere.getSubtitle());<NEW_LINE><MASK><NEW_LINE>//<NEW_LINE>mainPanel.setLayout(mainLayout);<NEW_LINE>mainLayout.setHgap(10);<NEW_LINE>mainLayout.setVgap(10);<NEW_LINE>northPanel.setLayout(northLayout);<NEW_LINE>northLayout.setHgap(10);<NEW_LINE>northLayout.setVgap(10);<NEW_LINE>panel.setLayout(panelLayout);<NEW_LINE>panelLayout.setHgap(10);<NEW_LINE>panelLayout.setVgap(10);<NEW_LINE>headerPanel.setLayout(headerLayout);<NEW_LINE>headerLayout.setColumns(1);<NEW_LINE>headerLayout.setRows(4);<NEW_LINE>//<NEW_LINE>// Configure info text area:<NEW_LINE>// readonly<NEW_LINE>infoArea.setReadWrite(false);<NEW_LINE>// don't wrap lines, we will use horizontal scroll bars<NEW_LINE>infoArea.setLineWrap(false);<NEW_LINE>infoArea.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);<NEW_LINE>infoArea.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);<NEW_LINE>this.getContentPane().add(panel, null);<NEW_LINE>panel.add(northPanel, BorderLayout.NORTH);<NEW_LINE>northPanel.add(imageControl, BorderLayout.WEST);<NEW_LINE>northPanel.add(headerPanel, BorderLayout.CENTER);<NEW_LINE>headerPanel.add(labelHeading, null);<NEW_LINE>headerPanel.add(labelCopyright, null);<NEW_LINE>headerPanel.add(labelVersion, null);<NEW_LINE>headerPanel.add(labelURL, null);<NEW_LINE>panel.add(mainPanel, BorderLayout.CENTER);<NEW_LINE>mainPanel.add(infoArea, BorderLayout.CENTER);<NEW_LINE>mainPanel.add(confirmPanel, BorderLayout.SOUTH);<NEW_LINE>confirmPanel.setActionListener(this);<NEW_LINE>}
imageControl.setVerticalTextPosition(SwingConstants.BOTTOM);
674,840
private static void toSlime(Cursor summaryObject, ConvergenceSummary summary) {<NEW_LINE>summaryObject.setLong("nodes", summary.nodes());<NEW_LINE>summaryObject.setLong("down", summary.down());<NEW_LINE>summaryObject.setLong(<MASK><NEW_LINE>summaryObject.setLong("upgrading", summary.upgradingPlatform());<NEW_LINE>summaryObject.setLong("needReboot", summary.needReboot());<NEW_LINE>summaryObject.setLong("rebooting", summary.rebooting());<NEW_LINE>summaryObject.setLong("needRestart", summary.needRestart());<NEW_LINE>summaryObject.setLong("restarting", summary.restarting());<NEW_LINE>summaryObject.setLong("upgradingOs", summary.upgradingOs());<NEW_LINE>summaryObject.setLong("upgradingFirmware", summary.upgradingFirmware());<NEW_LINE>summaryObject.setLong("services", summary.services());<NEW_LINE>summaryObject.setLong("needNewConfig", summary.needNewConfig());<NEW_LINE>summaryObject.setLong("retiring", summary.retiring());<NEW_LINE>}
"needPlatformUpgrade", summary.needPlatformUpgrade());
765,886
private LLVMValueRef buildCompressFunction(boolean nonNull, int shift) {<NEW_LINE>String funcName = COMPRESS_FUNCTION_BASE_NAME + (nonNull ? "_nonNull" : "") + "_" + shift;<NEW_LINE>LLVMValueRef func = builder.addFunction(funcName, builder.functionType(builder.objectType(true), builder.objectType(false), builder.wordType()));<NEW_LINE>LLVMIRBuilder.setLinkage(func, LinkageType.LinkOnce);<NEW_LINE>builder.setFunctionAttribute(func, Attribute.AlwaysInline);<NEW_LINE>builder.setFunctionAttribute(func, Attribute.GCLeafFunction);<NEW_LINE>LLVMBasicBlockRef block = <MASK><NEW_LINE>builder.positionAtEnd(block);<NEW_LINE>LLVMValueRef uncompressed = builder.buildPtrToInt(LLVMIRBuilder.getParam(func, 0));<NEW_LINE>LLVMValueRef heapBase = LLVMIRBuilder.getParam(func, 1);<NEW_LINE>LLVMValueRef compressed = builder.buildSub(uncompressed, heapBase);<NEW_LINE>if (!nonNull) {<NEW_LINE>LLVMValueRef isNull = builder.buildIsNull(uncompressed);<NEW_LINE>compressed = builder.buildSelect(isNull, uncompressed, compressed);<NEW_LINE>}<NEW_LINE>if (shift != 0) {<NEW_LINE>compressed = builder.buildShr(compressed, builder.constantInt(shift));<NEW_LINE>}<NEW_LINE>compressed = builder.buildLLVMIntToPtr(compressed, builder.objectType(true));<NEW_LINE>builder.buildRet(compressed);<NEW_LINE>return func;<NEW_LINE>}
builder.appendBasicBlock(func, "main");
853,694
final CreateTrafficPolicyInstanceResult executeCreateTrafficPolicyInstance(CreateTrafficPolicyInstanceRequest createTrafficPolicyInstanceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createTrafficPolicyInstanceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateTrafficPolicyInstanceRequest> request = null;<NEW_LINE>Response<CreateTrafficPolicyInstanceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateTrafficPolicyInstanceRequestMarshaller().marshall(super.beforeMarshalling(createTrafficPolicyInstanceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Route 53");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateTrafficPolicyInstance");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<CreateTrafficPolicyInstanceResult> responseHandler = new StaxResponseHandler<CreateTrafficPolicyInstanceResult>(new CreateTrafficPolicyInstanceResultStaxUnmarshaller());<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.CLIENT_ENDPOINT, endpoint);
357,813
private void callChangeObserver(FindResults results) {<NEW_LINE>int n;<NEW_LINE>log(lvl, "changes: %d in: %s", results.size(), observedRegion);<NEW_LINE>for (String name : eventNames.keySet()) {<NEW_LINE>if (eventTypes.get(name) != ObserveEvent.Type.CHANGE) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>n = (<MASK><NEW_LINE>List<Match> changes = new ArrayList<Match>();<NEW_LINE>for (int i = 0; i < results.size(); i++) {<NEW_LINE>FindResult r = results.get(i);<NEW_LINE>if (r.getW() * r.getH() >= n) {<NEW_LINE>changes.add(observedRegion.toGlobalCoord(new Match(r, observedRegion.getScreen())));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (changes.size() > 0) {<NEW_LINE>long now = (new Date()).getTime();<NEW_LINE>eventCounts.put(name, eventCounts.get(name) + 1);<NEW_LINE>ObserveEvent observeEvent = new ObserveEvent(name, ObserveEvent.Type.CHANGE, null, null, observedRegion, now);<NEW_LINE>observeEvent.setChanges(changes);<NEW_LINE>observeEvent.setIndex(n);<NEW_LINE>Observing.addEvent(observeEvent);<NEW_LINE>Object callBack = eventCallBacks.get(name);<NEW_LINE>if (callBack != null) {<NEW_LINE>log(lvl, "running call back");<NEW_LINE>((ObserverCallBack) callBack).changed(observeEvent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Integer) eventNames.get(name);
1,507,625
public Event fromStore(Result result) {<NEW_LINE>if (result == null)<NEW_LINE>return null;<NEW_LINE>Event evt = new Event();<NEW_LINE>evt.setUuid(Bytes.toString(result.getValue(B_AUDIT_CF, B_EVENT_UID)));<NEW_LINE>evt.setSource(Bytes.toString(result.<MASK><NEW_LINE>evt.setType(Bytes.toString(result.getValue(B_AUDIT_CF, B_EVENT_TYPE)));<NEW_LINE>evt.setName(Bytes.toString(result.getValue(B_AUDIT_CF, B_EVENT_NAME)));<NEW_LINE>evt.setAction(Bytes.toString(result.getValue(B_AUDIT_CF, B_EVENT_ACTION)));<NEW_LINE>evt.setDuration(Bytes.toLong(result.getValue(B_AUDIT_CF, B_EVENT_DURATION)));<NEW_LINE>evt.setHostName(Bytes.toString(result.getValue(B_AUDIT_CF, B_EVENT_HOSTNAME)));<NEW_LINE>evt.setUser(Bytes.toString(result.getValue(B_AUDIT_CF, B_EVENT_USER)));<NEW_LINE>evt.setValue(Bytes.toString(result.getValue(B_AUDIT_CF, B_EVENT_VALUE)));<NEW_LINE>evt.setTimestamp(Bytes.toLong(result.getValue(B_AUDIT_CF, B_EVENT_TIME)));<NEW_LINE>evt.setCustomKeys(MappingUtil.toMap(Bytes.toString(result.getValue(B_AUDIT_CF, B_EVENT_KEYS))));<NEW_LINE>return evt;<NEW_LINE>}
getValue(B_AUDIT_CF, B_EVENT_SOURCE)));
158,473
public void config(EndpointInfoBuilderContext context, EndpointInfo endpointInfo) {<NEW_LINE>InfoStore infoStore = context.getInfoStore();<NEW_LINE>ClassInfo implBeanClassInfo = infoStore.getDelayableClassInfo(endpointInfo.getImplBeanClassName());<NEW_LINE>String seiClassName = endpointInfo.getServiceEndpointInterface();<NEW_LINE>// first set targetNamespace and interface targetNamespace<NEW_LINE>endpointInfo.setTargetNamespaceURL(JaxWsUtils.getImplementedTargetNamespace(implBeanClassInfo));<NEW_LINE>endpointInfo.setInterfaceTragetNameSpaceURL(JaxWsUtils.getInterfaceTargetNamespace(implBeanClassInfo, seiClassName, endpointInfo.getTargetNamespaceURL(), infoStore));<NEW_LINE>endpointInfo.setWsdlService(JaxWsUtils.getServiceQName(implBeanClassInfo, seiClassName, endpointInfo.getTargetNamespaceURL()));<NEW_LINE>endpointInfo.setWsdlPort(JaxWsUtils.getPortQName(implBeanClassInfo, seiClassName, endpointInfo.getTargetNamespaceURL()));<NEW_LINE>endpointInfo.setPortComponentName(JaxWsUtils.getPortComponentName(implBeanClassInfo, seiClassName, infoStore));<NEW_LINE>if (endpointInfo.getAddresses().length == 0) {<NEW_LINE>endpointInfo.addAddress("/" + JaxWsUtils.getServiceName(implBeanClassInfo));<NEW_LINE>}<NEW_LINE>endpointInfo.setWsdlLocation(JaxWsUtils.getWSDLLocation(implBeanClassInfo, seiClassName, infoStore));<NEW_LINE>configMTOMFeatureInfo(implBeanClassInfo, seiClassName, infoStore, endpointInfo);<NEW_LINE>configAddressingFeatureInfo(implBeanClassInfo, seiClassName, infoStore, endpointInfo, context);<NEW_LINE>configRespectBindingFeatureInfo(implBeanClassInfo, seiClassName, infoStore, endpointInfo);<NEW_LINE>configProtocolBinding(implBeanClassInfo, seiClassName, infoStore, endpointInfo);<NEW_LINE>configServiceMode(implBeanClassInfo, seiClassName, infoStore, endpointInfo);<NEW_LINE>HandlerChainInfoBuilder handlerChainBuilder = new HandlerChainInfoBuilder(JaxWsUtils.getModuleInfo(context.getContainer<MASK><NEW_LINE>endpointInfo.setHandlerChainsInfo(handlerChainBuilder.buildHandlerChainsInfoFromAnnotation(implBeanClassInfo, seiClassName, infoStore, endpointInfo.getWsdlPort(), endpointInfo.getWsdlService(), endpointInfo.getProtocolBinding()));<NEW_LINE>}
()).getClassLoader());
1,589,206
public void processOpts() {<NEW_LINE>super.processOpts();<NEW_LINE>if (additionalProperties.containsKey(CodegenConstants.OPTIONAL_PROJECT_GUID)) {<NEW_LINE>setPackageGuid((String) additionalProperties.get(CodegenConstants.OPTIONAL_PROJECT_GUID));<NEW_LINE>}<NEW_LINE>additionalProperties.put("packageGuid", packageGuid);<NEW_LINE>if (additionalProperties.containsKey(USE_SWASHBUCKLE)) {<NEW_LINE>useSwashbuckle = convertPropertyToBooleanAndWriteBack(USE_SWASHBUCKLE);<NEW_LINE>} else {<NEW_LINE>additionalProperties.put(USE_SWASHBUCKLE, useSwashbuckle);<NEW_LINE>}<NEW_LINE>additionalProperties.put(PROJECT_SDK, projectSdk);<NEW_LINE>String authFolder = sourceFolder + File.separator + "auth";<NEW_LINE>String implFolder = sourceFolder + File.separator + "impl";<NEW_LINE>String helperFolder = sourceFolder + File.separator + "helpers";<NEW_LINE>supportingFiles.add(new SupportingFile("build.sh.mustache", projectFolder, "build.sh"));<NEW_LINE>supportingFiles.add(new SupportingFile("build.bat.mustache", projectFolder, "build.bat"));<NEW_LINE>supportingFiles.add(new SupportingFile("README.mustache", projectFolder, "README.md"));<NEW_LINE>supportingFiles.add(new SupportingFile("gitignore.mustache", projectFolder, ".gitignore"));<NEW_LINE>supportingFiles.add(new SupportingFile("Project.fsproj.mustache", sourceFolder, packageName + ".fsproj"));<NEW_LINE>supportingFiles.add(new SupportingFile("Program.mustache", sourceFolder, "Program.fs"));<NEW_LINE>supportingFiles.add(new SupportingFile<MASK><NEW_LINE>supportingFiles.add(new SupportingFile("Helpers.mustache", helperFolder, "Helpers.fs"));<NEW_LINE>supportingFiles.add(new SupportingFile("CustomHandlers.mustache", implFolder, "CustomHandlers.fs"));<NEW_LINE>supportingFiles.add(new SupportingFile("Project.Tests.fsproj.mustache", testFolder, packageName + "Tests.fsproj"));<NEW_LINE>supportingFiles.add(new SupportingFile("TestHelper.mustache", testFolder, "TestHelper.fs"));<NEW_LINE>// TODO - support Swashbuckle<NEW_LINE>if (useSwashbuckle)<NEW_LINE>LOGGER.warn("Swashbuckle flag not currently supported, this will be ignored.");<NEW_LINE>}
("AuthSchemes.mustache", authFolder, "AuthSchemes.fs"));
1,008,669
public static void showImageHttpPath(Context a, String path) {<NEW_LINE>final <MASK><NEW_LINE>builder.requestWindowFeature(Window.FEATURE_NO_TITLE);<NEW_LINE>builder.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));<NEW_LINE>builder.setOnDismissListener(new DialogInterface.OnDismissListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onDismiss(DialogInterface dialogInterface) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>final ScaledImageView imageView = new ScaledImageView(a);<NEW_LINE>imageView.setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>builder.dismiss();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Glide.with(LibreraApp.context).asBitmap().load(path).into(imageView);<NEW_LINE>RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams((int) (Dips.screenWidth() * 0.9), (int) (Dips.screenHeight() * 0.9));<NEW_LINE>builder.addContentView(imageView, params);<NEW_LINE>builder.show();<NEW_LINE>}
Dialog builder = new Dialog(a);
782,176
public ChannelMembershipPreferences unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ChannelMembershipPreferences channelMembershipPreferences = new ChannelMembershipPreferences();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("PushNotifications", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>channelMembershipPreferences.setPushNotifications(PushNotificationPreferencesJsonUnmarshaller.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 channelMembershipPreferences;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
1,835,078
public int compare(File f1, File f2) {<NEW_LINE>String s1 = f1.getName();<NEW_LINE>String s2 = f2.getName();<NEW_LINE>// For directories that are only numbers and files named part.*.log|txt<NEW_LINE>Matcher m1 = FileUtils.file_Pattern.matcher(s1);<NEW_LINE>Matcher m2 = <MASK><NEW_LINE>boolean bothMatch = false;<NEW_LINE>if (m1.matches() && m2.matches()) {<NEW_LINE>bothMatch = true;<NEW_LINE>} else {<NEW_LINE>m1 = FileUtils.dir_Pattern.matcher(s1);<NEW_LINE>m2 = FileUtils.dir_Pattern.matcher(s2);<NEW_LINE>if (m1.matches() && m2.matches()) {<NEW_LINE>bothMatch = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (bothMatch) {<NEW_LINE>return Integer.parseInt(m1.group(1)) - Integer.parseInt(m2.group(1));<NEW_LINE>}<NEW_LINE>// For everything else<NEW_LINE>return s1.compareTo(s2);<NEW_LINE>}
FileUtils.file_Pattern.matcher(s2);
1,354,319
public void paintDeterminate(Graphics g, JComponent c) {<NEW_LINE>if (!(g instanceof Graphics2D)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// area for border<NEW_LINE>Insets b = progressBar.getInsets();<NEW_LINE>int barRectWidth = progressBar.getWidth() - (b.right + b.left);<NEW_LINE>int barRectHeight = progressBar.getHeight() - (b.top + b.bottom);<NEW_LINE>if (barRectWidth <= 0 || barRectHeight <= 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int amountFull = getAmountFull(b, barRectWidth, barRectHeight);<NEW_LINE>if (progressBar.getOrientation() == JProgressBar.HORIZONTAL) {<NEW_LINE>g.setColor(progressBar.getForeground());<NEW_LINE>g.fillRect(b.left, <MASK><NEW_LINE>} else {<NEW_LINE>// VERTICAL<NEW_LINE>}<NEW_LINE>if (progressBar.isStringPainted()) {<NEW_LINE>paintString(g, b.left, b.top, barRectWidth, barRectHeight, amountFull, b);<NEW_LINE>}<NEW_LINE>}
b.top, amountFull, barRectHeight);
1,269,633
private int insertReturnAndIndent(final List<FormatterToken> argList, final int argIndex, final int argIndent) {<NEW_LINE>if (functionBracket.contains(Boolean.TRUE))<NEW_LINE>return 0;<NEW_LINE>try {<NEW_LINE>final String defaultLineSeparator = getDefaultLineSeparator();<NEW_LINE>StringBuilder s = new StringBuilder(defaultLineSeparator);<NEW_LINE>for (int index = 0; index < argIndent; index++) {<NEW_LINE>s.append(formatterCfg.getIndentString());<NEW_LINE>}<NEW_LINE>if (argIndex > 0) {<NEW_LINE>final FormatterToken token = argList.get(argIndex);<NEW_LINE>final FormatterToken prevToken = argList.get(argIndex - 1);<NEW_LINE>if (token.getType() == TokenType.COMMENT && isCommentLine(sqlDialect, token.getString()) && prevToken.getType() != TokenType.END) {<NEW_LINE>s.setCharAt(0, ' ');<NEW_LINE>s.setLength(1);<NEW_LINE>final String comment = token.getString();<NEW_LINE>final String withoutTrailingWhitespace = comment.replaceFirst("\\s*$", "");<NEW_LINE>token.setString(withoutTrailingWhitespace);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>FormatterToken token = argList.get(argIndex);<NEW_LINE>if (token.getType() == TokenType.SPACE) {<NEW_LINE>token.<MASK><NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>boolean isDelimiter = statementDelimiters.contains(token.getString().toUpperCase(Locale.ENGLISH));<NEW_LINE>if (!isDelimiter) {<NEW_LINE>token = argList.get(argIndex - 1);<NEW_LINE>if (token.getType() == TokenType.SPACE) {<NEW_LINE>token.setString(s.toString());<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isDelimiter) {<NEW_LINE>if (argList.size() > argIndex + 1) {<NEW_LINE>String string = s.toString();<NEW_LINE>argList.add(argIndex + 1, new FormatterToken(TokenType.SPACE, string + string));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>argList.add(argIndex, new FormatterToken(TokenType.SPACE, s.toString()));<NEW_LINE>}<NEW_LINE>return 1;<NEW_LINE>} catch (IndexOutOfBoundsException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>}
setString(s.toString());
334,234
public static DescribePdnsThreatStatisticsResponse unmarshall(DescribePdnsThreatStatisticsResponse describePdnsThreatStatisticsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describePdnsThreatStatisticsResponse.setRequestId<MASK><NEW_LINE>describePdnsThreatStatisticsResponse.setTotalCount(_ctx.longValue("DescribePdnsThreatStatisticsResponse.TotalCount"));<NEW_LINE>describePdnsThreatStatisticsResponse.setPageSize(_ctx.longValue("DescribePdnsThreatStatisticsResponse.PageSize"));<NEW_LINE>describePdnsThreatStatisticsResponse.setPageNumber(_ctx.longValue("DescribePdnsThreatStatisticsResponse.PageNumber"));<NEW_LINE>List<StatisticItem> data = new ArrayList<StatisticItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribePdnsThreatStatisticsResponse.Data.Length"); i++) {<NEW_LINE>StatisticItem statisticItem = new StatisticItem();<NEW_LINE>statisticItem.setSubDomain(_ctx.stringValue("DescribePdnsThreatStatisticsResponse.Data[" + i + "].SubDomain"));<NEW_LINE>statisticItem.setUdpTotalCount(_ctx.longValue("DescribePdnsThreatStatisticsResponse.Data[" + i + "].UdpTotalCount"));<NEW_LINE>statisticItem.setTotalCount(_ctx.longValue("DescribePdnsThreatStatisticsResponse.Data[" + i + "].TotalCount"));<NEW_LINE>statisticItem.setSourceIp(_ctx.stringValue("DescribePdnsThreatStatisticsResponse.Data[" + i + "].SourceIp"));<NEW_LINE>statisticItem.setThreatLevel(_ctx.stringValue("DescribePdnsThreatStatisticsResponse.Data[" + i + "].ThreatLevel"));<NEW_LINE>statisticItem.setDomainName(_ctx.stringValue("DescribePdnsThreatStatisticsResponse.Data[" + i + "].DomainName"));<NEW_LINE>statisticItem.setThreatType(_ctx.stringValue("DescribePdnsThreatStatisticsResponse.Data[" + i + "].ThreatType"));<NEW_LINE>statisticItem.setMaxThreatLevel(_ctx.stringValue("DescribePdnsThreatStatisticsResponse.Data[" + i + "].MaxThreatLevel"));<NEW_LINE>statisticItem.setLatestThreatTime(_ctx.longValue("DescribePdnsThreatStatisticsResponse.Data[" + i + "].LatestThreatTime"));<NEW_LINE>statisticItem.setDohTotalCount(_ctx.longValue("DescribePdnsThreatStatisticsResponse.Data[" + i + "].DohTotalCount"));<NEW_LINE>statisticItem.setDomainCount(_ctx.longValue("DescribePdnsThreatStatisticsResponse.Data[" + i + "].DomainCount"));<NEW_LINE>data.add(statisticItem);<NEW_LINE>}<NEW_LINE>describePdnsThreatStatisticsResponse.setData(data);<NEW_LINE>return describePdnsThreatStatisticsResponse;<NEW_LINE>}
(_ctx.stringValue("DescribePdnsThreatStatisticsResponse.RequestId"));
1,710,445
private void determineProsodicSettings(Document doc) {<NEW_LINE>// Determine the prosodic setting for each prosody element<NEW_LINE>NodeList prosodies = doc.getElementsByTagName(MaryXML.PROSODY);<NEW_LINE>for (int i = 0; i < prosodies.getLength(); i++) {<NEW_LINE>Element prosody = (Element) prosodies.item(i);<NEW_LINE>ProsodicSettings settings = new ProsodicSettings();<NEW_LINE>// Neutral default settings:<NEW_LINE>ProsodicSettings parentSettings = new ProsodicSettings();<NEW_LINE>// Obtain parent settings, if any:<NEW_LINE>Element ancestor = (Element) MaryDomUtils.getAncestor(prosody, MaryXML.PROSODY);<NEW_LINE>if (ancestor != null) {<NEW_LINE>ProsodicSettings testSettings = (ProsodicSettings) prosodyMap.get(ancestor);<NEW_LINE>if (testSettings != null) {<NEW_LINE>parentSettings = testSettings;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Only accept relative changes, i.e. percentage delta:<NEW_LINE>settings.setRate(parentSettings.rate() + getPercentageDelta(prosody.getAttribute("rate")));<NEW_LINE>settings.setAccentProminence(parentSettings.accentProminence() + getPercentageDelta(prosody.getAttribute("accent-prominence")));<NEW_LINE>settings.setAccentSlope(parentSettings.accentSlope() + getPercentageDelta(prosody.getAttribute("accent-slope")));<NEW_LINE>settings.setNumberOfPauses(parentSettings.numberOfPauses() + getPercentageDelta(prosody.getAttribute("number-of-pauses")));<NEW_LINE>settings.setPauseDuration(parentSettings.pauseDuration() + getPercentageDelta(prosody.getAttribute("pause-duration")));<NEW_LINE>settings.setVowelDuration(parentSettings.vowelDuration() + getPercentageDelta(prosody.getAttribute("vowel-duration")));<NEW_LINE>settings.setPlosiveDuration(parentSettings.plosiveDuration() + getPercentageDelta(prosody.getAttribute("plosive-duration")));<NEW_LINE>settings.setFricativeDuration(parentSettings.fricativeDuration() + getPercentageDelta(<MASK><NEW_LINE>settings.setNasalDuration(parentSettings.nasalDuration() + getPercentageDelta(prosody.getAttribute("nasal-duration")));<NEW_LINE>settings.setLiquidDuration(parentSettings.liquidDuration() + getPercentageDelta(prosody.getAttribute("liquid-duration")));<NEW_LINE>settings.setGlideDuration(parentSettings.glideDuration() + getPercentageDelta(prosody.getAttribute("glide-duration")));<NEW_LINE>String sVolume = prosody.getAttribute("volume");<NEW_LINE>if (sVolume.equals("")) {<NEW_LINE>settings.setVolume(parentSettings.volume());<NEW_LINE>} else if (isPercentageDelta(sVolume)) {<NEW_LINE>int newVolume = parentSettings.volume() + getPercentageDelta(sVolume);<NEW_LINE>if (newVolume < 0)<NEW_LINE>newVolume = 0;<NEW_LINE>else if (newVolume > 100)<NEW_LINE>newVolume = 100;<NEW_LINE>settings.setVolume(newVolume);<NEW_LINE>} else if (isUnsignedNumber(sVolume)) {<NEW_LINE>settings.setVolume(getUnsignedNumber(sVolume));<NEW_LINE>} else if (sVolume.equals("silent")) {<NEW_LINE>settings.setVolume(0);<NEW_LINE>} else if (sVolume.equals("soft")) {<NEW_LINE>settings.setVolume(25);<NEW_LINE>} else if (sVolume.equals("medium")) {<NEW_LINE>settings.setVolume(50);<NEW_LINE>} else if (sVolume.equals("loud")) {<NEW_LINE>settings.setVolume(75);<NEW_LINE>}<NEW_LINE>prosodyMap.put(prosody, settings);<NEW_LINE>}<NEW_LINE>}
prosody.getAttribute("fricative-duration")));
766,789
public static GetVideoInfoResponse unmarshall(GetVideoInfoResponse getVideoInfoResponse, UnmarshallerContext _ctx) {<NEW_LINE>getVideoInfoResponse.setRequestId(_ctx.stringValue("GetVideoInfoResponse.RequestId"));<NEW_LINE>getVideoInfoResponse.setAI(_ctx.stringValue("GetVideoInfoResponse.AI"));<NEW_LINE>Video video = new Video();<NEW_LINE>video.setVideoId(_ctx.stringValue("GetVideoInfoResponse.Video.VideoId"));<NEW_LINE>video.setTitle(_ctx.stringValue("GetVideoInfoResponse.Video.Title"));<NEW_LINE>video.setTags(_ctx.stringValue("GetVideoInfoResponse.Video.Tags"));<NEW_LINE>video.setStatus(_ctx.stringValue("GetVideoInfoResponse.Video.Status"));<NEW_LINE>video.setSize(_ctx.longValue("GetVideoInfoResponse.Video.Size"));<NEW_LINE>video.setDuration(_ctx.floatValue("GetVideoInfoResponse.Video.Duration"));<NEW_LINE>video.setDescription(_ctx.stringValue("GetVideoInfoResponse.Video.Description"));<NEW_LINE>video.setCreateTime(_ctx.stringValue("GetVideoInfoResponse.Video.CreateTime"));<NEW_LINE>video.setModifyTime(_ctx.stringValue("GetVideoInfoResponse.Video.ModifyTime"));<NEW_LINE>video.setModificationTime(_ctx.stringValue("GetVideoInfoResponse.Video.ModificationTime"));<NEW_LINE>video.setCreationTime<MASK><NEW_LINE>video.setCoverURL(_ctx.stringValue("GetVideoInfoResponse.Video.CoverURL"));<NEW_LINE>video.setCateId(_ctx.longValue("GetVideoInfoResponse.Video.CateId"));<NEW_LINE>video.setCateName(_ctx.stringValue("GetVideoInfoResponse.Video.CateName"));<NEW_LINE>video.setDownloadSwitch(_ctx.stringValue("GetVideoInfoResponse.Video.DownloadSwitch"));<NEW_LINE>video.setTemplateGroupId(_ctx.stringValue("GetVideoInfoResponse.Video.TemplateGroupId"));<NEW_LINE>video.setPreprocessStatus(_ctx.stringValue("GetVideoInfoResponse.Video.PreprocessStatus"));<NEW_LINE>video.setStorageLocation(_ctx.stringValue("GetVideoInfoResponse.Video.StorageLocation"));<NEW_LINE>video.setRegionId(_ctx.stringValue("GetVideoInfoResponse.Video.RegionId"));<NEW_LINE>video.setCustomMediaInfo(_ctx.stringValue("GetVideoInfoResponse.Video.CustomMediaInfo"));<NEW_LINE>video.setAuditStatus(_ctx.stringValue("GetVideoInfoResponse.Video.AuditStatus"));<NEW_LINE>video.setAppId(_ctx.stringValue("GetVideoInfoResponse.Video.AppId"));<NEW_LINE>List<String> snapshots = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetVideoInfoResponse.Video.Snapshots.Length"); i++) {<NEW_LINE>snapshots.add(_ctx.stringValue("GetVideoInfoResponse.Video.Snapshots[" + i + "]"));<NEW_LINE>}<NEW_LINE>video.setSnapshots(snapshots);<NEW_LINE>List<Thumbnail> thumbnailList = new ArrayList<Thumbnail>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetVideoInfoResponse.Video.ThumbnailList.Length"); i++) {<NEW_LINE>Thumbnail thumbnail = new Thumbnail();<NEW_LINE>thumbnail.setURL(_ctx.stringValue("GetVideoInfoResponse.Video.ThumbnailList[" + i + "].URL"));<NEW_LINE>thumbnailList.add(thumbnail);<NEW_LINE>}<NEW_LINE>video.setThumbnailList(thumbnailList);<NEW_LINE>getVideoInfoResponse.setVideo(video);<NEW_LINE>return getVideoInfoResponse;<NEW_LINE>}
(_ctx.stringValue("GetVideoInfoResponse.Video.CreationTime"));
1,391,821
public BooleanWithReason check() {<NEW_LINE>//<NEW_LINE>// Group candidates by orders<NEW_LINE>final HashMap<OrderId, Order> orders = new HashMap<>();<NEW_LINE>for (final ShipmentScheduleWithHU candidate : candidates) {<NEW_LINE>final OrderId orderId = candidate.getOrderId();<NEW_LINE>if (orderId == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final Order order = orders.computeIfAbsent(orderId, Order::new);<NEW_LINE>order.addShipmentScheduleId(candidate.getShipmentScheduleId());<NEW_LINE>if (!order.isCompleteOrderDeliveryRequired() && isCompleteOrderDeliveryRule(candidate)) {<NEW_LINE>order.setCompleteOrderDeliveryRequired(true);<NEW_LINE>}<NEW_LINE>if (order.isCompleteOrderDeliveryRequired() && !isCompletelyDelivered(candidate)) {<NEW_LINE>return BooleanWithReason.falseBecause("schedule not completely delivered: " + candidate.getShipmentScheduleId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Check Orders if they contain all shipment schedules in order to have a complete order delivery<NEW_LINE>for (final Order order : orders.values()) {<NEW_LINE>if (!order.isCompleteOrderDeliveryRequired()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final OrderId orderId = order.getOrderId();<NEW_LINE>final Set<ShipmentScheduleId> <MASK><NEW_LINE>final Set<ShipmentScheduleId> missingShipmentScheduleIds = order.getMissingShipmentScheduleIds(requiredShipmentScheduleIds);<NEW_LINE>if (!missingShipmentScheduleIds.isEmpty()) {<NEW_LINE>return BooleanWithReason.falseBecause("order " + orderId + " needs to be complete but following schedules are missing: " + missingShipmentScheduleIds);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return BooleanWithReason.TRUE;<NEW_LINE>}
requiredShipmentScheduleIds = shipmentSchedulesRepo.retrieveUnprocessedIdsByOrderId(orderId);
248,315
public static void doLoadJarLibrary(Project proj) {<NEW_LINE>final var loader = proj.getLogisimFile().getLoader();<NEW_LINE>final var chooser = loader.createChooser();<NEW_LINE>chooser.setDialogTitle(S.get("loadJarDialogTitle"));<NEW_LINE><MASK><NEW_LINE>int check = chooser.showOpenDialog(proj.getFrame());<NEW_LINE>if (check == JFileChooser.APPROVE_OPTION) {<NEW_LINE>final var f = chooser.getSelectedFile();<NEW_LINE>String className = null;<NEW_LINE>// try to retrieve the class name from the "Library-Class"<NEW_LINE>// attribute in the manifest. This section of code was contributed<NEW_LINE>// by Christophe Jacquet (Request Tracker #2024431).<NEW_LINE>try (final var jarFile = new JarFile(f)) {<NEW_LINE>final var manifest = jarFile.getManifest();<NEW_LINE>className = manifest.getMainAttributes().getValue("Library-Class");<NEW_LINE>} catch (IOException e) {<NEW_LINE>// if opening the JAR file failed, do nothing<NEW_LINE>}<NEW_LINE>// if the class name was not found, go back to the good old dialog<NEW_LINE>if (className == null) {<NEW_LINE>className = OptionPane.showInputDialog(proj.getFrame(), S.get("jarClassNamePrompt"), S.get("jarClassNameTitle"), OptionPane.QUESTION_MESSAGE);<NEW_LINE>// if user canceled selection, abort<NEW_LINE>if (className == null)<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final var lib = loader.loadJarLibrary(f, className);<NEW_LINE>if (lib != null) {<NEW_LINE>proj.doAction(LogisimFileActions.loadLibrary(lib, proj.getLogisimFile()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
chooser.setFileFilter(Loader.JAR_FILTER);
1,369,777
public static SpannableString nanoStatus() {<NEW_LINE>SpannableString pingStatus = null;<NEW_LINE>if (lastMessageReceived > 0) {<NEW_LINE>long pingSince = JoH.msSince(lastMessageReceived);<NEW_LINE>if (pingSince > Constants.MINUTE_IN_MS * 30) {<NEW_LINE>pingStatus = Span.colorSpan("No follower sync for: " + JoH.niceTimeScalar(pingSince), BAD.color());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (Home.get_follower()) {<NEW_LINE>updateLastBg();<NEW_LINE>final SpannableString remoteStatus = NanoStatus.getRemote();<NEW_LINE>if (last_bg != null) {<NEW_LINE>if (JoH.msSince(last_bg.timestamp) > Constants.MINUTE_IN_MS * 15) {<NEW_LINE>final SpannableString lastBgStatus = Span.colorSpan("Last from master: " + JoH.niceTimeSince(last_bg.timestamp) + " ago", NOTICE.color());<NEW_LINE>return Span.join(true, remoteStatus, pingStatus, lastBgStatus);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return Span.join(true, pingStatus, new SpannableString(gs(R.string.no_data_received_from_master_yet)));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
Span.join(true, pingStatus);
564,288
public void writeToParcel(Parcel dest, int flags) {<NEW_LINE>dest.writeInt(this.id);<NEW_LINE>dest.writeString(this.name);<NEW_LINE>dest.writeString(this.fullName);<NEW_LINE>dest.writeByte(this.repPrivate ? (byte) 1 : (byte) 0);<NEW_LINE>dest.writeString(this.htmlUrl);<NEW_LINE>dest.writeString(this.description);<NEW_LINE>dest.writeString(this.language);<NEW_LINE>dest.writeParcelable(this.owner, flags);<NEW_LINE>dest.writeString(this.defaultBranch);<NEW_LINE>dest.writeLong(this.createdAt != null ? this.createdAt.getTime() : -1);<NEW_LINE>dest.writeLong(this.updatedAt != null ? this.updatedAt.getTime() : -1);<NEW_LINE>dest.writeLong(this.pushedAt != null ? this.pushedAt.getTime() : -1);<NEW_LINE>dest.writeString(this.gitUrl);<NEW_LINE>dest.writeString(this.sshUrl);<NEW_LINE>dest.writeString(this.cloneUrl);<NEW_LINE>dest.writeString(this.svnUrl);<NEW_LINE>dest.writeLong(this.size);<NEW_LINE>dest.writeInt(this.stargazersCount);<NEW_LINE>dest.writeInt(this.watchersCount);<NEW_LINE>dest.writeInt(this.forksCount);<NEW_LINE>dest.writeInt(this.openIssuesCount);<NEW_LINE>dest.writeInt(this.subscribersCount);<NEW_LINE>dest.writeByte(this.fork ? (byte) 1 : (byte) 0);<NEW_LINE>dest.<MASK><NEW_LINE>dest.writeParcelable(this.permissions, flags);<NEW_LINE>dest.writeByte(this.hasIssues ? (byte) 1 : (byte) 0);<NEW_LINE>dest.writeByte(this.hasProjects ? (byte) 1 : (byte) 0);<NEW_LINE>dest.writeByte(this.hasDownloads ? (byte) 1 : (byte) 0);<NEW_LINE>dest.writeByte(this.hasWiki ? (byte) 1 : (byte) 0);<NEW_LINE>dest.writeByte(this.hasPages ? (byte) 1 : (byte) 0);<NEW_LINE>dest.writeInt(this.sinceStargazersCount);<NEW_LINE>dest.writeInt(this.since == null ? -1 : this.since.ordinal());<NEW_LINE>}
writeParcelable(this.parent, flags);
1,845,576
public Set<String> referencedFiles(String tableName) throws TableNotFoundException {<NEW_LINE>log.debug("Collecting referenced files for replication of table {}", tableName);<NEW_LINE>TableId tableId = context.getTableId(tableName);<NEW_LINE>log.debug("Found id of {} for name {}", tableId, tableName);<NEW_LINE>// Get the WALs currently referenced by the table<NEW_LINE>BatchScanner metaBs = context.createBatchScanner(MetadataTable.<MASK><NEW_LINE>metaBs.setRanges(Collections.singleton(TabletsSection.getRange(tableId)));<NEW_LINE>metaBs.fetchColumnFamily(LogColumnFamily.NAME);<NEW_LINE>Set<String> wals = new HashSet<>();<NEW_LINE>try {<NEW_LINE>for (Entry<Key, Value> entry : metaBs) {<NEW_LINE>LogEntry logEntry = LogEntry.fromMetaWalEntry(entry);<NEW_LINE>wals.add(new Path(logEntry.filename).toString());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>metaBs.close();<NEW_LINE>}<NEW_LINE>// And the WALs that need to be replicated for this table<NEW_LINE>metaBs = context.createBatchScanner(MetadataTable.NAME, Authorizations.EMPTY, 4);<NEW_LINE>metaBs.setRanges(Collections.singleton(ReplicationSection.getRange()));<NEW_LINE>metaBs.fetchColumnFamily(ReplicationSection.COLF);<NEW_LINE>try {<NEW_LINE>Text buffer = new Text();<NEW_LINE>for (Entry<Key, Value> entry : metaBs) {<NEW_LINE>if (tableId.equals(ReplicationSection.getTableId(entry.getKey()))) {<NEW_LINE>ReplicationSection.getFile(entry.getKey(), buffer);<NEW_LINE>wals.add(buffer.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>metaBs.close();<NEW_LINE>}<NEW_LINE>return wals;<NEW_LINE>}
NAME, Authorizations.EMPTY, 4);
575,465
public void run(RegressionEnvironment env) {<NEW_LINE>for (EventRepresentationChoice rep : EventRepresentationChoice.values()) {<NEW_LINE>tryAssertionColDefPlain(env, rep);<NEW_LINE>}<NEW_LINE>// test property classname, either simple or fully-qualified.<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@name('create') create schema MySchema (f1 Timestamp, f2 java.beans.BeanDescriptor, f3 EventHandler, f4 null)", path);<NEW_LINE>env.assertStatement("create", statement -> {<NEW_LINE>EventType eventType = statement.getEventType();<NEW_LINE>assertEquals(java.sql.Timestamp.class<MASK><NEW_LINE>assertEquals(java.beans.BeanDescriptor.class, eventType.getPropertyType("f2"));<NEW_LINE>assertEquals(java.beans.EventHandler.class, eventType.getPropertyType("f3"));<NEW_LINE>assertEquals(null, eventType.getPropertyType("f4"));<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>}
, eventType.getPropertyType("f1"));
1,150,993
public static List<GrammaticalStructure> readCoNLLXGrammaticalStructureCollection(String fileName, Map<String, GrammaticalRelation> shortNameToGRel, GrammaticalStructureFromDependenciesFactory factory) throws IOException {<NEW_LINE>try (BufferedReader r = IOUtils.readerFromString(fileName)) {<NEW_LINE>LineNumberReader reader = new LineNumberReader(r);<NEW_LINE>List<GrammaticalStructure> gsList = new LinkedList<>();<NEW_LINE>List<List<String>> tokenFields = new ArrayList<>();<NEW_LINE>for (String inline = reader.readLine(); inline != null; inline = reader.readLine()) {<NEW_LINE>if (!inline.isEmpty()) {<NEW_LINE>// read in a single sentence token by token<NEW_LINE>List<String> fields = Arrays.asList(inline.split("\t"));<NEW_LINE>if (fields.size() != CoNLLX_FieldCount) {<NEW_LINE>throw new RuntimeException(String.format("Error (line %d): 10 fields expected but %d are present", reader.getLineNumber(), fields.size()));<NEW_LINE>}<NEW_LINE>tokenFields.add(fields);<NEW_LINE>} else {<NEW_LINE>if (tokenFields.isEmpty())<NEW_LINE>// skip excess empty lines<NEW_LINE>continue;<NEW_LINE>gsList.add(buildCoNLLXGrammaticalStructure<MASK><NEW_LINE>tokenFields = new ArrayList<>();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return gsList;<NEW_LINE>}<NEW_LINE>}
(tokenFields, shortNameToGRel, factory));
212,560
public static void importGroup(RealmModel realm, GroupModel parent, GroupRepresentation group) {<NEW_LINE>GroupModel newGroup = realm.createGroup(group.getId(), group.getName(), parent);<NEW_LINE>if (group.getAttributes() != null) {<NEW_LINE>for (Map.Entry<String, List<String>> attr : group.getAttributes().entrySet()) {<NEW_LINE>newGroup.setAttribute(attr.getKey(), attr.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (group.getRealmRoles() != null) {<NEW_LINE>for (String roleString : group.getRealmRoles()) {<NEW_LINE>RoleModel role = realm.getRole(roleString.trim());<NEW_LINE>if (role == null) {<NEW_LINE>role = realm.addRole(roleString.trim());<NEW_LINE>}<NEW_LINE>newGroup.grantRole(role);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (group.getClientRoles() != null) {<NEW_LINE>for (Map.Entry<String, List<String>> entry : group.getClientRoles().entrySet()) {<NEW_LINE>ClientModel client = realm.getClientByClientId(entry.getKey());<NEW_LINE>if (client == null) {<NEW_LINE>throw new RuntimeException("Unable to find client role mappings for client: " + entry.getKey());<NEW_LINE>}<NEW_LINE>List<String> roleNames = entry.getValue();<NEW_LINE>for (String roleName : roleNames) {<NEW_LINE>RoleModel role = client.getRole(roleName.trim());<NEW_LINE>if (role == null) {<NEW_LINE>role = client.<MASK><NEW_LINE>}<NEW_LINE>newGroup.grantRole(role);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (group.getSubGroups() != null) {<NEW_LINE>for (GroupRepresentation subGroup : group.getSubGroups()) {<NEW_LINE>importGroup(realm, newGroup, subGroup);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
addRole(roleName.trim());
1,055,025
public void deleteByIdWithResponse(String id, Context context) {<NEW_LINE>String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String clusterName = Utils.getValueFromIdByName(id, "clusters");<NEW_LINE>if (clusterName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id)));<NEW_LINE>}<NEW_LINE>String managedPrivateEndpointName = <MASK><NEW_LINE>if (managedPrivateEndpointName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'managedPrivateEndpoints'.", id)));<NEW_LINE>}<NEW_LINE>this.delete(resourceGroupName, clusterName, managedPrivateEndpointName, context);<NEW_LINE>}
Utils.getValueFromIdByName(id, "managedPrivateEndpoints");
1,793,792
final ListItemsResult executeListItems(ListItemsRequest listItemsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listItemsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListItemsRequest> request = null;<NEW_LINE>Response<ListItemsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListItemsRequestProtocolMarshaller(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, "MediaStore Data");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListItems");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListItemsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListItemsResultJsonUnmarshaller());<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(listItemsRequest));
1,836,574
protected void onCreate(Bundle bundle) {<NEW_LINE>super.onCreate(bundle);<NEW_LINE>setContentView(R.layout.activity_webcontainer);<NEW_LINE>UIUtils.setupToolbar(this, R.drawable.logo, getString(R.string.add_facebook), true);<NEW_LINE>webview = (WebView) findViewById(R.id.webcontainer);<NEW_LINE>webview.<MASK><NEW_LINE>webview.setWebViewClient(new WebViewClient() {<NEW_LINE><NEW_LINE>// this was deprecated in API 24 but the replacement only added in the same release.<NEW_LINE>// the suppression can be removed when we move past 24<NEW_LINE>@SuppressWarnings("deprecation")<NEW_LINE>public boolean shouldOverrideUrlLoading(WebView view, String url) {<NEW_LINE>if (TextUtils.equals(url, APIConstants.buildUrl("/"))) {<NEW_LINE>AddFacebook.this.setResult(FACEBOOK_AUTHED);<NEW_LINE>AddFacebook.this.finish();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>view.loadUrl(url);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>webview.loadUrl(APIConstants.buildUrl(APIConstants.PATH_CONNECT_FACEBOOK));<NEW_LINE>}
getSettings().setJavaScriptEnabled(true);
1,529,866
public Long parse(Uri uri, InputStream inputStream) throws IOException {<NEW_LINE>String firstLine = new BufferedReader(new InputStreamReader(inputStream, Charsets.UTF_8)).readLine();<NEW_LINE>try {<NEW_LINE>Matcher matcher = TIMESTAMP_WITH_TIMEZONE_PATTERN.matcher(firstLine);<NEW_LINE>if (!matcher.matches()) {<NEW_LINE>throw ParserException.createForMalformedManifest("Couldn't parse timestamp: " + firstLine, /* cause= */<NEW_LINE>null);<NEW_LINE>}<NEW_LINE>// Parse the timestamp.<NEW_LINE>String timestampWithoutTimezone = matcher.group(1);<NEW_LINE>SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.US);<NEW_LINE>format.setTimeZone(TimeZone.getTimeZone("UTC"));<NEW_LINE>long timestampMs = format.parse(timestampWithoutTimezone).getTime();<NEW_LINE>// Parse the timezone.<NEW_LINE>String timezone = matcher.group(2);<NEW_LINE>if ("Z".equals(timezone)) {<NEW_LINE>// UTC (no offset).<NEW_LINE>} else {<NEW_LINE>long sign = "+".equals(matcher.group(4)) ? 1 : -1;<NEW_LINE>long hours = Long.parseLong<MASK><NEW_LINE>String minutesString = matcher.group(7);<NEW_LINE>long minutes = TextUtils.isEmpty(minutesString) ? 0 : Long.parseLong(minutesString);<NEW_LINE>long timestampOffsetMs = sign * (((hours * 60) + minutes) * 60 * 1000);<NEW_LINE>timestampMs -= timestampOffsetMs;<NEW_LINE>}<NEW_LINE>return timestampMs;<NEW_LINE>} catch (ParseException e) {<NEW_LINE>throw ParserException.createForMalformedManifest(/* message= */<NEW_LINE>null, /* cause= */<NEW_LINE>e);<NEW_LINE>}<NEW_LINE>}
(matcher.group(5));
1,769,495
public Protos.TaskInfo constructMesosTaskInfo(Config heronConfig, Config heronRuntime) {<NEW_LINE>// String taskIdStr, BaseContainer task, Offer offer<NEW_LINE>String taskIdStr = this.taskId;<NEW_LINE>Protos.TaskID mesosTaskID = Protos.TaskID.newBuilder().setValue(taskIdStr).build();<NEW_LINE>Protos.TaskInfo.Builder taskInfo = Protos.TaskInfo.newBuilder().setName(baseContainer.name).setTaskId(mesosTaskID);<NEW_LINE>Protos.Environment.Builder environment = Protos.Environment.newBuilder();<NEW_LINE>// If the job defines custom environment variables, add them to the builder<NEW_LINE>// Don't add them if they already exist to prevent overwriting the defaults<NEW_LINE>Set<String> builtinEnvNames = new HashSet<>();<NEW_LINE>for (Protos.Environment.Variable variable : environment.getVariablesList()) {<NEW_LINE>builtinEnvNames.add(variable.getName());<NEW_LINE>}<NEW_LINE>for (BaseContainer.EnvironmentVariable ev : baseContainer.environmentVariables) {<NEW_LINE>environment.addVariables(Protos.Environment.Variable.newBuilder().setName(ev.name)<MASK><NEW_LINE>}<NEW_LINE>taskInfo.addResources(scalarResource(TaskResources.CPUS_RESOURCE_NAME, baseContainer.cpu)).addResources(scalarResource(TaskResources.MEM_RESOURCE_NAME, baseContainer.memInMB)).addResources(scalarResource(TaskResources.DISK_RESOURCE_NAME, baseContainer.diskInMB)).addResources(rangeResource(TaskResources.PORT_RESOURCE_NAME, this.freePorts.get(0), this.freePorts.get(this.freePorts.size() - 1))).setSlaveId(this.offer.getSlaveId());<NEW_LINE>int containerIndex = TaskUtils.getContainerIndexForTaskId(taskIdStr);<NEW_LINE>String commandStr = executorCommand(heronConfig, heronRuntime, containerIndex);<NEW_LINE>Protos.CommandInfo.Builder command = Protos.CommandInfo.newBuilder();<NEW_LINE>List<Protos.CommandInfo.URI> uriProtos = new ArrayList<>();<NEW_LINE>for (String uri : baseContainer.dependencies) {<NEW_LINE>uriProtos.add(Protos.CommandInfo.URI.newBuilder().setValue(uri).setExtract(true).build());<NEW_LINE>}<NEW_LINE>command.setValue(commandStr).setShell(baseContainer.shell).setEnvironment(environment).addAllUris(uriProtos);<NEW_LINE>if (!baseContainer.runAsUser.isEmpty()) {<NEW_LINE>command.setUser(baseContainer.runAsUser);<NEW_LINE>}<NEW_LINE>taskInfo.setCommand(command);<NEW_LINE>return taskInfo.build();<NEW_LINE>}
.setValue(ev.value));
1,403,500
final ListAccountSettingsResult executeListAccountSettings(ListAccountSettingsRequest listAccountSettingsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listAccountSettingsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<ListAccountSettingsRequest> request = null;<NEW_LINE>Response<ListAccountSettingsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListAccountSettingsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listAccountSettingsRequest));<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, "ECS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListAccountSettings");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListAccountSettingsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListAccountSettingsResultJsonUnmarshaller());<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,250,509
private static BakedQuad putQuad(Transformation transform, Direction side, TextureAtlasSprite sprite, int color, int tint, float x1, float y1, float x2, float y2, float z, float u1, float v1, float u2, float v2, int luminosity) {<NEW_LINE>BakedQuadBuilder builder = new BakedQuadBuilder(sprite);<NEW_LINE>builder.setQuadTint(tint);<NEW_LINE>builder.setQuadOrientation(side);<NEW_LINE>builder.setApplyDiffuseLighting(luminosity == 0);<NEW_LINE>// only apply the transform if it's not identity<NEW_LINE>boolean hasTransform = !transform.isIdentity();<NEW_LINE>IVertexConsumer consumer = hasTransform ? new TRSRTransformer(builder, transform) : builder;<NEW_LINE>if (side == Direction.SOUTH) {<NEW_LINE>putVertex(consumer, side, x1, y1, z, <MASK><NEW_LINE>putVertex(consumer, side, x2, y1, z, u2, v2, color, luminosity);<NEW_LINE>putVertex(consumer, side, x2, y2, z, u2, v1, color, luminosity);<NEW_LINE>putVertex(consumer, side, x1, y2, z, u1, v1, color, luminosity);<NEW_LINE>} else {<NEW_LINE>putVertex(consumer, side, x1, y1, z, u1, v2, color, luminosity);<NEW_LINE>putVertex(consumer, side, x1, y2, z, u1, v1, color, luminosity);<NEW_LINE>putVertex(consumer, side, x2, y2, z, u2, v1, color, luminosity);<NEW_LINE>putVertex(consumer, side, x2, y1, z, u2, v2, color, luminosity);<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>}
u1, v2, color, luminosity);
1,585,867
public CreateCampaignResult createCampaign(CreateCampaignRequest createCampaignRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createCampaignRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateCampaignRequest> request = null;<NEW_LINE>Response<CreateCampaignResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateCampaignRequestMarshaller().marshall(createCampaignRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<CreateCampaignResult, JsonUnmarshallerContext> unmarshaller = new CreateCampaignResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<CreateCampaignResult> responseHandler = new JsonResponseHandler<CreateCampaignResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(<MASK><NEW_LINE>}<NEW_LINE>}
awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
356,857
private DataSet<Tuple3<Double, Object, Vector>> transform(BatchOperator<?> in, Params params, boolean isRegProc) {<NEW_LINE>String[] featureColNames = params.get(FmTrainParams.FEATURE_COLS);<NEW_LINE>String labelName = params.get(FmTrainParams.LABEL_COL);<NEW_LINE>String weightColName = <MASK><NEW_LINE>String vectorColName = params.get(FmTrainParams.VECTOR_COL);<NEW_LINE>TableSchema dataSchema = in.getSchema();<NEW_LINE>if (null == featureColNames && null == vectorColName) {<NEW_LINE>featureColNames = TableUtil.getNumericCols(dataSchema, new String[] { labelName });<NEW_LINE>params.set(FmTrainParams.FEATURE_COLS, featureColNames);<NEW_LINE>}<NEW_LINE>int[] featureIndices = null;<NEW_LINE>int labelIdx = TableUtil.findColIndexWithAssertAndHint(dataSchema.getFieldNames(), labelName);<NEW_LINE>if (featureColNames != null) {<NEW_LINE>featureIndices = new int[featureColNames.length];<NEW_LINE>for (int i = 0; i < featureColNames.length; ++i) {<NEW_LINE>int idx = TableUtil.findColIndexWithAssertAndHint(in.getColNames(), featureColNames[i]);<NEW_LINE>featureIndices[i] = idx;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int weightIdx = weightColName != null ? TableUtil.findColIndexWithAssertAndHint(in.getColNames(), weightColName) : -1;<NEW_LINE>int vecIdx = vectorColName != null ? TableUtil.findColIndexWithAssertAndHint(in.getColNames(), vectorColName) : -1;<NEW_LINE>return in.getDataSet().mapPartition(new Transform(isRegProc, weightIdx, vecIdx, featureIndices, labelIdx));<NEW_LINE>}
params.get(FmTrainParams.WEIGHT_COL);
1,140,727
private static void refactor(DomProvider p) {<NEW_LINE>final Document doc;<NEW_LINE>try {<NEW_LINE>doc = p.getDocument();<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>NodeList nl = doc.getElementsByTagName("*");<NEW_LINE>final List<Element> l = new ArrayList<Element>();<NEW_LINE>for (int i = 0; i < nl.getLength(); i++) {<NEW_LINE>l.add((Element) nl.item(i));<NEW_LINE>}<NEW_LINE>p.isolatingChange(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>for (Element el : l) {<NEW_LINE>String tagname = el.getTagName();<NEW_LINE>if (tagname.startsWith("tag-")) {<NEW_LINE>int n = Integer.parseInt(tagname.substring(4));<NEW_LINE>tagname = "tag-" + (n + 1);<NEW_LINE>Element <MASK><NEW_LINE>Node parent = el.getParentNode();<NEW_LINE>parent.insertBefore(el2, el);<NEW_LINE>NodeList nl2 = el.getChildNodes();<NEW_LINE>while (nl2.getLength() > 0) {<NEW_LINE>el2.appendChild(nl2.item(0));<NEW_LINE>}<NEW_LINE>parent.removeChild(el);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
el2 = doc.createElement(tagname);
384,947
public RedisKeeperServer add(KeeperTransMeta keeperTransMeta) {<NEW_LINE>KeeperMeta keeperMeta = keeperTransMeta.getKeeperMeta();<NEW_LINE>enrichKeeperMetaFromKeeperTransMeta(keeperMeta, keeperTransMeta);<NEW_LINE>String keeperServerKey = assembleKeeperServerKey(keeperTransMeta);<NEW_LINE>if (!redisKeeperServers.containsKey(keeperServerKey)) {<NEW_LINE>synchronized (this) {<NEW_LINE>if (!redisKeeperServers.containsKey(keeperServerKey)) {<NEW_LINE>if (runningPorts.contains(keeperMeta.getPort())) {<NEW_LINE>throw new RedisKeeperRuntimeException(new ErrorMessage<>(KeeperContainerErrorCode.KEEPER_ALREADY_EXIST, String.format("Add keeper for cluster %d shard %d failed since port %d is already used", keeperTransMeta.getClusterDbId(), keeperTransMeta.getShardDbId(), keeperMeta.getPort())), null);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>RedisKeeperServer redisKeeperServer = doAdd(keeperTransMeta, keeperMeta);<NEW_LINE>cacheKeeper(keeperServerKey, redisKeeperServer);<NEW_LINE>return redisKeeperServer;<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>throw new RedisKeeperRuntimeException(new ErrorMessage<>(KeeperContainerErrorCode.INTERNAL_EXCEPTION, String.format("Add keeper for cluster %d shard %d failed", keeperTransMeta.getClusterDbId(), keeperTransMeta.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new RedisKeeperRuntimeException(new ErrorMessage<>(KeeperContainerErrorCode.KEEPER_ALREADY_EXIST, String.format("Keeper already exists for cluster %d shard %d", keeperTransMeta.getClusterDbId(), keeperTransMeta.getShardDbId())), null);<NEW_LINE>}
getShardDbId())), ex);
722,820
public io.kubernetes.client.proto.V1.ConfigMapNodeConfigSource buildPartial() {<NEW_LINE>io.kubernetes.client.proto.V1.ConfigMapNodeConfigSource result = new io.kubernetes.client.<MASK><NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((from_bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>result.namespace_ = namespace_;<NEW_LINE>if (((from_bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>to_bitField0_ |= 0x00000002;<NEW_LINE>}<NEW_LINE>result.name_ = name_;<NEW_LINE>if (((from_bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>to_bitField0_ |= 0x00000004;<NEW_LINE>}<NEW_LINE>result.uid_ = uid_;<NEW_LINE>if (((from_bitField0_ & 0x00000008) == 0x00000008)) {<NEW_LINE>to_bitField0_ |= 0x00000008;<NEW_LINE>}<NEW_LINE>result.resourceVersion_ = resourceVersion_;<NEW_LINE>if (((from_bitField0_ & 0x00000010) == 0x00000010)) {<NEW_LINE>to_bitField0_ |= 0x00000010;<NEW_LINE>}<NEW_LINE>result.kubeletConfigKey_ = kubeletConfigKey_;<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>}
proto.V1.ConfigMapNodeConfigSource(this);
657,986
protected IStatus validateCompilationUnit(IResource resource) {<NEW_LINE>IPackageFragmentRoot root = getPackageFragmentRoot();<NEW_LINE>// root never null as validation is not done for working copies<NEW_LINE>try {<NEW_LINE>if (root.getKind() != IPackageFragmentRoot.K_SOURCE)<NEW_LINE>return new JavaModelStatus(IJavaModelStatusConstants.INVALID_ELEMENT_TYPES, root);<NEW_LINE>} catch (JavaModelException e) {<NEW_LINE>return e.getJavaModelStatus();<NEW_LINE>}<NEW_LINE>if (resource != null) {<NEW_LINE>char[][] inclusionPatterns = ((PackageFragmentRoot) root).fullInclusionPatternChars();<NEW_LINE>char[][] exclusionPatterns = ((PackageFragmentRoot) root).fullExclusionPatternChars();<NEW_LINE>if (Util.isExcluded(resource, inclusionPatterns, exclusionPatterns))<NEW_LINE>return new JavaModelStatus(IJavaModelStatusConstants.ELEMENT_NOT_ON_CLASSPATH, this);<NEW_LINE>if (!resource.isAccessible())<NEW_LINE>return new <MASK><NEW_LINE>}<NEW_LINE>IJavaProject project = getJavaProject();<NEW_LINE>return JavaConventions.validateCompilationUnitName(getElementName(), project.getOption(JavaCore.COMPILER_SOURCE, true), project.getOption(JavaCore.COMPILER_COMPLIANCE, true));<NEW_LINE>}
JavaModelStatus(IJavaModelStatusConstants.ELEMENT_DOES_NOT_EXIST, this);
1,407,212
public void appendHoverText(ItemStack stack, Level level, List<Component> lines, TooltipFlag advancedTooltips) {<NEW_LINE>String firstLineKey = this.getFirstValidTranslationKey(this.getSettingsName(stack) + ".name", this.getSettingsName(stack));<NEW_LINE>lines.add(Tooltips.of(new TranslatableComponent(firstLineKey)));<NEW_LINE>final CompoundTag data = this.getData(stack);<NEW_LINE>if (data.contains("tooltip")) {<NEW_LINE>String tooltipKey = getFirstValidTranslationKey(data.getString("tooltip") + ".name", data.getString("tooltip"));<NEW_LINE>lines.add(Tooltips.of<MASK><NEW_LINE>}<NEW_LINE>if (data.contains("freq")) {<NEW_LINE>final short freq = data.getShort("freq");<NEW_LINE>final String freqTooltip = ChatFormatting.BOLD + Platform.p2p().toHexString(freq);<NEW_LINE>lines.add(Tooltips.of(new TranslatableComponent("gui.tooltips.ae2.P2PFrequency", freqTooltip)));<NEW_LINE>}<NEW_LINE>}
(new TranslatableComponent(tooltipKey)));
163,529
private void checkIndex(RuntimeEnvironment env) {<NEW_LINE>if (env.isProjectsEnabled()) {<NEW_LINE>Map<String, Project> projects = env.getProjects();<NEW_LINE>File indexRoot = new File(env.getDataRootPath(), IndexDatabase.INDEX_DIR);<NEW_LINE>if (indexRoot.exists()) {<NEW_LINE>LOGGER.log(Level.FINE, "Checking indexes for all projects");<NEW_LINE>for (Map.Entry<String, Project> projectEntry : projects.entrySet()) {<NEW_LINE>try {<NEW_LINE>IndexCheck.checkDir(new File(indexRoot, projectEntry.getKey()));<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.log(Level.WARNING, String.format("Project %s index check failed, marking as not indexed", projectEntry<MASK><NEW_LINE>projectEntry.getValue().setIndexed(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOGGER.log(Level.FINE, "Index check for all projects done");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOGGER.log(Level.FINE, "Checking index");<NEW_LINE>try {<NEW_LINE>IndexCheck.checkDir(new File(env.getDataRootPath(), IndexDatabase.INDEX_DIR));<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.log(Level.SEVERE, "index check failed", e);<NEW_LINE>}<NEW_LINE>LOGGER.log(Level.FINE, "Index check done");<NEW_LINE>}<NEW_LINE>}
.getKey()), e);
1,534,963
protected Iterator<HugeEdge> queryEdgesFromBackend(Query query) {<NEW_LINE>assert query.resultType().isEdge();<NEW_LINE>QueryResults<BackendEntry> results = this.query(query);<NEW_LINE>Iterator<BackendEntry> entries = results.iterator();<NEW_LINE>Iterator<HugeEdge> edges = new FlatMapperIterator<>(entries, entry -> {<NEW_LINE>// Edges are in a vertex<NEW_LINE>HugeVertex vertex = this.parseEntry(entry);<NEW_LINE>if (vertex == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (query.idsSize() == 1) {<NEW_LINE>assert vertex.getEdges().size() == 1;<NEW_LINE>}<NEW_LINE>return new ListIterator<>(ImmutableList.copyOf(vertex.getEdges()));<NEW_LINE>});<NEW_LINE>edges = <MASK><NEW_LINE>if (!this.store().features().supportsQuerySortByInputIds()) {<NEW_LINE>// There is no id in BackendEntry, so sort after deserialization<NEW_LINE>edges = results.keepInputOrderIfNeeded(edges);<NEW_LINE>}<NEW_LINE>return edges;<NEW_LINE>}
this.filterExpiredResultFromFromBackend(query, edges);
1,084,970
public static Action<MapProperty<String, String>> bundleDefaults(Project project) {<NEW_LINE>return properties -> {<NEW_LINE>project.getPlugins().withType(PublishingPlugin.class).configureEach(publishingPlugin -> {<NEW_LINE>project.getExtensions().getByType(PublishingExtension.class).getPublications().withType(MavenPublication.class).stream().findAny().ifPresent(publication -> {<NEW_LINE>properties.put(Constants.BUNDLE_NAME, publication.getPom().getName());<NEW_LINE>properties.put(Constants.BUNDLE_DESCRIPTION, publication.getPom().getDescription());<NEW_LINE>});<NEW_LINE>});<NEW_LINE>properties.put(Constants.BUNDLE_SYMBOLICNAME, project.getGroup() + "." + project.getName());<NEW_LINE>properties.put(Constants.BUNDLE_DOCURL, "http://ehcache.org");<NEW_LINE>properties.<MASK><NEW_LINE>properties.put(Constants.BUNDLE_VENDOR, "Terracotta Inc., a wholly-owned subsidiary of Software AG USA, Inc.");<NEW_LINE>properties.put(Constants.BUNDLE_VERSION, osgiFixedVersion(project.getVersion().toString()));<NEW_LINE>properties.put(Constants.SERVICE_COMPONENT, "OSGI-INF/*.xml");<NEW_LINE>};<NEW_LINE>}
put(Constants.BUNDLE_LICENSE, "LICENSE");
602,352
private void initComponents() {<NEW_LINE>myRoot = new JPanel(new VerticalLayout(JBUI.scale(5)));<NEW_LINE>myRoot.setOpaque(false);<NEW_LINE>myIconLabel = new JBLabel();<NEW_LINE>myName = new JBTextArea();<NEW_LINE>myName.setBorder(JBUI.Borders.empty());<NEW_LINE>myName.setOpaque(false);<NEW_LINE>myName.setLineWrap(true);<NEW_LINE>myName.setWrapStyleWord(true);<NEW_LINE>myName.setEditable(false);<NEW_LINE>myName.setBorder(JBUI.Borders.empty(0, 5));<NEW_LINE>myName.setFont(UIUtil.getLabelFont(UIUtil.FontSize.BIGGER));<NEW_LINE>myInstallButton = new JButton();<NEW_LINE>myInstallButton.setOpaque(false);<NEW_LINE>JPanel nameWrapper = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.MIDDLE, true, true));<NEW_LINE>nameWrapper.setOpaque(false);<NEW_LINE>nameWrapper.add(myName);<NEW_LINE>myRoot.add(new BorderLayoutPanel().addToLeft(myIconLabel).addToCenter(nameWrapper).andTransparent());<NEW_LINE>myRoot.add(new BorderLayoutPanel().addToRight(myInstallButton).andTransparent());<NEW_LINE>myExperimentalLabel = new JBLabel();<NEW_LINE>myRoot.add(new BorderLayoutPanel().addToRight(myExperimentalLabel).andTransparent());<NEW_LINE>myDownloadsPanel = new JPanel(new HorizontalLayout(JBUI.scale(5)));<NEW_LINE>myDownloadsPanel.setOpaque(false);<NEW_LINE>myDownloadsPanel.add<MASK><NEW_LINE>myDownloadsPanel.add(myRating = new RatesPanel());<NEW_LINE>myRating.setVisible(PluginDescriptionPanel.ENABLED_STARS);<NEW_LINE>myRoot.add(new BorderLayoutPanel().andTransparent().addToRight(myDownloadsPanel));<NEW_LINE>myUpdated = new JBLabel();<NEW_LINE>myDownloads.setForeground(JBColor.GRAY);<NEW_LINE>myUpdated.setForeground(JBColor.GRAY);<NEW_LINE>final Font smallFont = UIUtil.getLabelFont(UIUtil.FontSize.SMALL);<NEW_LINE>myDownloads.setFont(smallFont);<NEW_LINE>myUpdated.setFont(smallFont);<NEW_LINE>myRoot.setVisible(false);<NEW_LINE>}
(myDownloads = new JBLabel());
1,013,132
public static List<Geometry> flatFeatureList(Geometry geom) {<NEW_LINE>final List<Geometry> singleGeoms = new ArrayList<>();<NEW_LINE>final Stack<Geometry> <MASK><NEW_LINE>Geometry nextGeom;<NEW_LINE>int nextGeomCount;<NEW_LINE>geomStack.push(geom);<NEW_LINE>while (!geomStack.isEmpty()) {<NEW_LINE>nextGeom = geomStack.pop();<NEW_LINE>if (nextGeom instanceof Point || nextGeom instanceof MultiPoint || nextGeom instanceof LineString || nextGeom instanceof MultiLineString || nextGeom instanceof Polygon || nextGeom instanceof MultiPolygon) {<NEW_LINE>singleGeoms.add(nextGeom);<NEW_LINE>} else if (nextGeom instanceof GeometryCollection) {<NEW_LINE>// Push all child geometries<NEW_LINE>nextGeomCount = nextGeom.getNumGeometries();<NEW_LINE>for (int i = 0; i < nextGeomCount; ++i) {<NEW_LINE>geomStack.push(nextGeom.getGeometryN(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return singleGeoms;<NEW_LINE>}
geomStack = new Stack<>();
1,736,631
public static void main(String[] args) {<NEW_LINE>// Instantiate a client that will be used to call the service.<NEW_LINE>TextAnalyticsClient client = new TextAnalyticsClientBuilder().credential(new AzureKeyCredential("{key}")).<MASK><NEW_LINE>// The texts that need be analyzed.<NEW_LINE>List<TextDocumentInput> documents = Arrays.asList(new TextDocumentInput("A", "The food was delicious and there were wonderful staff.").setLanguage("en"), new TextDocumentInput("B", "The pitot tube is used to measure airspeed.").setLanguage("en"));<NEW_LINE>TextAnalyticsRequestOptions requestOptions = new TextAnalyticsRequestOptions().setIncludeStatistics(true).setModelVersion("latest");<NEW_LINE>// Extracting key phrases for each document in a batch of documents<NEW_LINE>Response<ExtractKeyPhrasesResultCollection> keyPhrasesBatchResultResponse = client.extractKeyPhrasesBatchWithResponse(documents, requestOptions, Context.NONE);<NEW_LINE>// Response's status code<NEW_LINE>System.out.printf("Status code of request response: %d%n", keyPhrasesBatchResultResponse.getStatusCode());<NEW_LINE>ExtractKeyPhrasesResultCollection keyPhrasesBatchResultCollection = keyPhrasesBatchResultResponse.getValue();<NEW_LINE>// Model version<NEW_LINE>System.out.printf("Results of Azure Text Analytics \"Key Phrases Extraction\" Model, version: %s%n", keyPhrasesBatchResultCollection.getModelVersion());<NEW_LINE>// Batch statistics<NEW_LINE>TextDocumentBatchStatistics batchStatistics = keyPhrasesBatchResultCollection.getStatistics();<NEW_LINE>System.out.printf("Documents statistics: document count = %s, erroneous document count = %s, transaction count = %s, valid document count = %s.%n", batchStatistics.getDocumentCount(), batchStatistics.getInvalidDocumentCount(), batchStatistics.getTransactionCount(), batchStatistics.getValidDocumentCount());<NEW_LINE>// Extracted key phrases for each document in a batch of documents<NEW_LINE>AtomicInteger counter = new AtomicInteger();<NEW_LINE>keyPhrasesBatchResultCollection.forEach(extractKeyPhraseResult -> {<NEW_LINE>System.out.printf("%n%s%n", documents.get(counter.getAndIncrement()));<NEW_LINE>if (extractKeyPhraseResult.isError()) {<NEW_LINE>// Erroneous document<NEW_LINE>System.out.printf("Cannot extract key phrases. Error: %s%n", extractKeyPhraseResult.getError().getMessage());<NEW_LINE>} else {<NEW_LINE>// Valid document<NEW_LINE>System.out.println("Extracted phrases:");<NEW_LINE>extractKeyPhraseResult.getKeyPhrases().forEach(keyPhrases -> System.out.printf("\t%s.%n", keyPhrases));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
endpoint("{endpoint}").buildClient();
1,508,218
@Produces(MediaType.APPLICATION_JSON)<NEW_LINE>@Operation(description = "Delete the provider service from the specified tenant domain. Upon successful completion of this delete request, the server will return NO_CONTENT status code without any data (no object will be returned).")<NEW_LINE>public void deleteTenancy(@Parameter(description = "name of the tenant domain", required = true) @PathParam("domain") String domain, @Parameter(description = "name of the provider service", required = true) @PathParam("service") String service, @Parameter(description = "Audit param required(not empty) if domain auditEnabled is true.", required = true) @HeaderParam("Y-Audit-Ref") String auditRef) {<NEW_LINE>int code = ResourceException.OK;<NEW_LINE>ResourceContext context = null;<NEW_LINE>try {<NEW_LINE>context = this.delegate.newResourceContext(this.request, this.response, "deleteTenancy");<NEW_LINE>context.authorize("delete", "" + domain + ":tenancy", null);<NEW_LINE>this.delegate.deleteTenancy(context, domain, service, auditRef);<NEW_LINE>} catch (ResourceException e) {<NEW_LINE>code = e.getCode();<NEW_LINE>switch(code) {<NEW_LINE>case ResourceException.BAD_REQUEST:<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>case ResourceException.CONFLICT:<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>case ResourceException.FORBIDDEN:<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>case ResourceException.NOT_FOUND:<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>case ResourceException.TOO_MANY_REQUESTS:<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>case ResourceException.UNAUTHORIZED:<NEW_LINE>throw typedException(<MASK><NEW_LINE>default:<NEW_LINE>System.err.println("*** Warning: undeclared exception (" + code + ") for resource deleteTenancy");<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>this.delegate.publishChangeMessage(context, code);<NEW_LINE>this.delegate.recordMetrics(context, code);<NEW_LINE>}<NEW_LINE>}
code, e, ResourceError.class);
1,815,601
private static Map<String, CountryCode> initcodes() {<NEW_LINE>Map<String, CountryCode> ccs = new HashMap();<NEW_LINE>// US<NEW_LINE>ccs.put("1", new CountryCode("1", false, 10));<NEW_LINE>// Netherlands<NEW_LINE>ccs.put("31", new CountryCode("31"));<NEW_LINE>// France<NEW_LINE>ccs.put(<MASK><NEW_LINE>// Finland<NEW_LINE>ccs.put("358", new CountryCode("358"));<NEW_LINE>// UK<NEW_LINE>ccs.put("44", new CountryCode("44", true));<NEW_LINE>// Denmark<NEW_LINE>ccs.put("45", new CountryCode("45", 8));<NEW_LINE>// http://sv.wikipedia.org/wiki/Telefonnummer<NEW_LINE>// Sweden<NEW_LINE>ccs.put("46", new CountryCode("46", true, 7, 9));<NEW_LINE>// Norway<NEW_LINE>ccs.put("47", new CountryCode("47", true, 8));<NEW_LINE>// Germany<NEW_LINE>ccs.put("49", new CountryCode("49"));<NEW_LINE>// http://www.wtng.info/wtng-971-ae.html<NEW_LINE>// United Arab Emirates<NEW_LINE>ccs.put("971", new CountryCode("971", true, 7, 9));<NEW_LINE>return ccs;<NEW_LINE>}
"33", new CountryCode("33"));
1,669,694
public void marshall(StartEventsDetectionJobRequest startEventsDetectionJobRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (startEventsDetectionJobRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(startEventsDetectionJobRequest.getInputDataConfig(), INPUTDATACONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(startEventsDetectionJobRequest.getOutputDataConfig(), OUTPUTDATACONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(startEventsDetectionJobRequest.getDataAccessRoleArn(), DATAACCESSROLEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(startEventsDetectionJobRequest.getJobName(), JOBNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(startEventsDetectionJobRequest.getClientRequestToken(), CLIENTREQUESTTOKEN_BINDING);<NEW_LINE>protocolMarshaller.marshall(startEventsDetectionJobRequest.getTargetEventTypes(), TARGETEVENTTYPES_BINDING);<NEW_LINE>protocolMarshaller.marshall(startEventsDetectionJobRequest.getTags(), TAGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
startEventsDetectionJobRequest.getLanguageCode(), LANGUAGECODE_BINDING);
1,682,881
public NewTableConfiguration attachIterator(IteratorSetting setting, EnumSet<IteratorScope> scopes) {<NEW_LINE>Objects.requireNonNull(setting, "setting cannot be null!");<NEW_LINE>Objects.requireNonNull(scopes, "scopes cannot be null!");<NEW_LINE>try {<NEW_LINE>TableOperationsHelper.checkIteratorConflicts(iteratorProps, setting, scopes);<NEW_LINE>} catch (AccumuloException e) {<NEW_LINE>throw new IllegalArgumentException("The specified IteratorSetting" + " conflicts with an iterator already defined on this NewTableConfiguration", e);<NEW_LINE>}<NEW_LINE>for (IteratorScope scope : scopes) {<NEW_LINE>String root = String.format("%s%s.%s", Property.TABLE_ITERATOR_PREFIX, scope.name().toLowerCase(), setting.getName());<NEW_LINE>for (Entry<String, String> prop : setting.getOptions().entrySet()) {<NEW_LINE>iteratorProps.put(root + ".opt." + prop.getKey(), prop.getValue());<NEW_LINE>}<NEW_LINE>iteratorProps.put(root, setting.getPriority() + "," + setting.getIteratorClass());<NEW_LINE>// verify that the iteratorProps assigned and the properties do not share any keys.<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
checkDisjoint(properties, iteratorProps, "iterator");
1,410,460
public OtaPackageInfo saveOtaPackageInfo(OtaPackageInfo otaPackageInfo, boolean isUrl) {<NEW_LINE>log.trace("Executing saveOtaPackageInfo [{}]", otaPackageInfo);<NEW_LINE>if (isUrl && (StringUtils.isEmpty(otaPackageInfo.getUrl()) || otaPackageInfo.getUrl().trim().length() == 0)) {<NEW_LINE>throw new DataValidationException("Ota package URL should be specified!");<NEW_LINE>}<NEW_LINE>otaPackageInfoValidator.validate(otaPackageInfo, OtaPackageInfo::getTenantId);<NEW_LINE>try {<NEW_LINE>OtaPackageId otaPackageId = otaPackageInfo.getId();<NEW_LINE>if (otaPackageId != null) {<NEW_LINE>Cache cache = cacheManager.getCache(OTA_PACKAGE_CACHE);<NEW_LINE>cache.evict(toOtaPackageInfoKey(otaPackageId));<NEW_LINE>otaPackageDataCache.evict(otaPackageId.toString());<NEW_LINE>}<NEW_LINE>return otaPackageInfoDao.save(<MASK><NEW_LINE>} catch (Exception t) {<NEW_LINE>ConstraintViolationException e = extractConstraintViolationException(t).orElse(null);<NEW_LINE>if (e != null && e.getConstraintName() != null && e.getConstraintName().equalsIgnoreCase("ota_package_tenant_title_version_unq_key")) {<NEW_LINE>throw new DataValidationException("OtaPackage with such title and version already exists!");<NEW_LINE>} else {<NEW_LINE>throw t;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
otaPackageInfo.getTenantId(), otaPackageInfo);
1,453,793
final DeleteTagsResult executeDeleteTags(DeleteTagsRequest deleteTagsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteTagsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteTagsRequest> request = null;<NEW_LINE>Response<DeleteTagsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteTagsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteTagsRequest));<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, "mq");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteTags");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteTagsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteTagsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1,162,617
public com.amazonaws.services.redshiftdataapi.model.ResourceNotFoundException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.redshiftdataapi.model.ResourceNotFoundException resourceNotFoundException = new com.amazonaws.services.<MASK><NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("ResourceId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>resourceNotFoundException.setResourceId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return resourceNotFoundException;<NEW_LINE>}
redshiftdataapi.model.ResourceNotFoundException(null);
1,010,833
protected void handleRetransmits() throws IOException {<NEW_LINE>// If we have a cachedStream, we are caching the request.<NEW_LINE>if (cachedStream != null || getClient().isAutoRedirect() && KNOWN_HTTP_VERBS_WITH_NO_CONTENT.contains(getMethod()) || authSupplier != null && authSupplier.requiresRequestCaching()) {<NEW_LINE>if (LOG.isLoggable(Level.FINE) && cachedStream != null) {<NEW_LINE>StringBuilder b = new StringBuilder(4096);<NEW_LINE>b.append("Conduit \"").append(getConduitName()).append("\" Transmit cached message to: ").append(url).append(": ");<NEW_LINE>cachedStream.writeCacheTo(b, 16L * 1024L);<NEW_LINE>LOG.<MASK><NEW_LINE>}<NEW_LINE>int maxRetransmits = getMaxRetransmits();<NEW_LINE>updateCookiesBeforeRetransmit();<NEW_LINE>int nretransmits = 0;<NEW_LINE>while ((maxRetransmits < 0 || nretransmits < maxRetransmits) && processRetransmit()) {<NEW_LINE>nretransmits++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
fine(b.toString());
927,020
public CorrelationResult correlation() {<NEW_LINE>if (this.outerProduct == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>DenseMatrix cov = covariance();<NEW_LINE>Vector stv = toSummary().standardDeviation();<NEW_LINE>int n = cov.numRows();<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>for (int j = i; j < n; j++) {<NEW_LINE>double val = <MASK><NEW_LINE>if (!Double.isNaN(val) && val != 0) {<NEW_LINE>double d = val / stv.get(i) / stv.get(j);<NEW_LINE>cov.set(i, j, d);<NEW_LINE>cov.set(j, i, d);<NEW_LINE>} else {<NEW_LINE>cov.set(i, j, 0);<NEW_LINE>cov.set(j, i, 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>cov.set(i, i, 1.0);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>for (int j = 0; j < n; j++) {<NEW_LINE>if (i != j) {<NEW_LINE>if (cov.get(i, j) > 1.0) {<NEW_LINE>cov.set(i, j, 1.0);<NEW_LINE>} else if (cov.get(i, j) < -1.0) {<NEW_LINE>cov.set(i, j, -1.0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new CorrelationResult(cov);<NEW_LINE>}
cov.get(i, j);
135,109
public int compare(ETable.RowMapping rm1, ETable.RowMapping rm2) {<NEW_LINE>Object obj1 = rm1.getTransformedValue(column);<NEW_LINE>Object <MASK><NEW_LINE>if (obj1 == null && obj2 == null) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>if (obj1 == null) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>if (obj2 == null) {<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>// check nested comparator<NEW_LINE>if (getNestedComparator() != null) {<NEW_LINE>return getNestedComparator().compare(obj1, obj2);<NEW_LINE>} else {<NEW_LINE>Class cl1 = obj1.getClass();<NEW_LINE>Class cl2 = obj2.getClass();<NEW_LINE>if ((obj1 instanceof Comparable) && cl1.isAssignableFrom(cl2)) {<NEW_LINE>Comparable c1 = (Comparable) obj1;<NEW_LINE>return c1.compareTo(obj2);<NEW_LINE>}<NEW_LINE>if ((obj2 instanceof Comparable) && cl2.isAssignableFrom(cl1)) {<NEW_LINE>Comparable c2 = (Comparable) obj2;<NEW_LINE>return -c2.compareTo(obj1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return obj1.toString().compareTo(obj2.toString());<NEW_LINE>}
obj2 = rm2.getTransformedValue(column);