idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,253,475
public boolean onCallApi(int page, @Nullable String parameter) {<NEW_LINE>if (page == 1) {<NEW_LINE>lastPage = Integer.MAX_VALUE;<NEW_LINE>sendToView(view -> view.<MASK><NEW_LINE>}<NEW_LINE>setCurrentPage(page);<NEW_LINE>if (page > lastPage || lastPage == 0 || parameter == null) {<NEW_LINE>sendToView(SearchUsersMvp.View::hideProgress);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>makeRestCall(RestProvider.getSearchService(isEnterprise()).searchUsers(parameter, page), response -> {<NEW_LINE>lastPage = response.getLast();<NEW_LINE>sendToView(view -> {<NEW_LINE>view.onNotifyAdapter(response.isIncompleteResults() ? null : response.getItems(), page);<NEW_LINE>if (!response.isIncompleteResults()) {<NEW_LINE>view.onSetTabCount(response.getTotalCount());<NEW_LINE>} else {<NEW_LINE>view.onSetTabCount(0);<NEW_LINE>view.showMessage(R.string.error, R.string.search_results_warning);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>});<NEW_LINE>return true;<NEW_LINE>}
getLoadMore().reset());
813,721
public static void sanityCheckGoals(List<String> goals, boolean skipHardGoalCheck, KafkaCruiseControlConfig config) {<NEW_LINE>if (goals != null && !goals.isEmpty() && !skipHardGoalCheck && !(goals.size() == 1 && goals.get(0).equals(PreferredLeaderElectionGoal.class.getSimpleName()))) {<NEW_LINE>sanityCheckNonExistingGoal(goals, AnalyzerUtils.getCaseInsensitiveGoalsByName(config));<NEW_LINE>Set<<MASK><NEW_LINE>if (!goals.containsAll(hardGoals)) {<NEW_LINE>throw new IllegalArgumentException(String.format("Missing hard goals %s in the provided goals: %s. Add %s=true " + "parameter to ignore this sanity check.", hardGoals, goals, SKIP_HARD_GOAL_CHECK_PARAM));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
String> hardGoals = hardGoals(config);
270,034
private void installBackgroundImage() {<NEW_LINE>final String currentSpec = PropertiesComponent.getInstance().getValue(IdeBackgroundUtil.FRAME_PROP);<NEW_LINE>final String oldCurrentSpec = PropertiesComponent.getInstance().getValue("old.mt." + IdeBackgroundUtil.FRAME_PROP);<NEW_LINE>if (!MTConfig.getInstance().isUseMaterialWallpapers()) {<NEW_LINE>removeBackgroundImage(null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final String path = getBackgroundImage();<NEW_LINE>if (path != null) {<NEW_LINE>final File tmpImage = FileUtil.createTempFile("mtBackgroundImage", path.toString().substring(path.lastIndexOf('.')), true);<NEW_LINE>final URL resource = getClass().getClassLoader().getResource(path);<NEW_LINE>if (resource != null) {<NEW_LINE>try (final InputStream input = getClass().getClassLoader().getResourceAsStream(path)) {<NEW_LINE>try (final FileOutputStream output = new FileOutputStream(tmpImage)) {<NEW_LINE>FileUtil.copy(Objects.requireNonNull(input), output);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final String image = tmpImage.getPath();<NEW_LINE>final String alpha = String.valueOf(85);<NEW_LINE>final String fill = MTUiUtils.parseEnumValue("fill", IdeBackgroundUtil.Fill.PLAIN);<NEW_LINE>final String anchor = MTUiUtils.parseEnumValue("center", IdeBackgroundUtil.Anchor.CENTER);<NEW_LINE>final String spec = StringUtil.join(new String[] { image, alpha, fill, anchor }, ",");<NEW_LINE>PropertiesComponent.getInstance().setValue("old.mt." + IdeBackgroundUtil.FRAME_PROP, currentSpec);<NEW_LINE>PropertiesComponent.getInstance().setValue(IdeBackgroundUtil.FRAME_PROP, spec);<NEW_LINE>IdeBackgroundUtil.repaintAllWindows();<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>removeBackgroundImage(oldCurrentSpec);<NEW_LINE>}<NEW_LINE>} catch (final IOException ignored) {<NEW_LINE>}<NEW_LINE>}
throw new IllegalArgumentException("Can't load background: " + path);
894,091
public void run(RegressionEnvironment env) {<NEW_LINE>String[] <MASK><NEW_LINE>String epl = "@Name('s0') select a.theString as c0, b.theString as c1 from pattern [a=SupportBean(intPrimitive=0) and b=SupportBean(intPrimitive=1)]";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>env.milestone(0);<NEW_LINE>sendSupportBean(env, "EB", 1);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.milestone(1);<NEW_LINE>sendSupportBean(env, "EA", 0);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "EA", "EB" });<NEW_LINE>env.milestone(2);<NEW_LINE>sendSupportBean(env, "EB", 1);<NEW_LINE>sendSupportBean(env, "EA", 0);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.milestone(3);<NEW_LINE>sendSupportBean(env, "EB", 1);<NEW_LINE>sendSupportBean(env, "EA", 0);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.undeployAll();<NEW_LINE>}
fields = "c0,c1".split(",");
663,227
protected Control createControl(Composite editPlaceholder) {<NEW_LINE><MASK><NEW_LINE>valueController.getEditPlaceholder();<NEW_LINE>boolean inline = valueController.getEditType() == IValueController.EditType.INLINE;<NEW_LINE>timeEditor = new CustomTimeEditor(editPlaceholder, SWT.MULTI, true, inline);<NEW_LINE>textMode = new TextMode(this, timeEditor, valueController);<NEW_LINE>dateEditorMode = new DateEditorMode(this, timeEditor);<NEW_LINE>if (!isCalendarMode()) {<NEW_LINE>textMode.run();<NEW_LINE>textMode.setChecked(true);<NEW_LINE>} else<NEW_LINE>dateEditorMode.setChecked(true);<NEW_LINE>timeEditor.addSelectionAdapter(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>dirty = true;<NEW_LINE>Event selectionEvent = new Event();<NEW_LINE>selectionEvent.widget = timeEditor.getControl();<NEW_LINE>timeEditor.getControl().notifyListeners(SWT.Selection, selectionEvent);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>timeEditor.addModifyListener(e -> {<NEW_LINE>dirty = true;<NEW_LINE>Event modificationEvent = new Event();<NEW_LINE>modificationEvent.widget = timeEditor.getControl();<NEW_LINE>timeEditor.getControl().notifyListeners(SWT.Modify, modificationEvent);<NEW_LINE>});<NEW_LINE>primeEditorValue(value);<NEW_LINE>timeEditor.createDateFormat(valueController.getValueType());<NEW_LINE>timeEditor.setEditable(!valueController.isReadOnly());<NEW_LINE>return timeEditor.getControl();<NEW_LINE>}
Object value = valueController.getValue();
1,758,911
/*<NEW_LINE>* For tenant update<NEW_LINE>*/<NEW_LINE>// TODO: should be /tenant/{tenantName}<NEW_LINE>@PUT<NEW_LINE>@Path("/tenants")<NEW_LINE>@Authenticate(AccessType.UPDATE)<NEW_LINE>@Consumes(MediaType.APPLICATION_JSON)<NEW_LINE>@Produces(MediaType.APPLICATION_JSON)<NEW_LINE>@ApiOperation(value = "Update a tenant")<NEW_LINE>@ApiResponses(value = { @ApiResponse(code = 200, message = "Success"), @ApiResponse(code = 500, message = "Failed to update the tenant") })<NEW_LINE>public SuccessResponse updateTenant(Tenant tenant) {<NEW_LINE>PinotResourceManagerResponse response;<NEW_LINE>switch(tenant.getTenantRole()) {<NEW_LINE>case BROKER:<NEW_LINE>response = _pinotHelixResourceManager.updateBrokerTenant(tenant);<NEW_LINE>break;<NEW_LINE>case SERVER:<NEW_LINE>response = _pinotHelixResourceManager.updateServerTenant(tenant);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new RuntimeException("Not a valid tenant update call");<NEW_LINE>}<NEW_LINE>if (response.isSuccessful()) {<NEW_LINE>return new SuccessResponse("Updated tenant");<NEW_LINE>}<NEW_LINE>_controllerMetrics.<MASK><NEW_LINE>throw new ControllerApplicationException(LOGGER, "Failed to update tenant", Response.Status.INTERNAL_SERVER_ERROR);<NEW_LINE>}
addMeteredGlobalValue(ControllerMeter.CONTROLLER_TABLE_TENANT_UPDATE_ERROR, 1L);
131,006
public void turnSwitch(OnOffValue state) {<NEW_LINE>if (state == OnOffValue.UNDEF) {<NEW_LINE>logger.warn("got undef state, nothing to be done");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (getHouseCode() != null && getReceiverCode() != null) {<NEW_LINE>short switchTo = state == OnOffValue.ON ? BrickletRemoteSwitch.SWITCH_TO_ON : BrickletRemoteSwitch.SWITCH_TO_OFF;<NEW_LINE>try {<NEW_LINE>int maxRetries = 20;<NEW_LINE>int trial = 0;<NEW_LINE>while (tinkerforgeDevice.getSwitchingState() == BrickletRemoteSwitch.SWITCHING_STATE_BUSY && trial < maxRetries) {<NEW_LINE>trial++;<NEW_LINE>logger.trace("waiting for ready state {}", trial);<NEW_LINE>Thread.sleep(50);<NEW_LINE>}<NEW_LINE>if (trial == maxRetries) {<NEW_LINE>logger.error("remote switch doesn't go to ready state in spite of {} retries.", trial);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (getRepeats() != null) {<NEW_LINE>tinkerforgeDevice.setRepeats(getRepeats());<NEW_LINE>}<NEW_LINE>logger.debug("switching socket A with housCode {}, receiverCode {} to {}", getHouseCode(<MASK><NEW_LINE>tinkerforgeDevice.switchSocketA(getHouseCode(), getReceiverCode(), switchTo);<NEW_LINE>setSwitchState(state);<NEW_LINE>} catch (TimeoutException e) {<NEW_LINE>TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_TIMEOUT_EXCEPTION, e);<NEW_LINE>} catch (NotConnectedException e) {<NEW_LINE>TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_NOT_CONNECTION_EXCEPTION, e);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>logger.warn("retry was interrupted");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.error("{} missing configuration for subid {} device will not switch", LoggerConstants.TFINITSUB, getSubId());<NEW_LINE>}<NEW_LINE>}
), getReceiverCode(), switchTo);
798,696
private void applyJavaConvention(Project project) {<NEW_LINE>JavaPluginExtension java = project.getExtensions().getByType(JavaPluginExtension.class);<NEW_LINE>java.setSourceCompatibility(JavaVersion.VERSION_1_8);<NEW_LINE>java.setTargetCompatibility(JavaVersion.VERSION_1_8);<NEW_LINE>project.getTasks().withType(JavaCompile.class).forEach(compileTask -> {<NEW_LINE>compileTask.getOptions().setEncoding("UTF-8");<NEW_LINE>compileTask.getOptions().setCompilerArgs(// intentionally disabled<NEW_LINE>Arrays.// intentionally disabled<NEW_LINE>asList(// intentionally disabled<NEW_LINE>"-Xlint:-varargs", // intentionally disabled<NEW_LINE>"-Xlint:cast", // intentionally disabled<NEW_LINE>"-Xlint:classfile", // intentionally disabled<NEW_LINE>"-Xlint:dep-ann", // intentionally disabled<NEW_LINE>"-Xlint:divzero", // intentionally disabled<NEW_LINE>"-Xlint:empty", // intentionally disabled<NEW_LINE>"-Xlint:finally", // intentionally disabled<NEW_LINE>"-Xlint:overrides", // intentionally disabled<NEW_LINE>"-Xlint:path", // intentionally disabled<NEW_LINE>"-Xlint:-processing", // intentionally disabled<NEW_LINE>"-Xlint:static", // intentionally disabled<NEW_LINE>"-Xlint:try", // intentionally disabled<NEW_LINE>"-Xlint:deprecation", // intentionally disabled<NEW_LINE>"-Xlint:unchecked", // intentionally disabled<NEW_LINE>"-Xlint:-serial", // intentionally disabled<NEW_LINE>"-Xlint:-options", "-Xlint:-fallthrough", "-Xmaxerrs", "500", "-Xmaxwarns", "1000"));<NEW_LINE>});<NEW_LINE>if (JavaVersion.current().isJava8Compatible()) {<NEW_LINE>project.getTasks().withType(JavaCompile.class, t -> {<NEW_LINE>if (t.getName().endsWith("TestJava")) {<NEW_LINE>List<String> args = new ArrayList<>(t.<MASK><NEW_LINE>args.add("-parameters");<NEW_LINE>t.getOptions().setCompilerArgs(args);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
getOptions().getCompilerArgs());
1,733,204
public static DescribeVsDomainPvUvDataResponse unmarshall(DescribeVsDomainPvUvDataResponse describeVsDomainPvUvDataResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeVsDomainPvUvDataResponse.setRequestId(_ctx.stringValue("DescribeVsDomainPvUvDataResponse.RequestId"));<NEW_LINE>describeVsDomainPvUvDataResponse.setDomainName(_ctx.stringValue("DescribeVsDomainPvUvDataResponse.DomainName"));<NEW_LINE>describeVsDomainPvUvDataResponse.setStartTime(_ctx.stringValue("DescribeVsDomainPvUvDataResponse.StartTime"));<NEW_LINE>describeVsDomainPvUvDataResponse.setEndTime(_ctx.stringValue("DescribeVsDomainPvUvDataResponse.EndTime"));<NEW_LINE>describeVsDomainPvUvDataResponse.setDataInterval(_ctx.stringValue("DescribeVsDomainPvUvDataResponse.DataInterval"));<NEW_LINE>List<PvUvDataInfo> pvUvDataInfos = new ArrayList<PvUvDataInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeVsDomainPvUvDataResponse.PvUvDataInfos.Length"); i++) {<NEW_LINE>PvUvDataInfo pvUvDataInfo = new PvUvDataInfo();<NEW_LINE>pvUvDataInfo.setPV(_ctx.stringValue("DescribeVsDomainPvUvDataResponse.PvUvDataInfos[" + i + "].PV"));<NEW_LINE>pvUvDataInfo.setUV(_ctx.stringValue<MASK><NEW_LINE>pvUvDataInfo.setTimeStamp(_ctx.stringValue("DescribeVsDomainPvUvDataResponse.PvUvDataInfos[" + i + "].TimeStamp"));<NEW_LINE>pvUvDataInfos.add(pvUvDataInfo);<NEW_LINE>}<NEW_LINE>describeVsDomainPvUvDataResponse.setPvUvDataInfos(pvUvDataInfos);<NEW_LINE>return describeVsDomainPvUvDataResponse;<NEW_LINE>}
("DescribeVsDomainPvUvDataResponse.PvUvDataInfos[" + i + "].UV"));
768,563
public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) {<NEW_LINE>if (!shortSyntax)<NEW_LINE>return super.visitField(access, name, desc, signature, value);<NEW_LINE>List<Attribute> attrs = new ArrayList<>();<NEW_LINE>return new FieldVisitor(Opcodes.ASM7) {<NEW_LINE><NEW_LINE>private final List<AnnotationDef> <MASK><NEW_LINE><NEW_LINE>@Override<NEW_LINE>public AnnotationVisitor visitAnnotation(String type, boolean visible) {<NEW_LINE>AnnotationDef ad = new AnnotationDef(type);<NEW_LINE>annotations.add(ad);<NEW_LINE>return new AnnotationVisitor(Opcodes.ASM7, super.visitAnnotation(type, visible)) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visit(String name, Object val) {<NEW_LINE>ad.addValue(name, val);<NEW_LINE>super.visit(name, val);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visitAttribute(Attribute atrbt) {<NEW_LINE>super.visitAttribute(atrbt);<NEW_LINE>attrs.add(atrbt);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visitEnd() {<NEW_LINE>FieldDescriptor fd = new FieldDescriptor(access, name, desc, signature, value, attrs, annotations);<NEW_LINE>fields.add(fd);<NEW_LINE>super.visitEnd();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
annotations = new ArrayList<>();
1,511,226
public ExcludedRule unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ExcludedRule excludedRule = new ExcludedRule();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("RuleId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>excludedRule.setRuleId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return excludedRule;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
129,741
private ListenableFuture<TbAlarmResult> createNewAlarm(TbContext ctx, TbMsg msg, Alarm msgAlarm) {<NEW_LINE>ListenableFuture<JsonNode> asyncDetails;<NEW_LINE>boolean buildDetails = !config.isUseMessageAlarmData() || config.isOverwriteAlarmDetails();<NEW_LINE>if (buildDetails) {<NEW_LINE>ctx.logJsEvalRequest();<NEW_LINE>asyncDetails = <MASK><NEW_LINE>} else {<NEW_LINE>asyncDetails = Futures.immediateFuture(null);<NEW_LINE>}<NEW_LINE>ListenableFuture<Alarm> asyncAlarm = Futures.transform(asyncDetails, details -> {<NEW_LINE>if (buildDetails) {<NEW_LINE>ctx.logJsEvalResponse();<NEW_LINE>}<NEW_LINE>Alarm newAlarm;<NEW_LINE>if (msgAlarm != null) {<NEW_LINE>newAlarm = msgAlarm;<NEW_LINE>if (buildDetails) {<NEW_LINE>newAlarm.setDetails(details);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>newAlarm = buildAlarm(msg, details, ctx.getTenantId());<NEW_LINE>}<NEW_LINE>return newAlarm;<NEW_LINE>}, MoreExecutors.directExecutor());<NEW_LINE>ListenableFuture<Alarm> asyncCreated = Futures.transform(asyncAlarm, alarm -> ctx.getAlarmService().createOrUpdateAlarm(alarm), ctx.getDbCallbackExecutor());<NEW_LINE>return Futures.transform(asyncCreated, alarm -> new TbAlarmResult(true, false, false, alarm), MoreExecutors.directExecutor());<NEW_LINE>}
buildAlarmDetails(ctx, msg, null);
258,060
public static void prepareAnalyticsMetadataProperties(AnalyticsMetadata bean) {<NEW_LINE>Map<String, String> additionalProperties = bean.getAdditionalProperties();<NEW_LINE>if (additionalProperties == null) {<NEW_LINE><MASK><NEW_LINE>bean.setAdditionalProperties(additionalProperties);<NEW_LINE>}<NEW_LINE>if (bean.getSourceId() != null) {<NEW_LINE>additionalProperties.put(IdMap.SOURCE_ID, String.join(Constants.SYNC_ID_LIST_DELIMITER, bean.getSourceId()));<NEW_LINE>}<NEW_LINE>if (bean.getSourceGuid() != null) {<NEW_LINE>additionalProperties.put(IdMap.SOURCE_GUID, String.join(Constants.SYNC_ID_LIST_DELIMITER, bean.getSourceGuid()));<NEW_LINE>}<NEW_LINE>additionalProperties.put(Constants.TYPE, bean.getType());<NEW_LINE>additionalProperties.put(Constants.SYNC_IDENTIFIER, bean.getIdentifier());<NEW_LINE>if (bean instanceof MetadataItem) {<NEW_LINE>MetadataItem item = (MetadataItem) bean;<NEW_LINE>additionalProperties.put(Constants.SYNC_EXPRESSION, item.getExpression());<NEW_LINE>additionalProperties.put(Constants.SYNC_DATA_TYPE, item.getDataType());<NEW_LINE>}<NEW_LINE>bean.setAdditionalProperties(additionalProperties);<NEW_LINE>}
additionalProperties = new HashMap<>();
847,505
private Mono<Response<Void>> deleteWithResponseAsync(String resourceGroupName, String factoryName, String pipelineName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (factoryName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter factoryName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (pipelineName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter pipelineName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, factoryName, pipelineName, this.client.getApiVersion(), accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
242,814
public static void main(String[] args) throws Exception {<NEW_LINE>dataLocalPath = DownloaderUtility.MODELIMPORT.Download();<NEW_LINE>final String SIMPLE_MLP = new File(dataLocalPath, "keras/simple_mlp.h5").getAbsolutePath();<NEW_LINE>// Keras Sequential models correspond to DL4J MultiLayerNetworks. We enforce loading the training configuration<NEW_LINE>// of the model as well. If you're only interested in inference, you can safely set this to 'false'.<NEW_LINE>MultiLayerNetwork model = KerasModelImport.importKerasSequentialModelAndWeights(SIMPLE_MLP, true);<NEW_LINE>// Test basic inference on the model.<NEW_LINE>INDArray input = Nd4j.create(256, 100);<NEW_LINE>INDArray output = model.output(input);<NEW_LINE>// Test basic model training.<NEW_LINE>model.fit(input, output);<NEW_LINE>// Sanity checks for import. First, check it optimizer is correct.<NEW_LINE>assert model.conf().getOptimizationAlgo().equals(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT);<NEW_LINE>// The first layer is a dense layer with 100 input and 64 output units, with RELU activation<NEW_LINE>Layer first = model.getLayer(0);<NEW_LINE>DenseLayer firstConf = (DenseLayer) first.conf().getLayer();<NEW_LINE>assert firstConf.getActivationFn().equals(Activation.RELU.getActivationFunction());<NEW_LINE><MASK><NEW_LINE>assert firstConf.getNOut() == 64;<NEW_LINE>// The second later is a dense layer with 64 input and 10 output units, with Softmax activation.<NEW_LINE>Layer second = model.getLayer(1);<NEW_LINE>DenseLayer secondConf = (DenseLayer) second.conf().getLayer();<NEW_LINE>assert secondConf.getActivationFn().equals(Activation.SOFTMAX.getActivationFunction());<NEW_LINE>assert secondConf.getNIn() == 64;<NEW_LINE>assert secondConf.getNOut() == 10;<NEW_LINE>// The loss function of the Keras model gets translated into a DL4J LossLayer, which is the final<NEW_LINE>// layer in this MLP.<NEW_LINE>Layer loss = model.getLayer(2);<NEW_LINE>LossLayer lossConf = (LossLayer) loss.conf().getLayer();<NEW_LINE>assert lossConf.getLossFn() instanceof LossMCXENT;<NEW_LINE>}
assert firstConf.getNIn() == 100;
1,515,032
final DeleteBotAliasResult executeDeleteBotAlias(DeleteBotAliasRequest deleteBotAliasRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteBotAliasRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteBotAliasRequest> request = null;<NEW_LINE>Response<DeleteBotAliasResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteBotAliasRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteBotAliasRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Lex Models V2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteBotAlias");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteBotAliasResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteBotAliasResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
173,530
private boolean initOpenVRCompositor(boolean set) {<NEW_LINE>if (set && vrSystem != null) {<NEW_LINE>vrCompositor = new VR_IVRCompositor_FnTable(JOpenVRLibrary.VR_GetGenericInterface(JOpenVRLibrary.IVRCompositor_Version, hmdErrorStore));<NEW_LINE>if (hmdErrorStore.get(0) == 0) {<NEW_LINE>logger.info("OpenVR Compositor initialized OK.");<NEW_LINE>vrCompositor.setAutoSynch(false);<NEW_LINE>vrCompositor.read();<NEW_LINE>vrCompositor.SetTrackingSpace.apply(JOpenVRLibrary.ETrackingUniverseOrigin.ETrackingUniverseOrigin_TrackingUniverseStanding);<NEW_LINE>} else {<NEW_LINE>String errorString = jopenvr.JOpenVRLibrary.VR_GetVRInitErrorAsEnglishDescription(hmdErrorStore.get(0)).getString(0);<NEW_LINE>logger.info("vrCompositor initialization failed:" + errorString);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (vrCompositor == null) {<NEW_LINE>logger.info("Skipping VR Compositor...");<NEW_LINE>}<NEW_LINE>// left eye<NEW_LINE>texBounds.uMax = 1f;<NEW_LINE>texBounds.uMin = 0f;<NEW_LINE>texBounds.vMax = 1f;<NEW_LINE>texBounds.vMin = 0f;<NEW_LINE>texBounds.setAutoSynch(false);<NEW_LINE>texBounds.setAutoRead(false);<NEW_LINE>texBounds.setAutoWrite(false);<NEW_LINE>texBounds.write();<NEW_LINE>// texture type<NEW_LINE>for (int nEye = 0; nEye < 2; nEye++) {<NEW_LINE>texType[0].eColorSpace = JOpenVRLibrary.EColorSpace.EColorSpace_ColorSpace_Gamma;<NEW_LINE>texType[0].eType = JOpenVRLibrary.EGraphicsAPIConvention.EGraphicsAPIConvention_API_OpenGL;<NEW_LINE>texType[0].setAutoSynch(false);<NEW_LINE>texType[0].setAutoRead(false);<NEW_LINE>texType[0].setAutoWrite(false);<NEW_LINE>texType[0].handle = -1;<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>logger.info("OpenVR Compositor initialized OK.");<NEW_LINE>return true;<NEW_LINE>}
texType[0].write();
413,985
public Component createComponent() {<NEW_LINE>JScrollPane customizerScrollPane = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);<NEW_LINE>customizerScrollPane.setBorder(BorderFactory.createEmptyBorder());<NEW_LINE>customizerScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());<NEW_LINE>customizerScrollPane.setOpaque(false);<NEW_LINE>customizerScrollPane.getViewport().setOpaque(false);<NEW_LINE>String hint = ppFactories[selectedPPFactoryIndex].getHint();<NEW_LINE>if (hint != null && !hint.isEmpty()) {<NEW_LINE>JPanel panel = new JPanel(new BorderLayout(0, 0));<NEW_LINE>panel.setOpaque(false);<NEW_LINE>panel.add(customizerScrollPane, BorderLayout.CENTER);<NEW_LINE>JTextArea area = new JTextArea(hint);<NEW_LINE>area.setOpaque(false);<NEW_LINE>area.setWrapStyleWord(true);<NEW_LINE>area.setLineWrap(true);<NEW_LINE>area.setEnabled(false);<NEW_LINE>// NOI18N<NEW_LINE>area.setFont<MASK><NEW_LINE>area.setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 5));<NEW_LINE>panel.add(area, BorderLayout.SOUTH);<NEW_LINE>return panel;<NEW_LINE>} else {<NEW_LINE>return customizerScrollPane;<NEW_LINE>}<NEW_LINE>}
(UIManager.getFont("Label.font"));
350,618
void fillElementControlHeader(ElementControlHeader elementControlHeader, InstanceAuditHeader header) {<NEW_LINE>if (header != null) {<NEW_LINE>elementControlHeader.setElementSourceServer(serverName);<NEW_LINE>elementControlHeader.setElementOriginCategory(this.getElementOriginCategory(header.getInstanceProvenanceType()));<NEW_LINE>elementControlHeader.setElementMetadataCollectionId(header.getMetadataCollectionId());<NEW_LINE>elementControlHeader.setElementMetadataCollectionName(header.getMetadataCollectionName());<NEW_LINE>elementControlHeader.setElementLicense(header.getInstanceLicense());<NEW_LINE>elementControlHeader.setElementCreatedBy(header.getCreatedBy());<NEW_LINE>elementControlHeader.setElementUpdatedBy(header.getUpdatedBy());<NEW_LINE>elementControlHeader.setElementMaintainedBy(header.getMaintainedBy());<NEW_LINE>elementControlHeader.<MASK><NEW_LINE>elementControlHeader.setElementUpdateTime(header.getUpdateTime());<NEW_LINE>elementControlHeader.setElementVersion(header.getVersion());<NEW_LINE>elementControlHeader.setStatus(this.getElementStatus(header.getStatus()));<NEW_LINE>elementControlHeader.setMappingProperties(header.getMappingProperties());<NEW_LINE>}<NEW_LINE>}
setElementCreateTime(header.getCreateTime());
1,047,194
protected void processConfiguration(ContainerUnloader container, Workspace workspace) {<NEW_LINE>// Configuration<NEW_LINE>GraphController graphController = Lookup.getDefault().lookup(GraphController.class);<NEW_LINE>Configuration configuration = new Configuration();<NEW_LINE>configuration.setTimeRepresentation(container.getTimeRepresentation());<NEW_LINE>if (container.getEdgeTypeLabelClass() != null) {<NEW_LINE>configuration.setEdgeLabelType(container.getEdgeTypeLabelClass());<NEW_LINE>}<NEW_LINE>configuration.setNodeIdType(container.getElementIdType().getTypeClass());<NEW_LINE>configuration.setEdgeIdType(container.getElementIdType().getTypeClass());<NEW_LINE>ColumnDraft weightColumn = container.getEdgeColumn("weight");<NEW_LINE>if (weightColumn != null && weightColumn.isDynamic()) {<NEW_LINE>if (container.getTimeRepresentation().equals(TimeRepresentation.INTERVAL)) {<NEW_LINE>configuration.setEdgeWeightType(IntervalDoubleMap.class);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>GraphConfigurationWrapper originalConfig = new GraphConfigurationWrapper(graphController.getGraphModel(workspace).getConfiguration());<NEW_LINE>if (container.getEdgeCount() == 0) {<NEW_LINE>// Fix different config problems that are not actually problems since no edges are present:<NEW_LINE>// A case user-friendly specially for spreadsheet import<NEW_LINE>// Make weight types match:<NEW_LINE>if (!originalConfig.edgeWeightType.equals(configuration.getEdgeWeightType())) {<NEW_LINE>configuration.setEdgeWeightType(originalConfig.edgeWeightType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>GraphConfigurationWrapper newConfig = new GraphConfigurationWrapper(configuration);<NEW_LINE>if (!originalConfig.equals(newConfig)) {<NEW_LINE>try {<NEW_LINE>graphController.getGraphModel(workspace).setConfiguration(configuration);<NEW_LINE>} catch (Exception e) {<NEW_LINE>String message = NbBundle.getMessage(DefaultProcessor.class, "DefaultProcessor.error.configurationChangeForbidden", new GraphConfigurationWrapper(graphController.getGraphModel(workspace).getConfiguration()).toString(), new GraphConfigurationWrapper(configuration).toString());<NEW_LINE>report.logIssue(new Issue(message, Issue.Level.SEVERE));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
configuration.setEdgeWeightType(TimestampDoubleMap.class);
1,305,294
public void process(JCas jcas) throws AnalysisEngineProcessException {<NEW_LINE>JCas resultView, passagesView, pickedPassagesView, questionView;<NEW_LINE>try {<NEW_LINE>resultView = jcas.getView("Result");<NEW_LINE>passagesView = jcas.getView("Passages");<NEW_LINE>jcas.createView("PickedPassages");<NEW_LINE>questionView = jcas.getView("Question");<NEW_LINE>pickedPassagesView = jcas.getView("PickedPassages");<NEW_LINE>} catch (CASException e) {<NEW_LINE>throw new AnalysisEngineProcessException(e);<NEW_LINE>}<NEW_LINE>pickedPassagesView.<MASK><NEW_LINE>pickedPassagesView.setDocumentLanguage(passagesView.getDocumentLanguage());<NEW_LINE>int sourceID = JCasUtil.selectSingle(resultView, ResultInfo.class).getSourceID();<NEW_LINE>FSIndex idx = passagesView.getJFSIndexRepository().getIndex("SortedPassages");<NEW_LINE>FSIterator passages = idx.iterator();<NEW_LINE>int i = 0;<NEW_LINE>CasCopier copier = new CasCopier(passagesView.getCas(), pickedPassagesView.getCas());<NEW_LINE>while (passages.hasNext() && i++ < numPicked) {<NEW_LINE>Passage passage = (Passage) passages.next();<NEW_LINE>AnsweringPassage ap = new AnsweringPassage(SnippetIDGenerator.getInstance().generateID(), sourceID, passage.getCoveredText());<NEW_LINE>QuestionDashboard.getInstance().get(questionView).addSnippet(ap);<NEW_LINE>Passage p2 = (Passage) copier.copyFs(passage);<NEW_LINE>p2.setSnippetID(ap.getSnippetID());<NEW_LINE>p2.addToIndexes();<NEW_LINE>for (Annotation a : covering.get(passage)) {<NEW_LINE>if (!copier.alreadyCopied(a)) {<NEW_LINE>Annotation a2 = (Annotation) copier.copyFs(a);<NEW_LINE>a2.addToIndexes();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int n_tokens = JCasUtil.selectCovered(Token.class, passage).size();<NEW_LINE>logger.debug(passage.getScore() + " | " + passage.getCoveredText() + " | " + n_tokens);<NEW_LINE>}<NEW_LINE>}
setDocumentText(passagesView.getDocumentText());
451,099
public String toStringEntries() {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>try (ReadOptions readOptions = new ReadOptions().setTotalOrderSeek(true);<NEW_LINE>RocksIterator inodeIter = db().newIterator(mInodesColumn.get(), readOptions)) {<NEW_LINE>inodeIter.seekToFirst();<NEW_LINE>while (inodeIter.isValid()) {<NEW_LINE>MutableInode<?> inode;<NEW_LINE>try {<NEW_LINE>inode = MutableInode.fromProto(InodeMeta.Inode.parseFrom(inodeIter.value()));<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>sb.append("Inode " + Longs.fromByteArray(inodeIter.key()<MASK><NEW_LINE>inodeIter.next();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try (RocksIterator edgeIter = db().newIterator(mEdgesColumn.get())) {<NEW_LINE>edgeIter.seekToFirst();<NEW_LINE>while (edgeIter.isValid()) {<NEW_LINE>byte[] key = edgeIter.key();<NEW_LINE>byte[] id = new byte[Longs.BYTES];<NEW_LINE>byte[] name = new byte[key.length - Longs.BYTES];<NEW_LINE>System.arraycopy(key, 0, id, 0, Longs.BYTES);<NEW_LINE>System.arraycopy(key, Longs.BYTES, name, 0, key.length - Longs.BYTES);<NEW_LINE>sb.append(String.format("<%s,%s>->%s%n", Longs.fromByteArray(id), new String(name), Longs.fromByteArray(edgeIter.value())));<NEW_LINE>edgeIter.next();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>}
) + ": " + inode + "\n");
1,671,392
private static void testArithmetic() {<NEW_LINE>int a = 6;<NEW_LINE>int b = 3;<NEW_LINE>int c = -1;<NEW_LINE>assertTrue(a * b == 18);<NEW_LINE>assertTrue(a / b == 2);<NEW_LINE>assertTrue(a % b == 0);<NEW_LINE><MASK><NEW_LINE>assertTrue(a - b == 3);<NEW_LINE>assertTrue(a << 1 == 12);<NEW_LINE>assertTrue(c >> 16 == -1);<NEW_LINE>assertTrue(c >>> 16 == 65535);<NEW_LINE>assertTrue(a > b);<NEW_LINE>assertTrue(a >= b);<NEW_LINE>assertTrue(b < a);<NEW_LINE>assertTrue(b <= a);<NEW_LINE>assertTrue(a != b);<NEW_LINE>assertTrue((a ^ b) == 5);<NEW_LINE>assertTrue((a & b) == 2);<NEW_LINE>assertTrue((a | b) == 7);<NEW_LINE>assertTrue((a > b) && (a == 6));<NEW_LINE>assertTrue((a < b) || (a == 6));<NEW_LINE>assertTrue((-1 >>> 0) == -1);<NEW_LINE>assertTrue(a + b + a - b == 12);<NEW_LINE>assertTrue((a + b) * (a - b) == 27);<NEW_LINE>assertTrue(((5 / 2) - 0.0) == 2.0);<NEW_LINE>int i = 1;<NEW_LINE>i += 1L;<NEW_LINE>assertTrue(i == 2);<NEW_LINE>i += Double.MAX_VALUE;<NEW_LINE>assertTrue(i == Integer.MAX_VALUE);<NEW_LINE>int d = 10;<NEW_LINE>assertTrue(d == 10);<NEW_LINE>d ^= d;<NEW_LINE>assertTrue(d == 0);<NEW_LINE>d += 15;<NEW_LINE>assertTrue(d == 15);<NEW_LINE>d -= 5;<NEW_LINE>assertTrue(d == 10);<NEW_LINE>d *= 2;<NEW_LINE>assertTrue(d == 20);<NEW_LINE>d /= 4;<NEW_LINE>assertTrue(d == 5);<NEW_LINE>d &= 3;<NEW_LINE>assertTrue(d == 1);<NEW_LINE>d |= 2;<NEW_LINE>assertTrue(d == 3);<NEW_LINE>d %= 2;<NEW_LINE>assertTrue(d == 1);<NEW_LINE>d <<= 3;<NEW_LINE>assertTrue(d == 8);<NEW_LINE>d >>= 3;<NEW_LINE>assertTrue(d == 1);<NEW_LINE>d = -1;<NEW_LINE>d >>>= 16;<NEW_LINE>assertTrue(d == 65535);<NEW_LINE>d = -1;<NEW_LINE>d >>>= 0;<NEW_LINE>assertTrue(d == -1);<NEW_LINE>// Make sure that promotion rules from shift operations are correct.<NEW_LINE>assertTrue(Integer.MAX_VALUE << 1L == -2);<NEW_LINE>}
assertTrue(a + b == 9);
406,453
private void resize(double inc) {<NEW_LINE>final int cols = widths.size(), rows = heights.size();<NEW_LINE>if (LOG.isDebuggingFine()) {<NEW_LINE>LOG.debugFine("Resize by " + inc + "x" + (inc / ratio));<NEW_LINE>if (LOG.isDebuggingFinest()) {<NEW_LINE>logSizes();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// TODO: if the last row or column is empty, we can do this simpler<NEW_LINE>widths.add(inc);<NEW_LINE>twidth += inc;<NEW_LINE>heights.add(inc / ratio);<NEW_LINE>theight += inc / ratio;<NEW_LINE>// Add column:<NEW_LINE>for (int y = 0; y < rows; y++) {<NEW_LINE>usage.get<MASK><NEW_LINE>}<NEW_LINE>// Add row:<NEW_LINE>ArrayList<Object> row = new ArrayList<>();<NEW_LINE>for (int x = 0; x <= cols; x++) {<NEW_LINE>row.add(null);<NEW_LINE>}<NEW_LINE>usage.add(row);<NEW_LINE>assert assertConsistent();<NEW_LINE>if (LOG.isDebuggingFinest()) {<NEW_LINE>logSizes();<NEW_LINE>}<NEW_LINE>}
(y).add(null);
1,306,217
public void onItemFrameInteract(final PlayerInteractEntityEvent event) {<NEW_LINE>final User user = ess.getUser(event.getPlayer());<NEW_LINE>if (!(event.getRightClicked() instanceof ItemFrame)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (prot.getSettingBool(AntiBuildConfig.disable_build) && !user.canBuild() && !user.isAuthorized("essentials.build") && !metaPermCheck(user, "place", Material.ITEM_FRAME)) {<NEW_LINE>if (ess.getSettings().warnOnBuildDisallow()) {<NEW_LINE>user.sendMessage(tl("antiBuildPlace", Material<MASK><NEW_LINE>}<NEW_LINE>event.setCancelled(true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (prot.checkProtectionItems(AntiBuildConfig.blacklist_placement, Material.ITEM_FRAME) && !user.isAuthorized("essentials.protect.exemptplacement")) {<NEW_LINE>if (ess.getSettings().warnOnBuildDisallow()) {<NEW_LINE>user.sendMessage(tl("antiBuildPlace", Material.ITEM_FRAME.toString()));<NEW_LINE>}<NEW_LINE>event.setCancelled(true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (prot.checkProtectionItems(AntiBuildConfig.alert_on_placement, Material.ITEM_FRAME) && !user.isAuthorized("essentials.protect.alerts.notrigger")) {<NEW_LINE>prot.getEssentialsConnect().alert(user, Material.ITEM_FRAME.toString(), tl("alertPlaced"));<NEW_LINE>}<NEW_LINE>}
.ITEM_FRAME.toString()));
1,379,199
public ListenableFuture<Map<String, Object>> run(final Object command) {<NEW_LINE>if (!processing.get()) {<NEW_LINE>SettableFuture<Map<String, Object>> die = SettableFuture.create();<NEW_LINE>die.setException(new WatchmanException("connection closing down"));<NEW_LINE>return die;<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>final AtomicReference<Map<String, Object>> resultRef = new AtomicReference<Map<String, Object>>();<NEW_LINE>final AtomicReference<Exception> errorRef = new AtomicReference<Exception>();<NEW_LINE>QueuedCommand queuedCommand = new QueuedCommandBuilder().command(command).latch(latch).resultRef(resultRef).errorRef(errorRef).build();<NEW_LINE>commandQueue.add(queuedCommand);<NEW_LINE>return outgoingMessageExecutor.submit(new Callable<Map<String, Object>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Map<String, Object> call() throws Exception {<NEW_LINE>if (commandListener.isPresent()) {<NEW_LINE>commandListener.get().onStart();<NEW_LINE>}<NEW_LINE>if (processing.get()) {<NEW_LINE>bserSerializer.serializeToStream(command, outgoingMessageStream);<NEW_LINE>}<NEW_LINE>if (commandListener.isPresent()) {<NEW_LINE>commandListener.get().onSent();<NEW_LINE>}<NEW_LINE>latch.await();<NEW_LINE>if (commandListener.isPresent()) {<NEW_LINE>commandListener.get().onReceived();<NEW_LINE>}<NEW_LINE>if (resultRef.get() != null)<NEW_LINE>return resultRef.get();<NEW_LINE>throw errorRef.get();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
CountDownLatch latch = new CountDownLatch(1);
140,145
private static void parseConst(AnnotationsBuilder builder, int index, ParsedString line) {<NEW_LINE>// const is already taken.<NEW_LINE>if (!line.takeSomeWhitespace()) {<NEW_LINE>builder.diagnostics.put(index, "Expected whitespace after const and before type declaration");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean isString;<NEW_LINE>if (line.takeLiteral("int") || line.takeLiteral("float")) {<NEW_LINE>isString = true;<NEW_LINE>} else if (line.takeLiteral("bool")) {<NEW_LINE>isString = false;<NEW_LINE>} else {<NEW_LINE>builder.diagnostics.put(index, "Unexpected type declaration after const. " + "Expected int, float, or bool. " + "Vector const declarations cannot be configured using shader options.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!line.takeSomeWhitespace()) {<NEW_LINE>builder.diagnostics.put(index, "Expected whitespace after type declaration.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String name = line.takeWord();<NEW_LINE>if (name == null) {<NEW_LINE>builder.diagnostics.put(index, "Expected name of option after type declaration, " + "but an unexpected character was detected first.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>line.takeSomeWhitespace();<NEW_LINE>if (!line.takeLiteral("=")) {<NEW_LINE>builder.diagnostics.put(index, "Unexpected characters before equals sign in const declaration.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>line.takeSomeWhitespace();<NEW_LINE>String value = line.takeWordOrNumber();<NEW_LINE>if (value == null) {<NEW_LINE>builder.diagnostics.put(index, "Unexpected non-whitespace characters after equals sign");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>line.takeSomeWhitespace();<NEW_LINE>if (!line.takeLiteral(";")) {<NEW_LINE>builder.diagnostics.put(index, "Value between the equals sign and the semicolon wasn't parsed as a valid word or number.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>line.takeSomeWhitespace();<NEW_LINE>String comment;<NEW_LINE>if (line.takeComments()) {<NEW_LINE>comment = line.takeRest().trim();<NEW_LINE>} else if (!line.isEnd()) {<NEW_LINE>builder.<MASK><NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>comment = null;<NEW_LINE>}<NEW_LINE>if (!isString) {<NEW_LINE>boolean booleanValue;<NEW_LINE>if ("true".equals(value)) {<NEW_LINE>booleanValue = true;<NEW_LINE>} else if ("false".equals(value)) {<NEW_LINE>booleanValue = false;<NEW_LINE>} else {<NEW_LINE>builder.diagnostics.put(index, "Expected true or false as the value of a boolean const option, but got " + value + ".");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!VALID_CONST_OPTION_NAMES.contains(name)) {<NEW_LINE>builder.diagnostics.put(index, "This was a valid const boolean option declaration, but " + name + " was not recognized as being a name of one of the configurable const options.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>builder.booleanOptions.put(index, new BooleanOption(OptionType.CONST, name, comment, booleanValue));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!VALID_CONST_OPTION_NAMES.contains(name)) {<NEW_LINE>builder.diagnostics.put(index, "This was a valid const option declaration, but " + name + " was not recognized as being a name of one of the configurable const options.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StringOption option = StringOption.create(OptionType.CONST, name, comment, value);<NEW_LINE>if (option != null) {<NEW_LINE>builder.stringOptions.put(index, option);<NEW_LINE>} else {<NEW_LINE>builder.diagnostics.put(index, "Ignoring this const option because it is missing an allowed values list" + "in a comment, but is not a boolean const option.");<NEW_LINE>}<NEW_LINE>}
diagnostics.put(index, "Unexpected non-whitespace characters outside of comment after semicolon");
243,810
static List<String> choose(final List<String> userDefinedJvmOptions) throws InterruptedException, IOException {<NEW_LINE>final List<String> ergonomicChoices = new ArrayList<>();<NEW_LINE>final Map<String, JvmOption> <MASK><NEW_LINE>final long heapSize = JvmOption.extractMaxHeapSize(finalJvmOptions);<NEW_LINE>final long maxDirectMemorySize = JvmOption.extractMaxDirectMemorySize(finalJvmOptions);<NEW_LINE>if (maxDirectMemorySize == 0) {<NEW_LINE>ergonomicChoices.add("-XX:MaxDirectMemorySize=" + heapSize / 2);<NEW_LINE>}<NEW_LINE>final boolean tuneG1GCForSmallHeap = tuneG1GCForSmallHeap(heapSize);<NEW_LINE>final boolean tuneG1GCHeapRegion = tuneG1GCHeapRegion(finalJvmOptions, tuneG1GCForSmallHeap);<NEW_LINE>final boolean tuneG1GCInitiatingHeapOccupancyPercent = tuneG1GCInitiatingHeapOccupancyPercent(finalJvmOptions);<NEW_LINE>final int tuneG1GCReservePercent = tuneG1GCReservePercent(finalJvmOptions, tuneG1GCForSmallHeap);<NEW_LINE>if (tuneG1GCHeapRegion) {<NEW_LINE>ergonomicChoices.add("-XX:G1HeapRegionSize=4m");<NEW_LINE>}<NEW_LINE>if (tuneG1GCInitiatingHeapOccupancyPercent) {<NEW_LINE>ergonomicChoices.add("-XX:InitiatingHeapOccupancyPercent=30");<NEW_LINE>}<NEW_LINE>if (tuneG1GCReservePercent != 0) {<NEW_LINE>ergonomicChoices.add("-XX:G1ReservePercent=" + tuneG1GCReservePercent);<NEW_LINE>}<NEW_LINE>return ergonomicChoices;<NEW_LINE>}
finalJvmOptions = JvmOption.findFinalOptions(userDefinedJvmOptions);
1,363,899
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {<NEW_LINE>super.<MASK><NEW_LINE>if (requestCode == REQUEST_STORAGE_PERMISSION && permissions.length == 1) {<NEW_LINE>if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {<NEW_LINE>invalidateOptionsMenu();<NEW_LINE>handleStartup();<NEW_LINE>} else {<NEW_LINE>// User denied access to file storage so show error toast and display "App Info"<NEW_LINE>UIUtils.showThemedToast(this, R.string.startup_no_storage_permission, false);<NEW_LINE>finishWithoutAnimation();<NEW_LINE>// Open the Android settings page for our app so that the user can grant the missing permission<NEW_LINE>Intent intent = new Intent();<NEW_LINE>intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);<NEW_LINE>Uri uri = Uri.fromParts("package", getPackageName(), null);<NEW_LINE>intent.setData(uri);<NEW_LINE>startActivityWithoutAnimation(intent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
onRequestPermissionsResult(requestCode, permissions, grantResults);
830,841
private void retryDownedHosts() {<NEW_LINE>// we only check the ring if we have nodes in the cluster to query<NEW_LINE>// and auto discovery is on. Otherwise we risk removing hosts from the ring with no way to re-add them<NEW_LINE>boolean checkRing = connectionManager.getHosts().size() > 0 && autoDiscoverHosts ? true : false;<NEW_LINE>Set<CassandraHost> ringInfo = null;<NEW_LINE>if (checkRing) {<NEW_LINE>// Let's check the ring just once per cycle.<NEW_LINE>ringInfo = buildRingInfo();<NEW_LINE>if (ringInfo != null && ringInfo.isEmpty()) {<NEW_LINE>ringInfo = null;<NEW_LINE>log.warn("Got an empty ring info, maybe not enough permission");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Iterator<CassandraHost> iter = downedHostQueue.iterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>CassandraHost cassandraHost = iter.next();<NEW_LINE>if (cassandraHost == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (connectionManager.getHosts().size() == 0) {<NEW_LINE>listenerHandler.fireOnAllHostsDown();<NEW_LINE>log.info("Not checking that {} is a member of the ring since there are no live hosts", cassandraHost);<NEW_LINE>}<NEW_LINE>// The host may have been removed from the ring. It makes no sense to keep trying<NEW_LINE>// to connect to it. If the ThriftCluster is unknown to HFactory, ringInfo may not be available,<NEW_LINE>// in which case we have no choice but to continue checking.<NEW_LINE>if (checkRing && ringInfo != null && !ringInfo.contains(cassandraHost)) {<NEW_LINE>log.info("Removing host " + <MASK><NEW_LINE>iter.remove();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>boolean reconnected = verifyConnection(cassandraHost);<NEW_LINE>log.info("Downed Host retry status {} with host: {}", reconnected, cassandraHost.getName());<NEW_LINE>if (reconnected) {<NEW_LINE>connectionManager.addCassandraHost(cassandraHost);<NEW_LINE>// we can't call iter.remove() based on return value of connectionManager.addCassandraHost, since<NEW_LINE>// that returns false if an error occurs, or if the host already exists<NEW_LINE>if (connectionManager.getHosts().contains(cassandraHost)) {<NEW_LINE>listenerHandler.fireOnHostRestored(cassandraHost);<NEW_LINE>iter.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
cassandraHost.getName() + " - It does no longer exist in the ring.");
831,257
private void exportTask(Task t, net.sf.mpxj.Task mpxjParentTask, int outlineLevel, int ordinalNum, Map<Integer, net.sf.mpxj.Task> id2mpxjTask, Map<CustomPropertyDefinition, FieldType> customProperty_fieldType) {<NEW_LINE>final net.sf.mpxj.Task mpxjTask = mpxjParentTask == null ? myOutputProject.addTask<MASK><NEW_LINE>mpxjTask.setOutlineLevel(outlineLevel);<NEW_LINE>String wbs = (mpxjParentTask == null ? "" : mpxjParentTask.getWBS() + ".") + String.valueOf(ordinalNum);<NEW_LINE>mpxjTask.setWBS(wbs);<NEW_LINE>mpxjTask.setOutlineNumber(wbs);<NEW_LINE>mpxjTask.setUniqueID(convertTaskId(t.getTaskID()));<NEW_LINE>mpxjTask.setID(id2mpxjTask.size() + 1);<NEW_LINE>mpxjTask.setName(t.getName());<NEW_LINE>mpxjTask.setNotes(t.getNotes());<NEW_LINE>mpxjTask.setMilestone(t.isMilestone());<NEW_LINE>mpxjTask.setPercentageComplete(t.getCompletionPercentage());<NEW_LINE>mpxjTask.setHyperlink(((GanttTask) t).getWebLink());<NEW_LINE>mpxjTask.setIgnoreResourceCalendar(true);<NEW_LINE>Task[] nestedTasks = getTaskHierarchy().getNestedTasks(t);<NEW_LINE>mpxjTask.setTaskMode(TaskMode.MANUALLY_SCHEDULED);<NEW_LINE>Date startTime = convertStartTime(t.getStart().getTime());<NEW_LINE>mpxjTask.setStart(startTime);<NEW_LINE>Duration duration = convertDuration(t.getDuration());<NEW_LINE>mpxjTask.setDuration(duration);<NEW_LINE>mpxjTask.setManualDuration(duration);<NEW_LINE>if (t.isMilestone()) {<NEW_LINE>mpxjTask.setFinish(startTime);<NEW_LINE>} else {<NEW_LINE>Date finishTime = convertFinishTime(t.getEnd().getTime());<NEW_LINE>mpxjTask.setFinish(finishTime);<NEW_LINE>}<NEW_LINE>mpxjTask.setCost(t.getCost().getValue());<NEW_LINE>// mpxjTask.setDurationFormat(TimeUnit.DAYS);<NEW_LINE>Duration[] durations = getActualAndRemainingDuration(mpxjTask);<NEW_LINE>mpxjTask.setActualDuration(durations[0]);<NEW_LINE>mpxjTask.setRemainingDuration(durations[1]);<NEW_LINE>mpxjTask.setPriority(convertPriority(t));<NEW_LINE>exportCustomProperties(t.getCustomValues(), customProperty_fieldType, new CustomPropertySetter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void set(FieldType ft, Object value) {<NEW_LINE>mpxjTask.set(ft, value);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>id2mpxjTask.put(mpxjTask.getUniqueID(), mpxjTask);<NEW_LINE>int i = 0;<NEW_LINE>for (Task child : nestedTasks) {<NEW_LINE>exportTask(child, mpxjTask, outlineLevel + 1, ++i, id2mpxjTask, customProperty_fieldType);<NEW_LINE>}<NEW_LINE>}
() : mpxjParentTask.addTask();
160,551
protected void initializeComponents() {<NEW_LINE>super.initializeComponents();<NEW_LINE>JPanel contentPanel = getContentPanel();<NEW_LINE>{<NEW_LINE>JLabel label = new JLabel("Value:");<NEW_LINE>contentPanel.add(label, new GridBagConstraints(0, 1, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 6), 0, 0));<NEW_LINE>}<NEW_LINE>{<NEW_LINE>valueSpinner = new JSpinner(new SpinnerNumberModel(new Float(0), new Float(-99999), new Float(99999)<MASK><NEW_LINE>contentPanel.add(valueSpinner, new GridBagConstraints(1, 1, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));<NEW_LINE>}<NEW_LINE>valueSpinner.addChangeListener(new ChangeListener() {<NEW_LINE><NEW_LINE>public void stateChanged(ChangeEvent event) {<NEW_LINE>NumericPanel.this.value.setValue((Float) valueSpinner.getValue());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
, new Float(0.1f)));
236,592
private static org.jreleaser.model.Snap convertSnap(Snap packager) {<NEW_LINE>org.jreleaser.model.Snap t = new org.jreleaser.model.Snap();<NEW_LINE>convertPackager(packager, t);<NEW_LINE>t.setPackageName(tr<MASK><NEW_LINE>t.setTemplateDirectory(tr(packager.getTemplateDirectory()));<NEW_LINE>t.setSkipTemplates(tr(packager.getSkipTemplates()));<NEW_LINE>if (isNotBlank(packager.getBase()))<NEW_LINE>t.setBase(packager.getBase());<NEW_LINE>if (isNotBlank(packager.getGrade()))<NEW_LINE>t.setGrade(packager.getGrade());<NEW_LINE>if (isNotBlank(packager.getConfinement()))<NEW_LINE>t.setConfinement(packager.getConfinement());<NEW_LINE>if (null != packager.getExportedLogin())<NEW_LINE>t.setExportedLogin(packager.getExportedLogin().getAbsolutePath());<NEW_LINE>t.setRemoteBuild(packager.isRemoteBuild());<NEW_LINE>t.setLocalPlugs(packager.getLocalPlugs());<NEW_LINE>t.setLocalSlots(packager.getLocalSlots());<NEW_LINE>t.setPlugs(convertPlugs(packager.getPlugs()));<NEW_LINE>t.setSlots(convertSlots(packager.getSlots()));<NEW_LINE>t.setArchitectures(convertArchitectures(packager.getArchitectures()));<NEW_LINE>t.setSnap(convertSnapTap(packager.getSnap()));<NEW_LINE>t.setCommitAuthor(convertCommitAuthor(packager.getCommitAuthor()));<NEW_LINE>return t;<NEW_LINE>}
(packager.getPackageName()));
752,331
public static int createTopicIfNotExists(String topic, short replicationFactor, double partitionToBrokerRatio, int minPartitionNum, Properties topicConfig, AdminClient adminClient) throws ExecutionException, InterruptedException {<NEW_LINE>try {<NEW_LINE>if (adminClient.listTopics().names().get().contains(topic)) {<NEW_LINE>LOG.info("AdminClient indicates that topic {} already exists in the cluster. Topic config: {}", topic, topicConfig);<NEW_LINE>return getPartitionNumForTopic(adminClient, topic);<NEW_LINE>}<NEW_LINE>int <MASK><NEW_LINE>int partitionCount = Math.max((int) Math.ceil(brokerCount * partitionToBrokerRatio), minPartitionNum);<NEW_LINE>try {<NEW_LINE>NewTopic newTopic = new NewTopic(topic, partitionCount, replicationFactor);<NEW_LINE>// noinspection rawtypes<NEW_LINE>newTopic.configs((Map) topicConfig);<NEW_LINE>List<NewTopic> topics = new ArrayList<>();<NEW_LINE>topics.add(newTopic);<NEW_LINE>CreateTopicsResult result = adminClient.createTopics(topics);<NEW_LINE>// waits for this topic creation future to complete, and then returns its result.<NEW_LINE>result.values().get(topic).get();<NEW_LINE>LOG.info("CreateTopicsResult: {}.", result.values());<NEW_LINE>} catch (TopicExistsException e) {
brokerCount = Utils.getBrokerCount(adminClient);
1,784,180
public void run(final FlowTrigger chain, Map data) {<NEW_LINE>final VmInstanceSpec spec = (VmInstanceSpec) data.get(VmInstanceConstant.Params.VmInstanceSpec.toString());<NEW_LINE>StopVmOnHypervisorMsg msg = new StopVmOnHypervisorMsg();<NEW_LINE>msg.setVmInventory(spec.getVmInventory());<NEW_LINE>if (spec.getMessage() instanceof StopVmMessage) {<NEW_LINE>msg.setType(((StopVmMessage) spec.getMessage()).getType());<NEW_LINE>} else if (spec.getMessage() instanceof RebootVmInstanceMsg) {<NEW_LINE>msg.setType(((RebootVmInstanceMsg) spec.getMessage()).getType());<NEW_LINE>}<NEW_LINE>for (BeforeStopVmOnHypervisorExtensionPoint ext : pluginRegistry.getExtensionList(BeforeStopVmOnHypervisorExtensionPoint.class)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>bus.makeTargetServiceIdByResourceUuid(msg, HostConstant.SERVICE_ID, spec.getVmInventory().getHostUuid());<NEW_LINE>bus.send(msg, new CloudBusCallBack(chain) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(MessageReply reply) {<NEW_LINE>if (reply.isSuccess()) {<NEW_LINE>chain.next();<NEW_LINE>} else {<NEW_LINE>if (spec.isGcOnStopFailure() && reply.getError().isError(HostErrors.OPERATION_FAILURE_GC_ELIGIBLE)) {<NEW_LINE>StopVmGC gc = new StopVmGC();<NEW_LINE>gc.inventory = spec.getVmInventory();<NEW_LINE>gc.hostUuid = spec.getVmInventory().getHostUuid();<NEW_LINE>gc.NAME = String.format("gc-stop-vm-%s-%s-on-host-%s", gc.inventory.getUuid(), gc.inventory.getName(), gc.hostUuid);<NEW_LINE>gc.submit();<NEW_LINE>chain.next();<NEW_LINE>} else {<NEW_LINE>chain.fail(reply.getError());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
ext.beforeStopVmOnHypervisor(spec, msg);
1,821,331
public void menuSelected(MenuEvent event) {<NEW_LINE>Set<JMenuItem> unseen = new HashSet<>(itemMap.values());<NEW_LINE>for (final Editor editor : base.getEditors()) {<NEW_LINE><MASK><NEW_LINE>JMenuItem item = itemMap.get(sketch);<NEW_LINE>if (item != null) {<NEW_LINE>unseen.remove(item);<NEW_LINE>} else {<NEW_LINE>// it's a new item<NEW_LINE>item = new JCheckBoxMenuItem();<NEW_LINE>sketchMenu.add(item);<NEW_LINE>itemMap.put(sketch, item);<NEW_LINE>}<NEW_LINE>// set selected if the current sketch, deselect if not<NEW_LINE>item.setSelected(sketch.equals(getSketch()));<NEW_LINE>// name may have changed while Sketch object stayed the same<NEW_LINE>String name = sketch.getName();<NEW_LINE>if (!editor.getMode().equals(base.getDefaultMode())) {<NEW_LINE>name += " (" + editor.getMode().getTitle() + ")";<NEW_LINE>}<NEW_LINE>item.setText(name);<NEW_LINE>// Action listener to bring the appropriate sketch in front<NEW_LINE>item.addActionListener(e -> {<NEW_LINE>editor.setState(Frame.NORMAL);<NEW_LINE>editor.setVisible(true);<NEW_LINE>editor.toFront();<NEW_LINE>});<NEW_LINE>// Disabling for now, might be problematic [fry 200117]<NEW_LINE>// Toolkit.setMenuMnemsInside(sketchMenu);<NEW_LINE>}<NEW_LINE>for (JMenuItem item : unseen) {<NEW_LINE>sketchMenu.remove(item);<NEW_LINE>Sketch s = findSketch(item);<NEW_LINE>if (s != null) {<NEW_LINE>itemMap.remove(s);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Sketch sketch = editor.getSketch();
777,802
private void initCombos() {<NEW_LINE>BugzillaRepository repository = issue.getRepository();<NEW_LINE>BugzillaConfiguration bc = repository.getConfiguration();<NEW_LINE>if (bc == null || !bc.isValid()) {<NEW_LINE>// XXX nice error msg?<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>productCombo.setModel(toComboModel(bc.getProducts()));<NEW_LINE>// componentCombo, versionCombo, targetMilestoneCombo are filled<NEW_LINE>// automatically when productCombo is set/changed<NEW_LINE>platformCombo.setModel(toComboModel(bc.getPlatforms()));<NEW_LINE>osCombo.setModel(toComboModel(bc.getOSs()));<NEW_LINE>// Do not support MOVED resolution (yet?)<NEW_LINE>List<String> resolutions = new LinkedList<>(bc.getResolutions());<NEW_LINE>// NOI18N<NEW_LINE>resolutions.remove("MOVED");<NEW_LINE>resolutionCombo.setModel(toComboModel(resolutions));<NEW_LINE>priorityCombo.setModel(toComboModel(bc.getPriorities()));<NEW_LINE>priorityCombo.setRenderer(new PriorityRenderer());<NEW_LINE>severityCombo.setModel(toComboModel(bc.getSeverities()));<NEW_LINE>initAssignedCombo();<NEW_LINE>if (BugzillaUtil.isNbRepository(repository)) {<NEW_LINE>issueTypeCombo.setModel(toComboModel(bc.getIssueTypes()));<NEW_LINE>reproducibilityCombo.setModel(toComboModel(Arrays.asList(Bundle.LBL_HappensAlways(), Bundle.LBL_HappensSometimes(), Bundle.LBL_HaventTried(), <MASK><NEW_LINE>reproducibilityCombo.setSelectedItem(null);<NEW_LINE>}<NEW_LINE>// stausCombo and resolution fields are filled in reloadForm<NEW_LINE>}
Bundle.LBL_Tried())));
675,460
final ListSafetyRulesResult executeListSafetyRules(ListSafetyRulesRequest listSafetyRulesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listSafetyRulesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListSafetyRulesRequest> request = null;<NEW_LINE>Response<ListSafetyRulesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListSafetyRulesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listSafetyRulesRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Route53 Recovery Control Config");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListSafetyRules");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListSafetyRulesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListSafetyRulesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
731,634
public void commit() throws IllegalArgumentException {<NEW_LINE>Structure struct = (Structure) composite;<NEW_LINE>String fieldName = null;<NEW_LINE>String comment = null;<NEW_LINE>if (component != null) {<NEW_LINE>fieldName = component.getFieldName();<NEW_LINE>comment = component.getComment();<NEW_LINE>}<NEW_LINE>// we cannot replace a default type, since it is not a real data type<NEW_LINE>if (oldType != DataType.DEFAULT && newType.getLength() == oldType.getLength()) {<NEW_LINE>// Perform simple 1-for-1 component replacement. This allows to avoid unpack in<NEW_LINE>// some cases. Assume component is not null since we have a non-default type.<NEW_LINE>struct.replace(component.getOrdinal(), newType<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (disablePacking) {<NEW_LINE>// User has decided to disable packing for the structure<NEW_LINE>// alignment is maintained for struct since we do not know the impact if we change it<NEW_LINE>int alignment = struct.getAlignment();<NEW_LINE>struct.setPackingEnabled(false);<NEW_LINE>// preserve previous alignment<NEW_LINE>struct.setExplicitMinimumAlignment(alignment);<NEW_LINE>}<NEW_LINE>// The replaceAtOffset will only replace component containing offset plus any<NEW_LINE>// subsequent DEFAULT components available. Space check is performed prior to any<NEW_LINE>// clearing. Zero-length components at offset will be ignored.<NEW_LINE>struct.replaceAtOffset(offset, newType, -1, fieldName, comment);<NEW_LINE>}
, -1, fieldName, comment);
1,708,725
public boolean applyNetworkACL(final long aclId) throws ResourceUnavailableException {<NEW_LINE>boolean handled = true;<NEW_LINE>boolean aclApplyStatus = true;<NEW_LINE>final List<NetworkACLItemVO> <MASK><NEW_LINE>// Find all networks using this ACL and apply the ACL<NEW_LINE>final List<NetworkVO> networks = _networkDao.listByAclId(aclId);<NEW_LINE>for (final NetworkVO network : networks) {<NEW_LINE>if (!applyACLItemsToNetwork(network.getId(), rules)) {<NEW_LINE>handled = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final List<VpcGatewayVO> vpcGateways = _vpcGatewayDao.listByAclIdAndType(aclId, VpcGateway.Type.Private);<NEW_LINE>for (final VpcGatewayVO vpcGateway : vpcGateways) {<NEW_LINE>final PrivateGateway privateGateway = _vpcSvc.getVpcPrivateGateway(vpcGateway.getId());<NEW_LINE>if (!applyACLToPrivateGw(privateGateway)) {<NEW_LINE>aclApplyStatus = false;<NEW_LINE>s_logger.debug("failed to apply network acl item on private gateway " + privateGateway.getId() + "acl id " + aclId);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (handled && aclApplyStatus) {<NEW_LINE>for (final NetworkACLItem rule : rules) {<NEW_LINE>if (rule.getState() == NetworkACLItem.State.Revoke) {<NEW_LINE>removeRule(rule);<NEW_LINE>} else if (rule.getState() == NetworkACLItem.State.Add) {<NEW_LINE>final NetworkACLItemVO ruleVO = _networkACLItemDao.findById(rule.getId());<NEW_LINE>ruleVO.setState(NetworkACLItem.State.Active);<NEW_LINE>_networkACLItemDao.update(ruleVO.getId(), ruleVO);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return handled && aclApplyStatus;<NEW_LINE>}
rules = _networkACLItemDao.listByACL(aclId);
1,355,855
public static ListUmengAppkeysResponse unmarshall(ListUmengAppkeysResponse listUmengAppkeysResponse, UnmarshallerContext _ctx) {<NEW_LINE>listUmengAppkeysResponse.setCode(_ctx.stringValue("ListUmengAppkeysResponse.code"));<NEW_LINE>listUmengAppkeysResponse.setMessage<MASK><NEW_LINE>listUmengAppkeysResponse.setRequestId(_ctx.stringValue("ListUmengAppkeysResponse.requestId"));<NEW_LINE>List<ResultItem> result = new ArrayList<ResultItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListUmengAppkeysResponse.result.Length"); i++) {<NEW_LINE>ResultItem resultItem = new ResultItem();<NEW_LINE>resultItem.setAppkey(_ctx.stringValue("ListUmengAppkeysResponse.result[" + i + "].appkey"));<NEW_LINE>resultItem.setName(_ctx.stringValue("ListUmengAppkeysResponse.result[" + i + "].name"));<NEW_LINE>resultItem.setPlatform(_ctx.stringValue("ListUmengAppkeysResponse.result[" + i + "].platform"));<NEW_LINE>result.add(resultItem);<NEW_LINE>}<NEW_LINE>listUmengAppkeysResponse.setResult(result);<NEW_LINE>return listUmengAppkeysResponse;<NEW_LINE>}
(_ctx.stringValue("ListUmengAppkeysResponse.message"));
649,613
public OAuthConsent readConsent(String providerId, String username, String clientId, String resource) throws OAuthStoreException {<NEW_LINE>try {<NEW_LINE>DBCollection col = getConsentCollection();<NEW_LINE>DBObject dbo = col.findOne(createConsentKeyHelper(providerId, username, clientId, resource));<NEW_LINE>if (dbo == null) {<NEW_LINE>System.<MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>System.out.println("CustomStoreSample readConsent Found clientId " + clientId + " under " + providerId + " _id " + dbo.get("_id"));<NEW_LINE>return new OAuthConsent(clientId, (String) dbo.get(USERNAME), (String) dbo.get(SCOPE), resource, providerId, (long) dbo.get(EXPIRES), (String) dbo.get(PROPS));<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new OAuthStoreException("Failed on readConsent for " + username, e);<NEW_LINE>}<NEW_LINE>}
out.println("CustomStoreSample readConsent Did not find username " + username);
653,441
public void bindView(View view, Context context, Cursor cursor) {<NEW_LINE>int id = cursor.getInt(cursor.getColumnIndex(ClientAuthContentProvider.V3ClientAuth._ID));<NEW_LINE>final String where = ClientAuthContentProvider.V3ClientAuth._ID + "=" + id;<NEW_LINE>TextView domain = view.<MASK><NEW_LINE>String url = cursor.getString(cursor.getColumnIndex(ClientAuthContentProvider.V3ClientAuth.DOMAIN)) + ".onion";<NEW_LINE>domain.setText(url);<NEW_LINE>SwitchCompat enabled = view.findViewById(R.id.cookie_switch);<NEW_LINE>enabled.setChecked(cursor.getInt(cursor.getColumnIndex(ClientAuthContentProvider.V3ClientAuth.ENABLED)) == 1);<NEW_LINE>enabled.setOnCheckedChangeListener((buttonView, isChecked) -> {<NEW_LINE>ContentResolver resolver = context.getContentResolver();<NEW_LINE>ContentValues fields = new ContentValues();<NEW_LINE>fields.put(ClientAuthContentProvider.V3ClientAuth.ENABLED, isChecked);<NEW_LINE>resolver.update(ClientAuthContentProvider.CONTENT_URI, fields, where, null);<NEW_LINE>Toast.makeText(context, R.string.please_restart_Orbot_to_enable_the_changes, Toast.LENGTH_LONG).show();<NEW_LINE>});<NEW_LINE>}
findViewById(R.id.cookie_onion);
999,600
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>ExpressionFactory factory = ExpressionFactory.newInstance();<NEW_LINE>ELContextImpl context = new ELContextImpl(factory);<NEW_LINE>PrintWriter pw = response.getWriter();<NEW_LINE>ELResolver elResolver = ELContextImpl.getDefaultResolver(factory);<NEW_LINE>// Getting all EL Resolvers from the CompositeELResolver<NEW_LINE>pw.println("ELResolvers.");<NEW_LINE>ELResolver[] resolvers = getELResolvers(elResolver, pw);<NEW_LINE>if (checkOrderAndSize(resolvers, pw)) {<NEW_LINE>pw.println("The order and number of ELResolvers from the CompositeELResolver are correct!");<NEW_LINE>} else {<NEW_LINE>pw.println("Error: Order and number of ELResolvers are incorrect!");<NEW_LINE>}<NEW_LINE>// Test the behavior of the new ELResolvers. That is the StaticFieldELResolver and StreamELResolver.<NEW_LINE>pw.println("\nTesting implementation.");<NEW_LINE>try {<NEW_LINE>ELClass elClass = new ELClass(Boolean.class);<NEW_LINE>pw.println("Testing StaticFieldELResolver with Boolean.TRUE (Expected: true): " + elResolver.getValue(context, elClass, "TRUE"));<NEW_LINE>elClass = new ELClass(Integer.class);<NEW_LINE>pw.println("Testing StaticFieldELResolver with Integer.parseInt (Expected: 86): " + elResolver.invoke(context, elClass, "parseInt", new Class<?>[] { String.class, Integer.class }, new Object[] { "1010110", 2 }));<NEW_LINE>Stream stream = (Stream) elResolver.invoke(context, myList, "stream", null, new Object[] {});<NEW_LINE>pw.println("Testing StreamELResolver with distinct method (Expected: [1, 4, 3, 2, 5]): " + stream.distinct().toList());<NEW_LINE>ELProcessor elp = new ELProcessor();<NEW_LINE>LambdaExpression expression = (<MASK><NEW_LINE>stream = (Stream) elResolver.invoke(context, myList, "stream", null, new Object[] {});<NEW_LINE>pw.println("Testing StreamELResolver with filter method (Expected: [4, 3, 5, 3]): " + stream.filter(expression).toList());<NEW_LINE>} catch (Exception e) {<NEW_LINE>pw.println("Exception caught: " + e.getMessage());<NEW_LINE>pw.println("Test Failed. An exception was thrown: " + e.toString());<NEW_LINE>}<NEW_LINE>}
LambdaExpression) elp.eval("e->e>2");
182,835
private void dynInit() {<NEW_LINE>SmjReportLogic logic = new SmjReportLogic();<NEW_LINE>data = logic.getDataReport(m_AD_PInstance_ID, trxName);<NEW_LINE>generalTitle = logic.getGeneralTitle(reportId, trxName);<NEW_LINE>clientName = logic.getOrgName(trxName);<NEW_LINE>// if (clientName.equals("") || clientName.length()<=0){<NEW_LINE>// clientName = logic.getClientName(trxName);<NEW_LINE>// }<NEW_LINE>clientNIT = logic.getOrgNIT(trxName);<NEW_LINE>periodName = logic.getPeriodName(p_C_Period_ID, trxName);<NEW_LINE>currencyName = logic.getCurrency(trxName);<NEW_LINE>codeFont = logic.getCodeFont(trxName, p_AD_PrintFont_ID);<NEW_LINE>city = logic.getClientCity(trxName);<NEW_LINE>// logo<NEW_LINE><MASK><NEW_LINE>MOrgInfo oi = MOrgInfo.get(prop, Env.getAD_Org_ID(prop), null);<NEW_LINE>logoId = oi.getLogo_ID();<NEW_LINE>if (logoId <= 0) {<NEW_LINE>MClientInfo ci = MClientInfo.get(prop);<NEW_LINE>logoId = ci.getLogoReport_ID();<NEW_LINE>if (logoId <= 0)<NEW_LINE>logoId = ci.getLogo_ID();<NEW_LINE>}<NEW_LINE>SmjPdfReport pdf = new SmjPdfReport();<NEW_LINE>baosPDF = pdf.generate(data, trxName, generalTitle, clientName, clientNIT, periodName, currencyName, m_columns, codeFont, city, logoId);<NEW_LINE>filePdf = pdf.tofile(baosPDF.toByteArray(), generalTitle);<NEW_LINE>revalidate();<NEW_LINE>}
Properties prop = Env.getCtx();
974,164
public void addRecurrentEventsByWeeks(Event event, int periodicity, int endType, int repetitionsNumber, LocalDate endDate, Map<Integer, Boolean> daysCheckedMap) {<NEW_LINE>List<DayOfWeek> dayOfWeekList = daysCheckedMap.keySet().stream().sorted().map(DayOfWeek::of).collect(Collectors.toList());<NEW_LINE>Duration duration = Duration.between(event.getStartDateTime(), event.getEndDateTime());<NEW_LINE>Event lastEvent = event;<NEW_LINE>BiFunction<Integer, LocalDateTime, Boolean> breakCondition;<NEW_LINE>if (endType == RecurrenceConfigurationRepository.END_TYPE_REPET) {<NEW_LINE>breakCondition = (<MASK><NEW_LINE>} else {<NEW_LINE>breakCondition = (iteration, dateTime) -> dateTime.toLocalDate().isAfter(endDate);<NEW_LINE>}<NEW_LINE>boolean loop = true;<NEW_LINE>for (int iteration = 0; loop; ++iteration) {<NEW_LINE>if (iteration > ITERATION_LIMIT) {<NEW_LINE>throw new TooManyIterationsException(iteration);<NEW_LINE>}<NEW_LINE>LocalDateTime nextStartDateTime = lastEvent.getStartDateTime().plusWeeks(periodicity - 1L);<NEW_LINE>for (DayOfWeek dayOfWeek : dayOfWeekList) {<NEW_LINE>nextStartDateTime = nextStartDateTime.with(TemporalAdjusters.next(dayOfWeek));<NEW_LINE>if (breakCondition.apply(iteration, nextStartDateTime)) {<NEW_LINE>loop = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>Event copy = eventRepo.copy(lastEvent, false);<NEW_LINE>copy.setParentEvent(event);<NEW_LINE>copy.setStartDateTime(nextStartDateTime);<NEW_LINE>copy.setEndDateTime(nextStartDateTime.plus(duration));<NEW_LINE>lastEvent = eventRepo.save(copy);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
iteration, dateTime) -> iteration >= repetitionsNumber;
940,977
public static double[] flattenDoubleArray(Object doubleArray) {<NEW_LINE>if (doubleArray instanceof double[])<NEW_LINE>return (double[]) doubleArray;<NEW_LINE>LinkedList<Object> stack = new LinkedList<>();<NEW_LINE>stack.push(doubleArray);<NEW_LINE>int[] shape = arrayShape(doubleArray);<NEW_LINE>int length = ArrayUtil.prod(shape);<NEW_LINE>double[] flat = new double[length];<NEW_LINE>int count = 0;<NEW_LINE>while (!stack.isEmpty()) {<NEW_LINE>Object current = stack.pop();<NEW_LINE>if (current instanceof double[]) {<NEW_LINE>double[] arr = (double[]) current;<NEW_LINE>for (int i = 0; i < arr.length; i++) flat[<MASK><NEW_LINE>} else if (current instanceof Object[]) {<NEW_LINE>Object[] o = (Object[]) current;<NEW_LINE>for (int i = o.length - 1; i >= 0; i--) stack.push(o[i]);<NEW_LINE>} else<NEW_LINE>throw new IllegalArgumentException("Base array is not double[]");<NEW_LINE>}<NEW_LINE>if (count != flat.length)<NEW_LINE>throw new IllegalArgumentException("Fewer elements than expected. Array is ragged?");<NEW_LINE>return flat;<NEW_LINE>}
count++] = arr[i];
1,391,436
public void subscribe(Subscriber<? super ReadableBodyPart> subscriber) {<NEW_LINE>Objects.requireNonNull(subscriber);<NEW_LINE>if (!halfInit(UPSTREAM_INIT)) {<NEW_LINE>Multi.<ReadableBodyPart>error(new IllegalStateException("Only one Subscriber allowed")).subscribe(subscriber);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.downstream = subscriber;<NEW_LINE>// contenders < 0, so any part request will be deferred<NEW_LINE>// drain() will not request anything from upstream until the second deferredInit() invocation witnesses<NEW_LINE>// that upstream is set<NEW_LINE>downstream.onSubscribe(new Subscription() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void request(long n) {<NEW_LINE>long curr = n <= 0 ? partsRequested.getAndSet(-1) : partsRequested.getAndUpdate(v -> Long.MAX_VALUE - v > n ? v + n : v < <MASK><NEW_LINE>if (curr == 0) {<NEW_LINE>drain();<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void cancel() {<NEW_LINE>cancelled = true;<NEW_LINE>if (partsRequested.getAndSet(-1) == 0) {<NEW_LINE>drain();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>deferredInit();<NEW_LINE>}
0 ? v : Long.MAX_VALUE);
1,370,261
protected static void generateOClass(Class<?> iClass, ODatabaseDocument database) {<NEW_LINE>boolean reloadSchema = false;<NEW_LINE>for (Class<?> currentClass = iClass; currentClass != Object.class; ) {<NEW_LINE><MASK><NEW_LINE>currentClass = currentClass.getSuperclass();<NEW_LINE>if (currentClass == null || currentClass.equals(ODocument.class))<NEW_LINE>// POJO EXTENDS ODOCUMENT: SPECIAL CASE: AVOID TO CONSIDER<NEW_LINE>// ODOCUMENT FIELDS<NEW_LINE>currentClass = Object.class;<NEW_LINE>if (ODatabaseRecordThreadLocal.instance().get() != null && !ODatabaseRecordThreadLocal.instance().get().isClosed() && !currentClass.equals(Object.class)) {<NEW_LINE>OClass oSuperClass;<NEW_LINE>OClass currentOClass = database.getMetadata().getSchema().getClass(iClassName);<NEW_LINE>if (!database.getMetadata().getSchema().existsClass(currentClass.getSimpleName())) {<NEW_LINE>oSuperClass = database.getMetadata().getSchema().createClass(currentClass.getSimpleName());<NEW_LINE>reloadSchema = true;<NEW_LINE>} else {<NEW_LINE>oSuperClass = database.getMetadata().getSchema().getClass(currentClass.getSimpleName());<NEW_LINE>reloadSchema = true;<NEW_LINE>}<NEW_LINE>if (!currentOClass.getSuperClasses().contains(oSuperClass)) {<NEW_LINE>currentOClass.setSuperClasses(Arrays.asList(oSuperClass));<NEW_LINE>reloadSchema = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (reloadSchema) {<NEW_LINE>database.getMetadata().getSchema().reload();<NEW_LINE>}<NEW_LINE>}
String iClassName = currentClass.getSimpleName();
1,621,410
private void buildRow(Table table, boolean fullId, boolean detailed, DiscoveryNodes discoveryNodes, TaskInfo taskInfo) {<NEW_LINE>table.startRow();<NEW_LINE>String nodeId = taskInfo.getTaskId().getNodeId();<NEW_LINE>DiscoveryNode node = discoveryNodes.get(nodeId);<NEW_LINE>table.addCell(taskInfo.getId());<NEW_LINE>table.addCell(taskInfo.getAction());<NEW_LINE>table.addCell(taskInfo.getTaskId().toString());<NEW_LINE>if (taskInfo.getParentTaskId().isSet()) {<NEW_LINE>table.addCell(taskInfo.getParentTaskId().toString());<NEW_LINE>} else {<NEW_LINE>table.addCell("-");<NEW_LINE>}<NEW_LINE>table.addCell(taskInfo.getType());<NEW_LINE>table.addCell(taskInfo.getStartTime());<NEW_LINE>table.addCell(FORMATTER.format(Instant.ofEpochMilli(taskInfo.getStartTime())));<NEW_LINE>table.addCell(taskInfo.getRunningTimeNanos());<NEW_LINE>table.addCell(TimeValue.timeValueNanos(taskInfo.getRunningTimeNanos()).toString());<NEW_LINE>// Node information. Note that the node may be null because it has left the cluster between when we got this response and now.<NEW_LINE>table.addCell(fullId ? nodeId : Strings.substring(nodeId, 0, 4));<NEW_LINE>table.addCell(node == null ? <MASK><NEW_LINE>table.addCell(node.getAddress().address().getPort());<NEW_LINE>table.addCell(node == null ? "-" : node.getName());<NEW_LINE>table.addCell(node == null ? "-" : node.getVersion().toString());<NEW_LINE>if (detailed) {<NEW_LINE>table.addCell(taskInfo.getDescription());<NEW_LINE>}<NEW_LINE>table.endRow();<NEW_LINE>}
"-" : node.getHostAddress());
324,593
public double skewness() {<NEW_LINE>double mean = mean();<NEW_LINE>double numer = 0, denom = 0;<NEW_LINE>for (int i = 0; i < used; i++) {<NEW_LINE>numer += pow(values<MASK><NEW_LINE>denom += pow(values[i] - mean, 2);<NEW_LINE>}<NEW_LINE>// All the zero's we arent storing<NEW_LINE>numer += pow(-mean, 3) * (length - used);<NEW_LINE>denom += pow(-mean, 2) * (length - used);<NEW_LINE>numer /= length;<NEW_LINE>denom /= length;<NEW_LINE>double s1 = numer / (pow(denom, 3.0 / 2.0));<NEW_LINE>if (// We can use the bias corrected formula<NEW_LINE>length >= 3)<NEW_LINE>return sqrt(length * (length - 1)) / (length - 2) * s1;<NEW_LINE>return s1;<NEW_LINE>}
[i] - mean, 3);
600,519
public static void vertical3(Kernel1D_F64 kernel, GrayF64 src, GrayF64 dst) {<NEW_LINE>final double[] dataSrc = src.data;<NEW_LINE>final double[] dataDst = dst.data;<NEW_LINE>final double k1 = kernel.data[0];<NEW_LINE>final double k2 = kernel.data[1];<NEW_LINE>final double k3 = kernel.data[2];<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final int imgWidth = dst.getWidth();<NEW_LINE>final int imgHeight = dst.getHeight();<NEW_LINE>final int yEnd = imgHeight - radius;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(radius, yEnd, y -> {<NEW_LINE>for (int y = radius; y < yEnd; y++) {<NEW_LINE>int indexDst = dst.startIndex + y * dst.stride;<NEW_LINE>int i = src.startIndex + (y - radius) * src.stride;<NEW_LINE>final int iEnd = i + imgWidth;<NEW_LINE>for (; i < iEnd; i++) {<NEW_LINE>int indexSrc = i;<NEW_LINE>double total = (dataSrc[indexSrc]) * k1;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += <MASK><NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k3;<NEW_LINE>dataDst[indexDst++] = total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
(dataSrc[indexSrc]) * k2;
1,009,927
public static <T> T castToEnum(Object obj, Class<T> clazz, ParserConfig mapping) {<NEW_LINE>try {<NEW_LINE>if (obj instanceof String) {<NEW_LINE>String name = (String) obj;<NEW_LINE>if (name.length() == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (mapping == null) {<NEW_LINE>mapping = ParserConfig.getGlobalInstance();<NEW_LINE>}<NEW_LINE>ObjectDeserializer derializer = mapping.getDeserializer(clazz);<NEW_LINE>if (derializer instanceof EnumDeserializer) {<NEW_LINE>EnumDeserializer enumDeserializer = (EnumDeserializer) derializer;<NEW_LINE>return (T) enumDeserializer.getEnumByHashCode(TypeUtils.fnv1a_64(name));<NEW_LINE>}<NEW_LINE>return (T) Enum.valueOf((Class<? extends Enum>) clazz, name);<NEW_LINE>}<NEW_LINE>if (obj instanceof BigDecimal) {<NEW_LINE>int ordinal = intValue((BigDecimal) obj);<NEW_LINE>Object[] values = clazz.getEnumConstants();<NEW_LINE>if (ordinal < values.length) {<NEW_LINE>return (T) values[ordinal];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (obj instanceof Number) {<NEW_LINE>int ordinal = ((Number) obj).intValue();<NEW_LINE>Object[<MASK><NEW_LINE>if (ordinal < values.length) {<NEW_LINE>return (T) values[ordinal];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new JSONException("can not cast to : " + clazz.getName(), ex);<NEW_LINE>}<NEW_LINE>throw new JSONException("can not cast to : " + clazz.getName());<NEW_LINE>}
] values = clazz.getEnumConstants();
1,629,322
public AsyncRestQueryResult query(String uuid) {<NEW_LINE>AsyncRestQueryResult result = new AsyncRestQueryResult();<NEW_LINE>result.setUuid(uuid);<NEW_LINE>APIEvent evt = results.get(uuid);<NEW_LINE>if (evt != null) {<NEW_LINE>result.setState(AsyncRestState.done);<NEW_LINE>result.setResult(evt);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>AsyncRestVO vo = dbf.findByUuid(uuid, AsyncRestVO.class);<NEW_LINE>if (vo == null) {<NEW_LINE>result.setState(AsyncRestState.expired);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>if (vo.getState() != AsyncRestState.done) {<NEW_LINE>result.<MASK><NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>result.setState(AsyncRestState.done);<NEW_LINE>result.setResult(ApiEventResult.fromJson(vo.getResult()));<NEW_LINE>results.put(uuid, result.getResult());<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new CloudRuntimeException(e);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
setState(vo.getState());
1,397,257
public Cursor newCursor() {<NEW_LINE>return new Cursor() {<NEW_LINE><NEW_LINE>final String[] row = new String[header.size()];<NEW_LINE><NEW_LINE>{<NEW_LINE>clear();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void submit() {<NEW_LINE>addRow(row);<NEW_LINE>clear();<NEW_LINE>}<NEW_LINE><NEW_LINE>private void clear() {<NEW_LINE>Arrays.fill(row, "");<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void setCell(int colNo, double value) {<NEW_LINE>if (colNo >= 0) {<NEW_LINE>row[colNo] = formatDouble(header.get(colNo), value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void setCell(int colNo, long value) {<NEW_LINE>if (colNo >= 0) {<NEW_LINE>row[colNo] = formatLong(header.get(colNo), value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void setCell(int colNo, String value) {<NEW_LINE>if (colNo >= 0) {<NEW_LINE>row[colNo] = value;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void setCell(String name, double value) {<NEW_LINE>setCell(colByName(name), value);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void setCell(String name, long value) {<NEW_LINE>setCell(colByName(name), value);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void setCell(String name, String value) {<NEW_LINE>setCell<MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
(colByName(name), value);
560,220
private boolean noticeContainsPointInView(ParserNotice notice, Point p) {<NEW_LINE>try {<NEW_LINE>int start;<NEW_LINE>int end;<NEW_LINE>if (notice.getKnowsOffsetAndLength()) {<NEW_LINE>start = notice.getOffset();<NEW_LINE>end = start + notice.getLength() - 1;<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>Element root = doc.getDefaultRootElement();<NEW_LINE>int line = notice.getLine();<NEW_LINE>// Defend against possible bad user-defined notices.<NEW_LINE>if (line < 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Element elem = root.getElement(line);<NEW_LINE>start = elem.getStartOffset();<NEW_LINE>end = elem.getEndOffset() - 1;<NEW_LINE>}<NEW_LINE>Rectangle r1 = textArea.modelToView(start);<NEW_LINE>Rectangle r2 = textArea.modelToView(end);<NEW_LINE>if (r1.y != r2.y) {<NEW_LINE>// If the notice spans multiple lines, give them the benefit<NEW_LINE>// of the doubt. This is only "wrong" if the user is in empty<NEW_LINE>// space "to the right" of the error marker when it ends at the<NEW_LINE>// end of a line anyway.<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// Be a tiny bit lenient.<NEW_LINE>r1.y--;<NEW_LINE>// Ditto<NEW_LINE>r1.height += 2;<NEW_LINE>return p.x >= r1.x && p.x < (r2.x + r2.width) && p.y >= r1.y && p.y < (r1.y + r1.height);<NEW_LINE>} catch (BadLocationException ble) {<NEW_LINE>// Never occurs<NEW_LINE>// Give them the benefit of the doubt, should 99% of the time be<NEW_LINE>// true anyway<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}
Document doc = textArea.getDocument();
1,748,459
public void marshall(StartRxNormInferenceJobRequest startRxNormInferenceJobRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (startRxNormInferenceJobRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(startRxNormInferenceJobRequest.getInputDataConfig(), INPUTDATACONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(startRxNormInferenceJobRequest.getOutputDataConfig(), OUTPUTDATACONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(startRxNormInferenceJobRequest.getJobName(), JOBNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(startRxNormInferenceJobRequest.getClientRequestToken(), CLIENTREQUESTTOKEN_BINDING);<NEW_LINE>protocolMarshaller.marshall(startRxNormInferenceJobRequest.getKMSKey(), KMSKEY_BINDING);<NEW_LINE>protocolMarshaller.marshall(startRxNormInferenceJobRequest.getLanguageCode(), LANGUAGECODE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
startRxNormInferenceJobRequest.getDataAccessRoleArn(), DATAACCESSROLEARN_BINDING);
1,691,743
public Iterator<Object> ipaddresses() throws DataUnavailableException, CorruptDataException {<NEW_LINE>ArrayList<Object> addresses = new ArrayList<Object>();<NEW_LINE>U8Pointer ip = ptr.ipAddressesEA();<NEW_LINE>if (ip.isNull()) {<NEW_LINE>throw new DataUnavailableException("IP addresses not available");<NEW_LINE>}<NEW_LINE>int type = ip.<MASK><NEW_LINE>byte[] ipv4 = new byte[4];<NEW_LINE>byte[] ipv6 = new byte[16];<NEW_LINE>InetAddress address = null;<NEW_LINE>ADDRESS_PROCESSING: while (0 != type) {<NEW_LINE>try {<NEW_LINE>switch(type) {<NEW_LINE>case // IPv4<NEW_LINE>4:<NEW_LINE>DataType.getProcess().getBytesAt(ip.getAddress() + 1, ipv4);<NEW_LINE>// increment before getting address in case an UnknownHostException is thrown<NEW_LINE>ip = ip.add(5);<NEW_LINE>address = InetAddress.getByAddress(ipv4);<NEW_LINE>break;<NEW_LINE>case // IPv6<NEW_LINE>6:<NEW_LINE>DataType.getProcess().getBytesAt(ip.getAddress() + 1, ipv6);<NEW_LINE>// increment before getting address in case an UnknownHostException is thrown<NEW_LINE>ip = ip.add(7);<NEW_LINE>address = InetAddress.getByAddress(ipv6);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>// unknown type, so add a corrupt data<NEW_LINE>addresses.add(J9DDRDTFJUtils.newCorruptData(DTFJContext.getProcess(), "Unknown IP address type identifier : " + type));<NEW_LINE>// and exit loop as do not know how big the address is to skip to the next one<NEW_LINE>break ADDRESS_PROCESSING;<NEW_LINE>}<NEW_LINE>if (!addresses.contains(address)) {<NEW_LINE>addresses.add(address);<NEW_LINE>}<NEW_LINE>} catch (UnknownHostException e) {<NEW_LINE>addresses.add(J9DDRDTFJUtils.newCorruptData(DTFJContext.getProcess(), "Corrupt IP address : " + e.getMessage()));<NEW_LINE>}<NEW_LINE>type = ip.at(0).intValue();<NEW_LINE>}<NEW_LINE>if (0 == addresses.size()) {<NEW_LINE>throw new DataUnavailableException("IP addresses not available");<NEW_LINE>}<NEW_LINE>return addresses.iterator();<NEW_LINE>}
at(0).intValue();
335,613
public static ListUsersResponse unmarshall(ListUsersResponse listUsersResponse, UnmarshallerContext _ctx) {<NEW_LINE>listUsersResponse.setRequestId(_ctx.stringValue("ListUsersResponse.RequestId"));<NEW_LINE>listUsersResponse.setTotalCount<MASK><NEW_LINE>listUsersResponse.setErrorCode(_ctx.stringValue("ListUsersResponse.ErrorCode"));<NEW_LINE>listUsersResponse.setErrorMessage(_ctx.stringValue("ListUsersResponse.ErrorMessage"));<NEW_LINE>listUsersResponse.setSuccess(_ctx.booleanValue("ListUsersResponse.Success"));<NEW_LINE>List<User> userList = new ArrayList<User>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListUsersResponse.UserList.Length"); i++) {<NEW_LINE>User user = new User();<NEW_LINE>user.setState(_ctx.stringValue("ListUsersResponse.UserList[" + i + "].State"));<NEW_LINE>user.setCurResultCount(_ctx.longValue("ListUsersResponse.UserList[" + i + "].CurResultCount"));<NEW_LINE>user.setUserId(_ctx.stringValue("ListUsersResponse.UserList[" + i + "].UserId"));<NEW_LINE>user.setLastLoginTime(_ctx.stringValue("ListUsersResponse.UserList[" + i + "].LastLoginTime"));<NEW_LINE>user.setMaxResultCount(_ctx.longValue("ListUsersResponse.UserList[" + i + "].MaxResultCount"));<NEW_LINE>user.setParentUid(_ctx.stringValue("ListUsersResponse.UserList[" + i + "].ParentUid"));<NEW_LINE>user.setNickName(_ctx.stringValue("ListUsersResponse.UserList[" + i + "].NickName"));<NEW_LINE>user.setMaxExecuteCount(_ctx.longValue("ListUsersResponse.UserList[" + i + "].MaxExecuteCount"));<NEW_LINE>user.setCurExecuteCount(_ctx.longValue("ListUsersResponse.UserList[" + i + "].CurExecuteCount"));<NEW_LINE>user.setMobile(_ctx.stringValue("ListUsersResponse.UserList[" + i + "].Mobile"));<NEW_LINE>user.setUid(_ctx.stringValue("ListUsersResponse.UserList[" + i + "].Uid"));<NEW_LINE>user.setEmail(_ctx.stringValue("ListUsersResponse.UserList[" + i + "].Email"));<NEW_LINE>user.setDingRobot(_ctx.stringValue("ListUsersResponse.UserList[" + i + "].DingRobot"));<NEW_LINE>user.setWebhook(_ctx.stringValue("ListUsersResponse.UserList[" + i + "].Webhook"));<NEW_LINE>user.setSignatureMethod(_ctx.stringValue("ListUsersResponse.UserList[" + i + "].SignatureMethod"));<NEW_LINE>user.setNotificationMode(_ctx.stringValue("ListUsersResponse.UserList[" + i + "].NotificationMode"));<NEW_LINE>List<Integer> roleIdList = new ArrayList<Integer>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListUsersResponse.UserList[" + i + "].RoleIdList.Length"); j++) {<NEW_LINE>roleIdList.add(_ctx.integerValue("ListUsersResponse.UserList[" + i + "].RoleIdList[" + j + "]"));<NEW_LINE>}<NEW_LINE>user.setRoleIdList(roleIdList);<NEW_LINE>List<String> roleNameList = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListUsersResponse.UserList[" + i + "].RoleNameList.Length"); j++) {<NEW_LINE>roleNameList.add(_ctx.stringValue("ListUsersResponse.UserList[" + i + "].RoleNameList[" + j + "]"));<NEW_LINE>}<NEW_LINE>user.setRoleNameList(roleNameList);<NEW_LINE>userList.add(user);<NEW_LINE>}<NEW_LINE>listUsersResponse.setUserList(userList);<NEW_LINE>return listUsersResponse;<NEW_LINE>}
(_ctx.longValue("ListUsersResponse.TotalCount"));
1,728,647
final UpdateEmailIdentityPolicyResult executeUpdateEmailIdentityPolicy(UpdateEmailIdentityPolicyRequest updateEmailIdentityPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateEmailIdentityPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateEmailIdentityPolicyRequest> request = null;<NEW_LINE>Response<UpdateEmailIdentityPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateEmailIdentityPolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateEmailIdentityPolicyRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SESv2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateEmailIdentityPolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateEmailIdentityPolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateEmailIdentityPolicyResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
921,847
public Request<ForgetDeviceRequest> marshall(ForgetDeviceRequest forgetDeviceRequest) {<NEW_LINE>if (forgetDeviceRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(ForgetDeviceRequest)");<NEW_LINE>}<NEW_LINE>Request<ForgetDeviceRequest> request = new DefaultRequest<ForgetDeviceRequest>(forgetDeviceRequest, "AmazonCognitoIdentityProvider");<NEW_LINE>String target = "AWSCognitoIdentityProviderService.ForgetDevice";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (forgetDeviceRequest.getAccessToken() != null) {<NEW_LINE>String accessToken = forgetDeviceRequest.getAccessToken();<NEW_LINE>jsonWriter.name("AccessToken");<NEW_LINE>jsonWriter.value(accessToken);<NEW_LINE>}<NEW_LINE>if (forgetDeviceRequest.getDeviceKey() != null) {<NEW_LINE>String deviceKey = forgetDeviceRequest.getDeviceKey();<NEW_LINE>jsonWriter.name("DeviceKey");<NEW_LINE>jsonWriter.value(deviceKey);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.addHeader("Content-Type", "application/x-amz-json-1.1");
1,258,645
public Map<K, ValueHolder<V>> bulkCompute(Set<? extends K> keys, Function<Iterable<? extends Map.Entry<? extends K, ? extends V>>, Iterable<? extends Map.Entry<? extends K, ? extends V>>> remappingFunction) throws StoreAccessException {<NEW_LINE>// we are not expecting failures and these two maps are only used in case of failures. So keep them small<NEW_LINE>Set<K> successes = new HashSet<>(1);<NEW_LINE>Map<K, Exception> failures <MASK><NEW_LINE>if (remappingFunction instanceof Ehcache.PutAllFunction) {<NEW_LINE>return getkValueHolderMap((Ehcache.PutAllFunction<K, V>) remappingFunction, successes, failures);<NEW_LINE>} else if (remappingFunction instanceof Ehcache.RemoveAllFunction) {<NEW_LINE>return getkValueHolderMap(keys);<NEW_LINE>} else {<NEW_LINE>return delegate.bulkCompute(keys, remappingFunction);<NEW_LINE>}<NEW_LINE>}
= new HashMap<>(1);
148,113
final DeleteModelBiasJobDefinitionResult executeDeleteModelBiasJobDefinition(DeleteModelBiasJobDefinitionRequest deleteModelBiasJobDefinitionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteModelBiasJobDefinitionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteModelBiasJobDefinitionRequest> request = null;<NEW_LINE>Response<DeleteModelBiasJobDefinitionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteModelBiasJobDefinitionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteModelBiasJobDefinitionRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteModelBiasJobDefinition");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteModelBiasJobDefinitionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteModelBiasJobDefinitionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
1,041,977
private static JSONArray storeProperties(Map<String, V8Object.Property> properties, V8Object.Array array) {<NEW_LINE>JSONArray arrObj = new JSONArray();<NEW_LINE>if (properties != null) {<NEW_LINE>for (Map.Entry<String, V8Object.Property> entry : properties.entrySet()) {<NEW_LINE>String propName = entry.getKey();<NEW_LINE>V8Object.Property prop = entry.getValue();<NEW_LINE>JSONObject propObj = newJSONObject();<NEW_LINE>propObj.put(NAME, propName);<NEW_LINE>if (prop.getAttributes() != 0) {<NEW_LINE>propObj.put(ATTRIBUTES, prop.getAttributes());<NEW_LINE>}<NEW_LINE>V8Object.Property.Type type = prop.getType();<NEW_LINE>if (type != null) {<NEW_LINE>propObj.put(PROPERTY_TYPE, type.ordinal());<NEW_LINE>} else {<NEW_LINE>propObj.put(PROPERTY_TYPE, 0);<NEW_LINE>}<NEW_LINE>propObj.put(<MASK><NEW_LINE>arrObj.add(propObj);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (array != null) {<NEW_LINE>V8Object.IndexIterator indexIterator = array.getIndexIterator();<NEW_LINE>while (indexIterator.hasNextIndex()) {<NEW_LINE>JSONObject arrElm = newJSONObject();<NEW_LINE>long index = indexIterator.nextIndex();<NEW_LINE>arrElm.put(NAME, index);<NEW_LINE>arrElm.put(PROPERTY_TYPE, 0);<NEW_LINE>arrElm.put(REF, array.getReferenceAt(index));<NEW_LINE>arrObj.add(arrElm);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return arrObj;<NEW_LINE>}
REF, prop.getReference());
746,788
public DataStream removeBackingIndex(Index index) {<NEW_LINE>int backingIndexPosition = indices.indexOf(index);<NEW_LINE>if (backingIndexPosition == -1) {<NEW_LINE>throw new IllegalArgumentException(String.format(Locale.ROOT, "index [%s] is not part of data stream [%s]", index.getName(), name));<NEW_LINE>}<NEW_LINE>if (indices.size() == (backingIndexPosition + 1)) {<NEW_LINE>throw new IllegalArgumentException(String.format(Locale.ROOT, "cannot remove backing index [%s] of data stream [%s] because it is the write index", index.getName(), name));<NEW_LINE>}<NEW_LINE>List<Index> backingIndices <MASK><NEW_LINE>backingIndices.remove(index);<NEW_LINE>assert backingIndices.size() == indices.size() - 1;<NEW_LINE>return new DataStream(name, backingIndices, generation + 1, metadata, hidden, replicated, system, allowCustomRouting, indexMode);<NEW_LINE>}
= new ArrayList<>(indices);
355,169
private void captureFullSpeedHrInitialize(String channel, int samples, double timeGap, List<String> args) {<NEW_LINE>timeGap = (int) (timeGap * 8) / 8;<NEW_LINE>if (timeGap < 0.5)<NEW_LINE>timeGap = (int) (0.5 * 8) / 8;<NEW_LINE>if (samples > this.MAX_SAMPLES) {<NEW_LINE>Log.v(TAG, "Sample limit exceeded. 10,000 max");<NEW_LINE>samples = this.MAX_SAMPLES;<NEW_LINE>}<NEW_LINE>this.timebase = (int) (timeGap * 8) / 8;<NEW_LINE>this.samples = samples;<NEW_LINE>int CHOSA = this.<MASK><NEW_LINE>try {<NEW_LINE>mPacketHandler.sendByte(mCommandsProto.ADC);<NEW_LINE>if (args.contains("SET_LOW"))<NEW_LINE>mPacketHandler.sendByte(mCommandsProto.SET_LO_CAPTURE);<NEW_LINE>else if (args.contains("SET_HIGH"))<NEW_LINE>mPacketHandler.sendByte(mCommandsProto.SET_HI_CAPTURE);<NEW_LINE>else if (args.contains("READ_CAP")) {<NEW_LINE>mPacketHandler.sendByte(mCommandsProto.MULTIPOINT_CAPACITANCE);<NEW_LINE>} else<NEW_LINE>mPacketHandler.sendByte(mCommandsProto.CAPTURE_DMASPEED);<NEW_LINE>mPacketHandler.sendByte(CHOSA | 0x80);<NEW_LINE>mPacketHandler.sendInt(samples);<NEW_LINE>mPacketHandler.sendInt((int) timeGap * 8);<NEW_LINE>mPacketHandler.getAcknowledgement();<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
analogInputSources.get(channel).CHOSA;
377,668
private JSONObject addThreadStopInfo(ThreadReference thread, long stopThreadId, DebuggerStopReason stopReason) {<NEW_LINE>JSONObject threadJson = new JSONObject();<NEW_LINE>long threadId = thread.uniqueID();<NEW_LINE><MASK><NEW_LINE>boolean stackFrameValid = false;<NEW_LINE>threadJson.put("id", threadId);<NEW_LINE>threadJson.put("name", threadName);<NEW_LINE>threadJson.put("description", threadName);<NEW_LINE>try {<NEW_LINE>try {<NEW_LINE>if (thread.frameCount() > 0) {<NEW_LINE>StackFrame leafFrame = thread.frame(0);<NEW_LINE>threadJson.put("address", Utils.getFrameName(leafFrame));<NEW_LINE>threadJson.put("location", Utils.getFrameLocationJson(_contextManager.getFileManager(), leafFrame));<NEW_LINE>stackFrameValid = true;<NEW_LINE>}<NEW_LINE>} catch (InvalidStackFrameException e) {<NEW_LINE>}<NEW_LINE>if (stackFrameValid == false) {<NEW_LINE>threadJson.put("address", NOT_AVAILABLE_TEXT);<NEW_LINE>threadJson.put("location", NOT_AVAILABLE_TEXT);<NEW_LINE>}<NEW_LINE>if (threadId == stopThreadId) {<NEW_LINE>threadJson.put("stopReason", Utils.getStopReasonString(stopReason));<NEW_LINE>} else {<NEW_LINE>threadJson.put("stopReason", "");<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>threadJson.put("address", NOT_AVAILABLE_TEXT);<NEW_LINE>threadJson.put("location", NOT_AVAILABLE_TEXT);<NEW_LINE>}<NEW_LINE>return threadJson;<NEW_LINE>}
String threadName = thread.name();
684,134
static String innerSort(String line) {<NEW_LINE>MultiMap<String, String> mm = split(line);<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>// class<NEW_LINE>List<String> vals = mm.remove("class");<NEW_LINE>assert (null != vals && 1 == vals.size());<NEW_LINE>sb.append("class=").append(vals.iterator().next());<NEW_LINE>// indicies<NEW_LINE>vals = mm.remove("index");<NEW_LINE>if (null != vals && vals.size() > 0) {<NEW_LINE>Collections.sort(vals);<NEW_LINE>for (String index : vals) {<NEW_LINE>sb.append(",index=").append(index);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// metadata<NEW_LINE>vals = new ArrayList<String<MASK><NEW_LINE>Collections.sort(vals);<NEW_LINE>for (String key : vals) {<NEW_LINE>List<String> subVals = new ArrayList<String>(mm.get(key));<NEW_LINE>Collections.sort(subVals);<NEW_LINE>for (String val : subVals) {<NEW_LINE>sb.append(",").append(key).append("=").append(val);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>}
>(mm.keySet());
722,679
public void createEntryInSequencePerOrganizationForDatasource(MongockTemplate mongoTemplate) {<NEW_LINE>Map<String, Long> maxDatasourceCount = new HashMap<>();<NEW_LINE>mongoTemplate.find(query(where("name").regex("^Untitled Datasource \\d+$")), Datasource.class).forEach(datasource -> {<NEW_LINE>long count = 1;<NEW_LINE>String datasourceCnt = datasource.getName().substring("Untitled Datasource ".length()).trim();<NEW_LINE>if (!datasourceCnt.isEmpty()) {<NEW_LINE>count = Long.parseLong(datasourceCnt);<NEW_LINE>}<NEW_LINE>if (maxDatasourceCount.containsKey(datasource.getOrganizationId()) && (count < maxDatasourceCount.get(datasource.getOrganizationId()))) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>maxDatasourceCount.put(datasource.getOrganizationId(), count);<NEW_LINE>});<NEW_LINE>maxDatasourceCount.forEach((key, val) -> {<NEW_LINE>Sequence sequence = new Sequence();<NEW_LINE>sequence.setName("datasource for organization with _id : " + key);<NEW_LINE><MASK><NEW_LINE>mongoTemplate.save(sequence);<NEW_LINE>});<NEW_LINE>}
sequence.setNextNumber(val + 1);
667,083
void readImplementations(SubType type) {<NEW_LINE>this.interfaces.addAll(this.validationClassNode.interfaces);<NEW_LINE>this.interfaces.addAll(type.getInterfaces());<NEW_LINE>AnnotationNode implementsAnnotation = Annotations.getInvisible(this.validationClassNode, Implements.class);<NEW_LINE>if (implementsAnnotation == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<AnnotationNode> <MASK><NEW_LINE>if (interfaces == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (AnnotationNode interfaceNode : interfaces) {<NEW_LINE>InterfaceInfo interfaceInfo = InterfaceInfo.fromAnnotation(MixinInfo.this, interfaceNode);<NEW_LINE>this.softImplements.add(interfaceInfo);<NEW_LINE>this.interfaces.add(interfaceInfo.getInternalName());<NEW_LINE>// only add interface if its initial initialisation<NEW_LINE>if (!(this instanceof Reloaded)) {<NEW_LINE>this.classInfo.addInterface(interfaceInfo.getInternalName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
interfaces = Annotations.getValue(implementsAnnotation);
1,004,044
public void replaceDependencies(final Set<ModuleDependency> newDeps) throws CyclicDependencyException {<NEW_LINE>Set<ModuleDependency> addedDeps = new HashSet<ModuleDependency>(newDeps);<NEW_LINE>try {<NEW_LINE>SortedSet<ModuleDependency> currentDeps = getDirectDependencies();<NEW_LINE>addedDeps.removeAll(currentDeps);<NEW_LINE>String warning = getDependencyCycleWarning(addedDeps);<NEW_LINE>if (warning != null) {<NEW_LINE>throw new CyclicDependencyException(warning);<NEW_LINE>}<NEW_LINE>} catch (IOException x) {<NEW_LINE>// getDirectDependencies<NEW_LINE>// and skip check<NEW_LINE>LOG.log(<MASK><NEW_LINE>}<NEW_LINE>Element _confData = getConfData();<NEW_LINE>Document doc = _confData.getOwnerDocument();<NEW_LINE>Element moduleDependencies = findModuleDependencies(_confData);<NEW_LINE>_confData.removeChild(moduleDependencies);<NEW_LINE>moduleDependencies = createModuleElement(doc, ProjectXMLManager.MODULE_DEPENDENCIES);<NEW_LINE>XMLUtil.appendChildElement(_confData, moduleDependencies, ORDER);<NEW_LINE>SortedSet<ModuleDependency> sortedDeps = new TreeSet<ModuleDependency>(newDeps);<NEW_LINE>for (ModuleDependency md : sortedDeps) {<NEW_LINE>createModuleDependencyElement(moduleDependencies, md, null);<NEW_LINE>}<NEW_LINE>project.putPrimaryConfigurationData(_confData);<NEW_LINE>this.directDeps = sortedDeps;<NEW_LINE>}
Level.INFO, null, x);
371,171
public Map<String, LinkedList<BinaryMapDataObject>> cacheAllCountries() throws IOException {<NEW_LINE>quadTree = new QuadTree<String>(new QuadRect(0, 0, Integer.MAX_VALUE, Integer.MAX_VALUE), 8, 0.55f);<NEW_LINE>final ResultMatcher<BinaryMapDataObject> resultMatcher = new ResultMatcher<BinaryMapDataObject>() {<NEW_LINE><NEW_LINE>// int c = 0;<NEW_LINE>@Override<NEW_LINE>public boolean publish(BinaryMapDataObject object) {<NEW_LINE>if (object.getPointsLength() < 1) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>initTypes(object);<NEW_LINE>String nm = mapIndexFields.get(mapIndexFields.downloadNameType, object);<NEW_LINE>if (!countriesByDownloadName.containsKey(nm)) {<NEW_LINE>LinkedList<BinaryMapDataObject> ls = new LinkedList<BinaryMapDataObject>();<NEW_LINE>countriesByDownloadName.put(nm, ls);<NEW_LINE>ls.add(object);<NEW_LINE>} else {<NEW_LINE>countriesByDownloadName.get(nm).add(object);<NEW_LINE>}<NEW_LINE>int maxx = object.getPoint31XTile(0);<NEW_LINE>int <MASK><NEW_LINE>int minx = maxx;<NEW_LINE>int miny = maxy;<NEW_LINE>for (int i = 1; i < object.getPointsLength(); i++) {<NEW_LINE>int x = object.getPoint31XTile(i);<NEW_LINE>int y = object.getPoint31YTile(i);<NEW_LINE>if (y < miny) {<NEW_LINE>miny = y;<NEW_LINE>} else if (y > maxy) {<NEW_LINE>maxy = y;<NEW_LINE>}<NEW_LINE>if (x < minx) {<NEW_LINE>minx = x;<NEW_LINE>} else if (x > maxx) {<NEW_LINE>maxx = x;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>quadTree.insert(nm, new QuadRect(minx, miny, maxx, maxy));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean isCancelled() {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>iterateOverAllObjects(resultMatcher);<NEW_LINE>return countriesByDownloadName;<NEW_LINE>}
maxy = object.getPoint31YTile(0);
158,438
private Map toMap(JSONObject jsonObject) throws JSONException {<NEW_LINE>Map parentBean = new HashMap();<NEW_LINE><MASK><NEW_LINE>while (i.hasNext()) {<NEW_LINE>String key = (String) i.next();<NEW_LINE>Object value = jsonObject.get(key);<NEW_LINE>if (value instanceof JSONObject) {<NEW_LINE>Map subBean = toMap((JSONObject) value);<NEW_LINE>parentBean.put(key, subBean);<NEW_LINE>} else if (value instanceof JSONArray) {<NEW_LINE>JSONArray array = (JSONArray) value;<NEW_LINE>int length = array.length();<NEW_LINE>List list = new ArrayList(length);<NEW_LINE>for (int j = 0; j < length; j++) {<NEW_LINE>Object itemValue = array.get(j);<NEW_LINE>if (itemValue instanceof JSONObject) {<NEW_LINE>list.add(toMap((JSONObject) itemValue));<NEW_LINE>} else {<NEW_LINE>list.add(itemValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>parentBean.put(key, list);<NEW_LINE>} else {<NEW_LINE>parentBean.put(key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return parentBean;<NEW_LINE>}
Iterator i = jsonObject.keys();
1,118,442
private void deleteAllContracts(OrganizationBean organizationBean) throws StorageException {<NEW_LINE>Query query;<NEW_LINE>if (isMySql()) {<NEW_LINE>String sql = "DELETE c " + " FROM contracts c " + " JOIN api_versions " + " ON c.apiv_id = api_versions.id " + " JOIN apis " + " ON api_versions.api_id = apis.id " + " AND api_versions.api_org_id = apis.organization_id " + " JOIN organizations " + " ON apis.organization_id = organizations.id " + "WHERE organizations.id = :orgId ;";<NEW_LINE>query = getActiveEntityManager().createNativeQuery(sql);<NEW_LINE>} else {<NEW_LINE>String jpql = "DELETE ContractBean deleteBean " + " WHERE deleteBean IN ( " + " SELECT b " + " FROM ContractBean b " + " JOIN b.api apiVersion " + " JOIN apiVersion.api api " + " JOIN api.organization o " + " WHERE o.id = :orgId " + " )";<NEW_LINE>query = getActiveEntityManager().createQuery(jpql);<NEW_LINE>}<NEW_LINE>query.setParameter(<MASK><NEW_LINE>query.executeUpdate();<NEW_LINE>}
"orgId", organizationBean.getId());
1,646,747
public String visit(ASTNode.SubQuery node) {<NEW_LINE>ZQLMetadata.InventoryMetadata inventory = ZQLMetadata.findInventoryMetadata(node.getTarget().getEntity());<NEW_LINE>ZQLContext.pushQueryTargetInventoryName(inventory.fullInventoryName());<NEW_LINE>String fieldName = node.getTarget().getFields() == null || node.getTarget().getFields().isEmpty() ? "" : node.getTarget().getFields().get(0);<NEW_LINE>if (fieldName != "") {<NEW_LINE>inventory.errorIfNoField(fieldName);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>String queryTarget = fieldName.equals("") ? entityAlias : String.format("%s.%s", inventory.simpleInventoryName(), fieldName);<NEW_LINE>String entityVOName = inventory.inventoryAnnotation.mappingVOClass().getSimpleName();<NEW_LINE>List<String> clauses = new ArrayList<>();<NEW_LINE>clauses.add(String.format("SELECT %s FROM %s %s", queryTarget, entityVOName, entityAlias));<NEW_LINE>String condition = makeConditions(node);<NEW_LINE>if (!condition.equals("")) {<NEW_LINE>clauses.add("WHERE");<NEW_LINE>clauses.add(condition);<NEW_LINE>}<NEW_LINE>ZQLContext.popQueryTargetInventoryName();<NEW_LINE>return String.format("(%s)", StringUtils.join(clauses, " "));<NEW_LINE>}
String entityAlias = inventory.simpleInventoryName();
1,030,404
public boolean apply(Game game, Ability source) {<NEW_LINE>Set<UUID> lands = new HashSet<>();<NEW_LINE>for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {<NEW_LINE>Player player = game.getPlayer(playerId);<NEW_LINE>if (player != null) {<NEW_LINE>for (SubType landName : Arrays.stream(SubType.values()).filter(p -> p.getSubTypeSet() == SubTypeSet.BasicLandType).collect(Collectors.toSet())) {<NEW_LINE>FilterControlledLandPermanent filter = new FilterControlledLandPermanent(landName + " you control");<NEW_LINE>filter.add(landName.getPredicate());<NEW_LINE>Target target = new TargetControlledPermanent(1, 1, filter, true);<NEW_LINE>if (target.canChoose(player.getId(), source, game)) {<NEW_LINE>player.chooseTarget(<MASK><NEW_LINE>lands.add(target.getFirstTarget());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_LAND, game)) {<NEW_LINE>if (!lands.contains(permanent.getId())) {<NEW_LINE>permanent.sacrifice(source, game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
outcome, target, source, game);
1,537,532
public static void assertValuesMayConvert(EventBean eventBean, String[] propertyNames, ValueWithExistsFlag[] expected, Function<Object, Object> optionalValueConversion) {<NEW_LINE>SupportEventTypeAssertionUtil.assertConsistency(eventBean);<NEW_LINE>Object[] receivedValues <MASK><NEW_LINE>Object[] expectedValues = new Object[propertyNames.length];<NEW_LINE>for (int i = 0; i < receivedValues.length; i++) {<NEW_LINE>Object value = eventBean.get(propertyNames[i]);<NEW_LINE>if (optionalValueConversion != null) {<NEW_LINE>value = optionalValueConversion.apply(value);<NEW_LINE>}<NEW_LINE>receivedValues[i] = value;<NEW_LINE>expectedValues[i] = expected[i].getValue();<NEW_LINE>}<NEW_LINE>EPAssertionUtil.assertEqualsExactOrder(expectedValues, receivedValues);<NEW_LINE>for (int i = 0; i < receivedValues.length; i++) {<NEW_LINE>boolean exists = (Boolean) eventBean.get("exists_" + propertyNames[i]);<NEW_LINE>assertEquals("Assertion failed for property 'exists_" + propertyNames[i] + "'", expected[i].isExists(), exists);<NEW_LINE>}<NEW_LINE>}
= new Object[propertyNames.length];
219,719
public static void runSample() {<NEW_LINE><MASK><NEW_LINE>System.out.println(" Starting Event Hubs Sender Sample");<NEW_LINE>System.out.println("================================================================");<NEW_LINE>if (AZURE_EVENT_HUBS_CONNECTION_STRING.isEmpty() || (AZURE_EVENT_HUBS_NAMESPACE.isEmpty() && AZURE_EVENT_HUBS_NAME.isEmpty())) {<NEW_LINE>System.err.println("AZURE_EVENT_HUBS_CONNECTION_STRING environment variable should be set or " + "AZURE_EVENT_HUBS_NAMESPACE and AZURE_EVENT_HUBS_NAME environment variables should be set to " + "run this sample.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>EventHubClientBuilder eventHubClientBuilder = new EventHubClientBuilder();<NEW_LINE>if (AZURE_EVENT_HUBS_CONNECTION_STRING.isEmpty()) {<NEW_LINE>eventHubClientBuilder.credential(AZURE_EVENT_HUBS_NAMESPACE, AZURE_EVENT_HUBS_NAME, new DefaultAzureCredentialBuilder().build());<NEW_LINE>} else {<NEW_LINE>eventHubClientBuilder.connectionString(AZURE_EVENT_HUBS_CONNECTION_STRING);<NEW_LINE>}<NEW_LINE>final EventHubProducerClient eventHubProducerClient = eventHubClientBuilder.buildProducerClient();<NEW_LINE>System.out.println("Event Hub producer client created");<NEW_LINE>eventHubProducerClient.send(Arrays.asList(new EventData("Test event - graalvm")));<NEW_LINE>System.out.println("Sent message to Event Hub");<NEW_LINE>eventHubProducerClient.close();<NEW_LINE>System.out.println("\n================================================================");<NEW_LINE>System.out.println(" Event Hubs Sender Sample Complete");<NEW_LINE>System.out.println("================================================================");<NEW_LINE>}
System.out.println("\n================================================================");
1,676,646
public void beforeLayout(RecyclerView.Recycler recycler, RecyclerView.State state, LayoutManagerHelper helper) {<NEW_LINE>super.beforeLayout(recycler, state, helper);<NEW_LINE>int availableWidth;<NEW_LINE>if (helper.getOrientation() == VERTICAL) {<NEW_LINE>availableWidth = helper.getContentWidth() - helper.getPaddingLeft() - helper.getPaddingRight() <MASK><NEW_LINE>} else {<NEW_LINE>availableWidth = helper.getContentHeight() - helper.getPaddingTop() - helper.getPaddingBottom() - getVerticalMargin() - getVerticalPadding();<NEW_LINE>}<NEW_LINE>mColLength = (int) ((availableWidth - mHGap * (mNumLanes - 1)) / mNumLanes + 0.5);<NEW_LINE>int totalGaps = availableWidth - mColLength * mNumLanes;<NEW_LINE>if (mNumLanes <= 1) {<NEW_LINE>mEachGap = mLastGap = 0;<NEW_LINE>} else if (mNumLanes == 2) {<NEW_LINE>mEachGap = totalGaps;<NEW_LINE>mLastGap = totalGaps;<NEW_LINE>} else {<NEW_LINE>mEachGap = mLastGap = helper.getOrientation() == VERTICAL ? mHGap : mVGap;<NEW_LINE>}<NEW_LINE>if (mLayoutManager == null || mLayoutManager.get() == null || mLayoutManager.get() != helper) {<NEW_LINE>if (helper instanceof VirtualLayoutManager) {<NEW_LINE>mLayoutManager = new WeakReference<VirtualLayoutManager>((VirtualLayoutManager) helper);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
- getHorizontalMargin() - getHorizontalPadding();
1,524,021
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {<NEW_LINE>List<String> messages = new ArrayList<>();<NEW_LINE>if (canDodge) {<NEW_LINE>messages.add(getStatMessage(SubSkillType.ACROBATICS_DODGE, dodgeChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", dodgeChanceLucky) : ""));<NEW_LINE>}<NEW_LINE>if (canRoll) {<NEW_LINE>AbstractSubSkill abstractSubSkill = InteractionManager.getAbstractByName("Roll");<NEW_LINE>if (abstractSubSkill != null) {<NEW_LINE>double rollChance, graceChance;<NEW_LINE>// Chance to roll at half<NEW_LINE>RandomChanceSkill roll_rcs = new RandomChanceSkill(player, SubSkillType.ACROBATICS_ROLL);<NEW_LINE>// Chance to graceful roll<NEW_LINE>RandomChanceSkill grace_rcs = new RandomChanceSkill(player, SubSkillType.ACROBATICS_ROLL);<NEW_LINE>// Double Odds<NEW_LINE>grace_rcs.setSkillLevel(grace_rcs.getSkillLevel() * 2);<NEW_LINE>// Chance Stat Calculations<NEW_LINE>rollChance = RandomChanceUtil.getRandomChanceExecutionChance(roll_rcs);<NEW_LINE>graceChance = RandomChanceUtil.getRandomChanceExecutionChance(grace_rcs);<NEW_LINE>// damageThreshold = mcMMO.p.getAdvancedConfig().getRollDamageThreshold();<NEW_LINE>String[] rollStrings = getAbilityDisplayValues(SkillActivationType.<MASK><NEW_LINE>// Format<NEW_LINE>double rollChanceLucky = rollChance * 1.333D;<NEW_LINE>double graceChanceLucky = graceChance * 1.333D;<NEW_LINE>messages.add(getStatMessage(SubSkillType.ACROBATICS_ROLL, rollStrings[0]) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", rollStrings[1]) : ""));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return messages;<NEW_LINE>}
RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.ACROBATICS_ROLL);
685,854
private JPanel createQuickListsPanel() {<NEW_LINE>myQuickListsList = new JBList(myQuickListsModel);<NEW_LINE>myQuickListsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);<NEW_LINE>myQuickListsList.setCellRenderer(new MyQuickListCellRenderer());<NEW_LINE>myQuickListsList.addListSelectionListener(new ListSelectionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void valueChanged(ListSelectionEvent e) {<NEW_LINE>myRightPanel.removeAll();<NEW_LINE>final Object selectedValue = myQuickListsList.getSelectedValue();<NEW_LINE>if (selectedValue instanceof QuickList) {<NEW_LINE><MASK><NEW_LINE>updateRightPanel(quickList);<NEW_LINE>myQuickListsList.repaint();<NEW_LINE>} else {<NEW_LINE>addDescriptionLabel();<NEW_LINE>}<NEW_LINE>myRightPanel.revalidate();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>addDescriptionLabel();<NEW_LINE>ToolbarDecorator toolbarDecorator = ToolbarDecorator.createDecorator(myQuickListsList).setAddAction(new AnActionButtonRunnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(AnActionButton button) {<NEW_LINE>QuickList quickList = new QuickList(createUniqueName(), "", ArrayUtil.EMPTY_STRING_ARRAY, false);<NEW_LINE>myQuickListsModel.addElement(quickList);<NEW_LINE>myQuickListsList.clearSelection();<NEW_LINE>ScrollingUtil.selectItem(myQuickListsList, quickList);<NEW_LINE>myKeymapListener.processCurrentKeymapChanged(getCurrentQuickListIds());<NEW_LINE>}<NEW_LINE>}).setRemoveAction(new AnActionButtonRunnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(AnActionButton button) {<NEW_LINE>ListUtil.removeSelectedItems(myQuickListsList);<NEW_LINE>myQuickListsList.repaint();<NEW_LINE>myKeymapListener.processCurrentKeymapChanged(getCurrentQuickListIds());<NEW_LINE>}<NEW_LINE>}).disableUpDownActions();<NEW_LINE>return toolbarDecorator.setToolbarPosition(ActionToolbarPosition.TOP).setPanelBorder(JBUI.Borders.empty()).createPanel();<NEW_LINE>}
final QuickList quickList = (QuickList) selectedValue;
1,129,503
private void createPanelWidgets() {<NEW_LINE>int gridy = -1;<NEW_LINE>addGridBagComponent(this, createTopSpacer(), 0, ++gridy, fullGridWidth, 1, 0, 0, java.awt.GridBagConstraints.WEST, java.awt.GridBagConstraints.NONE, topSpacerInsets, 0, 0);<NEW_LINE>clientTable = new DisplayTable(categories);<NEW_LINE>clientTable.getAccessibleContext().setAccessibleName(NbBundle.getBundle(ClientDisplay.class).getString("ACS_MON_ClientTable_3A11yName"));<NEW_LINE>clientTable.setToolTipText(NbBundle.getBundle(ClientDisplay.class).getString("ACS_MON_ClientTable_3A11yDesc"));<NEW_LINE>addGridBagComponent(this, createHeaderLabel(NbBundle.getBundle(ClientDisplay.class).getString("MON_Client_3"), NbBundle.getBundle(ClientDisplay.class).getString("ACS_MON_Client_3A11yDesc"), clientTable), 0, ++gridy, fullGridWidth, 1, 0, 0, java.awt.GridBagConstraints.WEST, java.awt.GridBagConstraints.<MASK><NEW_LINE>addGridBagComponent(this, clientTable, 0, ++gridy, fullGridWidth, 1, tableWeightX, tableWeightY, java.awt.GridBagConstraints.WEST, java.awt.GridBagConstraints.BOTH, tableInsets, 0, 0);<NEW_LINE>engineTable = new DisplayTable(props);<NEW_LINE>engineTable.getAccessibleContext().setAccessibleName(NbBundle.getBundle(ClientDisplay.class).getString("ACS_MON_Servlet_engineTableA11yName"));<NEW_LINE>engineTable.setToolTipText(NbBundle.getBundle(ClientDisplay.class).getString("ACS_MON_Servlet_engineTableA11yDesc"));<NEW_LINE>addGridBagComponent(this, createHeaderLabel(NbBundle.getBundle(ClientDisplay.class).getString("MON_Servlet_engine"), NbBundle.getBundle(ClientDisplay.class).getString("ACS_MON_Servlet_engineA11yDesc"), engineTable), 0, ++gridy, fullGridWidth, 1, 0, 0, java.awt.GridBagConstraints.WEST, java.awt.GridBagConstraints.NONE, labelInsets, 0, 0);<NEW_LINE>addGridBagComponent(this, engineTable, 0, ++gridy, fullGridWidth, 1, tableWeightX, tableWeightY, java.awt.GridBagConstraints.WEST, java.awt.GridBagConstraints.BOTH, tableInsets, 0, 0);<NEW_LINE>addGridBagComponent(this, createGlue(), 0, ++gridy, 1, 1, 1.0, 1.0, java.awt.GridBagConstraints.WEST, java.awt.GridBagConstraints.BOTH, zeroInsets, 0, 0);<NEW_LINE>}
NONE, labelInsets, 0, 0);
387,098
public static void main(String[] args) {<NEW_LINE>Exercise27_QueueWith2Stacks<String> <MASK><NEW_LINE>StdOut.println("IsEmpty: " + exercise27_queueWith2Stacks.isEmpty() + " Expected: true");<NEW_LINE>StdOut.println("Size: " + exercise27_queueWith2Stacks.size() + " Expected: 0");<NEW_LINE>exercise27_queueWith2Stacks.enqueue("A");<NEW_LINE>exercise27_queueWith2Stacks.enqueue("B");<NEW_LINE>StdOut.println(exercise27_queueWith2Stacks.dequeue());<NEW_LINE>StdOut.println(exercise27_queueWith2Stacks.dequeue());<NEW_LINE>exercise27_queueWith2Stacks.enqueue("C");<NEW_LINE>exercise27_queueWith2Stacks.enqueue("D");<NEW_LINE>exercise27_queueWith2Stacks.enqueue("E");<NEW_LINE>exercise27_queueWith2Stacks.enqueue("F");<NEW_LINE>StdOut.println("Size: " + exercise27_queueWith2Stacks.size() + " Expected: 4");<NEW_LINE>StdOut.println(exercise27_queueWith2Stacks.dequeue());<NEW_LINE>StdOut.println(exercise27_queueWith2Stacks.dequeue());<NEW_LINE>StdOut.println("Expected output from dequeue(): A B C D");<NEW_LINE>StdOut.println("IsEmpty: " + exercise27_queueWith2Stacks.isEmpty() + " Expected: false");<NEW_LINE>StdOut.println("Size: " + exercise27_queueWith2Stacks.size() + " Expected: 2");<NEW_LINE>}
exercise27_queueWith2Stacks = new Exercise27_QueueWith2Stacks<>();
365,793
private void writeCoeffAbsLevel(MEncoder encoder, BlockType blockType, int numDecodAbsLevelGt1, int numDecodAbsLevelEq1, int absLev) {<NEW_LINE>int incB0 = ((numDecodAbsLevelGt1 != 0) ? 0 : Math.min(4, 1 + numDecodAbsLevelEq1));<NEW_LINE>int incBN = 5 + Math.min(<MASK><NEW_LINE>if (absLev == 0) {<NEW_LINE>encoder.encodeBin(blockType.coeffAbsLevelCtxOff + incB0, 0);<NEW_LINE>} else {<NEW_LINE>encoder.encodeBin(blockType.coeffAbsLevelCtxOff + incB0, 1);<NEW_LINE>if (absLev < 14) {<NEW_LINE>for (int i = 1; i < absLev; i++) encoder.encodeBin(blockType.coeffAbsLevelCtxOff + incBN, 1);<NEW_LINE>encoder.encodeBin(blockType.coeffAbsLevelCtxOff + incBN, 0);<NEW_LINE>} else {<NEW_LINE>for (int i = 1; i < 14; i++) encoder.encodeBin(blockType.coeffAbsLevelCtxOff + incBN, 1);<NEW_LINE>absLev -= 14;<NEW_LINE>int sufLen, pow;<NEW_LINE>for (sufLen = 0, pow = 1; absLev >= pow; sufLen++, pow = (1 << sufLen)) {<NEW_LINE>encoder.encodeBinBypass(1);<NEW_LINE>absLev -= pow;<NEW_LINE>}<NEW_LINE>encoder.encodeBinBypass(0);<NEW_LINE>for (sufLen--; sufLen >= 0; sufLen--) encoder.encodeBinBypass((absLev >> sufLen) & 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
4 - blockType.coeffAbsLevelAdjust, numDecodAbsLevelGt1);
430,022
public static DocumentFilter createDocumentFilterFromMQuery(@NonNull final MQuery mquery, @NonNull final ITranslatableString caption) {<NEW_LINE>final ArrayList<DocumentFilterParam> parameters = new ArrayList<>();<NEW_LINE>for (int restrictionIdx = 0, restrictionsCount = mquery.getRestrictionCount(); restrictionIdx < restrictionsCount; restrictionIdx++) {<NEW_LINE>final DocumentFilterParam param = createDocumentFilterParamFromMQueryRestriction(mquery, restrictionIdx);<NEW_LINE>parameters.add(param);<NEW_LINE>}<NEW_LINE>final String filterId;<NEW_LINE>if (parameters.size() == 1 && !parameters.get(0).isSqlFilter()) {<NEW_LINE>filterId = parameters.get(0).getFieldName();<NEW_LINE>} else {<NEW_LINE>// FIXME: find a better filterId<NEW_LINE>filterId = "MQuery-" + UUID.randomUUID();<NEW_LINE>}<NEW_LINE>return DocumentFilter.builder().setFilterId(filterId).setCaption(caption).<MASK><NEW_LINE>}
setParameters(parameters).build();
941,819
static ObjectIntHashMap<IRI> initMap() {<NEW_LINE>ObjectIntHashMap<IRI> predicates = new ObjectIntHashMap<>();<NEW_LINE>AtomicInteger nextId = new AtomicInteger(1);<NEW_LINE>List<OWLRDFVocabulary> ORDERED_URIS = Arrays.asList(RDF_TYPE, RDFS_LABEL, OWL_DEPRECATED, RDFS_COMMENT, RDFS_IS_DEFINED_BY, RDF_FIRST, RDF_REST, OWL_EQUIVALENT_CLASS, OWL_EQUIVALENT_PROPERTY, RDFS_SUBCLASS_OF, RDFS_SUB_PROPERTY_OF, RDFS_DOMAIN, RDFS_RANGE, OWL_DISJOINT_WITH, OWL_ON_PROPERTY, OWL_DATA_RANGE, OWL_ON_CLASS, OWL_ANNOTATED_SOURCE, OWL_ANNOTATED_PROPERTY, OWL_ANNOTATED_TARGET);<NEW_LINE>ORDERED_URIS.forEach(iri -> predicates.put(iri.getIRI()<MASK><NEW_LINE>Stream.of(OWLRDFVocabulary.values()).forEach(iri -> predicates.putIfAbsent(iri.getIRI(), nextId.getAndIncrement()));<NEW_LINE>return predicates;<NEW_LINE>}
, nextId.getAndIncrement()));
1,852,031
public Optional<FieldValueBuilder> fieldValue(final Object value) {<NEW_LINE>if (null != value) {<NEW_LINE>if (value instanceof String) {<NEW_LINE>return Optional.of(HiddenFieldType.builder().value(((String) value)));<NEW_LINE>}<NEW_LINE>if (value instanceof Boolean) {<NEW_LINE>return Optional.of(BoolHiddenFieldType.builder().value((Boolean) value));<NEW_LINE>}<NEW_LINE>if (value instanceof Date) {<NEW_LINE>return Optional.of(DateHiddenFieldType.builder().value((Date) value));<NEW_LINE>}<NEW_LINE>if (value instanceof Float) {<NEW_LINE>return Optional.of(FloatHiddenFieldType.builder().value((Float) value));<NEW_LINE>}<NEW_LINE>if (value instanceof Long) {<NEW_LINE>return Optional.of(LongHiddenFieldType.builder().<MASK><NEW_LINE>}<NEW_LINE>if (value instanceof Integer) {<NEW_LINE>return Optional.of(LongHiddenFieldType.builder().value(((Integer) value).longValue()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final DataTypes dataType = dataType();<NEW_LINE>switch(dataType) {<NEW_LINE>case BOOL:<NEW_LINE>return Optional.of(BoolHiddenFieldType.builder().value(false));<NEW_LINE>case FLOAT:<NEW_LINE>return Optional.of(FloatHiddenFieldType.builder().value(0F));<NEW_LINE>case INTEGER:<NEW_LINE>return Optional.of(LongHiddenFieldType.builder().value(0L));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Optional.empty();<NEW_LINE>}
value((Long) value));
1,459,477
private static void writeEntry(String name, Set<String> written, ZipOutputStream zos, File f) throws IOException, FileNotFoundException {<NEW_LINE>if (!written.add(name)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int idx = name.lastIndexOf('/', name.length() - 2);<NEW_LINE>if (idx != -1) {<NEW_LINE>writeEntry(name.substring(0, idx + 1), written, zos, f.getParentFile());<NEW_LINE>}<NEW_LINE>ZipEntry ze = new ZipEntry(name);<NEW_LINE>ze.setTime(f.lastModified());<NEW_LINE>if (name.endsWith("/")) {<NEW_LINE>ze.setMethod(ZipEntry.STORED);<NEW_LINE>ze.setSize(0);<NEW_LINE>ze.setCrc(0);<NEW_LINE>zos.putNextEntry(ze);<NEW_LINE>} else {<NEW_LINE>InputStream is = new FileInputStream(f);<NEW_LINE>ze.setMethod(ZipEntry.DEFLATED);<NEW_LINE>ze.setSize(f.length());<NEW_LINE>CRC32 crc = new CRC32();<NEW_LINE>try {<NEW_LINE>copyStreams(is, null, crc);<NEW_LINE>} finally {<NEW_LINE>is.close();<NEW_LINE>}<NEW_LINE>ze.setCrc(crc.getValue());<NEW_LINE>zos.putNextEntry(ze);<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>copyStreams(zis, zos, null);<NEW_LINE>} finally {<NEW_LINE>zis.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
InputStream zis = new FileInputStream(f);
10,511
public void onAdded(WindowBasedTextGUI textGUI, Window window, List<Window> allWindows) {<NEW_LINE>WindowDecorationRenderer decorationRenderer = getWindowDecorationRenderer(window);<NEW_LINE>TerminalSize expectedDecoratedSize = decorationRenderer.getDecoratedSize(window, window.getPreferredSize());<NEW_LINE>window.setDecoratedSize(expectedDecoratedSize);<NEW_LINE>// noinspection StatementWithEmptyBody<NEW_LINE>if (window.getHints().contains(Window.Hint.FIXED_POSITION)) {<NEW_LINE>// Don't place the window, assume the position is already set<NEW_LINE>} else if (allWindows.isEmpty()) {<NEW_LINE>window.setPosition(TerminalPosition.OFFSET_1x1);<NEW_LINE>} else if (window.getHints().contains(Window.Hint.CENTERED)) {<NEW_LINE>int left = (lastKnownScreenSize.getColumns() - expectedDecoratedSize.getColumns()) / 2;<NEW_LINE>int top = (lastKnownScreenSize.getRows() - <MASK><NEW_LINE>window.setPosition(new TerminalPosition(left, top));<NEW_LINE>} else {<NEW_LINE>TerminalPosition nextPosition = allWindows.get(allWindows.size() - 1).getPosition().withRelative(2, 1);<NEW_LINE>if (nextPosition.getColumn() + expectedDecoratedSize.getColumns() > lastKnownScreenSize.getColumns() || nextPosition.getRow() + expectedDecoratedSize.getRows() > lastKnownScreenSize.getRows()) {<NEW_LINE>nextPosition = TerminalPosition.OFFSET_1x1;<NEW_LINE>}<NEW_LINE>window.setPosition(nextPosition);<NEW_LINE>}<NEW_LINE>// Finally, run through the usual calculations so the window manager's usual prepare method can have it's say<NEW_LINE>prepareWindow(lastKnownScreenSize, window);<NEW_LINE>}
expectedDecoratedSize.getRows()) / 2;
738,581
public // Feature SIB0112b.mp.1<NEW_LINE>void restore(final List<DataSlice> dataSlices) throws SevereMessageStoreException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "restore", dataSlices);<NEW_LINE>super.restore(dataSlices);<NEW_LINE>key = new AIStreamKey(getMessage().getGuaranteedRemoteGetValueTick());<NEW_LINE>// find DestinationHandler and use it to initialize reference to RemoteConsumerDispatcher<NEW_LINE>ItemStream itemstream = null;<NEW_LINE>try {<NEW_LINE>itemstream = getItemStream();<NEW_LINE>} catch (SevereMessageStoreException e) {<NEW_LINE>// FFDC<NEW_LINE>FFDCFilter.processException(e, "com.ibm.ws.sib.processor.impl.store.items.AIMessageItem.restore", "1:249:1.44.1.10", this);<NEW_LINE>SibTr.exception(tc, e);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "restore", e);<NEW_LINE>throw new SIErrorException(e);<NEW_LINE>}<NEW_LINE>BaseDestinationHandler destinationHandler = null;<NEW_LINE>PtoPMessageItemStream localisation = (PtoPMessageItemStream) itemstream;<NEW_LINE>destinationHandler = localisation.getDestinationHandler();<NEW_LINE>// Using the uuid of the source ME in the message to retrieve the corresponding RCD, on the<NEW_LINE>// assumption that this RCD is the one to which the message was originally given to.<NEW_LINE>// When the message originally arrived, MPIO used the message's source cellule obtained via TRM<NEW_LINE>// to determine the AIH/RCD that would handle it.<NEW_LINE>// The assumption then is that the two forms of obtaining the source ME uuid yield the same RCD.<NEW_LINE>SIBUuid8 sourceMEId = getMessage().getGuaranteedSourceMessagingEngineUUID();<NEW_LINE>SIBUuid12 gatheringUuid = getMessage().getGuaranteedGatheringTargetUUID();<NEW_LINE>this.aih = destinationHandler.<MASK><NEW_LINE>synchronized (this) {<NEW_LINE>// restore the value by looking it up<NEW_LINE>cachedRedeliveredCount = getMessage().getRedeliveredCount();<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "restore");<NEW_LINE>}
getAnycastInputHandler(sourceMEId, gatheringUuid, true);
1,736,948
public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {<NEW_LINE>TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "blelrl");<NEW_LINE>Long baseOffset = instruction.getAddress().toLong() * 0x100;<NEW_LINE>final String jumpOperand = environment.getNextVariableString();<NEW_LINE>final IOperandTreeNode BIOperand = instruction.getOperands().get(0).getRootNode().getChildren().get(0);<NEW_LINE>instructions.add(ReilHelpers.createOr(baseOffset++, OperandSize.BYTE, String.valueOf((Helpers.getCRRegisterIndex(BIOperand.getValue()) * 4) + 2), OperandSize.BYTE, String.valueOf((Helpers.getCRRegisterIndex(BIOperand.getValue()) * 4) + 0)<MASK><NEW_LINE>BranchGenerator.generate(baseOffset, environment, instruction, instructions, "blelrl", jumpOperand, Helpers.LINK_REGISTER, true, false, false, false, false, false);<NEW_LINE>}
, OperandSize.BYTE, jumpOperand));
898,200
public Span start() {<NEW_LINE>Baggage baggage = null;<NEW_LINE>io.opentelemetry.api.trace.SpanBuilder builder = tracer().spanBuilder(spanName);<NEW_LINE>if (ignoreActiveSpan && parentSpan == null && parentSpanContext == null) {<NEW_LINE>builder.setNoParent();<NEW_LINE>} else if (parentSpan != null) {<NEW_LINE>builder.setParent(Context.root().with(parentSpan.getSpan()));<NEW_LINE>SpanContextShim contextShim = spanContextTable().get(parentSpan);<NEW_LINE>baggage = contextShim == null ? null : contextShim.getBaggage();<NEW_LINE>} else if (parentSpanContext != null) {<NEW_LINE>builder.setParent(Context.root().with(io.opentelemetry.api.trace.Span.wrap(parentSpanContext.getSpanContext())));<NEW_LINE>baggage = parentSpanContext.getBaggage();<NEW_LINE>}<NEW_LINE>for (io.opentelemetry.api.trace.SpanContext link : parentLinks) {<NEW_LINE>builder.addLink(link);<NEW_LINE>}<NEW_LINE>if (spanKind != null) {<NEW_LINE>builder.setSpanKind(spanKind);<NEW_LINE>}<NEW_LINE>if (startTimestampMicros > 0) {<NEW_LINE>builder.setStartTimestamp(startTimestampMicros, TimeUnit.MICROSECONDS);<NEW_LINE>}<NEW_LINE>// Attributes passed to the OT SpanBuilder MUST<NEW_LINE>// be set before the OTel Span is created,<NEW_LINE>// so those attributes are available to the Sampling API.<NEW_LINE>for (int i = 0; i < this.spanBuilderAttributeKeys.size(); i++) {<NEW_LINE>AttributeKey key = this.spanBuilderAttributeKeys.get(i);<NEW_LINE>Object value = this.spanBuilderAttributeValues.get(i);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>io.opentelemetry.api.trace.Span span = builder.startSpan();<NEW_LINE>if (error) {<NEW_LINE>span.setStatus(StatusCode.ERROR);<NEW_LINE>}<NEW_LINE>SpanShim spanShim = new SpanShim(telemetryInfo(), span);<NEW_LINE>if (baggage != null && baggage != telemetryInfo().emptyBaggage()) {<NEW_LINE>spanContextTable().create(spanShim, baggage);<NEW_LINE>}<NEW_LINE>return spanShim;<NEW_LINE>}
builder.setAttribute(key, value);
558,615
private static void removeUndefinedHsrpTrackReferences(Configuration c, Warnings w) {<NEW_LINE>for (Interface i : c.getAllInterfaces().values()) {<NEW_LINE>boolean groupsModified = false;<NEW_LINE>ImmutableMap.Builder<Integer, HsrpGroup> newGroups = ImmutableMap.builder();<NEW_LINE>for (Entry<Integer, HsrpGroup> groupById : i.getHsrpGroups().entrySet()) {<NEW_LINE>int id = groupById.getKey();<NEW_LINE>ImmutableSortedMap.Builder<String, TrackAction> newActions = ImmutableSortedMap.naturalOrder();<NEW_LINE>HsrpGroup group = groupById.getValue();<NEW_LINE>boolean tracksModified = false;<NEW_LINE>for (Entry<String, TrackAction> actionByTrack : group.getTrackActions().entrySet()) {<NEW_LINE>String track = actionByTrack.getKey();<NEW_LINE>if (!c.getTrackingGroups().containsKey(track)) {<NEW_LINE>tracksModified = true;<NEW_LINE>groupsModified = true;<NEW_LINE>w.redFlag(String.format("Removing reference to undefined track '%s' in HSRP group %d on '%s'", track, id, NodeInterfacePair.of(i)));<NEW_LINE>} else {<NEW_LINE>newActions.put(track, actionByTrack.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (tracksModified) {<NEW_LINE>HsrpGroup newGroup = group.toBuilder().setTrackActions(newActions.build()).build();<NEW_LINE>newGroups.put(id, newGroup);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (groupsModified) {<NEW_LINE>i.setHsrpGroups(newGroups.build());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
newGroups.put(id, group);
739,958
public Request<UpdateHostedZoneCommentRequest> marshall(UpdateHostedZoneCommentRequest updateHostedZoneCommentRequest) {<NEW_LINE>if (updateHostedZoneCommentRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<UpdateHostedZoneCommentRequest> request = new DefaultRequest<UpdateHostedZoneCommentRequest>(updateHostedZoneCommentRequest, "AmazonRoute53");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/2013-04-01/hostedzone/{Id}";<NEW_LINE>uriResourcePath = com.amazonaws.transform.PathMarshallers.NON_GREEDY.marshall(uriResourcePath, "Id", updateHostedZoneCommentRequest.getId());<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>XMLWriter xmlWriter = new XMLWriter(stringWriter, "https://route53.amazonaws.com/doc/2013-04-01/");<NEW_LINE>xmlWriter.startElement("UpdateHostedZoneCommentRequest");<NEW_LINE>if (updateHostedZoneCommentRequest != null) {<NEW_LINE>if (updateHostedZoneCommentRequest.getComment() != null) {<NEW_LINE>xmlWriter.startElement("Comment").value(updateHostedZoneCommentRequest.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>xmlWriter.endElement();<NEW_LINE>request.setContent(new StringInputStream(stringWriter.getBuffer().toString()));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(stringWriter.getBuffer().toString().getBytes(UTF8).length));<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/xml");<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to XML: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
getComment()).endElement();
1,283,154
private synchronized void initRand() {<NEW_LINE>// set up alias table<NEW_LINE>q = new double[p.length];<NEW_LINE>for (int i = 0; i < p.length; i++) {<NEW_LINE>q[i] = p[i] * p.length;<NEW_LINE>}<NEW_LINE>// initialize a with indices<NEW_LINE>a = new int[p.length];<NEW_LINE>for (int i = 0; i < p.length; i++) {<NEW_LINE>a[i] = i;<NEW_LINE>}<NEW_LINE>// set up H and L<NEW_LINE>int[] HL = new int[p.length];<NEW_LINE>int head = 0;<NEW_LINE>int tail = p.length - 1;<NEW_LINE>for (int i = 0; i < p.length; i++) {<NEW_LINE>if (q[i] >= 1.0) {<NEW_LINE>HL[head++] = i;<NEW_LINE>} else {<NEW_LINE>HL[tail--] = i;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>while (head != 0 && tail != p.length - 1) {<NEW_LINE>int j = HL[tail + 1];<NEW_LINE>int <MASK><NEW_LINE>a[j] = k;<NEW_LINE>q[k] += q[j] - 1;<NEW_LINE>// remove j from L<NEW_LINE>tail++;<NEW_LINE>if (q[k] < 1.0) {<NEW_LINE>// add k to L<NEW_LINE>HL[tail--] = k;<NEW_LINE>// remove k<NEW_LINE>head--;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
k = HL[head - 1];
1,743,076
public void windowStateChanged(WindowEvent evt) {<NEW_LINE>if (!Constants.AUTO_ICONIFY) {<NEW_LINE>modeView.getController().userChangedFrameStateMode(modeView, evt.getNewState());<NEW_LINE>} else {<NEW_LINE>// All the timestamping is a a workaround beause of buggy GNOME<NEW_LINE>// and of its kind who iconify the windows on leaving the desktop.<NEW_LINE><MASK><NEW_LINE>if (comp instanceof Frame) /*&& comp.isVisible() */<NEW_LINE>{<NEW_LINE>long currentStamp = System.currentTimeMillis();<NEW_LINE>if (currentStamp > (modeView.getUserStamp() + 500) && currentStamp > (modeView.getMainWindowStamp() + 1000)) {<NEW_LINE>modeView.getController().userChangedFrameStateMode(modeView, evt.getNewState());<NEW_LINE>} else {<NEW_LINE>modeView.setUserStamp(0);<NEW_LINE>modeView.setMainWindowStamp(0);<NEW_LINE>modeView.updateFrameState();<NEW_LINE>}<NEW_LINE>long stamp = System.currentTimeMillis();<NEW_LINE>modeView.setUserStamp(stamp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Component comp = modeView.getComponent();
261,749
protected IGenericClient newClientWithBaseUrl(CommandLine theCommandLine, String theBaseUrl, String theBasicAuthOptionName, String theBearerTokenOptionName) throws ParseException {<NEW_LINE>myFhirCtx.getRestfulClientFactory().setSocketTimeout<MASK><NEW_LINE>IGenericClient retVal = myFhirCtx.newRestfulGenericClient(theBaseUrl);<NEW_LINE>String basicAuthHeaderValue = getAndParseOptionBasicAuthHeader(theCommandLine, theBasicAuthOptionName);<NEW_LINE>if (isNotBlank(basicAuthHeaderValue)) {<NEW_LINE>retVal.registerInterceptor(new SimpleRequestHeaderInterceptor(Constants.HEADER_AUTHORIZATION, basicAuthHeaderValue));<NEW_LINE>}<NEW_LINE>if (isNotBlank(theBearerTokenOptionName)) {<NEW_LINE>String bearerToken = getAndParseBearerTokenAuthHeader(theCommandLine, theBearerTokenOptionName);<NEW_LINE>if (isNotBlank(bearerToken)) {<NEW_LINE>retVal.registerInterceptor(new SimpleRequestHeaderInterceptor(Constants.HEADER_AUTHORIZATION, Constants.HEADER_AUTHORIZATION_VALPREFIX_BEARER + bearerToken));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return retVal;<NEW_LINE>}
((int) DateUtils.MILLIS_PER_HOUR);
170,497
public static void main(String[] args) {<NEW_LINE>Scanner sc = new Scanner(System.in);<NEW_LINE>System.out.print("Enter number : ");<NEW_LINE>int num = sc.nextInt();<NEW_LINE>String str = String.valueOf(num);<NEW_LINE>len = str.length();<NEW_LINE>int[] arr = new int[300];<NEW_LINE>int[] str2 = new int[300];<NEW_LINE>int i = 0, temp = num;<NEW_LINE>for (i = 0; i < len; i++) {<NEW_LINE>str2[i] = temp % 10;<NEW_LINE>temp = temp / 10;<NEW_LINE>}<NEW_LINE>for (int j = 1; j < num; j++) {<NEW_LINE>str2 = Factorial(j, arr, str2);<NEW_LINE>}<NEW_LINE>System.out.print("Factorial of " + num + " = ");<NEW_LINE>for (i = len - 1; i >= 0; i--) {<NEW_LINE>System.out<MASK><NEW_LINE>}<NEW_LINE>}
.print(str2[i]);
228,679
public CreateChangeSetResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>CreateChangeSetResult createChangeSetResult = new CreateChangeSetResult();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 2;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return createChangeSetResult;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("Id", targetDepth)) {<NEW_LINE>createChangeSetResult.setId(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("StackId", targetDepth)) {<NEW_LINE>createChangeSetResult.setStackId(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return createChangeSetResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,803,368
final GetApplicationResult executeGetApplication(GetApplicationRequest getApplicationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getApplicationRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetApplicationRequest> request = null;<NEW_LINE>Response<GetApplicationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetApplicationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getApplicationRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "AppConfig");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetApplication");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetApplicationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetApplicationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();