idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
957,079
public DescribeUserStackAssociationsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeUserStackAssociationsResult describeUserStackAssociationsResult = new DescribeUserStackAssociationsResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return describeUserStackAssociationsResult;<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("UserStackAssociations", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeUserStackAssociationsResult.setUserStackAssociations(new ListUnmarshaller<UserStackAssociation>(UserStackAssociationJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeUserStackAssociationsResult.setNextToken(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 describeUserStackAssociationsResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,781,979
private static void populateStblPCM(NodeBox stbl, PacketChunk[] chunks, int trackId, CodecMeta se) throws IOException {<NEW_LINE>AudioCodecMeta ase = (AudioCodecMeta) se;<NEW_LINE>int frameSize = ase.getFrameSize();<NEW_LINE>LongArrayList stco = new LongArrayList(250 << 10);<NEW_LINE>List<SampleToChunkEntry> stsc <MASK><NEW_LINE>int stscCount = -1, stscFirstChunk = -1, totalFrames = 0;<NEW_LINE>for (int chunkNo = 0, stscCurChunk = 1; chunkNo < chunks.length; chunkNo++) {<NEW_LINE>PacketChunk chunk = chunks[chunkNo];<NEW_LINE>if (chunk.getTrackNo() == trackId) {<NEW_LINE>stco.add(chunk.getPos());<NEW_LINE>int framesPerChunk = chunk.getDataLen() / frameSize;<NEW_LINE>if (framesPerChunk != stscCount) {<NEW_LINE>if (stscCount != -1)<NEW_LINE>stsc.add(new SampleToChunkEntry(stscFirstChunk, stscCount, 1));<NEW_LINE>stscFirstChunk = stscCurChunk;<NEW_LINE>stscCount = framesPerChunk;<NEW_LINE>}<NEW_LINE>stscCurChunk++;<NEW_LINE>totalFrames += framesPerChunk;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (stscCount != -1)<NEW_LINE>stsc.add(new SampleToChunkEntry(stscFirstChunk, stscCount, 1));<NEW_LINE>stbl.add(ChunkOffsets64Box.createChunkOffsets64Box(stco.toArray()));<NEW_LINE>stbl.add(SampleToChunkBox.createSampleToChunkBox(stsc.toArray(new SampleToChunkEntry[0])));<NEW_LINE>stbl.add(SampleSizesBox.createSampleSizesBox(ase.getFrameSize(), totalFrames));<NEW_LINE>stbl.add(TimeToSampleBox.createTimeToSampleBox(new TimeToSampleEntry[] { new TimeToSampleEntry(totalFrames, 1) }));<NEW_LINE>}
= new ArrayList<SampleToChunkEntry>();
1,712,633
static String addUsernamePassword(final String url, final String userName, final String password) throws URISyntaxException, UnsupportedEncodingException {<NEW_LINE>final URI uri = URI.create(url.substring<MASK><NEW_LINE>final Map<String, String> params = new HashMap<>(// Hack around the fact Optional.Stream requires Java 9+.<NEW_LINE>Optional.ofNullable(uri.getQuery()).map(Stream::of).// Hack around the fact Optional.Stream requires Java 9+.<NEW_LINE>orElse(Stream.empty()).flatMap(par -> Arrays.stream(par.split("&"))).map(part -> part.split("=")).filter(part -> part.length > 1).collect(Collectors.toMap(part -> part[0], part -> part[1])));<NEW_LINE>// Use the old form for Java 8 compatibility.<NEW_LINE>params.put("user", URLEncoder.encode(userName, "UTF-8"));<NEW_LINE>params.put("password", URLEncoder.encode(password, "UTF-8"));<NEW_LINE>return JDBC_URL_PREFIX + new URI(uri.getScheme(), uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), params.entrySet().stream().map(i -> i.getKey() + "=" + i.getValue()).collect(Collectors.joining("&")), uri.getFragment());<NEW_LINE>}
(JDBC_URL_PREFIX.length()));
264,088
void init(boolean decrypting, String algorithm, byte[] key) throws InvalidKeyException {<NEW_LINE>int keyLength = key.length;<NEW_LINE>if (effectiveKeyBits == 0) {<NEW_LINE>effectiveKeyBits = keyLength << 3;<NEW_LINE>}<NEW_LINE>checkKey(algorithm, keyLength);<NEW_LINE>// key buffer, the L[] byte array from the spec<NEW_LINE>byte[] expandedKeyBytes = new byte[128];<NEW_LINE>// place key into key buffer<NEW_LINE>System.arraycopy(key, 0, expandedKeyBytes, 0, keyLength);<NEW_LINE>// first loop<NEW_LINE>int t = expandedKeyBytes[keyLength - 1];<NEW_LINE>for (int i = keyLength; i < 128; i++) {<NEW_LINE>t = PI_TABLE[(t + expandedKeyBytes[i - keyLength]) & 0xff];<NEW_LINE>expandedKeyBytes[i] = (byte) t;<NEW_LINE>}<NEW_LINE>int t8 = (effectiveKeyBits + 7) >> 3;<NEW_LINE>int tm = 0xff >> (-effectiveKeyBits & 7);<NEW_LINE>// second loop, reduce search space to effective key bits<NEW_LINE>t = PI_TABLE[expandedKeyBytes[128 - t8] & tm];<NEW_LINE>expandedKeyBytes[128 - t8] = (byte) t;<NEW_LINE>for (int i = 127 - t8; i >= 0; i--) {<NEW_LINE>t = PI_TABLE[t ^ (expandedKeyBytes[<MASK><NEW_LINE>expandedKeyBytes[i] = (byte) t;<NEW_LINE>}<NEW_LINE>// byte to short conversion, little endian (copy into K[])<NEW_LINE>for (int i = 0, j = 0; i < 64; i++, j += 2) {<NEW_LINE>t = (expandedKeyBytes[j] & 0xff) + ((expandedKeyBytes[j + 1] & 0xff) << 8);<NEW_LINE>expandedKey[i] = t;<NEW_LINE>}<NEW_LINE>}
i + t8] & 0xff)];
330,991
static RunnerApi.PTransform.Builder translateAppliedPTransform(AppliedPTransform<?, ?, ?> appliedPTransform, List<AppliedPTransform<?, ?, ?>> subtransforms, SdkComponents components) throws IOException {<NEW_LINE>RunnerApi.PTransform.Builder transformBuilder = RunnerApi.PTransform.newBuilder();<NEW_LINE>for (Map.Entry<TupleTag<?>, PCollection<?>> taggedInput : appliedPTransform.getInputs().entrySet()) {<NEW_LINE>transformBuilder.putInputs(toProto(taggedInput.getKey()), components.registerPCollection(taggedInput.getValue()));<NEW_LINE>}<NEW_LINE>for (Map.Entry<TupleTag<?>, PCollection<?>> taggedOutput : appliedPTransform.getOutputs().entrySet()) {<NEW_LINE>transformBuilder.putOutputs(toProto(taggedOutput.getKey()), components.registerPCollection<MASK><NEW_LINE>}<NEW_LINE>for (AppliedPTransform<?, ?, ?> subtransform : subtransforms) {<NEW_LINE>transformBuilder.addSubtransforms(components.getExistingPTransformId(subtransform));<NEW_LINE>}<NEW_LINE>transformBuilder.setUniqueName(appliedPTransform.getFullName());<NEW_LINE>transformBuilder.addAllDisplayData(DisplayDataTranslation.toProto(DisplayData.from(appliedPTransform.getTransform())));<NEW_LINE>return transformBuilder;<NEW_LINE>}
(taggedOutput.getValue()));
374,032
public static WaveletDescription<WlCoef_F32> daubJ_F32(int J) {<NEW_LINE>if (J != 4) {<NEW_LINE>throw new IllegalArgumentException("Only 4 is currently supported");<NEW_LINE>}<NEW_LINE>WlCoef_F32 coef = new WlCoef_F32();<NEW_LINE>coef.offsetScaling = 0;<NEW_LINE>coef.offsetWavelet = 0;<NEW_LINE>coef.scaling = new float[4];<NEW_LINE>coef.wavelet = new float[4];<NEW_LINE>double sqrt3 = Math.sqrt(3);<NEW_LINE>double div = 4.0 * Math.sqrt(2);<NEW_LINE>coef.scaling[0] = (float) ((1 + sqrt3) / div);<NEW_LINE>coef.scaling[1] = (float) ((3 + sqrt3) / div);<NEW_LINE>coef.scaling[2] = (float) ((3 - sqrt3) / div);<NEW_LINE>coef.scaling[3] = (float) ((1 - sqrt3) / div);<NEW_LINE>coef.wavelet[0] = coef.scaling[3];<NEW_LINE>coef.wavelet[1] = -coef.scaling[2];<NEW_LINE>coef.wavelet[2] = coef.scaling[1];<NEW_LINE>coef.wavelet[3] = -coef.scaling[0];<NEW_LINE>WlBorderCoefStandard<WlCoef_F32> inverse = new WlBorderCoefStandard<>(coef);<NEW_LINE>return new WaveletDescription<>(new <MASK><NEW_LINE>}
BorderIndex1D_Wrap(), coef, inverse);
40,626
private void readTypeParameters(NdBinding type, SignatureWrapper wrapper) throws CoreException {<NEW_LINE>char[] genericSignature = wrapper.signature;<NEW_LINE>if (genericSignature.length == 0 || wrapper.charAtStart() != '<') {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<TypeParameter> typeParameters = new ArrayList<>();<NEW_LINE>int indexOfClosingBracket = wrapper.skipAngleContents(wrapper.start) - 1;<NEW_LINE>wrapper.start++;<NEW_LINE>TypeParameter parameter = null;<NEW_LINE>while (wrapper.start < indexOfClosingBracket) {<NEW_LINE>int colonPos = CharOperation.indexOf(':', genericSignature, wrapper.start, indexOfClosingBracket);<NEW_LINE>if (colonPos > wrapper.start) {<NEW_LINE>char[] identifier = CharOperation.subarray(genericSignature, wrapper.start, colonPos);<NEW_LINE>parameter = new TypeParameter();<NEW_LINE>typeParameters.add(parameter);<NEW_LINE>parameter.identifier = identifier;<NEW_LINE>wrapper.start = colonPos + 1;<NEW_LINE>// The first bound is a class as long as it doesn't start with a double-colon<NEW_LINE>parameter.firstBoundIsClass = (wrapper.charAtStart() != ':');<NEW_LINE>}<NEW_LINE>skipChar(wrapper, ':');<NEW_LINE>NdTypeSignature <MASK><NEW_LINE>parameter.bounds.add(boundSignature);<NEW_LINE>}<NEW_LINE>type.allocateTypeParameters(typeParameters.size());<NEW_LINE>for (TypeParameter param : typeParameters) {<NEW_LINE>NdTypeParameter ndParam = type.createTypeParameter();<NEW_LINE>ndParam.setIdentifier(param.identifier);<NEW_LINE>ndParam.setFirstBoundIsClass(param.firstBoundIsClass);<NEW_LINE>ndParam.allocateBounds(param.bounds.size());<NEW_LINE>for (NdTypeSignature bound : param.bounds) {<NEW_LINE>ndParam.createBound(bound);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>skipChar(wrapper, '>');<NEW_LINE>}
boundSignature = createTypeSignature(wrapper, JAVA_LANG_OBJECT_FIELD_DESCRIPTOR);
1,213,235
public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>Permanent sourcePermanent = game.getPermanent(source.getSourceId());<NEW_LINE>if (controller != null) {<NEW_LINE>if (!controller.flipCoin(source, game, true)) {<NEW_LINE>if (sourcePermanent != null) {<NEW_LINE><MASK><NEW_LINE>if (target.canChoose(controller.getId(), source, game)) {<NEW_LINE>while (!target.isChosen() && target.canChoose(controller.getId(), source, game) && controller.canRespond()) {<NEW_LINE>controller.chooseTarget(outcome, target, source, game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Player chosenOpponent = game.getPlayer(target.getFirstTarget());<NEW_LINE>if (chosenOpponent != null) {<NEW_LINE>ContinuousEffect effect = new GoblinFestivalGainControlEffect(Duration.Custom, chosenOpponent.getId());<NEW_LINE>effect.setTargetPointer(new FixedTarget(sourcePermanent.getId(), game));<NEW_LINE>game.addEffect(effect, source);<NEW_LINE>game.informPlayers(chosenOpponent.getLogName() + " has gained control of " + sourcePermanent.getLogName());<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
Target target = new TargetOpponent(true);
1,013,294
// </editor-fold>//GEN-END:initComponents<NEW_LINE>private void libraryManagerComboBoxActionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>// GEN-FIRST:event_libraryManagerComboBoxActionPerformed<NEW_LINE>int index = libraryManagerComboBox.getSelectedIndex();<NEW_LINE>if (index == -1) {<NEW_LINE>// do nothing<NEW_LINE>} else if (index == 0) {<NEW_LINE><MASK><NEW_LINE>} else if (index > 0) {<NEW_LINE>URL u = null;<NEW_LINE>try {<NEW_LINE>// #131452 prevent space in path problem when converting to URL.<NEW_LINE>File loc = FileUtil.normalizeFile(new File((String) libraryManagerComboBox.getModel().getSelectedItem()));<NEW_LINE>u = Utilities.toURI(loc).toURL();<NEW_LINE>} catch (MalformedURLException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>librariesCustomizer.setLibraryStorageArea(findLibraryStorageArea(u));<NEW_LINE>}<NEW_LINE>}
librariesCustomizer.setLibraryStorageArea(LibraryStorageArea.GLOBAL);
1,763,573
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>private void initComponents() {<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>introLabel = new javax.swing.JLabel();<NEW_LINE>explanation = new javax.swing.JTextArea();<NEW_LINE>selectLabel = new javax.swing.JLabel();<NEW_LINE>selectCombo = new javax.swing.JComboBox();<NEW_LINE>setLayout(new java.awt.GridBagLayout());<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(introLabel, org.openide.util.NbBundle.getMessage(UnboundTargetAlert.class, "UTA_LBL_intro", label));<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridwidth = 2;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(0, 0, 12, 0);<NEW_LINE>add(introLabel, gridBagConstraints);<NEW_LINE>explanation.setBackground(javax.swing.UIManager.getDefaults().getColor("Label.background"));<NEW_LINE>explanation.setEditable(false);<NEW_LINE>explanation.setLineWrap(true);<NEW_LINE>// NOI18N<NEW_LINE>explanation.setText(org.openide.util.NbBundle.getMessage(UnboundTargetAlert.class, "UTA_TEXT_explanation", label));<NEW_LINE>explanation.setWrapStyleWord(true);<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = 1;<NEW_LINE>gridBagConstraints.gridwidth = 2;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(0, 0, 12, 0);<NEW_LINE>add(explanation, gridBagConstraints);<NEW_LINE>// NOI18N<NEW_LINE>explanation.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(UnboundTargetAlert<MASK><NEW_LINE>// NOI18N<NEW_LINE>explanation.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(UnboundTargetAlert.class, "ASCD_UTA_TEXT_explanation", label));<NEW_LINE>selectLabel.setLabelFor(selectCombo);<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(selectLabel, org.openide.util.NbBundle.getMessage(UnboundTargetAlert.class, "UTA_LBL_select", label));<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = 2;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 6);<NEW_LINE>add(selectLabel, gridBagConstraints);<NEW_LINE>selectCombo.setEditable(true);<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 1;<NEW_LINE>gridBagConstraints.gridy = 2;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;<NEW_LINE>add(selectCombo, gridBagConstraints);<NEW_LINE>}
.class, "ASCN_UTA_TEXT_explanation", label));
193,178
private void unload(List<Bundle> bundles) {<NEW_LINE>if (bundles.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LOG.log(<MASK><NEW_LINE>ClassLoader l = Lookup.getDefault().lookup(ClassLoader.class);<NEW_LINE>final Lookup stop = Lookups.metaInfServices(l, "META-INF/namedservices/Modules/Stop/");<NEW_LINE>for (Callable<?> r : stop.lookupAll(Callable.class)) {<NEW_LINE>if (bundles.contains(FrameworkUtil.getBundle(r.getClass()))) {<NEW_LINE>try {<NEW_LINE>if (!((Boolean) r.call())) {<NEW_LINE>LOG.log(Level.WARNING, "ignoring false return value from {0}", r.getClass().getName());<NEW_LINE>}<NEW_LINE>} catch (Exception x) {<NEW_LINE>LOG.log(Level.WARNING, null, x);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Runnable r : stop.lookupAll(Runnable.class)) {<NEW_LINE>if (bundles.contains(FrameworkUtil.getBundle(r.getClass()))) {<NEW_LINE>r.run();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Bundle bundle : bundles) {<NEW_LINE>ModuleInstall mi = installers.remove(bundle);<NEW_LINE>if (mi != null) {<NEW_LINE>LOG.log(Level.FINE, "uninstalled: {0}", bundle.getSymbolicName());<NEW_LINE>mi.uninstalled();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>OSGiRepository.DEFAULT.removeLayersFor(bundles);<NEW_LINE>OSGiMainLookup.bundlesRemoved(bundles);<NEW_LINE>}
Level.FINE, "unloading: {0}", bundles);
1,567,460
private static void tryAssertionScoringUseCase(RegressionEnvironment env, EventRepresentationChoice eventRepresentationEnum, AtomicInteger milestone) {<NEW_LINE>String[] fields = "userId,keyword,sumScore".split(",");<NEW_LINE>String epl = eventRepresentationEnum.getAnnotationTextWJsonProvided(MyLocalJsonProvidedScoreCycle.class) + "@buseventtype @public create schema ScoreCycle (userId string, keyword string, productId string, score long);\n" + eventRepresentationEnum.getAnnotationTextWJsonProvided(MyLocalJsonProvidedUserKeywordTotalStream.class) + "@buseventtype @public create schema UserKeywordTotalStream (userId string, keyword string, sumScore long);\n" + "\n" + eventRepresentationEnum.getAnnotationTextWJsonProvided(MyLocalJsonProvided.class) + " create context HashByUserCtx as " + "coalesce by consistent_hash_crc32(userId) from ScoreCycle, " + "consistent_hash_crc32(userId) from UserKeywordTotalStream " + "granularity 1000000;\n" + "\n" + "context HashByUserCtx create window ScoreCycleWindow#unique(productId, keyword) as ScoreCycle;\n" + "\n" + "context HashByUserCtx insert into ScoreCycleWindow select * from ScoreCycle;\n" + "\n" + "@Name('s0') context HashByUserCtx insert into UserKeywordTotalStream \n" + "select userId, keyword, sum(score) as sumScore from ScoreCycleWindow group by keyword;\n" + "\n" + "@Name('outTwo') context HashByUserCtx on UserKeywordTotalStream(sumScore > 10000) delete from ScoreCycleWindow;\n";<NEW_LINE>env.compileDeploy(epl, new RegressionPath());<NEW_LINE>env.addListener("s0");<NEW_LINE>makeSendScoreEvent(env, "ScoreCycle", eventRepresentationEnum, "Pete", "K1", "P1", 100);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "Pete", "K1", 100L });<NEW_LINE>makeSendScoreEvent(env, "ScoreCycle", eventRepresentationEnum, "Pete", "K1", "P2", 15);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] <MASK><NEW_LINE>makeSendScoreEvent(env, "ScoreCycle", eventRepresentationEnum, "Joe", "K1", "P2", 30);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "Joe", "K1", 30L });<NEW_LINE>makeSendScoreEvent(env, "ScoreCycle", eventRepresentationEnum, "Joe", "K2", "P1", 40);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "Joe", "K2", 40L });<NEW_LINE>makeSendScoreEvent(env, "ScoreCycle", eventRepresentationEnum, "Joe", "K1", "P1", 20);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "Joe", "K1", 50L });<NEW_LINE>env.undeployAll();<NEW_LINE>}
{ "Pete", "K1", 115L });
1,131,643
public static JobClusterManagerProto.ListJobsRequest createListJobsRequest(final Map<String, List<String>> params, final Optional<String> regex, final boolean activeOnlyDefault) {<NEW_LINE>if (params == null) {<NEW_LINE>if (regex.isPresent()) {<NEW_LINE>return new JobClusterManagerProto.ListJobsRequest(regex.get());<NEW_LINE>} else {<NEW_LINE>return new JobClusterManagerProto.ListJobsRequest();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Optional<Integer> limit = paramValueAsInt(params, QUERY_PARAM_LIMIT);<NEW_LINE>final Optional<JobState.MetaState> jobState = paramValue(params, QUERY_PARAM_JOB_STATE).map(p -> JobState.MetaState.valueOf(p));<NEW_LINE>final List<Integer> stageNumber = paramValuesAsInt(params, QUERY_PARAM_STAGE_NUM);<NEW_LINE>final List<Integer> workerIndex = paramValuesAsInt(params, QUERY_PARAM_WORKER_INDEX);<NEW_LINE>final List<Integer> workerNumber = paramValuesAsInt(params, QUERY_PARAM_WORKER_NUM);<NEW_LINE>final List<WorkerState.MetaState> workerState = paramValuesAsMetaState(params, QUERY_PARAM_WORKER_STATE);<NEW_LINE>final Optional<Boolean> activeOnly = Optional.of(paramValueAsBool(params, QUERY_PARAM_ACTIVE_ONLY).orElse(activeOnlyDefault));<NEW_LINE>final Optional<String> <MASK><NEW_LINE>final Optional<String> labelsOperand = paramValue(params, QUERY_PARAM_LABELS_OPERAND);<NEW_LINE>return new JobClusterManagerProto.ListJobsRequest(new JobClusterManagerProto.ListJobCriteria(limit, jobState, stageNumber, workerIndex, workerNumber, workerState, activeOnly, regex, labelsQuery, labelsOperand));<NEW_LINE>}
labelsQuery = paramValue(params, QUERY_PARAM_LABELS_QUERY);
637,183
private void handleEditReportal(final HttpServletRequest req, final HttpServletResponse resp, final Session session) throws ServletException, IOException {<NEW_LINE>final int id = getIntParam(req, "id");<NEW_LINE>final ProjectManager projectManager = this.server.getProjectManager();<NEW_LINE>final Page page = newPage(req, resp, session, "azkaban/viewer/reportal/reportaleditpage.vm");<NEW_LINE>preparePage(page, session);<NEW_LINE>page.add("ReportalHelper", ReportalHelper.class);<NEW_LINE>final Project project = projectManager.getProject(id);<NEW_LINE>final Reportal reportal = Reportal.loadFromProject(project);<NEW_LINE>final List<String> <MASK><NEW_LINE>if (reportal == null) {<NEW_LINE>errors.add("Report not found");<NEW_LINE>page.add("errorMsgs", errors);<NEW_LINE>page.render();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!hasPermission(project, session.getUser(), Type.ADMIN)) {<NEW_LINE>errors.add("You are not allowed to edit this report.");<NEW_LINE>page.add("errorMsgs", errors);<NEW_LINE>page.render();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>page.add("projectId", id);<NEW_LINE>page.add("title", reportal.title);<NEW_LINE>page.add("description", reportal.description);<NEW_LINE>page.add("queryNumber", reportal.queries.size());<NEW_LINE>page.add("queries", reportal.queries);<NEW_LINE>page.add("variableNumber", reportal.variables.size());<NEW_LINE>page.add("variables", reportal.variables);<NEW_LINE>page.add("schedule", reportal.schedule);<NEW_LINE>page.add("scheduleHour", reportal.scheduleHour);<NEW_LINE>page.add("scheduleMinute", reportal.scheduleMinute);<NEW_LINE>page.add("scheduleAmPm", reportal.scheduleAmPm);<NEW_LINE>page.add("scheduleTimeZone", reportal.scheduleTimeZone);<NEW_LINE>page.add("scheduleDate", reportal.scheduleDate);<NEW_LINE>page.add("endScheduleDate", reportal.endSchedule);<NEW_LINE>page.add("scheduleRepeat", reportal.scheduleRepeat);<NEW_LINE>page.add("scheduleIntervalQuantity", reportal.scheduleIntervalQuantity);<NEW_LINE>page.add("scheduleInterval", reportal.scheduleInterval);<NEW_LINE>page.add("renderResultsAsHtml", reportal.renderResultsAsHtml);<NEW_LINE>page.add("notifications", reportal.notifications);<NEW_LINE>page.add("failureNotifications", reportal.failureNotifications);<NEW_LINE>page.add("accessViewer", reportal.accessViewer);<NEW_LINE>page.add("accessExecutor", reportal.accessExecutor);<NEW_LINE>page.add("accessOwner", reportal.accessOwner);<NEW_LINE>page.add("max_allowed_schedule_dates", this.max_allowed_schedule_dates);<NEW_LINE>page.add("default_schedule_dates", this.default_schedule_dates);<NEW_LINE>page.render();<NEW_LINE>}
errors = new ArrayList<>();
1,043,501
public Hcl visitForObjectExpr(HCLParser.ForObjectExprContext ctx) {<NEW_LINE>return convert(ctx, (c, prefix) -> {<NEW_LINE>sourceBefore("{");<NEW_LINE>return new Hcl.ForObject(randomId(), Space.format(prefix), Markers.EMPTY, (Hcl.ForIntro) visit(ctx.forIntro()), new HclLeftPadded<>(sourceBefore(":"), (Expression) visit(ctx.expression().get(0)), Markers.EMPTY), new HclLeftPadded<>(sourceBefore("=>"), (Expression) visit(ctx.expression().get(1)), Markers.EMPTY), ctx.ELLIPSIS() == null ? null : new Hcl.Empty(randomId(), sourceBefore("..."), Markers.EMPTY), ctx.forCond() == null ? null : new HclLeftPadded<>(sourceBefore("if"), (Expression) visit(ctx.forCond().expression()), Markers.<MASK><NEW_LINE>});<NEW_LINE>}
EMPTY), sourceBefore("}"));
1,816,026
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {<NEW_LINE>City modifiedCity = adapter.getItem(position);<NEW_LINE>// Acquire the name of the clicked City, in order to be able to query for it.<NEW_LINE>final String name = modifiedCity.getName();<NEW_LINE>// Create an asynchronous transaction to increment the vote count for the selected City in the Realm.<NEW_LINE>// The write will happen on a background thread, and the RealmChangeListener will update the GridView automatically.<NEW_LINE>realm.executeTransactionAsync(bgRealm -> {<NEW_LINE>// We need to find the City we want to modify from the background thread's Realm<NEW_LINE>City city = bgRealm.where(City.class).equalTo(<MASK><NEW_LINE>if (city != null) {<NEW_LINE>// Let's increase the votes of the selected city!<NEW_LINE>city.setVotes(city.getVotes() + 1);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
"name", name).findFirst();
528,827
// Based on the explanation at https://algs4.cs.princeton.edu/61event/<NEW_LINE>public double timeToHit(Particle3D otherParticle) {<NEW_LINE>if (this == otherParticle) {<NEW_LINE>return Double.POSITIVE_INFINITY;<NEW_LINE>}<NEW_LINE>double deltaPositionX = otherParticle.positionX - positionX;<NEW_LINE>double deltaPositionY = otherParticle.positionY - positionY;<NEW_LINE>double deltaPositionZ = otherParticle.positionZ - positionZ;<NEW_LINE><MASK><NEW_LINE>double deltaVelocityY = otherParticle.velocityY - velocityY;<NEW_LINE>double deltaVelocityZ = otherParticle.velocityZ - velocityZ;<NEW_LINE>double deltaPositionByDeltaVelocity = deltaPositionX * deltaVelocityX + deltaPositionY * deltaVelocityY + deltaPositionZ * deltaVelocityZ;<NEW_LINE>if (deltaPositionByDeltaVelocity > 0) {<NEW_LINE>return Double.POSITIVE_INFINITY;<NEW_LINE>}<NEW_LINE>double deltaVelocitySquared = deltaVelocityX * deltaVelocityX + deltaVelocityY * deltaVelocityY + deltaVelocityZ * deltaVelocityZ;<NEW_LINE>double deltaPositionSquared = deltaPositionX * deltaPositionX + deltaPositionY * deltaPositionY + deltaPositionZ * deltaPositionZ;<NEW_LINE>double distanceBetweenCenters = radius + otherParticle.radius;<NEW_LINE>double distanceBetweenCentersSquared = distanceBetweenCenters * distanceBetweenCenters;<NEW_LINE>// Check if particles overlap<NEW_LINE>if (deltaPositionSquared < distanceBetweenCentersSquared) {<NEW_LINE>throw new IllegalStateException("Invalid state: overlapping particles. No two objects can occupy the same space " + "at the same time.");<NEW_LINE>}<NEW_LINE>double distance = (deltaPositionByDeltaVelocity * deltaPositionByDeltaVelocity) - deltaVelocitySquared * (deltaPositionSquared - distanceBetweenCentersSquared);<NEW_LINE>if (distance < 0) {<NEW_LINE>return Double.POSITIVE_INFINITY;<NEW_LINE>}<NEW_LINE>return -(deltaPositionByDeltaVelocity + Math.sqrt(distance)) / deltaVelocitySquared;<NEW_LINE>}
double deltaVelocityX = otherParticle.velocityX - velocityX;
1,310,821
private FieldsAndIncludes parseIncludes(RecordDataSchema recordDataSchema, PdlParser.FieldIncludesContext includeSet) throws ParseException {<NEW_LINE>List<NamedDataSchema> <MASK><NEW_LINE>Set<NamedDataSchema> includesDeclaredInline = new HashSet<>();<NEW_LINE>List<Field> fields = new ArrayList<>();<NEW_LINE>if (includeSet != null) {<NEW_LINE>getResolver().updatePendingSchema(recordDataSchema.getFullName(), true);<NEW_LINE>List<TypeAssignmentContext> includeTypes = includeSet.typeAssignment();<NEW_LINE>for (TypeAssignmentContext includeRef : includeTypes) {<NEW_LINE>DataSchema includedSchema = toDataSchema(includeRef);<NEW_LINE>if (includedSchema != null) {<NEW_LINE>DataSchema dereferencedIncludedSchema = includedSchema.getDereferencedDataSchema();<NEW_LINE>if (includedSchema instanceof NamedDataSchema && dereferencedIncludedSchema instanceof RecordDataSchema) {<NEW_LINE>NamedDataSchema includedNamedSchema = (NamedDataSchema) includedSchema;<NEW_LINE>RecordDataSchema dereferencedIncludedRecordSchema = (RecordDataSchema) dereferencedIncludedSchema;<NEW_LINE>fields.addAll(dereferencedIncludedRecordSchema.getFields());<NEW_LINE>includes.add(includedNamedSchema);<NEW_LINE>if (isDeclaredInline(includeRef)) {<NEW_LINE>includesDeclaredInline.add(includedNamedSchema);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>startErrorMessage(includeRef).append("Include is not a record type or a typeref to a record type: ").append(includeRef).append(NEWLINE);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>startErrorMessage(includeRef).append("Unable to resolve included schema: ").append(includeRef).append(NEWLINE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>getResolver().updatePendingSchema(recordDataSchema.getFullName(), false);<NEW_LINE>}<NEW_LINE>return new FieldsAndIncludes(fields, includes, includesDeclaredInline);<NEW_LINE>}
includes = new ArrayList<>();
1,262,324
final CreateNodeFromTemplateJobResult executeCreateNodeFromTemplateJob(CreateNodeFromTemplateJobRequest createNodeFromTemplateJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createNodeFromTemplateJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateNodeFromTemplateJobRequest> request = null;<NEW_LINE>Response<CreateNodeFromTemplateJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateNodeFromTemplateJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createNodeFromTemplateJobRequest));<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, "Panorama");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateNodeFromTemplateJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateNodeFromTemplateJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateNodeFromTemplateJobResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,566,749
// / Update the last word of a given named entity<NEW_LINE>private NamedEntity updateLastWord(NamedEntity namedEntity, String lastWord) {<NEW_LINE>boolean boolLastWord = false;<NEW_LINE>List<NerToken> tokens = new ArrayList<>(wordList.length);<NEW_LINE>for (int i = 0; i < wordList.length; i++) {<NEW_LINE>String s = wordList[i];<NEW_LINE>NePosition position;<NEW_LINE>if (wordList.length == 1) {<NEW_LINE>position = NePosition.UNIT;<NEW_LINE>boolLastWord = true;<NEW_LINE>} else if (i == 0) {<NEW_LINE>position = NePosition.BEGIN;<NEW_LINE>} else if (i == wordList.length - 1) {<NEW_LINE>position = NePosition.LAST;<NEW_LINE>boolLastWord = true;<NEW_LINE>} else {<NEW_LINE>position = NePosition.INSIDE;<NEW_LINE>}<NEW_LINE>if (boolLastWord) {<NEW_LINE>tokens.add(new NerToken(i, lastWord, type, position));<NEW_LINE>} else {<NEW_LINE>tokens.add(new NerToken(i, s, type, position));<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}
return new NamedEntity(type, tokens);
988,245
public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = new String[] { "symbol", "price", "sumVol" };<NEW_LINE>String stmtText = "@name('s0') select symbol, price, sum(volume) as sumVol " + "from SupportMarketDataBean#length(5) " + "group by symbol " + "order by symbol";<NEW_LINE>env.compileDeploy(stmtText).addListener("s0");<NEW_LINE>env.assertIterator("s0", it -> assertFalse(it.hasNext()));<NEW_LINE>sendEvent(env, "SYM", -1, 100);<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { "SYM", -1d, 100L } });<NEW_LINE>env.milestone(0);<NEW_LINE>sendEvent(env, "TAC", -2, 12);<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { "SYM", -1d, 100L }, { "TAC", -2d, 12L } });<NEW_LINE>sendEvent(env, "TAC", -3, 13);<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { "SYM", -1d, 100L }, { "TAC", -2d, 25L }, { "TAC", -3d, 25L } });<NEW_LINE>env.milestone(1);<NEW_LINE>sendEvent(env, "SYM", -4, 1);<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { "SYM", -1d, 101L }, { "SYM", -4d, 101L }, { "TAC", -2d, 25L }, { "TAC", -3d, 25L } });<NEW_LINE>env.milestone(2);<NEW_LINE>sendEvent(env<MASK><NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { "OCC", -5d, 99L }, { "SYM", -1d, 101L }, { "SYM", -4d, 101L }, { "TAC", -2d, 25L }, { "TAC", -3d, 25L } });<NEW_LINE>sendEvent(env, "TAC", -6, 2);<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { "OCC", -5d, 99L }, { "SYM", -4d, 1L }, { "TAC", -2d, 27L }, { "TAC", -3d, 27L }, { "TAC", -6d, 27L } });<NEW_LINE>env.undeployAll();<NEW_LINE>}
, "OCC", -5, 99);
587,766
public static ExchangeMetaData adaptMetaData(BitfinexAccountInfosResponse[] bitfinexAccountInfos, ExchangeMetaData exchangeMetaData) {<NEW_LINE>final Map<CurrencyPair, CurrencyPairMetaData> currencyPairs = exchangeMetaData.getCurrencyPairs();<NEW_LINE>// lets go with the assumption that the trading fees are common across all trading pairs for<NEW_LINE>// now.<NEW_LINE>// also setting the taker_fee as the trading_fee for now.<NEW_LINE>final CurrencyPairMetaData metaData = new CurrencyPairMetaData(bitfinexAccountInfos[0].getTakerFees().movePointLeft(2), null, null, null, null);<NEW_LINE>currencyPairs.keySet().parallelStream().forEach(currencyPair -> currencyPairs.merge(currencyPair, metaData, (oldMetaData, newMetaData) -> new CurrencyPairMetaData(newMetaData.getTradingFee(), oldMetaData.getMinimumAmount(), oldMetaData.getMaximumAmount(), oldMetaData.getPriceScale(), <MASK><NEW_LINE>return exchangeMetaData;<NEW_LINE>}
oldMetaData.getFeeTiers())));
871,484
public Integer[] calculateRange(String beginValue, String endValue) {<NEW_LINE>SimpleDateFormat format = new SimpleDateFormat(this.dateFormat);<NEW_LINE>try {<NEW_LINE>Date begin = format.parse(beginValue);<NEW_LINE>Date end = format.parse(endValue);<NEW_LINE>Calendar cal = Calendar.getInstance();<NEW_LINE>List<Integer> list = new ArrayList<>();<NEW_LINE>while (begin.getTime() <= end.getTime()) {<NEW_LINE>Integer nodeValue = this.calculate(format.format(begin));<NEW_LINE>if (Collections.frequency(list, nodeValue) < 1)<NEW_LINE>list.add(nodeValue);<NEW_LINE>cal.setTime(begin);<NEW_LINE>cal.add(Calendar.DATE, 1);<NEW_LINE>begin = cal.getTime();<NEW_LINE>}<NEW_LINE>Integer[] nodeArray = new <MASK><NEW_LINE>for (int i = 0; i < list.size(); i++) {<NEW_LINE>nodeArray[i] = list.get(i);<NEW_LINE>}<NEW_LINE>return nodeArray;<NEW_LINE>} catch (ParseException e) {<NEW_LINE>LOGGER.info("error", e);<NEW_LINE>return new Integer[0];<NEW_LINE>}<NEW_LINE>}
Integer[list.size()];
427,632
public RFuture<V> putIfExistsAsync(K key, V value) {<NEW_LINE>if (storeMode == LocalCachedMapOptions.StoreMode.LOCALCACHE) {<NEW_LINE>ByteBuf mapKey = encodeMapKey(key);<NEW_LINE>CacheKey cacheKey = localCacheView.toCacheKey(mapKey);<NEW_LINE>CacheValue prevValue = <MASK><NEW_LINE>if (prevValue != null) {<NEW_LINE>broadcastLocalCacheStore((V) value, mapKey, cacheKey);<NEW_LINE>return new CompletableFutureWrapper<>((V) prevValue.getValue());<NEW_LINE>} else {<NEW_LINE>mapKey.release();<NEW_LINE>return new CompletableFutureWrapper((Void) null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>RFuture<V> future = super.putIfExistsAsync(key, value);<NEW_LINE>CompletionStage<V> f = future.thenApply(res -> {<NEW_LINE>if (res != null) {<NEW_LINE>CacheKey cacheKey = localCacheView.toCacheKey(key);<NEW_LINE>cachePut(cacheKey, key, value);<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>});<NEW_LINE>return new CompletableFutureWrapper<>(f);<NEW_LINE>}
cachePutIfExists(cacheKey, key, value);
26,827
public void stateChanged(ChangeEvent evt) {<NEW_LINE>super.stateChanged(evt);<NEW_LINE>Document doc;<NEW_LINE>JTextComponent c = component();<NEW_LINE>if (RectangularSelectionUtils.isRectangularSelection(c) && (doc = c.getDocument()) != null) {<NEW_LINE>if (rectangularSelectionBag == null) {<NEW_LINE>// Btw the document is not used by PositionsBag at all<NEW_LINE>rectangularSelectionBag = new PositionsBag(doc);<NEW_LINE>rectangularSelectionBag.addHighlightsChangeListener(this);<NEW_LINE>}<NEW_LINE>List<Position> regions = RectangularSelectionUtils.regionsCopy(c);<NEW_LINE>if (regions != null) {<NEW_LINE>AttributeSet attrs = getAttribs();<NEW_LINE>rectangularSelectionBag.clear();<NEW_LINE>int size = regions.size();<NEW_LINE>for (int i = 0; i < size; ) {<NEW_LINE>Position startPos = regions.get(i++);<NEW_LINE>Position endPos <MASK><NEW_LINE>rectangularSelectionBag.addHighlight(startPos, endPos, attrs);<NEW_LINE>}<NEW_LINE>// Fire change at once<NEW_LINE>if (hlChangeStartOffset != -1) {<NEW_LINE>// fireHighlightsChange(hlChangeStartOffset, hlChangeEndOffset);<NEW_LINE>hlChangeStartOffset = -1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
= regions.get(i++);
446,610
public Request<DescribeStackResourceDriftsRequest> marshall(DescribeStackResourceDriftsRequest describeStackResourceDriftsRequest) {<NEW_LINE>if (describeStackResourceDriftsRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<DescribeStackResourceDriftsRequest> request = new DefaultRequest<DescribeStackResourceDriftsRequest>(describeStackResourceDriftsRequest, "AmazonCloudFormation");<NEW_LINE>request.addParameter("Action", "DescribeStackResourceDrifts");<NEW_LINE><MASK><NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (describeStackResourceDriftsRequest.getStackName() != null) {<NEW_LINE>request.addParameter("StackName", StringUtils.fromString(describeStackResourceDriftsRequest.getStackName()));<NEW_LINE>}<NEW_LINE>if (describeStackResourceDriftsRequest.getStackResourceDriftStatusFilters().isEmpty() && !((com.amazonaws.internal.SdkInternalList<String>) describeStackResourceDriftsRequest.getStackResourceDriftStatusFilters()).isAutoConstruct()) {<NEW_LINE>request.addParameter("StackResourceDriftStatusFilters", "");<NEW_LINE>}<NEW_LINE>if (!describeStackResourceDriftsRequest.getStackResourceDriftStatusFilters().isEmpty() || !((com.amazonaws.internal.SdkInternalList<String>) describeStackResourceDriftsRequest.getStackResourceDriftStatusFilters()).isAutoConstruct()) {<NEW_LINE>com.amazonaws.internal.SdkInternalList<String> stackResourceDriftStatusFiltersList = (com.amazonaws.internal.SdkInternalList<String>) describeStackResourceDriftsRequest.getStackResourceDriftStatusFilters();<NEW_LINE>int stackResourceDriftStatusFiltersListIndex = 1;<NEW_LINE>for (String stackResourceDriftStatusFiltersListValue : stackResourceDriftStatusFiltersList) {<NEW_LINE>if (stackResourceDriftStatusFiltersListValue != null) {<NEW_LINE>request.addParameter("StackResourceDriftStatusFilters.member." + stackResourceDriftStatusFiltersListIndex, StringUtils.fromString(stackResourceDriftStatusFiltersListValue));<NEW_LINE>}<NEW_LINE>stackResourceDriftStatusFiltersListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (describeStackResourceDriftsRequest.getNextToken() != null) {<NEW_LINE>request.addParameter("NextToken", StringUtils.fromString(describeStackResourceDriftsRequest.getNextToken()));<NEW_LINE>}<NEW_LINE>if (describeStackResourceDriftsRequest.getMaxResults() != null) {<NEW_LINE>request.addParameter("MaxResults", StringUtils.fromInteger(describeStackResourceDriftsRequest.getMaxResults()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.addParameter("Version", "2010-05-15");
1,826,526
public void deleteFileIfExistsCodeSnippets() {<NEW_LINE>ShareAsyncClient shareAsyncClient = createAsyncClientWithSASToken();<NEW_LINE>// BEGIN: com.azure.storage.file.share.ShareAsyncClient.deleteFileIfExists#string<NEW_LINE>shareAsyncClient.deleteFileIfExists("myfile").subscribe(deleted -> {<NEW_LINE>if (deleted) {<NEW_LINE>System.out.println("Successfully deleted.");<NEW_LINE>} else {<NEW_LINE>System.out.println("Does not exist.");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// END: com.azure.storage.file.share.ShareAsyncClient.deleteFileIfExists#string<NEW_LINE>// BEGIN: com.azure.storage.file.share.ShareAsyncClient.deleteFileIfExistsWithResponse#string<NEW_LINE>shareAsyncClient.deleteFileIfExistsWithResponse("myfile").subscribe(response -> {<NEW_LINE>if (response.getStatusCode() == 404) {<NEW_LINE>System.out.println("Does not exist.");<NEW_LINE>} else {<NEW_LINE>System.out.println("successfully deleted.");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// END: com.azure.storage.file.share.ShareAsyncClient.deleteFileIfExistsWithResponse#string<NEW_LINE>// BEGIN: com.azure.storage.file.share.ShareAsyncClient.deleteFileIfExistsWithResponse#string-ShareDeleteOptions<NEW_LINE>ShareRequestConditions requestConditions = new <MASK><NEW_LINE>ShareDeleteOptions options = new ShareDeleteOptions().setRequestConditions(requestConditions);<NEW_LINE>shareAsyncClient.deleteFileIfExistsWithResponse("myfile", options).subscribe(response -> {<NEW_LINE>if (response.getStatusCode() == 404) {<NEW_LINE>System.out.println("Does not exist.");<NEW_LINE>} else {<NEW_LINE>System.out.println("successfully deleted.");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// END: com.azure.storage.file.share.ShareAsyncClient.deleteFileIfExistsWithResponse#string-ShareDeleteOptions<NEW_LINE>}
ShareRequestConditions().setLeaseId(leaseId);
1,342,677
public void processFile() {<NEW_LINE>long counter = 0;<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>final AbstractLocusInfo<T> info = iterator.next();<NEW_LINE>final ReferenceSequence ref = refWalker.get(info.getSequenceIndex());<NEW_LINE>boolean referenceBaseN = collector.isReferenceBaseN(info.getPosition(), ref);<NEW_LINE>collector.addInfo(info, ref, referenceBaseN);<NEW_LINE>if (referenceBaseN) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>progress.record(info.getSequenceName(), info.getPosition());<NEW_LINE>if (collector.isTimeToStop(++counter)) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>collector.setCounter(counter);<NEW_LINE>}<NEW_LINE>// check that we added the same number of bases to the raw coverage histogram and the base quality histograms<NEW_LINE>final long sumBaseQ = Arrays.stream(<MASK><NEW_LINE>final long sumDepthHisto = LongStream.rangeClosed(0, collector.coverageCap).map(i -> (i * collector.unfilteredDepthHistogramArray[(int) i])).sum();<NEW_LINE>if (sumBaseQ != sumDepthHisto) {<NEW_LINE>log.error("Coverage and baseQ distributions contain different amount of bases!");<NEW_LINE>}<NEW_LINE>}
collector.unfilteredBaseQHistogramArray).sum();
894,139
ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, String path0, String path1) throws Exception {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wo wo = new Wo();<NEW_LINE>String executorSeed = null;<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Work work = emc.fetch(id, Work.class, ListTools.toList(Work.job_FIELDNAME));<NEW_LINE>if (null == work) {<NEW_LINE>throw new ExceptionEntityNotExist(id, Work.class);<NEW_LINE>}<NEW_LINE>executorSeed = work.getJob();<NEW_LINE>}<NEW_LINE>Callable<String> callable = new Callable<String>() {<NEW_LINE><NEW_LINE>public String call() throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>Work work = emc.find(id, Work.class);<NEW_LINE>if (null == work) {<NEW_LINE>throw new ExceptionEntityNotExist(id, Work.class);<NEW_LINE>}<NEW_LINE>wo.<MASK><NEW_LINE>deleteData(business, work, path0, path1);<NEW_LINE>}<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>};<NEW_LINE>ProcessPlatformExecutorFactory.get(executorSeed).submit(callable).get(300, TimeUnit.SECONDS);<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}
setId(work.getId());
250,754
// Write out a <funcRec/> segment in XML.<NEW_LINE>public void saveXml(Writer fwrite) throws IOException {<NEW_LINE>StringBuilder buf = new StringBuilder();<NEW_LINE>buf.append(" <funcRec");<NEW_LINE>buf.append(" funcName=\"");<NEW_LINE>SpecXmlUtils.xmlEscape(buf, this.funcName);<NEW_LINE>buf.append("\"");<NEW_LINE>buf.append(" hashVal=\"" + this.hashValue + "\"");<NEW_LINE>buf.append(">\n");<NEW_LINE>fwrite.append(buf.toString());<NEW_LINE>buf = new StringBuilder();<NEW_LINE>for (FuncRecord kid : this.children) {<NEW_LINE>buf.append(" <child name=\"");<NEW_LINE>SpecXmlUtils.<MASK><NEW_LINE>buf.append("\"/>\n");<NEW_LINE>}<NEW_LINE>// NB: It is unnecessary to store parents and children, since when we create the graph from the file, we can create both sides simultaneously.<NEW_LINE>buf.append(" </funcRec>\n");<NEW_LINE>fwrite.append(buf.toString());<NEW_LINE>return;<NEW_LINE>}
xmlEscape(buf, kid.funcName);
433,537
private I_M_HU createInstanceRecursively(@NonNull final I_M_HU_PI_Version huPIVersion, @Nullable final I_M_HU_Item parentItem) {<NEW_LINE>//<NEW_LINE>// Check if parent item was specified, make sure it was saved<NEW_LINE>if (parentItem != null && parentItem.getM_HU_Item_ID() <= 0) {<NEW_LINE>throw new AdempiereException(parentItem + " not saved");<NEW_LINE>}<NEW_LINE>final I_M_HU_PI_Version huPIVersionToUse;<NEW_LINE>if (parentItem != null && X_M_HU_Item.ITEMTYPE_HUAggregate.equals(parentItem.getItemType())) {<NEW_LINE>// gh #460: if the parent item is "aggregate", then we create a virtual HU to hold all the packing an material aggregations<NEW_LINE>final IHandlingUnitsDAO handlingUnitsDAO = Services.get(IHandlingUnitsDAO.class);<NEW_LINE>huPIVersionToUse = handlingUnitsDAO.retrieveVirtualPIItem(getHUContext().getCtx()).getM_HU_PI_Version();<NEW_LINE>} else {<NEW_LINE>huPIVersionToUse = huPIVersion;<NEW_LINE>}<NEW_LINE>// Create a single HU instance and save it.<NEW_LINE>final I_M_HU hu = createHUInstance(huPIVersionToUse);<NEW_LINE>BUILDER_INVOCATION_HU_PI_VERSION.setValue(hu, huPIVersion);<NEW_LINE>final IHUContext huContext = getHUContext();<NEW_LINE>// Assign HU to Parent<NEW_LINE>huTrxBL.setParentHU(huContext, parentItem, hu);<NEW_LINE>//<NEW_LINE>// Generate HU Attributes<NEW_LINE>final <MASK><NEW_LINE>final IAttributeStorage attributeStorage = attributesStorageFactory.getAttributeStorage(hu);<NEW_LINE>attributeStorage.generateInitialAttributes(getInitialAttributeValueDefaults());<NEW_LINE>setStatus(HUIteratorStatus.Running);<NEW_LINE>//<NEW_LINE>// Call HU Builder to create items and other included things (if any).<NEW_LINE>// this is where we actually create the HU items<NEW_LINE>final AbstractNodeIterator<I_M_HU> huBuilder = getNodeIterator(I_M_HU.class);<NEW_LINE>huBuilder.iterate(hu);<NEW_LINE>// Collect the HU (only if physical and unless the collector is disabled) in order to be taken from the empties warehouse into the current warehouse.<NEW_LINE>if (Services.get(IHUStatusBL.class).isPhysicalHU(hu)) {<NEW_LINE>huContext.getHUPackingMaterialsCollector().requirePackingMaterialForHURecursively(hu);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// If after running everything the status is still running, switch it to finished<NEW_LINE>if (getStatus() == HUIteratorStatus.Running) {<NEW_LINE>setStatus(HUIteratorStatus.Finished);<NEW_LINE>}<NEW_LINE>return hu;<NEW_LINE>}
IAttributeStorageFactory attributesStorageFactory = huContext.getHUAttributeStorageFactory();
1,082,872
public static MessageHandlerMethodFactory messageHandlerMethodFactory(@Qualifier(IntegrationContextUtils.ARGUMENT_RESOLVER_MESSAGE_CONVERTER_BEAN_NAME) CompositeMessageConverter compositeMessageConverter, @Nullable Validator validator, ConfigurableListableBeanFactory clbf) {<NEW_LINE>DefaultMessageHandlerMethodFactory messageHandlerMethodFactory = new DefaultMessageHandlerMethodFactory();<NEW_LINE>messageHandlerMethodFactory.setMessageConverter(compositeMessageConverter);<NEW_LINE>List<HandlerMethodArgumentResolver> resolvers = new LinkedList<>();<NEW_LINE>resolvers.add(new SmartPayloadArgumentResolver(compositeMessageConverter, validator));<NEW_LINE>resolvers.add(new SmartMessageMethodArgumentResolver(compositeMessageConverter));<NEW_LINE>resolvers.add(new HeaderMethodArgumentResolver(clbf.getConversionService(), clbf));<NEW_LINE>resolvers<MASK><NEW_LINE>// Copy the order from Spring Integration for compatibility with SI 5.2<NEW_LINE>resolvers.add(new PayloadExpressionArgumentResolver());<NEW_LINE>resolvers.add(new NullAwarePayloadArgumentResolver(compositeMessageConverter));<NEW_LINE>PayloadExpressionArgumentResolver payloadExpressionArgumentResolver = new PayloadExpressionArgumentResolver();<NEW_LINE>payloadExpressionArgumentResolver.setBeanFactory(clbf);<NEW_LINE>resolvers.add(payloadExpressionArgumentResolver);<NEW_LINE>PayloadsArgumentResolver payloadsArgumentResolver = new PayloadsArgumentResolver();<NEW_LINE>payloadsArgumentResolver.setBeanFactory(clbf);<NEW_LINE>resolvers.add(payloadsArgumentResolver);<NEW_LINE>MapArgumentResolver mapArgumentResolver = new MapArgumentResolver();<NEW_LINE>mapArgumentResolver.setBeanFactory(clbf);<NEW_LINE>resolvers.add(mapArgumentResolver);<NEW_LINE>messageHandlerMethodFactory.setArgumentResolvers(resolvers);<NEW_LINE>messageHandlerMethodFactory.setValidator(validator);<NEW_LINE>return messageHandlerMethodFactory;<NEW_LINE>}
.add(new HeadersMethodArgumentResolver());
966,970
public void forEach(BiConsumer<? super K, ? super V> processor) {<NEW_LINE>long stamp = tryOptimisticRead();<NEW_LINE>Object[] table = this.table;<NEW_LINE>boolean acquiredReadLock = false;<NEW_LINE>try {<NEW_LINE>// Validate no rehashing<NEW_LINE>if (!validate(stamp)) {<NEW_LINE>// Fallback to read lock<NEW_LINE>stamp = readLock();<NEW_LINE>acquiredReadLock = true;<NEW_LINE>table = this.table;<NEW_LINE>}<NEW_LINE>// Go through all the buckets for this section<NEW_LINE>for (int bucket = 0; bucket < table.length; bucket += 2) {<NEW_LINE>K storedKey = (K) table[bucket];<NEW_LINE>V storedValue = (V) table[bucket + 1];<NEW_LINE>if (!acquiredReadLock && !validate(stamp)) {<NEW_LINE>// Fallback to acquiring read lock<NEW_LINE>stamp = readLock();<NEW_LINE>acquiredReadLock = true;<NEW_LINE>storedKey = (K) table[bucket];<NEW_LINE>storedValue = (V) table[bucket + 1];<NEW_LINE>}<NEW_LINE>if (storedKey != DeletedKey && storedKey != EmptyKey) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (acquiredReadLock) {<NEW_LINE>unlockRead(stamp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
processor.accept(storedKey, storedValue);
363,027
private ByteBuffer untransform(ByteBuffer data) throws TTransportException {<NEW_LINE>if (readTransforms.contains(Transforms.ZLIB_TRANSFORM.getValue())) {<NEW_LINE>try {<NEW_LINE>Inflater decompressor = new Inflater();<NEW_LINE>decompressor.setInput(data.array(), data.position(), data.remaining());<NEW_LINE>int length = 0;<NEW_LINE>ArrayList<byte[]> outBytes = new ArrayList<byte[]>();<NEW_LINE>while (!decompressor.finished()) {<NEW_LINE>byte[] output = new byte[zlibBufferSize];<NEW_LINE>length += decompressor.inflate(output);<NEW_LINE>outBytes.add(output);<NEW_LINE>}<NEW_LINE>decompressor.end();<NEW_LINE>// Ugh output wants to be a list of blocks, we just want a buffer<NEW_LINE>if (outBytes.size() == 1) {<NEW_LINE>data = ByteBuffer.wrap(outBytes.get(0));<NEW_LINE>} else {<NEW_LINE>ByteBuffer output = ByteBuffer.allocate(length);<NEW_LINE>for (byte[] outBlock : outBytes) {<NEW_LINE>output.put(outBlock, 0, Math<MASK><NEW_LINE>length -= outBlock.length;<NEW_LINE>}<NEW_LINE>data = output;<NEW_LINE>data.position(0);<NEW_LINE>}<NEW_LINE>} catch (DataFormatException dfe) {<NEW_LINE>throw new THeaderException("Could not inflate data");<NEW_LINE>}<NEW_LINE>if (!writeTransforms.contains(Transforms.ZLIB_TRANSFORM)) {<NEW_LINE>writeTransforms.add(Transforms.ZLIB_TRANSFORM);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return data;<NEW_LINE>}
.min(zlibBufferSize, length));
1,792,793
public static // 14: PREFIX(parenthesized_expression)<NEW_LINE>boolean expression(PsiBuilder b, int l, int g) {<NEW_LINE>if (!recursion_guard_(b, l, "expression"))<NEW_LINE>return false;<NEW_LINE>addVariant(b, "<expression>");<NEW_LINE>boolean r, p;<NEW_LINE>Marker m = enter_section_(b, l, _NONE_, "<expression>");<NEW_LINE>r = catch_expression(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = atom_with_arity_expression(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = prefix_expression(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = function_call_expression(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = global_function_call_expression(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = <MASK><NEW_LINE>if (!r)<NEW_LINE>r = record2_expression(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = qualified_expression(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = max_expression(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = parenthesized_expression(b, l + 1);<NEW_LINE>p = r;<NEW_LINE>r = r && expression_0(b, l + 1, g);<NEW_LINE>exit_section_(b, l, m, null, r, p, null);<NEW_LINE>return r || p;<NEW_LINE>}
generic_function_call_expression(b, l + 1);
300,352
public BlazeCommandResult exec(CommandEnvironment env, OptionsParsingResult options) {<NEW_LINE>ImmutableSortedMap<BuildConfigurationKey, BuildConfigurationValue> configurations = findConfigurations(env);<NEW_LINE>try (PrintWriter writer = new PrintWriter(new OutputStreamWriter(env.getReporter().getOutErr().getOutputStream(), UTF_8))) {<NEW_LINE>ConfigOptions configCommandOptions = options.getOptions(ConfigOptions.class);<NEW_LINE>ConfigCommandOutputFormatter outputFormatter = configCommandOptions.outputType == OutputType.TEXT ? new TextOutputFormatter(writer) : new JsonOutputFormatter(writer);<NEW_LINE>ImmutableSortedMap<Class<? extends Fragment>, ImmutableSortedSet<Class<? extends FragmentOptions>>> fragmentDefs = getFragmentDefs(env.getRuntime().getRuleClassProvider().getFragmentRegistry());<NEW_LINE>if (options.getResidue().isEmpty()) {<NEW_LINE>if (configCommandOptions.dumpAll) {<NEW_LINE>return reportAllConfigurations(outputFormatter<MASK><NEW_LINE>} else {<NEW_LINE>return reportConfigurationIds(outputFormatter, forOutput(configurations, fragmentDefs));<NEW_LINE>}<NEW_LINE>} else if (options.getResidue().size() == 1) {<NEW_LINE>String configHash = options.getResidue().get(0);<NEW_LINE>return reportSingleConfiguration(outputFormatter, env, forOutput(configurations, fragmentDefs), configHash);<NEW_LINE>} else if (options.getResidue().size() == 2) {<NEW_LINE>String configHash1 = options.getResidue().get(0);<NEW_LINE>String configHash2 = options.getResidue().get(1);<NEW_LINE>return reportConfigurationDiff(forOutput(configurations, fragmentDefs), configHash1, configHash2, outputFormatter, env);<NEW_LINE>} else {<NEW_LINE>String message = "Too many config ids.";<NEW_LINE>env.getReporter().handle(Event.error(message));<NEW_LINE>return createFailureResult(message, Code.TOO_MANY_CONFIG_IDS);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, forOutput(configurations, fragmentDefs));
193,266
final DescribeVolumesResult executeDescribeVolumes(DescribeVolumesRequest describeVolumesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeVolumesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeVolumesRequest> request = null;<NEW_LINE>Response<DescribeVolumesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeVolumesRequestMarshaller().marshall(super.beforeMarshalling(describeVolumesRequest));<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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeVolumes");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeVolumesResult> responseHandler = new StaxResponseHandler<DescribeVolumesResult>(new DescribeVolumesResultStaxUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
293,773
private void completeContainer(String containerId, int rawExitCode, String rawExitDiagnostics, Boolean needToRelease) throws Exception {<NEW_LINE>if (needToRelease) {<NEW_LINE>tryToReleaseContainer(containerId);<NEW_LINE>if (rawExitCode == FrameworkExitCode.CONTAINER_MIGRATE_TASK_REQUESTED.toInt()) {<NEW_LINE>requestManager.onMigrateTaskRequestContainerReleased(containerId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String logSuffix = String.format("[%s]: completeContainer: RawExitCode: %s, RawExitDiagnostics: %s, NeedToRelease: %s", containerId, rawExitCode, rawExitDiagnostics, needToRelease);<NEW_LINE>if (!statusManager.isContainerIdLiveAssociated(containerId)) {<NEW_LINE>LOGGER.logDebug("[NotLiveAssociated]%s", logSuffix);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TaskStatus taskStatus = statusManager.getTaskStatusWithLiveAssociatedContainerId(containerId);<NEW_LINE>String taskRoleName = taskStatus.getTaskRoleName();<NEW_LINE>TaskStatusLocator taskLocator = new TaskStatusLocator(<MASK><NEW_LINE>String linePrefix = String.format("%s: ", taskLocator);<NEW_LINE>LOGGER.logSplittedLines(Level.INFO, "%s%s\n%s", taskLocator, logSuffix, generateContainerLocations(taskStatus, linePrefix));<NEW_LINE>statusManager.transitionTaskState(taskLocator, TaskState.CONTAINER_COMPLETED, new TaskEvent().setContainerRawExitCode(rawExitCode).setContainerRawExitDiagnostics(rawExitDiagnostics));<NEW_LINE>// Post-mortem CONTAINER_COMPLETED Task<NEW_LINE>attemptToRetry(taskStatus);<NEW_LINE>}
taskRoleName, taskStatus.getTaskIndex());
886,840
public Delegate unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Delegate delegate = new Delegate();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Id", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>delegate.setId(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("Type", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>delegate.setType(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 delegate;<NEW_LINE>}
class).unmarshall(context));
1,200,262
public VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vrp) {<NEW_LINE>// TODO determine alpha threshold<NEW_LINE>int radialShare = (int) (vrp.getJobs().size() * 0.3);<NEW_LINE>int randomShare = (int) (vrp.getJobs().size() * 0.5);<NEW_LINE>Jsprit.Builder builder = Jsprit.Builder.newInstance(vrp);<NEW_LINE>builder.setProperty(Jsprit.Parameter.THRESHOLD_ALPHA, "0.0");<NEW_LINE>builder.setProperty(Jsprit.Strategy.RADIAL_BEST, "0.5");<NEW_LINE>builder.setProperty(Jsprit.Strategy.RADIAL_REGRET, "0.0");<NEW_LINE>builder.setProperty(Jsprit.Strategy.RANDOM_BEST, "0.5");<NEW_LINE>builder.setProperty(Jsprit.Strategy.RANDOM_REGRET, "0.0");<NEW_LINE>builder.setProperty(<MASK><NEW_LINE>builder.setProperty(Jsprit.Strategy.WORST_REGRET, "0.0");<NEW_LINE>builder.setProperty(Jsprit.Strategy.CLUSTER_BEST, "0.0");<NEW_LINE>builder.setProperty(Jsprit.Strategy.CLUSTER_REGRET, "0.0");<NEW_LINE>builder.setProperty(Jsprit.Parameter.RADIAL_MIN_SHARE, String.valueOf(radialShare));<NEW_LINE>builder.setProperty(Jsprit.Parameter.RADIAL_MAX_SHARE, String.valueOf(radialShare));<NEW_LINE>builder.setProperty(Jsprit.Parameter.RANDOM_BEST_MIN_SHARE, String.valueOf(randomShare));<NEW_LINE>builder.setProperty(Jsprit.Parameter.RANDOM_BEST_MAX_SHARE, String.valueOf(randomShare));<NEW_LINE>return builder.buildAlgorithm();<NEW_LINE>}
Jsprit.Strategy.WORST_BEST, "0.0");
358,236
public static void handleXssBlockBuffer(CheckParameter parameter, String script) throws UnsupportedEncodingException {<NEW_LINE>Integer contentLength = (Integer) parameter.getParam("content_length");<NEW_LINE>Object buffer = parameter.getParam("buffer");<NEW_LINE>byte[] content = script.getBytes(parameter.getParam<MASK><NEW_LINE>if (buffer instanceof ByteBuffer) {<NEW_LINE>((ByteBuffer) buffer).clear();<NEW_LINE>} else {<NEW_LINE>Reflection.invokeMethod(buffer, "recycle", new Class[] {});<NEW_LINE>}<NEW_LINE>if (contentLength != null && contentLength >= 0) {<NEW_LINE>byte[] fullContent = new byte[contentLength];<NEW_LINE>if (contentLength >= content.length) {<NEW_LINE>for (int i = 0; i < content.length; i++) {<NEW_LINE>fullContent[i] = content[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = content.length; i < contentLength; i++) {<NEW_LINE>fullContent[i] = ' ';<NEW_LINE>}<NEW_LINE>writeContentToBuffer(buffer, fullContent);<NEW_LINE>} else {<NEW_LINE>writeContentToBuffer(buffer, content);<NEW_LINE>}<NEW_LINE>}
("encoding").toString());
411,490
public static double itakuraSaitoDist(double[] speechFrame1, double[] speechFrame2, int fftSize, int lpOrder) {<NEW_LINE>double[] preemphasizedFrame1 = SignalProcUtils.applyPreemphasis(speechFrame1, 0.97);<NEW_LINE>double[] preemphasizedFrame2 = SignalProcUtils.applyPreemphasis(speechFrame2, 0.97);<NEW_LINE>// Windowing<NEW_LINE>double[] windowedSpeechFrame1 = new double[preemphasizedFrame1.length];<NEW_LINE>System.arraycopy(preemphasizedFrame1, 0, windowedSpeechFrame1, 0, preemphasizedFrame1.length);<NEW_LINE>double[] windowedSpeechFrame2 = new double[preemphasizedFrame2.length];<NEW_LINE>System.arraycopy(preemphasizedFrame2, 0, windowedSpeechFrame2, 0, preemphasizedFrame2.length);<NEW_LINE>HammingWindow w1 = new HammingWindow(speechFrame1.length);<NEW_LINE>w1.apply(windowedSpeechFrame1, 0);<NEW_LINE>HammingWindow w2 = new HammingWindow(speechFrame2.length);<NEW_LINE>w2.apply(windowedSpeechFrame2, 0);<NEW_LINE>//<NEW_LINE>int w;<NEW_LINE>double[] Xabs1 = LpcAnalyser.calcSpecFrameLinear(speechFrame1, lpOrder, fftSize);<NEW_LINE>double[] Xabs2 = LpcAnalyser.calcSpecFrameLinear(speechFrame2, lpOrder, fftSize);<NEW_LINE>// Itakura-Saito distance using power spectrum: pf1/pf2 - log(pf1/pf2) - 1<NEW_LINE>double dist = 0.0;<NEW_LINE>for (w = 0; w < Xabs1.length; w++) Xabs1[w] = Xabs1[w] * Xabs1[w];<NEW_LINE>for (w = 0; w < Xabs2.length; w++) Xabs2[w] = Xabs2[w] * Xabs2[w];<NEW_LINE>for (w = 0; w < Xabs1.length; w++) dist += Xabs1[w] / Math.max(Xabs2[w], 1e-20) - Math.log(Math.max(Xabs1[w], 1e-20)) + Math.log(Math.max(Xabs2[<MASK><NEW_LINE>return Math.min(dist, MAX_SPECTRAL_DISTANCE);<NEW_LINE>}
w], 1e-20)) - 1.0;
1,367,997
void transpileTry(Node n, @Nullable TranspilationContext.Case breakCase) {<NEW_LINE>Node tryBlock = n.removeFirstChild();<NEW_LINE>Node catchBlock = n.removeFirstChild();<NEW_LINE>Node finallyBlock = n.removeFirstChild();<NEW_LINE>TranspilationContext.Case catchCase = catchBlock.hasChildren() ? context.createCase() : null;<NEW_LINE>TranspilationContext.Case finallyCase = finallyBlock == null ? null : context.createCase();<NEW_LINE>TranspilationContext.Case endCase = context.maybeCreateCase(breakCase);<NEW_LINE>// Transpile "try" block<NEW_LINE>context.enterTryBlock(catchCase, finallyCase, tryBlock);<NEW_LINE>transpileStatement(tryBlock);<NEW_LINE>if (finallyBlock == null) {<NEW_LINE>context.leaveTryBlock(catchCase, endCase, tryBlock);<NEW_LINE>} else {<NEW_LINE>// Transpile "finally" block<NEW_LINE>context.switchCaseTo(finallyCase);<NEW_LINE>context.enterFinallyBlock(catchCase, finallyCase, finallyBlock);<NEW_LINE>transpileStatement(finallyBlock);<NEW_LINE>context.leaveFinallyBlock(endCase, finallyBlock);<NEW_LINE>}<NEW_LINE>// Transpile "catch" block<NEW_LINE>if (catchBlock.hasChildren()) {<NEW_LINE>checkState(catchBlock.getFirstChild().isCatch());<NEW_LINE>context.switchCaseTo(catchCase);<NEW_LINE>Node exceptionName = catchBlock.getFirstFirstChild().detach();<NEW_LINE><MASK><NEW_LINE>Node catchBody = catchBlock.getFirstFirstChild().detach();<NEW_LINE>checkState(catchBody.isBlock());<NEW_LINE>transpileStatement(catchBody);<NEW_LINE>context.leaveCatchBlock(finallyCase, catchBody);<NEW_LINE>}<NEW_LINE>context.switchCaseTo(endCase);<NEW_LINE>}
context.enterCatchBlock(finallyCase, exceptionName);
340,832
public String show(@RequestParam(value = "name", required = true) String name, @RequestParam(value = "type", required = false) String type, @RequestParam(value = "topology", required = false) String topologyId, @RequestParam(value = "host", required = false) String host, ModelMap model) {<NEW_LINE>if (StringUtils.isNotEmpty(host) && UIUtils.isValidSupervisorHost(name, host)) {<NEW_LINE>UIUtils.addErrorAttribute(model, new RuntimeException("Not a valid host: " + host));<NEW_LINE>return "conf";<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>topologyId = StringEscapeUtils.escapeHtml(topologyId);<NEW_LINE>String title = null;<NEW_LINE>String uri = String.format("api/v2/cluster/%s", name);<NEW_LINE>if (!StringUtils.isBlank(type)) {<NEW_LINE>if (type.equals("supervisor")) {<NEW_LINE>uri += String.format("/supervisor/%s/configuration", host);<NEW_LINE>title = "Supervisor Conf";<NEW_LINE>model.addAttribute("subtitle", host);<NEW_LINE>model.addAttribute("host", host);<NEW_LINE>} else if (type.equals("topology")) {<NEW_LINE>uri += String.format("/topology/%s/configuration", topologyId);<NEW_LINE>title = "Topology Conf";<NEW_LINE>model.addAttribute("subtitle", topologyId);<NEW_LINE>model.addAttribute("topologyId", topologyId);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>uri += "/configuration";<NEW_LINE>title = "Nimbus Conf";<NEW_LINE>model.addAttribute("subtitle", name);<NEW_LINE>}<NEW_LINE>model.addAttribute("clusterName", name);<NEW_LINE>model.addAttribute("uri", uri);<NEW_LINE>model.addAttribute("pageTitle", title);<NEW_LINE>model.addAttribute("page", "conf");<NEW_LINE>UIUtils.addTitleAttribute(model, "Configuration");<NEW_LINE>return "conf";<NEW_LINE>}
name = StringEscapeUtils.escapeHtml(name);
1,542,913
public WebElement findElement(WebDriver driver, String locator) {<NEW_LINE>WebElement toReturn = null;<NEW_LINE>String strategy = searchAdditionalStrategies(locator);<NEW_LINE>if (strategy != null) {<NEW_LINE>String actualLocator = locator.substring(locator.indexOf('=') + 1);<NEW_LINE>// TODO(simon): Recurse into child documents<NEW_LINE>try {<NEW_LINE>toReturn = (WebElement) ((JavascriptExecutor) driver<MASK><NEW_LINE>if (toReturn == null) {<NEW_LINE>throw new SeleniumException("Element " + locator + " not found");<NEW_LINE>}<NEW_LINE>return toReturn;<NEW_LINE>} catch (WebDriverException e) {<NEW_LINE>throw new SeleniumException("Element " + locator + " not found", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>toReturn = findElementDirectlyIfNecessary(driver, locator);<NEW_LINE>if (toReturn != null) {<NEW_LINE>return toReturn;<NEW_LINE>}<NEW_LINE>return (WebElement) ((JavascriptExecutor) driver).executeScript(findElement, locator);<NEW_LINE>} catch (WebDriverException e) {<NEW_LINE>throw new SeleniumException("Element " + locator + " not found", e);<NEW_LINE>}<NEW_LINE>}
).executeScript(strategy, actualLocator);
315,291
private Sha256Hash readBinary(InputStream inputStream) throws IOException {<NEW_LINE>DataInputStream dis = null;<NEW_LINE>try {<NEW_LINE>MessageDigest digest = Sha256Hash.newDigest();<NEW_LINE>DigestInputStream digestInputStream = new DigestInputStream(inputStream, digest);<NEW_LINE>dis = new DataInputStream(digestInputStream);<NEW_LINE>digestInputStream.on(false);<NEW_LINE>byte[] header = new byte[BINARY_MAGIC.length()];<NEW_LINE>dis.readFully(header);<NEW_LINE>if (!Arrays.equals(header, BINARY_MAGIC.getBytes(StandardCharsets.US_ASCII)))<NEW_LINE>throw new IOException("Header bytes did not match expected version");<NEW_LINE>int numSignatures = checkPositionIndex(dis.readInt(), MAX_SIGNATURES, "Num signatures out of range");<NEW_LINE>for (int i = 0; i < numSignatures; i++) {<NEW_LINE>byte[] sig = new byte[65];<NEW_LINE>dis.readFully(sig);<NEW_LINE>// TODO: Do something with the signature here.<NEW_LINE>}<NEW_LINE>digestInputStream.on(true);<NEW_LINE>int numCheckpoints = dis.readInt();<NEW_LINE>checkState(numCheckpoints > 0);<NEW_LINE>final int size = StoredBlock.COMPACT_SERIALIZED_SIZE;<NEW_LINE>ByteBuffer buffer = ByteBuffer.allocate(size);<NEW_LINE>for (int i = 0; i < numCheckpoints; i++) {<NEW_LINE>if (dis.read(buffer.array(), 0, size) < size)<NEW_LINE>throw new IOException("Incomplete read whilst loading checkpoints.");<NEW_LINE>StoredBlock block = StoredBlock.deserializeCompact(params, buffer);<NEW_LINE>((Buffer) buffer).position(0);<NEW_LINE>checkpoints.put(block.getHeader().getTimeSeconds(), block);<NEW_LINE>}<NEW_LINE>Sha256Hash dataHash = Sha256Hash.wrap(digest.digest());<NEW_LINE>log.info("Read {} checkpoints up to time {}, hash is {}", checkpoints.size(), Utils.dateTimeFormat(checkpoints.lastEntry().getKey<MASK><NEW_LINE>return dataHash;<NEW_LINE>} catch (ProtocolException e) {<NEW_LINE>throw new IOException(e);<NEW_LINE>} finally {<NEW_LINE>if (dis != null)<NEW_LINE>dis.close();<NEW_LINE>inputStream.close();<NEW_LINE>}<NEW_LINE>}
() * 1000), dataHash);
571,389
final UpdateContactFlowNameResult executeUpdateContactFlowName(UpdateContactFlowNameRequest updateContactFlowNameRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateContactFlowNameRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateContactFlowNameRequest> request = null;<NEW_LINE>Response<UpdateContactFlowNameResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateContactFlowNameRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateContactFlowNameRequest));<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, "Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateContactFlowName");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateContactFlowNameResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateContactFlowNameResultJsonUnmarshaller());<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());
950,603
public void registerWithMaster() throws CancelledException, InternalException, DeadlineExceededException, InterruptedException {<NEW_LINE>// onNext() - send the request batches<NEW_LINE>// onError() - when an error occurs on the worker side, propagate the error status to<NEW_LINE>// the master side and then close on the worker side, the master will<NEW_LINE>// handle necessary cleanup on its side<NEW_LINE>// onCompleted() - complete on the client side when all the batches are sent<NEW_LINE>// and all ACKs are received<NEW_LINE>mWorkerRequestObserver = mAsyncClient.withDeadlineAfter(mDeadlineMs, TimeUnit.MILLISECONDS).registerWorkerStream(mMasterResponseObserver);<NEW_LINE>try {<NEW_LINE>registerInternal();<NEW_LINE>} catch (DeadlineExceededException | InterruptedException | CancelledException e) {<NEW_LINE>LOG.<MASK><NEW_LINE>// These exceptions are internal to the worker<NEW_LINE>// Propagate to the master side so it can clean up properly<NEW_LINE>mWorkerRequestObserver.onError(e);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>// The only exception that is not propagated to the master is InternalException.<NEW_LINE>// We assume that is from the master so there is no need to send it back again.<NEW_LINE>}
error("Worker {} - Error during the register stream, aborting now.", mWorkerId, e);
424,103
public void deleteArtifact(DeleteProjectArtifact request, StreamObserver<DeleteProjectArtifact.Response> responseObserver) {<NEW_LINE>try {<NEW_LINE>final var futureResponse = futureProjectDAO.deleteArtifacts(request).thenCompose(unused -> futureProjectDAO.getProjectById(request.getId()), executor).thenCompose(updatedProject -> addEvent(updatedProject.getId(), updatedProject.getWorkspaceServiceId(), UPDATE_PROJECT_EVENT_TYPE, Optional.of("artifacts"), Collections.singletonMap("artifact_keys", new Gson().toJsonTree(Collections.singletonList(request.getKey()), new TypeToken<ArrayList<String>>() {<NEW_LINE>}.getType())), "project artifact deleted successfully").thenApply(unused -> updatedProject, executor), executor).thenApply(updatedProject -> DeleteProjectArtifact.Response.newBuilder().setProject(updatedProject<MASK><NEW_LINE>FutureGrpc.ServerResponse(responseObserver, futureResponse, executor);<NEW_LINE>} catch (Exception e) {<NEW_LINE>CommonUtils.observeError(responseObserver, e);<NEW_LINE>}<NEW_LINE>}
).build(), executor);
351,507
private void collectAndSaveConsumerGroup(Long clusterId, Set<String> consumerGroupSet) {<NEW_LINE>try {<NEW_LINE>AdminClient adminClient = KafkaClientPool.getAdminClient(clusterId);<NEW_LINE>scala.collection.immutable.Map<org.apache.kafka.common.Node, scala.collection.immutable.List<kafka.coordinator.GroupOverview>> brokerGroupMap = adminClient.listAllGroups();<NEW_LINE>for (scala.collection.immutable.List<kafka.coordinator.GroupOverview> brokerGroup : JavaConversions.asJavaMap(brokerGroupMap).values()) {<NEW_LINE>List<kafka.coordinator.GroupOverview> lists = JavaConversions.asJavaList(brokerGroup);<NEW_LINE>for (kafka.coordinator.GroupOverview groupOverview : lists) {<NEW_LINE><MASK><NEW_LINE>if (consumerGroup != null && consumerGroup.contains("#")) {<NEW_LINE>String[] splitArray = consumerGroup.split("#");<NEW_LINE>consumerGroup = splitArray[splitArray.length - 1];<NEW_LINE>}<NEW_LINE>consumerGroupSet.add(consumerGroup);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("collect consumerGroup failed, clusterId:{}.", clusterId, e);<NEW_LINE>}<NEW_LINE>}
String consumerGroup = groupOverview.groupId();
1,367,689
public ApiResponse<FileMetadata> uploadPutResumableWithHttpInfo(String uploadId) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'uploadId' is set<NEW_LINE>if (uploadId == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'uploadId' when calling uploadPutResumable");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/upload/resumable";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "uploadId", uploadId));<NEW_LINE>final String[] localVarAccepts = { "application/json", "text/json" };<NEW_LINE>final String <MASK><NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>GenericType<FileMetadata> localVarReturnType = new GenericType<FileMetadata>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>}
localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
295,345
public static void checkCommand(byte[] command, byte[] args, final byte[] envBlock) {<NEW_LINE>if (HookHandler.enableCmdHook.get()) {<NEW_LINE>LinkedList<String> commands = new LinkedList<String>();<NEW_LINE>if (command != null && command.length > 0) {<NEW_LINE>commands.add(new String(command, 0<MASK><NEW_LINE>}<NEW_LINE>if (args != null && args.length > 0) {<NEW_LINE>int position = 0;<NEW_LINE>for (int i = 0; i < args.length; i++) {<NEW_LINE>if (args[i] == 0) {<NEW_LINE>commands.add(new String(Arrays.copyOfRange(args, position, i)));<NEW_LINE>position = i + 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LinkedList<String> envList = new LinkedList<String>();<NEW_LINE>if (envBlock != null) {<NEW_LINE>int index = -1;<NEW_LINE>for (int i = 0; i < envBlock.length; i++) {<NEW_LINE>if (envBlock[i] == '\0') {<NEW_LINE>String envItem = new String(envBlock, index + 1, i - index - 1);<NEW_LINE>if (envItem.length() > 0) {<NEW_LINE>envList.add(envItem);<NEW_LINE>}<NEW_LINE>index = i;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>checkCommand(commands, envList);<NEW_LINE>}<NEW_LINE>}
, command.length - 1));
536,164
public void perform(SecurityTest securityTest, Object param) {<NEW_LINE>if (dialog == null) {<NEW_LINE>XFormDialogBuilder builder = XFormFactory.createDialogBuilder("SecurityTest Options");<NEW_LINE>form = builder.createForm("Basic");<NEW_LINE>form.addCheckBox(FAIL_ON_ERROR, "Fail on error").addFormFieldListener(new XFormFieldListener() {<NEW_LINE><NEW_LINE>public void valueChanged(XFormField sourceField, String newValue, String oldValue) {<NEW_LINE>form.getFormField(FAIL_SECURITYTEST_ON_ERROR).setEnabled(<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>form.addCheckBox(FAIL_SECURITYTEST_ON_ERROR, "Fail SecurityTest if it has failed TestSteps");<NEW_LINE>dialog = builder.buildDialog(builder.buildOkCancelHelpActions(HelpUrls.SECURITYTESTEDITOR_HELP_URL), "Specify general options for this SecurityTest", UISupport.OPTIONS_ICON);<NEW_LINE>}<NEW_LINE>StringToStringMap values = new StringToStringMap();<NEW_LINE>values.put(FAIL_ON_ERROR, String.valueOf(securityTest.getFailOnError()));<NEW_LINE>values.put(FAIL_SECURITYTEST_ON_ERROR, String.valueOf(securityTest.getFailSecurityTestOnScanErrors()));<NEW_LINE>values = dialog.show(values);<NEW_LINE>if (dialog.getReturnValue() == XFormDialog.OK_OPTION) {<NEW_LINE>try {<NEW_LINE>securityTest.setFailOnError(Boolean.parseBoolean(values.get(FAIL_ON_ERROR)));<NEW_LINE>securityTest.setFailSecurityTestOnScanErrors(Boolean.parseBoolean(values.get(FAIL_SECURITYTEST_ON_ERROR)));<NEW_LINE>} catch (Exception e1) {<NEW_LINE>UISupport.showErrorMessage(e1.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
!Boolean.parseBoolean(newValue));
1,213,025
public RelDataType deriveType(SqlValidator validator, SqlValidatorScope scope, SqlCall call) {<NEW_LINE>final SqlNode operand = call.getOperandList().get(0);<NEW_LINE>final RelDataType nodeType = validator.deriveType(scope, operand);<NEW_LINE>assert nodeType != null;<NEW_LINE>if (!nodeType.isStruct()) {<NEW_LINE>throw SqlUtil.newContextException(operand.getParserPosition(), Static.RESOURCE.incompatibleTypes());<NEW_LINE>}<NEW_LINE>final SqlNode fieldId = call.operand(1);<NEW_LINE>final String fieldName = fieldId.toString();<NEW_LINE>final RelDataTypeField field = nodeType.getField(fieldName, false, false);<NEW_LINE>if (field == null) {<NEW_LINE>throw SqlUtil.newContextException(fieldId.getParserPosition(), Static<MASK><NEW_LINE>}<NEW_LINE>RelDataType type = field.getType();<NEW_LINE>// Validate and determine coercibility and resulting collation<NEW_LINE>// name of binary operator if needed.<NEW_LINE>type = adjustType(validator, call, type);<NEW_LINE>SqlValidatorUtil.checkCharsetAndCollateConsistentIfCharType(type);<NEW_LINE>return type;<NEW_LINE>}
.RESOURCE.unknownField(fieldName));
1,300,508
public static int runAnt(String[] args) {<NEW_LINE>String className = null;<NEW_LINE>Class c = null;<NEW_LINE>try {<NEW_LINE>className = "org.apache.tools.ant.Main";<NEW_LINE>c = Class.forName(className);<NEW_LINE>} catch (ClassNotFoundException e1) {<NEW_LINE>System.err.println("Error: ant.jar not found on the classpath");<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Class[] methodArgTypes = new Class[1];<NEW_LINE>methodArgTypes[0] = args.getClass();<NEW_LINE>Method mainMethod = c.getMethod("main", methodArgTypes);<NEW_LINE>Object[] methodArgs = new Object[1];<NEW_LINE>methodArgs[0] = args;<NEW_LINE>// The object can be null because the method is static<NEW_LINE>Integer res = (Integer) mainMethod.invoke(null, methodArgs);<NEW_LINE>// Clean up after running ANT<NEW_LINE>System.gc();<NEW_LINE>return res.intValue();<NEW_LINE>} catch (NoSuchMethodException e2) {<NEW_LINE>System.err.println("Error: method \"main\" not found");<NEW_LINE>e2.printStackTrace();<NEW_LINE>} catch (IllegalAccessException e4) {<NEW_LINE>System.err.println("Error: class not permitted to be instantiated");<NEW_LINE>e4.printStackTrace();<NEW_LINE>} catch (InvocationTargetException e5) {<NEW_LINE>System.err.println("Error: method \"main\" could not be invoked");<NEW_LINE>e5.printStackTrace();<NEW_LINE>} catch (Exception e6) {<NEW_LINE><MASK><NEW_LINE>e6.printStackTrace();<NEW_LINE>}<NEW_LINE>// Clean up after running ANT<NEW_LINE>System.gc();<NEW_LINE>return -1;<NEW_LINE>}
System.err.println("Error: ");
649,512
public byte[] encrypt(final byte[] iv, final byte[] plaintext, final byte[] associatedData) throws GeneralSecurityException {<NEW_LINE>if (iv.length != IV_SIZE_IN_BYTES) {<NEW_LINE>throw new GeneralSecurityException("iv is wrong size");<NEW_LINE>}<NEW_LINE>// Check that ciphertext is not longer than the max. size of a Java array.<NEW_LINE>if (plaintext.length > Integer.MAX_VALUE - IV_SIZE_IN_BYTES - TAG_SIZE_IN_BYTES) {<NEW_LINE>throw new GeneralSecurityException("plaintext too long");<NEW_LINE>}<NEW_LINE>int ciphertextLength = prependIv ? IV_SIZE_IN_BYTES + plaintext.length + TAG_SIZE_IN_BYTES : plaintext.length + TAG_SIZE_IN_BYTES;<NEW_LINE>byte[] ciphertext = new byte[ciphertextLength];<NEW_LINE>if (prependIv) {<NEW_LINE>System.arraycopy(iv, 0, ciphertext, 0, IV_SIZE_IN_BYTES);<NEW_LINE>}<NEW_LINE>AlgorithmParameterSpec params = getParams(iv);<NEW_LINE>localCipher.get().init(Cipher.ENCRYPT_MODE, keySpec, params);<NEW_LINE>if (associatedData != null && associatedData.length != 0) {<NEW_LINE>localCipher.get().updateAAD(associatedData);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>int written = localCipher.get().doFinal(plaintext, 0, plaintext.length, ciphertext, ciphertextOutputOffset);<NEW_LINE>// For security reasons, AES-GCM encryption must always use tag of TAG_SIZE_IN_BYTES bytes. If<NEW_LINE>// so, written must be equal to plaintext.length + TAG_SIZE_IN_BYTES.<NEW_LINE>if (written != plaintext.length + TAG_SIZE_IN_BYTES) {<NEW_LINE>// The tag is shorter than expected.<NEW_LINE>int actualTagSize = written - plaintext.length;<NEW_LINE>throw new GeneralSecurityException(String.format("encryption failed; GCM tag must be %s bytes, but got only %s bytes", TAG_SIZE_IN_BYTES, actualTagSize));<NEW_LINE>}<NEW_LINE>return ciphertext;<NEW_LINE>}
int ciphertextOutputOffset = prependIv ? IV_SIZE_IN_BYTES : 0;
383,396
public static Container decompress(byte[] b, int[] keys) throws IOException {<NEW_LINE>InputStream stream = new InputStream(b);<NEW_LINE>int compression = stream.readUnsignedByte();<NEW_LINE>int compressedLength = stream.readInt();<NEW_LINE>if (compressedLength < 0 || compressedLength > 1000000) {<NEW_LINE>throw new RuntimeException("Invalid data");<NEW_LINE>}<NEW_LINE>Crc32 crc32 = new Crc32();<NEW_LINE>// compression + length<NEW_LINE>crc32.update(b, 0, 5);<NEW_LINE>byte[] data;<NEW_LINE>int revision = -1;<NEW_LINE>switch(compression) {<NEW_LINE>case CompressionType.NONE:<NEW_LINE>{<NEW_LINE>byte[] encryptedData = new byte[compressedLength];<NEW_LINE>stream.readBytes(encryptedData, 0, compressedLength);<NEW_LINE>crc32.update(encryptedData, 0, compressedLength);<NEW_LINE>byte[] decryptedData = decrypt(encryptedData, encryptedData.length, keys);<NEW_LINE>if (stream.remaining() >= 2) {<NEW_LINE>revision = stream.readUnsignedShort();<NEW_LINE>assert revision != -1;<NEW_LINE>}<NEW_LINE>data = decryptedData;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case CompressionType.BZ2:<NEW_LINE>{<NEW_LINE>byte[] encryptedData <MASK><NEW_LINE>stream.readBytes(encryptedData);<NEW_LINE>crc32.update(encryptedData, 0, encryptedData.length);<NEW_LINE>byte[] decryptedData = decrypt(encryptedData, encryptedData.length, keys);<NEW_LINE>if (stream.remaining() >= 2) {<NEW_LINE>revision = stream.readUnsignedShort();<NEW_LINE>assert revision != -1;<NEW_LINE>}<NEW_LINE>stream = new InputStream(decryptedData);<NEW_LINE>int decompressedLength = stream.readInt();<NEW_LINE>data = BZip2.decompress(stream.getRemaining(), compressedLength);<NEW_LINE>if (data == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>assert data.length == decompressedLength;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case CompressionType.GZ:<NEW_LINE>{<NEW_LINE>byte[] encryptedData = new byte[compressedLength + 4];<NEW_LINE>stream.readBytes(encryptedData);<NEW_LINE>crc32.update(encryptedData, 0, encryptedData.length);<NEW_LINE>byte[] decryptedData = decrypt(encryptedData, encryptedData.length, keys);<NEW_LINE>if (stream.remaining() >= 2) {<NEW_LINE>revision = stream.readUnsignedShort();<NEW_LINE>assert revision != -1;<NEW_LINE>}<NEW_LINE>stream = new InputStream(decryptedData);<NEW_LINE>int decompressedLength = stream.readInt();<NEW_LINE>data = GZip.decompress(stream.getRemaining(), compressedLength);<NEW_LINE>if (data == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>assert data.length == decompressedLength;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>throw new RuntimeException("Unknown decompression type");<NEW_LINE>}<NEW_LINE>Container container = new Container(compression, revision);<NEW_LINE>container.data = data;<NEW_LINE>container.crc = crc32.getHash();<NEW_LINE>return container;<NEW_LINE>}
= new byte[compressedLength + 4];
1,334,765
DepictedItem fromCursor(final Cursor cursor) {<NEW_LINE>final String fileName = cursor.getString(cursor.getColumnIndex(Table.COLUMN_NAME));<NEW_LINE>final String description = cursor.getString(cursor.getColumnIndex(Table.COLUMN_DESCRIPTION));<NEW_LINE>final String imageUrl = cursor.getString(cursor.getColumnIndex(Table.COLUMN_IMAGE));<NEW_LINE>final String instanceListString = cursor.getString(cursor.getColumnIndex(Table.COLUMN_INSTANCE_LIST));<NEW_LINE>final List<String> instanceList = StringToArray(instanceListString);<NEW_LINE>final String categoryNameListString = cursor.getString(cursor.getColumnIndex(Table.COLUMN_CATEGORIES_NAME_LIST));<NEW_LINE>final List<String> categoryNameList = StringToArray(categoryNameListString);<NEW_LINE>final String categoryDescriptionListString = cursor.getString(cursor<MASK><NEW_LINE>final List<String> categoryDescriptionList = StringToArray(categoryDescriptionListString);<NEW_LINE>final String categoryThumbnailListString = cursor.getString(cursor.getColumnIndex(Table.COLUMN_CATEGORIES_THUMBNAIL_LIST));<NEW_LINE>final List<String> categoryThumbnailList = StringToArray(categoryThumbnailListString);<NEW_LINE>final List<CategoryItem> categoryList = convertToCategoryItems(categoryNameList, categoryDescriptionList, categoryThumbnailList);<NEW_LINE>final boolean isSelected = Boolean.parseBoolean(cursor.getString(cursor.getColumnIndex(Table.COLUMN_IS_SELECTED)));<NEW_LINE>final String id = cursor.getString(cursor.getColumnIndex(Table.COLUMN_ID));<NEW_LINE>return new DepictedItem(fileName, description, imageUrl, instanceList, categoryList, isSelected, id);<NEW_LINE>}
.getColumnIndex(Table.COLUMN_CATEGORIES_DESCRIPTION_LIST));
998,258
private void createEdges(int origEdgeKey, int origRevEdgeKey, GHPoint3D prevSnapped, int prevWayIndex, boolean isPillar, GHPoint3D currSnapped, int wayIndex, PointList fullPL, EdgeIteratorState closestEdge, int prevNodeId, int nodeId) {<NEW_LINE>int max = wayIndex + 1;<NEW_LINE>PointList basePoints = new PointList(<MASK><NEW_LINE>basePoints.add(prevSnapped.lat, prevSnapped.lon, prevSnapped.ele);<NEW_LINE>for (int i = prevWayIndex; i < max; i++) {<NEW_LINE>basePoints.add(fullPL, i);<NEW_LINE>}<NEW_LINE>if (!isPillar) {<NEW_LINE>basePoints.add(currSnapped.lat, currSnapped.lon, currSnapped.ele);<NEW_LINE>}<NEW_LINE>// basePoints must have at least the size of 2 to make sure fetchWayGeometry(FetchMode.ALL) returns at least 2<NEW_LINE>assert basePoints.size() >= 2 : "basePoints must have at least two points";<NEW_LINE>PointList baseReversePoints = basePoints.clone(true);<NEW_LINE>double baseDistance = DistancePlaneProjection.DIST_PLANE.calcDistance(basePoints);<NEW_LINE>int virtEdgeId = firstVirtualEdgeId + queryOverlay.getNumVirtualEdges() / 2;<NEW_LINE>boolean reverse = closestEdge.get(EdgeIteratorState.REVERSE_STATE);<NEW_LINE>// edges between base and snapped point<NEW_LINE>VirtualEdgeIteratorState baseEdge = new VirtualEdgeIteratorState(origEdgeKey, GHUtility.createEdgeKey(virtEdgeId, false), prevNodeId, nodeId, baseDistance, closestEdge.getFlags(), closestEdge.getName(), basePoints, reverse);<NEW_LINE>VirtualEdgeIteratorState baseReverseEdge = new VirtualEdgeIteratorState(origRevEdgeKey, GHUtility.createEdgeKey(virtEdgeId, true), nodeId, prevNodeId, baseDistance, IntsRef.deepCopyOf(closestEdge.getFlags()), closestEdge.getName(), baseReversePoints, !reverse);<NEW_LINE>baseEdge.setReverseEdge(baseReverseEdge);<NEW_LINE>baseReverseEdge.setReverseEdge(baseEdge);<NEW_LINE>queryOverlay.addVirtualEdge(baseEdge);<NEW_LINE>queryOverlay.addVirtualEdge(baseReverseEdge);<NEW_LINE>}
max - prevWayIndex + 1, is3D);
1,435,668
public void ldapMatchingRuleInChain_MemberOf() throws Exception {<NEW_LINE>// This test will only be executed when using physical LDAP server as these type of filters are not supported on ApacheDS<NEW_LINE>Assume.assumeTrue(!LDAPUtils.USE_LOCAL_LDAP_SERVER);<NEW_LINE>Log.info(c, "ldapMatchingRuleInChain_MemberOf", "Checking memberof LDAP_MATCHING_RULE_IN_CHAIN rule OID.");<NEW_LINE>ServerConfiguration clone = serverConfiguration.clone();<NEW_LINE>clone.getLdapRegistries().get(0).setLdapCache(new LdapCache(new AttributesCache(false, null, null, null), new SearchResultsCache(false, null, null, null)));<NEW_LINE>LdapFilters filters = clone.getActivedLdapFilterProperties().get(0);<NEW_LINE>filters.setUserFilter("(&(sAMAccountName=%v)(objectclass=user))");<NEW_LINE>updateConfigDynamically(server, clone);<NEW_LINE>assertEquals("Expected to find user 'vmmuser1'.", 1, servlet.getUsers("vmmuser1", 0).<MASK><NEW_LINE>assertEquals("Expected to find user 'vmmuser2'.", 1, servlet.getUsers("vmmuser2", 0).getList().size());<NEW_LINE>assertEquals("Expected to find user 'vmmuser3'.", 1, servlet.getUsers("vmmuser3", 0).getList().size());<NEW_LINE>assertEquals("Expected to find user 'vmmuser4'.", 1, servlet.getUsers("vmmuser4", 0).getList().size());<NEW_LINE>assertNotNull("Authentication should succeed.", servlet.checkPassword("vmmtestuser", "vmmtestuserpwd"));<NEW_LINE>filters.setUserFilter("(&(sAMAccountName=%v)(objectclass=user)(memberof:1.2.840.113556.1.4.1941:=CN=vmmgroup4,CN=Users,DC=secfvt2,DC=austin,DC=ibm,DC=com))");<NEW_LINE>// TODO Remove when https://github.com/OpenLiberty/open-liberty/issues/657 is complete<NEW_LINE>clone.getLdapRegistries().get(0).setCertificateFilter("");<NEW_LINE>updateConfigDynamically(server, clone);<NEW_LINE>assertEquals("Expected to not find user 'vmmuser1'.", 0, servlet.getUsers("vmmuser1", 0).getList().size());<NEW_LINE>assertEquals("Expected to not find user 'vmmuser2'.", 0, servlet.getUsers("vmmuser2", 0).getList().size());<NEW_LINE>assertEquals("Expected to find user 'vmmuser3'.", 1, servlet.getUsers("vmmuser3", 0).getList().size());<NEW_LINE>assertEquals("Expected to find user 'vmmuser4'.", 1, servlet.getUsers("vmmuser4", 0).getList().size());<NEW_LINE>assertNotNull("Authentication should succeed.", servlet.checkPassword("vmmtestuser", "vmmtestuserpwd"));<NEW_LINE>}
getList().size());
181,753
public List<Offer> readOffersByAutomaticDeliveryType() {<NEW_LINE>CriteriaBuilder builder = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Offer> criteria = builder.createQuery(Offer.class);<NEW_LINE>Root<OfferImpl> root = criteria.from(OfferImpl.class);<NEW_LINE>criteria.select(root);<NEW_LINE>List<Predicate> restrictions = new ArrayList<>();<NEW_LINE>Date myDate = getCurrentDateAfterFactoringInDateResolution();<NEW_LINE>Calendar c = Calendar.getInstance();<NEW_LINE>c.setTime(myDate);<NEW_LINE>c.add(Calendar.DATE, +1);<NEW_LINE>restrictions.add(builder.lessThan(root.get("startDate"), c.getTime()));<NEW_LINE>c = Calendar.getInstance();<NEW_LINE>c.setTime(myDate);<NEW_LINE>c.add(Calendar.DATE, -1);<NEW_LINE>restrictions.add(builder.or(builder.isNull(root.get("endDate")), builder.greaterThan(root.get("endDate"), c.getTime())));<NEW_LINE>restrictions.add(builder.or(builder.equal(root.get("archiveStatus").get("archived"), 'N'), builder.isNull(root.get("archiveStatus").get("archived"))));<NEW_LINE>restrictions.add(builder.equal(root.<MASK><NEW_LINE>criteria.where(restrictions.toArray(new Predicate[restrictions.size()]));<NEW_LINE>TypedQuery<Offer> query = em.createQuery(criteria);<NEW_LINE>query.setHint(QueryHints.HINT_CACHEABLE, true);<NEW_LINE>query.setHint(QueryHints.HINT_CACHE_REGION, "query.Offer");<NEW_LINE>return query.getResultList();<NEW_LINE>}
get("automaticallyAdded"), true));
1,660,118
private void handleChildren() {<NEW_LINE>getGraph().removeAllChildren();<NEW_LINE>map = new HashMap();<NEW_LINE>Iterator it = getChildren().iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>TestNode tn = (TestNode) it.next();<NEW_LINE>SimpleNode sn = new SimpleNode();<NEW_LINE>getGraph().addChild(sn);<NEW_LINE>sn.setData(tn.getData());<NEW_LINE>sn.setChildren(tn.getChildren());<NEW_LINE>map.put(tn, sn);<NEW_LINE>}<NEW_LINE>Iterator it2 = getChildren().iterator();<NEW_LINE>while (it2.hasNext()) {<NEW_LINE>TestNode tn = <MASK><NEW_LINE>SimpleNode src = (SimpleNode) map.get(tn);<NEW_LINE>Iterator eIt = tn.getOutputs().iterator();<NEW_LINE>while (eIt.hasNext()) {<NEW_LINE>Object endTn = eIt.next();<NEW_LINE>SimpleNode tgt = (SimpleNode) map.get(endTn);<NEW_LINE>if (tgt != null) {<NEW_LINE>Edge e = new Edge(src, tgt);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(TestNode) it2.next();
620,200
public Result processWorkPackage(@NonNull final I_C_Queue_WorkPackage workpackage, final String localTrxName) {<NEW_LINE>trxManager.assertTrxNameNull(localTrxName);<NEW_LINE>final Properties ctx = InterfaceWrapperHelper.getCtx(workpackage);<NEW_LINE>final <MASK><NEW_LINE>Check.assume(adClientId > 0, "No point in calling this process with AD_Client_ID=0");<NEW_LINE>//<NEW_LINE>// Get parameters<NEW_LINE>final int maxInvoiceCandidatesToUpdate = getMaxInvoiceCandidatesToUpdate();<NEW_LINE>//<NEW_LINE>// Update invalid ICs<NEW_LINE>// Only those which are not locked at all<NEW_LINE>invoiceCandBL.updateInvalid().setContext(ctx, localTrxName).setLockedBy(ILock.NULL).setTaggedWithNoTag().setLimit(maxInvoiceCandidatesToUpdate).update();<NEW_LINE>//<NEW_LINE>// If we updated just a limited set of invoice candidates,<NEW_LINE>// then create a new workpackage to update the rest of them.<NEW_LINE>if (maxInvoiceCandidatesToUpdate > 0) {<NEW_LINE>final int countRemaining = invoiceCandDAO.tagToRecompute().setContext(ctx, localTrxName).setLockedBy(ILock.NULL).setTaggedWithNoTag().countToBeTagged();<NEW_LINE>if (countRemaining > 0) {<NEW_LINE>final AsyncBatchId asyncBatchId = AsyncBatchId.ofRepoIdOrNull(getC_Queue_WorkPackage().getC_Async_Batch_ID());<NEW_LINE>final IInvoiceCandUpdateSchedulerRequest request = InvoiceCandUpdateSchedulerRequest.of(ctx, localTrxName, asyncBatchId);<NEW_LINE>schedule(request);<NEW_LINE>Loggables.addLog("Scheduled another workpackage for {} remaining recompute records", countRemaining);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Result.SUCCESS;<NEW_LINE>}
int adClientId = workpackage.getAD_Client_ID();
537,088
/*<NEW_LINE>* Closes all clients. Waits for checked out clients to be checked in, then closes them too.<NEW_LINE>*/<NEW_LINE>@FFDCIgnore(value = { InterruptedException.class })<NEW_LINE>public void close() {<NEW_LINE>// remove all the clients from the deque, closing them as we go<NEW_LINE>while (numClientsClosed.get() < numClients) {<NEW_LINE>try {<NEW_LINE>Client client = clients.takeFirst();<NEW_LINE>try {<NEW_LINE>client.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>// Ignore this<NEW_LINE>}<NEW_LINE>numClientsClosed.incrementAndGet();<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())<NEW_LINE>Tr.event(tc, "pool closed - " + numClientsClosed + " of " + numClients + " clients closed");<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Tr.event(tc, "InterruptedException during close - will retry");
697,453
public io.kubernetes.client.proto.V1.ServiceAccountList buildPartial() {<NEW_LINE>io.kubernetes.client.proto.V1.ServiceAccountList result = new io.kubernetes.client.proto.V1.ServiceAccountList(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((from_bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>if (metadataBuilder_ == null) {<NEW_LINE>result.metadata_ = metadata_;<NEW_LINE>} else {<NEW_LINE>result<MASK><NEW_LINE>}<NEW_LINE>if (itemsBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>items_ = java.util.Collections.unmodifiableList(items_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>}<NEW_LINE>result.items_ = items_;<NEW_LINE>} else {<NEW_LINE>result.items_ = itemsBuilder_.build();<NEW_LINE>}<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>}
.metadata_ = metadataBuilder_.build();
1,566,714
public void Adjust(Date period) {<NEW_LINE>Date end = new Date(period.getTime() + TimeHelper.ONE_HOUR);<NEW_LINE>RouterConfig routerConfig = m_routerService.queryLastReport(Constants.CAT);<NEW_LINE>StateReport report = m_stateReportService.queryHourlyReport(Constants.CAT, period, end);<NEW_LINE>String remoteServers = m_serverConfigManager.getConsoleRemoteServers();<NEW_LINE>List<String> servers = Splitters.by(",").noEmptyItem().split(remoteServers);<NEW_LINE>AdjustStateReportVisitor visitor = new AdjustStateReportVisitor(m_configManager, servers);<NEW_LINE>visitor.visitStateReport(report);<NEW_LINE>Map<String, Map<String, Machine>> statistics = visitor.getStatistics();<NEW_LINE>Map<String, Map<Server, Long<MASK><NEW_LINE>Map<String, Map<String, Server>> results = buildAdjustServers(gaps, routerConfig, statistics);<NEW_LINE>updateRouterConfig(routerConfig, results);<NEW_LINE>updateRouterConfigToDB(routerConfig);<NEW_LINE>}
>> gaps = buildGroupServersGaps(statistics);
1,665,370
private void browsePressed() {<NEW_LINE>JFileChooser chooser = FileChooserFactory.getPkcs8FileChooser();<NEW_LINE>File currentExportFile = new File(jtfExportFile.getText().trim());<NEW_LINE>if ((currentExportFile.getParentFile() != null) && (currentExportFile.getParentFile().exists())) {<NEW_LINE>chooser.setCurrentDirectory(currentExportFile.getParentFile());<NEW_LINE>chooser.setSelectedFile(currentExportFile);<NEW_LINE>} else {<NEW_LINE>chooser.setCurrentDirectory(CurrentDirectory.get());<NEW_LINE>}<NEW_LINE>chooser.setDialogTitle<MASK><NEW_LINE>chooser.setMultiSelectionEnabled(false);<NEW_LINE>int rtnValue = JavaFXFileChooser.isFxAvailable() ? chooser.showSaveDialog(this) : chooser.showDialog(this, res.getString("DExportPrivateKeyPkcs8.ChooseExportFile.button"));<NEW_LINE>if (rtnValue == JFileChooser.APPROVE_OPTION) {<NEW_LINE>File chosenFile = chooser.getSelectedFile();<NEW_LINE>CurrentDirectory.updateForFile(chosenFile);<NEW_LINE>jtfExportFile.setText(chosenFile.toString());<NEW_LINE>jtfExportFile.setCaretPosition(0);<NEW_LINE>}<NEW_LINE>}
(res.getString("DExportPrivateKeyPkcs8.ChooseExportFile.Title"));
346,181
public void onDrawOver(@NonNull Canvas c, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {<NEW_LINE>super.<MASK><NEW_LINE>RecyclerView.Adapter adapter = parent.getAdapter();<NEW_LINE>RecyclerView.LayoutManager layoutManager = parent.getLayoutManager();<NEW_LINE>if (adapter == null || layoutManager == null || mSeparatorAttr == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < parent.getChildCount(); i++) {<NEW_LINE>View view = parent.getChildAt(i);<NEW_LINE>int position = parent.getChildAdapterPosition(view);<NEW_LINE>if (view instanceof QMUIBottomSheetListItemView) {<NEW_LINE>if (position > 0 && adapter.getItemViewType(position - 1) != QMUIBottomSheetListAdapter.ITEM_TYPE_NORMAL) {<NEW_LINE>int top = layoutManager.getDecoratedTop(view);<NEW_LINE>c.drawLine(0, top, parent.getWidth(), top, mSeparatorPaint);<NEW_LINE>}<NEW_LINE>if (position + 1 < adapter.getItemCount() && adapter.getItemViewType(position + 1) == QMUIBottomSheetListAdapter.ITEM_TYPE_NORMAL) {<NEW_LINE>int bottom = layoutManager.getDecoratedBottom(view);<NEW_LINE>c.drawLine(0, bottom, parent.getWidth(), bottom, mSeparatorPaint);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
onDrawOver(c, parent, state);
1,071,791
public static void allInsideLeft(CameraPinholeBrown paramLeft, DMatrixRMaj rectifyLeft, DMatrixRMaj rectifyRight, DMatrixRMaj rectifyK, ImageDimension rectifiedSize) {<NEW_LINE>// need to take in account the order in which image distort will remove rectification later on<NEW_LINE>paramLeft = new CameraPinholeBrown(paramLeft);<NEW_LINE>Point2Transform2_F64 tranLeft = transformPixelToRect(paramLeft, rectifyLeft);<NEW_LINE>Point2D_F64 work = new Point2D_F64();<NEW_LINE>RectangleLength2D_F64 bound = LensDistortionOps_F64.boundBoxInside(paramLeft.width, paramLeft.height, new PointToPixelTransform_F64(tranLeft), work);<NEW_LINE>LensDistortionOps_F64.roundInside(bound);<NEW_LINE>// Select scale to maintain the same number of pixels<NEW_LINE>double scale = Math.sqrt((paramLeft.width * paramLeft.height) / (bound<MASK><NEW_LINE>rectifiedSize.width = (int) (scale * bound.width + 0.5);<NEW_LINE>rectifiedSize.height = (int) (scale * bound.height + 0.5);<NEW_LINE>adjustCalibrated(rectifyLeft, rectifyRight, rectifyK, bound, scale);<NEW_LINE>}
.width * bound.height));
1,369,057
// ~ Methods ----------------------------------------------------------------<NEW_LINE>public void onMatch(RelOptRuleCall call) {<NEW_LINE>final Intersect intersect = call.rel(0);<NEW_LINE>if (intersect.all) {<NEW_LINE>// nothing we can do<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final RelOptCluster cluster = intersect.getCluster();<NEW_LINE>final RexBuilder rexBuilder = cluster.getRexBuilder();<NEW_LINE>final RelBuilder relBuilder = call.builder();<NEW_LINE>// 1st level GB: create a GB (col0, col1, count() as c) for each branch<NEW_LINE>for (RelNode input : intersect.getInputs()) {<NEW_LINE>relBuilder.push(input);<NEW_LINE>relBuilder.aggregate(relBuilder.groupKey(relBuilder.fields()), relBuilder.countStar(null));<NEW_LINE>}<NEW_LINE>// create a union above all the branches<NEW_LINE>final int branchCount = intersect<MASK><NEW_LINE>relBuilder.union(true, branchCount);<NEW_LINE>final RelNode union = relBuilder.peek();<NEW_LINE>// 2nd level GB: create a GB (col0, col1, count(c)) for each branch<NEW_LINE>// the index of c is union.getRowType().getFieldList().size() - 1<NEW_LINE>final int fieldCount = union.getRowType().getFieldCount();<NEW_LINE>final ImmutableBitSet groupSet = ImmutableBitSet.range(fieldCount - 1);<NEW_LINE>relBuilder.aggregate(relBuilder.groupKey(groupSet), relBuilder.countStar(null));<NEW_LINE>// add a filter count(c) = #branches<NEW_LINE>relBuilder.filter(relBuilder.equals(relBuilder.field(fieldCount - 1), rexBuilder.makeBigintLiteral(new BigDecimal(branchCount))));<NEW_LINE>// Project all but the last field<NEW_LINE>relBuilder.project(Util.skipLast(relBuilder.fields()));<NEW_LINE>// the schema for intersect distinct is like this<NEW_LINE>// R3 on all attributes + count(c) as cnt<NEW_LINE>// finally add a project to project out the last column<NEW_LINE>call.transformTo(relBuilder.build());<NEW_LINE>}
.getInputs().size();
743,558
public void onBookClicked(long bookId) {<NEW_LINE>if (action == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!action.equals(Intent.ACTION_CREATE_SHORTCUT)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Book book = dataRepository.getBook(bookId);<NEW_LINE>if (book == null) {<NEW_LINE>Toast.makeText(this, R.string.book_does_not_exist_anymore, <MASK><NEW_LINE>setResult(RESULT_CANCELED);<NEW_LINE>finish();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String id = "template-" + bookId;<NEW_LINE>String name = book.getName();<NEW_LINE>String title = BookUtils.getFragmentTitleForBook(book);<NEW_LINE>Intent launchIntent = ShareActivity.createNewNoteInNotebookIntent(this, bookId);<NEW_LINE>IconCompat icon = createIcon();<NEW_LINE>ShortcutInfoCompat shortcut = new ShortcutInfoCompat.Builder(this, id).setShortLabel(name).setLongLabel(title).setIcon(icon).setIntent(launchIntent).build();<NEW_LINE>setResult(RESULT_OK, ShortcutManagerCompat.createShortcutResultIntent(this, shortcut));<NEW_LINE>finish();<NEW_LINE>}
Toast.LENGTH_SHORT).show();
1,500,520
public void listStatusTest() throws IOException {<NEW_LINE>String testDirNonEmpty = <MASK><NEW_LINE>String testDirNonEmptyChildDir = PathUtils.concatPath(testDirNonEmpty, "testDirNonEmpty2");<NEW_LINE>String testDirNonEmptyChildFile = PathUtils.concatPath(testDirNonEmpty, "testDirNonEmptyF");<NEW_LINE>String testDirNonEmptyChildDirFile = PathUtils.concatPath(testDirNonEmptyChildDir, "testDirNonEmptyChildDirF");<NEW_LINE>mUfs.mkdirs(testDirNonEmpty, MkdirsOptions.defaults(mConfiguration).setCreateParent(false));<NEW_LINE>mUfs.mkdirs(testDirNonEmptyChildDir, MkdirsOptions.defaults(mConfiguration).setCreateParent(false));<NEW_LINE>createEmptyFile(testDirNonEmptyChildFile);<NEW_LINE>createEmptyFile(testDirNonEmptyChildDirFile);<NEW_LINE>String[] expectedResTopDir = new String[] { "testDirNonEmpty2", "testDirNonEmptyF" };<NEW_LINE>// Some file systems may prefix with a slash<NEW_LINE>String[] expectedResTopDir2 = new String[] { "/testDirNonEmpty2", "/testDirNonEmptyF" };<NEW_LINE>Arrays.sort(expectedResTopDir);<NEW_LINE>Arrays.sort(expectedResTopDir2);<NEW_LINE>UfsStatus[] resTopDirStatus = mUfs.listStatus(testDirNonEmpty);<NEW_LINE>String[] resTopDir = UfsStatus.convertToNames(resTopDirStatus);<NEW_LINE>Arrays.sort(resTopDir);<NEW_LINE>if (!Arrays.equals(expectedResTopDir, resTopDir) && !Arrays.equals(expectedResTopDir2, resTopDir)) {<NEW_LINE>throw new IOException(LIST_STATUS_RESULT_INCORRECT);<NEW_LINE>}<NEW_LINE>if (!mUfs.listStatus(testDirNonEmptyChildDir)[0].getName().equals("testDirNonEmptyChildDirF") || mUfs.listStatus(testDirNonEmptyChildDir)[0].getName().equals("/testDirNonEmptyChildDirF")) {<NEW_LINE>throw new IOException(LIST_STATUS_RESULT_INCORRECT);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < resTopDir.length; ++i) {<NEW_LINE>if (mUfs.isDirectory(PathUtils.concatPath(testDirNonEmpty, resTopDirStatus[i].getName())) != resTopDirStatus[i].isDirectory()) {<NEW_LINE>throw new IOException("UnderFileSystem.isDirectory() result is different from expected");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
PathUtils.concatPath(mTopLevelTestDirectory, "testDirNonEmpty1");
1,476,988
public void drawConnection(int[] xPoints, int[] yPoints, String connectionType, double scaleFactor) {<NEW_LINE>Paint originalPaint = g.getPaint();<NEW_LINE>Stroke originalStroke = g.getStroke();<NEW_LINE>g.setPaint(CONNECTION_COLOR);<NEW_LINE>for (int i = 1; i < xPoints.length; i++) {<NEW_LINE>int <MASK><NEW_LINE>int sourceY = yPoints[i - 1];<NEW_LINE>int targetX = xPoints[i];<NEW_LINE>int targetY = yPoints[i];<NEW_LINE>Line2D.Double line = new Line2D.Double(sourceX, sourceY, targetX, targetY);<NEW_LINE>g.draw(line);<NEW_LINE>}<NEW_LINE>Line2D.Double line = new Line2D.Double(xPoints[xPoints.length - 2], yPoints[xPoints.length - 2], xPoints[xPoints.length - 1], yPoints[xPoints.length - 1]);<NEW_LINE>drawArrowHead(line, scaleFactor);<NEW_LINE>g.setPaint(originalPaint);<NEW_LINE>g.setStroke(originalStroke);<NEW_LINE>}
sourceX = xPoints[i - 1];
621,441
public void write(org.apache.thrift.protocol.TProtocol prot, create_app_options struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet optionals = new java.util.BitSet();<NEW_LINE>if (struct.isSetPartition_count()) {<NEW_LINE>optionals.set(0);<NEW_LINE>}<NEW_LINE>if (struct.isSetReplica_count()) {<NEW_LINE>optionals.set(1);<NEW_LINE>}<NEW_LINE>if (struct.isSetSuccess_if_exist()) {<NEW_LINE>optionals.set(2);<NEW_LINE>}<NEW_LINE>if (struct.isSetApp_type()) {<NEW_LINE>optionals.set(3);<NEW_LINE>}<NEW_LINE>if (struct.isSetIs_stateful()) {<NEW_LINE>optionals.set(4);<NEW_LINE>}<NEW_LINE>if (struct.isSetEnvs()) {<NEW_LINE>optionals.set(5);<NEW_LINE>}<NEW_LINE>oprot.writeBitSet(optionals, 6);<NEW_LINE>if (struct.isSetPartition_count()) {<NEW_LINE>oprot.writeI32(struct.partition_count);<NEW_LINE>}<NEW_LINE>if (struct.isSetReplica_count()) {<NEW_LINE>oprot.writeI32(struct.replica_count);<NEW_LINE>}<NEW_LINE>if (struct.isSetSuccess_if_exist()) {<NEW_LINE>oprot.writeBool(struct.success_if_exist);<NEW_LINE>}<NEW_LINE>if (struct.isSetApp_type()) {<NEW_LINE>oprot.writeString(struct.app_type);<NEW_LINE>}<NEW_LINE>if (struct.isSetIs_stateful()) {<NEW_LINE>oprot.writeBool(struct.is_stateful);<NEW_LINE>}<NEW_LINE>if (struct.isSetEnvs()) {<NEW_LINE>{<NEW_LINE>oprot.writeI32(<MASK><NEW_LINE>for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter5 : struct.envs.entrySet()) {<NEW_LINE>oprot.writeString(_iter5.getKey());<NEW_LINE>oprot.writeString(_iter5.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
struct.envs.size());
132,309
public RPReply _process(RPRequest request) {<NEW_LINE>String method = request.getMethod();<NEW_LINE>if (method.equals("getPluginProperties")) {<NEW_LINE>// must copy properties as actual return is subtype + non serialisable<NEW_LINE>Properties p = new Properties();<NEW_LINE>Properties x = delegate.getPluginProperties();<NEW_LINE>Iterator it = x.keySet().iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>Object key = it.next();<NEW_LINE>p.put(key, x.get(key));<NEW_LINE>}<NEW_LINE>return (new RPReply(p));<NEW_LINE>} else if (method.equals("getDownloadManager")) {<NEW_LINE>return (new RPReply(RPDownloadManager.create(delegate.getDownloadManager())));<NEW_LINE>} else if (method.equals("getTorrentManager")) {<NEW_LINE>return (new RPReply(RPTorrentManager.create(delegate.getTorrentManager())));<NEW_LINE>} else if (method.equals("getPluginconfig")) {<NEW_LINE>return (new RPReply(RPPluginConfig.create(delegate.getPluginconfig())));<NEW_LINE>} else if (method.equals("getIPFilter")) {<NEW_LINE>return (new RPReply(RPIPFilter.create(delegate.getIPFilter())));<NEW_LINE>} else if (method.equals("getShortCuts")) {<NEW_LINE>return (new RPReply(RPShortCuts.create(<MASK><NEW_LINE>} else if (method.equals("getTracker")) {<NEW_LINE>return (new RPReply(RPTracker.create(delegate.getTracker())));<NEW_LINE>}<NEW_LINE>throw (new RPException("Unknown method: " + method));<NEW_LINE>}
delegate.getShortCuts())));
1,071,173
public static byte[] injectPayload(byte[] origin, byte[] payload, boolean noXor, PrintStream out) {<NEW_LINE>byte[] chunk = noXor ? createChunk(payload, 0) : createChunk(payload);<NEW_LINE>byte[] result = new byte[origin.length + chunk.length + 4];<NEW_LINE>System.arraycopy(origin, 0, result, 0, origin.length);<NEW_LINE>System.arraycopy(chunk, 0, result, origin.length, chunk.length);<NEW_LINE>writeLe32(result, origin.length + chunk.length, chunk.length + 4);<NEW_LINE>writeLe32(result, 32, result.length);<NEW_LINE>out.printf("I Dex size is 0x%x(%d)\n", result.length, result.length);<NEW_LINE>MessageDigest md;<NEW_LINE>try {<NEW_LINE>md = MessageDigest.getInstance("SHA-1");<NEW_LINE>} catch (NoSuchAlgorithmException ex) {<NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>}<NEW_LINE>md.update(result, 32, result.length - 32);<NEW_LINE>byte[] signature = md.digest();<NEW_LINE>if (signature.length != kSHA1DigestLen) {<NEW_LINE>throw new RuntimeException(<MASK><NEW_LINE>}<NEW_LINE>System.arraycopy(signature, 0, result, 12, 20);<NEW_LINE>out.println("I SHA1 sig: " + HexUtils.byteArrayToString(signature));<NEW_LINE>Adler32 adler32 = new Adler32();<NEW_LINE>adler32.update(result, 12, result.length - 12);<NEW_LINE>int a32 = (int) adler32.getValue();<NEW_LINE>writeLe32(result, 8, a32);<NEW_LINE>out.printf("I Dex Adler32 checksum: %08x\n", a32);<NEW_LINE>return result;<NEW_LINE>}
"unexpected digest write: " + signature.length + " bytes");
1,515,108
public static int wavelengthToRGB(float wavelength) {<NEW_LINE>float gamma = 0.80f;<NEW_LINE>float r, g, b, factor;<NEW_LINE>int w = (int) wavelength;<NEW_LINE>if (w < 380) {<NEW_LINE>r = 0.0f;<NEW_LINE>g = 0.0f;<NEW_LINE>b = 0.0f;<NEW_LINE>} else if (w < 440) {<NEW_LINE>r = -(wavelength - <MASK><NEW_LINE>g = 0.0f;<NEW_LINE>b = 1.0f;<NEW_LINE>} else if (w < 490) {<NEW_LINE>r = 0.0f;<NEW_LINE>g = (wavelength - 440) / (490 - 440);<NEW_LINE>b = 1.0f;<NEW_LINE>} else if (w < 510) {<NEW_LINE>r = 0.0f;<NEW_LINE>g = 1.0f;<NEW_LINE>b = -(wavelength - 510) / (510 - 490);<NEW_LINE>} else if (w < 580) {<NEW_LINE>r = (wavelength - 510) / (580 - 510);<NEW_LINE>g = 1.0f;<NEW_LINE>b = 0.0f;<NEW_LINE>} else if (w < 645) {<NEW_LINE>r = 1.0f;<NEW_LINE>g = -(wavelength - 645) / (645 - 580);<NEW_LINE>b = 0.0f;<NEW_LINE>} else if (w <= 780) {<NEW_LINE>r = 1.0f;<NEW_LINE>g = 0.0f;<NEW_LINE>b = 0.0f;<NEW_LINE>} else {<NEW_LINE>r = 0.0f;<NEW_LINE>g = 0.0f;<NEW_LINE>b = 0.0f;<NEW_LINE>}<NEW_LINE>// Let the intensity fall off near the vision limits<NEW_LINE>if (380 <= w && w <= 419)<NEW_LINE>factor = 0.3f + 0.7f * (wavelength - 380) / (420 - 380);<NEW_LINE>else if (420 <= w && w <= 700)<NEW_LINE>factor = 1.0f;<NEW_LINE>else if (701 <= w && w <= 780)<NEW_LINE>factor = 0.3f + 0.7f * (780 - wavelength) / (780 - 700);<NEW_LINE>else<NEW_LINE>factor = 0.0f;<NEW_LINE>int ir = adjust(r, factor, gamma);<NEW_LINE>int ig = adjust(g, factor, gamma);<NEW_LINE>int ib = adjust(b, factor, gamma);<NEW_LINE>return 0xff000000 | (ir << 16) | (ig << 8) | ib;<NEW_LINE>}
440) / (440 - 380);
499,107
public static boolean writeMapExceptionExtensions(List<MapExceptionEntry> mapExceptionList, boolean didWriteExtensionStartElement, XMLStreamWriter xtw) throws Exception {<NEW_LINE>for (MapExceptionEntry mapException : mapExceptionList) {<NEW_LINE>if (!didWriteExtensionStartElement) {<NEW_LINE>xtw.writeStartElement(ELEMENT_EXTENSIONS);<NEW_LINE>didWriteExtensionStartElement = true;<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(mapException.getErrorCode())) {<NEW_LINE>xtw.writeStartElement(FLOWABLE_EXTENSIONS_PREFIX, MAP_EXCEPTION, FLOWABLE_EXTENSIONS_NAMESPACE);<NEW_LINE>BpmnXMLUtil.writeDefaultAttribute(MAP_EXCEPTION_ERRORCODE, <MASK><NEW_LINE>BpmnXMLUtil.writeDefaultAttribute(MAP_EXCEPTION_ANDCHILDREN, Boolean.toString(mapException.isAndChildren()), xtw);<NEW_LINE>BpmnXMLUtil.writeDefaultAttribute(MAP_EXCEPTION_ROOTCAUSE, mapException.getRootCause(), xtw);<NEW_LINE>if (StringUtils.isNotEmpty(mapException.getClassName())) {<NEW_LINE>xtw.writeCData(mapException.getClassName());<NEW_LINE>}<NEW_LINE>// end flowable:mapException<NEW_LINE>xtw.writeEndElement();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return didWriteExtensionStartElement;<NEW_LINE>}
mapException.getErrorCode(), xtw);
652,409
final DeleteAccountAliasResult executeDeleteAccountAlias(DeleteAccountAliasRequest deleteAccountAliasRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteAccountAliasRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteAccountAliasRequest> request = null;<NEW_LINE>Response<DeleteAccountAliasResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteAccountAliasRequestMarshaller().marshall(super.beforeMarshalling(deleteAccountAliasRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteAccountAlias");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeleteAccountAliasResult> responseHandler = new StaxResponseHandler<DeleteAccountAliasResult>(new DeleteAccountAliasResultStaxUnmarshaller());<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.SERVICE_ID, "IAM");
1,790,698
public void apply(final double[] src, int srcPos, double[] target, int targetPos, int off, int len) {<NEW_LINE>if (len < 0 || off < 0 || off + len > window.length)<NEW_LINE>throw new IllegalArgumentException("Requested offset " + off + " or length " + len + " does not fit into window length " + window.length);<NEW_LINE>if (target.length < targetPos + len)<NEW_LINE>throw new IllegalArgumentException("Target array cannot hold enough data");<NEW_LINE>// actual positions in src to apply the window to.<NEW_LINE>int start, end;<NEW_LINE>// If these deviate from srcPos and srcPos+len, resp., zeroes need to be pre-/appended.<NEW_LINE>start = srcPos;<NEW_LINE>if (start < 0) {<NEW_LINE>start = 0;<NEW_LINE>Arrays.fill(target, targetPos, targetPos + (start - srcPos), 0);<NEW_LINE>}<NEW_LINE>end = srcPos + len;<NEW_LINE>if (end > src.length) {<NEW_LINE>end = src.length;<NEW_LINE>Arrays.fill(target, targetPos + end - <MASK><NEW_LINE>}<NEW_LINE>for (int i = start; i < end; i++) {<NEW_LINE>target[targetPos + i - srcPos] = src[i] * window[off + i - srcPos];<NEW_LINE>}<NEW_LINE>}
srcPos, targetPos + len, 0);
410,606
public void after(Object target, Object[] args, Object result, Throwable throwable) {<NEW_LINE>if (isDebug) {<NEW_LINE>logger.afterInterceptor(target, args, result, throwable);<NEW_LINE>}<NEW_LINE>if (args == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DatabaseInfo databaseInfo = DatabaseInfoUtils.getDatabaseInfo(target, UnKnownDatabaseInfo.MONGO_INSTANCE);<NEW_LINE>databaseInfo = new MongoDatabaseInfo(databaseInfo.getType(), databaseInfo.getExecuteQueryType(), null, null, databaseInfo.getHost(), databaseInfo.getDatabaseId(), args[0].toString(), ((MongoDatabaseInfo) databaseInfo).getReadPreference(), ((MongoDatabaseInfo) databaseInfo).getWriteConcern());<NEW_LINE>if (isDebug) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (result instanceof DatabaseInfoAccessor) {<NEW_LINE>((DatabaseInfoAccessor) result)._$PINPOINT$_setDatabaseInfo(databaseInfo);<NEW_LINE>}<NEW_LINE>}
logger.debug("parse DatabaseInfo:{}", databaseInfo);
106,784
public void service(HttpRequest request, HttpResponse response) throws Exception {<NEW_LINE>JsonParser parser = new JsonParser();<NEW_LINE>Gson gson = new GsonBuilder().create();<NEW_LINE>JsonObject parsedRequest = gson.fromJson(request.<MASK><NEW_LINE>// For more information on the structure of this object https://cloud.google.com/dialogflow/cx/docs/reference/rest/v3/Fulfillment<NEW_LINE>String requestTag = parsedRequest.getAsJsonObject("fulfillmentInfo").getAsJsonPrimitive("tag").toString();<NEW_LINE>JsonObject responseObject = null;<NEW_LINE>String defaultIntent = "\"Default Welcome Intent\"";<NEW_LINE>String secondIntent = "\"get-agent-name\"";<NEW_LINE>String responseText = "";<NEW_LINE>// Compares the Intent Tag to provide the correct response<NEW_LINE>if (requestTag.equals(defaultIntent)) {<NEW_LINE>responseText = "\"Hello from a Java GCF Webhook\"";<NEW_LINE>} else if (requestTag.equals(secondIntent)) {<NEW_LINE>responseText = "\"My name is Flowhook\"";<NEW_LINE>} else {<NEW_LINE>responseText = "\"Sorry I didn't get that\"";<NEW_LINE>}<NEW_LINE>// Constructing the response jsonObject<NEW_LINE>responseObject = parser.parse("{ \"fulfillment_response\": { \"messages\": [ { \"text\": { \"text\": [" + responseText + "] } } ] } }").getAsJsonObject();<NEW_LINE>BufferedWriter writer = response.getWriter();<NEW_LINE>// Sends the responseObject<NEW_LINE>writer.write(responseObject.toString());<NEW_LINE>}
getReader(), JsonObject.class);
653,105
public void prepare(PreparedStatement statement) throws SQLException {<NEW_LINE>statement.setString(1, information.getName());<NEW_LINE>statement.setString(2, information.getTableColor().name());<NEW_LINE>setStringOrNull(statement, 3, columns[0]);<NEW_LINE>setStringOrNull(statement, 4, columns[1]);<NEW_LINE>setStringOrNull(statement, 5, columns[2]);<NEW_LINE>setStringOrNull(statement, 6, columns[3]);<NEW_LINE>setStringOrNull(statement, 7, columns[4]);<NEW_LINE>setStringOrNull(statement, 8, information.getCondition().orElse(null));<NEW_LINE>ExtensionTabTable.set3TabValuesToStatement(statement, 9, information.getTab().orElse("No Tab"), information.getPluginName(), serverUUID);<NEW_LINE>ExtensionPluginTable.set2PluginValuesToStatement(statement, 12, information.getPluginName(), serverUUID);<NEW_LINE>ExtensionIconTable.set3IconValuesToStatement(statement, 14, icons[0]);<NEW_LINE>ExtensionIconTable.set3IconValuesToStatement(statement, 17, icons[1]);<NEW_LINE>ExtensionIconTable.set3IconValuesToStatement(statement<MASK><NEW_LINE>ExtensionIconTable.set3IconValuesToStatement(statement, 23, icons[3]);<NEW_LINE>ExtensionIconTable.set3IconValuesToStatement(statement, 26, icons[4]);<NEW_LINE>setStringOrNull(statement, 29, formats[0] == TableColumnFormat.NONE ? null : formats[0].name());<NEW_LINE>setStringOrNull(statement, 30, formats[1] == TableColumnFormat.NONE ? null : formats[1].name());<NEW_LINE>setStringOrNull(statement, 31, formats[2] == TableColumnFormat.NONE ? null : formats[2].name());<NEW_LINE>setStringOrNull(statement, 32, formats[3] == TableColumnFormat.NONE ? null : formats[3].name());<NEW_LINE>setStringOrNull(statement, 33, formats[4] == TableColumnFormat.NONE ? null : formats[4].name());<NEW_LINE>statement.setInt(34, forPlayer ? VALUES_FOR_PLAYER : VALUES_FOR_SERVER);<NEW_LINE>}
, 20, icons[2]);
991,432
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.scan_roms_activity);<NEW_LINE>if (NativeExports.SettingsLoadBool(SettingsID.RomList_GameDirUseSelected.getValue())) {<NEW_LINE>File CurrentPath = new File(NativeExports.SettingsLoadString(SettingsID.RomList_GameDir.getValue()));<NEW_LINE>if (CurrentPath.exists() && CurrentPath.isDirectory()) {<NEW_LINE>mCurrentPath = CurrentPath;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>TextView selectDir = (TextView) findViewById(R.id.scanRomsDialog_selectDir);<NEW_LINE>selectDir.setText(Strings<MASK><NEW_LINE>// Set check box state<NEW_LINE>mScanRecursively = (CheckBox) findViewById(R.id.ScanRecursively);<NEW_LINE>mScanRecursively.setChecked(NativeExports.SettingsLoadBool(SettingsID.RomList_GameDirRecursive.getValue()));<NEW_LINE>mScanRecursively.setText(Strings.GetString(LanguageStringID.ANDROID_INCLUDE_SUBDIRECTORIES));<NEW_LINE>mCancelButton = (Button) findViewById(R.id.buttonCancel);<NEW_LINE>mCancelButton.setText(Strings.GetString(LanguageStringID.ANDROID_CANCEL));<NEW_LINE>mCancelButton.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>public void onClick(View v) {<NEW_LINE>ScanRomsActivity.this.setResult(RESULT_CANCELED, null);<NEW_LINE>ScanRomsActivity.this.finish();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mOkButton = (Button) findViewById(R.id.buttonOk);<NEW_LINE>mOkButton.setText(Strings.GetString(LanguageStringID.ANDROID_OK));<NEW_LINE>mOkButton.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>public void onClick(View v) {<NEW_LINE>Intent data = new Intent();<NEW_LINE>data.putExtra(GAME_DIR_PATH, mCurrentPath.getPath());<NEW_LINE>data.putExtra(GAME_DIR_RECURSIVELY, mScanRecursively.isChecked());<NEW_LINE>ScanRomsActivity.this.setResult(RESULT_OK, data);<NEW_LINE>ScanRomsActivity.this.finish();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>PopulateFileList();<NEW_LINE>}
.GetString(LanguageStringID.ANDROID_SELECTDIR));
813,327
// gadgetBytes will be null only if gadget_ == null AND empty == true<NEW_LINE>@SuppressWarnings("null")<NEW_LINE>public byte[] toByteArray() {<NEW_LINE>final int preLongs, outBytes;<NEW_LINE>final boolean empty = gadget_ == null;<NEW_LINE>final byte[] gadgetBytes = (gadget_ != null ? gadget_.toByteArray() : null);<NEW_LINE>if (empty) {<NEW_LINE>preLongs = Family.RESERVOIR_UNION.getMinPreLongs();<NEW_LINE>outBytes = 8;<NEW_LINE>} else {<NEW_LINE>preLongs = Family.RESERVOIR_UNION.getMaxPreLongs();<NEW_LINE>// longs, so we know the size<NEW_LINE>outBytes = (preLongs << 3) + gadgetBytes.length;<NEW_LINE>}<NEW_LINE>final byte[] outArr = new byte[outBytes];<NEW_LINE>final WritableMemory mem = WritableMemory.writableWrap(outArr);<NEW_LINE>// construct header<NEW_LINE>// Byte 0<NEW_LINE>PreambleUtil.insertPreLongs(mem, preLongs);<NEW_LINE>// Byte 1<NEW_LINE>PreambleUtil.insertSerVer(mem, SER_VER);<NEW_LINE>// Byte 2<NEW_LINE>PreambleUtil.insertFamilyID(mem, Family.RESERVOIR_UNION.getID());<NEW_LINE>if (empty) {<NEW_LINE>// Byte 3<NEW_LINE>PreambleUtil.insertFlags(mem, EMPTY_FLAG_MASK);<NEW_LINE>} else {<NEW_LINE>PreambleUtil.insertFlags(mem, 0);<NEW_LINE>}<NEW_LINE>// Bytes 4-7<NEW_LINE>PreambleUtil.insertMaxK(mem, maxK_);<NEW_LINE>if (!empty) {<NEW_LINE>final int preBytes = preLongs << 3;<NEW_LINE>mem.putByteArray(preBytes, <MASK><NEW_LINE>}<NEW_LINE>return outArr;<NEW_LINE>}
gadgetBytes, 0, gadgetBytes.length);
745,230
public Pair<Boolean, String> executeRule(double[] values, double[] baselines, String rawValue) {<NEW_LINE>MonitorRule instance = m_rules.get(rawValue);<NEW_LINE>if (instance == null) {<NEW_LINE>try {<NEW_LINE>Pair<File, File> files = generateClassFile(rawValue);<NEW_LINE>File userDefinedFolder = files.getKey();<NEW_LINE>File userDefinedClassFile = files.getValue();<NEW_LINE>JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();<NEW_LINE>compiler.run(null, null, null, userDefinedClassFile.getPath());<NEW_LINE>URLClassLoader classLoader = URLClassLoader.newInstance(new URL[] { userDefinedFolder.toURI().toURL() });<NEW_LINE>Class<?> cls = Class.forName("UserDefinedRule", true, classLoader);<NEW_LINE>instance = <MASK><NEW_LINE>m_rules.put(rawValue, instance);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Cat.logError("generate user defined rule error: " + rawValue, e);<NEW_LINE>return new Pair<Boolean, String>(false, "");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return instance.checkData(values, baselines);<NEW_LINE>}
(MonitorRule) cls.newInstance();
1,150,769
private String generateBetween(@NonNull Criteria criteria, @NonNull List<Pair<String, Object>> parameters, int counter) {<NEW_LINE>final String subject = criteria.getSubject();<NEW_LINE>final Object value1 = toCosmosDbValue(criteria.getSubjectValues<MASK><NEW_LINE>final Object value2 = toCosmosDbValue(criteria.getSubjectValues().get(1));<NEW_LINE>final String subject1 = subject + "start";<NEW_LINE>final String subject2 = subject + "end";<NEW_LINE>final String parameter1 = generateQueryParameter(subject1, counter);<NEW_LINE>final String parameter2 = generateQueryParameter(subject2, counter);<NEW_LINE>final String keyword = criteria.getType().getSqlKeyword();<NEW_LINE>parameters.add(Pair.of(parameter1, value1));<NEW_LINE>parameters.add(Pair.of(parameter2, value2));<NEW_LINE>return String.format("(r.%s %s @%s AND @%s)", subject, keyword, parameter1, parameter2);<NEW_LINE>}
().get(0));
1,000,227
public DescribeAssociationExecutionTargetsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeAssociationExecutionTargetsResult describeAssociationExecutionTargetsResult = new DescribeAssociationExecutionTargetsResult();<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 describeAssociationExecutionTargetsResult;<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("AssociationExecutionTargets", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeAssociationExecutionTargetsResult.setAssociationExecutionTargets(new ListUnmarshaller<AssociationExecutionTarget>(AssociationExecutionTargetJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeAssociationExecutionTargetsResult.setNextToken(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 describeAssociationExecutionTargetsResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
484,634
public static void main(String[] args) {<NEW_LINE>LOGGER.info("Program started");<NEW_LINE>// Create a list of tasks to be executed<NEW_LINE>var tasks = List.of(new PotatoPeelingTask(3), new PotatoPeelingTask(6), new CoffeeMakingTask(2), new CoffeeMakingTask(6), new PotatoPeelingTask(4), new CoffeeMakingTask(2), new PotatoPeelingTask(4), new CoffeeMakingTask(9), new PotatoPeelingTask(3), new CoffeeMakingTask(2), new PotatoPeelingTask(4), new CoffeeMakingTask(2), new CoffeeMakingTask(7), new PotatoPeelingTask(4), new PotatoPeelingTask(5));<NEW_LINE>// Creates a thread pool that reuses a fixed number of threads operating off a shared<NEW_LINE>// unbounded queue. At any point, at most nThreads threads will be active processing<NEW_LINE>// tasks. If additional tasks are submitted when all threads are active, they will wait<NEW_LINE>// in the queue until a thread is available.<NEW_LINE>var executor = Executors.newFixedThreadPool(3);<NEW_LINE>// Allocate new worker for each task<NEW_LINE>// The worker is executed when a thread becomes<NEW_LINE>// available in the thread pool<NEW_LINE>tasks.stream().map(Worker::new<MASK><NEW_LINE>// All tasks were executed, now shutdown<NEW_LINE>executor.shutdown();<NEW_LINE>while (!executor.isTerminated()) {<NEW_LINE>Thread.yield();<NEW_LINE>}<NEW_LINE>LOGGER.info("Program finished");<NEW_LINE>}
).forEach(executor::execute);
316,750
public static DetectSpineMRIResponse unmarshall(DetectSpineMRIResponse detectSpineMRIResponse, UnmarshallerContext _ctx) {<NEW_LINE>detectSpineMRIResponse.setRequestId(_ctx.stringValue("DetectSpineMRIResponse.RequestId"));<NEW_LINE>Data data = new Data();<NEW_LINE>List<Disc> discs = new ArrayList<Disc>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DetectSpineMRIResponse.Data.Discs.Length"); i++) {<NEW_LINE>Disc disc = new Disc();<NEW_LINE>disc.setDisease(_ctx.stringValue("DetectSpineMRIResponse.Data.Discs[" + i + "].Disease"));<NEW_LINE>disc.setIdentification(_ctx.stringValue("DetectSpineMRIResponse.Data.Discs[" + i + "].Identification"));<NEW_LINE>List<Float> location = new ArrayList<Float>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DetectSpineMRIResponse.Data.Discs[" + i + "].Location.Length"); j++) {<NEW_LINE>location.add(_ctx.floatValue("DetectSpineMRIResponse.Data.Discs[" + i <MASK><NEW_LINE>}<NEW_LINE>disc.setLocation(location);<NEW_LINE>discs.add(disc);<NEW_LINE>}<NEW_LINE>data.setDiscs(discs);<NEW_LINE>List<Vertebra> vertebras = new ArrayList<Vertebra>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DetectSpineMRIResponse.Data.Vertebras.Length"); i++) {<NEW_LINE>Vertebra vertebra = new Vertebra();<NEW_LINE>vertebra.setDisease(_ctx.stringValue("DetectSpineMRIResponse.Data.Vertebras[" + i + "].Disease"));<NEW_LINE>vertebra.setIdentification(_ctx.stringValue("DetectSpineMRIResponse.Data.Vertebras[" + i + "].Identification"));<NEW_LINE>List<Float> location1 = new ArrayList<Float>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DetectSpineMRIResponse.Data.Vertebras[" + i + "].Location.Length"); j++) {<NEW_LINE>location1.add(_ctx.floatValue("DetectSpineMRIResponse.Data.Vertebras[" + i + "].Location[" + j + "]"));<NEW_LINE>}<NEW_LINE>vertebra.setLocation1(location1);<NEW_LINE>vertebras.add(vertebra);<NEW_LINE>}<NEW_LINE>data.setVertebras(vertebras);<NEW_LINE>detectSpineMRIResponse.setData(data);<NEW_LINE>return detectSpineMRIResponse;<NEW_LINE>}
+ "].Location[" + j + "]"));
228,811
void addRegOrMem(Instruction instruction, int operand, int regLo, int regHi, int vsibIndexRegLo, int vsibIndexRegHi, boolean allowMemOp, boolean allowRegOp) {<NEW_LINE>int opKind = instruction.getOpKind(operand);<NEW_LINE>encoderFlags |= EncoderFlags.MOD_RM;<NEW_LINE>if (opKind == OpKind.REGISTER) {<NEW_LINE>if (!allowRegOp) {<NEW_LINE>setErrorMessage(String.format("Operand %d: register operand != allowed", operand));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int reg = instruction.getOpRegister(operand);<NEW_LINE>if (!verify(operand, reg, regLo, regHi))<NEW_LINE>return;<NEW_LINE>int regNum = reg - regLo;<NEW_LINE>if (regLo == Register.AL) {<NEW_LINE>if (reg >= Register.R8L)<NEW_LINE>regNum -= 4;<NEW_LINE>else if (reg >= Register.SPL) {<NEW_LINE>regNum -= 4;<NEW_LINE>encoderFlags |= EncoderFlags.REX;<NEW_LINE>} else if (reg >= Register.AH)<NEW_LINE>encoderFlags |= EncoderFlags.HIGH_LEGACY_8_BIT_REGS;<NEW_LINE>}<NEW_LINE>modRM |= (byte) (regNum & 7);<NEW_LINE>modRM |= 0xC0;<NEW_LINE>encoderFlags |= (regNum >>> 3) & 3;<NEW_LINE>assert Integer.compareUnsigned(regNum, 31) <= 0 : regNum;<NEW_LINE>} else if (opKind == OpKind.MEMORY) {<NEW_LINE>if (!allowMemOp) {<NEW_LINE>setErrorMessage(String.format("Operand %d: memory operand != allowed", operand));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (MemorySize.isBroadcast(instruction.getMemorySize()))<NEW_LINE>encoderFlags |= EncoderFlags.BROADCAST;<NEW_LINE><MASK><NEW_LINE>if (codeSize == CodeSize.UNKNOWN) {<NEW_LINE>if (bitness == 64)<NEW_LINE>codeSize = CodeSize.CODE64;<NEW_LINE>else if (bitness == 32)<NEW_LINE>codeSize = CodeSize.CODE32;<NEW_LINE>else {<NEW_LINE>assert bitness == 16 : bitness;<NEW_LINE>codeSize = CodeSize.CODE16;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>@SuppressWarnings("deprecation")<NEW_LINE>int addrSize = com.github.icedland.iced.x86.InternalInstructionUtils.getAddressSizeInBytes(instruction.getMemoryBase(), instruction.getMemoryIndex(), instruction.getMemoryDisplSize(), codeSize) * 8;<NEW_LINE>if (addrSize != bitness)<NEW_LINE>encoderFlags |= EncoderFlags.P67;<NEW_LINE>if ((encoderFlags & EncoderFlags.REG_IS_MEMORY) != 0) {<NEW_LINE>int regSize = getRegisterOpSize(instruction);<NEW_LINE>if (regSize != addrSize) {<NEW_LINE>setErrorMessage(String.format("Operand %d: Register operand size must equal memory addressing mode (16/32/64)", operand));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (addrSize == 16) {<NEW_LINE>if (vsibIndexRegLo != Register.NONE) {<NEW_LINE>setErrorMessage(String.format("Operand %d: VSIB operands can't use 16-bit addressing. It must be 32-bit or 64-bit addressing", operand));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>addMemOp16(instruction, operand);<NEW_LINE>} else<NEW_LINE>addMemOp(instruction, operand, addrSize, vsibIndexRegLo, vsibIndexRegHi);<NEW_LINE>} else<NEW_LINE>setErrorMessage(String.format("Operand %d: Expected a register or memory operand, but opKind is %d", operand, opKind));<NEW_LINE>}
int codeSize = instruction.getCodeSize();
1,577,931
public boolean undo(Set<Integer> p_changed_nets) {<NEW_LINE>this.components.undo(this.communication.observers);<NEW_LINE>Collection<UndoableObjects.Storable> cancelled_objects = new LinkedList<>();<NEW_LINE>Collection<UndoableObjects.Storable> restored_objects = new LinkedList<>();<NEW_LINE>boolean result = item_list.undo(cancelled_objects, restored_objects);<NEW_LINE>// update the search trees<NEW_LINE>Iterator<UndoableObjects.Storable> it = cancelled_objects.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>Item curr_item = (Item) it.next();<NEW_LINE>search_tree_manager.remove(curr_item);<NEW_LINE>// let the observers syncronize the deletion<NEW_LINE>communication.observers.notify_deleted(curr_item);<NEW_LINE>if (p_changed_nets != null) {<NEW_LINE>for (int i = 0; i < curr_item.net_count(); ++i) {<NEW_LINE>p_changed_nets.add(Integer.valueOf(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>it = restored_objects.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>Item curr_item = (Item) it.next();<NEW_LINE>curr_item.board = this;<NEW_LINE>search_tree_manager.insert(curr_item);<NEW_LINE>curr_item.clear_autoroute_info();<NEW_LINE>// let the observers know the insertion<NEW_LINE>communication.observers.notify_new(curr_item);<NEW_LINE>if (p_changed_nets != null) {<NEW_LINE>for (int i = 0; i < curr_item.net_count(); ++i) {<NEW_LINE>p_changed_nets.add(Integer.valueOf(curr_item.get_net_no(i)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
curr_item.get_net_no(i)));
740,617
private /*<NEW_LINE>@Override<NEW_LINE>public void paint(Graphics g) {<NEW_LINE>super.paint(g);<NEW_LINE>Graphics2D g2d = (Graphics2D) g;<NEW_LINE>drawDecoration(g2d);<NEW_LINE>g2d.setColor(new Color(0<MASK><NEW_LINE>g2d.drawRoundRect(3, 3, getWidth() - 7, getHeight() - 7, 5, 5);<NEW_LINE>}<NEW_LINE>*/<NEW_LINE>void drawDecoration(Graphics2D g2d) {<NEW_LINE>String strSim = null, strOffset = null;<NEW_LINE>if (_similarity != DEFAULT_SIMILARITY || (_resizeFactor > 0 && _resizeFactor != 1) || (null != _mask && !_mask.isEmpty())) {<NEW_LINE>if (_exact) {<NEW_LINE>strSim = "99";<NEW_LINE>} else {<NEW_LINE>strSim = String.format("%d", (int) (_similarity * 100));<NEW_LINE>}<NEW_LINE>if (_resizeFactor > 0 && _resizeFactor != 1) {<NEW_LINE>strSim += " +";<NEW_LINE>}<NEW_LINE>if (null != _mask && !_mask.isEmpty()) {<NEW_LINE>strSim += " M";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (_offset != null && (_offset.x != 0 || _offset.y != 0)) {<NEW_LINE>strOffset = _offset.toStringShort();<NEW_LINE>}<NEW_LINE>if (strOffset == null && strSim == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final int fontH = g2d.getFontMetrics().getMaxAscent();<NEW_LINE>final int x = getWidth(), y = 0;<NEW_LINE>drawSimBadge(g2d, strSim, x, y);<NEW_LINE>if (_offset != null) {<NEW_LINE>drawCross(g2d);<NEW_LINE>}<NEW_LINE>}
, 128, 128, 128));
515,419
public HyperBoundingBox determineAlphaMinMax(HyperBoundingBox interval) {<NEW_LINE>final int dim = vec.getDimensionality();<NEW_LINE>if (interval.getDimensionality() != dim - 1) {<NEW_LINE>throw new IllegalArgumentException("Interval needs to have dimensionality d=" + (dim - 1) + ", read: " + interval.getDimensionality());<NEW_LINE>}<NEW_LINE>if (extremumType.equals(ExtremumType.CONSTANT)) {<NEW_LINE>double[] <MASK><NEW_LINE>return new HyperBoundingBox(centroid, centroid);<NEW_LINE>}<NEW_LINE>double[] alpha_min = new double[dim - 1];<NEW_LINE>double[] alpha_max = new double[dim - 1];<NEW_LINE>if (SpatialUtil.contains(interval, alphaExtremum)) {<NEW_LINE>if (extremumType.equals(ExtremumType.MINIMUM)) {<NEW_LINE>alpha_min = alphaExtremum;<NEW_LINE>for (int d = dim - 2; d >= 0; d--) {<NEW_LINE>alpha_max[d] = determineAlphaMax(d, alpha_max, interval);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>alpha_max = alphaExtremum;<NEW_LINE>for (int d = dim - 2; d >= 0; d--) {<NEW_LINE>alpha_min[d] = determineAlphaMin(d, alpha_min, interval);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int d = dim - 2; d >= 0; d--) {<NEW_LINE>alpha_min[d] = determineAlphaMin(d, alpha_min, interval);<NEW_LINE>alpha_max[d] = determineAlphaMax(d, alpha_max, interval);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new HyperBoundingBox(alpha_min, alpha_max);<NEW_LINE>}
centroid = SpatialUtil.centroid(interval);
463,122
final StartSentimentDetectionJobResult executeStartSentimentDetectionJob(StartSentimentDetectionJobRequest startSentimentDetectionJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(startSentimentDetectionJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StartSentimentDetectionJobRequest> request = null;<NEW_LINE>Response<StartSentimentDetectionJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StartSentimentDetectionJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(startSentimentDetectionJobRequest));<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, "Comprehend");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartSentimentDetectionJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StartSentimentDetectionJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartSentimentDetectionJobResultJsonUnmarshaller());<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,521,760
private void doTargetsForFullyQualifiedBuckTarget(VirtualFile sourceFile, Project project, String prefixToAutocomplete, CompletionResultSet result) {<NEW_LINE>BuckTargetPattern pattern = BuckTargetPattern.parse(prefixToAutocomplete).orElse(null);<NEW_LINE>if (pattern == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BuckTargetLocator buckTargetLocator = BuckTargetLocator.getInstance(project);<NEW_LINE>VirtualFile targetBuildFile = buckTargetLocator.resolve(sourceFile, pattern).flatMap(buckTargetLocator::findVirtualFileForTargetPattern).orElse(null);<NEW_LINE>if (targetBuildFile == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PsiFile targetPsiFile = PsiManager.getInstance(project).findFile(targetBuildFile);<NEW_LINE>if (targetPsiFile == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, ?> targetsInPsiTree = BuckPsiUtils.findTargetsInPsiTree(targetPsiFile, pattern.getRuleName().orElse(""));<NEW_LINE>String cellName = pattern.getCellName().orElse(null);<NEW_LINE>String cellPath = pattern.getCellPath().orElse("");<NEW_LINE>for (String name : targetsInPsiTree.keySet()) {<NEW_LINE>String completion;<NEW_LINE>if (cellName == null) {<NEW_LINE>completion = cellPath + ":" + name;<NEW_LINE>} else {<NEW_LINE>completion = cellName <MASK><NEW_LINE>}<NEW_LINE>addResultForTarget(result, completion);<NEW_LINE>}<NEW_LINE>}
+ "//" + cellPath + ":" + name;
1,451,021
public void resize() {<NEW_LINE>if (((m_initialMovieHeight == -1 || m_initialMovieWidth == -1) && !m_isAudioOnly) || m_textureView == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Handler handler = new Handler(Looper.getMainLooper());<NEW_LINE>handler.post(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>View currentParent = (View) getParent();<NEW_LINE>if (currentParent != null) {<NEW_LINE>int screenWidth = currentParent.getWidth();<NEW_LINE>int newHeight = 200;<NEW_LINE>if (!m_isAudioOnly) {<NEW_LINE>newHeight = (int) ((float) (screenWidth * m_initialMovieHeight) / (float) m_initialMovieWidth);<NEW_LINE>} else {<NEW_LINE>newHeight = 200;<NEW_LINE>}<NEW_LINE>if (m_textureView != null) {<NEW_LINE>FrameLayout.LayoutParams layoutParams = (FrameLayout<MASK><NEW_LINE>layoutParams.width = screenWidth;<NEW_LINE>layoutParams.height = newHeight;<NEW_LINE>m_textureView.setLayoutParams(layoutParams);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
.LayoutParams) m_textureView.getLayoutParams();
379,967
public void onPresentProofClicked(View v) {<NEW_LINE>try {<NEW_LINE>int connectionHandle = ConnectionApi.connectionDeserialize(connection).get();<NEW_LINE>// Check agency for a proof request<NEW_LINE>String requests = DisclosedProofApi.proofGetRequests(connectionHandle).get();<NEW_LINE>// Create a Disclosed proof object from proof request<NEW_LINE>LinkedHashMap<String, Object> request = JsonPath.read(requests, "$.[0]");<NEW_LINE>int proofHandle = DisclosedProofApi.proofCreateWithRequest("1", JsonPath.parse(request).jsonString()).get();<NEW_LINE>// Query for credentials in the wallet that satisfy the proof request<NEW_LINE>String credentials = DisclosedProofApi.proofRetrieveCredentials(proofHandle).get();<NEW_LINE>// Use the first available credentials to satisfy the proof request<NEW_LINE>DocumentContext ctx = JsonPath.parse(credentials);<NEW_LINE>LinkedHashMap<String, Object> attrs = ctx.read("$.attrs");<NEW_LINE>for (String key : attrs.keySet()) {<NEW_LINE>LinkedHashMap<String, Object> attr = JsonPath.read(attrs.get(key), "$.[0]");<NEW_LINE>ctx.set("$.attrs." + key, JsonPath.parse("{\"credential\":null}").json());<NEW_LINE>ctx.set("$.attrs." + key + ".credential", attr);<NEW_LINE>}<NEW_LINE>// Generate and send the proof<NEW_LINE>DisclosedProofApi.proofGenerate(proofHandle, ctx.jsonString(), "{}").get();<NEW_LINE>DisclosedProofApi.proofSend(proofHandle, connectionHandle).get();<NEW_LINE>int state = DisclosedProofApi.<MASK><NEW_LINE>while (state != 4) {<NEW_LINE>try {<NEW_LINE>Thread.sleep(1 * 1000);<NEW_LINE>} catch (InterruptedException ie) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>}<NEW_LINE>state = DisclosedProofApi.proofUpdateState(proofHandle).get();<NEW_LINE>}<NEW_LINE>String serializedProof = DisclosedProofApi.proofSerialize(proofHandle).get();<NEW_LINE>Log.d(TAG, "Serialized proof: " + serializedProof);<NEW_LINE>DisclosedProofApi.proofRelease(proofHandle);<NEW_LINE>} catch (VcxException | ExecutionException | InterruptedException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
proofUpdateState(proofHandle).get();
1,180,055
private static List<Map<String, Object>> mergeNamedList(List listA, List listB) {<NEW_LINE>Map<String, Map<String, Object>> mapped = new HashMap<String, Map<String, Object>>();<NEW_LINE>for (Object item : (List) listA) {<NEW_LINE>Map<String, Object> map = (Map<String, Object>) item;<NEW_LINE>String name = (String) map.get("name");<NEW_LINE>mapped.put(name, map);<NEW_LINE>}<NEW_LINE>List<Map<String, Object>> mergedList = new ArrayList<Map<String, Object>>();<NEW_LINE>for (Object item : (List) listB) {<NEW_LINE>Map<String, Object> mapB = (Map<String, Object>) item;<NEW_LINE>String name = (String) mapB.get("name");<NEW_LINE>Map<String, Object> mapA = mapped.get(name);<NEW_LINE>Map<String, Object> <MASK><NEW_LINE>mergedList.add(mergedMap);<NEW_LINE>}<NEW_LINE>return mergedList;<NEW_LINE>}
mergedMap = mergeWallStat(mapA, mapB);
558,094
private void updateUdt(RestDB restDB, Keyspace keyspace, UserDefinedTypeUpdate udtUpdate, UserDefinedType udt) throws ExecutionException, InterruptedException {<NEW_LINE>List<UserDefinedTypeField> addFields = udtUpdate.getAddFields();<NEW_LINE>List<UserDefinedTypeUpdate.RenameUdtField<MASK><NEW_LINE>if ((addFields == null || addFields.isEmpty()) && (renameFields == null || renameFields.isEmpty())) {<NEW_LINE>throw new IllegalArgumentException("addFields and/or renameFields is required to update an UDT.");<NEW_LINE>}<NEW_LINE>if (addFields != null && !addFields.isEmpty()) {<NEW_LINE>List<Column> columns = getUdtColumns(keyspace, addFields);<NEW_LINE>restDB.queryBuilder().alter().type(keyspace.name(), udt).addColumn(columns).build().execute(ConsistencyLevel.LOCAL_QUORUM).get();<NEW_LINE>}<NEW_LINE>if (renameFields != null && !renameFields.isEmpty()) {<NEW_LINE>List<Pair<String, String>> columns = renameFields.stream().map(r -> Pair.fromArray(new String[] { r.getFrom(), r.getTo() })).collect(Collectors.toList());<NEW_LINE>restDB.queryBuilder().alter().type(keyspace.name(), udt).renameColumn(columns).build().execute(ConsistencyLevel.LOCAL_QUORUM).get();<NEW_LINE>}<NEW_LINE>}
> renameFields = udtUpdate.getRenameFields();