idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,040,727 | @Produces("application/json")<NEW_LINE>public Response evaluate(PolicyEvaluationRequest evaluationRequest) {<NEW_LINE>this.auth.realm().requireViewAuthorization();<NEW_LINE>CloseableKeycloakIdentity identity = createIdentity(evaluationRequest);<NEW_LINE>try {<NEW_LINE>AuthorizationRequest request = new AuthorizationReq... | getContext().get("attributes"); |
342,809 | public void updateNotification(@NonNull WeatherPresentation weatherPresentation, @NonNull NotificationCompat.Builder notification, @NonNull Context context) throws NullPointerException {<NEW_LINE>// noinspection ConstantConditions<NEW_LINE>if (weatherPresentation == null)<NEW_LINE>throw new NullPointerException("weathe... | ).setColor(NotificationCompat.COLOR_DEFAULT); |
1,517,166 | public MLTrain create(final MLMethod method, final MLDataSet training, final String argsStr) {<NEW_LINE>if (!(method instanceof SVM)) {<NEW_LINE>throw new EncogError("SVM Train training cannot be used on a method of type: " + method.getClass().getName());<NEW_LINE>}<NEW_LINE>final double defaultGamma = 1.0 / ((<MASK><N... | SVM) method).getInputCount(); |
503,493 | private FlowScope traverseOptChain(Node n, FlowScope scope) {<NEW_LINE>checkArgument(NodeUtil.isOptChainNode(n));<NEW_LINE>if (NodeUtil.isEndOfOptChainSegment(n)) {<NEW_LINE>// Create new optional chain tracking object and push it onto the stack.<NEW_LINE>final Node startOfChain = NodeUtil.getStartOfOptChainSegment(n);... | executedScope = setOptChainNodeTypeAfterChildrenTraversed(n, aboutToExecuteScope); |
789,546 | public static ListContactsResponse unmarshall(ListContactsResponse listContactsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listContactsResponse.setRequestId<MASK><NEW_LINE>listContactsResponse.setTotalCount(_ctx.integerValue("ListContactsResponse.TotalCount"));<NEW_LINE>listContactsResponse.setMessage(_ctx.stringVal... | (_ctx.stringValue("ListContactsResponse.RequestId")); |
687,035 | private static Set<String> collectSourceRoots(Project prj) {<NEW_LINE>Set<String> toRet = new HashSet<String>();<NEW_LINE>NbMavenProject watcher = prj.getLookup().lookup(NbMavenProject.class);<NEW_LINE><MASK><NEW_LINE>// TODO this ought to be really configurable based on what class gets debugged.<NEW_LINE>toRet.addAll(... | MavenProject mproject = watcher.getMavenProject(); |
391,097 | // Remove a consumer for a topic<NEW_LINE>public CompletableFuture<Void> removeConsumerAsync(String topicName) {<NEW_LINE>checkArgument(TopicName.isValid(topicName), "Invalid topic name:" + topicName);<NEW_LINE>if (getState() == State.Closing || getState() == State.Closed) {<NEW_LINE>return FutureUtil.failedFuture(new ... | get(topicName).getPartitionedTopicName(); |
913,587 | private void colorFilledInput(Theme theme) {<NEW_LINE>if (devices == null) {<NEW_LINE>// Don't mark anything red, until the devices are loaded.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>requiredFieldMessage.setVisible(!this.isReady());<NEW_LINE>deviceLabel.setForeground(getSelectedDevice() == null ? theme.missingInput() : t... | setForeground(theme.filledInput()); |
565,401 | public List<DataSetTableUnionDTO> listByTableId(String tableId) {<NEW_LINE>List<DataSetTableUnionDTO> sourceList = extDatasetTableUnionMapper.selectBySourceTableId(tableId);<NEW_LINE>List<DataSetTableUnionDTO> targetList = extDatasetTableUnionMapper.selectByTargetTableId(tableId);<NEW_LINE>sourceList.addAll(targetList.... | setCreateBy(ele.getCreateBy()); |
784,939 | final GlobalCluster executeDeleteGlobalCluster(DeleteGlobalClusterRequest deleteGlobalClusterRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteGlobalClusterRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.star... | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
946,942 | private void doRefresh() {<NEW_LINE>for (DockingAction action : actions) {<NEW_LINE>tool.removeAction(action);<NEW_LINE>}<NEW_LINE>actions.clear();<NEW_LINE>if (program == null || program.isClosed()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<MarkerSetImpl> list = markerManager.copyMarkerSets(program);<NEW_LINE>// sep... | 0).getName())); |
587,677 | public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException {<NEW_LINE>Object[] params = new Object[3];<NEW_LINE>params[0] = context;<NEW_LINE>params[1] = component;<NEW_LINE>params[2] = value;<NEW_LINE>try {<NEW_LINE>methodExpression.invoke(<MASK><NEW_LINE>} catch (ELExcep... | context.getELContext(), params); |
1,150,619 | public static void vibrate(float duration) {<NEW_LINE>try {<NEW_LINE>if (sVibrateService != null && sVibrateService.hasVibrator()) {<NEW_LINE>if (android.os.Build.VERSION.SDK_INT >= 26) {<NEW_LINE>Class<?> vibrationEffectClass = Class.forName("android.os.VibrationEffect");<NEW_LINE>if (vibrationEffectClass != null) {<N... | Integer>getConstantValue(vibrationEffectClass, "DEFAULT_AMPLITUDE"); |
405,401 | protected void initialiseNewStoreFile(CursorContext cursorContext) throws IOException {<NEW_LINE>super.initialiseNewStoreFile(cursorContext);<NEW_LINE>long storeVersionAsLong = MetaDataStore.versionStringToLong(storeVersion);<NEW_LINE>StoreId storeId = new StoreId(storeVersionAsLong);<NEW_LINE>setCreationTime(storeId.g... | BASE_TX_ID, BASE_TX_CHECKSUM, BASE_TX_COMMIT_TIMESTAMP, cursorContext); |
251,430 | private JPanel buildSearchPanel() {<NEW_LINE>JPanel labelPanel = new JPanel();<NEW_LINE>labelPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10));<NEW_LINE>labelPanel.setLayout(new GridLayout(0, 1));<NEW_LINE>labelPanel.add(new GLabel("Search Value: "));<NEW_LINE>labelPanel.add(new GLabel("Hex Sequence: "));<N... | , 5, 5, 5)); |
33,414 | private void stop(AtomicBoolean hasAnythingChanged, ClassMapper classMapper, DependencyNode node) {<NEW_LINE>// Check if all its dependencies have been satisfied.<NEW_LINE>// when stopping.<NEW_LINE>if (node.canBe(State.STOPPED)) {<NEW_LINE>LOGGER_INSTANCE.debug(HORIZONTAL_LINE);<NEW_LINE>// Retrieve the instance for t... | = (Execution<Object>) exec; |
164,087 | public DkimAttributes unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DkimAttributes dkimAttributes = new DkimAttributes();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth +... | class).unmarshall(context)); |
36,755 | // testargumentContainsExceptionInTwoCallbackClasses<NEW_LINE>public void testargumentContainsExceptionInTwoCallbackClasses(String BASE_URL, StringBuilder sb) throws Exception {<NEW_LINE><MASK><NEW_LINE>invokeClear(client, BASE_URL);<NEW_LINE>invokeReset(client, BASE_URL);<NEW_LINE>Future<Response> suspend2 = client.ta... | Client client = ClientBuilder.newClient(); |
1,149,040 | public void marshall(DestinationConnectorProperties destinationConnectorProperties, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (destinationConnectorProperties == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.mar... | destinationConnectorProperties.getEventBridge(), EVENTBRIDGE_BINDING); |
1,103,590 | public void init(int WindowNo, FormFrame frame) {<NEW_LINE>m_WindowNo = WindowNo;<NEW_LINE>m_frame = frame;<NEW_LINE>log.info("WinNo=" + m_WindowNo + " - AD_Client_ID=" + m_AD_Client_ID + ", AD_Org_ID=" + m_AD_Org_ID + ", By=" + m_by);<NEW_LINE>Env.setContext(Env.getCtx(), m_WindowNo, "IsSOTrx", "N");<NEW_LINE>try {<NE... | add(statusBar, BorderLayout.SOUTH); |
405,406 | final UpdateReportGroupResult executeUpdateReportGroup(UpdateReportGroupRequest updateReportGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateReportGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.st... | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
1,148,743 | static byte[] decrypt(String privateKey, byte[] secret) throws Exception {<NEW_LINE>String pkcs8Pem = privateKey;<NEW_LINE>pkcs8Pem = pkcs8Pem.replace("-----BEGIN RSA PRIVATE KEY-----", "");<NEW_LINE>pkcs8Pem = pkcs8Pem.replace("-----END RSA PRIVATE KEY-----", "");<NEW_LINE>pkcs8Pem = pkcs8Pem.replaceAll("\\s+", "");<N... | init(Cipher.DECRYPT_MODE, privKey); |
623,947 | protected void paintComponent(Graphics g) {<NEW_LINE><MASK><NEW_LINE>final Rectangle bounds = getBounds();<NEW_LINE>final Insets insets = getInsets();<NEW_LINE>final GraphicsConfig cfg = new GraphicsConfig(g);<NEW_LINE>cfg.setAntialiasing(true);<NEW_LINE>final Shape shape = new RoundRectangle2D.Double(insets.left, inse... | final Graphics2D g2d = (Graphics2D) g; |
636,480 | static boolean isOverlapPreventedInOtherDimension(LayoutInterval addingInterval, LayoutInterval existingInterval, int dimension) {<NEW_LINE>int otherDim = dimension ^ 1;<NEW_LINE>Iterator<LayoutInterval> addIt = getComponentIterator(addingInterval);<NEW_LINE>do {<NEW_LINE>LayoutInterval otherDimAdd = addIt.next().<MASK... | getComponent().getLayoutInterval(otherDim); |
389,829 | private void processDynamicPpcGotEntry(ElfLoadHelper elfLoadHelper) {<NEW_LINE>ElfHeader elfHeader = elfLoadHelper.getElfHeader();<NEW_LINE>// Presence of DT_PPC_GOT signals old ABI<NEW_LINE>ElfDynamicTable dynamicTable = elfHeader.getDynamicTable();<NEW_LINE>if (dynamicTable == null || !dynamicTable.containsDynamicVal... | memory.setInt(gotAddr, dynamicOffset); |
814,552 | boolean anyOtherEndTag(Token t, HtmlTreeBuilder tb) {<NEW_LINE>// case insensitive search - goal is to preserve output case, not for the parse to be case sensitive<NEW_LINE>final String name = t.asEndTag().normalName;<NEW_LINE>final ArrayList<Element> stack = tb.getStack();<NEW_LINE>// deviate from spec slightly to spe... | elFromStack = tb.getFromStack(name); |
523,378 | public void applyBlock(BlockCapsule block) {<NEW_LINE>long nowTime = System.currentTimeMillis();<NEW_LINE>String witnessAddress = Hex.toHexString(block.getWitnessAddress().toByteArray());<NEW_LINE>// witness info<NEW_LINE>if (witnessInfo.containsKey(witnessAddress)) {<NEW_LINE>BlockCapsule oldBlock = witnessInfo.get(wi... | witnessAddress, block.getNum()); |
207,007 | public static ClassMembers createMembers(Map<String, byte[]> classMap, ClassHierarchy hierarchy) {<NEW_LINE>Class<?>[] argTypes = new Class[] { ClassHierarchy.class };<NEW_LINE>Object[] argVals = new Object[] { hierarchy };<NEW_LINE>ClassMembers repo = ReflectUtil.quietNew(ClassMembers.class, argTypes, argVals);<NEW_LI... | .new Feeder(), 0); |
1,148,276 | public void collectRowRecord(RowRecord rowRecord) {<NEW_LINE>if (numberOfInitializedColumns != columns.length) {<NEW_LINE>List<Integer> initializedDataTypeIndexes = trySetDataTypes(rowRecord);<NEW_LINE>tryInitColumns(initializedDataTypeIndexes);<NEW_LINE>numberOfInitializedColumns += initializedDataTypeIndexes.size();<... | , field.getDataType())); |
1,368,370 | public InternalFuture<Void> deleteAttributes(DeleteProjectAttributes request) {<NEW_LINE>final var projectId = request.getId();<NEW_LINE>final var now = Calendar.getInstance().getTimeInMillis();<NEW_LINE>var validateArgumentFuture = InternalFuture.runAsync(() -> {<NEW_LINE>if (projectId.isEmpty()) {<NEW_LINE>throw new ... | -> updateVersionNumber(projectId), executor); |
34,516 | private void killDoomedServers(boolean dumpState) {<NEW_LINE>URL doomedServer = self().getDoomedServer();<NEW_LINE>if (doomedServer != null) {<NEW_LINE>// Kill the other guy<NEW_LINE>System.out.println("killDoomedServers: " + doomedServer.toString());<NEW_LINE>HttpURLConnection conn = null;<NEW_LINE>try {<NEW_LINE>conn... | int response_code = conn.getResponseCode(); |
386,037 | private ListNode<Set<V>> lookupImpl(@NotNull Iterator<T> key) {<NEW_LINE>if (!key.hasNext()) {<NEW_LINE>if (root.values.size() > 0) {<NEW_LINE>return ListNode.of(root.values);<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// walk down the tree while terms of the key path sequence match the corr... | null && key.hasNext()); |
1,773,486 | public void log(TraceComponent tc) {<NEW_LINE>Tr.debug(tc, MessageFormat.format("Delayed Class [ {0} ]", getHashText()));<NEW_LINE>Tr.debug(tc, MessageFormat.format(" classInfo [ {0} ]", ((classInfo != null) ? classInfo.getHashText() : null)));<NEW_LINE>Tr.debug(tc, MessageFormat.format(" isArtificial [ {0} ]", Boole... | .format(" isFieldAnnotationPresent [ {0} ]", isFieldAnnotationPresent)); |
1,226,366 | void resolve() throws InjectionException {<NEW_LINE>final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.entry(tc, "resolve");<NEW_LINE>Map<String, Object> props = new HashMap<String, Object>();<NEW_LINE>if (properties != null) {<NEW_LINE>int i = 0;<... | "." + i + ".name", key); |
392,501 | public static ConfigECoCheckMarkers parse(String description, double squareSize) {<NEW_LINE>// 9x7n1e3c6<NEW_LINE>int locN = -1;<NEW_LINE>int locE = -1;<NEW_LINE>int locC = -1;<NEW_LINE>for (int i = 0; i < description.length(); i++) {<NEW_LINE>switch(description.charAt(i)) {<NEW_LINE>case 'n' -><NEW_LINE>locN = i;<NEW_... | , locN).split("x"); |
583,051 | final DescribeDestinationsResult executeDescribeDestinations(DescribeDestinationsRequest describeDestinationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeDestinationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRe... | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
403,063 | public int sendTCP(Object object) {<NEW_LINE>if (object == null)<NEW_LINE>throw new IllegalArgumentException("object cannot be null.");<NEW_LINE>try {<NEW_LINE>int length = tcp.send(this, object);<NEW_LINE>if (length == 0) {<NEW_LINE>if (TRACE)<NEW_LINE><MASK><NEW_LINE>} else if (DEBUG) {<NEW_LINE>String objectString =... | trace("kryonet", this + " TCP had nothing to send."); |
791,366 | public long select(final long j) throws IllegalArgumentException {<NEW_LINE>if (!doCacheCardinalities) {<NEW_LINE>return selectNoCache(j);<NEW_LINE>}<NEW_LINE>// Ensure all cumulatives as we we have straightforward way to know in advance the high of the<NEW_LINE>// j-th value<NEW_LINE>int indexOk = ensureCumulatives(hi... | , nextBitmap.select(0)); |
1,503,432 | public AppendEntryResponse append(byte[] body) {<NEW_LINE>try {<NEW_LINE>waitOnUpdatingMetadata(1500, false);<NEW_LINE>if (leaderId == null) {<NEW_LINE>AppendEntryResponse appendEntryResponse = new AppendEntryResponse();<NEW_LINE>appendEntryResponse.setCode(<MASK><NEW_LINE>return appendEntryResponse;<NEW_LINE>}<NEW_LIN... | DLedgerResponseCode.METADATA_ERROR.getCode()); |
427,794 | /*<NEW_LINE>* Verify the signature for the CMK<NEW_LINE>*/<NEW_LINE>static void verifyColumnMasterKeyMetadata(SQLServerConnection connection, SQLServerStatement statement, String keyStoreName, String keyPath, String serverName, boolean isEnclaveEnabled, byte[] CMKSignature) throws SQLServerException {<NEW_LINE>// check... | getColumnEncryptionKeyStoreProvider(keyStoreName, connection, statement); |
1,509,480 | protected void flowThrough(AnalysisInfo in, Unit unit, AnalysisInfo outValue) {<NEW_LINE>AnalysisInfo out = new AnalysisInfo(in);<NEW_LINE>Stmt s = (Stmt) unit;<NEW_LINE>// in case of an if statement, we neet to compute the branch-flow;<NEW_LINE>// e.g. for a statement "if(x!=null) goto s" we have x==null for the fallO... | ).getOp(), NON_NULL); |
1,594,124 | private void visitGenericsTypeAnnotations(final GenericsType[] genericsTypes, final Object visitor, final String typePath, final TypeReference typeRef, final boolean typeUse) {<NEW_LINE>for (int paramIdx = 0; paramIdx < genericsTypes.length; paramIdx++) {<NEW_LINE>GenericsType gt = genericsTypes[paramIdx];<NEW_LINE><MA... | String prefix = typePath + paramIdx + ";"; |
672,149 | private void mapGtfsStopsToOtpTypes(GtfsRelationalDao data) {<NEW_LINE>StopToParentStationLinker stopToParentStationLinker = new StopToParentStationLinker(issueStore);<NEW_LINE>for (org.onebusaway.gtfs.model.Stop it : data.getAllStops()) {<NEW_LINE>if (it.getLocationType() == org.onebusaway.gtfs.model.Stop.LOCATION_TYP... | boardingArea, it.getParentStation()); |
699,622 | public BlackboardArtifact addArea(String areaName, GeoAreaPoints areaPoints, List<BlackboardAttribute> moreAttributes) throws TskCoreException, BlackboardException {<NEW_LINE>if (areaPoints == null || areaPoints.isEmpty()) {<NEW_LINE>throw new IllegalArgumentException(String.format("addArea was passed a null or empty l... | , getModuleName(), areaName)); |
1,669,821 | private void generateSubstitutionParamMembers(List<MemberFieldPair> members) {<NEW_LINE>List<CodegenSubstitutionParamEntry<MASK><NEW_LINE>LinkedHashMap<String, CodegenSubstitutionParamEntry> named = packageScope.getSubstitutionParamsByName();<NEW_LINE>if (numbered.isEmpty() && named.isEmpty()) {<NEW_LINE>return;<NEW_LI... | > numbered = packageScope.getSubstitutionParamsByNumber(); |
909,451 | public void build() {<NEW_LINE>// row<NEW_LINE>String[] protocols = { "HTTP", "HTTPS", "UDP", "DHT" };<NEW_LINE>String[] descs = { "HTTP", "HTTPS (SSL)", "UDP", "Decentralised" };<NEW_LINE>StringListParameterImpl protocol = new StringListParameterImpl(SCFG_SHARING_PROTOCOL, "ConfigView.section.sharing.protocol", protoc... | (new Parameter[0])); |
1,338,190 | private void loadNode923() {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.ServerType_ServerRedundancy_RedundancySupport, new QualifiedName(0, "RedundancySupport"), new LocalizedText("en", "RedundancySupport"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new Dat... | (1), 0.0, false); |
251,725 | private void tagNote(List<Tag> tags, Integer[] selectedTags, Note note) {<NEW_LINE>Pair<String, List<Tag>> taggingResult = TagsHelper.addTagToNote(tags, selectedTags, note);<NEW_LINE>StringBuilder sb;<NEW_LINE>if (Boolean.TRUE.equals(noteTmp.isChecklist())) {<NEW_LINE>CheckListViewItem mCheckListViewItem = mChecklistMa... | " " + taggingResult.first + " "); |
1,330,717 | protected void bindKeys() {<NEW_LINE>final InputMap inputMap = getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);<NEW_LINE>final ActionMap actionMap = getActionMap();<NEW_LINE>// Slight translation<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke("alt UP"), "UpTranslateAction");<NEW_LINE>actionMap.put("UpTranslateAction", get... | .getKeyStroke("ctrl 0"), "ZoomResetAction"); |
119,979 | public List<Object> tracedQuery(Object objectToQuery, JsonPointerIterator iterator) {<NEW_LINE>List<Object> list = new ArrayList<>();<NEW_LINE>if (isRootPointer() && !iterator.isNull(objectToQuery))<NEW_LINE>list.add(objectToQuery);<NEW_LINE>else {<NEW_LINE>Object lastValue = walkTillLastElement(objectToQuery, iterator... | getObjectParameter(lastValue, lastKey, false); |
1,153,123 | public CodecDocument openDocumentInner(String fileName, String password) {<NEW_LINE>try {<NEW_LINE>if (cacheFile.isFile()) {<NEW_LINE>LOG.d("OdtContext cache", cacheFile.getPath());<NEW_LINE>MuPdfDocument muPdfDocument = new MuPdfDocument(this, MuPdfDocument.FORMAT_PDF, cacheFile.getPath(), password);<NEW_LINE>return m... | = fileNameCache.hashCode() + ".tmp"; |
408,335 | protected void onAccountChangeMessage(String topic, String message) {<NEW_LINE>if (!open.get()) {<NEW_LINE>// take no action instead of throwing an exception to silence noisy log messages when a message is received while<NEW_LINE>// closing the AccountService.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>switch(... | info("Processing message={} for topic={}", message, topic); |
1,685,199 | public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = new String[] { "key", "value" };<NEW_LINE>String epl = "@name('create') create window MyWindowFU#firstunique(key) as MySimpleKeyValueMap;\n" + "insert into MyWindowFU select theString as key, longBoxed as value from SupportBean;\n" + "@name('s0') s... | { { "G1", 1L } }); |
246,715 | protected void resumeVm(final Message msg, Completion completion) {<NEW_LINE>refreshVO();<NEW_LINE>ErrorCode allowed = validateOperationByState(msg, self.getState(), null);<NEW_LINE>if (allowed != null) {<NEW_LINE>completion.fail(allowed);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>VmInstanceInventory <MASK><NEW_LINE>final V... | inv = VmInstanceInventory.valueOf(self); |
462,105 | protected void deleteFiles(@NonNull List<RemoteFile> remoteFiles) {<NEW_LINE>Map<String, String> commonParameters = new HashMap<>();<NEW_LINE>commonParameters.put("deviceid", <MASK><NEW_LINE>commonParameters.put("accessToken", getHelper().getAccessToken());<NEW_LINE>List<DeleteRemoteFileTask> tasks = new ArrayList<>();... | getHelper().getDeviceId()); |
971,733 | public org.mlflow.api.proto.Service.Experiment buildPartial() {<NEW_LINE>org.mlflow.api.proto.Service.Experiment result = new org.mlflow.api.proto.Service.Experiment(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((from_bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>... | bitField0_ = (bitField0_ & ~0x00000040); |
1,041,411 | protected long writeByteOffset(final byte[] bits, final int offset, long len) throws IOException {<NEW_LINE>if (len == 0)<NEW_LINE>return 0;<NEW_LINE>if (len <= free) {<NEW_LINE>return writeInCurrent(bits[offset] >>> 8 - len, (int) len);<NEW_LINE>} else {<NEW_LINE>final int shift = free;<NEW_LINE>int i, j;<NEW_LINE>wri... | 8 - shift - queue, queue); |
111,735 | public static void main(String[] args) throws Exception {<NEW_LINE>String filename = "iris.data";<NEW_LINE>URL url = new URL("https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data");<NEW_LINE>File irisText = new File(filename);<NEW_LINE>if (!irisText.exists()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>Sp... | FileUtils.copyURLToFile(url, irisText); |
283,051 | private void handleExchangeOperation(PrintWriter responseWriter, HttpServletRequest servletRequest, HttpServletResponse servletResponse) {<NEW_LINE>ExchangeData exchangeData = createExchangeData(responseWriter, servletRequest, servletResponse);<NEW_LINE>if (exchangeData == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>r... | .getExchangeTotal(toName) + " ]"); |
991,650 | protected Byte coerceToByte(Object value) {<NEW_LINE>if (value == null || "".equals(value)) {<NEW_LINE>return Byte.valueOf((byte) 0);<NEW_LINE>}<NEW_LINE>if (value instanceof Byte) {<NEW_LINE>return (Byte) value;<NEW_LINE>}<NEW_LINE>if (value instanceof Number) {<NEW_LINE>return Byte.valueOf(((Number) value).byteValue(... | ()).byteValue()); |
590,608 | public static void plotData(List<INDArray> xyVsIter, INDArray labels, double axisMin, double axisMax, int plotFrequency) {<NEW_LINE>JPanel panel = new ChartPanel(createChart(xyVsIter.get(0), labels, axisMin, axisMax));<NEW_LINE>JSlider slider = new JSlider(0, xyVsIter.size() - 1, 0);<NEW_LINE>slider.setSnapToTicks(true... | add(panel, BorderLayout.CENTER); |
1,664,566 | public void layoutContainer(Container target) {<NEW_LINE><MASK><NEW_LINE>int maxheight = target.getSize().height - (insets.top + insets.bottom + vgap * 2);<NEW_LINE>int maxwidth = target.getSize().width - (insets.left + insets.right + hgap * 2);<NEW_LINE>int nmembers = target.getComponentCount();<NEW_LINE>int x = inset... | Insets insets = target.getInsets(); |
451,174 | private static ImageData processImage(ImageData image, int size) {<NEW_LINE>size = DPIUtil.autoScaleUp(size);<NEW_LINE>if (image.width >= image.height) {<NEW_LINE>if (image.width > size) {<NEW_LINE>return image.scaledTo(size, Math.max(1, (image.height * size) / image.width));<NEW_LINE>} else if (image.width < MIN_SIZE)... | / image.height), MIN_SIZE); |
1,430,908 | protected DaemonForkOptions toDaemonForkOptions(T spec) {<NEW_LINE>MinimalJavaCompilerDaemonForkOptions javaOptions = spec.getCompileOptions().getForkOptions();<NEW_LINE>MinimalScalaCompilerDaemonForkOptions scalaOptions = spec.getScalaCompileOptions().getForkOptions();<NEW_LINE>JavaForkOptions javaForkOptions = new Ba... | String javaExecutable = javaOptions.getExecutable(); |
1,554,415 | public void importData(ColumnList source, boolean keepVisibleColumns) {<NEW_LINE>for (ColumnImpl column : myColumns) {<NEW_LINE>if (keepVisibleColumns) {<NEW_LINE>Boolean visible = myTableHeaderFacade.findColumnByID(column.getID()).isVisible();<NEW_LINE>column.getStub().setVisible(visible);<NEW_LINE>} else {<NEW_LINE>c... | getStub().setVisible(false); |
719,812 | // TODO revisit usage, eventually should be only reuse MavenProjectCache<NEW_LINE>@NonNull<NEW_LINE>public MavenProject loadMavenProject(MavenEmbedder embedder, List<String> activeProfiles, Properties properties) {<NEW_LINE>try {<NEW_LINE>MavenExecutionRequest req = embedder.createMavenExecutionRequest();<NEW_LINE>req.... | "Runtime exception thrown while loading maven project at " + getProjectDirectory(), exc); |
850,763 | public void PrintRegionData(int Label0, int Label1) {<NEW_LINE>if (Label0 < 0)<NEW_LINE>Label0 = 0;<NEW_LINE>if (Label1 > MaxLabel)<NEW_LINE>Label1 = MaxLabel;<NEW_LINE>if (Label1 < Label0)<NEW_LINE>return;<NEW_LINE>for (int Label = Label0; Label <= Label1; Label++) {<NEW_LINE>double[] Property = RegionData[Label];<NEW... | = (int) Property[BLOBLABEL]; |
933,645 | protected Object decode(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {<NEW_LINE>String sentence = (String) msg;<NEW_LINE>if (sentence.equals("AA55,HB")) {<NEW_LINE>if (channel != null) {<NEW_LINE>channel.writeAndFlush(new NetworkMessage("55AA,HB,OK\r\n", remoteAddress));<NEW_LINE>}<NEW_LIN... | parser.nextInt() * 0.001); |
1,652,357 | private NameEnvironmentAnswer findClassInternal(char[] typeName, String qualifiedPackageName, String qualifiedBinaryFileName, boolean asBinaryOnly) {<NEW_LINE>// most common case TODO(SHMOD): use module name from this.module?<NEW_LINE>if (!isPackage(qualifiedPackageName, null))<NEW_LINE>return null;<NEW_LINE>String fil... | doesFileExist(fileName + SUFFIX_STRING_java, qualifiedPackageName); |
1,093,547 | public static ListDevicesResponse unmarshall(ListDevicesResponse listDevicesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listDevicesResponse.setRequestId(_ctx.stringValue("ListDevicesResponse.RequestId"));<NEW_LINE>listDevicesResponse.setErrorCode(_ctx.integerValue("ListDevicesResponse.ErrorCode"));<NEW_LINE>listDevi... | (_ctx.stringValue("ListDevicesResponse.Message")); |
962,672 | public void propagate(InstanceState state) {<NEW_LINE>StateData oldData = (StateData) state.getData();<NEW_LINE>Value oldValue = oldData == null ? Value.NIL : oldData.curValue;<NEW_LINE>Value newValue = state.getPortValue(0);<NEW_LINE>boolean same = Objects.equals(oldValue, newValue);<NEW_LINE>if (!same) {<NEW_LINE>if ... | .getInstance().recomputeBounds(); |
673,029 | static public void inner4(GrayF32 intensity, GrayS16 derivX, GrayS16 derivY, GrayF32 output) {<NEW_LINE>final int w = intensity.width;<NEW_LINE>final int h = intensity.height - 1;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(1,h,y->{<NEW_LINE>for (int y = 1; y < h; y++) {<NEW_LINE>int indexI = intensity.startIn... | + y * derivX.stride + 1; |
505,303 | public Request<DisableVgwRoutePropagationRequest> marshall(DisableVgwRoutePropagationRequest disableVgwRoutePropagationRequest) {<NEW_LINE>if (disableVgwRoutePropagationRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<DisableVgwRoutePropag... | <DisableVgwRoutePropagationRequest>(disableVgwRoutePropagationRequest, "AmazonEC2"); |
387,827 | public Object compute(Object[] args, ExecutionContext ec) {<NEW_LINE>for (Object arg : args) {<NEW_LINE>if (FunctionUtils.isNull(arg)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// parse datetime<NEW_LINE>Object timeObj = args[0];<NEW_LINE>MysqlDateTime t = DataTypeUtil.toMySQLDatetimeByFlags(timeObj, <MASK... | Types.TIMESTAMP, TimeParserFlags.FLAG_TIME_NO_ZERO_DATE); |
860,246 | public static List<GCList> searchBookmarkLists() {<NEW_LINE>final Parameters params = new Parameters();<NEW_LINE>params.add("skip", "0");<NEW_LINE>params.add("take", "100");<NEW_LINE>params.add("type", "bm");<NEW_LINE>final String page = GCLogin.getInstance().getRequestLogged("https://www.geocaching.com/api/proxy/web/v... | Log.e("GCParser.searchBookmarkLists: error parsing html page", e); |
591,307 | private void invalidatePartitionCache(String databaseName, String tableName) {<NEW_LINE>HiveTableName hiveTableName = hiveTableName(databaseName, tableName);<NEW_LINE>partitionNamesCache.asMap().keySet().stream().filter(hiveTableNameKey -> hiveTableNameKey.getKey().equals(hiveTableName)).forEach(partitionNamesCache::in... | ).forEach(partitionCache::invalidate); |
1,101,193 | public static void deserializeVector(ByteBuf buf, LongDoubleVector vector) {<NEW_LINE>int elemNum = buf.readInt();<NEW_LINE>StorageMethod method = getStorageMethod(vector);<NEW_LINE>SerializeArrangement arrangement = SerializeArrangement.valuesOf(buf.readInt());<NEW_LINE>if (arrangement == SerializeArrangement.KEY_VALU... | i] = buf.readDouble(); |
412,850 | private String convertDescriptionList(DescriptionList node) {<NEW_LINE>logger.debug("convertDescriptionList");<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>appendTitle(node, sb);<NEW_LINE>String style = Optional.ofNullable(node.getStyle()).orElse("");<NEW_LINE>switch(style) {<NEW_LINE>case STYLE_HORIZONTAL... | getLevel(), true))); |
1,482,843 | public boolean markPresent(Map<Integer, Set<String>> paths, Instant lastScanned) {<NEW_LINE>if (!paths.isEmpty()) {<NEW_LINE>return paths.entrySet().parallelStream().map(e -> {<NEW_LINE>int batches = (e.getValue().<MASK><NEW_LINE>List<String> pList = new ArrayList<>(e.getValue());<NEW_LINE>return IntStream.rangeClosed(... | size() - 1) / 30000; |
1,281,725 | public Suggestion<T> reduce(List<Suggestion<T>> toReduce) {<NEW_LINE>if (toReduce.size() == 1) {<NEW_LINE>return toReduce.get(0);<NEW_LINE>} else if (toReduce.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Suggestion<T> leader = toReduce.get(0);<NEW_LINE>List<T> entries = leader.entries;<NEW_LINE>final int size... | currentEntries = new ArrayList<>(); |
1,168,383 | static Map<String, Object> parseFirebaseUser(FirebaseUser firebaseUser) {<NEW_LINE>if (firebaseUser == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Map<String, Object> output = new HashMap<>();<NEW_LINE>Map<String, Object> <MASK><NEW_LINE>output.put(Constants.DISPLAY_NAME, firebaseUser.getDisplayName());<NEW_LINE>... | metadata = new HashMap<>(); |
1,137,238 | private void writeModelAndElements(File file) throws IOException {<NEW_LINE>Writer writer = createOutputStreamWriter(file);<NEW_LINE>// Write BOM<NEW_LINE>writeBOM(writer);<NEW_LINE>// Write Header<NEW_LINE>String header = createHeader(MODEL_ELEMENTS_HEADER);<NEW_LINE>writer.write(header);<NEW_LINE>// CRLF<NEW_LINE>wri... | .getFolder(FolderType.APPLICATION)); |
792,560 | public HttpServiceResponse handle(HttpServiceRequest request) throws Exception {<NEW_LINE>HttpServiceResponse response = new HttpServiceResponse();<NEW_LINE>if (HttpServer.Method.PUT == request.getMethod()) {<NEW_LINE>bookieServer.getBookie().getLedgerStorage().forceGC();<NEW_LINE>String output = "Triggered GC on Booki... | LOG.debug("output body:" + jsonResponse); |
1,509,724 | public Set<JwkDefinition> convert(InputStream jwkSetSource) {<NEW_LINE>Set<JwkDefinition> jwkDefinitions;<NEW_LINE>JsonParser parser = null;<NEW_LINE>try {<NEW_LINE>parser = this.factory.createParser(jwkSetSource);<NEW_LINE>if (parser.nextToken() != JsonToken.START_OBJECT) {<NEW_LINE>throw new JwkException("Invalid JWK... | = new LinkedHashSet<JwkDefinition>(); |
1,140,410 | public com.amazonaws.services.cloudsearchdomain.model.SearchException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.cloudsearchdomain.model.SearchException searchException = new com.amazonaws.services.cloudsearchdomain.model.SearchException(null);<NEW_LINE>int... | String currentParentElement = context.getCurrentParentElement(); |
1,527,545 | public com.amazonaws.services.datasync.model.InvalidRequestException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.datasync.model.InvalidRequestException invalidRequestException = new com.amazonaws.services.<MASK><NEW_LINE>int originalDepth = context.getCurren... | datasync.model.InvalidRequestException(null); |
1,516,988 | public static <S> TreeNode<S> lowestCommonAncestor(TreeNode<S> node1, TreeNode<S> node2) throws NodesNotInSameTreeException {<NEW_LINE>if (node1 == node2)<NEW_LINE>return node1;<NEW_LINE>else if (node1.depth < node2.depth)<NEW_LINE>return lowestCommonAncestor(node2, node1);<NEW_LINE>else if (node1.depth > node2.depth) ... | node1.ancestors.get(step); |
1,488,934 | public void updated(Provider<E> provider, E oldElement, E element) {<NEW_LINE>final <MASK><NEW_LINE>final K uid = element.getUID();<NEW_LINE>if (!uidOld.equals(uid)) {<NEW_LINE>logger.warn("Received update event for elements that UID differ (old: \"{}\", new: \"{}\"). Ignore event.", uidOld, uid);<NEW_LINE>return;<NEW_... | K uidOld = oldElement.getUID(); |
1,227,325 | /*<NEW_LINE>* @see<NEW_LINE>* com.sitewhere.connectors.FilteredOutboundConnector#start(com.sitewhere.spi.<NEW_LINE>* server.lifecycle.ILifecycleProgressMonitor)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void start(ILifecycleProgressMonitor monitor) throws SiteWhereException {<NEW_LINE>// Required for filters.<NEW_... | .getSolrClient().ping(); |
1,483,278 | private JMenu createSettingsMenu() {<NEW_LINE>JMenu settingsMenu = new JMenu();<NEW_LINE>settingsMenu.setName("settingsMenu");<NEW_LINE>settingsMenu.add(new JLabel("Device"));<NEW_LINE>deviceMenuItems = addRadioButtonMenuItems(settingsMenu, new String[] <MASK><NEW_LINE>settingsMenu.addSeparator();<NEW_LINE>settingsMenu... | { "selectTerminalDevice", "selectPrinterDevice", "selectFileDevice" }); |
1,761,215 | private void createText(Composite container) {<NEW_LINE>StyledText text = new StyledText(container, SWT.MULTI | SWT.WRAP | SWT.READ_ONLY | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);<NEW_LINE>List<StyleRange> ranges = new ArrayList<>();<NEW_LINE>StringBuilder buffer = new StringBuilder();<NEW_LINE>if (newVersion.require... | setText(buffer.toString()); |
1,358,946 | private int forwardMedia(data.media.Media media, FlatBufferBuilder fbb) {<NEW_LINE>int uri = fbb.createString(media.uri);<NEW_LINE>int title = media.title != null ? fbb.<MASK><NEW_LINE>int format = fbb.createString(media.format);<NEW_LINE>int[] persons = new int[media.persons.size()];<NEW_LINE>for (int i = 0; i < media... | createString(media.title) : 0; |
237,337 | private void createVerificationRunLine(@NonNull final InvoiceVerificationRunId runId, @NonNull final InvoiceVerificationRunResult runResult) {<NEW_LINE>final Tax invoiceTax = runResult.getInvoiceTax();<NEW_LINE>final Tax resultingTax = runResult.getResultingTax();<NEW_LINE>final boolean noTaxFound = resultingTax == nul... | resultingTax.getRate()) == 0; |
1,696,527 | private static Document createPatternXMLDoc(List<SsurgeonPattern> patterns) {<NEW_LINE>try {<NEW_LINE>DocumentBuilderFactory dbf = XMLUtils.safeDocumentBuilderFactory();<NEW_LINE>DocumentBuilder db = dbf.newDocumentBuilder();<NEW_LINE>Document domDoc = db.newDocument();<NEW_LINE>Element rootElt = domDoc.createElement(S... | domDoc.createElement(SsurgeonPattern.SSURGEON_ELEM_TAG); |
1,845,560 | private void processSetting(Map<String, Object> map, String prefix, String setting, Object value) {<NEW_LINE>int <MASK><NEW_LINE>if (prefixLength == -1) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Map<String, Object> innerMap = (Map<String, Object>) map.get(prefix + setting);<NEW_LINE>if (innerMap != null) {<NEW... | prefixLength = setting.indexOf('.'); |
605,003 | final DeleteIdentityProviderResult executeDeleteIdentityProvider(DeleteIdentityProviderRequest deleteIdentityProviderRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteIdentityProviderRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_... | addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteIdentityProvider"); |
145,542 | public synchronized void treeExpanded(final TreeExpansionEvent event) {<NEW_LINE>final Node eventNode = Visualizer.findNode(event.<MASK><NEW_LINE>if (eventNode instanceof TableFilterNode) {<NEW_LINE>final TableFilterNode tableFilterNode = (TableFilterNode) eventNode;<NEW_LINE>final DataResultFilterNode dataResultFilter... | getPath().getLastPathComponent()); |
568,525 | final GetVpcLinksResult executeGetVpcLinks(GetVpcLinksRequest getVpcLinksRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getVpcLinksRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTi... | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
838,380 | private static Request prepareDeleteByQueryRequest(DeleteByQueryRequest deleteByQueryRequest, boolean waitForCompletion) throws IOException {<NEW_LINE>String endpoint = endpoint(deleteByQueryRequest.indices(), "_delete_by_query");<NEW_LINE>Request request = new Request(HttpPost.METHOD_NAME, endpoint);<NEW_LINE>Params p... | withIndicesOptions(deleteByQueryRequest.indicesOptions()); |
748,620 | private Function<Signal<AccessToken>, Mono<? extends AccessToken>> processTokenRefreshResult(Sinks.One<AccessToken> sinksOne, OffsetDateTime now, Mono<AccessToken> fallback) {<NEW_LINE>return signal -> {<NEW_LINE>AccessToken accessToken = signal.get();<NEW_LINE>Throwable error = signal.getThrowable();<NEW_LINE>if (sign... | (cache, now, "Acquired a new access token")); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.