idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,764,584 | public void createPartControl(Composite parent) {<NEW_LINE>parent.setLayout(new FillLayout());<NEW_LINE>parent.addControlListener(new ControlListener() {<NEW_LINE><NEW_LINE>public void controlResized(ControlEvent e) {<NEW_LINE>viewer.applyLayout();<NEW_LINE>}<NEW_LINE><NEW_LINE>public void controlMoved(ControlEvent e) ... | yyyymmdd(d.p.endTime); |
459,516 | public static int runJar(String filename) {<NEW_LINE>// TBD: this is kind of gross because a local called `zipfile' just magically<NEW_LINE>// shows up in the module's globals. Either `zipfile' should be called<NEW_LINE>// `__zipfile__' or (preferably, IMO), __run__.py should be imported and a main()<NEW_LINE>// functi... | file = zip.getInputStream(runit); |
669,194 | private void warnPlayersToPlay() {<NEW_LINE>// have to do this all synchronized in case they play while we're processing this<NEW_LINE>synchronized (roundTimerLock) {<NEW_LINE>killRoundTimer();<NEW_LINE>synchronized (roundPlayers) {<NEW_LINE>for (final Player player : roundPlayers) {<NEW_LINE>final List<WhiteCard> card... | getUser().enqueueMessage(q); |
1,716,750 | final DescribeBotRecommendationResult executeDescribeBotRecommendation(DescribeBotRecommendationRequest describeBotRecommendationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeBotRecommendationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequest... | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
137,009 | public void placeObject(ChunkManager level, int x, int y, int z, NukkitRandom random) {<NEW_LINE>this.treeHeight = random.nextBoundedInt(4) + 6;<NEW_LINE>int topSize = this.getTreeHeight() - (1 + random.nextBoundedInt(2));<NEW_LINE>int lRadius = 2 + random.nextBoundedInt(2);<NEW_LINE>this.placeTrunk(level, x, y, z, ran... | Math.abs(xx - x); |
1,730,406 | public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {<NEW_LINE>if (getArguments() != null) {<NEW_LINE>mOpenType = getArguments().getInt(ARG_FRAGMENT_OPEN_TYPE, -1);<NEW_LINE>mRootKey = getArguments().getString(ARG_PREFS_ROOT);<NEW_LINE>}<NEW_LINE>setPreferencesFromResource(<MASK><NEW_LINE>_mbwMan... | R.xml.preferences, mRootKey); |
679,625 | public void processMessage(final WebSocketMessage webSocketData) {<NEW_LINE>setDoTransactionNotifications(true);<NEW_LINE>final Set<String> supportedByArchiveStreamFactory = new HashSet<>(Arrays.asList(new String[] { ArchiveStreamFactory.AR, ArchiveStreamFactory.ARJ, ArchiveStreamFactory.CPIO, ArchiveStreamFactory.DUMP... | file.getName(), "."); |
327,773 | public void run(final JobExecutionContext jobContext) throws JobExecutionException {<NEW_LINE>final Permissionable permissionable;<NEW_LINE>final Trigger trigger = jobContext.getTrigger();<NEW_LINE>final Map<String, Serializable> map = getExecutionData(trigger, CascadePermissionsJob.class);<NEW_LINE>final String permis... | e.getMessage(), e); |
280,701 | public Integer update(ApproverRequest request, String operator) {<NEW_LINE>Preconditions.checkNotNull(request, "approver request cannot be null");<NEW_LINE>Integer id = request.getId();<NEW_LINE>Preconditions.checkNotNull(id, "approver id cannot be null");<NEW_LINE>WorkflowApproverEntity <MASK><NEW_LINE>Preconditions.c... | entity = workflowApproverMapper.selectById(id); |
201,610 | static final Object convertBytesToObject(byte[] bytesValue, JDBCType jdbcType, TypeInfo baseTypeInfo) throws SQLServerException {<NEW_LINE>switch(jdbcType) {<NEW_LINE>case CHAR:<NEW_LINE>String str = Util.bytesToHexString(bytesValue, bytesValue.length);<NEW_LINE>if ((SSType.BINARY == baseTypeInfo.getSSType()) && (str.l... | newBytes, 0, bytesValue.length); |
751,108 | public void deploy(FormDeploymentEntity deployment) {<NEW_LINE>LOGGER.debug("Processing deployment {}", deployment.getName());<NEW_LINE>// The ParsedDeployment represents the deployment, the forms, and the form<NEW_LINE>// resource, parse, and model associated with each form.<NEW_LINE>ParsedDeployment parsedDeployment ... | FormDefinitionEntity> mapOfNewFormToPreviousVersion = getPreviousVersionsOfFormDefinitions(parsedDeployment); |
1,489,040 | public void initActorSystem() {<NEW_LINE>log.info("Initializing actor system.");<NEW_LINE>actorContext.setActorService(this);<NEW_LINE>TbActorSystemSettings settings = new <MASK><NEW_LINE>system = new DefaultTbActorSystem(settings);<NEW_LINE>system.createDispatcher(APP_DISPATCHER_NAME, initDispatcherExecutor(APP_DISPAT... | TbActorSystemSettings(actorThroughput, schedulerPoolSize, maxActorInitAttempts); |
1,758,138 | private void loadTopic() {<NEW_LINE>topicList.clear();<NEW_LINE>Cursor topicCursor = dbManager.selectTopic();<NEW_LINE>for (int i = 0; i < topicCursor.getCount(); i++) {<NEW_LINE>switch(topicCursor.getInt(2)) {<NEW_LINE>case ITopic.TYPE_CONTACTS:<NEW_LINE>topicList.add(new Contacts(topicCursor.getLong(0), topicCursor.g... | topicCursor.getInt(5))); |
1,033,718 | protected void onInit() {<NEW_LINE>super.onInit();<NEW_LINE>ConversionService conversionService = getConversionService();<NEW_LINE>if (conversionService == null) {<NEW_LINE>conversionService = DefaultConversionService.getSharedInstance();<NEW_LINE>}<NEW_LINE>for (Map.Entry<Object, NamedComponent> entry : this.mapping.e... | >) key).getName(); |
1,690,018 | private Map<String, String> parseHeader(final byte[] header) {<NEW_LINE>final byte[] name = new byte[32];<NEW_LINE>for (int i = 0; i < 32; i++) {<NEW_LINE>name[i] = header[i + 16];<NEW_LINE>}<NEW_LINE>final byte[] author = new byte[32];<NEW_LINE>for (int i = 0; i < 32; i++) {<NEW_LINE>author[i] = header[i + 48];<NEW_LI... | HashMap<String, String>(); |
60,207 | protected void openWorkbook(OutputStream os) throws JRException {<NEW_LINE>rendererToImagePathMap = new HashMap<>();<NEW_LINE>// imageMaps = new HashMap();<NEW_LINE>// hyperlinksMap = new HashMap();<NEW_LINE>definedNames = new StringBuilder();<NEW_LINE>sheetMapping = new HashMap<>();<NEW_LINE>try {<NEW_LINE>String memo... | String keywords = configuration.getMetadataKeywords(); |
469,158 | public ContextIDValue createContextIDValue(ContextID contextID) throws CSErrorException {<NEW_LINE>logger.info("Start to createContextIDValue of ContextID({}) ", contextID.getContextId());<NEW_LINE>if (contextMapPersistence == null) {<NEW_LINE>throw new CSErrorException(97001, "Failed to get proxy of contextMapPersiste... | this.contextKeyCallbackEngine.registerClient(contextKeyListenerDomain); |
1,325,806 | private <T> T doSaveVersioned(AdaptibleEntity<T> source, String collectionName) {<NEW_LINE>if (source.isNew()) {<NEW_LINE>return (T) doInsert(collectionName, source.getBean(), this.mongoConverter);<NEW_LINE>}<NEW_LINE>// Create query for entity with the id and old version<NEW_LINE>Query query = source.getQueryForVersio... | UpdateDefinition update = mapped.updateWithoutId(); |
413,168 | private Composite createLoadingSection(Composite parent) {<NEW_LINE>Composite loadingComp = new Composite(parent, SWT.NONE);<NEW_LINE>loadingComp.setLayout(new GridLayout());<NEW_LINE>loadingComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));<NEW_LINE>loadingComp.setBackgroundMode(SWT.INHERIT_DEFAULT);<N... | .FILL, true, false)); |
1,176,976 | protected void execute(HttpServletRequest request, HttpServletResponse response) {<NEW_LINE>long id = allocRequestId(request, response);<NEW_LINE>ValidationAction action = new ValidationAction(id, vLog, request, response, false);<NEW_LINE>printRequest(action);<NEW_LINE>action.setStartTime();<NEW_LINE>response = action.... | JSON.write(out, obj); |
1,831,234 | private void readFields(DataInput in) throws IOException {<NEW_LINE>id = in.readLong();<NEW_LINE>host = Text.readString(in);<NEW_LINE>heartbeatPort = in.readInt();<NEW_LINE>bePort = in.readInt();<NEW_LINE>httpPort = in.readInt();<NEW_LINE>beRpcPort = in.readInt();<NEW_LINE>isAlive.<MASK><NEW_LINE>isDecommissioned.set(i... | set(in.readBoolean()); |
466,898 | public static ListUserSolutionsResponse unmarshall(ListUserSolutionsResponse listUserSolutionsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listUserSolutionsResponse.setRequestId(_ctx.stringValue("ListUserSolutionsResponse.RequestId"));<NEW_LINE>listUserSolutionsResponse.setCurrentPageNum(_ctx.integerValue("ListUserSo... | ("ListUserSolutionsResponse.Data[" + i + "].Status")); |
1,797,947 | public void directionsOnClick() {<NEW_LINE>MapActivity mapActivity = getMapActivity();<NEW_LINE>if (mapActivity != null) {<NEW_LINE><MASK><NEW_LINE>MapActivityActions mapActions = mapActivity.getMapActions();<NEW_LINE>TargetPointsHelper targetPointsHelper = app.getTargetPointsHelper();<NEW_LINE>ApplicationMode appMode ... | OsmandApplication app = mapActivity.getMyApplication(); |
967,080 | void run(String directory, String executable, String... args) {<NEW_LINE>if (status != 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>System.out.printf("%n%n%n|%n| %s%n|%n", directory);<NEW_LINE>System.out.printf("| %s %s%n|%n", executable, String.join(" ", args));<NEW_LINE>var <MASK><NEW_LINE>var isWindows = System.getProp... | path = Paths.get(directory); |
1,012,709 | private void drawCardinalDirections(Canvas canvas, QuadPoint center, float radiusLength, RotatedTileBox tileBox, RenderingLineAttributes attrs) {<NEW_LINE>float textMargin = AndroidUtils.dpToPx(app, 14);<NEW_LINE>attrs.paint2.setTextAlign(Paint.Align.CENTER);<NEW_LINE>attrs.paint3.setTextAlign(Paint.Align.CENTER);<NEW_... | radiusLength - textMargin - textWidth / 2); |
1,010,110 | private void sendOutMessages(@NotNull final List<PUBLISH> retainedPublishes) {<NEW_LINE>if (!channel.isActive()) {<NEW_LINE>for (final PUBLISH publish : retainedPublishes) {<NEW_LINE>payloadPersistence.<MASK><NEW_LINE>}<NEW_LINE>resultFuture.setException(CLOSED_CHANNEL_EXCEPTION);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>i... | decrementReferenceCounter(publish.getPublishId()); |
533,907 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>MageObject sourceObject = game.getObject(source);<NEW_LINE>if (controller != null && sourceObject != null) {<NEW_LINE>if (!controller.getHand().isEmpty()) {<NEW_LINE>UUID exileId = source.ge... | card.setFaceDown(true, game); |
782,398 | private void initialize() {<NEW_LINE>SyntaxElement currentTag = null;<NEW_LINE>DocumentContext documentContext = DocumentContext.create(baseDocument, offset);<NEW_LINE>if (documentContext == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>declaredNamespaces = documentContext.getDeclaredNamespacesMap();<NEW_LINE>Token<XMLT... | .text().toString(); |
1,211,318 | public static void main(String[] args) {<NEW_LINE>try {<NEW_LINE>// To take affect these must be set before the splash screen is instantiated<NEW_LINE>if (OperatingSystem.isMacOs()) {<NEW_LINE>setAppleSystemProperties();<NEW_LINE>} else if (OperatingSystem.isWindows7() || OperatingSystem.isWindows8() || OperatingSystem... | (new JFrame(), t); |
306,772 | public List<MetadataDto> findByCriteria(MetadataCriteria criteria, SortCriteria sortCriteria) {<NEW_LINE>Map<String, Object> <MASK><NEW_LINE>List<String> criteriaList = new ArrayList<>();<NEW_LINE>StringBuilder sb = new StringBuilder("select m.MET_ID_C c0, m.MET_NAME_C c1, m.MET_TYPE_C c2");<NEW_LINE>sb.append(" from T... | parameterMap = new HashMap<>(); |
309,822 | public boolean buildDailyTask(String name, String domain, Date period) {<NEW_LINE>Map<String, BusinessReport> reports = new HashMap<String, BusinessReport>();<NEW_LINE>BusinessReportConfig config = m_configManager.queryConfigByDomain(domain);<NEW_LINE>Map<String, BusinessItemConfig> itemConfigs = config.getBusinessItem... | baselineConfig.getWeights(), POINT_NUMBER); |
1,007,979 | // auto-generated, see spoon.generating.ReplacementVisitorGenerator<NEW_LINE>@java.lang.Override<NEW_LINE>public <T> void visitCtConditional(final spoon.reflect.code.CtConditional<T> conditional) {<NEW_LINE>replaceElementIfExist(conditional.getType(), new spoon.support.visitor.replace<MASK><NEW_LINE>replaceInListIfExis... | .ReplacementVisitor.CtTypedElementTypeReplaceListener(conditional)); |
1,832,962 | private static void validateManifest(TableManifest tableManifest, Ddl ddl) {<NEW_LINE>Table table = ddl.<MASK><NEW_LINE>if (table == null) {<NEW_LINE>throw new RuntimeException(String.format("Table %s not found in the database. Table must be pre-created in database", tableManifest.getTableName()));<NEW_LINE>}<NEW_LINE>... | table(tableManifest.getTableName()); |
1,413,768 | protected static ReadDepsPcodeExecutor buildAddressDepsExecutor(DebuggerCoordinates coordinates) {<NEW_LINE><MASK><NEW_LINE>ReadDepsTraceBytesPcodeExecutorState state = new ReadDepsTraceBytesPcodeExecutorState(trace, coordinates.getViewSnap(), coordinates.getThread(), coordinates.getFrame());<NEW_LINE>Language language... | Trace trace = coordinates.getTrace(); |
1,454,950 | @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })<NEW_LINE>public Response clear(@HeaderParam(Constants.SESSION_TOKEN_HEADER_NAME) String sessionToken, @Context HttpHeaders headers) {<NEW_LINE>if (log.isDebugEnabled())<NEW_LINE>log.debug("PUT: Session Token:" + sessionToken);<NEW_LINE>String mediaTyp... | ), mediaType).build(); |
879,750 | public static ClientMessage encodeRequest(java.lang.String name, java.util.UUID txnId, long threadId, com.hazelcast.internal.serialization.Data key, com.hazelcast.internal.serialization.Data value) {<NEW_LINE>ClientMessage clientMessage = ClientMessage.createForEncode();<NEW_LINE>clientMessage.setRetryable(false);<NEW_... | StringCodec.encode(clientMessage, name); |
1,083,050 | /* Build call for throttlingPoliciesCustomGet */<NEW_LINE>private com.squareup.okhttp.Call throttlingPoliciesCustomGetCall(String accept, String ifNoneMatch, String ifModifiedSince, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) t... | String[] localVarContentTypes = { "application/json" }; |
314,001 | public CommonDDBean addRow(Object[] values) {<NEW_LINE>try {<NEW_LINE>Object parent = getParent();<NEW_LINE>InitParam param = null;<NEW_LINE>if (parent instanceof Servlet) {<NEW_LINE>// NOI18N<NEW_LINE>param = (InitParam) ((Servlet) parent).createBean("InitParam");<NEW_LINE>} else if (parent instanceof Filter) {<NEW_LI... | getChildren().add(param); |
1,384,941 | private void updateCaptionInternal(ComponentConnector child) {<NEW_LINE>Slot slot = getWidget().getSlot(child.getWidget());<NEW_LINE>String caption = child.getState().caption;<NEW_LINE>URLReference iconUrl = child.getState().resources.get(ComponentConstants.ICON_RESOURCE);<NEW_LINE>String iconUrlString = iconUrl != nul... | CaptionPosition pos = slot.getCaptionPosition(); |
1,769,130 | protected boolean initMutiFragment(List<QMUIFragment> fragments) {<NEW_LINE>if (fragments.size() == 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean disableSwipeBack = getIntent().getIntExtra(QMUIFragmentActivity.QMUI_MUTI_START_INDEX, 0) > 0;<NEW_LINE>if (fragments.size() == 1) {<NEW_LINE>QMUIFragment fragment ... | fragment = fragments.get(i); |
156,457 | private void doFilterProjectTargets(BlazeSyncParams params, Predicate<TargetKey> filter, BlazeContext context) {<NEW_LINE>Instant startTime = Instant.now();<NEW_LINE>SyncResult syncResult = SyncResult.FAILURE;<NEW_LINE>SyncStats.Builder stats = SyncStats.builder();<NEW_LINE>try {<NEW_LINE>SaveUtil.saveAllFiles();<NEW_L... | ("Filtering project targets", EventType.Other)); |
312,132 | final ExportAutoScalingGroupRecommendationsResult executeExportAutoScalingGroupRecommendations(ExportAutoScalingGroupRecommendationsRequest exportAutoScalingGroupRecommendationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(exportAutoScalingGroupRecommendationsRequest);<NEW_LINE>AWSReque... | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
808,870 | private int[] createExportBookmarks() {<NEW_LINE>// create array with all bookmark-categories<NEW_LINE>String[] bookmarkCategories = new String[bookmarks.getCategoryCount() + 1];<NEW_LINE>// first field is always "all"<NEW_LINE>bookmarkCategories[0] = getResourceMap().getString("exportBookmarkCatAll");<NEW_LINE>// retr... | getBookmarkedEntriesFromCat(expo.toString()); |
846,971 | public JsonElement serialize(ClusterValueForBaseWrite<?> value, Type type, JsonSerializationContext jsonSerializationContext) {<NEW_LINE>JsonObject obj = new JsonObject();<NEW_LINE>obj.addProperty("instanceName", value.getInstanceName());<NEW_LINE>obj.addProperty("apiVersion", value.apiVersion);<NEW_LINE>obj.addPropert... | add("data", value.rawData); |
246,234 | public String process(String line) {<NEW_LINE>int currentCount = 0;<NEW_LINE>int currentIndex = 0;<NEW_LINE>while ((currentIndex = line.indexOf(m_start, currentIndex)) >= 0) {<NEW_LINE>if (currentCount == m_skipCount) {<NEW_LINE>int endIndex = line.indexOf(m_end, currentIndex + 1);<NEW_LINE>if (endIndex > 0) {<NEW_LINE... | .substring(endIndex + 1)); |
483,190 | public Stream<ORawPair<Object, ORID>> executeIndexQuery(OCommandContext iContext, OIndex index, List<Object> keyParams, boolean ascSortOrder) {<NEW_LINE>final OIndexDefinition indexDefinition = index.getDefinition();<NEW_LINE>Stream<ORawPair<Object, ORID>> stream;<NEW_LINE>final OIndexInternal internalIndex = index.get... | iContext, index, keyParams, indexDefinition); |
242,720 | public void decodeFragment(DTLSConnectionState readState) throws GeneralSecurityException, HandshakeException {<NEW_LINE>if (fragment != null) {<NEW_LINE>LOGGER.error("DTLS read state already applied!");<NEW_LINE>throw new IllegalArgumentException("DTLS read state already applied!");<NEW_LINE>}<NEW_LINE>ContentType act... | Arrays.copyOf(decryptedMessage, index); |
1,017,017 | public Object userMinWithdrawalFee(String currency) throws TimeoutException, ExecutionException, InterruptedException, ApiException {<NEW_LINE>Object postBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String path = "/user/minWithdrawalFee";<NEW_LINE>// query params<NEW_LINE>List<Pair> queryParams = new... | authNames = new String[] {}; |
232,340 | final CreateKeyResult executeCreateKey(CreateKeyRequest createKeyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createKeyRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateKeyRequest> request = null;<NEW_LINE>Response<CreateKe... | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
1,192,258 | public void mapPartition(Iterable<Row> iterable, Collector<Tuple2<FmDataFormat, double[]>> collector) throws Exception {<NEW_LINE>int taskId = getRuntimeContext().getIndexOfThisSubtask();<NEW_LINE>if (taskId == 0) {<NEW_LINE>FmDataFormat format = new FmDataFormat();<NEW_LINE>double[] cinfo = new double[0];<NEW_LINE>dou... | + i] = buffer[i]; |
1,482,822 | public void await() throws BackgroundException {<NEW_LINE>while (size.get() > 0) {<NEW_LINE>// Repeat until no new entries in queue found<NEW_LINE>try {<NEW_LINE>if (log.isInfoEnabled()) {<NEW_LINE>log.info(String.format("Await completion for %d submitted tasks in queue", size.get()));<NEW_LINE>}<NEW_LINE>final Transfe... | .format("Unhandled failure %s", e)); |
1,191,037 | protected void loadSectionRelocations() {<NEW_LINE>monitor.setMessage("Processing relocation table...");<NEW_LINE>MachoRelocationHandler handler = MachoRelocationHandlerFactory.getHandler(machoHeader);<NEW_LINE>List<Section> sections = machoHeader.getAllSections();<NEW_LINE>for (Section section : sections) {<NEW_LINE>i... | origBytes, relocation.getTargetDescription()); |
352,536 | public DescribeDocumentVersionsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeDocumentVersionsResult describeDocumentVersionsResult = new DescribeDocumentVersionsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCu... | class).unmarshall(context)); |
368,540 | public boolean onTouchEvent(TextView widget, Spannable buffer, MotionEvent event) {<NEW_LINE>int action = event.getAction();<NEW_LINE>if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_DOWN) {<NEW_LINE>int x = (int) event.getX();<NEW_LINE>int y = (int) event.getY();<NEW_LINE>x -= widget.getTotalPadding... | off, off, ClickableSpan.class); |
559,368 | public String placeLimitOrder(LimitOrder limitOrder) throws IOException {<NEW_LINE>Order.IOrderFlags orderFlag = CoinjarOrderFlags.GTC;<NEW_LINE>if (limitOrder.getOrderFlags().size() > 0) {<NEW_LINE>orderFlag = limitOrder.getOrderFlags()<MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>CoinjarOrderRequest request = new Coinjar... | .iterator().next(); |
675,939 | public boolean apply(Game game, Ability source) {<NEW_LINE>SubType choice = SubType.byDescription((String) game.getState().getValue(source.getSourceId().toString() + "_ElsewhereFlask"));<NEW_LINE>if (choice == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>for (Iterator<MageObjectReference> it = affectedObjectList.... | source.getSourceId(), game); |
1,637,072 | public void execute(@NonNull final MapActivity mapActivity) {<NEW_LINE>final LatLon latLon = mapActivity.getMapView().getCurrentRotatedTileBox().getCenterLatLon();<NEW_LINE>final String title = getParams().get(KEY_NAME);<NEW_LINE>if (title == null || title.isEmpty()) {<NEW_LINE>progressDialog = createProgressDialog(map... | ).get(KEY_DIALOG))); |
1,452,194 | public void onResume(final Activity activity) {<NEW_LINE>if (LOG) {<NEW_LINE>LogManager.i(activity, "onResume");<NEW_LINE>}<NEW_LINE>if ((!application.isInitialized() || SyncManager.getInstance().isSyncMode()) && !Application.getInstance().isClosing()) {<NEW_LINE>if (LOG) {<NEW_LINE>LogManager.i(this, "Wait for loading... | .getInstance().onPreInitialize(); |
107,906 | public static boolean[] populateNullVector(@Nullable final boolean[] nullVector, final ReadableVectorOffset offset, final PeekableIntIterator nullIterator) {<NEW_LINE>if (!nullIterator.hasNext()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final boolean[] retVal;<NEW_LINE>if (nullVector != null) {<NEW_LINE>retVal = nul... | int startOffset = offset.getStartOffset(); |
289,544 | private static void appendLong14(CharSink sink, long i) {<NEW_LINE>long c;<NEW_LINE>sink.put((char) ('0' + i / 10000000000000L));<NEW_LINE>sink.put((char) ('0' + (c = i % 10000000000000L) / 1000000000000L));<NEW_LINE>sink.put((char) ('0' + (<MASK><NEW_LINE>sink.put((char) ('0' + (c %= 100000000000L) / 10000000000L));<N... | c %= 1000000000000L) / 100000000000L)); |
1,254,294 | // End of variables declaration//GEN-END:variables<NEW_LINE>public static FileObject showDialog(SourceGroup[] folders, Class<?> target, String preselectedFileName) {<NEW_LINE>BrowseFolders bf = new BrowseFolders(folders, target, preselectedFileName);<NEW_LINE>// NOI18N<NEW_LINE>String title = target == DataFolder.class... | DialogDescriptor.BOTTOM_ALIGN, null, null); |
1,606,769 | public SingularityCreateResult saveDeploy(SingularityRequest request, SingularityDeployMarker deployMarker, SingularityDeploy deploy) {<NEW_LINE>createDeployIfNotExists(request, deployMarker, deploy);<NEW_LINE>LOG.info("Creating deploy {}", deployMarker);<NEW_LINE>singularityEventListener.deployHistoryEvent(new Singula... | getRequestDeployState(deploy.getRequestId()); |
1,447,505 | public void report(final SortedMap<MetricName, Gauge> gauges, final SortedMap<MetricName, Counter> counters, final SortedMap<MetricName, Histogram> histograms, final SortedMap<MetricName, Meter> meters, final SortedMap<MetricName, Timer> timers) {<NEW_LINE>final long now = System.currentTimeMillis();<NEW_LINE>JVMMetric... | "InfluxDbReporter report is called with counter size " + counters.size()); |
1,565,903 | private BiomeProfile createFromFile(Path file) {<NEW_LINE>try {<NEW_LINE>BiomeProfile profile = JsonReader.readLocation(file, BiomeProfile.class);<NEW_LINE>if (profile.validate()) {<NEW_LINE>return profile;<NEW_LINE>}<NEW_LINE>AmidstLogger.warn("Profile invalid, ignoring: {}", file);<NEW_LINE>} catch (IOException | For... | warn(e, "Unable to load file: {}", file); |
308,461 | private static void findAndRegisterResources(Type type, Class<? extends ClientConnector> cls, LegacyCommunicationManager manager, List<Dependency> dependencies) {<NEW_LINE>Annotation[] annotations = cls.getAnnotationsByType(type.annotationType);<NEW_LINE>if (annotations != null) {<NEW_LINE>for (Annotation annotation : ... | annotationType().getName()); |
1,494,547 | private List<SourceFolder> basicProjectRelativeFolders(Iterable<SourceSet> sourceSets, Function<File, String> provideRelativePath, File defaultOutputDir) {<NEW_LINE>ArrayList<SourceFolder> entries = Lists.newArrayList();<NEW_LINE>List<SourceSet> sortedSourceSets = sortSourceSetsAsPerUsualConvention(sourceSets);<NEW_LIN... | getAllSource().getSrcDirTrees()); |
1,565,351 | public DevicePoolCompatibilityResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DevicePoolCompatibilityResult devicePoolCompatibilityResult = new DevicePoolCompatibilityResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurren... | JsonToken token = context.getCurrentToken(); |
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>FileUtils.copyURLToFile(url, ... | System.out.println("\n\n---- Original Data ----"); |
180,480 | CopyAction createCopyAction(Jar jar, LayerResolver layerResolver, String layerToolsLocation) {<NEW_LINE>File output = jar.getArchiveFile().get().getAsFile();<NEW_LINE><MASK><NEW_LINE>boolean preserveFileTimestamps = jar.isPreserveFileTimestamps();<NEW_LINE>boolean includeDefaultLoader = isUsingDefaultLoader(jar);<NEW_L... | Manifest manifest = jar.getManifest(); |
1,669,162 | private void sendReport(HttpServletRequest req, HttpServletResponse resp, Hashtable<String, Integer> errorList) throws ServletException, IOException {<NEW_LINE>resp.setStatus(WebdavStatus.SC_MULTI_STATUS);<NEW_LINE>String absoluteUri = req.getRequestURI();<NEW_LINE>String relativePath = getRelativePath(req);<NEW_LINE>X... | null, "response", XMLWriter.CLOSING); |
513,608 | private void addAbstract(Map<Field, String> hm, String lab, String value) {<NEW_LINE>String abstractValue = "";<NEW_LINE>if ("AB".equals(lab)) {<NEW_LINE>// adds copyright information that comes at the end of an abstract<NEW_LINE>if (value.contains("Copyright")) {<NEW_LINE>int copyrightIndex = value.lastIndexOf("Copyri... | new UnknownField("copyright"), copyrightInfo); |
832,285 | private static Row fillNewFields(Row row, AddFieldsInformation addFieldsInformation) {<NEW_LINE>Schema outputSchema = checkNotNull(addFieldsInformation.getOutputFieldType().getRowSchema());<NEW_LINE>List<Object> newValues = Lists.<MASK><NEW_LINE>for (int i = 0; i < row.getFieldCount(); ++i) {<NEW_LINE>AddFieldsInformat... | newArrayListWithCapacity(outputSchema.getFieldCount()); |
26,531 | private int inKeyStoreForOneSigner(CodeSigner signer) {<NEW_LINE>if (cacheForInKS.containsKey(signer)) {<NEW_LINE>return cacheForInKS.get(signer);<NEW_LINE>}<NEW_LINE>boolean found = false;<NEW_LINE>int result = 0;<NEW_LINE>List<? extends Certificate> certs = signer.getSignerCertPath().getCertificates();<NEW_LINE>for (... | c, "(" + alias + ")"); |
1,129,736 | public ProxyBranchImpl findRecurseBranch(String branchId) {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "findRecurseBranch", getMyInfo() + " branchID = " + branchId);<NEW_LINE>}<NEW_LINE>// In this case we should not compare this branch ID to the given<NEW_LINE>// branchId as it wa... | ProxyBranchImpl) _proxyBranches.get(i); |
454,158 | public Point2Transform2_F64 undistort_F64(boolean pixelIn, boolean pixelOut) {<NEW_LINE>if (pixelIn) {<NEW_LINE>Point2Transform2_F64 p_to_n = new RemoveBrownPtoN_F64().setK(p.fx, p.fy, p.skew, p.cx, p.cy).setDistortion(p.radial, p.t1, p.t2);<NEW_LINE>if (pixelOut) {<NEW_LINE>return new Transform2ThenPixel_F64(p_to_n).s... | p.t1, p.t2); |
83,766 | // documented at http://minecraft.gamepedia.com/Player.dat_Format<NEW_LINE>// player data that does not correspond to HumanEntity is in PlayerStore<NEW_LINE>@Override<NEW_LINE>public void load(T entity, CompoundTag tag) {<NEW_LINE>super.load(entity, tag);<NEW_LINE>tag.readInt("XpSeed", entity::setXpSeed);<NEW_LINE>tag.... | entity.getInventory()::setHeldItemSlot); |
1,762,649 | private void desiredCapabilityForCloud(String testMethodName, String platform, String jsonPath, DesiredCapabilities desiredCapabilities) {<NEW_LINE>JSONObject platFormCapabilities = new JsonParser(jsonPath).getObjectFromJSON().getJSONObject(platform);<NEW_LINE>platFormCapabilities.keySet().forEach(key -> {<NEW_LINE>cap... | setCapability(CapabilityType.VERSION, osVersion); |
1,322,344 | public ElideResponse delete(String baseUrlEndPoint, String path, String jsonApiDocument, MultivaluedMap<String, String> queryParams, Map<String, List<String>> requestHeaders, User opaqueUser, String apiVersion, UUID requestId) {<NEW_LINE>return handleRequest(false, opaqueUser, dataStore::beginTransaction, requestId, (t... | BaseVisitor visitor = new DeleteVisitor(requestScope); |
345,935 | private static String convertStringForMatcher(String text) {<NEW_LINE>StringBuilder sb = null;<NEW_LINE>if (text != null) {<NEW_LINE>// NOI18N<NEW_LINE>String[] sGroups = text.split("\\\\\\\\", text.length());<NEW_LINE>// NOI18N<NEW_LINE>sb = new StringBuilder();<NEW_LINE>for (int i = 0; i < sGroups.length; i++) {<NEW_... | replace("\\" + "r", "\r"); |
1,274,849 | protected void publishEvents(ZbResponse zbResponse) {<NEW_LINE>String zbResponseStr = zbResponse.getMessage();<NEW_LINE>String id = this.extractIdFromZbResponse(zbResponseStr);<NEW_LINE>logger.debug("Found event from ID {}", id);<NEW_LINE>if (id == null) {<NEW_LINE>logger.debug(" => ignoring null ID");<NEW_LINE>retu... | getBindingProvider().getItemNamesById(id); |
558,566 | public static DataSchemaFactory withCustomClasspath(Path pluginLocation) throws IOException {<NEW_LINE>if (pluginLocation == null) {<NEW_LINE>// no custom classpath, just return the default factory<NEW_LINE>return INSTANCE;<NEW_LINE>}<NEW_LINE>// first we load up classes from the classpath<NEW_LINE>File pluginDir = plu... | = new ArrayList<URL>(); |
28,937 | private void advanceToNextPage() {<NEW_LINE>synchronized (this) {<NEW_LINE>int nextIdx = dataPages.indexOf(currentPage) + 1;<NEW_LINE>if (destructive && currentPage != null) {<NEW_LINE>dataPages.remove(currentPage);<NEW_LINE>freePage(currentPage);<NEW_LINE>nextIdx--;<NEW_LINE>}<NEW_LINE>if (dataPages.size() > nextIdx) ... | currentPage = dataPages.get(nextIdx); |
1,787,608 | public void drawImage(FSImage fsImage, int x, int y, boolean interpolate) {<NEW_LINE>PdfBoxImage img = (PdfBoxImage) fsImage;<NEW_LINE><MASK><NEW_LINE>if (interpolate) {<NEW_LINE>// PDF/A does not support setting the interpolate flag to true.<NEW_LINE>if (!_pdfAConform) {<NEW_LINE>xobject.setInterpolate(true);<NEW_LINE... | PDImageXObject xobject = img.getXObject(); |
313,034 | public ReportResultData createCSV_FileForSSCC18_Labels(final Collection<Integer> desadvLinePack_IDs_ToPrint, final ZebraConfigId zebraConfigId, final PInstanceId pInstanceId) {<NEW_LINE>final ZebraConfigId zebraConfigToUse = zebraConfigId != null <MASK><NEW_LINE>final I_AD_Zebra_Config zebraConfig = zebraConfigReposito... | ? zebraConfigId : zebraConfigRepository.getDefaultZebraConfigId(); |
1,199,977 | private void authorizePublish(@NotNull final ChannelHandlerContext ctx, @NotNull final PUBLISH publish, @Nullable final PublishAuthorizerResult authorizerResult) {<NEW_LINE>final ClientConnection clientConnection = ctx.channel().attr(ChannelAttributes.CLIENT_CONNECTION).get();<NEW_LINE>if (authorizerResult != null && a... | ctx, publish, null, null); |
712,876 | final RetryStageExecutionResult executeRetryStageExecution(RetryStageExecutionRequest retryStageExecutionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(retryStageExecutionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequest... | addHandlerContext(HandlerContextKey.SERVICE_ID, "CodePipeline"); |
868,013 | public void onDescriptorRead(final BluetoothGatt gatt, final BluetoothGattDescriptor descriptor, final int status) {<NEW_LINE>final byte[<MASK><NEW_LINE>if (status == BluetoothGatt.GATT_SUCCESS) {<NEW_LINE>log(Log.INFO, () -> "Read Response received from descr. " + descriptor.getUuid() + ", value: " + ParserUtils.parse... | ] data = descriptor.getValue(); |
147,080 | public void makeGraph() {<NEW_LINE>Dimension size = graphPanel.getSize();<NEW_LINE>// canvas size<NEW_LINE>int width = (int) size.getWidth();<NEW_LINE>int height = (int) size.getHeight();<NEW_LINE>if (!dynamicGraphSize.isSelected()) {<NEW_LINE>String wstr = graphWidth.getText();<NEW_LINE>String hstr = graphHeight.getTe... | setData(this.getData()); |
159,090 | public Concrete.Expression visitPi(PiExpression piExpr, Void ignore) {<NEW_LINE>List<List<Concrete.TypeParameter>> parameters = new ArrayList<>();<NEW_LINE>Expression expr = piExpr;<NEW_LINE>for (; piExpr != null; piExpr = expr.cast(PiExpression.class)) {<NEW_LINE>List<Concrete.TypeParameter> params = new ArrayList<>()... | - 1).addAll(params); |
214,254 | public void update(ModelController controller) throws InternalErrorException, IOException {<NEW_LINE>ApiConnector api = controller.getApiAccessor();<NEW_LINE>if (_project == null) {<NEW_LINE>s_logger.debug("Project is null for the policy: " + _name);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>NetworkPolicy policy = _policy;<N... | throw new IOException("Project is null for the policy: " + _name); |
1,248,841 | public static PrivateKey convertStringToPrivateKey(String strKey) throws Exception {<NEW_LINE>java.security.Security<MASK><NEW_LINE>strKey = strKey.replace(System.lineSeparator(), "");<NEW_LINE>strKey = strKey.replaceAll("^\"+|\"+$", "");<NEW_LINE>strKey = strKey.replace("-----BEGIN PRIVATE KEY-----", "");<NEW_LINE>str... | .addProvider(new BouncyCastleProvider()); |
370,367 | private long epollWait(long deadlineNanos) throws IOException {<NEW_LINE>if (deadlineNanos == NONE) {<NEW_LINE>return // disarm timer<NEW_LINE>Native.// disarm timer<NEW_LINE>epollWait(// disarm timer<NEW_LINE>epollFd, // disarm timer<NEW_LINE>events, // disarm timer<NEW_LINE>timerFd, // disarm timer<NEW_LINE>Integer.M... | totalDelay / 1000000000L, Integer.MAX_VALUE); |
1,439,738 | private ValidValue createValidValue(Term term1, Term term2) throws GlossaryAuthorFVTCheckedException, InvalidParameterException, PropertyServerException, UserNotAuthorizedException {<NEW_LINE>ValidValue validValue = new ValidValue();<NEW_LINE>validValue.setDescription("ddd");<NEW_LINE>validValue.setExpression("Ex");<NE... | getSystemAttributes().getGUID()); |
917,263 | public void paintChildren() {<NEW_LINE>double zoom <MASK><NEW_LINE>if (zoom <= hardMinimalZoom || zoom >= hardMaximalZoom)<NEW_LINE>return;<NEW_LINE>Graphics2D gr = getGraphics();<NEW_LINE>Composite previousComposite = null;<NEW_LINE>if (hardMinimalZoom < zoom && zoom < softMinimalZoom) {<NEW_LINE>double diff = softMin... | = getScene().getZoomFactor(); |
1,408,580 | public void waitForAllocationCondition(final String modelId, final Predicate<ClusterState> predicate, @Nullable final TimeValue timeout, final WaitForAllocationListener listener) {<NEW_LINE>final ClusterStateObserver observer = new ClusterStateObserver(clusterService, timeout, <MASK><NEW_LINE>final ClusterState cluster... | logger, threadPool.getThreadContext()); |
1,522,269 | public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {<NEW_LINE>if (((bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>output.writeInt64(1, tag_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>output.writeEnum(2, type_);<NEW_LINE>}<NEW_LINE>if (... | output.writeBool(55, awake_); |
1,306,024 | final ListProtectionsResult executeListProtections(ListProtectionsRequest listProtectionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listProtectionsRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListProtectionsRequest> reques... | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
706,675 | public static Optional<PolarxUDFInfo> build(DataSource dataSource) {<NEW_LINE>try (Connection conn = dataSource.getConnection();<NEW_LINE>Statement stmt = conn.createStatement()) {<NEW_LINE>String pluginSql = "select `PLUGIN_VERSION`, `PLUGIN_STATUS` " <MASK><NEW_LINE>int[] versionParts = new int[2];<NEW_LINE>String st... | + " from information_schema.plugins " + " where `PLUGIN_NAME` = '" + PLUGIN_NAME + "';"; |
243,405 | private static long queryLatestStatisticsTimestamp(Datastore datastore, @Nullable String namespace) throws DatastoreException {<NEW_LINE>Query.Builder query = Query.newBuilder();<NEW_LINE>// Note: namespace either being null or empty represents the default namespace, in which<NEW_LINE>// case we treat it as not provide... | response = datastore.runQuery(request); |
1,003,181 | public static void main(String[] args) throws XGBoostError {<NEW_LINE>// this is the only difference, add a # followed by a cache prefix name<NEW_LINE>// several cache file with the prefix will be generated<NEW_LINE>// currently only support convert from libsvm file<NEW_LINE>DMatrix trainMat = new DMatrix("../../demo/d... | watches.put("test", testMat); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.