idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
652,173 | public Optional<BinaryOperationExpression> convertToSQLSegment(final SqlBasicCall sqlBasicCall) {<NEW_LINE>ExpressionConverter expressionConverter = new ExpressionConverter();<NEW_LINE>ExpressionSegment left = expressionConverter.convertToSQLSegment(sqlBasicCall.getOperandList().get(0)).orElseThrow(IllegalStateExceptio... | , right, operator, text)); |
981,027 | public int[][] test(DataFrame data) {<NEW_LINE>DataFrame x = formula.x(data);<NEW_LINE>int n = x.nrow();<NEW_LINE>int ntrees = trees != null ? trees.length : forest[0].length;<NEW_LINE>int[][] prediction = new int[ntrees][n];<NEW_LINE>if (k == 2) {<NEW_LINE>for (int j = 0; j < n; j++) {<NEW_LINE>Tuple <MASK><NEW_LINE>d... | xj = x.get(j); |
85,398 | private // LIDB2018-1<NEW_LINE>void // LIDB2018-1<NEW_LINE>initialize(// LIDB2018-1<NEW_LINE>EJSContainer container, // LIDB2018-1<NEW_LINE>EJBCache cache, // LIDB2018-1<NEW_LINE>PassivationPolicy passivationPolicy, // LIDB2018-1<NEW_LINE>StatefulPassivator passivator, SfFailoverCache failoverCache) {<NEW_LINE>if (Trac... | EJBRuntime runtime = container.getEJBRuntime(); |
1,449,127 | public Expression evalFieldCall(ClassField field, Expression arg) {<NEW_LINE>if (arg instanceof FunCallExpression && ((FunCallExpression) arg).getDefinition().getResultType() instanceof ClassCallExpression) {<NEW_LINE>FunCallExpression funCall = (FunCallExpression) arg;<NEW_LINE>ClassCallExpression classCall = (ClassCa... | (funCall.getLevelSubstitution())); |
68,554 | private static void addMagic(SName sname) {<NEW_LINE>final String cleanName = sname.name(<MASK><NEW_LINE>addConvert(cleanName + "BackgroundColor", PName.BackGroundColor, sname);<NEW_LINE>addConvert(cleanName + "BorderColor", PName.LineColor, sname);<NEW_LINE>addConvert(cleanName + "BorderThickness", PName.LineThickness... | ).replace("_", ""); |
1,190,618 | public static ListContactFlowsResponse unmarshall(ListContactFlowsResponse listContactFlowsResponse, UnmarshallerContext context) {<NEW_LINE>listContactFlowsResponse.setRequestId(context.stringValue("ListContactFlowsResponse.RequestId"));<NEW_LINE>listContactFlowsResponse.setSuccess(context.booleanValue("ListContactFlo... | (context.stringValue("ListContactFlowsResponse.Code")); |
1,124,269 | protected void uploadGlyphs(XRGlyphCacheEntry[] glyphs, ArrayList<XRGlyphCacheEntry> uncachedGlyphs, GlyphList gl, int parentXid) {<NEW_LINE>for (XRGlyphCacheEntry glyph : uncachedGlyphs) {<NEW_LINE>cachedPixels += glyph.getPixelCnt();<NEW_LINE>}<NEW_LINE>if (cachedPixels > MAX_CACHED_PIXELS) {<NEW_LINE>clearCache(glyp... | >> glyphListsByType = separateGlyphTypes(uncachedGlyphs); |
1,680,272 | private static void pushPrimitiveCastIfRequired(MethodVisitor methodVisitor, String internalName, Type primitiveType) {<NEW_LINE>if (primitiveType != null) {<NEW_LINE>Method valueMethod = null;<NEW_LINE>switch(primitiveType.getSort()) {<NEW_LINE>case Type.BOOLEAN:<NEW_LINE>valueMethod = Method.getMethod("boolean boolea... | valueMethod = Method.getMethod("byte byteValue()"); |
268,776 | // endregion<NEW_LINE>// region DocumentOperations<NEW_LINE>@Override<NEW_LINE>public <T> Flux<T> saveAll(Mono<? extends Collection<? extends T>> entitiesPublisher, IndexCoordinates index) {<NEW_LINE>Assert.notNull(entitiesPublisher, "entitiesPublisher must not be null!");<NEW_LINE>return //<NEW_LINE>entitiesPublisher.... | , response.getVersion())); |
1,777,591 | public void accept(TraceVisitor traceVisitor) throws Exception {<NEW_LINE>// timings for traces that are still active are normalized to the capture tick in order<NEW_LINE>// to *attempt* to present a picture of the trace at that exact tick<NEW_LINE>// (without using synchronization to block updates to the trace while i... | transaction.visitEntries(captureTick, entryVisitorWrapper); |
1,019,687 | private static boolean hasJavaRuntime(ImageReference imageReference) {<NEW_LINE>if (null == imageReference || null == imageReference.image) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Iterator<?> spaces <MASK><NEW_LINE>while ((null != spaces) && spaces.hasNext()) {<NEW_LINE>// search address spaces<NEW_LINE>Object obj... | = imageReference.image.getAddressSpaces(); |
1,187,163 | public static void renderVolume(ImageByte4 output, VolumeShort2 volume, Float3 volumeDims, Matrix4x4Float view, float nearPlane, float farPlane, float smallStep, float largeStep, Float3 light, Float3 ambient) {<NEW_LINE>for (@Parallel int y = 0; y < output.Y(); y++) {<NEW_LINE>for (@Parallel int x = 0; x < output.X(); ... | (normalizedSurfNorm, diff), 0f); |
297,663 | protected TypeBinding internalResolveType(Scope scope, int location) {<NEW_LINE>// handle the error here<NEW_LINE>this.constant = Constant.NotAConstant;<NEW_LINE>checkYieldUsage(scope);<NEW_LINE>if (this.resolvedType != null) {<NEW_LINE>// is a shared type reference which was already resolved<NEW_LINE>if (this.resolved... | this.resolvedType = getTypeBinding(scope); |
217,836 | public void run(String command, String[] args, Context context, PrintStream out) throws DDRInteractiveCommandException {<NEW_LINE>String subcommand;<NEW_LINE>if (command.equals("!markmap")) {<NEW_LINE>if (args.length < 1) {<NEW_LINE>out.println("No command specified");<NEW_LINE>printHelp(out);<NEW_LINE>return;<NEW_LINE... | markBits(args, context, out); |
826,885 | public void openAdvancedDevices(long handleToDownload, boolean highPriority) {<NEW_LINE>logDebug("openAdvancedDevices");<NEW_LINE>String externalPath = getExternalCardPath();<NEW_LINE>if (externalPath != null) {<NEW_LINE>logDebug("ExternalPath for advancedDevices: " + externalPath);<NEW_LINE>MegaNode node = megaApi.get... | intent.addCategory(Intent.CATEGORY_OPENABLE); |
1,348,089 | // Used by DatumReader. Applications should not call.<NEW_LINE>@SuppressWarnings(value = "unchecked")<NEW_LINE>public void put(int field$, java.lang.Object value$) {<NEW_LINE>switch(field$) {<NEW_LINE>case 0:<NEW_LINE>ownerId = (java.lang.Integer) value$;<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>timestampLastResetMs ... | (java.lang.Long) value$; |
539,209 | protected MethodNode checkGroovyStyleConstructor(final ClassNode node, final ClassNode[] arguments, final ASTNode source) {<NEW_LINE>if (node.equals(OBJECT_TYPE) || node.equals(DYNAMIC_TYPE)) {<NEW_LINE>// in that case, we are facing a list constructor assigned to a def or object<NEW_LINE>return null;<NEW_LINE>}<NEW_LI... | > constructors = node.getDeclaredConstructors(); |
1,166,819 | protected void handleDoubleClick(DoubleClickEvent anEvent) {<NEW_LINE>super.handleDoubleClick(anEvent);<NEW_LINE>// open the model<NEW_LINE>if (anEvent.getSelection() instanceof IStructuredSelection) {<NEW_LINE>IStructuredSelection iss = (IStructuredSelection) anEvent.getSelection();<NEW_LINE>Object firstElement = iss.... | ) firstElement).getModuleName()); |
464,734 | public static void vertical3(Kernel1D_S32 kernel, GrayS32 src, GrayS32 dst, int divisor, @Nullable GrowArray<DogArray_I32> workspaces) {<NEW_LINE>final int[] dataSrc = src.data;<NEW_LINE>final int[] dataDst = dst.data;<NEW_LINE>final int k1 = kernel.data[0];<NEW_LINE>final int k2 = kernel.data[1];<NEW_LINE>final int k3... | (dataSrc[indexSrc]) * k2; |
872,175 | public List<Artifact> findAdditionalInputs(CppCompileAction action, ActionExecutionContext actionExecutionContext, IncludeScanningHeaderData includeScanningHeaderData) throws ExecException, InterruptedException {<NEW_LINE>Preconditions.checkNotNull(includeScannerSupplier, action);<NEW_LINE>Set<Artifact> includes = Sets... | > quoteIncludeDirs = action.getQuoteIncludeDirs(); |
1,591,345 | public void marshall(WeeklyAutoScalingSchedule weeklyAutoScalingSchedule, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (weeklyAutoScalingSchedule == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(weeklyAut... | weeklyAutoScalingSchedule.getFriday(), FRIDAY_BINDING); |
1,043,208 | public static List<String> listByRegex(String directory, String regex) {<NEW_LINE>List<String> ret = new ArrayList<>();<NEW_LINE>File d = new File(directory);<NEW_LINE>if (!d.isDirectory()) {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>if (url.getProtocol().equals("file")) {<NEW_LINE>d = new File(url.getFile());<NEW_LINE>}... | URL url = new URL(directory); |
1,088,771 | public void mergeTrackable(final Trackable newTrackable) {<NEW_LINE>guid = StringUtils.defaultIfEmpty(newTrackable.guid, guid);<NEW_LINE>geocode = StringUtils.defaultIfEmpty(newTrackable.geocode, geocode);<NEW_LINE>iconUrl = StringUtils.defaultIfEmpty(newTrackable.iconUrl, iconUrl);<NEW_LINE>name = StringUtils.defaultI... | defaultIfNull(newTrackable.goal, goal); |
1,380,065 | public void restoreAuthSystemState() {<NEW_LINE>Boolean previousState;<NEW_LINE>try {<NEW_LINE>previousState = authStateChangeHistory.pop();<NEW_LINE>} catch (NoSuchElementException ex) {<NEW_LINE>log.warn(LogHelper.getHeader(this, "restore_auth_sys_state", "not previous state info available: {}"), ex::getLocalizedMes... | length - 1].getClassName(); |
247,586 | private RexNode buildJoinCondition(RelNode convertedLeft, RelNode convertedRight, List<Integer> leftKeys, List<Integer> rightKeys, List<Boolean> filterNulls, RexBuilder builder) {<NEW_LINE>List<RexNode> equijoinList = Lists.newArrayList();<NEW_LINE>final int numLeftFields = convertedLeft.getRowType().getFieldCount();<N... | rightKeyOrdinal = rightKeys.get(i); |
1,528,197 | public void onBindViewHolder(ViewHolder holder, int position) {<NEW_LINE>if (holder.isFoot()) {<NEW_LINE>holder.count = getItemCount();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (holder.isHeader()) {<NEW_LINE>if (userData.isNewHeaderValid()) {<NEW_LINE>Size size = userData.getHeaderSize(position);<NEW_LINE><MASK><NEW_LIN... | View cellView = holder.getCellView(); |
1,614,116 | public void invoke(@NotNull String line, @NotNull Repl api, @NotNull Supplier<@NotNull String> scanner) throws QuitReplException {<NEW_LINE>Concrete.Expression expr = api.preprocessExpr(line);<NEW_LINE>if (api.checkErrors() || expr == null)<NEW_LINE>return;<NEW_LINE>if (expr instanceof Concrete.ReferenceExpression && (... | .getSize(result.expression)); |
339,474 | public void visit(BLangFail failNode, AnalyzerData data) {<NEW_LINE>data.failVisited = true;<NEW_LINE>analyzeExpr(failNode.expr, data);<NEW_LINE>if (data.env.scope.owner.getKind() == SymbolKind.PACKAGE) {<NEW_LINE>// Check at module level.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>typeChecker.checkExpr(<MASK><NEW_LINE>if (!... | failNode.expr, data.env); |
13,339 | public void run() {<NEW_LINE>try {<NEW_LINE>Thread.sleep(10);<NEW_LINE>} catch (InterruptedException e1) {<NEW_LINE>}<NEW_LINE>// Utils.platformLog("@@@@ ZebraPrinterBluetoothConnect Address :", mAdress);<NEW_LINE>BluetoothConnection connection = new BluetoothConnection(mAdress);<NEW_LINE>String zAdr = connection.toStr... | TcpConnection) c).getAddress(); |
1,767,022 | private void copyResourceFiles(String oldTenantCode, String newTenantCode, ResourceComponent resourceComponent, String srcBasePath, String dstBasePath) {<NEW_LINE>List<ResourceComponent> components = resourceComponent.getChildren();<NEW_LINE>try {<NEW_LINE>if (CollectionUtils.isNotEmpty(components)) {<NEW_LINE>for (Res... | newTenantCode, component, srcBasePath, dstBasePath); |
51,853 | public boolean onTouch(View view, MotionEvent motionEvent) {<NEW_LINE>int pointerIndex = motionEvent.getActionIndex();<NEW_LINE>int <MASK><NEW_LINE>FingerPosition position;<NEW_LINE>switch(motionEvent.getActionMasked()) {<NEW_LINE>case MotionEvent.ACTION_DOWN:<NEW_LINE>// Paranoia mode, if it's the first finger down ma... | pointerId = motionEvent.getPointerId(pointerIndex); |
736,432 | private void reflowTableLayout(com.codename1.ui.Container parent) {<NEW_LINE>// we need to re-add all the components to the table layout since order only<NEW_LINE>// affects the layout initially<NEW_LINE>if (parent.getLayout() instanceof com.codename1.ui.table.TableLayout) {<NEW_LINE>List<com.codename1.ui.Component> cm... | , cmpList.get(iter)); |
1,135,271 | public static DescribeGatewayNFSClientsResponse unmarshall(DescribeGatewayNFSClientsResponse describeGatewayNFSClientsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeGatewayNFSClientsResponse.setRequestId(_ctx.stringValue("DescribeGatewayNFSClientsResponse.RequestId"));<NEW_LINE>describeGatewayNFSClientsResponse... | (_ctx.integerValue("DescribeGatewayNFSClientsResponse.TotalCount")); |
1,338,495 | public void actionPerformed(ActionEvent evt) {<NEW_LINE>String err = "";<NEW_LINE>try {<NEW_LINE>if (controller != null) {<NEW_LINE>setStatus("");<NEW_LINE><MASK><NEW_LINE>if (source == clearButton) {<NEW_LINE>// additionally clear the text area<NEW_LINE>err = "when clearing the views ";<NEW_LINE>messageLogger.clear();... | Object source = evt.getSource(); |
1,768,139 | private void lookupTabletLocation(ClientContext context, Text row, boolean retry, LockCheckerSession lcSession) throws AccumuloException, AccumuloSecurityException, TableNotFoundException {<NEW_LINE>Text metadataRow = new Text(tableId.canonical());<NEW_LINE>metadataRow.append(new byte[] <MASK><NEW_LINE>metadataRow.appe... | { ';' }, 0, 1); |
1,716,416 | public DescribeVoicesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeVoicesResult describeVoicesResult = new DescribeVoicesResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targe... | class).unmarshall(context)); |
1,786,186 | private void updateMultiselectMenu() {<NEW_LINE>Timber.d("updateMultiselectMenu()");<NEW_LINE>if (mActionBarMenu == null || mActionBarMenu.findItem(R.id.action_suspend_card) == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!mCheckedCards.isEmpty()) {<NEW_LINE>TaskManager.cancelAllTasks(CollectionTask.CheckCardSelect... | .setVisible(!hasSelectedAllCards()); |
1,569,880 | public GuardingNode createGuard(FixedNode before, LogicNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action, Speculation speculation, boolean negated, NodeSourcePosition noDeoptSucccessorPosition) {<NEW_LINE>StructuredGraph graph = before.graph();<NEW_LINE>if (OptEliminateGuards.getValue(graph.... | GuardingNode result = handle.getGuard(); |
1,772,872 | public AlarmNotification unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AlarmNotification alarmNotification = new AlarmNotification();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurr... | String currentParentElement = context.getCurrentParentElement(); |
1,262,017 | public void run(Objectify datastore) throws ObjectifyException {<NEW_LINE>UserData userData = null;<NEW_LINE>if (user.getId() != null) {<NEW_LINE>userData = datastore.find(userKey(user.getId()));<NEW_LINE>}<NEW_LINE>if (userData != null) {<NEW_LINE>userData.email = user.getEmail();<NEW_LINE>userData.emaillower = userDa... | .isAdmin = user.getIsAdmin(); |
710,204 | public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {<NEW_LINE>final StringBounder stringBounder = ug.getStringBounder();<NEW_LINE>final FtileGeometry geo = getFtile1().calculateDimension(stringBounder);<NEW_LINE>if (geo.hasPointOut() == false) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>fin... | ) - 1.5 * Hexagon.hexagonHalfSize); |
392,384 | private static int[] createSorted16BitInts(int howMany) {<NEW_LINE>long[<MASK><NEW_LINE>Arrays.fill(bitset, 0L);<NEW_LINE>int consumed = 0;<NEW_LINE>while (consumed < howMany) {<NEW_LINE>int value = RANDOM.nextInt(1 << 16);<NEW_LINE>long bit = (1L << value);<NEW_LINE>consumed += 1 - Long.bitCount(bitset[value >>> 6] & ... | ] bitset = bits.get(); |
1,558,181 | private MethodInvocation injectLogMethod(MethodInvocation node) {<NEW_LINE>ExecutableElement method = node.getExecutableElement();<NEW_LINE>TypeElement cls = ElementUtil.getDeclaringClass(method);<NEW_LINE>List<Expression> args = node.getArguments();<NEW_LINE>if (!args.isEmpty() && typeUtil.isSameType(args.get(0).getTy... | (arg.getTypeMirror())); |
1,192,970 | public String readReleaseInfo() {<NEW_LINE>try {<NEW_LINE>final String key = "PRETTY_NAME";<NEW_LINE>// available for all distributions<NEW_LINE>final String releaseInfo = "/etc/os-release";<NEW_LINE>final ProcessOutput output = <MASK><NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>LOG.debug("Reading release info: " + get... | executeOnWsl(10000, "cat", releaseInfo); |
1,057,836 | protected void createTitleArea(Composite parent) {<NEW_LINE>((GridData) parent.getLayoutData()).heightHint = TITLE_HEIGHT;<NEW_LINE>Label titleImageLabel = new Label(parent, SWT.NONE);<NEW_LINE>titleImageLabel.setImage(getPopupShellImage(TITLE_HEIGHT));<NEW_LINE>Label titleTextLabel = new Label(parent, SWT.NONE);<NEW_L... | .CENTER, true, true)); |
1,291,987 | public int detectIndentationLevel(IDocument document, int offset, boolean isSelection, IFormattingContext formattingContext) {<NEW_LINE>int indent = 0;<NEW_LINE>try {<NEW_LINE>// detect the indentation offset with the parser, only if the given offset is not the first one in the<NEW_LINE>// current partition.<NEW_LINE>I... | root.accept(context, detector); |
898,017 | public void init(boolean install) throws DesktopInitialisationException {<NEW_LINE>// Registers KDE specific commands.<NEW_LINE>try {<NEW_LINE>CommandManager.registerDefaultCommand(new Command(CommandManager.FILE_OPENER_ALIAS, FILE_OPENER, CommandType.SYSTEM_COMMAND, null));<NEW_LINE>CommandManager.registerDefaultComma... | , CommandType.SYSTEM_COMMAND, null)); |
814,145 | private void sortedMerge(List<Integer> result, int start, int end, int[] sum) {<NEW_LINE>int mid = (start + end) / 2;<NEW_LINE>int i = sum[start];<NEW_LINE>int j = sum[mid + 1];<NEW_LINE>List<Integer> temp = new ArrayList<Integer>();<NEW_LINE>while (i < sum[mid + 1] && j < sum[end + 1]) {<NEW_LINE>if (result.get(i) < r... | (result.get(j)); |
843,303 | protected void updateMesh() {<NEW_LINE>Vector3f a = rectangle.getA();<NEW_LINE><MASK><NEW_LINE>Vector3f c = rectangle.getC();<NEW_LINE>Vector3f d = rectangle.calculateD();<NEW_LINE>setBuffer(Type.Position, 3, new float[] { a.x, a.y, a.z, b.x, b.y, b.z, d.x, d.y, d.z, c.x, c.y, c.z });<NEW_LINE>setBuffer(Type.TexCoord, ... | Vector3f b = rectangle.getB(); |
1,009,530 | final ListLicenseConfigurationsResult executeListLicenseConfigurations(ListLicenseConfigurationsRequest listLicenseConfigurationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listLicenseConfigurationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequest... | addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListLicenseConfigurations"); |
1,204,400 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>try {<NEW_LINE>String BASE_URL = request.getParameter("baseurl");<NEW_LINE>if (BASE_URL == null || BASE_URL.equals(""))<NEW_LINE>BASE_URL = "http://localhost:8010";<NEW_LINE>Hello proxy;<NEW_LI... | e.toString() + "</body></html>"); |
709,061 | public static String format(Locale locale, String pattern, Object[] arguments, boolean translateArguments) throws LanguageException {<NEW_LINE>String value = null;<NEW_LINE>User fakeUser = new User();<NEW_LINE>fakeUser.setLocale(locale);<NEW_LINE>String pattern2 = get(fakeUser, pattern);<NEW_LINE>if (!pattern.equals(pa... | MessageFormat.format(pattern, formattedArguments); |
715,196 | private List<FileMetadata> loadFileMetadataTabList() {<NEW_LINE>List<DataFile> allfiles = allRelatedFiles();<NEW_LINE>List<FileMetadata> retList = new ArrayList<>();<NEW_LINE>for (DatasetVersion versionLoop : fileMetadata.getDatasetVersion().getDataset().getVersions()) {<NEW_LINE>boolean foundFmd = false;<NEW_LINE>if (... | (fmd, getPreviousFileMetadata(fmd)); |
1,732,292 | protected void index(Iterable<? extends Indexable> files, Context context) {<NEW_LINE>// NOI18N<NEW_LINE>LOGGER.log(Level.FINE, <MASK><NEW_LINE>if (context.getRoot() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<URL> toRescan = new ArrayList<>();<NEW_LINE>for (Indexable i : files) {<NEW_LINE>URL indexableURL = i... | "JsfCustomIndexer: indexing {0}", context.getRoot()); |
937,221 | public Optional<String> toImageBlock(Image image) {<NEW_LINE>Path currentPath = directoryService.currentParentOrWorkdir();<NEW_LINE>IOHelper.createDirectories(currentPath.resolve("images"));<NEW_LINE>List<String> buffer = new LinkedList<>();<NEW_LINE>DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(asc... | error("Problem occured while saving clipboard image {}", targetImage, e); |
1,555,088 | final ListUnsupportedAppVersionResourcesResult executeListUnsupportedAppVersionResources(ListUnsupportedAppVersionResourcesRequest listUnsupportedAppVersionResourcesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listUnsupportedAppVersionResourcesRequest);<NEW_LINE>AWSRequestMetrics awsRe... | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
1,005,261 | public static ClusterRerouteRequest createRequest(RestRequest request) throws IOException {<NEW_LINE>ClusterRerouteRequest clusterRerouteRequest = Requests.clusterRerouteRequest();<NEW_LINE>clusterRerouteRequest.dryRun(request.paramAsBoolean("dry_run", clusterRerouteRequest.dryRun()));<NEW_LINE>clusterRerouteRequest.ex... | , clusterRerouteRequest.isRetryFailed())); |
287,306 | final DeleteAuthorizerResult executeDeleteAuthorizer(DeleteAuthorizerRequest deleteAuthorizerRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteAuthorizerRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<D... | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
361,555 | final AssociateThirdPartyFirewallResult executeAssociateThirdPartyFirewall(AssociateThirdPartyFirewallRequest associateThirdPartyFirewallRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(associateThirdPartyFirewallRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.get... | (super.beforeMarshalling(associateThirdPartyFirewallRequest)); |
944,730 | public void handleMapStoreConfig(Node node, BeanDefinitionBuilder mapConfigBuilder) {<NEW_LINE>BeanDefinitionBuilder mapStoreConfigBuilder = createBeanBuilder(MapStoreConfig.class);<NEW_LINE>AbstractBeanDefinition beanDefinition = mapStoreConfigBuilder.getBeanDefinition();<NEW_LINE>for (Node child : childElements(node)... | mapConfigBuilder.addPropertyValue("mapStoreConfig", beanDefinition); |
31,842 | public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>Map<String, String> map = getURIParams();<NEW_LINE>String cmd = map.get("cmd");<NEW_LINE>java.lang.reflect.Method meth = null;<NEW_LINE>Class[] partypes = new Class[] { HttpServletRequest.class,... | Object[] { request, response }; |
190,689 | final GetStoredQueryResult executeGetStoredQuery(GetStoredQueryRequest getStoredQueryRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getStoredQueryRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.... | addHandlerContext(HandlerContextKey.SERVICE_ID, "Config Service"); |
375,983 | protected ImmutableTupleN calculateCacheKey() {<NEW_LINE>int length = fSource.length();<NEW_LINE>if (length < 11) {<NEW_LINE>// If it's a small string, just keep it instead of using the hashCode().<NEW_LINE>return new ImmutableTupleN(length, fSource, fStartingOffset);<NEW_LINE>} else {<NEW_LINE>// Note: we currently us... | int) (2 * factor)); |
539,396 | public Object doit() {<NEW_LINE>Object targetClass = "java.lang.String";<NEW_LINE>Class c = null;<NEW_LINE>try {<NEW_LINE>// Allow the class to be specified as a String instead of<NEW_LINE>// passed-in as a java.lang.Class object.<NEW_LINE>if (targetClass instanceof String)<NEW_LINE>c = Class.forName((String) targetCla... | RuntimeException("Cannot create " + targetClass, cnfe); |
1,631,240 | private DataType resolveBitFieldDataType(BitFieldDataType bitFieldDataType, DataTypeConflictHandler handler) {<NEW_LINE>// NOTE: When a bit-field is getting added it will get resolved more than once.<NEW_LINE>// The first time we will ensure that the base data type, which may be a<NEW_LINE>// TypeDef, gets resolved. If... | resolvedBaseDt = resolve(baseDt, handler); |
1,853,166 | public static void main(String[] args) throws InterruptedException {<NEW_LINE>TagContextBuilder tagContextBuilder = tagger.currentBuilder().put(FRONTEND_KEY, TagValue.create("mobile-ios9.3.5"));<NEW_LINE>SpanBuilder spanBuilder = tracer.spanBuilder("my.org/ProcessVideo").setRecordEvents(true).setSampler(Samplers.always... | .nextInt(10) + 1); |
403,518 | private ChannelInfo parseChannelInfo(String json) {<NEW_LINE>try {<NEW_LINE>JSONParser parser = new JSONParser();<NEW_LINE>JSONObject root = (JSONObject) parser.parse(json);<NEW_LINE>String name = (String) root.get("name");<NEW_LINE>String id = (String) root.get("_id");<NEW_LINE>String status = (String) root.get("statu... | .getString(root, "updated_at")); |
1,267,765 | public void prepare(Map<String, Object> stormConf, TopologyContext context, OutputCollector collector) {<NEW_LINE>_collector = collector;<NEW_LINE>scheduler = Scheduler.getInstance(stormConf);<NEW_LINE>mdTransfer = MetadataTransfer.getInstance(stormConf);<NEW_LINE>useCache = ConfUtils.getBoolean(stormConf, useCachePara... | from(spec).build(); |
1,773,802 | private MotionEvent rotateTouchEvent(MotionEvent ev) {<NEW_LINE>if (this.getMapOrientation() == 0) {<NEW_LINE>return ev;<NEW_LINE>}<NEW_LINE>MotionEvent rotatedEvent = MotionEvent.obtain(ev);<NEW_LINE>if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {<NEW_LINE>getProjection().unrotateAndScalePoint((int) ev.ge... | mRotateScalePoint.x, mRotateScalePoint.y); |
1,300,262 | public String renderTemplate(Script source, WatchExecutionContext ctx, Payload payload) {<NEW_LINE>// Due the inconsistency with templates in ES 1.x, we maintain our own template format.<NEW_LINE>// This template format we use now, will become the template structure in ES 2.0<NEW_LINE>Map<String, Object> watcherContext... | compile(template, Watcher.SCRIPT_TEMPLATE_CONTEXT); |
430,383 | public long handle(Emulator<?> emulator) {<NEW_LINE>RegisterContext context = emulator.getContext();<NEW_LINE>UnidbgPointer object = context.getPointerArg(1);<NEW_LINE>UnidbgPointer clazz = context.getPointerArg(2);<NEW_LINE>UnidbgPointer jmethodID = context.getPointerArg(3);<NEW_LINE>UnidbgPointer va_list = context.ge... | DalvikVM64.this, va_list, dvmMethod); |
1,342,100 | public int matches(String str, int start, int length) {<NEW_LINE>final int end = start + length;<NEW_LINE>if (repeated instanceof AnyMatcher) {<NEW_LINE>final int stop = end - next.minLength();<NEW_LINE>for (int pos = start; pos >= 0 && pos <= stop; ++pos) {<NEW_LINE>int p = next.matches(<MASK><NEW_LINE>if (p >= start)... | str, pos, end - pos); |
861,571 | public static CodegenExpression codegen(ExprDotNodeForgeVariable forge, CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope classScope) {<NEW_LINE>CodegenExpressionField variableReader = classScope.addOrGetFieldSharable(new VariableReaderCodegenFieldSharable(forge.getVariable()))... | .methodReturn(ref("returned")); |
623,514 | void validateSelf(final boolean shouldIdCheck, final boolean descriptionOptional) throws InvalidToolException {<NEW_LINE>super.validateSelf();<NEW_LINE>// Not the expected type, the wrong Object is in use.<NEW_LINE>if (!objectType.equals(type)) {<NEW_LINE>throw new InvalidToolException(RequestNLS.formatMessage(tc<MASK>... | , "TYPE_NOT_CORRECT", objectType, type)); |
1,752,867 | private Observable<MantisKafkaConsumer<?>> createConsumers(final Context context, final MantisKafkaSourceConfig kafkaSourceConfig, final int totalNumWorkers) {<NEW_LINE>final List<MantisKafkaConsumer<?>> consumers = new ArrayList<>();<NEW_LINE>for (int i = 0; i < kafkaSourceConfig.getNumConsumerInstances(); i++) {<NEW_... | LOGGER.info("created consumer {}", mantisKafkaConsumer); |
117,648 | public void handleApplicationCommandRequest(SerialMessage serialMessage, int offset, int endpoint) {<NEW_LINE>logger.debug("NODE {}: Received CLOCK command V{}", getNode().getNodeId(), getVersion());<NEW_LINE>int command = serialMessage.getMessagePayloadByte(offset);<NEW_LINE>switch(command) {<NEW_LINE>case CLOCK_REPOR... | Calendar cal = Calendar.getInstance(); |
1,664,759 | public void processMessage(final WebSocketMessage webSocketData) {<NEW_LINE>setDoTransactionNotifications(false);<NEW_LINE>final SecurityContext securityContext = getWebSocket().getSecurityContext();<NEW_LINE>final PropertyKey selectorsKey = StructrApp.<MASK><NEW_LINE>final List<String> classes = webSocketData.getNodeD... | key(Widget.class, "selectors"); |
271,187 | private static double calculateSigma(double clipNorm, double eps, double targetDelta) {<NEW_LINE>double deltaZero = calculateBPositive(eps, 0);<NEW_LINE>double alpha = 1d;<NEW_LINE>if (targetDelta > deltaZero) {<NEW_LINE>double sPositive = calculateSPositive(eps, targetDelta, 0, 1);<NEW_LINE>alpha = Math.sqrt(1.0 + sPo... | Math.sqrt(2.0 * eps); |
1,156,475 | private static boolean equal(ISVNStatus e1, ISVNStatus e2) {<NEW_LINE>if (!SVNStatusKind.IGNORED.equals(e1.getTextStatus()) && !SVNStatusKind.UNVERSIONED.equals(e1.getTextStatus()) && !SVNStatusKind.ADDED.equals(e1.getTextStatus())) {<NEW_LINE>// check revisions just when it's meaningful, unversioned or ignored files h... | SVNRevision r = e2.getRevision(); |
1,463,023 | public AwsIotAnalyticsParameters unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AwsIotAnalyticsParameters awsIotAnalyticsParameters = new AwsIotAnalyticsParameters();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement()... | JsonToken token = context.getCurrentToken(); |
872,473 | public void marshall(HumanTaskConfig humanTaskConfig, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (humanTaskConfig == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(humanTaskConfig.getWorkteamArn(), WORKT... | humanTaskConfig.getNumberOfHumanWorkersPerDataObject(), NUMBEROFHUMANWORKERSPERDATAOBJECT_BINDING); |
347,389 | private static Engine prepareEngine(int numEntities) {<NEW_LINE>Engine engine = new Engine();<NEW_LINE>engine.addSystem(new MovementSystem());<NEW_LINE>engine.addSystem(new StateSystem());<NEW_LINE>engine.addSystem(new CollisionSystem());<NEW_LINE>engine.addSystem(new RemovalSystem());<NEW_LINE>for (int i = 0; i < numE... | Constants.MIN_ACC, Constants.MAX_ACC); |
941,919 | public ASTNode visitCExpr(final CExprContext ctx) {<NEW_LINE>if (null != ctx.columnref()) {<NEW_LINE>return visit(ctx.columnref());<NEW_LINE>}<NEW_LINE>if (null != ctx.parameterMarker()) {<NEW_LINE>ParameterMarkerValue parameterMarker = (ParameterMarkerValue) visit(ctx.parameterMarker());<NEW_LINE>ParameterMarkerExpres... | ), parameterMarker.getType()); |
381,598 | public final <K> Map<K, ?> toMap(K key1, K key2, K key3, K key4, K key5, K key6, K key7, K key8, K key9, K key10, K key11, K key12, K key13, K key14, K key15) {<NEW_LINE>Map<K, Object> result = new LinkedHashMap<>();<NEW_LINE>result.put(key1, v1);<NEW_LINE>result.put(key2, v2);<NEW_LINE>result.put(key3, v3);<NEW_LINE>r... | result.put(key6, v6); |
9,553 | // Add claims to authorization-url<NEW_LINE>private OAuth2AuthorizationRequest addClaims(HttpServletRequest httpServletRequest, OAuth2AuthorizationRequest oAuth2AuthorizationRequest) {<NEW_LINE>if (oAuth2AuthorizationRequest == null || httpServletRequest == null) {<NEW_LINE>return oAuth2AuthorizationRequest;<NEW_LINE>}... | httpSession.removeAttribute(Constants.CONDITIONAL_ACCESS_POLICY_CLAIMS); |
271,036 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player opponent = game.getPlayer(this.getTargetPointer().getFirst(game, source));<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (opponent != null && controller != null) {<NEW_LINE>if (!opponent.getHand().isEmpty()) {<NEW_LIN... | Zone.HAND, StaticFilters.FILTER_CARD_A_NON_LAND); |
1,539,530 | public void parseData(JSONArray printData, PrintOptions options) throws JSONException, UnsupportedOperationException {<NEW_LINE>dpiScale = (options.getPixelOptions().getDensity() * options.getPixelOptions().getUnits().as1Inch()) / 72.0;<NEW_LINE>for (int i = 0; i < printData.length(); i++) {<NEW_LINE>JSONObject data = ... | .getString("data")))); |
1,089,258 | private static PrivateKey generatePEMPrivateKey(final Path keyPath) throws IOException {<NEW_LINE>String key = Files.readString(keyPath, Charset.defaultCharset());<NEW_LINE>String privateKeyPEM = key.replace("-----BEGIN PRIVATE KEY-----", "").replaceAll(System.lineSeparator(), "").replace("-----END PRIVATE KEY-----", "... | kf = KeyFactory.getInstance("DSA"); |
770,364 | // load ratings data from ratings.csv<NEW_LINE>private void loadRatingData(String ratingDataPath) throws Exception {<NEW_LINE>System.out.println("Loading rating data from " + ratingDataPath + " ...");<NEW_LINE>boolean skipFirstLine = true;<NEW_LINE>int count = 0;<NEW_LINE>try (Scanner scanner = new Scanner(new File(rat... | ()).addRating(rating); |
481,160 | public RouteDefinition convertRoute(GatewayStrategyRouteEntity gatewayStrategyRouteEntity) {<NEW_LINE>RouteDefinition routeDefinition = new RouteDefinition();<NEW_LINE>routeDefinition.setId(gatewayStrategyRouteEntity.getId());<NEW_LINE>routeDefinition.setUri(convertURI(gatewayStrategyRouteEntity.getUri()));<NEW_LINE>Li... | ) + userFilters.size()); |
255,121 | /*<NEW_LINE>* We support only TEXT, CHART, DROPDOWN, TABLE, INPUT widgets as part of the suggestion<NEW_LINE>* We need string and number type fields to construct the query which will bind data to the above widgets<NEW_LINE>*/<NEW_LINE>private static DataFields collectFieldsFromData(Iterator<Map.Entry<String, JsonNode>>... | objectFields = new ArrayList<>(); |
515,251 | private void actOnLogin(PostLoginEvent event) {<NEW_LINE>ProxiedPlayer player = event.getPlayer();<NEW_LINE>UUID playerUUID = player.getUniqueId();<NEW_LINE>String playerName = player.getName();<NEW_LINE>InetAddress address = player.getAddress().getAddress();<NEW_LINE>long time = System.currentTimeMillis();<NEW_LINE>Ac... | , playerName, CallEvents.PLAYER_JOIN)); |
1,512,256 | public void change(Database database, DatabaseSession databaseSession) throws NotImplementedException, BimserverDatabaseException {<NEW_LINE>EClass eClass = eAttribute.getEContainingClass();<NEW_LINE>KeyValueStore keyValueStore = database.getKeyValueStore();<NEW_LINE>for (EClass subClass : schema.getSubClasses(eClass))... | Record record = recordIterator.next(); |
1,334,280 | private static void checkResult(LockdowndError result) {<NEW_LINE>switch(result) {<NEW_LINE>case LOCKDOWN_E_SUCCESS:<NEW_LINE>return;<NEW_LINE>case LOCKDOWN_E_INVALID_ARG:<NEW_LINE>throw new LibIMobileDeviceException(result.swigValue(), "LOCKDOWN_E_INVALID_ARG");<NEW_LINE>case LOCKDOWN_E_INVALID_CONF:<NEW_LINE>throw ne... | LibIMobileDeviceException(result.swigValue()); |
449,262 | public static void main(String[] args) {<NEW_LINE>Exercise28_StackWithAQueue<Integer> exercise28_stackWithAQueue = new Exercise28_StackWithAQueue<>();<NEW_LINE>StdOut.println("IsEmpty: " + exercise28_stackWithAQueue.isEmpty() + " Expected: true");<NEW_LINE>exercise28_stackWithAQueue.push(1);<NEW_LINE>exercise28_stackWi... | exercise28_stackWithAQueue.isEmpty() + " Expected: false"); |
1,198,954 | public void start() {<NEW_LINE>final <MASK><NEW_LINE>state.name = res.getDisplayName();<NEW_LINE>duration = 0;<NEW_LINE>if (res.getMedia() != null) {<NEW_LINE>duration = (long) res.getMedia().getDurationInSeconds() * 1000;<NEW_LINE>state.duration = DurationFormatUtils.formatDuration(duration, "HH:mm:ss");<NEW_LINE>}<NE... | DLNAResource res = renderer.getPlayingRes(); |
820,117 | static <K, V> MapMakerInternalMap<K, V, ? extends InternalEntry<K, V, ?>, ?> create(MapMaker builder) {<NEW_LINE>if (builder.getKeyStrength() == Strength.STRONG && builder.getValueStrength() == Strength.STRONG) {<NEW_LINE>return new MapMakerInternalMap<>(builder, StrongKeyStrongValueEntry.Helper.<K, V>instance());<NEW_... | K, V>instance()); |
887,788 | public void visitVarInsn(int opcode, int var) {<NEW_LINE>switch(opcode) {<NEW_LINE>case Opcodes.ILOAD:<NEW_LINE>push(InferredType.INT);<NEW_LINE>break;<NEW_LINE>case Opcodes.LLOAD:<NEW_LINE>push(InferredType.LONG);<NEW_LINE>push(InferredType.TOP);<NEW_LINE>break;<NEW_LINE>case Opcodes.FLOAD:<NEW_LINE>push(InferredType.... | super.visitVarInsn(opcode, var); |
1,321,200 | public Mono<MatchResult> matches(ServerWebExchange exchange) {<NEW_LINE>ServerHttpRequest request = exchange.getRequest();<NEW_LINE>PathContainer path = request.getPath().pathWithinApplication();<NEW_LINE>if (this.method != null && !this.method.equals(request.getMethod())) {<NEW_LINE>return MatchResult.notMatch().doOnN... | pattern.getPatternString() + "'"); |
621,667 | public void prepareDatabase() {<NEW_LINE>if (config.hasPath(RdbmsConfigConstants.SQLITE_PATH_CREATE) && config.hasPath(RdbmsConfigConstants.SQLITE_PATH_VALUE) && config.getBoolean(RdbmsConfigConstants.SQLITE_PATH_CREATE)) {<NEW_LINE>String path = config.getString(RdbmsConfigConstants.SQLITE_PATH_VALUE);<NEW_LINE>try {<... | , MetastoreConfigConstants.OVERRIDE_RESOURCE_FILE_NAME), e); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.