idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,626,391 | final UpdateDataIntegrationResult executeUpdateDataIntegration(UpdateDataIntegrationRequest updateDataIntegrationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateDataIntegrationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateDataIntegrationRequest> request = null;<NEW_LINE>Response<UpdateDataIntegrationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateDataIntegrationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateDataIntegrationRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "AppIntegrations");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateDataIntegration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateDataIntegrationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateDataIntegrationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
800,230 | // called *after* the change<NEW_LINE>@Override<NEW_LINE>public void remove(Context context) throws BadLocationException {<NEW_LINE>Document doc = context.getDocument();<NEW_LINE>int dotPos = context.getOffset();<NEW_LINE>char ch = context.<MASK><NEW_LINE>if (ch == '\'' || ch == '"') {<NEW_LINE>// NOI18N<NEW_LINE>TokenSequence<HTMLTokenId> ts = LexUtilities.getTokenSequence((BaseDocument) doc, dotPos, HTMLTokenId.language());<NEW_LINE>if (ts != null) {<NEW_LINE>int diff = ts.move(dotPos);<NEW_LINE>if (diff != 1) {<NEW_LINE>// we only handle situation where leading quote is removed from an attribute value -- the diff must be 1<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!ts.moveNext()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Token<HTMLTokenId> token = ts.token();<NEW_LINE>if (token.id() == HTMLTokenId.VALUE || token.id() == HTMLTokenId.VALUE_CSS || token.id() == HTMLTokenId.VALUE_JAVASCRIPT) {<NEW_LINE>char first = token.text().charAt(0);<NEW_LINE>if (first == ch) {<NEW_LINE>// user pressed backspace in empty value: <div class="|" + BACKSPACE<NEW_LINE>// now the text is: <div class=|"<NEW_LINE>// expected result: remove the second quote<NEW_LINE>doc.remove(dotPos - 1, 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getText().charAt(0); |
1,442,749 | private Timestamp scheduleForward(final Timestamp start, final long nodeDurationMillis, MResource r) {<NEW_LINE>MResourceType t = r.getResourceType();<NEW_LINE>// statistical interation count<NEW_LINE>int iteration = 0;<NEW_LINE>Timestamp currentDate = start;<NEW_LINE>Timestamp end = null;<NEW_LINE>long remainingMillis = nodeDurationMillis;<NEW_LINE>do {<NEW_LINE>currentDate = reasoner.getAvailableDate(r, currentDate, false);<NEW_LINE>Timestamp dayStart = t.getDayStart(currentDate);<NEW_LINE>Timestamp dayEnd = t.getDayEnd(currentDate);<NEW_LINE>// If working has already began at this day and the value is in the range of the<NEW_LINE>// resource's availability, switch start time to the given again<NEW_LINE>if (currentDate.after(dayStart) && currentDate.before(dayEnd)) {<NEW_LINE>dayStart = currentDate;<NEW_LINE>}<NEW_LINE>// The available time at this day in milliseconds<NEW_LINE>long availableDayDuration = getAvailableDurationMillis(dayStart, dayEnd, r);<NEW_LINE>// The work can be finish on this day.<NEW_LINE>if (availableDayDuration >= remainingMillis) {<NEW_LINE>end = new Timestamp(<MASK><NEW_LINE>remainingMillis = 0;<NEW_LINE>break;<NEW_LINE>} else // Otherwise recall with next day and the remained node duration.<NEW_LINE>{<NEW_LINE>currentDate = TimeUtil.addDays(TimeUtil.getDayBorder(currentDate, null, false), 1);<NEW_LINE>remainingMillis -= availableDayDuration;<NEW_LINE>}<NEW_LINE>iteration++;<NEW_LINE>if (iteration > p_MaxIterationsNo) {<NEW_LINE>throw new CRPException("Maximum number of iterations exceeded (" + p_MaxIterationsNo + ")" + " - Date:" + currentDate + ", RemainingMillis:" + remainingMillis);<NEW_LINE>}<NEW_LINE>} while (remainingMillis > 0);<NEW_LINE>return end;<NEW_LINE>} | dayStart.getTime() + remainingMillis); |
1,400,931 | public void executeTaskListeners(UserTask userTask, TaskEntity taskEntity, String eventType) {<NEW_LINE>for (FlowableListener listener : userTask.getTaskListeners()) {<NEW_LINE>String event = listener.getEvent();<NEW_LINE>if (event.equals(eventType) || event.equals(TaskListener.EVENTNAME_ALL_EVENTS)) {<NEW_LINE>BaseTaskListener taskListener = createTaskListener(listener);<NEW_LINE>if (listener.getOnTransaction() != null) {<NEW_LINE>ExecutionEntity executionEntity = CommandContextUtil.getExecutionEntityManager().findById(taskEntity.getExecutionId());<NEW_LINE>planTransactionDependentTaskListener(executionEntity, (TransactionDependentTaskListener) taskListener, listener);<NEW_LINE>} else {<NEW_LINE>taskEntity.setEventName(eventType);<NEW_LINE>taskEntity.<MASK><NEW_LINE>try {<NEW_LINE>CommandContextUtil.getProcessEngineConfiguration().getDelegateInterceptor().handleInvocation(new TaskListenerInvocation((TaskListener) taskListener, taskEntity));<NEW_LINE>} finally {<NEW_LINE>taskEntity.setEventName(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | setEventHandlerId(listener.getId()); |
242,818 | protected void createOffsetsEnumsForAutomata(Terms termsIndex, int doc, List<OffsetsEnum> results) throws IOException {<NEW_LINE>final LabelledCharArrayMatcher[] automata = components.getAutomata();<NEW_LINE>List<List<PostingsEnum>> automataPostings = new ArrayList<>(automata.length);<NEW_LINE>for (int i = 0; i < automata.length; i++) {<NEW_LINE>automataPostings.add(new ArrayList<>());<NEW_LINE>}<NEW_LINE>TermsEnum termsEnum = termsIndex.iterator();<NEW_LINE>BytesRef term;<NEW_LINE>CharsRefBuilder refBuilder = new CharsRefBuilder();<NEW_LINE>while ((term = termsEnum.next()) != null) {<NEW_LINE>for (int i = 0; i < automata.length; i++) {<NEW_LINE>CharArrayMatcher automaton = automata[i];<NEW_LINE>refBuilder.copyUTF8Bytes(term);<NEW_LINE>if (automaton.match(refBuilder.get())) {<NEW_LINE>PostingsEnum postings = termsEnum.postings(null, PostingsEnum.OFFSETS);<NEW_LINE>if (doc == postings.advance(doc)) {<NEW_LINE>automataPostings.get<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < automata.length; i++) {<NEW_LINE>LabelledCharArrayMatcher automaton = automata[i];<NEW_LINE>List<PostingsEnum> postingsEnums = automataPostings.get(i);<NEW_LINE>if (postingsEnums.isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Build one OffsetsEnum exposing the automaton label as the term, and the sum of freq<NEW_LINE>BytesRef wildcardTerm = new BytesRef(automaton.getLabel());<NEW_LINE>int sumFreq = 0;<NEW_LINE>for (PostingsEnum postingsEnum : postingsEnums) {<NEW_LINE>sumFreq += postingsEnum.freq();<NEW_LINE>}<NEW_LINE>for (PostingsEnum postingsEnum : postingsEnums) {<NEW_LINE>results.add(new OffsetsEnum.OfPostings(wildcardTerm, sumFreq, postingsEnum));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (i).add(postings); |
1,230,166 | public boolean exists(@Nonnull @NonNull final ConnectorRequestContext context, @Nonnull @NonNull final QualifiedName name) {<NEW_LINE>final String keyspace = name.getDatabaseName();<NEW_LINE>final <MASK><NEW_LINE>log.debug("Checking if Cassandra table {}.{} exists for request {}", keyspace, table, context);<NEW_LINE>try {<NEW_LINE>final KeyspaceMetadata keyspaceMetadata = this.getCluster().getMetadata().getKeyspace(keyspace);<NEW_LINE>if (keyspaceMetadata == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final boolean exists = keyspaceMetadata.getTable(table) != null;<NEW_LINE>log.debug("Cassandra table {}.{} {} for request {}", keyspace, table, exists ? "exists" : "doesn't exist", context);<NEW_LINE>return exists;<NEW_LINE>} catch (final DriverException de) {<NEW_LINE>log.error(de.getMessage(), de);<NEW_LINE>throw this.getExceptionMapper().toConnectorException(de, name);<NEW_LINE>}<NEW_LINE>} | String table = name.getTableName(); |
371,003 | private DatabaseAccountUpdateParameters updateParametersInner(DatabaseAccountGetResultsInner inner) {<NEW_LINE>this.ensureFailoverIsInitialized();<NEW_LINE>DatabaseAccountUpdateParameters updateParameters = new DatabaseAccountUpdateParameters();<NEW_LINE>updateParameters.<MASK><NEW_LINE>updateParameters.withLocation(this.regionName().toLowerCase(Locale.ROOT));<NEW_LINE>updateParameters.withConsistencyPolicy(inner.consistencyPolicy());<NEW_LINE>updateParameters.withIpRules(inner.ipRules());<NEW_LINE>updateParameters.withIsVirtualNetworkFilterEnabled(inner.isVirtualNetworkFilterEnabled());<NEW_LINE>updateParameters.withEnableAutomaticFailover(inner.enableAutomaticFailover());<NEW_LINE>updateParameters.withCapabilities(inner.capabilities());<NEW_LINE>updateParameters.withEnableMultipleWriteLocations(inner.enableMultipleWriteLocations());<NEW_LINE>updateParameters.withEnableCassandraConnector(inner.enableCassandraConnector());<NEW_LINE>updateParameters.withConnectorOffer(inner.connectorOffer());<NEW_LINE>updateParameters.withDisableKeyBasedMetadataWriteAccess(inner.disableKeyBasedMetadataWriteAccess());<NEW_LINE>if (virtualNetworkRulesMap != null) {<NEW_LINE>updateParameters.withVirtualNetworkRules(new ArrayList<>(this.virtualNetworkRulesMap.values()));<NEW_LINE>virtualNetworkRulesMap = null;<NEW_LINE>}<NEW_LINE>this.addLocationsForParameters(new UpdateLocationParameters(updateParameters), this.failoverPolicies);<NEW_LINE>return updateParameters;<NEW_LINE>} | withTags(inner.tags()); |
1,605,516 | public void save(final OutputStream os, final Object obj) {<NEW_LINE>final EncogWriteHelper out = new EncogWriteHelper(os);<NEW_LINE>final RBFNetwork net = (RBFNetwork) obj;<NEW_LINE>final FlatNetworkRBF flat = (FlatNetworkRBF) net.getFlat();<NEW_LINE>out.addSection("RBF-NETWORK");<NEW_LINE>out.addSubSection("PARAMS");<NEW_LINE>out.<MASK><NEW_LINE>out.addSubSection("NETWORK");<NEW_LINE>out.writeProperty(BasicNetwork.TAG_BEGIN_TRAINING, flat.getBeginTraining());<NEW_LINE>out.writeProperty(BasicNetwork.TAG_CONNECTION_LIMIT, flat.getConnectionLimit());<NEW_LINE>out.writeProperty(BasicNetwork.TAG_CONTEXT_TARGET_OFFSET, flat.getContextTargetOffset());<NEW_LINE>out.writeProperty(BasicNetwork.TAG_CONTEXT_TARGET_SIZE, flat.getContextTargetSize());<NEW_LINE>out.writeProperty(BasicNetwork.TAG_END_TRAINING, flat.getEndTraining());<NEW_LINE>out.writeProperty(BasicNetwork.TAG_HAS_CONTEXT, flat.getHasContext());<NEW_LINE>out.writeProperty(PersistConst.INPUT_COUNT, flat.getInputCount());<NEW_LINE>out.writeProperty(BasicNetwork.TAG_LAYER_COUNTS, flat.getLayerCounts());<NEW_LINE>out.writeProperty(BasicNetwork.TAG_LAYER_FEED_COUNTS, flat.getLayerFeedCounts());<NEW_LINE>out.writeProperty(BasicNetwork.TAG_LAYER_CONTEXT_COUNT, flat.getLayerContextCount());<NEW_LINE>out.writeProperty(BasicNetwork.TAG_LAYER_INDEX, flat.getLayerIndex());<NEW_LINE>out.writeProperty(PersistConst.OUTPUT, flat.getLayerOutput());<NEW_LINE>out.writeProperty(PersistConst.OUTPUT_COUNT, flat.getOutputCount());<NEW_LINE>out.writeProperty(BasicNetwork.TAG_WEIGHT_INDEX, flat.getWeightIndex());<NEW_LINE>out.writeProperty(PersistConst.WEIGHTS, flat.getWeights());<NEW_LINE>out.writeProperty(BasicNetwork.TAG_BIAS_ACTIVATION, flat.getBiasActivation());<NEW_LINE>out.addSubSection("ACTIVATION");<NEW_LINE>for (final ActivationFunction af : flat.getActivationFunctions()) {<NEW_LINE>out.addColumn(af.getClass().getSimpleName());<NEW_LINE>for (int i = 0; i < af.getParams().length; i++) {<NEW_LINE>out.addColumn(af.getParams()[i]);<NEW_LINE>}<NEW_LINE>out.writeLine();<NEW_LINE>}<NEW_LINE>out.addSubSection("RBF");<NEW_LINE>for (final RadialBasisFunction rbf : flat.getRBF()) {<NEW_LINE>out.addColumn(rbf.getClass().getSimpleName());<NEW_LINE>out.addColumn(rbf.getWidth());<NEW_LINE>out.addColumn(rbf.getPeak());<NEW_LINE>for (int i = 0; i < rbf.getCenters().length; i++) {<NEW_LINE>out.addColumn(rbf.getCenters()[i]);<NEW_LINE>}<NEW_LINE>out.writeLine();<NEW_LINE>}<NEW_LINE>out.flush();<NEW_LINE>} | addProperties(net.getProperties()); |
1,799,776 | private void initChannelForText(String protocol, boolean restApi) {<NEW_LINE>protocolEncoder.signalEncoderCanReplace();<NEW_LINE>ChannelOptions config = channel.options();<NEW_LINE>config.setOption(SO_RCVBUF, clientRcvBuf());<NEW_LINE>ServerConnection connection = (TcpServerConnection) channel.attributeMap().get(ServerConnection.class);<NEW_LINE>TextEncoder encoder = new TextEncoder(connection);<NEW_LINE>channel.attributeMap().put(TextEncoder.TEXT_ENCODER, encoder);<NEW_LINE>TextDecoder decoder = restApi ? new RestApiTextDecoder(connection, encoder, false) : new <MASK><NEW_LINE>decoder.src(newByteBuffer(config.getOption(SO_RCVBUF), config.getOption(DIRECT_BUF)));<NEW_LINE>// we need to restore whatever is read<NEW_LINE>decoder.src().put(stringToBytes(protocol));<NEW_LINE>channel.inboundPipeline().replace(this, decoder);<NEW_LINE>} | MemcacheTextDecoder(connection, encoder, false); |
723,600 | public static Set<IBaseReference> extractReferencesToAutoVersion(FhirContext theFhirContext, ModelConfig theModelConfig, IBaseResource theResource) {<NEW_LINE>Map<IBaseReference, Object> references = Collections.emptyMap();<NEW_LINE>if (!theModelConfig.getAutoVersionReferenceAtPaths().isEmpty()) {<NEW_LINE>String resourceName = theFhirContext.getResourceType(theResource);<NEW_LINE>for (String nextPath : theModelConfig.getAutoVersionReferenceAtPathsByResourceType(resourceName)) {<NEW_LINE>List<IBaseReference> nextReferences = theFhirContext.newTerser().getValues(<MASK><NEW_LINE>for (IBaseReference next : nextReferences) {<NEW_LINE>if (next.getReferenceElement().hasVersionIdPart()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (references.isEmpty()) {<NEW_LINE>references = new IdentityHashMap<>();<NEW_LINE>}<NEW_LINE>references.put(next, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return references.keySet();<NEW_LINE>} | theResource, nextPath, IBaseReference.class); |
743,947 | public static void prepareExecutionContext(ExecutionContext context, DdlContext ddlContext) {<NEW_LINE>context.setDdlContext(ddlContext);<NEW_LINE>context.setServerVariables(ddlContext.getServerVariables());<NEW_LINE>context.setUserDefVariables(ddlContext.getUserDefVariables());<NEW_LINE>context.setExtraServerVariables(ddlContext.getExtraServerVariables());<NEW_LINE>context.setExtraCmds(ddlContext.getExtraCmds());<NEW_LINE>context.setEncoding(ddlContext.getEncoding());<NEW_LINE>prepareTimezone(context, ddlContext);<NEW_LINE>Map<String, Object> dataPassed = ddlContext.getDataPassed();<NEW_LINE>Object connId = dataPassed.get(SQLRecord.CONN_ID);<NEW_LINE>if (connId != null) {<NEW_LINE>context.setConnId((Long) connId);<NEW_LINE>}<NEW_LINE>Object testMode = dataPassed.get(DdlConstants.TEST_MODE);<NEW_LINE>if (testMode != null) {<NEW_LINE>context.setTestMode((Boolean) testMode);<NEW_LINE>}<NEW_LINE>Object clientIP = dataPassed.get(SQLRecord.CLIENT_IP);<NEW_LINE>if (clientIP != null) {<NEW_LINE>context<MASK><NEW_LINE>}<NEW_LINE>Object traceId = dataPassed.get(SQLRecord.TRACE_ID);<NEW_LINE>if (traceId != null) {<NEW_LINE>context.setTraceId((String) traceId);<NEW_LINE>}<NEW_LINE>Object txId = dataPassed.get(SQLRecord.TX_ID);<NEW_LINE>if (txId != null) {<NEW_LINE>context.setTxId((Long) txId);<NEW_LINE>}<NEW_LINE>if (ddlContext.getSchemaName() != null) {<NEW_LINE>context.setSchemaName(ddlContext.getSchemaName());<NEW_LINE>}<NEW_LINE>if (ddlContext.isEnableTrace()) {<NEW_LINE>context.setEnableDdlTrace(true);<NEW_LINE>context.setTracer(new SQLTracer());<NEW_LINE>}<NEW_LINE>} | .setClientIp((String) clientIP); |
295,684 | public Mesh buildFacadeItemQuads(ItemStack textureItem, Direction side) {<NEW_LINE>MeshBuilder meshBuilder = renderer.meshBuilder();<NEW_LINE>QuadEmitter emitter = meshBuilder.getEmitter();<NEW_LINE>BakedModel model = Minecraft.getInstance().getItemRenderer().getModel(textureItem, null, null, 0);<NEW_LINE>QuadReInterpolator interpolator = new QuadReInterpolator();<NEW_LINE>var itemColors = Minecraft.getInstance().itemColors;<NEW_LINE>QuadClamper clamper = new QuadClamper(THICK_FACADE_BOXES[side.ordinal()]);<NEW_LINE>for (int cullFaceIdx = 0; cullFaceIdx <= ModelHelper.NULL_FACE_ID; cullFaceIdx++) {<NEW_LINE>Direction cullFace = ModelHelper.faceFromIndex(cullFaceIdx);<NEW_LINE>List<BakedQuad> quads = model.getQuads(null, cullFace, new Random());<NEW_LINE>for (BakedQuad quad : quads) {<NEW_LINE>QuadTinter quadTinter = null;<NEW_LINE>// Prebake the color tint into the quad<NEW_LINE>if (quad.getTintIndex() != -1) {<NEW_LINE>quadTinter = new QuadTinter(itemColors.getColor(textureItem, quad.getTintIndex()));<NEW_LINE>}<NEW_LINE>emitter.fromVanilla(quad.<MASK><NEW_LINE>emitter.cullFace(cullFace);<NEW_LINE>emitter.nominalFace(quad.getDirection());<NEW_LINE>interpolator.setInputQuad(emitter);<NEW_LINE>if (!clamper.transform(emitter)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>interpolator.transform(emitter);<NEW_LINE>// Tints the quad if we need it to. Disabled by default.<NEW_LINE>if (quadTinter != null) {<NEW_LINE>quadTinter.transform(emitter);<NEW_LINE>}<NEW_LINE>emitter.emit();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return meshBuilder.build();<NEW_LINE>} | getVertices(), 0, false); |
302,773 | protected void textCharImpl(char ch, float x, float y) {<NEW_LINE>PFont.Glyph glyph = textFont.getGlyph(ch);<NEW_LINE>if (glyph != null) {<NEW_LINE>if (textMode == MODEL) {<NEW_LINE>FontTexture.TextureInfo tinfo = textTex.getTexInfo(glyph);<NEW_LINE>if (tinfo == null) {<NEW_LINE>// Adding new glyph to the font texture.<NEW_LINE>tinfo = textTex.addToTexture(this, glyph);<NEW_LINE>}<NEW_LINE>float high = glyph.height / (float) textFont.getSize();<NEW_LINE>float bwidth = glyph.width / <MASK><NEW_LINE>float lextent = glyph.leftExtent / (float) textFont.getSize();<NEW_LINE>float textent = glyph.topExtent / (float) textFont.getSize();<NEW_LINE>// The default text setting assumes an Y axis pointing down, so<NEW_LINE>// inverting in the the case Y points up<NEW_LINE>int sign = cameraUp ? -1 : +1;<NEW_LINE>float x1 = x + lextent * textSize;<NEW_LINE>float y1 = y - sign * textent * textSize;<NEW_LINE>float x2 = x1 + bwidth * textSize;<NEW_LINE>float y2 = y1 + sign * high * textSize;<NEW_LINE>textCharModelImpl(tinfo, x1, y1, x2, y2);<NEW_LINE>} else if (textMode == SHAPE) {<NEW_LINE>textCharShapeImpl(ch, x, y);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (float) textFont.getSize(); |
1,541,085 | private void startServer(MonoSink<String> sink) {<NEW_LINE>server.createContext("/", ex -> {<NEW_LINE>Headers rHeaders = ex.getResponseHeaders();<NEW_LINE>rHeaders.set("Content-Type", "text/plain");<NEW_LINE>ex.sendResponseHeaders(200, 0);<NEW_LINE>if ("GET".equalsIgnoreCase(ex.getRequestMethod())) {<NEW_LINE>var params = splitQuery(ex.getRequestURI());<NEW_LINE>if (params.containsKey("code")) {<NEW_LINE>String responseMessage = "Authorization grant recieved. you can close this window";<NEW_LINE>writeResponse(ex, responseMessage);<NEW_LINE>sink.success(params.get("code"));<NEW_LINE>} else {<NEW_LINE>String error = params.get("error");<NEW_LINE>String errorMessage = error != null ? error : "No Errormessage provided";<NEW_LINE>String responseMessage = "No Authorization code received. Error: " + errorMessage;<NEW_LINE>writeResponse(ex, responseMessage);<NEW_LINE>sink.error(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>server.start();<NEW_LINE>var port = server.getAddress().getPort();<NEW_LINE>log.info("Server started at http://localhost:" + port);<NEW_LINE>} | new IllegalStateException("No Code Received: " + errorMessage)); |
1,475,837 | private void scheduleCallback() {<NEW_LINE>long afterTime = timePeriodProvide.deltaAdd(agentInstanceContext.getStatementContext().getSchedulingService().getTime(), null, true, agentInstanceContext);<NEW_LINE>ScheduleHandleCallback callback = new ScheduleHandleCallback() {<NEW_LINE><NEW_LINE>public void scheduledTrigger() {<NEW_LINE>agentInstanceContext.getAuditProvider().scheduleFire(agentInstanceContext, ScheduleObjectType.view, factory.getViewName());<NEW_LINE>agentInstanceContext.getInstrumentationProvider().qViewScheduledEval(factory);<NEW_LINE>FirstTimeView.this.isClosed = true;<NEW_LINE>agentInstanceContext.getInstrumentationProvider().aViewScheduledEval();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>handle = new EPStatementHandleCallbackSchedule(<MASK><NEW_LINE>agentInstanceContext.getAuditProvider().scheduleAdd(afterTime, agentInstanceContext, handle, ScheduleObjectType.view, factory.getViewName());<NEW_LINE>agentInstanceContext.getStatementContext().getSchedulingService().add(afterTime, handle, scheduleSlot);<NEW_LINE>} | agentInstanceContext.getEpStatementAgentInstanceHandle(), callback); |
1,342,344 | public void marshall(ImportJobResponse importJobResponse, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (importJobResponse == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(importJobResponse.getCompletedPieces(), COMPLETEDPIECES_BINDING);<NEW_LINE>protocolMarshaller.marshall(importJobResponse.getCompletionDate(), COMPLETIONDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(importJobResponse.getCreationDate(), CREATIONDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(importJobResponse.getDefinition(), DEFINITION_BINDING);<NEW_LINE>protocolMarshaller.marshall(importJobResponse.getFailedPieces(), FAILEDPIECES_BINDING);<NEW_LINE>protocolMarshaller.marshall(importJobResponse.getFailures(), FAILURES_BINDING);<NEW_LINE>protocolMarshaller.marshall(importJobResponse.getId(), ID_BINDING);<NEW_LINE>protocolMarshaller.marshall(importJobResponse.getJobStatus(), JOBSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(importJobResponse.getTotalFailures(), TOTALFAILURES_BINDING);<NEW_LINE>protocolMarshaller.marshall(importJobResponse.getTotalPieces(), TOTALPIECES_BINDING);<NEW_LINE>protocolMarshaller.marshall(importJobResponse.getTotalProcessed(), TOTALPROCESSED_BINDING);<NEW_LINE>protocolMarshaller.marshall(importJobResponse.getType(), TYPE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | importJobResponse.getApplicationId(), APPLICATIONID_BINDING); |
147,566 | public <V1, V2, V3, V4, V5> Promise<MultipleResultsN, OneReject<?>, MasterProgress> when(DeferredAsyncTask<Void, ?, V1> taskV1, DeferredAsyncTask<Void, ?, V2> taskV2, DeferredAsyncTask<Void, ?, V3> taskV3, DeferredAsyncTask<Void, ?, V4> taskV4, DeferredAsyncTask<Void, ?, V5> taskV5, DeferredAsyncTask<Void, ?, ?> task6, DeferredAsyncTask<Void, ?, ?>... tasks) {<NEW_LINE>assertNotNull(taskV1, TASK_V1);<NEW_LINE>assertNotNull(taskV2, TASK_V2);<NEW_LINE>assertNotNull(taskV3, TASK_V3);<NEW_LINE>assertNotNull(taskV4, TASK_V4);<NEW_LINE>assertNotNull(taskV5, TASK_V5);<NEW_LINE>assertNotNull(task6, "task6");<NEW_LINE>Promise<V1, Throwable, ?> promise1 = when(taskV1);<NEW_LINE>Promise<V2, Throwable, ?> promise2 = when(taskV2);<NEW_LINE>Promise<V3, Throwable, <MASK><NEW_LINE>Promise<V4, Throwable, ?> promise4 = when(taskV4);<NEW_LINE>Promise<V5, Throwable, ?> promise5 = when(taskV5);<NEW_LINE>Promise<?, Throwable, ?> promise6 = when(task6);<NEW_LINE>Promise[] promiseN = new Promise[tasks.length];<NEW_LINE>for (int i = 0; i < tasks.length; i++) {<NEW_LINE>promiseN[i] = when(tasks[i]);<NEW_LINE>}<NEW_LINE>return new MasterDeferredObjectN(promise1, promise2, promise3, promise4, promise5, promise6, promiseN);<NEW_LINE>} | ?> promise3 = when(taskV3); |
1,224,640 | final DeleteEnvironmentConfigurationResult executeDeleteEnvironmentConfiguration(DeleteEnvironmentConfigurationRequest deleteEnvironmentConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteEnvironmentConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteEnvironmentConfigurationRequest> request = null;<NEW_LINE>Response<DeleteEnvironmentConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteEnvironmentConfigurationRequestMarshaller().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, "Elastic Beanstalk");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteEnvironmentConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeleteEnvironmentConfigurationResult> responseHandler = new StaxResponseHandler<DeleteEnvironmentConfigurationResult>(new DeleteEnvironmentConfigurationResultStaxUnmarshaller());<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(deleteEnvironmentConfigurationRequest)); |
851,283 | private void copyToTable(SnowflakeBatchServiceConfig config) throws SQLException {<NEW_LINE>SerializableFunction<Void, DataSource<MASK><NEW_LINE>List<String> filesList = config.getFilesList();<NEW_LINE>String database = config.getDatabase();<NEW_LINE>String schema = config.getSchema();<NEW_LINE>String table = config.getTable();<NEW_LINE>String query = config.getQuery();<NEW_LINE>SnowflakeTableSchema tableSchema = config.getTableSchema();<NEW_LINE>CreateDisposition createDisposition = config.getCreateDisposition();<NEW_LINE>WriteDisposition writeDisposition = config.getWriteDisposition();<NEW_LINE>String storageIntegrationName = config.getStorageIntegrationName();<NEW_LINE>String stagingBucketDir = config.getStagingBucketDir();<NEW_LINE>String source;<NEW_LINE>if (query != null) {<NEW_LINE>// Query must be surrounded with brackets<NEW_LINE>source = String.format("(%s)", query);<NEW_LINE>} else {<NEW_LINE>source = String.format("'%s'", stagingBucketDir);<NEW_LINE>}<NEW_LINE>filesList = filesList.stream().map(e -> String.format("'%s'", e)).collect(Collectors.toList());<NEW_LINE>String files = String.join(", ", filesList);<NEW_LINE>files = files.replaceAll(stagingBucketDir, "");<NEW_LINE>DataSource dataSource = dataSourceProviderFn.apply(null);<NEW_LINE>prepareTableAccordingCreateDisposition(dataSource, table, tableSchema, createDisposition);<NEW_LINE>prepareTableAccordingWriteDisposition(dataSource, table, writeDisposition);<NEW_LINE>if (!storageIntegrationName.isEmpty()) {<NEW_LINE>query = String.format("COPY INTO %s FROM %s FILES=(%s) FILE_FORMAT=(TYPE=CSV FIELD_OPTIONALLY_ENCLOSED_BY='%s' COMPRESSION=GZIP) STORAGE_INTEGRATION=%s;", getTablePath(database, schema, table), getProperBucketDir(source), files, getASCIICharRepresentation(config.getQuotationMark()), storageIntegrationName);<NEW_LINE>} else {<NEW_LINE>query = String.format("COPY INTO %s FROM %s FILES=(%s) FILE_FORMAT=(TYPE=CSV FIELD_OPTIONALLY_ENCLOSED_BY='%s' COMPRESSION=GZIP);", table, source, files, getASCIICharRepresentation(config.getQuotationMark()));<NEW_LINE>}<NEW_LINE>runStatement(query, dataSource.getConnection(), null);<NEW_LINE>} | > dataSourceProviderFn = config.getDataSourceProviderFn(); |
220,576 | // Internal methods.<NEW_LINE>private void buildAndPrepareSampleStreamWrappers(long positionUs) {<NEW_LINE>HlsMultivariantPlaylist multivariantPlaylist = Assertions.checkNotNull(playlistTracker.getMultivariantPlaylist());<NEW_LINE>Map<String, DrmInitData> overridingDrmInitData = useSessionKeys ? deriveOverridingDrmInitData(multivariantPlaylist.sessionKeyDrmInitData) : Collections.emptyMap();<NEW_LINE>boolean hasVariants = !multivariantPlaylist.variants.isEmpty();<NEW_LINE>List<Rendition> audioRenditions = multivariantPlaylist.audios;<NEW_LINE>List<Rendition> subtitleRenditions = multivariantPlaylist.subtitles;<NEW_LINE>pendingPrepareCount = 0;<NEW_LINE>ArrayList<HlsSampleStreamWrapper> sampleStreamWrappers = new ArrayList<>();<NEW_LINE>ArrayList<int[]> manifestUrlIndicesPerWrapper = new ArrayList<>();<NEW_LINE>if (hasVariants) {<NEW_LINE>buildAndPrepareMainSampleStreamWrapper(multivariantPlaylist, positionUs, sampleStreamWrappers, manifestUrlIndicesPerWrapper, overridingDrmInitData);<NEW_LINE>}<NEW_LINE>// TODO: Build video stream wrappers here.<NEW_LINE>buildAndPrepareAudioSampleStreamWrappers(positionUs, <MASK><NEW_LINE>audioVideoSampleStreamWrapperCount = sampleStreamWrappers.size();<NEW_LINE>// Subtitle stream wrappers. We can always use multivariant playlist information to prepare<NEW_LINE>// these.<NEW_LINE>for (int i = 0; i < subtitleRenditions.size(); i++) {<NEW_LINE>Rendition subtitleRendition = subtitleRenditions.get(i);<NEW_LINE>String sampleStreamWrapperUid = "subtitle:" + i + ":" + subtitleRendition.name;<NEW_LINE>HlsSampleStreamWrapper sampleStreamWrapper = buildSampleStreamWrapper(sampleStreamWrapperUid, C.TRACK_TYPE_TEXT, new Uri[] { subtitleRendition.url }, new Format[] { subtitleRendition.format }, null, Collections.emptyList(), overridingDrmInitData, positionUs);<NEW_LINE>manifestUrlIndicesPerWrapper.add(new int[] { i });<NEW_LINE>sampleStreamWrappers.add(sampleStreamWrapper);<NEW_LINE>sampleStreamWrapper.prepareWithMultivariantPlaylistInfo(new TrackGroup[] { new TrackGroup(sampleStreamWrapperUid, subtitleRendition.format) }, /* primaryTrackGroupIndex= */<NEW_LINE>0);<NEW_LINE>}<NEW_LINE>this.sampleStreamWrappers = sampleStreamWrappers.toArray(new HlsSampleStreamWrapper[0]);<NEW_LINE>this.manifestUrlIndicesPerWrapper = manifestUrlIndicesPerWrapper.toArray(new int[0][]);<NEW_LINE>pendingPrepareCount = this.sampleStreamWrappers.length;<NEW_LINE>// Set timestamp master and trigger preparation (if not already prepared)<NEW_LINE>this.sampleStreamWrappers[0].setIsTimestampMaster(true);<NEW_LINE>for (HlsSampleStreamWrapper sampleStreamWrapper : this.sampleStreamWrappers) {<NEW_LINE>sampleStreamWrapper.continuePreparing();<NEW_LINE>}<NEW_LINE>// All wrappers are enabled during preparation.<NEW_LINE>enabledSampleStreamWrappers = this.sampleStreamWrappers;<NEW_LINE>} | audioRenditions, sampleStreamWrappers, manifestUrlIndicesPerWrapper, overridingDrmInitData); |
1,474,727 | private static PreviousFileRevisionProvider createDefaultPreviousFileRevisionProvider(@Nonnull FileAnnotation annotation) {<NEW_LINE>List<VcsFileRevision> revisions = annotation.getRevisions();<NEW_LINE>if (revisions == null)<NEW_LINE>return null;<NEW_LINE>Map<VcsRevisionNumber, VcsFileRevision> map = new HashMap<>();<NEW_LINE>for (int i = 0; i < revisions.size(); i++) {<NEW_LINE>VcsFileRevision revision = revisions.get(i);<NEW_LINE>VcsFileRevision previousRevision = i + 1 < revisions.size() ? revisions.<MASK><NEW_LINE>map.put(revision.getRevisionNumber(), previousRevision);<NEW_LINE>}<NEW_LINE>List<VcsFileRevision> lineToRevision = new ArrayList<>(annotation.getLineCount());<NEW_LINE>for (int i = 0; i < annotation.getLineCount(); i++) {<NEW_LINE>lineToRevision.add(map.get(annotation.getLineRevisionNumber(i)));<NEW_LINE>}<NEW_LINE>VcsFileRevision lastRevision = ContainerUtil.getFirstItem(revisions);<NEW_LINE>return new PreviousFileRevisionProvider() {<NEW_LINE><NEW_LINE>@javax.annotation.Nullable<NEW_LINE>@Override<NEW_LINE>public VcsFileRevision getPreviousRevision(int lineNumber) {<NEW_LINE>LOG.assertTrue(lineNumber >= 0 && lineNumber < lineToRevision.size());<NEW_LINE>return lineToRevision.get(lineNumber);<NEW_LINE>}<NEW_LINE><NEW_LINE>@javax.annotation.Nullable<NEW_LINE>@Override<NEW_LINE>public VcsFileRevision getLastRevision() {<NEW_LINE>return lastRevision;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | get(i + 1) : null; |
1,840,953 | public void processWay(ReaderWay way) {<NEW_LINE>try {<NEW_LINE>if (arrStorageBuilders != null) {<NEW_LINE>int nStorages = arrStorageBuilders.length;<NEW_LINE>if (nStorages > 0) {<NEW_LINE>if (nStorages == 1) {<NEW_LINE>arrStorageBuilders[0].processWay(way);<NEW_LINE>} else if (nStorages == 2) {<NEW_LINE>arrStorageBuilders[0].processWay(way);<NEW_LINE>arrStorageBuilders[1].processWay(way);<NEW_LINE>} else if (nStorages == 3) {<NEW_LINE>arrStorageBuilders[0].processWay(way);<NEW_LINE>arrStorageBuilders[1].processWay(way);<NEW_LINE>arrStorageBuilders[2].processWay(way);<NEW_LINE>} else if (nStorages == 4) {<NEW_LINE>arrStorageBuilders[0].processWay(way);<NEW_LINE>arrStorageBuilders<MASK><NEW_LINE>arrStorageBuilders[2].processWay(way);<NEW_LINE>arrStorageBuilders[3].processWay(way);<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < nStorages; ++i) {<NEW_LINE>arrStorageBuilders[i].processWay(way);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>LOGGER.warning(ex.getMessage() + ". Way id = " + way.getId());<NEW_LINE>}<NEW_LINE>} | [1].processWay(way); |
1,054,951 | private void startCardHintPopup(final TransferData data, final Component parentComponent, final Point parentPoint) {<NEW_LINE>MageCard cardPanel = data<MASK><NEW_LINE>if (data.getTooltipDelay() > 0) {<NEW_LINE>// custom tooltip<NEW_LINE>tooltipDelay = data.getTooltipDelay();<NEW_LINE>} else {<NEW_LINE>// from preferences<NEW_LINE>tooltipDelay = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_TOOLTIPS_DELAY, 300);<NEW_LINE>}<NEW_LINE>if (tooltipDelay == 0) {<NEW_LINE>// disabled<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (cardInfoPane == null) {<NEW_LINE>// create new popup<NEW_LINE>if (data.getLocationOnScreen() == null) {<NEW_LINE>data.setLocationOnScreen(cardPanel.getCardLocationOnScreen().getCardPoint());<NEW_LINE>}<NEW_LINE>PopupFactory factory = PopupFactory.getSharedInstance();<NEW_LINE>data.getPopupText().updateText();<NEW_LINE>tooltipPopup = factory.getPopup(cardPanel, data.getPopupText(), (int) data.getLocationOnScreen().getX() + data.getPopupOffsetX(), (int) data.getLocationOnScreen().getY() + data.getPopupOffsetY() + 40);<NEW_LINE>tooltipPopup.show();<NEW_LINE>// hack to get popup to resize to fit text<NEW_LINE>tooltipPopup.hide();<NEW_LINE>tooltipPopup = factory.getPopup(cardPanel, data.getPopupText(), (int) data.getLocationOnScreen().getX() + data.getPopupOffsetX(), (int) data.getLocationOnScreen().getY() + data.getPopupOffsetY() + 40);<NEW_LINE>tooltipPopup.show();<NEW_LINE>} else {<NEW_LINE>showCardHintPopup(data, parentComponent, parentPoint);<NEW_LINE>}<NEW_LINE>} | .getComponent().getTopPanelRef(); |
800,373 | public void readNext() throws NoSuchElementException {<NEW_LINE>if (paragraphIterator != null && paragraphIterator.hasNext()) {<NEW_LINE>// if the record contains more paragraphs, we parse them<NEW_LINE>String paragraph = paragraphIterator.next().<MASK><NEW_LINE>paragraphNumber += 1;<NEW_LINE>bufferedRecord = new Cord19ParagraphCollection.Document(record, paragraph, paragraphNumber);<NEW_LINE>} else if (iterator.hasNext()) {<NEW_LINE>// if CSV contains more lines, we parse the next record<NEW_LINE>record = iterator.next();<NEW_LINE>String recordFullText = "";<NEW_LINE>// get paragraphs from full text file<NEW_LINE>String fullTextPath = null;<NEW_LINE>if (!record.get("pmc_json_files").isEmpty()) {<NEW_LINE>fullTextPath = "/" + record.get("pmc_json_files").split(";")[0];<NEW_LINE>} else if (!record.get("pdf_json_files").isEmpty()) {<NEW_LINE>fullTextPath = "/" + record.get("pdf_json_files").split(";")[0];<NEW_LINE>}<NEW_LINE>if (fullTextPath != null) {<NEW_LINE>try {<NEW_LINE>String recordFullTextPath = Cord19ParagraphCollection.this.path.toString() + fullTextPath;<NEW_LINE>recordFullText = new String(Files.readAllBytes(Paths.get(recordFullTextPath)));<NEW_LINE>FileReader recordFullTextFileReader = new FileReader(recordFullTextPath);<NEW_LINE>ObjectMapper mapper = new ObjectMapper();<NEW_LINE>JsonNode recordJsonNode = mapper.readerFor(JsonNode.class).readTree(recordFullTextFileReader);<NEW_LINE>paragraphIterator = recordJsonNode.get("body_text").elements();<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.error("Error parsing file at " + fullTextPath + "\n" + e.getMessage());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>paragraphIterator = null;<NEW_LINE>}<NEW_LINE>paragraphNumber = 0;<NEW_LINE>bufferedRecord = new Cord19ParagraphCollection.Document(record, recordFullText);<NEW_LINE>} else {<NEW_LINE>throw new NoSuchElementException("Reached end of CSVRecord Entries Iterator");<NEW_LINE>}<NEW_LINE>} | get("text").asText(); |
1,350,154 | public void run() {<NEW_LINE>final Properties surveyProperties = new Properties();<NEW_LINE>try (final InputStream input = freeplaneSurveyProperties.openRemoteConfiguration()) {<NEW_LINE>surveyProperties.load(input);<NEW_LINE>final int frequency = Integer.parseInt(surveyProperties.getProperty(FREQUENCY_KEY));<NEW_LINE>if (frequency > 0 && randomNumber < 1. / frequency || freeplaneSurveyProperties.remindMeLaterIsActive()) {<NEW_LINE><MASK><NEW_LINE>title = surveyProperties.getProperty(TITLE_KEY);<NEW_LINE>question = surveyProperties.getProperty(QUESTION_KEY);<NEW_LINE>surveyUrl = surveyProperties.getProperty(SURVEY_URL_KEY);<NEW_LINE>runOn = RunningPoint.valueOf(surveyProperties.getProperty(RUN_ON_KEY, RunningPoint.NEVER.name()));<NEW_LINE>} else<NEW_LINE>runOn = RunningPoint.NEVER;<NEW_LINE>} catch (Exception e) {<NEW_LINE>runOn = RunningPoint.NEVER;<NEW_LINE>}<NEW_LINE>if (RunningPoint.ON_START == runOn)<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>surveyRunner.runServey(surveyId, title, question, surveyUrl);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | surveyId = surveyProperties.getProperty(SURVEY_ID_KEY); |
880,821 | public static FleetController create(FleetControllerOptions options, StatusPageServerInterface statusPageServer, MetricReporter metricReporter) throws Exception {<NEW_LINE>var context = new FleetControllerContextImpl(options);<NEW_LINE>var timer = new RealTimer();<NEW_LINE>var metricUpdater = new MetricUpdater(metricReporter, options.fleetControllerIndex, options.clusterName);<NEW_LINE>var log = new EventLog(timer, metricUpdater);<NEW_LINE>var cluster = new ContentCluster(options.clusterName, options.nodes, options.storageDistribution);<NEW_LINE>var stateGatherer = new NodeStateGatherer(timer, timer, log);<NEW_LINE>var communicator = new RPCCommunicator(RPCCommunicator.createRealSupervisor(), timer, options.fleetControllerIndex, options.nodeStateRequestTimeoutMS, options.nodeStateRequestTimeoutEarliestPercentage, <MASK><NEW_LINE>var database = new DatabaseHandler(context, new ZooKeeperDatabaseFactory(context), timer, options.zooKeeperServerAddress, timer);<NEW_LINE>var lookUp = new SlobrokClient(context, timer);<NEW_LINE>var stateGenerator = new StateChangeHandler(context, timer, log);<NEW_LINE>var stateBroadcaster = new SystemStateBroadcaster(context, timer, timer);<NEW_LINE>var masterElectionHandler = new MasterElectionHandler(context, options.fleetControllerIndex, options.fleetControllerCount, timer, timer);<NEW_LINE>var controller = new FleetController(context, timer, log, cluster, stateGatherer, communicator, statusPageServer, null, lookUp, database, stateGenerator, stateBroadcaster, masterElectionHandler, metricUpdater, options);<NEW_LINE>controller.start();<NEW_LINE>return controller;<NEW_LINE>} | options.nodeStateRequestTimeoutLatestPercentage, options.nodeStateRequestRoundTripTimeMaxSeconds); |
488,856 | static Object doTpDict(PythonManagedClass object, @SuppressWarnings("unused") PythonNativeWrapper nativeWrapper, @SuppressWarnings("unused") String key, @Shared("factory") @Cached PythonObjectFactory factory, @Cached GetOrCreateDictNode getDict, @CachedLibrary(limit = "2") HashingStorageLibrary storageLib, @Shared("toSulongNode") @Cached ToSulongNode toSulongNode) {<NEW_LINE>// TODO(fa): we could cache the dict instance on the class' native wrapper<NEW_LINE>PDict dict = getDict.execute(object);<NEW_LINE>if (dict instanceof StgDictObject) {<NEW_LINE>return dict.getNativeWrapper();<NEW_LINE>}<NEW_LINE>HashingStorage dictStorage = dict.getDictStorage();<NEW_LINE>if (dictStorage instanceof DynamicObjectStorage) {<NEW_LINE>// reuse the existing and modifiable storage<NEW_LINE>return toSulongNode.execute(factory.createDict(dict.getDictStorage()));<NEW_LINE>}<NEW_LINE>HashingStorage storage = new <MASK><NEW_LINE>if (dictStorage != null) {<NEW_LINE>// copy all mappings to the new storage<NEW_LINE>storage = storageLib.addAllToOther(dictStorage, storage);<NEW_LINE>}<NEW_LINE>dict.setDictStorage(storage);<NEW_LINE>return toSulongNode.execute(dict);<NEW_LINE>} | DynamicObjectStorage(object.getStorage()); |
1,582,995 | public QueryResult<OrderedCounterRows<K, N>> execute() {<NEW_LINE>Assert.notNull(columnFamilyName, "columnFamilyName can't be null");<NEW_LINE>Assert.notNull(superColumn, "superColumn cannot be null");<NEW_LINE>return new QueryResultImpl<OrderedCounterRows<K, N>>(keyspace.doExecute(new KeyspaceOperationCallback<OrderedCounterRows<K, N>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public OrderedCounterRows<K, N> doInKeyspace(KeyspaceService ks) throws HectorException {<NEW_LINE><MASK><NEW_LINE>columnParent.setSuper_column(sNameSerializer.toByteBuffer(superColumn));<NEW_LINE>Map<K, List<CounterColumn>> thriftRet = keySerializer.fromBytesMap(ks.getRangeCounterSlices(columnParent, getPredicate(), keyRange.toThrift()));<NEW_LINE>return new OrderedCounterRowsImpl<K, N>((LinkedHashMap<K, List<CounterColumn>>) thriftRet, columnNameSerializer);<NEW_LINE>}<NEW_LINE>}, consistency), this);<NEW_LINE>} | ColumnParent columnParent = new ColumnParent(columnFamilyName); |
1,678,606 | public void addTab(Path path, Runnable... runnables) {<NEW_LINE>ObservableList<Item> recentFiles = storedConfigBean.getRecentFiles();<NEW_LINE>if (Files.notExists(path)) {<NEW_LINE>recentFiles.<MASK><NEW_LINE>logger.debug("Path {} not found in the filesystem", path);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ObservableList<Tab> tabs = controller.getTabPane().getTabs();<NEW_LINE>for (Tab tab : tabs) {<NEW_LINE>if (tab instanceof MyTab) {<NEW_LINE>MyTab myTab = (MyTab) tab;<NEW_LINE>Path currentPath = myTab.getPath();<NEW_LINE>if (Objects.nonNull(currentPath))<NEW_LINE>if (currentPath.equals(path)) {<NEW_LINE>// Select already added tab<NEW_LINE>myTab.select();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>AnchorPane anchorPane = new AnchorPane();<NEW_LINE>MyTab tab = createTab();<NEW_LINE>tab.setTabText(path.getFileName().toString());<NEW_LINE>EditorPane editorPane = tab.getEditorPane();<NEW_LINE>threadService.runActionLater(() -> {<NEW_LINE>TabPane tabPane = controller.getTabPane();<NEW_LINE>tabPane.getTabs().add(tab);<NEW_LINE>tab.select();<NEW_LINE>});<NEW_LINE>Node editorVBox = editorService.createEditorVBox(editorPane, tab);<NEW_LINE>controller.fitToParent(editorVBox);<NEW_LINE>anchorPane.getChildren().add(editorVBox);<NEW_LINE>tab.setContent(anchorPane);<NEW_LINE>tab.setPath(path);<NEW_LINE>Tooltip tip = new Tooltip(path.toString());<NEW_LINE>Tooltip.install(tab.getGraphic(), tip);<NEW_LINE>recentFiles.remove(new Item(path));<NEW_LINE>recentFiles.add(0, new Item(path));<NEW_LINE>editorPane.getHandleReadyTasks().clear();<NEW_LINE>editorPane.getHandleReadyTasks().addAll(runnables);<NEW_LINE>editorPane.load(String.format(editorUrl, controller.getPort()));<NEW_LINE>} | remove(new Item(path)); |
1,513,725 | private void stageIndex(BlockingQueue<List<Tuple<NodeId>>> pipe, TupleIndex idx) {<NEW_LINE>TransactionCoordinator coordinator = CoLib.newCoordinator();<NEW_LINE>CoLib.add(coordinator, idx);<NEW_LINE>CoLib.start(coordinator);<NEW_LINE>Transaction transaction = coordinator.begin(TxnType.WRITE);<NEW_LINE>boolean workHasBeenDone;<NEW_LINE>try {<NEW_LINE>Destination<Tuple<NodeId>> loader = loadTuples(idx);<NEW_LINE>for (; ; ) {<NEW_LINE>List<Tuple<NodeId>> tuples = pipe.take();<NEW_LINE>if (tuples.isEmpty())<NEW_LINE>break;<NEW_LINE>loader.deliver(tuples);<NEW_LINE>}<NEW_LINE>workHasBeenDone = !idx.isEmpty();<NEW_LINE>transaction.commit();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Log.<MASK><NEW_LINE>transaction.abort();<NEW_LINE>workHasBeenDone = false;<NEW_LINE>}<NEW_LINE>CoLib.finish(coordinator);<NEW_LINE>if (workHasBeenDone)<NEW_LINE>output.print("Finish - index %s", idx.getName());<NEW_LINE>termination.release();<NEW_LINE>} | error(this, "Interrupted", ex); |
1,611,107 | public boolean authorize(String tenantId, @Sensitive String tenantPassword) throws IOException {<NEW_LINE>// Prepare the auth frame<NEW_LINE>ByteArrayOutputStream output = new ByteArrayOutputStream();<NEW_LINE>byte[] tenantIdBytes = tenantId.getBytes(UTF_8);<NEW_LINE>byte[] tenantPasswordBytes = tenantPassword.getBytes(UTF_8);<NEW_LINE>byte tenantIdLength = (byte) tenantIdBytes.length;<NEW_LINE>byte tenantPasswordLength = (byte) tenantPasswordBytes.length;<NEW_LINE>// Protocol version 2<NEW_LINE>output.write(MT_PROTOCOL_VERSION.getBytes(UTF_8));<NEW_LINE>// Frame type 'T'<NEW_LINE>output.write(TENANT_FRAME_TYPE.getBytes(UTF_8));<NEW_LINE>// 1 byte id length<NEW_LINE>output.write(ByteBuffer.allocate(1).put(tenantIdLength).array());<NEW_LINE>output.write(tenantIdBytes);<NEW_LINE>// 1 byte password length<NEW_LINE>output.write(ByteBuffer.allocate(1).put(tenantPasswordLength).array());<NEW_LINE>output.write(tenantPasswordBytes);<NEW_LINE>// Write the auth frame to the wire<NEW_LINE>writeFrame(output.toByteArray());<NEW_LINE>// Check the ack to see if the user is authorized<NEW_LINE>byte[<MASK><NEW_LINE>int bytesReceived = 0;<NEW_LINE>while ((bytesReceived = bytesReceived + in.read(buffer, bytesReceived, buffer.length - bytesReceived)) != -1) {<NEW_LINE>if (bytesReceived == 6) {<NEW_LINE>String response = new String(Arrays.copyOfRange(buffer, 0, 1), UTF_8);<NEW_LINE>String frameType = new String(Arrays.copyOfRange(buffer, 1, 2), UTF_8);<NEW_LINE>if (frameType.equals("A")) {<NEW_LINE>if (response.equals("0"))<NEW_LINE>return false;<NEW_LINE>else<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | ] buffer = new byte[6]; |
679,938 | public void markPotentiallyNonNullBit(LocalVariableBinding local) {<NEW_LINE>if (this != DEAD_END) {<NEW_LINE>this.tagBits |= NULL_FLAG_MASK;<NEW_LINE>int position;<NEW_LINE>long mask;<NEW_LINE>if ((position = local.id + this.maxFieldCount) < BitCacheSize) {<NEW_LINE>// use bits<NEW_LINE>mask = 1L << position;<NEW_LINE>// $NON-NLS-1$<NEW_LINE>isTrue((this.nullBit1 & mask) == 0, "Adding 'potentially non-null' mark in unexpected state");<NEW_LINE>this.nullBit3 |= mask;<NEW_LINE>if (COVERAGE_TEST_FLAG) {<NEW_LINE>if (CoverageTestId == 42) {<NEW_LINE>this.nullBit1 = ~0;<NEW_LINE>this.nullBit2 = 0;<NEW_LINE>this.nullBit3 = ~0;<NEW_LINE>this.nullBit4 = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// use extra vector<NEW_LINE>int vectorIndex = (position / BitCacheSize) - 1;<NEW_LINE>if (this.extra == null) {<NEW_LINE>int length = vectorIndex + 1;<NEW_LINE>createExtraSpace(length);<NEW_LINE>} else {<NEW_LINE>// might need to grow the arrays<NEW_LINE>int oldLength;<NEW_LINE>if (vectorIndex >= (oldLength = this.extra[0].length)) {<NEW_LINE>for (int j = 0; j < extraLength; j++) {<NEW_LINE>System.arraycopy(this.extra[j], 0, (this.extra[j] = new long[vectorIndex + 1]), 0, oldLength);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mask = 1L << (position % BitCacheSize);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>isTrue((this.extra[2][vectorIndex] & mask) == 0, "Adding 'potentially non-null' mark in unexpected state");<NEW_LINE>this.extra[4][vectorIndex] |= mask;<NEW_LINE>if (COVERAGE_TEST_FLAG) {<NEW_LINE>if (CoverageTestId == 43) {<NEW_LINE>this.extra[2][vectorIndex] = ~0;<NEW_LINE>this.extra<MASK><NEW_LINE>this.extra[4][vectorIndex] = ~0;<NEW_LINE>this.extra[5][vectorIndex] = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | [3][vectorIndex] = 0; |
538,962 | public void marshall(ReviewActionDetail reviewActionDetail, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (reviewActionDetail == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(reviewActionDetail.getActionName(), ACTIONNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(reviewActionDetail.getTargetId(), TARGETID_BINDING);<NEW_LINE>protocolMarshaller.marshall(reviewActionDetail.getTargetType(), TARGETTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(reviewActionDetail.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(reviewActionDetail.getCompleteTime(), COMPLETETIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(reviewActionDetail.getResult(), RESULT_BINDING);<NEW_LINE>protocolMarshaller.marshall(reviewActionDetail.getErrorCode(), ERRORCODE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | reviewActionDetail.getActionId(), ACTIONID_BINDING); |
290,247 | protected Object rawGetStarlarkProvider(String providerKey) {<NEW_LINE>if (providerKey.equals(AbstractConfiguredTarget.ACTIONS_FIELD_NAME)) {<NEW_LINE>ImmutableList.Builder<ActionAnalysisMetadata> actions = ImmutableList.builder();<NEW_LINE>// Only expose actions which are StarlarkValues.<NEW_LINE>// TODO(cparsons): Expose all actions to Starlark.<NEW_LINE>for (ConfiguredAspect aspect : aspects) {<NEW_LINE>actions.addAll(aspect.getActions().stream().filter(action -> action <MASK><NEW_LINE>}<NEW_LINE>if (base instanceof RuleConfiguredTarget) {<NEW_LINE>actions.addAll(((RuleConfiguredTarget) base).getActions().stream().filter(action -> action instanceof ActionApi).iterator());<NEW_LINE>}<NEW_LINE>return actions.build();<NEW_LINE>}<NEW_LINE>Object provider = nonBaseProviders.get(providerKey);<NEW_LINE>if (provider == null) {<NEW_LINE>provider = base.get(providerKey);<NEW_LINE>}<NEW_LINE>return provider;<NEW_LINE>} | instanceof ActionApi).iterator()); |
1,092,310 | public Stream<IJavaType> arguments() {<NEW_LINE>if (data.getExtras() != null && data.getExtras().containsKey("arguments")) {<NEW_LINE>List<Map<String, Object>> args = (List<Map<String, Object>>) data.getExtras().get("arguments");<NEW_LINE>if (args != null) {<NEW_LINE>List<IJavaType> types = new ArrayList<>(args.size());<NEW_LINE>for (Map<String, Object> entry : args) {<NEW_LINE>JavaTypeData typeData = GSON.fromJson(GSON.toJson(entry), JavaTypeData.class);<NEW_LINE>if (entry.get("kind") instanceof Double) {<NEW_LINE>typeData.setKind(JavaTypeKind.values()[((Double) entry.get("kind"<MASK><NEW_LINE>}<NEW_LINE>types.add(Wrappers.wrap(typeData));<NEW_LINE>}<NEW_LINE>return types.stream();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Stream.of();<NEW_LINE>} | )).intValue()]); |
335,964 | public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>super.onCreateView(inflater, container, savedInstanceState);<NEW_LINE>setHasOptionsMenu(true);<NEW_LINE>View rootView = inflater.inflate(R.layout.pager_fragment, container, false);<NEW_LINE>viewPager = rootView.findViewById(R.id.viewpager);<NEW_LINE>toolbar = rootView.findViewById(R.id.toolbar);<NEW_LINE>toolbar.setTitle(getString(R.string.statistics_label));<NEW_LINE>toolbar.inflateMenu(R.menu.statistics);<NEW_LINE>toolbar.setNavigationOnClickListener(v -> getParentFragmentManager().popBackStack());<NEW_LINE>viewPager.setAdapter(new StatisticsPagerAdapter(this));<NEW_LINE>// Give the TabLayout the ViewPager<NEW_LINE>tabLayout = rootView.findViewById(R.id.sliding_tabs);<NEW_LINE>super.setupPagedToolbar(toolbar, viewPager);<NEW_LINE>new TabLayoutMediator(tabLayout, viewPager, (tab, position) -> {<NEW_LINE>switch(position) {<NEW_LINE>case POS_SUBSCRIPTIONS:<NEW_LINE>tab.setText(R.string.subscriptions_label);<NEW_LINE>break;<NEW_LINE>case POS_YEARS:<NEW_LINE>tab.<MASK><NEW_LINE>break;<NEW_LINE>case POS_SPACE_TAKEN:<NEW_LINE>tab.setText(R.string.downloads_label);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}).attach();<NEW_LINE>return rootView;<NEW_LINE>} | setText(R.string.years_statistics_label); |
1,216,276 | public void marshall(AssociationExecutionTarget associationExecutionTarget, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (associationExecutionTarget == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(associationExecutionTarget.getAssociationId(), ASSOCIATIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(associationExecutionTarget.getAssociationVersion(), ASSOCIATIONVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(associationExecutionTarget.getExecutionId(), EXECUTIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(associationExecutionTarget.getResourceId(), RESOURCEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(associationExecutionTarget.getResourceType(), RESOURCETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(associationExecutionTarget.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(associationExecutionTarget.getDetailedStatus(), DETAILEDSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(associationExecutionTarget.getLastExecutionDate(), LASTEXECUTIONDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(associationExecutionTarget.getOutputSource(), OUTPUTSOURCE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>} | e.getMessage(), e); |
613,825 | Object doGeneric(VirtualFrame frame, Object objectPtr, int mode, long targetTypeSize) {<NEW_LINE>Object resolvedPointer = ensurePointerClassProfile().profile(ensureResolveHandleNode().execute(objectPtr));<NEW_LINE>try {<NEW_LINE>if (resolvedPointer instanceof PrimitiveNativeWrapper) {<NEW_LINE>PrimitiveNativeWrapper wrapper = (PrimitiveNativeWrapper) resolvedPointer;<NEW_LINE>if (requiredPInt(mode) && !wrapper.isSubtypeOfInt()) {<NEW_LINE>throw raise(TypeError, ErrorMessages.INTEGER_REQUIRED);<NEW_LINE>}<NEW_LINE>return ensureConvertPIntToPrimitiveNode().execute(wrapper, signed(mode), PInt.intValueExact(targetTypeSize), exact(mode));<NEW_LINE>}<NEW_LINE>Object object = ensureToJavaNode().execute(resolvedPointer);<NEW_LINE>if (requiredPInt(mode) && !ensureIsSubtypeNode().execute(getPythonClass(object), PythonBuiltinClassType.PInt)) {<NEW_LINE>throw raise(TypeError, ErrorMessages.INTEGER_REQUIRED);<NEW_LINE>}<NEW_LINE>// the 'ConvertPIntToPrimitiveNode' uses 'AsNativePrimitive' which does coercion<NEW_LINE>Object coerced = ensureConvertPIntToPrimitiveNode().execute(object, signed(mode), PInt.intValueExact(targetTypeSize), exact(mode));<NEW_LINE>return <MASK><NEW_LINE>} catch (OverflowException e) {<NEW_LINE>throw CompilerDirectives.shouldNotReachHere();<NEW_LINE>} catch (PException e) {<NEW_LINE>ensureTransformExceptionToNativeNode().execute(frame, e);<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>} | ensureCastToNativeLongNode().execute(coerced); |
1,684,225 | public Response<Void> deleteByIdWithResponse(String id, Boolean deleteRunningTasks, Context context) {<NEW_LINE>String groupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (groupName == 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 serviceName = Utils.getValueFromIdByName(id, "services");<NEW_LINE>if (serviceName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id)));<NEW_LINE>}<NEW_LINE>String projectName = Utils.getValueFromIdByName(id, "projects");<NEW_LINE>if (projectName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id)));<NEW_LINE>}<NEW_LINE>String taskName = Utils.getValueFromIdByName(id, "tasks");<NEW_LINE>if (taskName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'tasks'.", id)));<NEW_LINE>}<NEW_LINE>return this.deleteWithResponse(groupName, serviceName, <MASK><NEW_LINE>} | projectName, taskName, deleteRunningTasks, context); |
1,287,570 | private void check(APIRecoverVmInstanceMsg msg, Map<String, Quota.QuotaPair> pairs) {<NEW_LINE>String currentAccountUuid = msg.getSession().getAccountUuid();<NEW_LINE>String resourceTargetOwnerAccountUuid = msg.getSession().getAccountUuid();<NEW_LINE>long totalVmNumQuota = pairs.get(<MASK><NEW_LINE>VmQuotaUtil.VmQuota vmQuotaUsed = new VmQuotaUtil().getUsedVmCpuMemory(currentAccountUuid);<NEW_LINE>long totalVmNumAsked = 1;<NEW_LINE>QuotaUtil.QuotaCompareInfo quotaCompareInfo;<NEW_LINE>{<NEW_LINE>quotaCompareInfo = new QuotaUtil.QuotaCompareInfo();<NEW_LINE>quotaCompareInfo.currentAccountUuid = currentAccountUuid;<NEW_LINE>quotaCompareInfo.resourceTargetOwnerAccountUuid = resourceTargetOwnerAccountUuid;<NEW_LINE>quotaCompareInfo.quotaName = VmQuotaConstant.VM_TOTAL_NUM;<NEW_LINE>quotaCompareInfo.quotaValue = totalVmNumQuota;<NEW_LINE>quotaCompareInfo.currentUsed = vmQuotaUsed.totalVmNum;<NEW_LINE>quotaCompareInfo.request = totalVmNumAsked;<NEW_LINE>new QuotaUtil().CheckQuota(quotaCompareInfo);<NEW_LINE>}<NEW_LINE>} | VmQuotaConstant.VM_TOTAL_NUM).getValue(); |
1,482,315 | public void run() {<NEW_LINE>TcpProxy tcp = TcpProxy.getTcpProxy(serverId);<NEW_LINE>List<Value> names = null;<NEW_LINE>try {<NEW_LINE>MapPack param = new MapPack();<NEW_LINE>param.put("objType", objType);<NEW_LINE>param.put("tagGroup", tagGroup);<NEW_LINE>names = tcp.processValues(RequestCmd.TAGCNT_TAG_NAMES, param);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} finally {<NEW_LINE>TcpProxy.putTcpProxy(tcp);<NEW_LINE>}<NEW_LINE>if (names != null) {<NEW_LINE>final List<String> list = new ArrayList<String>();<NEW_LINE>for (Value v : names) {<NEW_LINE>if (TagConstants.NAME_TOTAL.equals(v.toString()))<NEW_LINE>continue;<NEW_LINE>list.<MASK><NEW_LINE>}<NEW_LINE>for (int i = 0; i < list.size(); i++) {<NEW_LINE>TagCount tag = new TagCount();<NEW_LINE>tag.tagName = "";<NEW_LINE>tag.value = list.get(i);<NEW_LINE>nameTree.put(list.get(i), tag);<NEW_LINE>}<NEW_LINE>loadTagValues(tagGroup, list);<NEW_LINE>ExUtil.exec(tagNameTree, new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>treeViewer.refresh();<NEW_LINE>treeViewer.setGrayedElements(nameTree.values().toArray());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | add(v.toString()); |
1,843,276 | public Object decodeResult(ByteBuf data, @Nullable Class<?> targetClass) throws EncodingException {<NEW_LINE>if (data.readableBytes() > 0 && targetClass != null) {<NEW_LINE>try {<NEW_LINE>if (GeneratedMessageV3.class.isAssignableFrom(targetClass)) {<NEW_LINE>Method method = parseFromMethodStore.get(targetClass);<NEW_LINE>if (method != null) {<NEW_LINE>return method.invoke(null, data.nioBuffer());<NEW_LINE>}<NEW_LINE>} else if (ktProtoBuf && KotlinSerializerSupport.isKotlinSerializable(targetClass)) {<NEW_LINE>byte[] bytes = new byte[data.readableBytes()];<NEW_LINE>data.readBytes(bytes);<NEW_LINE>return KotlinSerializerSupport.decodeFromProtobuf(bytes, targetClass);<NEW_LINE>} else {<NEW_LINE>Schema <MASK><NEW_LINE>Object object = schema.newMessage();<NEW_LINE>ProtostuffIOUtil.mergeFrom(new ByteBufInputStream(data), object, schema);<NEW_LINE>return object;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new EncodingException(RsocketErrorCode.message("RST-700501", "bytebuf", targetClass.getName()), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | schema = RuntimeSchema.getSchema(targetClass); |
478,721 | public io.kubernetes.client.proto.V1beta1Extensions.ReplicaSet buildPartial() {<NEW_LINE>io.kubernetes.client.proto.V1beta1Extensions.ReplicaSet result = new io.kubernetes.client.proto.V1beta1Extensions.ReplicaSet(this);<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>if (metadataBuilder_ == null) {<NEW_LINE>result.metadata_ = metadata_;<NEW_LINE>} else {<NEW_LINE>result.metadata_ = metadataBuilder_.build();<NEW_LINE>}<NEW_LINE>if (((from_bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>to_bitField0_ |= 0x00000002;<NEW_LINE>}<NEW_LINE>if (specBuilder_ == null) {<NEW_LINE>result.spec_ = spec_;<NEW_LINE>} else {<NEW_LINE>result.spec_ = specBuilder_.build();<NEW_LINE>}<NEW_LINE>if (((from_bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>to_bitField0_ |= 0x00000004;<NEW_LINE>}<NEW_LINE>if (statusBuilder_ == null) {<NEW_LINE>result.status_ = status_;<NEW_LINE>} else {<NEW_LINE>result<MASK><NEW_LINE>}<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>} | .status_ = statusBuilder_.build(); |
1,171,411 | public int showBits(int bits) {<NEW_LINE>if (bits == 0)<NEW_LINE>return 0;<NEW_LINE>if (len <= 32) {<NEW_LINE>// huffman_spectral_data_2 needs to read more than may be available,<NEW_LINE>// bits maybe > len, deliver 0 than<NEW_LINE>if (len >= bits)<NEW_LINE>return ((bufa >> (len - bits)) & (0xFFFFFFFF >> (32 - bits)));<NEW_LINE>else<NEW_LINE>return ((bufa << (bits - len)) & (0xFFFFFFFF >> (32 - bits)));<NEW_LINE>} else {<NEW_LINE>if ((len - bits) < 32)<NEW_LINE>return ((bufb & (0xFFFFFFFF >> (64 - len))) << (bits - len + 32)) | (bufa >> (len - bits));<NEW_LINE>else<NEW_LINE>return ((bufb >> (len - bits - 32)) & (0xFFFFFFFF ><MASK><NEW_LINE>}<NEW_LINE>} | > (32 - bits))); |
1,717,397 | public Set<String> assignRoleToUsers(String roleName, Set<String> userIds, String operatorUserId) {<NEW_LINE>Role role = findRoleByRoleName(roleName);<NEW_LINE>Preconditions.checkState(role != null, "Role %s doesn't exist!", roleName);<NEW_LINE>List<UserRole> existedUserRoles = userRoleRepository.findByUserIdInAndRoleId(userIds, role.getId());<NEW_LINE>Set<String> existedUserIds = existedUserRoles.stream().map(UserRole::getUserId).collect(Collectors.toSet());<NEW_LINE>Set<String> toAssignUserIds = Sets.difference(userIds, existedUserIds);<NEW_LINE>Iterable<UserRole> toCreate = toAssignUserIds.stream().map(userId -> {<NEW_LINE>UserRole userRole = new UserRole();<NEW_LINE>userRole.<MASK><NEW_LINE>userRole.setUserId(userId);<NEW_LINE>userRole.setDataChangeCreatedBy(operatorUserId);<NEW_LINE>userRole.setDataChangeLastModifiedBy(operatorUserId);<NEW_LINE>return userRole;<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>userRoleRepository.saveAll(toCreate);<NEW_LINE>return toAssignUserIds;<NEW_LINE>} | setRoleId(role.getId()); |
369,549 | public ListContactsFilter unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListContactsFilter listContactsFilter = new ListContactsFilter();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return 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("FilteredStatus", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listContactsFilter.setFilteredStatus(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("TopicFilter", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listContactsFilter.setTopicFilter(TopicFilterJsonUnmarshaller.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 listContactsFilter;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
203,807 | private void updateOutput() {<NEW_LINE>if (separator_.getSelectedIndex() < 0 || quote_.getSelectedIndex() < 0 || decimal_.getSelectedIndex() < 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>updateRequest_.invalidate();<NEW_LINE>final Token invalidationToken = updateRequest_.getInvalidationToken();<NEW_LINE>progress_.onProgress(constants_.updatingPreview());<NEW_LINE>server_.getOutputPreview(dataFile_.getPath(), encoding_.getValue(encoding_.getSelectedIndex()), headingYes_.getValue().booleanValue(), separator_.getValue(separator_.getSelectedIndex()), decimal_.getValue(decimal_.getSelectedIndex()), quote_.getValue(quote_.getSelectedIndex()), comment_.getValue(comment_.getSelectedIndex()), new ServerRequestCallback<DataPreviewResult>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponseReceived(DataPreviewResult response) {<NEW_LINE>if (invalidationToken.isInvalid())<NEW_LINE>return;<NEW_LINE>progress_.onProgress(null);<NEW_LINE>populateOutput(response);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(ServerError error) {<NEW_LINE>if (invalidationToken.isInvalid())<NEW_LINE>return;<NEW_LINE>progress_.onProgress(null);<NEW_LINE>globalDisplay_.showErrorMessage(constants_.errorCapitalized(<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | ), error.getUserMessage()); |
695,709 | public String createAuthenticationRequest(Saml2AuthenticationRequest request) {<NEW_LINE>Saml2MessageBinding binding = this.protocolBindingResolver.convert(null);<NEW_LINE>RelyingPartyRegistration registration = RelyingPartyRegistration.withRegistrationId("noId").assertionConsumerServiceBinding(binding).assertionConsumerServiceLocation(request.getAssertionConsumerServiceUrl()).entityId(request.getIssuer()).remoteIdpEntityId("noIssuer").idpWebSsoUrl("noUrl").credentials((credentials) -> credentials.addAll(request.getCredentials<MASK><NEW_LINE>Saml2AuthenticationRequestContext context = Saml2AuthenticationRequestContext.builder().relyingPartyRegistration(registration).issuer(request.getIssuer()).assertionConsumerServiceUrl(request.getAssertionConsumerServiceUrl()).build();<NEW_LINE>AuthnRequest authnRequest = this.authenticationRequestContextConverter.convert(context);<NEW_LINE>return OpenSamlSigningUtils.serialize(OpenSamlSigningUtils.sign(authnRequest, registration));<NEW_LINE>} | ())).build(); |
1,851,700 | public void onRemoveWatchRequestReceived(RemoveWatchManagementRequest request) {<NEW_LINE>File rootFolder = request.getWatch();<NEW_LINE>if (!watchOperations.containsKey(rootFolder)) {<NEW_LINE>eventBus.post(new RemoveWatchManagementResponse(RemoveWatchManagementResponse.ERR_DOES_NOT_EXIST, request.getId(), "Watch does not exist."));<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>boolean folderRemoved = DaemonConfigHelper.removeFolder(rootFolder);<NEW_LINE>if (folderRemoved) {<NEW_LINE>eventBus.post(new RemoveWatchManagementResponse(RemoveWatchManagementResponse.OKAY, request.getId(), "Successfully removed."));<NEW_LINE>} else {<NEW_LINE>eventBus.post(new RemoveWatchManagementResponse(RemoveWatchManagementResponse.ERR_DOES_NOT_EXIST, request.getId(), "Watch does not exist (inactive/disabled)."));<NEW_LINE>}<NEW_LINE>} catch (ConfigException e) {<NEW_LINE>logger.log(<MASK><NEW_LINE>eventBus.post(new RemoveWatchManagementResponse(RemoveWatchManagementResponse.ERR_OTHER, request.getId(), "Error removing to config: " + e.getMessage()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Level.WARNING, "Error removing watch from daemon config.", e); |
33,736 | private static void updatePointersFromRegion(int regionIndex) {<NEW_LINE>int regionOffset = Structure.add(Region.class, regionsAddress(), regionIndex).start - 1;<NEW_LINE>if (regionOffset < 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int regionSize = regionSize();<NEW_LINE>Address regionStart = heapAddress().add(regionIndex * regionSize);<NEW_LINE>Address regionEnd = regionStart.add(regionSize);<NEW_LINE>FreeChunk object = regionStart.add(regionOffset).toStructure();<NEW_LINE>Address heapLimit = heapAddress().add(availableBytes());<NEW_LINE>if (heapLimit.isLessThan(regionEnd)) {<NEW_LINE>regionEnd = heapLimit;<NEW_LINE>}<NEW_LINE>while (object.toAddress().isLessThan(regionEnd)) {<NEW_LINE>int classRef = object.classReference;<NEW_LINE>int size;<NEW_LINE>if (classRef != 0) {<NEW_LINE>Relocation relocation = <MASK><NEW_LINE>if (relocation != null) {<NEW_LINE>classRef = relocation.classBackup;<NEW_LINE>}<NEW_LINE>RuntimeClass cls = RuntimeClass.unpack(classRef);<NEW_LINE>updatePointers(cls, object.toAddress().toStructure());<NEW_LINE>size = objectSize(object.toAddress().toStructure(), cls);<NEW_LINE>} else {<NEW_LINE>size = object.size;<NEW_LINE>}<NEW_LINE>object = object.toAddress().add(size).toStructure();<NEW_LINE>}<NEW_LINE>} | getRelocation(object.toAddress()); |
1,357,259 | private Token<XMLTokenId> initialize(TokenSequence ts, int offset) {<NEW_LINE>int diff = ts.move(offset);<NEW_LINE>Token<XMLTokenId> token = ts.token();<NEW_LINE>if (diff > 0) {<NEW_LINE>if (!ts.moveNext()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} else if (!ts.movePrevious()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>token = ts.token();<NEW_LINE>XMLTokenId id = token.id();<NEW_LINE>while (token.id() == XMLTokenId.CHARACTER) {<NEW_LINE>if (!ts.movePrevious()) {<NEW_LINE>return token;<NEW_LINE>}<NEW_LINE>token = ts.token();<NEW_LINE>id = token.id();<NEW_LINE>}<NEW_LINE>String image = token<MASK><NEW_LINE>if (id == XMLTokenId.WS || id == XMLTokenId.ARGUMENT || id == XMLTokenId.OPERATOR || id == XMLTokenId.VALUE || (id == XMLTokenId.TAG && (">".equals(image) || "/>".equals(image)))) {<NEW_LINE>// NOI18N<NEW_LINE>while (ts.movePrevious()) {<NEW_LINE>token = ts.token();<NEW_LINE>id = token.id();<NEW_LINE>if (id == XMLTokenId.TAG || id == XMLTokenId.PI_START || id == XMLTokenId.DECLARATION)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// while<NEW_LINE>}<NEW_LINE>// if<NEW_LINE>return token;<NEW_LINE>} | .text().toString(); |
791,322 | public void testAsyncRetryAroundBulkhead() throws Exception {<NEW_LINE>// This test uses sleeps because FT 1.x blocks while retrying around a bulkhead exception<NEW_LINE>// which means we can't easily complete one of running tasks while the retry for<NEW_LINE>// the last task is taking place.<NEW_LINE>// First two tasks should run<NEW_LINE>Future<Void> future1 = bean1.runTaskWithSlowRetries(this::sleep);<NEW_LINE><MASK><NEW_LINE>Future<Void> future2 = bean1.runTaskWithSlowRetries(this::sleep);<NEW_LINE>Thread.sleep(TestConstants.TEST_TWEAK_TIME_UNIT);<NEW_LINE>// Second two tasks should queue<NEW_LINE>Future<Void> future3 = bean1.runTaskWithSlowRetries(this::sleep);<NEW_LINE>Thread.sleep(TestConstants.TEST_TWEAK_TIME_UNIT);<NEW_LINE>Future<Void> future4 = bean1.runTaskWithSlowRetries(this::sleep);<NEW_LINE>Thread.sleep(TestConstants.TEST_TWEAK_TIME_UNIT);<NEW_LINE>// Fifth task should be rejected by the bulkhead but retry until it can run<NEW_LINE>Future<Void> future5 = bean1.runTaskWithSlowRetries(this::sleep);<NEW_LINE>assertFutureHasResult(future1, null);<NEW_LINE>assertFutureHasResult(future2, null);<NEW_LINE>assertFutureHasResult(future3, null);<NEW_LINE>assertFutureHasResult(future4, null);<NEW_LINE>assertFutureHasResult(future5, null);<NEW_LINE>} | Thread.sleep(TestConstants.TEST_TWEAK_TIME_UNIT); |
1,044,558 | private SchemaPath handleItemOperator(RexCall call, SqlSyntax syntax) {<NEW_LINE>SchemaPath left = (SchemaPath) call.getOperands().get(0).accept(this);<NEW_LINE>RelDataType dataType = call.getOperands().get(0).getType();<NEW_LINE>boolean isMap = dataType.getSqlTypeName() == SqlTypeName.MAP;<NEW_LINE>// Convert expr of item[*, 'abc'] into column expression 'abc'<NEW_LINE>String rootSegName = left.getRootSegment().getPath();<NEW_LINE>if (StarColumnHelper.isStarColumn(rootSegName)) {<NEW_LINE>rootSegName = rootSegName.substring(0, rootSegName.indexOf(SchemaPath.DYNAMIC_STAR));<NEW_LINE>final RexLiteral literal = (RexLiteral) call.getOperands().get(1);<NEW_LINE>return SchemaPath.getSimplePath(rootSegName + literal.getValue2().toString());<NEW_LINE>}<NEW_LINE>final RexLiteral literal;<NEW_LINE>RexNode operand = call.getOperands().get(1);<NEW_LINE>if (operand instanceof RexLiteral) {<NEW_LINE>literal = (RexLiteral) operand;<NEW_LINE>} else if (isMap && operand.getKind() == SqlKind.CAST) {<NEW_LINE>SqlTypeName castType = operand.getType().getSqlTypeName();<NEW_LINE>SqlTypeName keyType = dataType.getKeyType().getSqlTypeName();<NEW_LINE>Preconditions.checkArgument(castType == keyType, String.format("Wrong type CAST: expected '%s' but found '%s'", keyType.getName(), castType.getName()));<NEW_LINE>literal = (RexLiteral) ((RexCall) operand).operands.get(0);<NEW_LINE>} else {<NEW_LINE>throw notImplementedException(syntax, call);<NEW_LINE>}<NEW_LINE>switch(literal.getTypeName()) {<NEW_LINE>case DECIMAL:<NEW_LINE>case INTEGER:<NEW_LINE>if (isMap) {<NEW_LINE>return handleMapNumericKey(literal, operand, dataType, left);<NEW_LINE>}<NEW_LINE>return left.getChild(((BigDecimal) literal.getValue()).intValue());<NEW_LINE>case CHAR:<NEW_LINE>if (isMap) {<NEW_LINE>return handleMapCharKey(literal, operand, dataType, left);<NEW_LINE>}<NEW_LINE>return left.getChild(literal.getValue2().toString());<NEW_LINE>case BOOLEAN:<NEW_LINE>if (isMap) {<NEW_LINE>BasicSqlType sqlType = (BasicSqlType) operand.getType();<NEW_LINE>TypeProtos.DataMode mode = sqlType.isNullable() ? TypeProtos.DataMode<MASK><NEW_LINE>return left.getChild(literal.getValue().toString(), literal.getValue(), Types.withMode(MinorType.BIT, mode));<NEW_LINE>}<NEW_LINE>// fall through<NEW_LINE>default:<NEW_LINE>throw notImplementedException(syntax, call);<NEW_LINE>}<NEW_LINE>} | .OPTIONAL : TypeProtos.DataMode.REQUIRED; |
1,662,689 | public static String buildClientWhere(final String tableName, final String tableAlias, @NonNull final Access access, @NonNull final Set<ClientId> adClientIds) {<NEW_LINE>final HashSet<ClientId> adClientIdsEffective = new HashSet<>(adClientIds);<NEW_LINE>if (access.isReadOnly()) {<NEW_LINE>adClientIdsEffective.add(ClientId.SYSTEM);<NEW_LINE>}<NEW_LINE>final String tablePrefix = tableAlias != null ? tableAlias + "." : "";<NEW_LINE>if (adClientIdsEffective.isEmpty()) {<NEW_LINE>return "/* no Org Access records */ " + tablePrefix + "AD_Client_ID=-1";<NEW_LINE>}<NEW_LINE>final StringBuilder whereClause = new StringBuilder();<NEW_LINE>whereClause.append(DB.buildSqlList(tablePrefix + "AD_Client_ID", adClientIdsEffective, /* paramsOut */<NEW_LINE>null));<NEW_LINE>if (access.isReadWrite() && "AD_Org".equals(tableName)) {<NEW_LINE>whereClause.append(" OR (").append(tablePrefix).append("AD_Client_ID=").append(ClientId.SYSTEM.getRepoId()).append(" AND ").append(tablePrefix).append("AD_Org_ID=").append(OrgId.ANY.getRepoId<MASK><NEW_LINE>whereClause.insert(0, "(").append(")");<NEW_LINE>}<NEW_LINE>return whereClause.toString();<NEW_LINE>} | ()).append(")"); |
1,283,281 | public void apply(Request request, Response response) {<NEW_LINE>response.status = status;<NEW_LINE>String format = request.format;<NEW_LINE>if (request.isAjax() && "html".equals(format)) {<NEW_LINE>format = "txt";<NEW_LINE>}<NEW_LINE>response.contentType = MimeTypes.getContentType("xx." + format);<NEW_LINE>Map<String, Object> binding = Scope<MASK><NEW_LINE>binding.put("exception", this);<NEW_LINE>binding.put("result", this);<NEW_LINE>binding.put("session", Scope.Session.current());<NEW_LINE>binding.put("request", Http.Request.current());<NEW_LINE>binding.put("flash", Scope.Flash.current());<NEW_LINE>binding.put("params", Scope.Params.current());<NEW_LINE>binding.put("play", new Play());<NEW_LINE>String errorHtml = getMessage();<NEW_LINE>try {<NEW_LINE>errorHtml = TemplateLoader.load("errors/" + this.status + "." + (format == null ? "html" : format)).render(binding);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// no template in desired format, just display the default response<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>response.out.write(errorHtml.getBytes(getEncoding()));<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new UnexpectedException(e);<NEW_LINE>}<NEW_LINE>} | .RenderArgs.current().data; |
328,560 | public Object visit(Object context1, ForVarDeclOfStatement statement, boolean strict) {<NEW_LINE>ExecutionContext context = (ExecutionContext) context1;<NEW_LINE>String varName = (String) statement.getDeclaration().accept(context, this, strict);<NEW_LINE>Object exprRef = statement.getRhs().<MASK><NEW_LINE>Object exprValue = getValue(context, exprRef);<NEW_LINE>if (exprValue == Types.NULL || exprValue == Types.UNDEFINED) {<NEW_LINE>return (Completion.createNormal());<NEW_LINE>}<NEW_LINE>JSObject obj = Types.toObject(context, exprValue);<NEW_LINE>Object v = null;<NEW_LINE>List<String> names = obj.getAllEnumerablePropertyNames().toList();<NEW_LINE>for (String each : names) {<NEW_LINE>Reference varRef = context.resolve(varName);<NEW_LINE>Reference propertyRef = context.createPropertyReference(obj, each);<NEW_LINE>varRef.putValue(context, propertyRef.getValue(context));<NEW_LINE>Completion completion = (Completion) statement.getBlock().accept(context, this, strict);<NEW_LINE>// Completion completion = invokeCompiledBlockStatement(context, "ForVarDeclsOf", statement.getBlock());<NEW_LINE>if (completion.value != null) {<NEW_LINE>v = completion.value;<NEW_LINE>}<NEW_LINE>if (completion.type == Completion.Type.BREAK) {<NEW_LINE>if (completion.target == null || statement.getLabels().contains(completion.target)) {<NEW_LINE>return (Completion.createNormal(v));<NEW_LINE>} else {<NEW_LINE>return (completion);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (completion.type == Completion.Type.RETURN || completion.type == Completion.Type.BREAK) {<NEW_LINE>return (completion);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (Completion.createNormal(v));<NEW_LINE>} | accept(context, this, strict); |
1,562,941 | void displayResults(NodeResults nodeResults) {<NEW_LINE>Document document = Jsoup.parse(EMPTY_HTML);<NEW_LINE>Element body = document.getElementsByTag("body").first();<NEW_LINE>Optional<Element> panelHeader = appendPanelHeader(body, nodeResults.getItemName(), nodeResults.getAggregateScore());<NEW_LINE>// for each analysis result item, display the data.<NEW_LINE>List<ResultDisplayAttributes> displayAttributes = nodeResults.getAnalysisResults();<NEW_LINE>for (int idx = 0; idx < displayAttributes.size(); idx++) {<NEW_LINE>AnalysisResultsViewModel.ResultDisplayAttributes resultAttrs = displayAttributes.get(idx);<NEW_LINE>Element sectionDiv = <MASK><NEW_LINE>if (idx > 0 || panelHeader.isPresent()) {<NEW_LINE>sectionDiv.attr("class", ContentViewerHtmlStyles.getSpacedSectionClassName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// set the body html<NEW_LINE>ContentViewerHtmlStyles.setStyles(textPanel);<NEW_LINE>textPanel.setText(document.html());<NEW_LINE>// if there is a selected result scroll to it<NEW_LINE>Optional<AnalysisResult> selectedResult = nodeResults.getSelectedResult();<NEW_LINE>if (selectedResult.isPresent()) {<NEW_LINE>textPanel.scrollToReference(getAnchor(selectedResult.get()));<NEW_LINE>} else {<NEW_LINE>// otherwise, scroll to the beginning.<NEW_LINE>textPanel.setCaretPosition(0);<NEW_LINE>}<NEW_LINE>} | appendResult(body, idx, resultAttrs); |
424,661 | public Restlet createInboundRoot() {<NEW_LINE>// Create a root router<NEW_LINE>Router router = new Router(getContext());<NEW_LINE>// Create a Redirector to Google search service<NEW_LINE>String target = "http://www.google.com/search?q=site:mysite.org+{keywords}";<NEW_LINE>Redirector redirector = new Redirector(getContext(), target, Redirector.MODE_CLIENT_TEMPORARY);<NEW_LINE>// While routing requests to the redirector, extract the "kwd" query<NEW_LINE>// parameter. For instance :<NEW_LINE>// http://localhost:8111/search?kwd=myKeyword1+myKeyword2<NEW_LINE>// will be routed to<NEW_LINE>// http://www.google.com/search?q=site:mysite.org+myKeyword1%20myKeyword2<NEW_LINE>Extractor extractor = new Extractor(getContext(), redirector);<NEW_LINE>extractor.<MASK><NEW_LINE>// Attach the extractor to the router<NEW_LINE>router.attach("/search", extractor);<NEW_LINE>// Return the root router<NEW_LINE>return router;<NEW_LINE>} | extractFromQuery("keywords", "kwd", true); |
417,565 | public ParsingResult<V> run(InputBuffer inputBuffer) {<NEW_LINE>checkArgNotNull(inputBuffer, "inputBuffer");<NEW_LINE>resetValueStack();<NEW_LINE>totalRuns++;<NEW_LINE>MatcherContext<V> rootContext = <MASK><NEW_LINE>rootContext.getMatcher().accept(new DoWithMatcherVisitor(new DoWithMatcherVisitor.Action() {<NEW_LINE><NEW_LINE>public void process(Matcher matcher) {<NEW_LINE>RuleStats ruleStats = (RuleStats) matcher.getTag();<NEW_LINE>if (ruleStats == null) {<NEW_LINE>ruleStats = new RuleStats();<NEW_LINE>matcher.setTag(ruleStats);<NEW_LINE>} else {<NEW_LINE>ruleStats.clear();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>runMatches = 0;<NEW_LINE>long timeStamp = System.nanoTime() - timeCorrection;<NEW_LINE>boolean matched = rootContext.runMatcher();<NEW_LINE>totalNanoTime += System.nanoTime() - timeCorrection - timeStamp;<NEW_LINE>getRootMatcher().accept(new DoWithMatcherVisitor(updateStatsAction));<NEW_LINE>return createParsingResult(matched, rootContext);<NEW_LINE>} | createRootContext(inputBuffer, this, true); |
1,372,462 | private void drawSelectedPoint(Canvas canvas, RotatedTileBox tileBox) {<NEW_LINE>if (selectedImageLocation != null) {<NEW_LINE>canvas.rotate(-tileBox.getRotate(), tileBox.getCenterPixelX(), tileBox.getCenterPixelY());<NEW_LINE>float x = tileBox.getPixXFromLatLon(selectedImageLocation.getLatitude(), selectedImageLocation.getLongitude());<NEW_LINE>float y = tileBox.getPixYFromLatLon(selectedImageLocation.getLatitude(<MASK><NEW_LINE>if (selectedImageCameraAngle != null) {<NEW_LINE>canvas.save();<NEW_LINE>canvas.rotate(selectedImageCameraAngle - 180, x, y);<NEW_LINE>canvas.drawBitmap(headingImage, x - headingImage.getWidth() / 2, y - headingImage.getHeight() / 2, paintIcon);<NEW_LINE>canvas.restore();<NEW_LINE>}<NEW_LINE>canvas.drawBitmap(selectedImage, x - selectedImage.getWidth() / 2, y - selectedImage.getHeight() / 2, paintIcon);<NEW_LINE>canvas.rotate(tileBox.getRotate(), tileBox.getCenterPixelX(), tileBox.getCenterPixelY());<NEW_LINE>}<NEW_LINE>} | ), selectedImageLocation.getLongitude()); |
1,195,440 | public static void vertical9(Kernel1D_S32 kernel, GrayU8 src, GrayI8 dst, int divisor, @Nullable GrowArray<DogArray_I32> workspaces) {<NEW_LINE>final byte[] dataSrc = src.data;<NEW_LINE>final <MASK><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] & 0xFF) * k1;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k2;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k3;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k4;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k5;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k6;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k7;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k8;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k9;<NEW_LINE>dataDst[indexDst++] = (byte) ((total + halfDivisor) / divisor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} | byte[] dataDst = dst.data; |
1,041,366 | private void init() {<NEW_LINE>handler.postDelayed(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>if (context instanceof Activity) {<NEW_LINE>windowManager = (WindowManager) context.getSystemService(WINDOW_SERVICE);<NEW_LINE>view = LayoutInflater.from(context).inflate(layoutId, null, true);<NEW_LINE>// Don't let it grab the input focus if focusable is false<NEW_LINE>int flags = focusable ? 0 : WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;<NEW_LINE>WindowManager.LayoutParams layoutParams = new // Shrink the window to wrap the content rather than filling the screen<NEW_LINE>WindowManager.LayoutParams(// Make the underlying application window visible through any transparent parts<NEW_LINE>WindowManager.LayoutParams.MATCH_PARENT, // Make the underlying application window visible through any transparent parts<NEW_LINE>WindowManager.LayoutParams.MATCH_PARENT, // Make the underlying application window visible through any transparent parts<NEW_LINE>WindowManager.LayoutParams.TYPE_APPLICATION_PANEL, // Make the underlying application window visible through any transparent parts<NEW_LINE>flags, PixelFormat.TRANSLUCENT);<NEW_LINE>if ((layoutParams.softInputMode & WindowManager.LayoutParams.SOFT_INPUT_IS_FORWARD_NAVIGATION) == 0) {<NEW_LINE>WindowManager.LayoutParams nl = new WindowManager.LayoutParams();<NEW_LINE>nl.copyFrom(layoutParams);<NEW_LINE>nl.softInputMode |= WindowManager.LayoutParams.SOFT_INPUT_IS_FORWARD_NAVIGATION;<NEW_LINE>layoutParams = nl;<NEW_LINE>}<NEW_LINE>windowManager.addView(view, layoutParams);<NEW_LINE>view.findViewById(R.id.bottom_sheet_background).setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View view) {<NEW_LINE>hide();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>view.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onPreDraw() {<NEW_LINE>view.<MASK><NEW_LINE>if (listener != null) {<NEW_LINE>listener.onLoaded(view);<NEW_LINE>}<NEW_LINE>animateBottomSheet();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, 100);<NEW_LINE>} | getViewTreeObserver().removeOnPreDrawListener(this); |
857,419 | public static DescribeApplicationScalingRulesResponse unmarshall(DescribeApplicationScalingRulesResponse describeApplicationScalingRulesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeApplicationScalingRulesResponse.setRequestId(_ctx.stringValue("DescribeApplicationScalingRulesResponse.RequestId"));<NEW_LINE>describeApplicationScalingRulesResponse.setCode(_ctx.integerValue("DescribeApplicationScalingRulesResponse.Code"));<NEW_LINE>describeApplicationScalingRulesResponse.setMessage(_ctx.stringValue("DescribeApplicationScalingRulesResponse.Message"));<NEW_LINE>AppScalingRules appScalingRules = new AppScalingRules();<NEW_LINE>appScalingRules.setCurrentPage(_ctx.integerValue("DescribeApplicationScalingRulesResponse.AppScalingRules.CurrentPage"));<NEW_LINE>appScalingRules.setPageSize(_ctx.integerValue("DescribeApplicationScalingRulesResponse.AppScalingRules.PageSize"));<NEW_LINE>appScalingRules.setTotalSize(_ctx.longValue("DescribeApplicationScalingRulesResponse.AppScalingRules.TotalSize"));<NEW_LINE>List<Rule> result = new ArrayList<Rule>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeApplicationScalingRulesResponse.AppScalingRules.Result.Length"); i++) {<NEW_LINE>Rule rule = new Rule();<NEW_LINE>rule.setAppId(_ctx.stringValue("DescribeApplicationScalingRulesResponse.AppScalingRules.Result[" + i + "].AppId"));<NEW_LINE>rule.setScaleRuleName(_ctx.stringValue("DescribeApplicationScalingRulesResponse.AppScalingRules.Result[" + i + "].ScaleRuleName"));<NEW_LINE>rule.setScaleRuleType(_ctx.stringValue("DescribeApplicationScalingRulesResponse.AppScalingRules.Result[" + i + "].ScaleRuleType"));<NEW_LINE>rule.setScaleRuleEnabled(_ctx.booleanValue("DescribeApplicationScalingRulesResponse.AppScalingRules.Result[" + i + "].ScaleRuleEnabled"));<NEW_LINE>rule.setMinReplicas(_ctx.integerValue("DescribeApplicationScalingRulesResponse.AppScalingRules.Result[" + i + "].MinReplicas"));<NEW_LINE>rule.setMaxReplicas(_ctx.integerValue("DescribeApplicationScalingRulesResponse.AppScalingRules.Result[" + i + "].MaxReplicas"));<NEW_LINE>rule.setCreateTime(_ctx.longValue("DescribeApplicationScalingRulesResponse.AppScalingRules.Result[" + i + "].CreateTime"));<NEW_LINE>rule.setUpdateTime(_ctx.longValue("DescribeApplicationScalingRulesResponse.AppScalingRules.Result[" + i + "].UpdateTime"));<NEW_LINE>rule.setLastDisableTime(_ctx.longValue("DescribeApplicationScalingRulesResponse.AppScalingRules.Result[" + i + "].LastDisableTime"));<NEW_LINE>Metric metric = new Metric();<NEW_LINE>metric.setMaxReplicas(_ctx.integerValue("DescribeApplicationScalingRulesResponse.AppScalingRules.Result[" + i + "].Metric.MaxReplicas"));<NEW_LINE>metric.setMinReplicas(_ctx.integerValue("DescribeApplicationScalingRulesResponse.AppScalingRules.Result[" + i + "].Metric.MinReplicas"));<NEW_LINE>List<Metric1> metrics = new ArrayList<Metric1>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeApplicationScalingRulesResponse.AppScalingRules.Result[" + i + "].Metric.Metrics.Length"); j++) {<NEW_LINE>Metric1 metric1 = new Metric1();<NEW_LINE>metric1.setMetricType(_ctx.stringValue("DescribeApplicationScalingRulesResponse.AppScalingRules.Result[" + i + "].Metric.Metrics[" + j + "].MetricType"));<NEW_LINE>metric1.setMetricTargetAverageUtilization(_ctx.integerValue("DescribeApplicationScalingRulesResponse.AppScalingRules.Result[" + i + "].Metric.Metrics[" + j + "].MetricTargetAverageUtilization"));<NEW_LINE>metrics.add(metric1);<NEW_LINE>}<NEW_LINE>metric.setMetrics(metrics);<NEW_LINE>rule.setMetric(metric);<NEW_LINE>Trigger trigger = new Trigger();<NEW_LINE>trigger.setMaxReplicas(_ctx.integerValue("DescribeApplicationScalingRulesResponse.AppScalingRules.Result[" + i + "].Trigger.MaxReplicas"));<NEW_LINE>trigger.setMinReplicas(_ctx.integerValue("DescribeApplicationScalingRulesResponse.AppScalingRules.Result[" + i + "].Trigger.MinReplicas"));<NEW_LINE>List<Trigger2> triggers = new ArrayList<Trigger2>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeApplicationScalingRulesResponse.AppScalingRules.Result[" + i + "].Trigger.Triggers.Length"); j++) {<NEW_LINE>Trigger2 trigger2 = new Trigger2();<NEW_LINE>trigger2.setType(_ctx.stringValue("DescribeApplicationScalingRulesResponse.AppScalingRules.Result[" + i <MASK><NEW_LINE>trigger2.setName(_ctx.stringValue("DescribeApplicationScalingRulesResponse.AppScalingRules.Result[" + i + "].Trigger.Triggers[" + j + "].Name"));<NEW_LINE>trigger2.setMetaData(_ctx.stringValue("DescribeApplicationScalingRulesResponse.AppScalingRules.Result[" + i + "].Trigger.Triggers[" + j + "].MetaData"));<NEW_LINE>triggers.add(trigger2);<NEW_LINE>}<NEW_LINE>trigger.setTriggers(triggers);<NEW_LINE>rule.setTrigger(trigger);<NEW_LINE>result.add(rule);<NEW_LINE>}<NEW_LINE>appScalingRules.setResult(result);<NEW_LINE>describeApplicationScalingRulesResponse.setAppScalingRules(appScalingRules);<NEW_LINE>return describeApplicationScalingRulesResponse;<NEW_LINE>} | + "].Trigger.Triggers[" + j + "].Type")); |
1,413,940 | public static <T> T parseObject(String str, Type objectType, Feature... features) {<NEW_LINE>if (str == null || str.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>boolean useNativeJavaObject = false;<NEW_LINE>for (Feature feature : features) {<NEW_LINE>if (feature == Feature.UseNativeJavaObject) {<NEW_LINE>useNativeJavaObject = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>JSONReader jsonReader = JSONReader.of(str);<NEW_LINE>JSONReader.<MASK><NEW_LINE>if (!useNativeJavaObject) {<NEW_LINE>context.setArraySupplier(arraySupplier);<NEW_LINE>context.setObjectSupplier(defaultSupplier);<NEW_LINE>}<NEW_LINE>String defaultDateFormat = JSON.DEFFAULT_DATE_FORMAT;<NEW_LINE>if (!"yyyy-MM-dd HH:mm:ss".equals(defaultDateFormat)) {<NEW_LINE>context.setDateFormat(defaultDateFormat);<NEW_LINE>}<NEW_LINE>config(context, features);<NEW_LINE>try {<NEW_LINE>ObjectReader<T> objectReader = jsonReader.getObjectReader(objectType);<NEW_LINE>T object = objectReader.readObject(jsonReader, null, null, 0);<NEW_LINE>if (object != null) {<NEW_LINE>jsonReader.handleResolveTasks(object);<NEW_LINE>}<NEW_LINE>return object;<NEW_LINE>} catch (com.alibaba.fastjson2.JSONException e) {<NEW_LINE>Throwable cause = e.getCause();<NEW_LINE>if (cause == null) {<NEW_LINE>cause = e;<NEW_LINE>}<NEW_LINE>throw new JSONException(e.getMessage(), cause);<NEW_LINE>}<NEW_LINE>} | Context context = jsonReader.getContext(); |
339,340 | private boolean writeDictionaryRowGroup(Block dictionary, int valueCount, IntBigArray dictionaryIndexes, int maxDirectBytes) {<NEW_LINE>int[][] segments = dictionaryIndexes.getSegments();<NEW_LINE>for (int i = 0; valueCount > 0 && i < segments.length; i++) {<NEW_LINE>int[] segment = segments[i];<NEW_LINE>int positionCount = Math.min(valueCount, segment.length);<NEW_LINE>Block block = new DictionaryBlock(positionCount, dictionary, segment);<NEW_LINE>while (block != null) {<NEW_LINE>int chunkPositionCount = block.getPositionCount();<NEW_LINE>Block chunk = block.getRegion(0, chunkPositionCount);<NEW_LINE>// avoid chunk with huge logical size<NEW_LINE>while (chunkPositionCount > 1 && chunk.getLogicalSizeInBytes() > DIRECT_CONVERSION_CHUNK_MAX_LOGICAL_BYTES) {<NEW_LINE>chunkPositionCount /= 2;<NEW_LINE>chunk = chunk.getRegion(0, chunkPositionCount);<NEW_LINE>}<NEW_LINE>directColumnWriter.writeBlock(chunk);<NEW_LINE>if (directColumnWriter.getBufferedBytes() > maxDirectBytes) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// slice block to only unconverted rows<NEW_LINE>if (chunkPositionCount < block.getPositionCount()) {<NEW_LINE>block = block.getRegion(chunkPositionCount, <MASK><NEW_LINE>} else {<NEW_LINE>block = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>valueCount -= positionCount;<NEW_LINE>}<NEW_LINE>checkState(valueCount == 0);<NEW_LINE>return true;<NEW_LINE>} | block.getPositionCount() - chunkPositionCount); |
1,047,084 | public <T> Boolean notStartsWith(BoundReference<T> ref, Literal<T> lit) {<NEW_LINE><MASK><NEW_LINE>if (mayContainNull(id)) {<NEW_LINE>return ROWS_MIGHT_MATCH;<NEW_LINE>}<NEW_LINE>ByteBuffer prefixAsBytes = lit.toByteBuffer();<NEW_LINE>Comparator<ByteBuffer> comparator = Comparators.unsignedBytes();<NEW_LINE>// notStartsWith will match unless all values must start with the prefix. This happens when the lower and upper<NEW_LINE>// bounds both start with the prefix.<NEW_LINE>if (lowerBounds != null && upperBounds != null && lowerBounds.containsKey(id) && upperBounds.containsKey(id)) {<NEW_LINE>ByteBuffer lower = lowerBounds.get(id);<NEW_LINE>// if lower is shorter than the prefix then lower doesn't start with the prefix<NEW_LINE>if (lower.remaining() < prefixAsBytes.remaining()) {<NEW_LINE>return ROWS_MIGHT_MATCH;<NEW_LINE>}<NEW_LINE>int cmp = comparator.compare(BinaryUtil.truncateBinary(lower, prefixAsBytes.remaining()), prefixAsBytes);<NEW_LINE>if (cmp == 0) {<NEW_LINE>ByteBuffer upper = upperBounds.get(id);<NEW_LINE>// if upper is shorter than the prefix then upper can't start with the prefix<NEW_LINE>if (upper.remaining() < prefixAsBytes.remaining()) {<NEW_LINE>return ROWS_MIGHT_MATCH;<NEW_LINE>}<NEW_LINE>cmp = comparator.compare(BinaryUtil.truncateBinary(upper, prefixAsBytes.remaining()), prefixAsBytes);<NEW_LINE>if (cmp == 0) {<NEW_LINE>// both bounds match the prefix, so all rows must match the prefix and therefore do not satisfy<NEW_LINE>// the predicate<NEW_LINE>return ROWS_CANNOT_MATCH;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ROWS_MIGHT_MATCH;<NEW_LINE>} | Integer id = ref.fieldId(); |
1,575,328 | public List<PostgresTable> findTable(String schemaName, String[] tableName) throws SQLException {<NEW_LINE>List<<MASK><NEW_LINE>if (tableList.isEmpty()) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>if (StringUtils.isBlank(schemaName)) {<NEW_LINE>schemaName = getCurrentSchema();<NEW_LINE>if (StringUtils.isBlank(schemaName)) {<NEW_LINE>throw new SQLException("no schema is specified and the current schema is not set");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>String queryString = TABLE + " where table_schema = ? and table_name in " + buildWhereIn(tableList);<NEW_LINE>List<String> queryArgs = new ArrayList<>();<NEW_LINE>queryArgs.add(schemaName);<NEW_LINE>queryArgs.addAll(tableList);<NEW_LINE>//<NEW_LINE>try (Connection conn = this.connectSupplier.eGet()) {<NEW_LINE>List<Map<String, Object>> mapList = new JdbcTemplate(conn).queryForList(queryString, queryArgs.toArray());<NEW_LINE>if (mapList == null) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>return mapList.stream().map(this::convertTable).collect(Collectors.toList());<NEW_LINE>}<NEW_LINE>} | String> tableList = stringArray2List(tableName); |
376,924 | public void visitPhpTernaryExpression(@NotNull TernaryExpression expression) {<NEW_LINE>final PsiElement rawCondition = expression.getCondition();<NEW_LINE>if (rawCondition != null) {<NEW_LINE>final PsiElement <MASK><NEW_LINE>if (condition instanceof BinaryExpression) {<NEW_LINE>final PsiElement trueVariant = ExpressionSemanticUtil.getExpressionTroughParenthesis(expression.getTrueVariant());<NEW_LINE>if (trueVariant != null) {<NEW_LINE>final PsiElement falseVariant = ExpressionSemanticUtil.getExpressionTroughParenthesis(expression.getFalseVariant());<NEW_LINE>if (falseVariant != null) {<NEW_LINE>final boolean isTarget = PhpLanguageUtil.isBoolean(trueVariant) && PhpLanguageUtil.isBoolean(falseVariant);<NEW_LINE>if (isTarget) {<NEW_LINE>final String replacement = this.generateReplacement((BinaryExpression) condition, trueVariant);<NEW_LINE>if (replacement != null) {<NEW_LINE>holder.registerProblem(expression, MessagesPresentationUtil.prefixWithEa(String.format(messagePattern, replacement)), new SimplifyFix(replacement));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | condition = ExpressionSemanticUtil.getExpressionTroughParenthesis(rawCondition); |
1,738,960 | public ECPoint twicePlus(ECPoint b) {<NEW_LINE>if (this.isInfinity()) {<NEW_LINE>return b;<NEW_LINE>}<NEW_LINE>if (b.isInfinity()) {<NEW_LINE>return twice();<NEW_LINE>}<NEW_LINE>ECCurve curve = this.getCurve();<NEW_LINE>ECFieldElement X1 = this.x;<NEW_LINE>if (X1.isZero()) {<NEW_LINE>// A point with X == 0 is its own additive inverse<NEW_LINE>return b;<NEW_LINE>}<NEW_LINE>// NOTE: twicePlus() only optimized for lambda-affine argument<NEW_LINE>ECFieldElement X2 = b.getRawXCoord(), Z2 = b.getZCoord(0);<NEW_LINE>if (X2.isZero() || !Z2.isOne()) {<NEW_LINE>return twice().add(b);<NEW_LINE>}<NEW_LINE>ECFieldElement L1 = this.y, Z1 = this.zs[0];<NEW_LINE><MASK><NEW_LINE>ECFieldElement X1Sq = X1.square();<NEW_LINE>ECFieldElement L1Sq = L1.square();<NEW_LINE>ECFieldElement Z1Sq = Z1.square();<NEW_LINE>ECFieldElement L1Z1 = L1.multiply(Z1);<NEW_LINE>ECFieldElement T = L1Sq.add(L1Z1);<NEW_LINE>ECFieldElement L2plus1 = L2.addOne();<NEW_LINE>ECFieldElement A = L2plus1.multiply(Z1Sq).add(L1Sq).multiplyPlusProduct(T, X1Sq, Z1Sq);<NEW_LINE>ECFieldElement X2Z1Sq = X2.multiply(Z1Sq);<NEW_LINE>ECFieldElement B = X2Z1Sq.add(T).square();<NEW_LINE>if (B.isZero()) {<NEW_LINE>if (A.isZero()) {<NEW_LINE>return b.twice();<NEW_LINE>}<NEW_LINE>return curve.getInfinity();<NEW_LINE>}<NEW_LINE>if (A.isZero()) {<NEW_LINE>return new SecT283K1Point(curve, A, curve.getB());<NEW_LINE>}<NEW_LINE>ECFieldElement X3 = A.square().multiply(X2Z1Sq);<NEW_LINE>ECFieldElement Z3 = A.multiply(B).multiply(Z1Sq);<NEW_LINE>ECFieldElement L3 = A.add(B).square().multiplyPlusProduct(T, L2plus1, Z3);<NEW_LINE>return new SecT283K1Point(curve, X3, L3, new ECFieldElement[] { Z3 });<NEW_LINE>} | ECFieldElement L2 = b.getRawYCoord(); |
579,516 | public void read(org.apache.thrift.protocol.TProtocol prot, loadTablet_args struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet incoming = iprot.readBitSet(4);<NEW_LINE>if (incoming.get(0)) {<NEW_LINE>struct.tinfo = new org.apache.accumulo.core.trace.thrift.TInfo();<NEW_LINE>struct.tinfo.read(iprot);<NEW_LINE>struct.setTinfoIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(1)) {<NEW_LINE>struct.credentials = new org.apache.accumulo.core.securityImpl.thrift.TCredentials();<NEW_LINE>struct.credentials.read(iprot);<NEW_LINE>struct.setCredentialsIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(2)) {<NEW_LINE>struct<MASK><NEW_LINE>struct.setLockIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(3)) {<NEW_LINE>struct.extent = new org.apache.accumulo.core.dataImpl.thrift.TKeyExtent();<NEW_LINE>struct.extent.read(iprot);<NEW_LINE>struct.setExtentIsSet(true);<NEW_LINE>}<NEW_LINE>} | .lock = iprot.readString(); |
22,343 | private void showErrorDetails() {<NEW_LINE>Maybe.fromCallable(() -> {<NEW_LINE>List<DownloadStatus> feedDownloadLog = DBReader.getFeedDownloadLog(feedID);<NEW_LINE>if (feedDownloadLog.size() == 0 || feedDownloadLog.get(0).isSuccessful()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return feedDownloadLog.get(0);<NEW_LINE>}).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(downloadStatus -> new DownloadLogDetailsDialog(getContext(), downloadStatus).show(), error -> error.printStackTrace(), () -> {<NEW_LINE>Intent intent = new Intent(<MASK><NEW_LINE>intent.putExtra(MainActivity.EXTRA_FRAGMENT_TAG, DownloadsFragment.TAG);<NEW_LINE>Bundle args = new Bundle();<NEW_LINE>args.putInt(DownloadsFragment.ARG_SELECTED_TAB, DownloadsFragment.POS_LOG);<NEW_LINE>intent.putExtra(MainActivity.EXTRA_FRAGMENT_ARGS, args);<NEW_LINE>startActivity(intent);<NEW_LINE>});<NEW_LINE>} | getContext(), MainActivity.class); |
141,507 | public static boolean checkMacros(final Project project, final Set<String> usedMacros) {<NEW_LINE>final Set<MASK><NEW_LINE>usedMacros.removeAll(defined);<NEW_LINE>// try to lookup values in System properties<NEW_LINE>@NonNls<NEW_LINE>final String pathMacroSystemPrefix = "path.macro.";<NEW_LINE>for (Iterator it = usedMacros.iterator(); it.hasNext(); ) {<NEW_LINE>final String macro = (String) it.next();<NEW_LINE>final String value = System.getProperty(pathMacroSystemPrefix + macro, null);<NEW_LINE>if (value != null) {<NEW_LINE>ApplicationManager.getApplication().runWriteAction(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>PathMacros.getInstance().setMacro(macro, value);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>it.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (usedMacros.isEmpty()) {<NEW_LINE>// all macros in configuration files are defined<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// there are undefined macros, need to define them before loading components<NEW_LINE>final boolean[] result = new boolean[1];<NEW_LINE>final Runnable r = new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>result[0] = showMacrosConfigurationDialog(project, usedMacros);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>WaitForProgressToShow.runOrInvokeAndWaitAboveProgress(r, ModalityState.NON_MODAL);<NEW_LINE>return result[0];<NEW_LINE>} | <String> defined = getDefinedMacros(); |
552,235 | public void menuShown(MenuEvent e) {<NEW_LINE>Utils.clearMenu(friends_menu);<NEW_LINE>boolean enabled = plugin.isClassicEnabled();<NEW_LINE>if (enabled) {<NEW_LINE>MenuItem mi = new MenuItem(friends_menu, SWT.PUSH);<NEW_LINE>mi.setText(MessageText.getString("azbuddy.insert.friend.key"));<NEW_LINE>mi.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent event) {<NEW_LINE>String uri = getFriendURI(!chat.isAnonymous());<NEW_LINE>input_area.append(uri);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mi.setEnabled(!chat.isReadOnly());<NEW_LINE>new MenuItem(friends_menu, SWT.SEPARATOR);<NEW_LINE>mi = new <MASK><NEW_LINE>mi.setText(MessageText.getString("azbuddy.view.friends"));<NEW_LINE>mi.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent event) {<NEW_LINE>view.selectClassicTab();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>MenuItem mi = new MenuItem(friends_menu, SWT.PUSH);<NEW_LINE>mi.setText(MessageText.getString("label.enable"));<NEW_LINE>mi.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent event) {<NEW_LINE>plugin.setClassicEnabled(true, false);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | MenuItem(friends_menu, SWT.PUSH); |
483,069 | private void _getFieldDeser(Context context, MethodVisitor mw, FieldInfo fieldInfo) {<NEW_LINE>Label notNull_ = new Label();<NEW_LINE>mw.visitVarInsn(ALOAD, 0);<NEW_LINE>mw.visitFieldInsn(GETFIELD, context.className, context.fieldDeserName(fieldInfo), desc(ObjectDeserializer.class));<NEW_LINE>mw.visitJumpInsn(IFNONNULL, notNull_);<NEW_LINE>mw.visitVarInsn(ALOAD, 0);<NEW_LINE><MASK><NEW_LINE>mw.visitMethodInsn(INVOKEVIRTUAL, DefaultJSONParser, "getConfig", "()" + desc(ParserConfig.class));<NEW_LINE>mw.visitLdcInsn(com.alibaba.fastjson.asm.Type.getType(desc(fieldInfo.fieldClass)));<NEW_LINE>mw.visitMethodInsn(INVOKEVIRTUAL, type(ParserConfig.class), "getDeserializer", "(Ljava/lang/reflect/Type;)" + desc(ObjectDeserializer.class));<NEW_LINE>mw.visitFieldInsn(PUTFIELD, context.className, context.fieldDeserName(fieldInfo), desc(ObjectDeserializer.class));<NEW_LINE>mw.visitLabel(notNull_);<NEW_LINE>mw.visitVarInsn(ALOAD, 0);<NEW_LINE>mw.visitFieldInsn(GETFIELD, context.className, context.fieldDeserName(fieldInfo), desc(ObjectDeserializer.class));<NEW_LINE>} | mw.visitVarInsn(ALOAD, 1); |
771,967 | public DomElement closest(final String selectorString) {<NEW_LINE>try {<NEW_LINE>final BrowserVersion browserVersion = getPage().getWebClient().getBrowserVersion();<NEW_LINE>final SelectorList selectorList = getSelectorList(selectorString, browserVersion);<NEW_LINE>DomNode current = this;<NEW_LINE>if (selectorList != null) {<NEW_LINE>do {<NEW_LINE>for (final Selector selector : selectorList) {<NEW_LINE><MASK><NEW_LINE>if (CssStyleSheet.selects(browserVersion, selector, elem, null, true)) {<NEW_LINE>return elem;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>do {<NEW_LINE>current = current.getParentNode();<NEW_LINE>} while (current != null && !(current instanceof DomElement));<NEW_LINE>} while (current != null);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} catch (final IOException e) {<NEW_LINE>throw new CSSException("Error parsing CSS selectors from '" + selectorString + "': " + e.getMessage());<NEW_LINE>}<NEW_LINE>} | final DomElement elem = (DomElement) current; |
598,493 | public boolean doStartElement(String uri, String localName, String name, Attributes attributes) throws SAXException {<NEW_LINE>if (STYLE_ELT.equals(localName)) {<NEW_LINE>this.currentStyleId = attributes.getValue(W_STYLE_ID_ATTR);<NEW_LINE>} else if (NAME_ELT.equals(localName)) {<NEW_LINE>String val = attributes.getValue(W_VAL_ATTR);<NEW_LINE>if (StringUtils.isNotEmpty(val)) {<NEW_LINE>if (HYPERLINK_STYLE_NAME.equals(val)) {<NEW_LINE>DefaultStyle defaultStyle = DocxContextHelper.getDefaultStyle(sharedContext);<NEW_LINE>defaultStyle.setHyperLinkStyleId(currentStyleId);<NEW_LINE>} else if (val.startsWith("heading ")) {<NEW_LINE>String index = val.substring("heading ".length(), val.length());<NEW_LINE>Integer <MASK><NEW_LINE>if (level != null) {<NEW_LINE>DefaultStyle defaultStyle = DocxContextHelper.getDefaultStyle(sharedContext);<NEW_LINE>defaultStyle.addHeaderStyle(level, currentStyleId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return super.doStartElement(uri, localName, name, attributes);<NEW_LINE>} | level = StringUtils.asInteger(index); |
210,555 | public boolean correctFullLinkControl(CorrectedBinaryMessage message, int crcMask) {<NEW_LINE>int[] input = new int[255];<NEW_LINE>int[] output = new int[255];<NEW_LINE>input[0] = message.getInt(FLC_PARITY_2) ^ crcMask;<NEW_LINE>input[1] = <MASK><NEW_LINE>input[2] = message.getInt(FLC_PARITY_0) ^ crcMask;<NEW_LINE>input[3] = message.getInt(FLC_CODEWORD_8);<NEW_LINE>input[4] = message.getInt(FLC_CODEWORD_7);<NEW_LINE>input[5] = message.getInt(FLC_CODEWORD_6);<NEW_LINE>input[6] = message.getInt(FLC_CODEWORD_5);<NEW_LINE>input[7] = message.getInt(FLC_CODEWORD_4);<NEW_LINE>input[8] = message.getInt(FLC_CODEWORD_3);<NEW_LINE>input[9] = message.getInt(FLC_CODEWORD_2);<NEW_LINE>input[10] = message.getInt(FLC_CODEWORD_1);<NEW_LINE>input[11] = message.getInt(FLC_CODEWORD_0);<NEW_LINE>try {<NEW_LINE>boolean irrecoverableErrors = decode(input, output);<NEW_LINE>if (irrecoverableErrors) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int pointer = 0;<NEW_LINE>for (int x = 11; x >= 0; x--) {<NEW_LINE>if (output[x] != -1 && (output[x] != input[x])) {<NEW_LINE>message.load(pointer, 8, output[x]);<NEW_LINE>message.setCorrectedBitCount(1);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>pointer += 8;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | message.getInt(FLC_PARITY_1) ^ crcMask; |
1,319,127 | public void unsubscribeTopic(final String senderId, final String gcmToken, final String topic) {<NEW_LINE>new AsyncTask<Void, Void, Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected Void doInBackground(Void... params) {<NEW_LINE>try {<NEW_LINE>GcmPubSub.getInstance(mContext).unsubscribe(gcmToken, topic);<NEW_LINE>mLogger.log(Log.INFO, "topic unsubscription succeeded." + "\ngcmToken: " + gcmToken + "\ntopic: " + topic);<NEW_LINE>// Save the token in the address book<NEW_LINE>Sender entry = mSenders.getSender(senderId);<NEW_LINE>if (entry == null) {<NEW_LINE>mLogger.log(Log.ERROR, "Could not save token, missing sender id");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>entry.topics.put(topic, false);<NEW_LINE>mSenders.updateSender(entry);<NEW_LINE>} catch (IOException | IllegalArgumentException e) {<NEW_LINE>mLogger.log(Log.INFO, "topic unsubscription failed." + "\nerror: " + e.getMessage() + <MASK><NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}.execute();<NEW_LINE>} | "\ngcmToken: " + gcmToken + "\ntopic: " + topic); |
538,988 | public boolean convertLevelToRocksBatchIterator(DB level, RocksDB rocks) {<NEW_LINE>// convert<NEW_LINE>List<byte[]> keys = new ArrayList<>(BATCH);<NEW_LINE>List<byte[]> values = new ArrayList<>(BATCH);<NEW_LINE>try (DBIterator levelIterator = level.iterator(new org.iq80.leveldb.ReadOptions().fillCache(false))) {<NEW_LINE>JniDBFactory.pushMemoryPool(1024 * 1024);<NEW_LINE>levelIterator.seekToFirst();<NEW_LINE>while (levelIterator.hasNext()) {<NEW_LINE>Map.Entry<byte[], byte[]<MASK><NEW_LINE>byte[] key = entry.getKey();<NEW_LINE>byte[] value = entry.getValue();<NEW_LINE>srcDbKeyCount++;<NEW_LINE>srcDbKeySum = byteArrayToIntWithOne(srcDbKeySum, key);<NEW_LINE>srcDbValueSum = byteArrayToIntWithOne(srcDbValueSum, value);<NEW_LINE>keys.add(key);<NEW_LINE>values.add(value);<NEW_LINE>if (keys.size() >= BATCH) {<NEW_LINE>try {<NEW_LINE>batchInsert(rocks, keys, values);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("{}", e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!keys.isEmpty()) {<NEW_LINE>try {<NEW_LINE>batchInsert(rocks, keys, values);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("{}", e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// check<NEW_LINE>check(rocks);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("{}", e);<NEW_LINE>return false;<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>level.close();<NEW_LINE>rocks.close();<NEW_LINE>JniDBFactory.popMemoryPool();<NEW_LINE>} catch (Exception e1) {<NEW_LINE>logger.error("{}", e1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return dstDbKeyCount == srcDbKeyCount && dstDbKeySum == srcDbKeySum && dstDbValueSum == srcDbValueSum;<NEW_LINE>} | > entry = levelIterator.next(); |
1,214,476 | public static // Shape creation (temporary hack)<NEW_LINE>PShapeOpenGL createShape(PGraphicsOpenGL pg, PShape src) {<NEW_LINE>PShapeOpenGL dest = null;<NEW_LINE>if (src.getFamily() == GROUP) {<NEW_LINE>// dest = PGraphics3D.createShapeImpl(pg, GROUP);<NEW_LINE>dest = (PShapeOpenGL) pg.createShapeFamily(GROUP);<NEW_LINE>copyGroup(pg, src, dest);<NEW_LINE>} else if (src.getFamily() == PRIMITIVE) {<NEW_LINE>// dest = PGraphics3D.createShapeImpl(pg, src.getKind(), src.getParams());<NEW_LINE>dest = (PShapeOpenGL) pg.createShapePrimitive(src.getKind(<MASK><NEW_LINE>PShape.copyPrimitive(src, dest);<NEW_LINE>} else if (src.getFamily() == GEOMETRY) {<NEW_LINE>// dest = PGraphics3D.createShapeImpl(pg, PShape.GEOMETRY);<NEW_LINE>dest = (PShapeOpenGL) pg.createShapeFamily(PShape.GEOMETRY);<NEW_LINE>PShape.copyGeometry(src, dest);<NEW_LINE>} else if (src.getFamily() == PATH) {<NEW_LINE>dest = (PShapeOpenGL) pg.createShapeFamily(PShape.PATH);<NEW_LINE>// dest = PGraphics3D.createShapeImpl(pg, PATH);<NEW_LINE>PShape.copyPath(src, dest);<NEW_LINE>}<NEW_LINE>dest.setName(src.getName());<NEW_LINE>dest.width = src.width;<NEW_LINE>dest.height = src.height;<NEW_LINE>dest.depth = src.depth;<NEW_LINE>return dest;<NEW_LINE>} | ), src.getParams()); |
1,403,022 | public static void main(String[] args) throws IOException {<NEW_LINE>List<String> artists = getTop100Artists();<NEW_LINE>Set<String> tags = getTop100Tags();<NEW_LINE>List<Record> records = datasetWithTaggedArtists(artists, tags);<NEW_LINE>Map<Centroid, List<Record>> clusters = KMeans.fit(records, 7, new EuclideanDistance(), 1000);<NEW_LINE>// Print the cluster configuration<NEW_LINE>clusters.forEach((key, value) -> {<NEW_LINE>System.out.println("------------------------------ CLUSTER -----------------------------------");<NEW_LINE>System.out<MASK><NEW_LINE>String members = String.join(", ", value.stream().map(Record::getDescription).collect(toSet()));<NEW_LINE>System.out.print(members);<NEW_LINE>System.out.println();<NEW_LINE>System.out.println();<NEW_LINE>});<NEW_LINE>Map<String, Object> json = convertToD3CompatibleMap(clusters);<NEW_LINE>System.out.println(mapper.writeValueAsString(json));<NEW_LINE>} | .println(sortedCentroid(key)); |
431,368 | public void receivedReply(final EchoBreakpointHitReply reply) {<NEW_LINE>lock.lock();<NEW_LINE>final Pair<ThreadRegisters, BreakpointAddress> addressPair = getAddress(reply);<NEW_LINE>final BreakpointAddress address = addressPair.second();<NEW_LINE>// If trace mode is active and the echo breakpoint that was hit<NEW_LINE>// is part of the current graph, the event is added to the current<NEW_LINE>// event list.<NEW_LINE>if (hasEchoBreakpoint(address)) {<NEW_LINE>NaviLogger.info("Adding echo breakpoint event %s to event list %s", address.getAddress().getAddress().toHexString(), eventList.getName());<NEW_LINE>final List<TraceRegister> registers = new ArrayList<TraceRegister>();<NEW_LINE>for (final RegisterValue registerValue : addressPair.first()) {<NEW_LINE>registers.add(new TraceRegister(registerValue.getName(), new CAddress(registerValue.getValue()), registerValue.getMemory()));<NEW_LINE>}<NEW_LINE>final List<TraceRegister> <MASK><NEW_LINE>final TraceEvent newEvent = new TraceEvent(reply.getThreadId(), address, TraceEventType.ECHO_BREAKPOINT, valueSet);<NEW_LINE>eventList.addEvent(newEvent);<NEW_LINE>final Integer count = activeEchoBreakpoints.get(address);<NEW_LINE>if (count != null) {<NEW_LINE>final int remaining = count - 1;<NEW_LINE>if (remaining <= 0) {<NEW_LINE>breakpointManager.removeBreakpoints(BreakpointType.ECHO, Sets.newHashSet(address));<NEW_LINE>} else {<NEW_LINE>activeEchoBreakpoints.put(address, remaining);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>NaviLogger.info("Unknown echo breakpoint event for address [%s]", address.getAddress().getAddress().toHexString());<NEW_LINE>}<NEW_LINE>lock.unlock();<NEW_LINE>} | valueSet = Lists.newArrayList(registers); |
1,766,362 | public PrimitiveVS<Boolean> symbolicEquals(MapVS<K, V> cmp, Guard pc) {<NEW_LINE>Guard equalCond = Guard.constFalse();<NEW_LINE>Guard guard = BooleanVS.getTrueGuard(this.keys.symbolicEquals(cmp.keys, Guard.constTrue()));<NEW_LINE>ListVS<PrimitiveVS<K>> thisSet = this.restrict(guard).keys.getElements();<NEW_LINE>ListVS<PrimitiveVS<K>> cmpSet = cmp.restrict(guard).keys.getElements();<NEW_LINE>if (thisSet.isEmpty() && cmpSet.isEmpty())<NEW_LINE>return BooleanVS.trueUnderGuard(pc.and(guard));<NEW_LINE>while (!thisSet.isEmpty()) {<NEW_LINE>PrimitiveVS<K> thisVal = thisSet.get(new PrimitiveVS<>(0).restrict(guard));<NEW_LINE>PrimitiveVS<K> cmpVal = cmpSet.get(new PrimitiveVS<>(0).restrict(guard));<NEW_LINE>assert (ValueSummaryChecks.equalUnder(thisVal, cmpVal, guard));<NEW_LINE>for (GuardedValue<K> key : thisVal.getGuardedValues()) {<NEW_LINE>PrimitiveVS<Boolean> compareVals = entries.get(key.getValue()).restrict(key.getGuard()).symbolicEquals(cmp.entries.get(key.getValue()).restrict(key<MASK><NEW_LINE>equalCond = equalCond.or(BooleanVS.getTrueGuard(compareVals));<NEW_LINE>}<NEW_LINE>thisSet = thisSet.removeAt(new PrimitiveVS<>(0).restrict(thisVal.getUniverse()));<NEW_LINE>cmpSet = cmpSet.removeAt(new PrimitiveVS<>(0).restrict(thisVal.getUniverse()));<NEW_LINE>}<NEW_LINE>return BooleanVS.trueUnderGuard(pc.and(equalCond));<NEW_LINE>} | .getGuard()), guard); |
1,786,985 | public Set<String> suggest(EntityRef sender, Object... resolvedParameters) {<NEW_LINE>Map<String, Set<ResourceUrn>> resourceMap = Maps.newHashMap();<NEW_LINE>Set<String<MASK><NEW_LINE>for (ResourceUrn resolvedParameter : assetManager.getAvailableAssets(assetType)) {<NEW_LINE>String resourceName = resolvedParameter.getResourceName().toString();<NEW_LINE>if (!resourceMap.containsKey(resourceName)) {<NEW_LINE>resourceMap.put(resourceName, Sets.newHashSet());<NEW_LINE>}<NEW_LINE>resourceMap.get(resourceName).add(resolvedParameter);<NEW_LINE>}<NEW_LINE>for (String key : resourceMap.keySet()) {<NEW_LINE>Set<ResourceUrn> set = resourceMap.get(key);<NEW_LINE>if (set.size() == 1) {<NEW_LINE>suggestions.add(set.iterator().next().getResourceName().toString());<NEW_LINE>} else {<NEW_LINE>for (ResourceUrn resourceUrn : set) {<NEW_LINE>suggestions.add(resourceUrn.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return suggestions;<NEW_LINE>} | > suggestions = Sets.newHashSet(); |
1,560,077 | public static Setting fromTenantParameterStore(UUID tenantId, Parameter parameter) {<NEW_LINE>Setting setting = null;<NEW_LINE>if (parameter != null) {<NEW_LINE>String parameterStoreName = parameter.name();<NEW_LINE>if (Utils.isEmpty(parameterStoreName)) {<NEW_LINE>throw new RuntimeException("Can't get Setting name for blank Parameter Store name");<NEW_LINE>}<NEW_LINE>String settingName = null;<NEW_LINE>Matcher regex = SAAS_BOOST_TENANT_PATTERN.matcher(parameterStoreName);<NEW_LINE>if (regex.matches()) {<NEW_LINE>if (!regex.group(1).equals(tenantId.toString())) {<NEW_LINE>throw new RuntimeException("Parameter Store Parameter " + parameterStoreName + " does not belong to tenant " + tenantId.toString());<NEW_LINE>}<NEW_LINE>settingName = regex.group(2);<NEW_LINE>}<NEW_LINE>if (settingName == null) {<NEW_LINE>throw new RuntimeException("Parameter Store Parameter " + parameterStoreName + <MASK><NEW_LINE>}<NEW_LINE>setting = Setting.builder().name(settingName).value(!"N/A".equals(parameter.value()) ? parameter.value() : "").readOnly(false).secure(ParameterType.SECURE_STRING == parameter.type()).version(parameter.version()).build();<NEW_LINE>}<NEW_LINE>return setting;<NEW_LINE>} | " does not match SaaS Boost tenant pattern " + SAAS_BOOST_TENANT_PATTERN.toString()); |
1,837,573 | private static FilterSpecPlanForge planFilterParametersInternal(List<ExprNode> validatedNodes, FilterSpecCompilerArgs args) throws ExprValidationException {<NEW_LINE>if (validatedNodes.isEmpty()) {<NEW_LINE>return FilterSpecPlanForge.EMPTY;<NEW_LINE>}<NEW_LINE>if (args.compileTimeServices.getConfiguration().getCompiler().getExecution().getFilterIndexPlanning() == ConfigurationCompilerExecution.FilterIndexPlanning.NONE) {<NEW_LINE>decomposeCheckAggregation(validatedNodes);<NEW_LINE>return buildNoPlan(validatedNodes, args);<NEW_LINE>}<NEW_LINE>boolean performConditionPlanning = hasLevelOrHint(FilterSpecCompilerIndexPlannerHint.CONDITIONS, args.statementRawInfo, args.compileTimeServices);<NEW_LINE>FilterSpecParaForgeMap filterParamExprMap = new FilterSpecParaForgeMap();<NEW_LINE>// Make filter parameter for each expression node, if it can be optimized.<NEW_LINE>// Optionally receive a top-level control condition that negates<NEW_LINE>ExprNode topLevelNegation = decomposePopulateConsolidate(<MASK><NEW_LINE>// Use all filter parameter and unassigned expressions<NEW_LINE>int countUnassigned = filterParamExprMap.countUnassignedExpressions();<NEW_LINE>// we are done if there are no remaining nodes<NEW_LINE>if (countUnassigned == 0) {<NEW_LINE>return makePlanFromTriplets(filterParamExprMap.getTriplets(), topLevelNegation, args);<NEW_LINE>}<NEW_LINE>// determine max-width<NEW_LINE>int filterServiceMaxFilterWidth = args.compileTimeServices.getConfiguration().getCompiler().getExecution().getFilterServiceMaxFilterWidth();<NEW_LINE>Hint hint = HintEnum.MAX_FILTER_WIDTH.getHint(args.statementRawInfo.getAnnotations());<NEW_LINE>if (hint != null) {<NEW_LINE>String hintValue = HintEnum.MAX_FILTER_WIDTH.getHintAssignedValue(hint);<NEW_LINE>filterServiceMaxFilterWidth = Integer.parseInt(hintValue);<NEW_LINE>}<NEW_LINE>FilterSpecPlanForge plan = null;<NEW_LINE>if (filterServiceMaxFilterWidth > 0) {<NEW_LINE>if (performConditionPlanning) {<NEW_LINE>plan = planRemainingNodesWithConditions(filterParamExprMap, args, filterServiceMaxFilterWidth, topLevelNegation);<NEW_LINE>} else {<NEW_LINE>plan = planRemainingNodesBasic(filterParamExprMap, args, filterServiceMaxFilterWidth);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (plan != null) {<NEW_LINE>return plan;<NEW_LINE>}<NEW_LINE>// handle no-plan<NEW_LINE>List<FilterSpecPlanPathTripletForge> triplets = new ArrayList<>(filterParamExprMap.getTriplets());<NEW_LINE>List<ExprNode> unassignedExpressions = filterParamExprMap.getUnassignedExpressions();<NEW_LINE>FilterSpecPlanPathTripletForge triplet = makeRemainingNode(unassignedExpressions, args);<NEW_LINE>triplets.add(triplet);<NEW_LINE>return makePlanFromTriplets(triplets, topLevelNegation, args);<NEW_LINE>} | filterParamExprMap, performConditionPlanning, validatedNodes, args); |
247,634 | public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = "symbol".split(",");<NEW_LINE>String text = "@name('s0') select irstream * from SupportMarketDataBean#length_batch(3)";<NEW_LINE>env.compileDeployAddListenerMileZero(text, "s0");<NEW_LINE>env.sendEventBean(makeMarketDataEvent("E1"));<NEW_LINE>env.milestone(1);<NEW_LINE>env.sendEventBean(makeMarketDataEvent("E2"));<NEW_LINE>env.milestone(2);<NEW_LINE>env.sendEventBean(makeMarketDataEvent("E3"));<NEW_LINE>env.assertPropsPerRowIRPair("s0", fields, new Object[][] { { "E1" }, { "E2" }, { "E3" } }, null);<NEW_LINE>env.milestone(3);<NEW_LINE>env.sendEventBean(makeMarketDataEvent("E4"));<NEW_LINE>env.milestone(4);<NEW_LINE>env.sendEventBean(makeMarketDataEvent("E5"));<NEW_LINE>env.milestone(5);<NEW_LINE>// test iterator<NEW_LINE>env.assertPropsPerRowIterator("s0", new String[] { "symbol" }, new Object[][] { { <MASK><NEW_LINE>env.sendEventBean(makeMarketDataEvent("E6"));<NEW_LINE>env.assertPropsPerRowIRPair("s0", fields, new Object[][] { { "E4" }, { "E5" }, { "E6" } }, new Object[][] { { "E1" }, { "E2" }, { "E3" } });<NEW_LINE>env.milestone(6);<NEW_LINE>env.sendEventBean(makeMarketDataEvent("E7"));<NEW_LINE>env.milestone(7);<NEW_LINE>env.sendEventBean(makeMarketDataEvent("E8"));<NEW_LINE>env.milestone(8);<NEW_LINE>env.sendEventBean(makeMarketDataEvent("E9"));<NEW_LINE>env.assertPropsPerRowIRPair("s0", fields, new Object[][] { { "E7" }, { "E8" }, { "E9" } }, new Object[][] { { "E4" }, { "E5" }, { "E6" } });<NEW_LINE>env.milestone(9);<NEW_LINE>env.sendEventBean(makeMarketDataEvent("E10"));<NEW_LINE>env.milestone(10);<NEW_LINE>env.undeployAll();<NEW_LINE>} | "E4" }, { "E5" } }); |
135,970 | final DescribeOperatingSystemsResult executeDescribeOperatingSystems(DescribeOperatingSystemsRequest describeOperatingSystemsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeOperatingSystemsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeOperatingSystemsRequest> request = null;<NEW_LINE>Response<DescribeOperatingSystemsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeOperatingSystemsRequestProtocolMarshaller(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, "OpsWorks");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeOperatingSystems");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeOperatingSystemsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeOperatingSystemsResultJsonUnmarshaller());<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(describeOperatingSystemsRequest)); |
1,356,400 | static IBaseResource parseResourceFromRequest(RequestDetails theRequest, @Nonnull BaseMethodBinding<?> theMethodBinding, Class<? extends IBaseResource> theResourceType) {<NEW_LINE>if (theRequest.getResource() != null) {<NEW_LINE>return theRequest.getResource();<NEW_LINE>}<NEW_LINE>IBaseResource retVal = null;<NEW_LINE>if (theResourceType != null && IBaseBinary.class.isAssignableFrom(theResourceType)) {<NEW_LINE>String ct = theRequest.getHeader(Constants.HEADER_CONTENT_TYPE);<NEW_LINE>if (EncodingEnum.forContentTypeStrict(ct) == null) {<NEW_LINE>FhirContext ctx = theRequest.getServer().getFhirContext();<NEW_LINE>IBaseBinary binary = BinaryUtil.newBinary(ctx);<NEW_LINE>binary.setId(theRequest.getId());<NEW_LINE>binary.setContentType(ct);<NEW_LINE>binary.setContent(theRequest.loadRequestContents());<NEW_LINE>retVal = binary;<NEW_LINE>if (ctx.getVersion().getVersion().isEqualOrNewerThan(FhirVersionEnum.DSTU3)) {<NEW_LINE>String securityContext = theRequest.getHeader(Constants.HEADER_X_SECURITY_CONTEXT);<NEW_LINE>if (isNotBlank(securityContext)) {<NEW_LINE>BinaryUtil.setSecurityContext(ctx, binary, securityContext);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean isNonFhirPatch = false;<NEW_LINE>if (theRequest.getRequestType() == RequestTypeEnum.PATCH) {<NEW_LINE>EncodingEnum requestEncoding = <MASK><NEW_LINE>if (requestEncoding == null) {<NEW_LINE>isNonFhirPatch = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (retVal == null && !isNonFhirPatch) {<NEW_LINE>retVal = loadResourceFromRequest(theRequest, theMethodBinding, theResourceType);<NEW_LINE>}<NEW_LINE>theRequest.setResource(retVal);<NEW_LINE>return retVal;<NEW_LINE>} | RestfulServerUtils.determineRequestEncodingNoDefault(theRequest, true); |
1,203,753 | private void allAppsGridView() throws AndroidDeviceException {<NEW_LINE>int x = screenSize.width;<NEW_LINE>int y = screenSize.height;<NEW_LINE>if (x > y) {<NEW_LINE>y = y / 2;<NEW_LINE>x = x - 30;<NEW_LINE>} else {<NEW_LINE>x = x / 2;<NEW_LINE>y = y - 30;<NEW_LINE>}<NEW_LINE>List<String> coordinates = new ArrayList<String>();<NEW_LINE>coordinates.add("3 0 " + x);<NEW_LINE>coordinates.add("3 1 " + y);<NEW_LINE>coordinates.add("1 330 1");<NEW_LINE>coordinates.add("0 0 0");<NEW_LINE>coordinates.add("1 330 0");<NEW_LINE>coordinates.add("0 0 0");<NEW_LINE>for (String coordinate : coordinates) {<NEW_LINE>CommandLine event1 = getAdbCommand();<NEW_LINE>event1.addArgument("shell", false);<NEW_LINE>event1.addArgument("sendevent", false);<NEW_LINE>event1.addArgument("dev/input/event0", false);<NEW_LINE>event1.addArgument(coordinate, false);<NEW_LINE>try {<NEW_LINE>ShellCommand.exec(event1);<NEW_LINE>} catch (ShellCommandException e) {<NEW_LINE>throw new AndroidDeviceException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Thread.sleep(750);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>Thread<MASK><NEW_LINE>}<NEW_LINE>} | .currentThread().interrupt(); |
1,284,671 | private void processMethods(DexHeader header, TaskMonitor monitor, MessageLog log) throws Exception {<NEW_LINE>monitor.setMessage("DEX: processing methods");<NEW_LINE>monitor.setMaximum(header.getMethodIdsSize());<NEW_LINE>monitor.setProgress(0);<NEW_LINE>Address address = baseAddress.add(header.getMethodIdsOffset());<NEW_LINE>int methodIndex = 0;<NEW_LINE>for (MethodIDItem item : header.getMethods()) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE>monitor.incrementProgress(1);<NEW_LINE>DataType dataType = item.toDataType();<NEW_LINE>api.createData(address, dataType);<NEW_LINE>fragmentManager.methodsAddressSet.add(address, address.add(dataType.getLength() - 1));<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>builder.append("Method Index: 0x" + Integer.toHexString(methodIndex) + "\n");<NEW_LINE>builder.append("Class: " + DexUtil.convertTypeIndexToString(header, item.getClassIndex()) + "\n");<NEW_LINE>builder.append("Prototype: " + DexUtil.convertPrototypeIndexToString(header, item.getProtoIndex()) + "\n");<NEW_LINE>builder.append("Name: " + DexUtil.convertToString(header, item<MASK><NEW_LINE>api.setPlateComment(address, builder.toString());<NEW_LINE>Address methodIndexAddress = DexUtil.toLookupAddress(program, methodIndex);<NEW_LINE>if (program.getMemory().getInt(methodIndexAddress) == -1) {<NEW_LINE>// Add placeholder symbol for external functions<NEW_LINE>String methodName = DexUtil.convertToString(header, item.getNameIndex());<NEW_LINE>String className = DexUtil.convertTypeIndexToString(header, item.getClassIndex());<NEW_LINE>Namespace classNameSpace = DexUtil.createNameSpaceFromMangledClassName(program, className);<NEW_LINE>if (classNameSpace != null) {<NEW_LINE>Address externalAddress = DexUtil.toLookupAddress(program, methodIndex);<NEW_LINE>Symbol methodSymbol = createMethodSymbol(externalAddress, methodName, classNameSpace, log);<NEW_LINE>if (methodSymbol != null) {<NEW_LINE>String externalName = methodSymbol.getName(true);<NEW_LINE>program.getReferenceManager().addExternalReference(methodIndexAddress, "EXTERNAL.dex-" + methodIndex, externalName, null, SourceType.ANALYSIS, 0, RefType.DATA);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>api.createData(methodIndexAddress, new PointerDataType());<NEW_LINE>++methodIndex;<NEW_LINE>address = address.add(dataType.getLength());<NEW_LINE>}<NEW_LINE>} | .getNameIndex()) + "\n"); |
916,417 | public void updateFeedbackResponsesForChangingTeam(String courseId, String userEmail, String oldTeam, String newTeam) {<NEW_LINE>FeedbackQuestionAttributes question;<NEW_LINE>// deletes all responses given by the user to team members or given by the user as a representative of a team.<NEW_LINE>List<FeedbackResponseAttributes> responsesFromUser = getFeedbackResponsesFromGiverForCourse(courseId, userEmail);<NEW_LINE>for (FeedbackResponseAttributes response : responsesFromUser) {<NEW_LINE>question = fqLogic.getFeedbackQuestion(response.getFeedbackQuestionId());<NEW_LINE>if (question.getGiverType() == FeedbackParticipantType.TEAMS || isRecipientTypeTeamMembers(question)) {<NEW_LINE>deleteFeedbackResponseCascade(response.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Deletes all responses given by other team members to the user.<NEW_LINE>List<FeedbackResponseAttributes> <MASK><NEW_LINE>for (FeedbackResponseAttributes response : responsesToUser) {<NEW_LINE>question = fqLogic.getFeedbackQuestion(response.getFeedbackQuestionId());<NEW_LINE>if (isRecipientTypeTeamMembers(question)) {<NEW_LINE>deleteFeedbackResponseCascade(response.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean isOldTeamEmpty = studentsLogic.getStudentsForTeam(oldTeam, courseId).isEmpty();<NEW_LINE>if (isOldTeamEmpty) {<NEW_LINE>deleteFeedbackResponsesInvolvedEntityOfCourseCascade(courseId, oldTeam);<NEW_LINE>}<NEW_LINE>} | responsesToUser = getFeedbackResponsesForReceiverForCourse(courseId, userEmail); |
1,264,717 | public Object readObject(JSONReader jsonReader, Type fieldType, Object fieldName, long features) {<NEW_LINE>JSONReader.Context context = jsonReader.getContext();<NEW_LINE>if (jsonReader.isInt()) {<NEW_LINE>long millis = jsonReader.readInt64Value();<NEW_LINE>if (formatUnixTime) {<NEW_LINE>millis *= 1000;<NEW_LINE>}<NEW_LINE>Instant <MASK><NEW_LINE>return ZonedDateTime.ofInstant(instant, context.getZoneId());<NEW_LINE>}<NEW_LINE>if (jsonReader.readIfNull()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (format == null || yyyyMMddhhmmss19 || formatISO8601) {<NEW_LINE>return jsonReader.readZonedDateTime();<NEW_LINE>}<NEW_LINE>String str = jsonReader.readString();<NEW_LINE>if (formatMillis || formatUnixTime) {<NEW_LINE>long millis = Long.parseLong(str);<NEW_LINE>if (formatUnixTime) {<NEW_LINE>millis *= 1000L;<NEW_LINE>}<NEW_LINE>Instant instant = Instant.ofEpochMilli(millis);<NEW_LINE>return ZonedDateTime.ofInstant(instant, context.getZoneId());<NEW_LINE>}<NEW_LINE>DateTimeFormatter formatter = getDateFormatter(jsonReader.getLocale());<NEW_LINE>if (!formatHasHour) {<NEW_LINE>return ZonedDateTime.of(LocalDate.parse(str, formatter), LocalTime.MIN, context.getZoneId());<NEW_LINE>}<NEW_LINE>if (!formatHasDay) {<NEW_LINE>return ZonedDateTime.of(LocalDate.of(1970, 1, 1), LocalTime.parse(str, formatter), context.getZoneId());<NEW_LINE>}<NEW_LINE>LocalDateTime localDateTime = LocalDateTime.parse(str, formatter);<NEW_LINE>return ZonedDateTime.of(localDateTime, context.getZoneId());<NEW_LINE>} | instant = Instant.ofEpochMilli(millis); |
1,148,458 | public synchronized boolean checkValid(String clientId, String username, byte[] password) {<NEW_LINE>// Check Username / Password in DB using sqlQuery<NEW_LINE>if (username == null || password == null) {<NEW_LINE>LOG.info("username or password was null");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>ResultSet r = null;<NEW_LINE>try {<NEW_LINE>this.preparedStatement.setString(1, username);<NEW_LINE>r <MASK><NEW_LINE>if (r.next()) {<NEW_LINE>final String foundPwq = r.getString(1);<NEW_LINE>messageDigest.update(password);<NEW_LINE>byte[] digest = messageDigest.digest();<NEW_LINE>String encodedPasswd = new String(Hex.encodeHex(digest));<NEW_LINE>return foundPwq.equals(encodedPasswd);<NEW_LINE>}<NEW_LINE>r.close();<NEW_LINE>} catch (SQLException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>Utility.printExecption(LOG, e);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | = this.preparedStatement.executeQuery(); |
365,700 | public <T extends ONNXRef<?>> ONNXNode exportCombiner(ONNXNode input, T weight) {<NEW_LINE>// Unsqueeze the weights to make sure they broadcast how I want them too.<NEW_LINE>// Now the size is [1, 1, num_members].<NEW_LINE>ONNXInitializer unsqueezeAxes = input.onnxContext().array("unsqueeze_ensemble_output", new long[] { 0, 1 });<NEW_LINE>ONNXNode unsqueezed = weight.<MASK><NEW_LINE>// Multiply the input by the weights.<NEW_LINE>ONNXNode mulByWeights = input.apply(ONNXOperators.MUL, unsqueezed);<NEW_LINE>// Sum the weights<NEW_LINE>ONNXNode weightSum = weight.apply(ONNXOperators.REDUCE_SUM);<NEW_LINE>// Take the weighted mean over the outputs<NEW_LINE>ONNXInitializer sumAxes = input.onnxContext().array("sum_across_ensemble_axes", new long[] { 2 });<NEW_LINE>return mulByWeights.apply(ONNXOperators.REDUCE_SUM, sumAxes, Collections.singletonMap("keepdims", 0)).apply(ONNXOperators.DIV, weightSum);<NEW_LINE>} | apply(ONNXOperators.UNSQUEEZE, unsqueezeAxes); |
404,477 | static double[][] readErrorMatrix(String fileName, Index<String> tagIndex, boolean useLogProb) {<NEW_LINE><MASK><NEW_LINE>int matrixSize = numTags;<NEW_LINE>String[] matrixLines = new String[matrixSize];<NEW_LINE>try {<NEW_LINE>BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(fileName))));<NEW_LINE>String line = null;<NEW_LINE>int lineCount = 0;<NEW_LINE>while ((line = br.readLine()) != null) {<NEW_LINE>line = line.trim();<NEW_LINE>matrixLines[lineCount] = line;<NEW_LINE>lineCount++;<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>double[][] matrix = parseMatrix(matrixLines, tagIndex, matrixSize, false, useLogProb);<NEW_LINE>log.info("Error Matrix P(Observed|Truth): ");<NEW_LINE>log.info(ArrayUtils.toString(matrix));<NEW_LINE>return matrix;<NEW_LINE>} | int numTags = tagIndex.size(); |
1,594,898 | protected void installDefaults() {<NEW_LINE>if (tree.getBackground() == null || tree.getBackground() instanceof UIResource) {<NEW_LINE>tree.setBackground(UIManager.getColor("Tree.background"));<NEW_LINE>}<NEW_LINE>if (getHashColor() == null || getHashColor() instanceof UIResource) {<NEW_LINE>setHashColor(UIManager.getColor("Tree.hash"));<NEW_LINE>}<NEW_LINE>if (tree.getFont() == null || tree.getFont() instanceof UIResource)<NEW_LINE>tree.setFont(UIManager.getFont("Tree.font"));<NEW_LINE>// JTree's original row height is 16. To correctly display the<NEW_LINE>// contents on Linux we should have set it to 18, Windows 19 and<NEW_LINE>// Solaris 20. As these values vary so much it's too hard to<NEW_LINE>// be backward compatable and try to update the row height, we're<NEW_LINE>// therefor NOT going to adjust the row height based on font. If the<NEW_LINE>// developer changes the font, it's there responsibility to update<NEW_LINE>// the row height.<NEW_LINE>setExpandedIcon(null);<NEW_LINE>setCollapsedIcon(null);<NEW_LINE>setLeftChildIndent(0);<NEW_LINE>setRightChildIndent(0);<NEW_LINE>LookAndFeel.installProperty(tree, "rowHeight", UIManager.get("Tree.rowHeight"));<NEW_LINE>largeModel = (tree.isLargeModel() && tree.getRowHeight() > 0);<NEW_LINE>Object scrollsOnExpand = UIManager.get("Tree.scrollsOnExpand");<NEW_LINE>if (scrollsOnExpand != null) {<NEW_LINE>LookAndFeel.<MASK><NEW_LINE>}<NEW_LINE>UIManager.getDefaults().put("Tree.paintLines", false);<NEW_LINE>UIManager.getDefaults().put("Tree.lineTypeDashed", false);<NEW_LINE>} | installProperty(tree, "scrollsOnExpand", scrollsOnExpand); |
1,098,065 | protected ActionToolbar buildToolbar(@Nullable Point mousePosition, @Nonnull Disposable parentDisposable) {<NEW_LINE>final DefaultActionGroup group = new DefaultActionGroup();<NEW_LINE>final ShowPrevChangeMarkerAction localShowPrevAction = new ShowPrevChangeMarkerAction(myTracker.getPrevRange(myRange), myTracker, myEditor);<NEW_LINE>final ShowNextChangeMarkerAction localShowNextAction = new ShowNextChangeMarkerAction(myTracker.getNextRange(myRange), myTracker, myEditor);<NEW_LINE>final RollbackLineStatusRangeAction rollback = new <MASK><NEW_LINE>final ShowLineStatusRangeDiffAction showDiff = new ShowLineStatusRangeDiffAction(myTracker, myRange, myEditor);<NEW_LINE>final CopyLineStatusRangeAction copyRange = new CopyLineStatusRangeAction(myTracker, myRange);<NEW_LINE>final ToggleByWordDiffAction toggleWordDiff = new ToggleByWordDiffAction(myRange, myEditor, myTracker, mousePosition);<NEW_LINE>group.add(localShowPrevAction);<NEW_LINE>group.add(localShowNextAction);<NEW_LINE>group.add(rollback);<NEW_LINE>group.add(showDiff);<NEW_LINE>group.add(copyRange);<NEW_LINE>group.add(toggleWordDiff);<NEW_LINE>JComponent editorComponent = myEditor.getComponent();<NEW_LINE>DiffUtil.registerAction(localShowPrevAction, editorComponent);<NEW_LINE>DiffUtil.registerAction(localShowNextAction, editorComponent);<NEW_LINE>DiffUtil.registerAction(rollback, editorComponent);<NEW_LINE>DiffUtil.registerAction(showDiff, editorComponent);<NEW_LINE>DiffUtil.registerAction(copyRange, editorComponent);<NEW_LINE>final List<AnAction> actionList = ActionUtil.getActions(editorComponent);<NEW_LINE>Disposer.register(parentDisposable, () -> {<NEW_LINE>actionList.remove(localShowPrevAction);<NEW_LINE>actionList.remove(localShowNextAction);<NEW_LINE>actionList.remove(rollback);<NEW_LINE>actionList.remove(showDiff);<NEW_LINE>actionList.remove(copyRange);<NEW_LINE>});<NEW_LINE>return ActionManager.getInstance().createActionToolbar(ActionPlaces.FILEHISTORY_VIEW_TOOLBAR, group, true);<NEW_LINE>} | RollbackLineStatusRangeAction(myTracker, myRange, myEditor); |
426,102 | public void writeTo(StreamOutput out) throws IOException {<NEW_LINE>out.writeString(modelId);<NEW_LINE>out.writeString(createdBy);<NEW_LINE>Version.writeVersion(version, out);<NEW_LINE>out.writeOptionalString(description);<NEW_LINE>out.writeInstant(createTime);<NEW_LINE>out.writeOptionalWriteable(definition);<NEW_LINE>out.<MASK><NEW_LINE>out.writeGenericMap(metadata);<NEW_LINE>input.writeTo(out);<NEW_LINE>out.writeVLong(modelSize);<NEW_LINE>out.writeVLong(estimatedOperations);<NEW_LINE>out.writeString(licenseLevel.description());<NEW_LINE>if (defaultFieldMap != null) {<NEW_LINE>out.writeBoolean(true);<NEW_LINE>out.writeMap(defaultFieldMap, StreamOutput::writeString, StreamOutput::writeString);<NEW_LINE>} else {<NEW_LINE>out.writeBoolean(false);<NEW_LINE>}<NEW_LINE>out.writeOptionalNamedWriteable(inferenceConfig);<NEW_LINE>if (out.getVersion().onOrAfter(VERSION_3RD_PARTY_CONFIG_ADDED)) {<NEW_LINE>out.writeOptionalEnum(modelType);<NEW_LINE>out.writeOptionalNamedWriteable(location);<NEW_LINE>}<NEW_LINE>} | writeCollection(tags, StreamOutput::writeString); |
693,152 | public void doUpgrade(String userId) {<NEW_LINE>if (// Unless conversion is enabled...<NEW_LINE>!conversionEnabled)<NEW_LINE>// shouldn't really ever happen but...<NEW_LINE>return;<NEW_LINE><MASK><NEW_LINE>UserData userData = datastore.find(userKey(userId));<NEW_LINE>if ((userData.upgradedGCS && useGcs) || (!userData.upgradedGCS && !useGcs))<NEW_LINE>// All done, another task did it!<NEW_LINE>return;<NEW_LINE>List<Long> projectIds = getProjects(userId);<NEW_LINE>boolean anyFailed = false;<NEW_LINE>for (long projectId : projectIds) {<NEW_LINE>for (FileData fd : datastore.query(FileData.class).ancestor(projectKey(projectId))) {<NEW_LINE>if (fd.isBlob) {<NEW_LINE>if (useGcs) {<NEW_LINE>// Let's convert by just reading it!<NEW_LINE>downloadRawFile(userId, projectId, fd.fileName);<NEW_LINE>}<NEW_LINE>} else if (isTrue(fd.isGCS)) {<NEW_LINE>if (!useGcs) {<NEW_LINE>// Let's downgrade by just reading it!<NEW_LINE>downloadRawFile(userId, projectId, fd.fileName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ApiProxy.getCurrentEnvironment().getRemainingMillis() <= 5000)<NEW_LINE>return; | Objectify datastore = ObjectifyService.begin(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.