idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,556,270
public void readFields(DataInput in) throws IOException {<NEW_LINE>state = TEtlState.valueOf(Text.readString(in));<NEW_LINE>trackingUrl = Text.readString(in);<NEW_LINE>int statsCount = in.readInt();<NEW_LINE>for (int i = 0; i < statsCount; ++i) {<NEW_LINE>String key = Text.readString(in);<NEW_LINE>String value = Text.readString(in);<NEW_LINE>stats.put(key, value);<NEW_LINE>}<NEW_LINE>int countersCount = in.readInt();<NEW_LINE>for (int i = 0; i < countersCount; ++i) {<NEW_LINE>String key = Text.readString(in);<NEW_LINE>String value = Text.readString(in);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// TODO: Persist `tableCounters`<NEW_LINE>// if (Catalog.getCurrentCatalogJournalVersion() >= FeMetaVersion.VERSION_93) {<NEW_LINE>// tableCounters = GsonUtils.GSON.fromJson(Text.readString(in), tableCounters.getClass());<NEW_LINE>// }<NEW_LINE>}
counters.put(key, value);
1,542,055
public void appendBatch(VectorAccessible batch) {<NEW_LINE>assert numPartitions == 1;<NEW_LINE>int recordCount = batch.getRecordCount();<NEW_LINE>currHVVector = new IntVector(MaterializedField.create(HASH_VALUE_COLUMN_NAME, HVtype), allocator);<NEW_LINE>currHVVector.allocateNew(recordCount);<NEW_LINE>try {<NEW_LINE>// For every record in the build batch, hash the key columns and keep the result<NEW_LINE>for (int ind = 0; ind < recordCount; ind++) {<NEW_LINE>int hashCode = getBuildHashCode(ind);<NEW_LINE>// store the hash value in the new HV column<NEW_LINE>currHVVector.getMutator().set(ind, hashCode);<NEW_LINE>}<NEW_LINE>} catch (SchemaChangeException sce) {<NEW_LINE>}<NEW_LINE>VectorContainer container = new VectorContainer();<NEW_LINE>List<ValueVector> vectors = Lists.newArrayList();<NEW_LINE>for (VectorWrapper<?> v : batch) {<NEW_LINE>TransferPair tp = v.<MASK><NEW_LINE>tp.transfer();<NEW_LINE>vectors.add(tp.getTo());<NEW_LINE>}<NEW_LINE>container.addCollection(vectors);<NEW_LINE>// the HV vector is added as an extra "column"<NEW_LINE>container.add(currHVVector);<NEW_LINE>container.setRecordCount(recordCount);<NEW_LINE>container.buildSchema(BatchSchema.SelectionVectorMode.NONE);<NEW_LINE>tmpBatchesList.add(container);<NEW_LINE>partitionBatchesCount++;<NEW_LINE>currHVVector = null;<NEW_LINE>numInMemoryRecords += recordCount;<NEW_LINE>}
getValueVector().getTransferPair(allocator);
606,367
public void testAuthenticateMethodFL_ProtectedServlet1() throws Exception {<NEW_LINE>METHODS = "testMethod=authenticate,logout,login";<NEW_LINE>String url = "http://" + server.getHostname() + ":" + server.getHttpDefaultPort() + "/formlogin/ProgrammaticAPIServlet?" + METHODS + "&user=" + managerUser + "&password=" + managerPassword;<NEW_LINE>HttpClient client = new DefaultHttpClient();<NEW_LINE>String response = authenticateWithValidAuthDataFL(client, validUser, validPassword, url);<NEW_LINE>// Get servlet output to verify each test<NEW_LINE>String test1 = response.substring(response.indexOf("STARTTEST1"), response.indexOf("ENDTEST1"));<NEW_LINE>String test2 = response.substring(response.indexOf("STARTTEST2"), response.indexOf("ENDTEST2"));<NEW_LINE>String test3 = response.substring(response.indexOf("STARTTEST3"), response.indexOf("ENDTEST3"));<NEW_LINE>// TEST1 - check values after 1st authenticate<NEW_LINE>testHelper.verifyProgrammaticAPIValues(authTypeForm, validUser, test1, NOT_MANAGER_ROLE, IS_EMPLOYEE_ROLE);<NEW_LINE>// TEST2 - check values after logout<NEW_LINE>testHelper.verifyNullValuesAfterLogout(<MASK><NEW_LINE>// TEST3 - check values after 1st login<NEW_LINE>testHelper.verifyProgrammaticAPIValues(authTypeForm, managerUser, test3, IS_MANAGER_ROLE, NOT_EMPLOYEE_ROLE);<NEW_LINE>List<String> passwordsInTrace = server.findStringsInLogsAndTrace(validPassword);<NEW_LINE>assertEquals("Should not find password we used to initially log in with in the log file", Collections.emptyList(), passwordsInTrace);<NEW_LINE>// N.B. In this case we are not searching for the manager password<NEW_LINE>// because it is being passed in via the request URL. Since the<NEW_LINE>// FormLogin flow will manipulate the request URL for a redirect<NEW_LINE>// and trace that manipulation, we are going to see the manager<NEW_LINE>// password. This is not viewed as a security issue at this time.<NEW_LINE>}
validUser, test2, NOT_MANAGER_ROLE, IS_EMPLOYEE_ROLE);
1,132,911
final CreateVPCEConfigurationResult executeCreateVPCEConfiguration(CreateVPCEConfigurationRequest createVPCEConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createVPCEConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateVPCEConfigurationRequest> request = null;<NEW_LINE>Response<CreateVPCEConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new CreateVPCEConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createVPCEConfigurationRequest));<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, "Device Farm");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateVPCEConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateVPCEConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateVPCEConfigurationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
764,163
public static void main(String[] args) {<NEW_LINE>Exercise30_ChiSquareStatistic chiSquareStatistic = new Exercise30_ChiSquareStatistic();<NEW_LINE>SeparateChainingHashTableChiSquare<Integer, Integer> separateChainingHashTableChiSquare = chiSquareStatistic.new SeparateChainingHashTableChiSquare<>(100, 20);<NEW_LINE>for (int key = 0; key < 10000; key++) {<NEW_LINE>int randomIntegerKey = StdRandom.uniform(Integer.MAX_VALUE);<NEW_LINE>separateChainingHashTableChiSquare.put(randomIntegerKey, randomIntegerKey);<NEW_LINE>}<NEW_LINE>double lowerBound = separateChainingHashTableChiSquare.size - Math.sqrt(separateChainingHashTableChiSquare.size);<NEW_LINE>double upperBound = separateChainingHashTableChiSquare.size + Math.sqrt(separateChainingHashTableChiSquare.size);<NEW_LINE>double constant = separateChainingHashTableChiSquare.<MASK><NEW_LINE>double probability = 1 - (1 / constant);<NEW_LINE>double chiSquareStatisticValue = separateChainingHashTableChiSquare.computeChiSquareStatistic();<NEW_LINE>StdOut.println("M - sqrt(M) = " + String.format("%.2f", lowerBound));<NEW_LINE>StdOut.println("M + sqrt(M) = " + String.format("%.2f", upperBound));<NEW_LINE>StdOut.println("Chi square statistic = " + String.format("%.2f", chiSquareStatisticValue));<NEW_LINE>StdOut.println("Probability = " + String.format("%.2f%%", probability * 100));<NEW_LINE>StdOut.print("Produces random values: ");<NEW_LINE>if (lowerBound <= chiSquareStatisticValue && chiSquareStatisticValue <= upperBound) {<NEW_LINE>StdOut.print("True");<NEW_LINE>} else {<NEW_LINE>StdOut.print("False");<NEW_LINE>}<NEW_LINE>}
keysSize / (double) separateChainingHashTableChiSquare.size;
1,410,893
public void populateCredentials(Map<String, String> credentials) {<NEW_LINE>// Log the user in and get the TGT<NEW_LINE>try {<NEW_LINE>Configuration <MASK><NEW_LINE>ClientCallbackHandler client_callback_handler = new ClientCallbackHandler(login_conf);<NEW_LINE>// login our user<NEW_LINE>Configuration.setConfiguration(login_conf);<NEW_LINE>LoginContext lc = new LoginContext(AuthUtils.LOGIN_CONTEXT_CLIENT, client_callback_handler);<NEW_LINE>try {<NEW_LINE>lc.login();<NEW_LINE>final Subject subject = lc.getSubject();<NEW_LINE>KerberosTicket tgt = getTGT(subject);<NEW_LINE>if (tgt == null) {<NEW_LINE>// error<NEW_LINE>throw new RuntimeException("Fail to verify user principal with section \"" + AuthUtils.LOGIN_CONTEXT_CLIENT + "\" in login configuration file " + login_conf);<NEW_LINE>}<NEW_LINE>if (!tgt.isForwardable()) {<NEW_LINE>throw new RuntimeException("The TGT found is not forwardable");<NEW_LINE>}<NEW_LINE>if (!tgt.isRenewable()) {<NEW_LINE>throw new RuntimeException("The TGT found is not renewable");<NEW_LINE>}<NEW_LINE>LOG.info("Pushing TGT for " + tgt.getClient() + " to topology.");<NEW_LINE>saveTGT(tgt, credentials);<NEW_LINE>} finally {<NEW_LINE>lc.logout();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}
login_conf = AuthUtils.GetConfiguration(conf);
341,225
public void handle(HttpRequest httpRequest, HttpResponse response) throws IOException {<NEW_LINE>int queries = Math.min(Math.max(NumberUtils.toInt(httpRequest.getParameter("queries"), 1), 1), 500);<NEW_LINE>World[] worlds = new World[queries];<NEW_LINE>try (Connection connection = dataSource.getConnection();<NEW_LINE>PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM World WHERE id=?")) {<NEW_LINE>for (int i = 0; i < queries; i++) {<NEW_LINE>preparedStatement.setInt(1, getRandomNumber());<NEW_LINE>ResultSet resultSet = preparedStatement.executeQuery();<NEW_LINE>resultSet.next();<NEW_LINE>World world = new World();<NEW_LINE>world.setId(resultSet.getInt(1));<NEW_LINE>world.setRandomNumber<MASK><NEW_LINE>worlds[i] = world;<NEW_LINE>preparedStatement.clearParameters();<NEW_LINE>}<NEW_LINE>} catch (SQLException throwables) {<NEW_LINE>throwables.printStackTrace();<NEW_LINE>}<NEW_LINE>response.setContentType("application/json");<NEW_LINE>JsonUtil.writeJsonBytes(response, worlds);<NEW_LINE>}
(resultSet.getInt(2));
1,534,157
protected void work() {<NEW_LINE>Map<TailFile, List<Map>> serverlogs = null;<NEW_LINE>try {<NEW_LINE>TailFile tf = (TailFile) this.get("tfevent");<NEW_LINE>this.setCurrenttfref((CopyOfProcessOfLogagent) this.get("tfref"));<NEW_LINE>// tfref = ((TaildirLogComponent) this.get("tfref"));<NEW_LINE>serverlogs = this.getCurrenttfref().tailFileProcessSeprate(tf, true);<NEW_LINE>for (Entry<TailFile, List<Map>> applogs : serverlogs.entrySet()) {<NEW_LINE>if (log.isDebugEnable()) {<NEW_LINE>log.debug(this, "### Logvalue ###: " + applogs.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!(serverlogs.isEmpty())) {<NEW_LINE>this.getCurrenttfref().sendLogDataBatch(serverlogs);<NEW_LINE>} else {<NEW_LINE>if (log.isDebugEnable()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>log.err(this, "Unable to tail files.", t);<NEW_LINE>} finally {<NEW_LINE>if (null != serverlogs) {<NEW_LINE>serverlogs.clear();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
log.debug(this, "serverlogs is emptry!!!");
188,816
public void processOpts() {<NEW_LINE>super.processOpts();<NEW_LINE>String appPackage = invokerPackage + ".app";<NEW_LINE>supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));<NEW_LINE>supportingFiles.add(new SupportingFile("build.mustache", "", "build.sbt"));<NEW_LINE>supportingFiles.add(new SupportingFile("web.xml", "/src/main/webapp/WEB-INF", "web.xml"));<NEW_LINE>supportingFiles.add(new SupportingFile("logback.xml", "/src/main/resources", "logback.xml"));<NEW_LINE>supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));<NEW_LINE>supportingFiles.add(new SupportingFile("JettyMain.mustache", sourceFolderByPackage(invokerPackage), "JettyMain.scala"));<NEW_LINE>supportingFiles.add(new SupportingFile("Bootstrap.mustache", <MASK><NEW_LINE>supportingFiles.add(new SupportingFile("ServletApp.mustache", sourceFolderByPackage(appPackage), "ServletApp.scala"));<NEW_LINE>supportingFiles.add(new SupportingFile("project/build.properties", "project", "build.properties"));<NEW_LINE>supportingFiles.add(new SupportingFile("project/plugins.sbt", "project", "plugins.sbt"));<NEW_LINE>supportingFiles.add(new SupportingFile("sbt", "", "sbt"));<NEW_LINE>additionalProperties.put("appName", appName);<NEW_LINE>additionalProperties.put("appDescription", appDescription);<NEW_LINE>additionalProperties.put("infoUrl", infoUrl);<NEW_LINE>additionalProperties.put("infoEmail", infoEmail);<NEW_LINE>additionalProperties.put("apiVersion", apiVersion);<NEW_LINE>additionalProperties.put("licenseInfo", licenseInfo);<NEW_LINE>additionalProperties.put("licenseUrl", licenseUrl);<NEW_LINE>additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage);<NEW_LINE>additionalProperties.put(CodegenConstants.GROUP_ID, groupId);<NEW_LINE>additionalProperties.put(CodegenConstants.ARTIFACT_ID, artifactId);<NEW_LINE>additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion);<NEW_LINE>}
sourceFolderByPackage(invokerPackage), "ScalatraBootstrap.scala"));
134,310
final DescribePublicIpv4PoolsResult executeDescribePublicIpv4Pools(DescribePublicIpv4PoolsRequest describePublicIpv4PoolsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describePublicIpv4PoolsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribePublicIpv4PoolsRequest> request = null;<NEW_LINE>Response<DescribePublicIpv4PoolsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribePublicIpv4PoolsRequestMarshaller().marshall(super.beforeMarshalling(describePublicIpv4PoolsRequest));<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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribePublicIpv4Pools");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribePublicIpv4PoolsResult> responseHandler = new StaxResponseHandler<DescribePublicIpv4PoolsResult>(new DescribePublicIpv4PoolsResultStaxUnmarshaller());<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,001,325
public static DataPreprocessingHelper generateDataPreprocessingHelper(Path inputPaths, Path outputPath) throws IOException {<NEW_LINE>final List<Path> avroFiles = DataFileUtils.getDataFiles(inputPaths, DataFileUtils.AVRO_FILE_EXTENSION);<NEW_LINE>final List<Path> orcFiles = DataFileUtils.getDataFiles(inputPaths, DataFileUtils.ORC_FILE_EXTENSION);<NEW_LINE>int numAvroFiles = avroFiles.size();<NEW_LINE>int numOrcFiles = orcFiles.size();<NEW_LINE>Preconditions.checkState(numAvroFiles == 0 || numOrcFiles == 0, <MASK><NEW_LINE>Preconditions.checkState(numAvroFiles > 0 || numOrcFiles > 0, "Failed to find any AVRO or ORC file in directories: %s", inputPaths);<NEW_LINE>if (numAvroFiles > 0) {<NEW_LINE>LOGGER.info("Found AVRO files: {} in directories: {}", avroFiles, inputPaths);<NEW_LINE>return new AvroDataPreprocessingHelper(avroFiles, outputPath);<NEW_LINE>} else {<NEW_LINE>LOGGER.info("Found ORC files: {} in directories: {}", orcFiles, inputPaths);<NEW_LINE>return new OrcDataPreprocessingHelper(orcFiles, outputPath);<NEW_LINE>}<NEW_LINE>}
"Cannot preprocess mixed AVRO files: %s and ORC files: %s in directories: %s", avroFiles, orcFiles, inputPaths);
1,257,197
// @Override<NEW_LINE>// public SpringAppDeploymentImpl withSourceCodeFolder(File sourceCodeFolder) {<NEW_LINE>// ensureSource();<NEW_LINE>// inner().properties().source().withType(UserSourceType.SOURCE);<NEW_LINE>// this.addDependency(<NEW_LINE>// context -> parent().getResourceUploadUrlAsync()<NEW_LINE>// .flatMap(option -> {<NEW_LINE>// try {<NEW_LINE>// return uploadToStorage(compressSource(sourceCodeFolder), option);<NEW_LINE>// } catch (Exception e) {<NEW_LINE>// return Mono.error(e);<NEW_LINE>// }<NEW_LINE>// })<NEW_LINE>// .then(context.voidMono())<NEW_LINE>// );<NEW_LINE>// return this;<NEW_LINE>// }<NEW_LINE>@Override<NEW_LINE>public SpringAppDeploymentImpl withExistingSource(UserSourceType type, String relativePath) {<NEW_LINE>if (isEnterpriseTier()) {<NEW_LINE>ensureSource(UserSourceType.BUILD_RESULT);<NEW_LINE>UserSourceInfo sourceInfo = innerModel().properties().source();<NEW_LINE>if (sourceInfo instanceof BuildResultUserSourceInfo) {<NEW_LINE>BuildResultUserSourceInfo userSourceInfo = (BuildResultUserSourceInfo) sourceInfo;<NEW_LINE>userSourceInfo.withBuildResultId(relativePath);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ensureSource(type);<NEW_LINE>UserSourceInfo userSourceInfo = innerModel()<MASK><NEW_LINE>if (userSourceInfo instanceof UploadedUserSourceInfo) {<NEW_LINE>UploadedUserSourceInfo uploadedUserSourceInfo = (UploadedUserSourceInfo) userSourceInfo;<NEW_LINE>uploadedUserSourceInfo.withRelativePath(relativePath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
.properties().source();
1,610,138
// Visible for testing<NEW_LINE>byte[] DERToJOSE(byte[] derSignature) throws SignatureException {<NEW_LINE>// DER Structure: http://crypto.stackexchange.com/a/1797<NEW_LINE>boolean derEncoded = derSignature[0] == 0x30 && derSignature.length != ecNumberSize * 2;<NEW_LINE>if (!derEncoded) {<NEW_LINE>throw new SignatureException("Invalid DER signature format.");<NEW_LINE>}<NEW_LINE>final byte[] joseSignature <MASK><NEW_LINE>// Skip 0x30<NEW_LINE>int offset = 1;<NEW_LINE>if (derSignature[1] == (byte) 0x81) {<NEW_LINE>// Skip sign<NEW_LINE>offset++;<NEW_LINE>}<NEW_LINE>// Convert to unsigned. Should match DER length - offset<NEW_LINE>int encodedLength = derSignature[offset++] & 0xff;<NEW_LINE>if (encodedLength != derSignature.length - offset) {<NEW_LINE>throw new SignatureException("Invalid DER signature format.");<NEW_LINE>}<NEW_LINE>// Skip 0x02<NEW_LINE>offset++;<NEW_LINE>// Obtain R number length (Includes padding) and skip it<NEW_LINE>int rlength = derSignature[offset++];<NEW_LINE>if (rlength > ecNumberSize + 1) {<NEW_LINE>throw new SignatureException("Invalid DER signature format.");<NEW_LINE>}<NEW_LINE>int rpadding = ecNumberSize - rlength;<NEW_LINE>// Retrieve R number<NEW_LINE>System.arraycopy(derSignature, offset + Math.max(-rpadding, 0), joseSignature, Math.max(rpadding, 0), rlength + Math.min(rpadding, 0));<NEW_LINE>// Skip R number and 0x02<NEW_LINE>offset += rlength + 1;<NEW_LINE>// Obtain S number length. (Includes padding)<NEW_LINE>int slength = derSignature[offset++];<NEW_LINE>if (slength > ecNumberSize + 1) {<NEW_LINE>throw new SignatureException("Invalid DER signature format.");<NEW_LINE>}<NEW_LINE>int spadding = ecNumberSize - slength;<NEW_LINE>// Retrieve R number<NEW_LINE>System.arraycopy(derSignature, offset + Math.max(-spadding, 0), joseSignature, ecNumberSize + Math.max(spadding, 0), slength + Math.min(spadding, 0));<NEW_LINE>return joseSignature;<NEW_LINE>}
= new byte[ecNumberSize * 2];
1,353,516
public GroupCandidate recipientIdToCandidate(@NonNull RecipientId recipientId) throws IOException {<NEW_LINE>final Recipient recipient = Recipient.resolved(recipientId);<NEW_LINE>ServiceId serviceId = recipient.getServiceId().orElse(null);<NEW_LINE>if (serviceId == null) {<NEW_LINE>throw new AssertionError("Non UUID members should have need detected by now");<NEW_LINE>}<NEW_LINE>Optional<ProfileKeyCredential> profileKeyCredential = Optional.ofNullable(recipient.getProfileKeyCredential());<NEW_LINE>GroupCandidate candidate = new GroupCandidate(serviceId.uuid(), profileKeyCredential);<NEW_LINE>if (!candidate.hasProfileKeyCredential()) {<NEW_LINE>ProfileKey profileKey = ProfileKeyUtil.profileKeyOrNull(recipient.getProfileKey());<NEW_LINE>if (profileKey != null) {<NEW_LINE>Log.i(TAG, String.format("No profile key credential on recipient %s, fetching", recipient.getId()));<NEW_LINE>Optional<ProfileKeyCredential> profileKeyCredentialOptional = signalServiceAccountManager.resolveProfileKeyCredential(serviceId, profileKey, Locale.getDefault());<NEW_LINE>if (profileKeyCredentialOptional.isPresent()) {<NEW_LINE>boolean updatedProfileKey = recipientDatabase.setProfileKeyCredential(recipient.getId(), profileKey, profileKeyCredentialOptional.get());<NEW_LINE>if (!updatedProfileKey) {<NEW_LINE>Log.w(TAG, String.format("Failed to update the profile key credential on recipient %s", recipient.getId()));<NEW_LINE>} else {<NEW_LINE>Log.i(TAG, String.format("Got new profile key credential for recipient %s"<MASK><NEW_LINE>candidate = candidate.withProfileKeyCredential(profileKeyCredentialOptional.get());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return candidate;<NEW_LINE>}
, recipient.getId()));
552,883
public static void parsePredicateLogicalCompare(Message.LogicalCompare.Builder logicalCompareBuilder, P predicate) {<NEW_LINE>if (predicate instanceof AndP) {<NEW_LINE>List<P> plist = ((AndP) predicate).getPredicates();<NEW_LINE>logicalCompareBuilder.setCompare(Message.CompareType.AND_RELATION);<NEW_LINE>int andPropId = logicalCompareBuilder.getPropId();<NEW_LINE>for (P p : plist) {<NEW_LINE>Message.LogicalCompare.Builder childCompareBuilder = Message.LogicalCompare.newBuilder().setPropId(andPropId);<NEW_LINE>parsePredicateLogicalCompare(childCompareBuilder, p);<NEW_LINE>logicalCompareBuilder.addChildCompareList(childCompareBuilder);<NEW_LINE>}<NEW_LINE>} else if (predicate instanceof OrP) {<NEW_LINE>List<P> plist = ((OrP) predicate).getPredicates();<NEW_LINE>logicalCompareBuilder.setCompare(Message.CompareType.OR_RELATION);<NEW_LINE>int orPropId = logicalCompareBuilder.getPropId();<NEW_LINE>for (P p : plist) {<NEW_LINE>Message.LogicalCompare.Builder childCompareBuilder = Message.LogicalCompare.newBuilder().setPropId(orPropId);<NEW_LINE>parsePredicateLogicalCompare(childCompareBuilder, p);<NEW_LINE>logicalCompareBuilder.addChildCompareList(childCompareBuilder);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>BiPredicate biPredicate = predicate instanceof CustomPredicate ? null : predicate.getBiPredicate();<NEW_LINE>Object value = predicate instanceof CustomPredicate <MASK><NEW_LINE>Pair<Message.CompareType, Message.Value.Builder> compareValuePair = parseCompareValuePair(predicate, biPredicate, value);<NEW_LINE>if (predicate instanceof NegatePredicate && ((NegatePredicate) predicate).isNegate()) {<NEW_LINE>compareValuePair.getRight().setBoolFlag(true);<NEW_LINE>}<NEW_LINE>logicalCompareBuilder.setCompare(compareValuePair.getLeft()).setValue(compareValuePair.getRight()).setType(compareValuePair.getRight().getValueType());<NEW_LINE>}<NEW_LINE>}
? null : predicate.getValue();
1,777,079
public void run() {<NEW_LINE>double percentile = routerConfig.routerLatencyToleranceQuantile * 100;<NEW_LINE>for (Map.Entry<Resource, CachedHistogram> resourceToHistogram : getBlobLocalDcResourceToLatency.entrySet()) {<NEW_LINE>Resource resource = resourceToHistogram.getKey();<NEW_LINE>CachedHistogram histogram = resourceToHistogram.getValue();<NEW_LINE>logger.debug("{} GetBlob local DC latency histogram {}th percentile in ms: {}", resource.toString(), percentile, histogram.getCachedValue());<NEW_LINE>}<NEW_LINE>for (Map.Entry<Resource, CachedHistogram> resourceToHistogram : getBlobCrossDcResourceToLatency.entrySet()) {<NEW_LINE>Resource resource = resourceToHistogram.getKey();<NEW_LINE>CachedHistogram histogram = resourceToHistogram.getValue();<NEW_LINE>logger.trace("{} GetBlob cross DC latency histogram {}th percentile in ms: {}", resource.toString(), percentile, histogram.getCachedValue());<NEW_LINE>}<NEW_LINE>for (Map.Entry<Resource, CachedHistogram> resourceToHistogram : getBlobInfoLocalDcResourceToLatency.entrySet()) {<NEW_LINE>Resource resource = resourceToHistogram.getKey();<NEW_LINE>CachedHistogram histogram = resourceToHistogram.getValue();<NEW_LINE>logger.debug("{} GetBlobInfo local DC latency histogram {}th percentile in ms: {}", resource.toString(), <MASK><NEW_LINE>}<NEW_LINE>for (Map.Entry<Resource, CachedHistogram> resourceToHistogram : getBlobInfoCrossDcResourceToLatency.entrySet()) {<NEW_LINE>Resource resource = resourceToHistogram.getKey();<NEW_LINE>CachedHistogram histogram = resourceToHistogram.getValue();<NEW_LINE>logger.trace("{} GetBlobInfo cross DC latency histogram {}th percentile in ms: {}", resource.toString(), percentile, histogram.getCachedValue());<NEW_LINE>}<NEW_LINE>}
percentile, histogram.getCachedValue());
1,102,630
public void write(KeyValue keyValue) throws IOException {<NEW_LINE>byte[] kafkaKey = keyValue.hasKafkaKey() ? keyValue.getKafkaKey<MASK><NEW_LINE>long timestamp = keyValue.getTimestamp();<NEW_LINE>final int timestampLength = (keyValue.hasTimestamp()) ? 10 : 0;<NEW_LINE>// output size estimate<NEW_LINE>// 1 - map header<NEW_LINE>// 1 - message pack key<NEW_LINE>// 9 - max kafka offset<NEW_LINE>// 1 - message pack key<NEW_LINE>// 9 - kafka timestamp<NEW_LINE>// 1 - message pack key<NEW_LINE>// 5 - max (sane) kafka key size<NEW_LINE>// N - size of kafka key<NEW_LINE>// = 27 + N<NEW_LINE>ByteArrayOutputStream out = new ByteArrayOutputStream(17 + timestampLength + kafkaKey.length);<NEW_LINE>MessagePacker packer = MessagePack.newDefaultPacker(out).packMapHeader(numberOfFieldsMappedInHeader(keyValue)).packInt(KAFKA_MESSAGE_OFFSET).packLong(keyValue.getOffset());<NEW_LINE>if (keyValue.hasTimestamp())<NEW_LINE>packer.packInt(KAFKA_MESSAGE_TIMESTAMP).packLong(timestamp);<NEW_LINE>if (keyValue.hasKafkaKey())<NEW_LINE>packer.packInt(KAFKA_HASH_KEY).packBinaryHeader(kafkaKey.length).writePayload(kafkaKey);<NEW_LINE>packer.close();<NEW_LINE>byte[] outBytes = out.toByteArray();<NEW_LINE>this.mKey.set(outBytes, 0, outBytes.length);<NEW_LINE>this.mValue.set(keyValue.getValue(), 0, keyValue.getValue().length);<NEW_LINE>this.mWriter.append(this.mKey, this.mValue);<NEW_LINE>}
() : new byte[0];
1,831,016
private void fetchNextEdge() {<NEW_LINE>this.nextEdge = null;<NEW_LINE>while (true) {<NEW_LINE>while (this.currentToEdgesIter == null || !this.currentToEdgesIter.hasNext()) {<NEW_LINE>if (this.toIter == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (this.toIter.hasNext()) {<NEW_LINE>Object from = toIter.next();<NEW_LINE>if (from instanceof OResult) {<NEW_LINE>from = ((OResult) from).toElement();<NEW_LINE>}<NEW_LINE>if (from instanceof OIdentifiable && !(from instanceof OElement)) {<NEW_LINE>from = ((OIdentifiable) from).getRecord();<NEW_LINE>}<NEW_LINE>if (from instanceof OElement && ((OElement) from).isVertex()) {<NEW_LINE>Iterable<OEdge> edges = ((OElement) from).asVertex().get().getEdges(ODirection.IN);<NEW_LINE>currentToEdgesIter = edges.iterator();<NEW_LINE>} else {<NEW_LINE>throw new OCommandExecutionException("Invalid vertex: " + from);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>OEdge edge <MASK><NEW_LINE>if (matchesClass(edge) && matchesCluster(edge)) {<NEW_LINE>this.nextEdge = edge;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
= this.currentToEdgesIter.next();
709,892
public Map<SystemInfo, List<Section>> process() {<NEW_LINE>final Scale scale = sheet.getScale();<NEW_LINE>final int minDistanceFromStaff = scale.toPixels(constants.minDistanceFromStaff);<NEW_LINE>final StaffManager staffManager = sheet.getStaffManager();<NEW_LINE>// Filter to keep only the runs which stand outside of staves cores.<NEW_LINE>final RunTableFactory.Filter filter = (int x, int y, int length) -> {<NEW_LINE>Point center = new Point(x + <MASK><NEW_LINE>Staff staff = staffManager.getClosestStaff(center);<NEW_LINE>if (staff == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return staff.distanceTo(center) >= minDistanceFromStaff;<NEW_LINE>};<NEW_LINE>final RunTableFactory runFactory = new RunTableFactory(HORIZONTAL, filter);<NEW_LINE>final ByteProcessor buffer = sheet.getPicture().getSource(Picture.SourceKey.NO_STAFF);<NEW_LINE>final RunTable ledgerTable = runFactory.createTable(buffer);<NEW_LINE>final Lag lag = new BasicLag(Lags.LEDGER_LAG, HORIZONTAL);<NEW_LINE>// We accept no shift between runs of the same section!<NEW_LINE>final SectionFactory sectionFactory = new SectionFactory(lag, new JunctionShiftPolicy(0));<NEW_LINE>sectionFactory.createSections(ledgerTable, null, true);<NEW_LINE>setVipSections(lag);<NEW_LINE>// Display a view on this lag?<NEW_LINE>if ((OMR.gui != null) && constants.displayLedgers.isSet()) {<NEW_LINE>lag.setEntityService(new SectionService(lag, sheet.getLocationService()));<NEW_LINE>new LagController(sheet, lag, SheetTab.LEDGER_TAB).refresh();<NEW_LINE>// Filament board<NEW_LINE>sheet.getStub().getAssembly().addBoard(SheetTab.LEDGER_TAB, new FilamentBoard(sheet.getFilamentIndex().getEntityService(), true));<NEW_LINE>}<NEW_LINE>return dispatchLedgerSections(lag.getEntities());<NEW_LINE>}
(length / 2), y);
1,335,477
protected void prepareConsumerOffset() {<NEW_LINE>Map<TopicPartition, Long> beginningTimestamp = new HashMap<>();<NEW_LINE>long currentTimeMs = System.currentTimeMillis();<NEW_LINE>for (TopicPartition tp : _consumer.assignment()) {<NEW_LINE>if (tp.topic().equals(_brokerMetricSampleStoreTopic)) {<NEW_LINE>beginningTimestamp.put(tp, <MASK><NEW_LINE>} else {<NEW_LINE>beginningTimestamp.put(tp, currentTimeMs - _sampleLoader.partitionMonitoringPeriodMs());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Set<TopicPartition> partitionWithNoRecentMessage = new HashSet<>();<NEW_LINE>Map<TopicPartition, OffsetAndTimestamp> beginningOffsetAndTimestamp = _consumer.offsetsForTimes(beginningTimestamp);<NEW_LINE>for (Map.Entry<TopicPartition, OffsetAndTimestamp> entry : beginningOffsetAndTimestamp.entrySet()) {<NEW_LINE>if (entry.getValue() == null) {<NEW_LINE>// If this sample store topic partition does not have data available after beginning timestamp, then seek to the<NEW_LINE>// beginning of this topic partition.<NEW_LINE>partitionWithNoRecentMessage.add(entry.getKey());<NEW_LINE>} else {<NEW_LINE>_consumer.seek(entry.getKey(), entry.getValue().offset());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (partitionWithNoRecentMessage.size() > 0) {<NEW_LINE>_consumer.seekToBeginning(partitionWithNoRecentMessage);<NEW_LINE>}<NEW_LINE>}
currentTimeMs - _sampleLoader.brokerMonitoringPeriodMs());
1,410,703
public static void reRegisterHost(final ZooKeeperClient client, final String host, final String hostId) throws HostNotFoundException, KeeperException {<NEW_LINE>// * Delete everything in the /status/hosts/<hostname> subtree<NEW_LINE>// * Don't delete any history for the job (on the host)<NEW_LINE>// * DON'T touch anything in the /config/hosts/<hostname> subtree, except updating the host id<NEW_LINE>log.info("re-registering host: {}, new host id: {}", host, hostId);<NEW_LINE>try {<NEW_LINE>final List<ZooKeeperOperation> operations = Lists.newArrayList();<NEW_LINE>// Check that the host exists in ZK<NEW_LINE>operations.add(check(Paths.configHost(host)));<NEW_LINE>// Remove the host status<NEW_LINE>final List<String> nodes = safeListRecursive(client, Paths.statusHost(host));<NEW_LINE>for (final String node : reverse(nodes)) {<NEW_LINE>operations.add(delete(node));<NEW_LINE>}<NEW_LINE>// ...and re-create the /status/hosts/<host>/jobs node + parent<NEW_LINE>operations.add(create(Paths.statusHost(host)));<NEW_LINE>operations.add(create(<MASK><NEW_LINE>// Update the host ID<NEW_LINE>// We don't have WRITE permissions to the node, so delete and re-create it.<NEW_LINE>operations.add(delete(Paths.configHostId(host)));<NEW_LINE>operations.add(create(Paths.configHostId(host), hostId.getBytes(UTF_8)));<NEW_LINE>client.transaction(operations);<NEW_LINE>} catch (NoNodeException e) {<NEW_LINE>throw new HostNotFoundException(host);<NEW_LINE>} catch (KeeperException e) {<NEW_LINE>throw new HeliosRuntimeException(e);<NEW_LINE>}<NEW_LINE>}
Paths.statusHostJobs(host)));
1,229,606
private boolean writeGroupResCtrlInfo(Map<String, GroupResCtrlEntity> groupResCtrlMap, StringBuilder strBuff, ProcessResult result) {<NEW_LINE>if (groupResCtrlMap.isEmpty()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>Map<String, String> inParamMap = new HashMap<>();<NEW_LINE>for (GroupResCtrlEntity entity : groupResCtrlMap.values()) {<NEW_LINE>inParamMap.clear();<NEW_LINE>inParamMap.put("groupName", entity.getGroupName());<NEW_LINE>inParamMap.put("resCheckEnable", String.valueOf(entity.isEnableResCheck()));<NEW_LINE>inParamMap.put("alwdBrokerClientRate", String.valueOf(entity.getAllowedBrokerClientRate()));<NEW_LINE>inParamMap.put("qryPriorityId", String.valueOf(entity.getQryPriorityId()));<NEW_LINE>inParamMap.put("flowCtrlEnable", String.valueOf(entity.isFlowCtrlEnable()));<NEW_LINE>inParamMap.put("flowCtrlInfo", String.valueOf(entity.getFlowCtrlInfo()));<NEW_LINE>inParamMap.put("dataVersionId", String.valueOf(entity.getDataVerId()));<NEW_LINE>inParamMap.put("createUser", String.valueOf(entity.getCreateUser()));<NEW_LINE>inParamMap.put("createDate", String.valueOf<MASK><NEW_LINE>inParamMap.put("modifyUser", String.valueOf(entity.getModifyUser()));<NEW_LINE>inParamMap.put("modifyDate", String.valueOf(entity.getModifyDateStr()));<NEW_LINE>if (!writeDataToMaster("admin_add_group_resctrl_info", authToken, inParamMap, strBuff, result)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
(entity.getCreateDateStr()));
1,334,391
Optional<org.jreleaser.model.releaser.spi.User> findUser(String email, String name) throws RestAPIException {<NEW_LINE>logger.debug(RB.$("git.user.lookup"), name, email);<NEW_LINE>List<User> users = api.searchUser(CollectionUtils.<String, String>newMap("scope", "users", "search", email));<NEW_LINE>if (users != null && !users.isEmpty()) {<NEW_LINE>User user = users.get(0);<NEW_LINE>return Optional.of(new org.jreleaser.model.releaser.spi.User(user.getUsername(), email<MASK><NEW_LINE>}<NEW_LINE>users = api.searchUser(CollectionUtils.<String, String>newMap("scope", "users", "search", name));<NEW_LINE>if (users != null && !users.isEmpty()) {<NEW_LINE>User user = users.get(0);<NEW_LINE>if (name.equals(user.getName())) {<NEW_LINE>return Optional.of(new org.jreleaser.model.releaser.spi.User(user.getUsername(), email, user.getWebUrl()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Optional.empty();<NEW_LINE>}
, user.getWebUrl()));
1,318,674
void update_merge(Business business, List<WrapMerge> wraps, Process process) throws Exception {<NEW_LINE>List<String> ids = business.merge().listWithProcess(process.getId());<NEW_LINE>List<Merge> os = business.entityManagerContainer().list(Merge.class, ids);<NEW_LINE>for (Merge o : os) {<NEW_LINE>if (null == jpaInWrapList(o, wraps)) {<NEW_LINE>business.entityManagerContainer().remove(o);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (null != wraps) {<NEW_LINE>for (WrapMerge w : wraps) {<NEW_LINE>Merge o = wrapInJpaList(w, os);<NEW_LINE>if (null == o) {<NEW_LINE>o = new Merge();<NEW_LINE>o.setProcess(process.getId());<NEW_LINE>WrapMerge.inCopier.copy(w, o);<NEW_LINE>o.setDistributeFactor(process.getDistributeFactor());<NEW_LINE>business.entityManagerContainer().persist(o, CheckPersistType.all);<NEW_LINE>} else {<NEW_LINE>WrapMerge.<MASK><NEW_LINE>business.entityManagerContainer().check(o, CheckPersistType.all);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
inCopier.copy(w, o);
1,302,860
protected void merge(ArrayState in1, ArrayState in2, ArrayState out) {<NEW_LINE>out.active.clear();<NEW_LINE>out.active.or(in1.active);<NEW_LINE>out.active.or(in2.active);<NEW_LINE>BitSet in2_excl = (BitSet) in2.active.clone();<NEW_LINE><MASK><NEW_LINE>for (int i = in1.active.nextSetBit(0); i >= 0; i = in1.active.nextSetBit(i + 1)) {<NEW_LINE>if (in1.state[i] == null) {<NEW_LINE>out.state[i] = null;<NEW_LINE>} else if (in2.active.get(i)) {<NEW_LINE>if (in2.state[i] == null) {<NEW_LINE>out.state[i] = null;<NEW_LINE>} else {<NEW_LINE>out.state[i] = mergeTypeStates(in1.state[i], in2.state[i]);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>out.state[i] = in1.state[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = in2_excl.nextSetBit(0); i >= 0; i = in2_excl.nextSetBit(i + 1)) {<NEW_LINE>out.state[i] = in2.state[i];<NEW_LINE>}<NEW_LINE>}
in2_excl.andNot(in1.active);
1,097,092
protected T instantiateAndValidate(Map<String, Object> pluginArgs, String id, Context pluginContext, PluginLookup.PluginClass pluginClass) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final Class<T> cls = (Class<T>) pluginClass.klass();<NEW_LINE>if (cls == null) {<NEW_LINE>throw new IllegalStateException("Unable to instantiate type: " + pluginClass);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final Constructor<T> ctor = cls.getConstructor(String.class, Configuration.class, Context.class);<NEW_LINE>Configuration config = new ConfigurationImpl(pluginArgs, pluginsFactory);<NEW_LINE>T plugin = ctor.newInstance(id, config, pluginContext);<NEW_LINE>PluginUtil.validateConfig(plugin, config);<NEW_LINE>return plugin;<NEW_LINE>} catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException ex) {<NEW_LINE>if (ex instanceof InvocationTargetException && ex.getCause() != null) {<NEW_LINE>throw new IllegalStateException(<MASK><NEW_LINE>}<NEW_LINE>throw new IllegalStateException(ex);<NEW_LINE>}<NEW_LINE>}
(ex).getCause());
1,162,514
void refreshServers(MasterClientOuterClass.TabletLocationsPB tabletLocations) throws NonRecoverableException {<NEW_LINE>synchronized (tabletServers) {<NEW_LINE>// TODO not a fat lock with IP resolving in it<NEW_LINE>tabletServers.clear();<NEW_LINE>leaderIndex = NO_LEADER_INDEX;<NEW_LINE>List<UnknownHostException> lookupExceptions = new ArrayList<>(tabletLocations.getReplicasCount());<NEW_LINE>for (MasterClientOuterClass.TabletLocationsPB.ReplicaPB replica : tabletLocations.getReplicasList()) {<NEW_LINE>List<CommonNet.HostPortPB> addresses = replica.getTsInfo().getBroadcastAddressesList();<NEW_LINE>if (addresses.isEmpty()) {<NEW_LINE>addresses = replica.getTsInfo().getPrivateRpcAddressesList();<NEW_LINE>}<NEW_LINE>if (addresses.isEmpty()) {<NEW_LINE>LOG.warn("Tablet server for tablet " + getTabletIdAsString() + " doesn't have any " + "address");<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String uuid = replica.getTsInfo().getPermanentUuid().toStringUtf8();<NEW_LINE>// from meta_cache.cc<NEW_LINE>// TODO: if the TS advertises multiple host/ports, pick the right one<NEW_LINE>// based on some kind of policy. For now just use the first always.<NEW_LINE>try {<NEW_LINE>addTabletClient(uuid, addresses.get(0).getHost(), addresses.get(0).getPort(), replica.getRole().equals<MASK><NEW_LINE>} catch (UnknownHostException ex) {<NEW_LINE>lookupExceptions.add(ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>leaderIndex = 0;<NEW_LINE>if (leaderIndex == NO_LEADER_INDEX) {<NEW_LINE>LOG.warn("No leader provided for tablet " + getTabletIdAsString());<NEW_LINE>}<NEW_LINE>// If we found a tablet that doesn't contain a single location that we can resolve, there's<NEW_LINE>// no point in retrying.<NEW_LINE>if (!lookupExceptions.isEmpty() && lookupExceptions.size() == tabletLocations.getReplicasCount()) {<NEW_LINE>throw new NonRecoverableException("Couldn't find any valid locations, exceptions: " + lookupExceptions);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(CommonTypes.PeerRole.LEADER));
1,232,144
private void addTaxReturnBlock(Map<String, String> context, DocumentType type) {<NEW_LINE>Block block = new Block("^Steuerliche Ausgleichrechnung$");<NEW_LINE>type.addBlock(block);<NEW_LINE>block.set(new Transaction<AccountTransaction>().subject(() -> {<NEW_LINE>AccountTransaction t = new AccountTransaction();<NEW_LINE>t.setType(AccountTransaction.Type.TAX_REFUND);<NEW_LINE>return t;<NEW_LINE>}).// Ausmachender Betrag 0,79 EUR<NEW_LINE>// Den Gegenwert buchen wir mit Valuta 03.03.2022 zu Gunsten des Kontos 1111111111111<NEW_LINE>section("amount", "currency", "date").optional().match("^Ausmachender Betrag (?<amount>[\\.,\\d]+) (?<currency>[\\w]{3})$").match("^Den Gegenwert buchen wir mit Valuta (?<date>[\\d]{2}\\.[\\d]{2}\\.[\\d]{4}) .*$").assign((t, v) -> {<NEW_LINE>t.setDateTime(asDate(<MASK><NEW_LINE>t.setCurrencyCode(asCurrencyCode(v.get("currency")));<NEW_LINE>t.setAmount(asAmount(v.get("amount")));<NEW_LINE>t.setShares(asShares(context.get("shares")));<NEW_LINE>t.setSecurity(getOrCreateSecurity(context));<NEW_LINE>}).wrap(t -> {<NEW_LINE>if (t.getCurrencyCode() != null && t.getAmount() != 0)<NEW_LINE>return new TransactionItem(t);<NEW_LINE>return null;<NEW_LINE>}));<NEW_LINE>}
v.get("date")));
1,527,837
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {<NEW_LINE>if (((bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>output.writeInt32(1, replicas_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>output.writeMessage(2, getSelector());<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>output.writeMessage(3, getTemplate());<NEW_LINE>}<NEW_LINE>for (int i = 0; i < volumeClaimTemplates_.size(); i++) {<NEW_LINE>output.writeMessage(4, volumeClaimTemplates_.get(i));<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000008) == 0x00000008)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 5, serviceName_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000010) == 0x00000010)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 6, podManagementPolicy_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000020) == 0x00000020)) {<NEW_LINE>output.writeMessage(7, getUpdateStrategy());<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000040) == 0x00000040)) {<NEW_LINE>output.writeInt32(8, revisionHistoryLimit_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000080) == 0x00000080)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>unknownFields.writeTo(output);<NEW_LINE>}
output.writeInt32(9, minReadySeconds_);
1,796,360
public com.amazonaws.services.serverlessapplicationrepository.model.TooManyRequestsException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.serverlessapplicationrepository.model.TooManyRequestsException tooManyRequestsException = new com.amazonaws.services.serverlessapplicationrepository.model.TooManyRequestsException(null);<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 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("errorCode", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>tooManyRequestsException.setErrorCode(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 tooManyRequestsException;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,853,298
void permitVerify() {<NEW_LINE>logDebug("permitVerify");<NEW_LINE>if (firstPin.length() == 1 && secondPin.length() == 1 && thirdPin.length() == 1 && fourthPin.length() == 1 && fifthPin.length() == 1 && sixthPin.length() == 1) {<NEW_LINE>hideKeyboard(this, 0);<NEW_LINE>if (sb.length() > 0) {<NEW_LINE>sb.delete(0, sb.length());<NEW_LINE>}<NEW_LINE>sb.append(firstPin.getText());<NEW_LINE>sb.append(secondPin.getText());<NEW_LINE>sb.append(thirdPin.getText());<NEW_LINE>sb.append(fourthPin.getText());<NEW_LINE>sb.append(fifthPin.getText());<NEW_LINE>sb.<MASK><NEW_LINE>pin = sb.toString();<NEW_LINE>logDebug("PIN: " + pin);<NEW_LINE>if (!isErrorShown && pin != null) {<NEW_LINE>verify2faProgressBar.setVisibility(View.VISIBLE);<NEW_LINE>logDebug("lastEmail: " + lastEmail + " lastPasswd: " + lastPassword);<NEW_LINE>megaApi.multiFactorAuthLogin(lastEmail, lastPassword, pin, this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
append(sixthPin.getText());
377,455
public static CTTblPPr apply(CTTblPPr source, CTTblPPr destination) {<NEW_LINE>if (!isEmpty(source)) {<NEW_LINE>if (destination == null)<NEW_LINE>destination = Context.getWmlObjectFactory().createCTTblPPr();<NEW_LINE>destination.setLeftFromText(apply(source.getLeftFromText(), destination.getLeftFromText()));<NEW_LINE>destination.setRightFromText(apply(source.getRightFromText(), destination.getRightFromText()));<NEW_LINE>destination.setTopFromText(apply(source.getTopFromText(), destination.getTopFromText()));<NEW_LINE>destination.setBottomFromText(apply(source.getBottomFromText(), destination.getBottomFromText()));<NEW_LINE>destination.setVertAnchor(source.getVertAnchor());<NEW_LINE>destination.setHorzAnchor(source.getHorzAnchor());<NEW_LINE>destination.setTblpXSpec(source.getTblpXSpec());<NEW_LINE>destination.setTblpX(apply(source.getTblpX(), destination.getTblpX()));<NEW_LINE>destination.<MASK><NEW_LINE>destination.setTblpY(apply(source.getTblpY(), destination.getTblpY()));<NEW_LINE>}<NEW_LINE>return destination;<NEW_LINE>}
setTblpYSpec(source.getTblpYSpec());
747,238
void recordRescanStepTimes(CMSRemark collection, String line) {<NEW_LINE>GCLogTrace clause;<NEW_LINE>double unloading = 0.0d, symbolTable = 0.0d, stringTable = 0.0d, stringAndSymbolTable = 0.0d;<NEW_LINE>if ((clause = CLASS_UNLOADING.parse(line)) != null)<NEW_LINE>unloading = clause.getDoubleGroup(2);<NEW_LINE>if ((clause = SYMBOL_TABLE_SCRUB.parse(line)) != null)<NEW_LINE><MASK><NEW_LINE>if ((clause = STRING_TABLE_SCRUB.parse(line)) != null)<NEW_LINE>stringTable = clause.getDoubleGroup(2);<NEW_LINE>if ((clause = STRING_AND_SYMBOL_SCRUB.parse(line)) != null)<NEW_LINE>stringAndSymbolTable = clause.getDoubleGroup(2);<NEW_LINE>collection.addClassUnloadingAndStringTableProcessingDurations(unloading, symbolTable, stringTable, stringAndSymbolTable);<NEW_LINE>}
symbolTable = clause.getDoubleGroup(2);
76,688
public final void typeIdentifier() throws RecognitionException, TokenStreamException {<NEW_LINE>returnAST = null;<NEW_LINE>ASTPair currentAST = new ASTPair();<NEW_LINE>PascalAST typeIdentifier_AST = null;<NEW_LINE>switch(LA(1)) {<NEW_LINE>case IDENT:<NEW_LINE>{<NEW_LINE>identifier();<NEW_LINE>astFactory.addASTChild(currentAST, returnAST);<NEW_LINE>typeIdentifier_AST = (PascalAST) currentAST.root;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case CHAR:<NEW_LINE>{<NEW_LINE>PascalAST tmp49_AST = null;<NEW_LINE>tmp49_AST = (PascalAST) astFactory.create(LT(1));<NEW_LINE>astFactory.addASTChild(currentAST, tmp49_AST);<NEW_LINE>match(CHAR);<NEW_LINE>typeIdentifier_AST = (PascalAST) currentAST.root;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case BOOLEAN:<NEW_LINE>{<NEW_LINE>PascalAST tmp50_AST = null;<NEW_LINE>tmp50_AST = (PascalAST) astFactory.create(LT(1));<NEW_LINE>astFactory.addASTChild(currentAST, tmp50_AST);<NEW_LINE>match(BOOLEAN);<NEW_LINE>typeIdentifier_AST = (PascalAST) currentAST.root;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case INTEGER:<NEW_LINE>{<NEW_LINE>PascalAST tmp51_AST = null;<NEW_LINE>tmp51_AST = (PascalAST) astFactory<MASK><NEW_LINE>astFactory.addASTChild(currentAST, tmp51_AST);<NEW_LINE>match(INTEGER);<NEW_LINE>typeIdentifier_AST = (PascalAST) currentAST.root;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case REAL:<NEW_LINE>{<NEW_LINE>PascalAST tmp52_AST = null;<NEW_LINE>tmp52_AST = (PascalAST) astFactory.create(LT(1));<NEW_LINE>astFactory.addASTChild(currentAST, tmp52_AST);<NEW_LINE>match(REAL);<NEW_LINE>typeIdentifier_AST = (PascalAST) currentAST.root;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case STRING:<NEW_LINE>{<NEW_LINE>PascalAST tmp53_AST = null;<NEW_LINE>tmp53_AST = (PascalAST) astFactory.create(LT(1));<NEW_LINE>astFactory.addASTChild(currentAST, tmp53_AST);<NEW_LINE>match(STRING);<NEW_LINE>typeIdentifier_AST = (PascalAST) currentAST.root;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>throw new NoViableAltException(LT(1), getFilename());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>returnAST = typeIdentifier_AST;<NEW_LINE>}
.create(LT(1));
1,497,463
public Request<StartOnDemandAuditTaskRequest> marshall(StartOnDemandAuditTaskRequest startOnDemandAuditTaskRequest) {<NEW_LINE>if (startOnDemandAuditTaskRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(StartOnDemandAuditTaskRequest)");<NEW_LINE>}<NEW_LINE>Request<StartOnDemandAuditTaskRequest> request = new DefaultRequest<StartOnDemandAuditTaskRequest>(startOnDemandAuditTaskRequest, "AWSIot");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/audit/tasks";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (startOnDemandAuditTaskRequest.getTargetCheckNames() != null) {<NEW_LINE>java.util.List<String> targetCheckNames = startOnDemandAuditTaskRequest.getTargetCheckNames();<NEW_LINE>jsonWriter.name("targetCheckNames");<NEW_LINE>jsonWriter.beginArray();<NEW_LINE>for (String targetCheckNamesItem : targetCheckNames) {<NEW_LINE>if (targetCheckNamesItem != null) {<NEW_LINE>jsonWriter.value(targetCheckNamesItem);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>jsonWriter.endArray();<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.addHeader("Content-Type", "application/x-amz-json-1.0");
1,529,625
private // begin F196678.10<NEW_LINE>int determineHeartbeatTimeout(Map properties) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(this, tc, "determineHeartbeatTimeout", properties);<NEW_LINE>// How often should we heartbeat?<NEW_LINE>int heartbeatTimeout = JFapChannelConstants.DEFAULT_HEARTBEAT_TIMEOUT;<NEW_LINE>try {<NEW_LINE>// 669424: using RuntimeInfo.getPropertyWithMsg as this would log a message<NEW_LINE>// when the property is different to the default value passed.<NEW_LINE>heartbeatTimeout = Integer.parseInt(RuntimeInfo.getPropertyWithMsg(JFapChannelConstants.RUNTIMEINFO_KEY_HEARTBEAT_TIMEOUT, "" + heartbeatTimeout));<NEW_LINE>} catch (NumberFormatException nfe) {<NEW_LINE>// No FFDC code needed<NEW_LINE>}<NEW_LINE>if (properties != null) {<NEW_LINE>String timeoutStr = (String) properties.get(JFapChannelConstants.CHANNEL_CONFIG_HEARTBEAT_TIMEOUT_PROPERTY);<NEW_LINE>if (timeoutStr != null) {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (NumberFormatException nfe) {<NEW_LINE>// No FFDC code needed<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(this, tc, "determineHeartbeatTimeout", heartbeatTimeout);<NEW_LINE>return heartbeatTimeout;<NEW_LINE>}
heartbeatTimeout = Integer.parseInt(timeoutStr);
1,752,020
private Object[] createInstrumentedMethodPack15() {<NEW_LINE>String[] instrMethodClasses = new String[nInstrClasses];<NEW_LINE>int[] instrClassLoaderIds = new int[nInstrClasses];<NEW_LINE>byte[][] replacementClassFileBytes <MASK><NEW_LINE>for (int j = 0; j < nInstrClasses; j++) {<NEW_LINE>DynamicClassInfo clazz = (DynamicClassInfo) instrClasses.get(j);<NEW_LINE>// NOI18N<NEW_LINE>instrMethodClasses[j] = clazz.getName().replace('/', '.');<NEW_LINE>instrClassLoaderIds[j] = clazz.getLoaderId();<NEW_LINE>// As an optimization, we now send just nulls for class file bytes to the server, who loads original class file bytes in place<NEW_LINE>// try {<NEW_LINE>// replacementClassFileBytes[j] = clazz.getClassFileBytes();<NEW_LINE>// } catch (IOException ex) {<NEW_LINE>// // Shouldn't happen, so a message just in case<NEW_LINE>// MiscUtils.internalError("MiscInstrumentationOps: can't get original class file bytes for class " + clazz.getName() + "\nIOException message = " + ex.getMessage());<NEW_LINE>// }<NEW_LINE>}<NEW_LINE>return new Object[] { instrMethodClasses, instrClassLoaderIds, replacementClassFileBytes };<NEW_LINE>}
= new byte[nInstrClasses][];
697,589
public <T1, T2, T3, R1, R2, R3, R> Higher<W1, R> forEach4(Higher<W1, T1> value1, Function<? super T1, ? extends Higher<W1, R1>> value2, BiFunction<? super T1, ? super R1, ? extends Higher<W1, R2>> value3, Function3<? super T1, ? super R1, ? super R2, ? extends Higher<W1, R3>> value4, Function4<? super T1, ? super R1, ? super R2, ? super R3, ? extends R> yieldingFunction) {<NEW_LINE>return monad.flatMap_(value1, in -> {<NEW_LINE>Higher<W1, R1> a = value2.apply(in);<NEW_LINE>return monad.flatMap_(a, ina -> {<NEW_LINE>Higher<W1, R2> b = value3.apply(in, ina);<NEW_LINE>return monad.flatMap_(b, inb -> {<NEW_LINE>Higher<W1, R3> c = value4.<MASK><NEW_LINE>return monad.map_(c, in2 -> yieldingFunction.apply(in, ina, inb, in2));<NEW_LINE>});<NEW_LINE>});<NEW_LINE>});<NEW_LINE>}
apply(in, ina, inb);
1,850,394
private String hashPassword(String password) {<NEW_LINE>int bcryptWork = Constants.DEFAULT_BCRYPT_WORK;<NEW_LINE>String envBcryptWork = System.getenv(Constants.BCRYPT_WORK_ENV);<NEW_LINE>if (!Strings.isNullOrEmpty(envBcryptWork)) {<NEW_LINE>try {<NEW_LINE>int <MASK><NEW_LINE>if (envBcryptWorkInt >= 4 && envBcryptWorkInt <= 31) {<NEW_LINE>bcryptWork = envBcryptWorkInt;<NEW_LINE>} else {<NEW_LINE>log.warn(Constants.BCRYPT_WORK_ENV + " needs to be in range 4...31. Falling back to " + Constants.DEFAULT_BCRYPT_WORK + ".");<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>log.warn(Constants.BCRYPT_WORK_ENV + " needs to be a number in range 4...31. Falling back to " + Constants.DEFAULT_BCRYPT_WORK + ".");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return BCrypt.withDefaults().hashToString(bcryptWork, password.toCharArray());<NEW_LINE>}
envBcryptWorkInt = Integer.parseInt(envBcryptWork);
1,011,654
private static void primeHTTPDeliveryServices(final String domain, final TrafficRouter tr, final LoadingCache<ZoneKey, Zone> dzc, final Zone zone, final DeliveryService ds, final CacheRegister data) throws TextParseException {<NEW_LINE>final Name edgeName = newName(ds.getRoutingName(), domain);<NEW_LINE>LOGGER.info("Priming " + edgeName);<NEW_LINE>final DNSRequest request = new DNSRequest(zone, edgeName, Type.A);<NEW_LINE>request.setDnssec(signatureManager.isDnssecEnabled());<NEW_LINE>// Name.toString(true) - omit the trailing dot<NEW_LINE>request.setHostname(edgeName.toString(true));<NEW_LINE>// prime the miss case first<NEW_LINE>try {<NEW_LINE>final DNSRouteResult result = new DNSRouteResult();<NEW_LINE>result.setAddresses(tr.selectTrafficRoutersMiss(request<MASK><NEW_LINE>fillDynamicZone(dzc, zone, request, result);<NEW_LINE>} catch (GeolocationException ex) {<NEW_LINE>LOGGER.warn(ex, ex);<NEW_LINE>}<NEW_LINE>// prime answers for each of our edge locations<NEW_LINE>for (final TrafficRouterLocation trLocation : data.getEdgeTrafficRouterLocations()) {<NEW_LINE>try {<NEW_LINE>final DNSRouteResult result = new DNSRouteResult();<NEW_LINE>result.setAddresses(tr.selectTrafficRoutersLocalized(trLocation.getGeolocation(), request.getZoneName(), ds));<NEW_LINE>fillDynamicZone(dzc, zone, request, result);<NEW_LINE>} catch (GeolocationException ex) {<NEW_LINE>LOGGER.warn(ex, ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getZoneName(), ds));
1,119,351
public boolean place(@Nonnull WorldGenLevel world, ChunkGenerator generator, Random rand, BlockPos pos, OreConfiguration config) {<NEW_LINE>float angle = rand.nextFloat() * (float) Math.PI;<NEW_LINE>float f1 = (float) config.size / 8.0F;<NEW_LINE>int i = Mth.ceil((f1 + 1.0F) / 2.0F);<NEW_LINE>float sin = Mth.sin(angle) * f1;<NEW_LINE>float cos = Mth.cos(angle) * f1;<NEW_LINE>double xStart = pos.getX() + sin;<NEW_LINE>double xEnd = pos.getX() - sin;<NEW_LINE>double zStart = pos.getZ() + cos;<NEW_LINE>double zEnd = pos.getZ() - cos;<NEW_LINE>double yStart = pos.getY() + rand.nextInt(3) - 2;<NEW_LINE>double yEnd = pos.getY() + rand.nextInt(3) - 2;<NEW_LINE>int k = pos.getX() - Mth.ceil(f1) - i;<NEW_LINE>int l = pos.getY() - 2 - i;<NEW_LINE>int i1 = pos.getZ() - Mth.ceil(f1) - i;<NEW_LINE>int j1 = 2 * (Mth.ceil(f1) + i);<NEW_LINE>int k1 <MASK><NEW_LINE>for (int l1 = k; l1 <= k + j1; ++l1) {<NEW_LINE>for (int i2 = i1; i2 <= i1 + j1; ++i2) {<NEW_LINE>// Use OCEAN_FLOOR instead of OCEAN_FLOOR_WG as the chunks are already generated<NEW_LINE>if (l <= world.getHeight(Heightmap.Types.OCEAN_FLOOR, l1, i2)) {<NEW_LINE>return this.doPlace(world, rand, config, xStart, xEnd, zStart, zEnd, yStart, yEnd, k, l, i1, j1, k1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
= 2 * (2 + i);
1,774,408
public void changeEvent(final IChangeRecord record) {<NEW_LINE>if (log.isTraceEnabled()) {<NEW_LINE>log.trace(record);<NEW_LINE>}<NEW_LINE>{<NEW_LINE>final IV<?, ?> p = record.getStatement().p();<NEW_LINE>if (added.equals(p) || removed.equals(p)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!accept(record)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ChangeAction action = record.getChangeAction();<NEW_LINE>if (!(action == ChangeAction.INSERTED || action == ChangeAction.REMOVED)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final IV<?, ?> p = action <MASK><NEW_LINE>@SuppressWarnings("rawtypes")<NEW_LINE>final SidIV sid = new SidIV(record.getStatement());<NEW_LINE>final ISPO spo = new SPO(sid, p, nullTime, StatementEnum.Explicit);<NEW_LINE>if (log.isTraceEnabled()) {<NEW_LINE>log.trace(spo);<NEW_LINE>}<NEW_LINE>getOrCreateBuffer().add(spo);<NEW_LINE>}
== ChangeAction.INSERTED ? added : removed;
115,778
private void evalCPU() {<NEW_LINE>int small = Evaluate.evaluateTrain(2, 4, 0, 1);<NEW_LINE>this.report.report(EncogBenchmark.STEPS, EncogBenchmark.STEP1, "Evaluate CPU, tiny= " + Format.formatInteger(small / 100));<NEW_LINE>int medium = Evaluate.evaluateTrain(10, 20, 0, 1);<NEW_LINE>this.report.report(EncogBenchmark.STEPS, EncogBenchmark.STEP1, "Evaluate CPU, small= " + Format.formatInteger(medium / 30));<NEW_LINE>int large = Evaluate.evaluateTrain(100, 200, 40, 5);<NEW_LINE>this.report.report(EncogBenchmark.STEPS, EncogBenchmark.STEP1, "Evaluate CPU, large= " <MASK><NEW_LINE>int huge = Evaluate.evaluateTrain(200, 300, 200, 50);<NEW_LINE>this.report.report(EncogBenchmark.STEPS, EncogBenchmark.STEP1, "Evaluate CPU, huge= " + Format.formatInteger(huge));<NEW_LINE>int result = (small / 100) + (medium / 30) + large + huge;<NEW_LINE>this.report.report(EncogBenchmark.STEPS, EncogBenchmark.STEP1, "CPU result: " + result);<NEW_LINE>this.cpuScore = result;<NEW_LINE>}
+ Format.formatInteger(large));
376,607
public FlagDefinition removeFlagDefinition(FlagDefinition flagDefinition) {<NEW_LINE>if (_flagDefinitions.containsValue(flagDefinition)) {<NEW_LINE>// Remove from category list<NEW_LINE>Set<FlagDefinition> categoryDefinitions = _flagCategories.get(flagDefinition.getCategory());<NEW_LINE>categoryDefinitions.remove(flagDefinition);<NEW_LINE>// Remove category if this was the last flag definition<NEW_LINE>if (categoryDefinitions.size() == 0) {<NEW_LINE>_flagCategories.remove(flagDefinition.getCategory());<NEW_LINE>}<NEW_LINE>// Remove any require/preclude reference to this category<NEW_LINE>for (FlagDefinition def : _flagDefinitions.values()) {<NEW_LINE>if (def.getRequires().containsKey(flagDefinition.getId())) {<NEW_LINE>def.<MASK><NEW_LINE>}<NEW_LINE>if (def.getPrecludes().containsKey(flagDefinition.getId())) {<NEW_LINE>def.removePrecludes(flagDefinition.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return _flagDefinitions.remove(flagDefinition.getId());<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
removeRequires(flagDefinition.getId());
772,568
private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String locationName, String failoverGroupName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (locationName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (failoverGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter failoverGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2017-10-01-preview";<NEW_LINE>context = <MASK><NEW_LINE>return service.delete(this.client.getEndpoint(), resourceGroupName, locationName, failoverGroupName, this.client.getSubscriptionId(), apiVersion, context);<NEW_LINE>}
this.client.mergeContext(context);
925,890
protected final void mINT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {<NEW_LINE>int _ttype;<NEW_LINE>Token _token = null;<NEW_LINE><MASK><NEW_LINE>_ttype = INT;<NEW_LINE>int _saveIndex;<NEW_LINE>{<NEW_LINE>int _cnt610 = 0;<NEW_LINE>_loop610: do {<NEW_LINE>if (((LA(1) >= '0' && LA(1) <= '9'))) {<NEW_LINE>mDIGIT(false);<NEW_LINE>} else {<NEW_LINE>if (_cnt610 >= 1) {<NEW_LINE>break _loop610;<NEW_LINE>} else {<NEW_LINE>throw new NoViableAltForCharException((char) LA(1), getFilename(), getLine(), getColumn());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>_cnt610++;<NEW_LINE>} while (true);<NEW_LINE>}<NEW_LINE>if (_createToken && _token == null && _ttype != Token.SKIP) {<NEW_LINE>_token = makeToken(_ttype);<NEW_LINE>_token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));<NEW_LINE>}<NEW_LINE>_returnToken = _token;<NEW_LINE>}
int _begin = text.length();
928,386
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see<NEW_LINE>* com.vaadin.client.ui.AbstractComponentConnector#onStateChanged(com.vaadin<NEW_LINE>* .client.communication.StateChangeEvent)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void onStateChanged(StateChangeEvent stateChangeEvent) {<NEW_LINE>super.onStateChanged(stateChangeEvent);<NEW_LINE>clickEventHandler.handleEventHandlerRegistration();<NEW_LINE>for (ComponentConnector child : getChildComponents()) {<NEW_LINE>if (!getState().childCss.containsKey(child)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String css = getState().childCss.get(child);<NEW_LINE>Style style = child.getWidget()<MASK><NEW_LINE>// should we remove styles also? How can we know what we have added<NEW_LINE>// as it is added directly to the child component?<NEW_LINE>String[] cssRules = css.split(";");<NEW_LINE>for (String cssRule : cssRules) {<NEW_LINE>String[] parts = cssRule.split(":", 2);<NEW_LINE>if (parts.length == 2) {<NEW_LINE>style.setProperty(makeCamelCase(parts[0].trim()), parts[1].trim());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getElement().getStyle();
1,590,317
static SecretKey decryptAesKey(@NonNull byte[] encryptedAesKey) throws CryptoException {<NEW_LINE>// We only have 32/64 bytes AES key with either 256 or 512 bytes minus 42 bytes of data,<NEW_LINE>// so it should work without issues<NEW_LINE>KeyPair keyPair;<NEW_LINE>try {<NEW_LINE>KeyStoreManager keyStoreManager = KeyStoreManager.getInstance();<NEW_LINE>keyPair = keyStoreManager.getKeyPair(RSA_KEY_ALIAS);<NEW_LINE>if (keyPair == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new CryptoException(e);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Cipher cipher = Cipher.getInstance(RSA_CIPHER_TYPE);<NEW_LINE>cipher.init(Cipher.DECRYPT_MODE, keyPair.getPrivateKey());<NEW_LINE>return new SecretKeySpec(cipher.doFinal(encryptedAesKey), "AES");<NEW_LINE>} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | BadPaddingException | IllegalBlockSizeException e) {<NEW_LINE>throw new CryptoException(e);<NEW_LINE>}<NEW_LINE>}
throw new CryptoException("No KeyPair with alias " + RSA_KEY_ALIAS);
679,930
private Mono<Response<Flux<ByteBuffer>>> createOrUpdateWithResponseAsync(String resourceGroupName, String clusterName, ClusterInner parameters, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (clusterName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, this.client.getApiVersion(), parameters, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
634,608
public static <T> RBFNetwork<T> fit(T[] x, double[] y, RBF<T>[] rbf, boolean normalized) {<NEW_LINE>if (x.length != y.length) {<NEW_LINE>throw new IllegalArgumentException(String.format("The sizes of X and Y don't match: %d != %d", x.length, y.length));<NEW_LINE>}<NEW_LINE>int n = x.length;<NEW_LINE>int m = rbf.length;<NEW_LINE>Matrix G = new Matrix(n, m);<NEW_LINE>double[] b = new double[n];<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>double sum = 0.0;<NEW_LINE>for (int j = 0; j < m; j++) {<NEW_LINE>double r = rbf[j].f(x[i]);<NEW_LINE>G.set(i, j, r);<NEW_LINE>sum += r;<NEW_LINE>}<NEW_LINE>if (normalized) {<NEW_LINE>b[i] = sum * y[i];<NEW_LINE>} else {<NEW_LINE>b[i] = y[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Matrix.QR qr = G.qr(true);<NEW_LINE>double[] <MASK><NEW_LINE>return new RBFNetwork<>(rbf, w, normalized);<NEW_LINE>}
w = qr.solve(b);
46,795
public static void replicatedMapYamlGenerator(Map<String, Object> parent, Config config) {<NEW_LINE>if (config.getReplicatedMapConfigs().isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, Object> child = new LinkedHashMap<>();<NEW_LINE>for (ReplicatedMapConfig subConfigAsObject : config.getReplicatedMapConfigs().values()) {<NEW_LINE>Map<String, Object> subConfigAsMap = new LinkedHashMap<>();<NEW_LINE>addNonNullToMap(subConfigAsMap, "in-memory-format", subConfigAsObject.getInMemoryFormat().name());<NEW_LINE>addNonNullToMap(subConfigAsMap, "async-fillup", subConfigAsObject.isAsyncFillup());<NEW_LINE>addNonNullToMap(subConfigAsMap, "statistics-enabled", subConfigAsObject.isStatisticsEnabled());<NEW_LINE>addNonNullToMap(subConfigAsMap, "split-brain-protection-ref", subConfigAsObject.getSplitBrainProtectionName());<NEW_LINE>addNonNullToMap(subConfigAsMap, "merge-policy", getMergePolicyConfigAsMap(subConfigAsObject.getMergePolicyConfig()));<NEW_LINE>addNonNullToMap(subConfigAsMap, "entry-listeners", getEntryListenerConfigsAsList(subConfigAsObject.getListenerConfigs()));<NEW_LINE>child.put(subConfigAsObject.getName(), subConfigAsMap);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}
parent.put("replicatedmap", child);
575,731
public static boolean parseNorms(FieldMapper.Builder builder, String fieldName, String propName, Object propNode, Mapper.TypeParser.ParserContext parserContext) {<NEW_LINE>if (propName.equals("norms")) {<NEW_LINE>if (propNode instanceof Map) {<NEW_LINE>final Map<String, Object> properties = nodeMapValue(propNode, "norms");<NEW_LINE>for (Iterator<Entry<String, Object>> propsIterator = properties.entrySet().iterator(); propsIterator.hasNext(); ) {<NEW_LINE>Entry<String, Object> entry2 = propsIterator.next();<NEW_LINE>final String propName2 = entry2.getKey();<NEW_LINE>final Object propNode2 = entry2.getValue();<NEW_LINE>if (propName2.equals("enabled")) {<NEW_LINE>builder.omitNorms(nodeBooleanValue(fieldName, "enabled", propNode2, parserContext) == false);<NEW_LINE>propsIterator.remove();<NEW_LINE>} else if (propName2.equals("loading")) {<NEW_LINE>// ignore for bw compat<NEW_LINE>propsIterator.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>DocumentMapperParser.checkNoRemainingFields(propName, properties, parserContext.indexVersionCreated());<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>builder.omitNorms(nodeBooleanValue(fieldName, "norms", propNode, parserContext) == false);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} else if (propName.equals("omit_norms")) {<NEW_LINE>builder.omitNorms(nodeBooleanValue(fieldName, "norms", propNode, parserContext));<NEW_LINE>DEPRECATION_LOGGER.deprecated("[omit_norms] is deprecated, please use [norms] instead with the opposite boolean value");<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
DEPRECATION_LOGGER.deprecated("The [norms{enabled:true/false}] way of specifying norms is deprecated, please use " + "[norms:true/false] instead");
983,201
private static void prepareData() throws IoTDBConnectionException, StatementExecutionException {<NEW_LINE>Session session = new Session(LOCAL_HOST, 6667, "root", "root");<NEW_LINE>session.open(false);<NEW_LINE>try {<NEW_LINE>session.setStorageGroup("root.sg1");<NEW_LINE>if (!session.checkTimeseriesExists(ROOT_SG1_D1_S1)) {<NEW_LINE>session.createTimeseries(ROOT_SG1_D1_S1, TSDataType.INT64, TSEncoding.RLE, CompressionType.SNAPPY);<NEW_LINE>List<String> measurements = new ArrayList<>();<NEW_LINE>measurements.add("s1");<NEW_LINE>measurements.add("s2");<NEW_LINE>measurements.add("s3");<NEW_LINE>List<TSDataType> types = new ArrayList<>();<NEW_LINE><MASK><NEW_LINE>types.add(TSDataType.INT64);<NEW_LINE>types.add(TSDataType.INT64);<NEW_LINE>for (long time = 0; time < 100; time++) {<NEW_LINE>List<Object> values = new ArrayList<>();<NEW_LINE>values.add(1L);<NEW_LINE>values.add(2L);<NEW_LINE>values.add(3L);<NEW_LINE>session.insertRecord(ROOT_SG1_D1, time, measurements, types, values);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (StatementExecutionException e) {<NEW_LINE>if (e.getStatusCode() != TSStatusCode.PATH_ALREADY_EXIST_ERROR.getStatusCode()) {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
types.add(TSDataType.INT64);
274,489
public OutlierMetrics toMetrics() {<NEW_LINE>String[] labelStrs = new String[labels.length];<NEW_LINE>for (int i = 0; i < labels.length; i++) {<NEW_LINE>labelStrs[i] = labels[i].toString();<NEW_LINE>}<NEW_LINE>Params params = new Params();<NEW_LINE>Tuple3<ConfusionMatrix[], double[], EvaluationCurve[]> <MASK><NEW_LINE>setCurveAreaParams(params, threshCurves.f2);<NEW_LINE>if (threshCMs.isEmpty()) {<NEW_LINE>params.set(BinaryClassMetrics.AUC, Double.NaN);<NEW_LINE>}<NEW_LINE>// TODO: sample curves<NEW_LINE>setCurvePointsParams(params, threshCurves);<NEW_LINE>ConfusionMatrix[] matrices = threshCurves.f0;<NEW_LINE>setComputationsArrayParams(params, threshCurves.f1, threshCurves.f0);<NEW_LINE>double decisionThreshold = (minOutlierScore + maxNormalScore) / 2.;<NEW_LINE>int middleIndex = getMiddleThresholdIndex(threshCurves.f1, decisionThreshold);<NEW_LINE>setMiddleThreParams(params, matrices[middleIndex], labelStrs);<NEW_LINE>params.set(OutlierMetrics.OUTLIER_VALUE_ARRAY, outlierValueStrings);<NEW_LINE>params.set(OutlierMetrics.LABEL_ARRAY, allValueStrings);<NEW_LINE>return new OutlierMetrics(params);<NEW_LINE>}
threshCurves = extractThreshCurves(threshCMs, total);
135,665
public void subscribe(URL url, NotifyListener listener) {<NEW_LINE>super.subscribe(url, listener);<NEW_LINE>removeFailedSubscribed(url, listener);<NEW_LINE>try {<NEW_LINE>// Sending a subscription request to the server side<NEW_LINE>doSubscribe(url, listener);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Throwable t = e;<NEW_LINE>List<URL> urls = getCacheUrls(url);<NEW_LINE>if (CollectionUtils.isNotEmpty(urls)) {<NEW_LINE>notify(url, listener, urls);<NEW_LINE>logger.error("Failed to subscribe " + url + ", Using cached list: " + urls + " from cache file: " + getCacheFile().getName() + ", cause: " + t.getMessage(), t);<NEW_LINE>} else {<NEW_LINE>// If the startup detection is opened, the Exception is thrown directly.<NEW_LINE>boolean check = getUrl().getParameter(Constants.CHECK_KEY, true) && url.getParameter(Constants.CHECK_KEY, true);<NEW_LINE>boolean skipFailback = t instanceof SkipFailbackWrapperException;<NEW_LINE>if (check || skipFailback) {<NEW_LINE>if (skipFailback) {<NEW_LINE>t = t.getCause();<NEW_LINE>}<NEW_LINE>throw new IllegalStateException("Failed to subscribe " + url + ", cause: " + <MASK><NEW_LINE>} else {<NEW_LINE>logger.error("Failed to subscribe " + url + ", waiting for retry, cause: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Record a failed registration request to a failed list, retry regularly<NEW_LINE>addFailedSubscribed(url, listener);<NEW_LINE>}<NEW_LINE>}
t.getMessage(), t);
394,743
public void validate(Update update) {<NEW_LINE>for (ValidationCapability c : getCapabilities()) {<NEW_LINE>validateFeature(c, Feature.update);<NEW_LINE>validateOptionalFeature(c, update.getFromItem(), Feature.updateFrom);<NEW_LINE>validateOptionalFeature(c, update.getStartJoins(), Feature.updateJoins);<NEW_LINE>validateFeature(c, update.isUseSelect(), Feature.updateUseSelect);<NEW_LINE>validateOptionalFeature(c, update.getOrderByElements(), Feature.updateOrderBy);<NEW_LINE>validateOptionalFeature(c, update.getLimit(), Feature.updateLimit);<NEW_LINE>if (isNotEmpty(update.getReturningExpressionList()) || update.isReturningAllColumns()) {<NEW_LINE>validateFeature(c, Feature.updateReturning);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>validateOptionalFromItem(update.getTable());<NEW_LINE>validateOptional(update.getStartJoins(), j -> getValidator(SelectValidator.class).validateOptionalJoins(j));<NEW_LINE>if (update.isUseSelect()) {<NEW_LINE>validateOptionalExpressions(update.getColumns());<NEW_LINE>validateOptional(update.getSelect(), e -> e.getSelectBody().accept(getValidator(SelectValidator.class)));<NEW_LINE>} else {<NEW_LINE>validateOptionalExpressions(update.getColumns());<NEW_LINE>validateOptionalExpressions(update.getExpressions());<NEW_LINE>}<NEW_LINE>if (update.getFromItem() != null) {<NEW_LINE>validateOptionalFromItem(update.getFromItem());<NEW_LINE>validateOptional(update.getJoins(), j -> getValidator(SelectValidator.class).validateOptionalJoins(j));<NEW_LINE>}<NEW_LINE>validateOptionalExpression(update.getWhere());<NEW_LINE><MASK><NEW_LINE>if (update.getLimit() != null) {<NEW_LINE>getValidator(LimitValidator.class).validate(update.getLimit());<NEW_LINE>}<NEW_LINE>if (update.getReturningExpressionList() != null) {<NEW_LINE>validateOptionalExpressions(update.getReturningExpressionList().stream().map(SelectExpressionItem::getExpression).collect(Collectors.toList()));<NEW_LINE>}<NEW_LINE>}
validateOptionalOrderByElements(update.getOrderByElements());
1,303,542
public void draw(Batch batch, float parentAlpha) {<NEW_LINE>validate();<NEW_LINE>drawBackground(batch, parentAlpha);<NEW_LINE>BitmapFont font = style.font;<NEW_LINE>Drawable selectedDrawable = style.selection;<NEW_LINE>Color fontColorSelected = style.fontColorSelected;<NEW_LINE>Color fontColorUnselected = style.fontColorUnselected;<NEW_LINE>Color color = getColor();<NEW_LINE>batch.setColor(color.r, color.g, color.b, color.a * parentAlpha);<NEW_LINE>float x = getX(), y = getY(), width = getWidth(), height = getHeight();<NEW_LINE>float itemY = height;<NEW_LINE>Drawable background = style.background;<NEW_LINE>if (background != null) {<NEW_LINE>float leftWidth = background.getLeftWidth();<NEW_LINE>x += leftWidth;<NEW_LINE>itemY -= background.getTopHeight();<NEW_LINE>width <MASK><NEW_LINE>}<NEW_LINE>float textOffsetX = selectedDrawable.getLeftWidth(), textWidth = width - textOffsetX - selectedDrawable.getRightWidth();<NEW_LINE>float textOffsetY = selectedDrawable.getTopHeight() - font.getDescent();<NEW_LINE>font.setColor(fontColorUnselected.r, fontColorUnselected.g, fontColorUnselected.b, fontColorUnselected.a * parentAlpha);<NEW_LINE>for (int i = 0; i < items.size; i++) {<NEW_LINE>if (cullingArea == null || (itemY - itemHeight <= cullingArea.y + cullingArea.height && itemY >= cullingArea.y)) {<NEW_LINE>T item = items.get(i);<NEW_LINE>boolean selected = selection.contains(item);<NEW_LINE>Drawable drawable = null;<NEW_LINE>if (pressedIndex == i && style.down != null)<NEW_LINE>drawable = style.down;<NEW_LINE>else if (selected) {<NEW_LINE>drawable = selectedDrawable;<NEW_LINE>font.setColor(fontColorSelected.r, fontColorSelected.g, fontColorSelected.b, fontColorSelected.a * parentAlpha);<NEW_LINE>} else if (//<NEW_LINE>overIndex == i && style.over != null)<NEW_LINE>drawable = style.over;<NEW_LINE>drawSelection(batch, drawable, x, y + itemY - itemHeight, width, itemHeight);<NEW_LINE>drawItem(batch, font, i, item, x + textOffsetX, y + itemY - textOffsetY, textWidth);<NEW_LINE>if (selected) {<NEW_LINE>font.setColor(fontColorUnselected.r, fontColorUnselected.g, fontColorUnselected.b, fontColorUnselected.a * parentAlpha);<NEW_LINE>}<NEW_LINE>} else if (itemY < cullingArea.y) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>itemY -= itemHeight;<NEW_LINE>}<NEW_LINE>}
-= leftWidth + background.getRightWidth();
89,278
public static void send(@NotNull final Socket socket, final String host, final int port) throws IOException, SocksException {<NEW_LINE>final InputStream inputStream = socket.getInputStream();<NEW_LINE>final OutputStream outputStream = socket.getOutputStream();<NEW_LINE>final int lengthOfHost = host.getBytes(UTF_8).length;<NEW_LINE>final byte[] bufferSent = new byte[7 + lengthOfHost];<NEW_LINE>bufferSent[0] = SOCKS_VERSION;<NEW_LINE>bufferSent[1] = (byte) COMMAND_CONNECT;<NEW_LINE>bufferSent[2] = RESERVED;<NEW_LINE>bufferSent[3] = ATYPE_DOMAINNAME;<NEW_LINE>bufferSent[4] = (byte) lengthOfHost;<NEW_LINE>final byte[] bytesOfHost = host.getBytes(UTF_8);<NEW_LINE>// copy host bytes.<NEW_LINE>System.arraycopy(bytesOfHost, 0, bufferSent, 5, lengthOfHost);<NEW_LINE>bufferSent[5 + host.length()] = (byte) ((port & 0xff00) >> 8);<NEW_LINE>bufferSent[6 + host.length()] = <MASK><NEW_LINE>outputStream.write(bufferSent);<NEW_LINE>outputStream.flush();<NEW_LINE>LOGGER.trace("{}", MiscUtil.buildLogStringForSOCKSCommunication(bufferSent, false));<NEW_LINE>checkServerReply(inputStream);<NEW_LINE>}
(byte) (port & 0xff);
104,394
void encode(PgEncoder encoder) {<NEW_LINE>this.encoder = encoder;<NEW_LINE>if (cmd.isSuspended()) {<NEW_LINE>encoder.writeExecute(cmd.cursorId(), cmd.fetch());<NEW_LINE>encoder.writeSync();<NEW_LINE>} else {<NEW_LINE>PgPreparedStatement ps = (PgPreparedStatement) cmd.preparedStatement();<NEW_LINE>if (cmd.isBatch()) {<NEW_LINE>if (cmd.paramsList().isEmpty()) {<NEW_LINE>// We set suspended to false as we won't get a command complete command back from Postgres<NEW_LINE>this.result = false;<NEW_LINE>completionHandler.handle<MASK><NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>for (Tuple param : cmd.paramsList()) {<NEW_LINE>encoder.writeBind(ps.bind, cmd.cursorId(), param);<NEW_LINE>encoder.writeExecute(cmd.cursorId(), cmd.fetch());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>encoder.writeBind(ps.bind, cmd.cursorId(), cmd.params());<NEW_LINE>encoder.writeExecute(cmd.cursorId(), cmd.fetch());<NEW_LINE>}<NEW_LINE>encoder.writeSync();<NEW_LINE>}<NEW_LINE>}
(CommandResponse.failure("Can not execute batch query with 0 sets of batch parameters."));
1,088,638
public static void main(String[] args) throws Exception {<NEW_LINE>SystemProperties.getDefault().overrideParams("database.dir", "");<NEW_LINE>Source<byte[], byte[]> index = CommonConfig.getDefault().cachedDbSource("index");<NEW_LINE>Source<byte[], byte[]> blockDS = CommonConfig.getDefault().cachedDbSource("block");<NEW_LINE>IndexedBlockStore indexedBlockStore = new IndexedBlockStore();<NEW_LINE><MASK><NEW_LINE>for (int i = 1_919_990; i < 1_921_000; i++) {<NEW_LINE>Block chainBlock = indexedBlockStore.getChainBlockByNumber(i);<NEW_LINE>List<Block> blocks = indexedBlockStore.getBlocksByNumber(i);<NEW_LINE>String s = chainBlock.getShortDescr() + " (";<NEW_LINE>for (Block block : blocks) {<NEW_LINE>if (!block.isEqual(chainBlock)) {<NEW_LINE>s += block.getShortDescr() + " ";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println(s);<NEW_LINE>}<NEW_LINE>}
indexedBlockStore.init(index, blockDS);
1,658,872
public void run(final WorkingCopy working) throws IOException {<NEW_LINE>working.toPhase(Phase.RESOLVED);<NEW_LINE>TypeElement targetType = target.resolve(working);<NEW_LINE>if (targetType == null) {<NEW_LINE>// NOI18N<NEW_LINE>ErrorHintsProvider.LOG.log(Level.INFO, "Cannot resolve target.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ClassTree targetTree = working.getTrees().getTree(targetType);<NEW_LINE>if (targetTree == null) {<NEW_LINE>// NOI18N<NEW_LINE>ErrorHintsProvider.LOG.log(Level.INFO, "Cannot resolve target tree: " + targetType.getQualifiedName() + ".");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TypeMirror proposedType = CreateEnumConstant.this.proposedType.resolve(working);<NEW_LINE><MASK><NEW_LINE>// XXX enum flag. Creation of enum constant should be part of TreeMaker<NEW_LINE>int mods = 1 << 14;<NEW_LINE>ModifiersTree modds = make.Modifiers(mods, Collections.<AnnotationTree>emptyList());<NEW_LINE>VariableTree var = make.Variable(modds, name, make.Type(proposedType), null);<NEW_LINE>List<? extends Tree> members = targetTree.getMembers();<NEW_LINE>ArrayList<Tree> newMembers = new ArrayList<Tree>(members);<NEW_LINE>int pos = -1;<NEW_LINE>for (Iterator<? extends Tree> it = members.iterator(); it.hasNext(); ) {<NEW_LINE>Tree t = it.next();<NEW_LINE>if (t.getKind() == Kind.VARIABLE && working.getTreeUtilities().isEnumConstant((VariableTree) t)) {<NEW_LINE>pos = members.indexOf(t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>newMembers.add(pos + 1, var);<NEW_LINE>ClassTree enumm = make.Enum(targetTree.getModifiers(), targetTree.getSimpleName(), targetTree.getImplementsClause(), newMembers);<NEW_LINE>// ClassTree decl = GeneratorUtilities.get(working).insertClassMember(targetTree, var);<NEW_LINE>working.rewrite(targetTree, enumm);<NEW_LINE>}
TreeMaker make = working.getTreeMaker();
1,034,269
public static Expression parse(final String expression) {<NEW_LINE>CompilerConfiguration cc = new CompilerConfiguration();<NEW_LINE>cc.setScriptBaseClass(DelegatingScript.class.getName());<NEW_LINE>ImportCustomizer icz = new ImportCustomizer();<NEW_LINE>icz.addImport("K8sRetagType", K8sRetagType.class.getName());<NEW_LINE>icz.addImport("DetectPoint", DetectPoint.class.getName());<NEW_LINE>icz.addImport("Layer", Layer.class.getName());<NEW_LINE>cc.addCompilationCustomizers(icz);<NEW_LINE>final SecureASTCustomizer secureASTCustomizer = new SecureASTCustomizer();<NEW_LINE>secureASTCustomizer.setDisallowedStatements(ImmutableList.<Class<? extends Statement>>builder().add(WhileStatement.class).add(DoWhileStatement.class).add(ForStatement<MASK><NEW_LINE>// noinspection rawtypes<NEW_LINE>secureASTCustomizer.setAllowedReceiversClasses(ImmutableList.<Class>builder().add(Object.class).add(Map.class).add(List.class).add(Array.class).add(K8sRetagType.class).add(DetectPoint.class).add(Layer.class).build());<NEW_LINE>cc.addCompilationCustomizers(secureASTCustomizer);<NEW_LINE>GroovyShell sh = new GroovyShell(new Binding(), cc);<NEW_LINE>DelegatingScript script = (DelegatingScript) sh.parse(expression);<NEW_LINE>return new Expression(expression, script);<NEW_LINE>}
.class).build());
1,660,414
public Set<EventBean> lookup(EventBean theEvent, Map parent, Set<EventBean> result, CompositeIndexQuery next, ExprEvaluatorContext context, ArrayList<Object> optionalKeyCollector, CompositeIndexQueryResultPostProcessor postProcessor) {<NEW_LINE>Object comparableStart = <MASK><NEW_LINE>if (optionalKeyCollector != null) {<NEW_LINE>optionalKeyCollector.add(comparableStart);<NEW_LINE>}<NEW_LINE>if (comparableStart == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Object comparableEnd = super.evaluateLookupEnd(theEvent, context);<NEW_LINE>if (optionalKeyCollector != null) {<NEW_LINE>optionalKeyCollector.add(comparableEnd);<NEW_LINE>}<NEW_LINE>if (comparableEnd == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>TreeMap index = (TreeMap) parent;<NEW_LINE>SortedMap<Object, Set<EventBean>> submapOne = index.headMap(comparableStart, !includeStart);<NEW_LINE>SortedMap<Object, Set<EventBean>> submapTwo = index.tailMap(comparableEnd, !includeEnd);<NEW_LINE>return CompositeIndexQueryRange.handle(theEvent, submapOne, submapTwo, result, next, postProcessor);<NEW_LINE>}
super.evaluateLookupStart(theEvent, context);
1,026,859
private void onMouseDoubleClick(MouseEvent e) {<NEW_LINE>if (e.button == 1) {<NEW_LINE>if (hoveringOnColumnResizer) {<NEW_LINE>columnBeingResized.pack(true);<NEW_LINE>resizingColumn = false;<NEW_LINE>scrollValuesObsolete = true;<NEW_LINE>handleHoverOnColumnHeader(e.x, e.y);<NEW_LINE>redraw();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Point point = new Point(e.x, e.y);<NEW_LINE>int row = getRow(point);<NEW_LINE>GridColumn col = getColumn(point);<NEW_LINE>if (row >= 0) {<NEW_LINE>if (col != null) {<NEW_LINE>if (isListening(SWT.DefaultSelection)) {<NEW_LINE>Event newEvent = new Event();<NEW_LINE>newEvent.data = new GridCell(col.getElement(), rowElements[row]);<NEW_LINE>notifyListeners(SWT.DefaultSelection, newEvent);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>GridNode node = rowNodes<MASK><NEW_LINE>GridNode parentNode = parentNodes[row];<NEW_LINE>if (node != null && node.state != IGridContentProvider.ElementState.NONE) {<NEW_LINE>if (!GridRowRenderer.isOverExpander(e.x, parentNode == null ? 0 : parentNode.level)) {<NEW_LINE>toggleRowState(row);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.get(rowElements[row]);
158,510
public static DescribeVulDetailsResponse unmarshall(DescribeVulDetailsResponse describeVulDetailsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeVulDetailsResponse.setRequestId(_ctx.stringValue("DescribeVulDetailsResponse.RequestId"));<NEW_LINE>List<Cve> cves = new ArrayList<Cve>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeVulDetailsResponse.Cves.Length"); i++) {<NEW_LINE>Cve cve = new Cve();<NEW_LINE>cve.setCveId(_ctx.stringValue("DescribeVulDetailsResponse.Cves[" + i + "].CveId"));<NEW_LINE>cve.setCnvdId(_ctx.stringValue("DescribeVulDetailsResponse.Cves[" + i + "].CnvdId"));<NEW_LINE>cve.setTitle(_ctx.stringValue("DescribeVulDetailsResponse.Cves[" + i + "].Title"));<NEW_LINE>cve.setCvssScore(_ctx.stringValue("DescribeVulDetailsResponse.Cves[" + i + "].CvssScore"));<NEW_LINE>cve.setCvssVector(_ctx.stringValue<MASK><NEW_LINE>cve.setReleaseTime(_ctx.longValue("DescribeVulDetailsResponse.Cves[" + i + "].ReleaseTime"));<NEW_LINE>cve.setComplexity(_ctx.stringValue("DescribeVulDetailsResponse.Cves[" + i + "].Complexity"));<NEW_LINE>cve.setPoc(_ctx.stringValue("DescribeVulDetailsResponse.Cves[" + i + "].Poc"));<NEW_LINE>cve.setPocCreateTime(_ctx.longValue("DescribeVulDetailsResponse.Cves[" + i + "].PocCreateTime"));<NEW_LINE>cve.setPocDisclosureTime(_ctx.longValue("DescribeVulDetailsResponse.Cves[" + i + "].PocDisclosureTime"));<NEW_LINE>cve.setSummary(_ctx.stringValue("DescribeVulDetailsResponse.Cves[" + i + "].Summary"));<NEW_LINE>cve.setSolution(_ctx.stringValue("DescribeVulDetailsResponse.Cves[" + i + "].Solution"));<NEW_LINE>cve.setContent(_ctx.stringValue("DescribeVulDetailsResponse.Cves[" + i + "].Content"));<NEW_LINE>cve.setVendor(_ctx.stringValue("DescribeVulDetailsResponse.Cves[" + i + "].Vendor"));<NEW_LINE>cve.setProduct(_ctx.stringValue("DescribeVulDetailsResponse.Cves[" + i + "].Product"));<NEW_LINE>cve.setVulLevel(_ctx.stringValue("DescribeVulDetailsResponse.Cves[" + i + "].VulLevel"));<NEW_LINE>cve.setReference(_ctx.stringValue("DescribeVulDetailsResponse.Cves[" + i + "].Reference"));<NEW_LINE>cve.setClassify(_ctx.stringValue("DescribeVulDetailsResponse.Cves[" + i + "].Classify"));<NEW_LINE>List<Classify> classifys = new ArrayList<Classify>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeVulDetailsResponse.Cves[" + i + "].Classifys.Length"); j++) {<NEW_LINE>Classify classify = new Classify();<NEW_LINE>classify.setClassify(_ctx.stringValue("DescribeVulDetailsResponse.Cves[" + i + "].Classifys[" + j + "].Classify"));<NEW_LINE>classify.setDescription(_ctx.stringValue("DescribeVulDetailsResponse.Cves[" + i + "].Classifys[" + j + "].Description"));<NEW_LINE>classify.setDemoVideoUrl(_ctx.stringValue("DescribeVulDetailsResponse.Cves[" + i + "].Classifys[" + j + "].DemoVideoUrl"));<NEW_LINE>classifys.add(classify);<NEW_LINE>}<NEW_LINE>cve.setClassifys(classifys);<NEW_LINE>cves.add(cve);<NEW_LINE>}<NEW_LINE>describeVulDetailsResponse.setCves(cves);<NEW_LINE>return describeVulDetailsResponse;<NEW_LINE>}
("DescribeVulDetailsResponse.Cves[" + i + "].CvssVector"));
431,420
static double[][] of(float[] data, float[] breaks) {<NEW_LINE>int k = breaks.length - 1;<NEW_LINE>if (k <= 1) {<NEW_LINE>throw new IllegalArgumentException("Invalid number of bins: " + k);<NEW_LINE>}<NEW_LINE>double[][] freq = new double[3][k];<NEW_LINE>for (int i = 0; i < k; i++) {<NEW_LINE>freq[0][i] = breaks[i];<NEW_LINE>freq[1][i] = breaks[i + 1];<NEW_LINE>freq[2][i] = 0.0f;<NEW_LINE>}<NEW_LINE>for (float d : data) {<NEW_LINE>int j = <MASK><NEW_LINE>if (j >= k) {<NEW_LINE>j = k - 1;<NEW_LINE>}<NEW_LINE>if (j < -1 && j >= -breaks.length) {<NEW_LINE>j = -j - 2;<NEW_LINE>}<NEW_LINE>if (j >= 0) {<NEW_LINE>freq[2][j]++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return freq;<NEW_LINE>}
Arrays.binarySearch(breaks, d);
1,415,986
public void deleteShardDirectoryUnderLock(ShardLock lock, IndexSettings indexSettings, Consumer<Path[]> listener) throws IOException {<NEW_LINE>final ShardId shardId = lock.getShardId();<NEW_LINE>assert isShardLocked(shardId) : "shard " + shardId + " is not locked";<NEW_LINE>final Path[] paths = availableShardPaths(shardId);<NEW_LINE>logger.trace("acquiring locks for {}, paths: [{}]", shardId, paths);<NEW_LINE>acquireFSLockForPaths(indexSettings, paths);<NEW_LINE>listener.accept(paths);<NEW_LINE>IOUtils.rm(paths);<NEW_LINE>if (indexSettings.hasCustomDataPath()) {<NEW_LINE>Path customLocation = resolveCustomLocation(<MASK><NEW_LINE>logger.trace("acquiring lock for {}, custom path: [{}]", shardId, customLocation);<NEW_LINE>acquireFSLockForPaths(indexSettings, customLocation);<NEW_LINE>logger.trace("deleting custom shard {} directory [{}]", shardId, customLocation);<NEW_LINE>listener.accept(new Path[] { customLocation });<NEW_LINE>IOUtils.rm(customLocation);<NEW_LINE>}<NEW_LINE>logger.trace("deleted shard {} directory, paths: [{}]", shardId, paths);<NEW_LINE>assert assertPathsDoNotExist(paths);<NEW_LINE>}
indexSettings.customDataPath(), shardId);
1,166,743
public InitiateBucketWormResult initiateBucketWorm(InitiateBucketWormRequest initiateBucketWormRequest) throws OSSException, ClientException {<NEW_LINE>assertParameterNotNull(initiateBucketWormRequest, "initiateBucketWormRequest");<NEW_LINE>String bucketName = initiateBucketWormRequest.getBucketName();<NEW_LINE>assertParameterNotNull(bucketName, "bucketName");<NEW_LINE>ensureBucketNameValid(bucketName);<NEW_LINE>Map<String, String> params = new HashMap<String, String>();<NEW_LINE>params.put(SUBRESOURCE_WORM, null);<NEW_LINE>byte[] rawContent = initiateBucketWormRequestMarshaller.marshall(initiateBucketWormRequest);<NEW_LINE>Map<String, String> headers = new <MASK><NEW_LINE>addRequestRequiredHeaders(headers, rawContent);<NEW_LINE>RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint(initiateBucketWormRequest)).setMethod(HttpMethod.POST).setBucket(bucketName).setParameters(params).setHeaders(headers).setOriginalRequest(initiateBucketWormRequest).setInputSize(rawContent.length).setInputStream(new ByteArrayInputStream(rawContent)).build();<NEW_LINE>return doOperation(request, initiateBucketWormResponseParser, bucketName, null);<NEW_LINE>}
HashMap<String, String>();
251,083
public JComponent createComponent() {<NEW_LINE>ToolbarDecorator tablePanel = ToolbarDecorator.createDecorator(this.tableView, new ElementProducer<MethodSignatureSetting>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public MethodSignatureSetting createElement() {<NEW_LINE>// IdeFocusManager.getInstance(TwigSettingsForm.this.project).requestFocus(TwigNamespaceDialog.getWindows(), true);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean canCreateElement() {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>tablePanel.setEditAction(anActionButton -> MethodSignatureTypeSettingsForm.this.openTwigPathDialog(MethodSignatureTypeSettingsForm.this<MASK><NEW_LINE>tablePanel.setAddAction(anActionButton -> MethodSignatureTypeSettingsForm.this.openTwigPathDialog(null));<NEW_LINE>tablePanel.disableUpAction();<NEW_LINE>tablePanel.disableDownAction();<NEW_LINE>this.panelConfigTableView.add(tablePanel.createPanel());<NEW_LINE>return this.panel1;<NEW_LINE>}
.tableView.getSelectedObject()));
42,468
private byte[] applySegmentation(final int mtuSize, final byte[] pdu) {<NEW_LINE>int srcOffset = 0;<NEW_LINE>int dstOffset = 0;<NEW_LINE>final int chunks = (pdu.length + (mtuSize - 1)) / mtuSize;<NEW_LINE>final int pduType = pdu[0];<NEW_LINE>if (chunks > 1) {<NEW_LINE>final byte[] segmentedBuffer = new byte[pdu.length + chunks - 1];<NEW_LINE>int length;<NEW_LINE>for (int i = 0; i < chunks; i++) {<NEW_LINE>if (i == 0) {<NEW_LINE>length = Math.min(pdu.length - srcOffset, mtuSize);<NEW_LINE>System.arraycopy(pdu, srcOffset, segmentedBuffer, dstOffset, length);<NEW_LINE>segmentedBuffer[0] = (byte) ((GATT_SAR_START << 6) | pduType);<NEW_LINE>} else if (i == chunks - 1) {<NEW_LINE>length = Math.min(pdu.length - srcOffset, mtuSize);<NEW_LINE>segmentedBuffer[dstOffset] = (byte) (<MASK><NEW_LINE>System.arraycopy(pdu, srcOffset, segmentedBuffer, dstOffset + 1, length);<NEW_LINE>} else {<NEW_LINE>length = Math.min(pdu.length - srcOffset, mtuSize - 1);<NEW_LINE>segmentedBuffer[dstOffset] = (byte) ((GATT_SAR_CONTINUATION << 6) | pduType);<NEW_LINE>System.arraycopy(pdu, srcOffset, segmentedBuffer, dstOffset + 1, length);<NEW_LINE>}<NEW_LINE>srcOffset += length;<NEW_LINE>dstOffset += mtuSize;<NEW_LINE>}<NEW_LINE>return segmentedBuffer;<NEW_LINE>}<NEW_LINE>return pdu;<NEW_LINE>}
(GATT_SAR_END << 6) | pduType);
1,805,101
private void loadNode1184() {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.ProgramStateMachineType_ProgramDiagnostics_LastMethodInputArguments, new QualifiedName(0, "LastMethodInputArguments"), new LocalizedText("en", "LastMethodInputArguments"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Argument, 1, new UInteger[] { org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.valueOf(0) }, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.ProgramStateMachineType_ProgramDiagnostics_LastMethodInputArguments, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ProgramStateMachineType_ProgramDiagnostics_LastMethodInputArguments, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.ProgramStateMachineType_ProgramDiagnostics_LastMethodInputArguments, Identifiers.HasProperty, Identifiers.ProgramStateMachineType_ProgramDiagnostics.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), true));
913,641
private void generateRegisterGcRoot(Expr slotExpr, Expr gcRootExpr) {<NEW_LINE>if (stackVariable == null) {<NEW_LINE>throw new IllegalStateException("Call to ShadowStack.registerGCRoot must be dominated by " + "Mutator.allocStack");<NEW_LINE>}<NEW_LINE>slotExpr.acceptVisitor(this);<NEW_LINE>WasmExpression slotOffset = getSlotOffset(result);<NEW_LINE>WasmExpression address = new WasmGetLocal(stackVariable);<NEW_LINE>if (!(slotOffset instanceof WasmInt32Constant)) {<NEW_LINE>address = new WasmIntBinary(WasmIntType.INT32, WasmIntBinaryOperation.ADD, address, slotOffset);<NEW_LINE>}<NEW_LINE>gcRootExpr.acceptVisitor(this);<NEW_LINE>WasmExpression gcRoot = result;<NEW_LINE>WasmStoreInt32 store = new WasmStoreInt32(4, <MASK><NEW_LINE>if (slotOffset instanceof WasmInt32Constant) {<NEW_LINE>store.setOffset(((WasmInt32Constant) slotOffset).getValue());<NEW_LINE>}<NEW_LINE>result = store;<NEW_LINE>}
address, gcRoot, WasmInt32Subtype.INT32);
183,470
public static DetectFaceAttributesResponse unmarshall(DetectFaceAttributesResponse detectFaceAttributesResponse, UnmarshallerContext _ctx) {<NEW_LINE>detectFaceAttributesResponse.setRequestId(_ctx.stringValue("DetectFaceAttributesResponse.RequestId"));<NEW_LINE>detectFaceAttributesResponse.setCode(_ctx.stringValue("DetectFaceAttributesResponse.Code"));<NEW_LINE>detectFaceAttributesResponse.setMessage(_ctx.stringValue("DetectFaceAttributesResponse.Message"));<NEW_LINE>detectFaceAttributesResponse.setSuccess(_ctx.booleanValue("DetectFaceAttributesResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setImgHeight(_ctx.integerValue("DetectFaceAttributesResponse.Data.ImgHeight"));<NEW_LINE>data.setImgWidth(_ctx.integerValue("DetectFaceAttributesResponse.Data.ImgWidth"));<NEW_LINE>List<FaceAttributesDetectInfo> faceInfos = new ArrayList<FaceAttributesDetectInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DetectFaceAttributesResponse.Data.FaceInfos.Length"); i++) {<NEW_LINE>FaceAttributesDetectInfo faceAttributesDetectInfo = new FaceAttributesDetectInfo();<NEW_LINE>FaceRect faceRect = new FaceRect();<NEW_LINE>faceRect.setLeft(_ctx.integerValue("DetectFaceAttributesResponse.Data.FaceInfos[" + i + "].FaceRect.Left"));<NEW_LINE>faceRect.setTop(_ctx.integerValue("DetectFaceAttributesResponse.Data.FaceInfos[" + i + "].FaceRect.Top"));<NEW_LINE>faceRect.setWidth(_ctx.integerValue("DetectFaceAttributesResponse.Data.FaceInfos[" + i + "].FaceRect.Width"));<NEW_LINE>faceRect.setHeight(_ctx.integerValue("DetectFaceAttributesResponse.Data.FaceInfos[" + i + "].FaceRect.Height"));<NEW_LINE>faceAttributesDetectInfo.setFaceRect(faceRect);<NEW_LINE>FaceAttributes faceAttributes = new FaceAttributes();<NEW_LINE>faceAttributes.setGlasses(_ctx.stringValue("DetectFaceAttributesResponse.Data.FaceInfos[" + i + "].FaceAttributes.Glasses"));<NEW_LINE>faceAttributes.setFacequal(_ctx.floatValue("DetectFaceAttributesResponse.Data.FaceInfos[" + i + "].FaceAttributes.Facequal"));<NEW_LINE>faceAttributes.setIntegrity(_ctx.integerValue("DetectFaceAttributesResponse.Data.FaceInfos[" + i + "].FaceAttributes.Integrity"));<NEW_LINE>faceAttributes.setFacetype(_ctx.stringValue("DetectFaceAttributesResponse.Data.FaceInfos[" + i + "].FaceAttributes.Facetype"));<NEW_LINE>faceAttributes.setRespirator(_ctx.stringValue("DetectFaceAttributesResponse.Data.FaceInfos[" + i + "].FaceAttributes.Respirator"));<NEW_LINE>faceAttributes.setAppearanceScore(_ctx.floatValue("DetectFaceAttributesResponse.Data.FaceInfos[" + i + "].FaceAttributes.AppearanceScore"));<NEW_LINE>faceAttributes.setAge(_ctx.integerValue("DetectFaceAttributesResponse.Data.FaceInfos[" + i + "].FaceAttributes.Age"));<NEW_LINE>faceAttributes.setBlur(_ctx.floatValue<MASK><NEW_LINE>Gender gender = new Gender();<NEW_LINE>gender.setValue(_ctx.stringValue("DetectFaceAttributesResponse.Data.FaceInfos[" + i + "].FaceAttributes.Gender.Value"));<NEW_LINE>gender.setScore(_ctx.floatValue("DetectFaceAttributesResponse.Data.FaceInfos[" + i + "].FaceAttributes.Gender.Score"));<NEW_LINE>faceAttributes.setGender(gender);<NEW_LINE>Smiling smiling = new Smiling();<NEW_LINE>smiling.setValue(_ctx.floatValue("DetectFaceAttributesResponse.Data.FaceInfos[" + i + "].FaceAttributes.Smiling.Value"));<NEW_LINE>smiling.setThreshold(_ctx.floatValue("DetectFaceAttributesResponse.Data.FaceInfos[" + i + "].FaceAttributes.Smiling.Threshold"));<NEW_LINE>faceAttributes.setSmiling(smiling);<NEW_LINE>Headpose headpose = new Headpose();<NEW_LINE>headpose.setPitchAngle(_ctx.floatValue("DetectFaceAttributesResponse.Data.FaceInfos[" + i + "].FaceAttributes.Headpose.PitchAngle"));<NEW_LINE>headpose.setRollAngle(_ctx.floatValue("DetectFaceAttributesResponse.Data.FaceInfos[" + i + "].FaceAttributes.Headpose.RollAngle"));<NEW_LINE>headpose.setYawAngle(_ctx.floatValue("DetectFaceAttributesResponse.Data.FaceInfos[" + i + "].FaceAttributes.Headpose.YawAngle"));<NEW_LINE>faceAttributes.setHeadpose(headpose);<NEW_LINE>faceAttributesDetectInfo.setFaceAttributes(faceAttributes);<NEW_LINE>faceInfos.add(faceAttributesDetectInfo);<NEW_LINE>}<NEW_LINE>data.setFaceInfos(faceInfos);<NEW_LINE>detectFaceAttributesResponse.setData(data);<NEW_LINE>return detectFaceAttributesResponse;<NEW_LINE>}
("DetectFaceAttributesResponse.Data.FaceInfos[" + i + "].FaceAttributes.Blur"));
1,605,443
private Node move(String hostname, Node.State toState, Agent agent, boolean keepAllocation, Optional<String> reason, NestedTransaction transaction) {<NEW_LINE>// TODO: Work out a safe lock acquisition strategy for moves. Lock is only held while adding operations to<NEW_LINE>// transaction, but lock must also be held while committing<NEW_LINE>try (NodeMutex lock = lockAndGetRequired(hostname)) {<NEW_LINE>Node node = lock.node();<NEW_LINE>if (toState == Node.State.active) {<NEW_LINE>if (node.allocation().isEmpty())<NEW_LINE><MASK><NEW_LINE>if (!keepAllocation)<NEW_LINE>illegal("Could not set " + node + " active: Requested to discard allocation");<NEW_LINE>for (Node currentActive : list(Node.State.active).owner(node.allocation().get().owner())) {<NEW_LINE>if (node.allocation().get().membership().cluster().equals(currentActive.allocation().get().membership().cluster()) && node.allocation().get().membership().index() == currentActive.allocation().get().membership().index())<NEW_LINE>illegal("Could not set " + node + " active: Same cluster and index as " + currentActive);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!keepAllocation && node.allocation().isPresent()) {<NEW_LINE>node = node.withoutAllocation();<NEW_LINE>}<NEW_LINE>if (toState == Node.State.deprovisioned) {<NEW_LINE>node = node.with(IP.Config.EMPTY);<NEW_LINE>}<NEW_LINE>return db.writeTo(toState, List.of(node), agent, reason, transaction).get(0);<NEW_LINE>}<NEW_LINE>}
illegal("Could not set " + node + " active: It has no allocation");
594,207
public boolean handlesFile(IFile file) {<NEW_LINE>Set<String> fqns = getModule().getPathCache().getFqnForFile(file);<NEW_LINE>if (fqns == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>for (String fqn : fqns) {<NEW_LINE>if (fqn.length() > EXTENSIONS_PACKAGE.length() + 2) {<NEW_LINE>int iExt = fqn.indexOf(EXTENSIONS_PACKAGE + '.');<NEW_LINE>if (iExt >= 0) {<NEW_LINE>String extendedType = fqn.substring(iExt + EXTENSIONS_PACKAGE.length() + 1);<NEW_LINE>int iDot = extendedType.lastIndexOf('.');<NEW_LINE>if (iDot > 0) {<NEW_LINE>try {<NEW_LINE>// ## note: this is pretty sloppy science here, but we don't want to parse<NEW_LINE>// java or use asm here i.e., handlesFile() this has to be *fast*.<NEW_LINE>if (file.getExtension().equalsIgnoreCase("java")) {<NEW_LINE>String content = StreamUtil.getContent(new InputStreamReader(file.openInputStream(), UTF_8));<NEW_LINE>return content.contains("@Extension") && content.contains(Extension.class.getPackage().getName());<NEW_LINE>} else // .class file<NEW_LINE>{<NEW_LINE>String content = StreamUtil.getContent(new InputStreamReader(file.openInputStream(), UTF_8));<NEW_LINE>return content.contains(Extension.class.getName()<MASK><NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>// eat<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
.replace('.', '/'));
28,700
private RemotingCommand processReplyMessageRequest(final ChannelHandlerContext ctx, final RemotingCommand request, final SendMessageContext sendMessageContext, final SendMessageRequestHeader requestHeader) {<NEW_LINE>final RemotingCommand response = RemotingCommand.createResponseCommand(SendMessageResponseHeader.class);<NEW_LINE>final SendMessageResponseHeader responseHeader = (SendMessageResponseHeader) response.readCustomHeader();<NEW_LINE>response.setOpaque(request.getOpaque());<NEW_LINE>response.addExtField(MessageConst.PROPERTY_MSG_REGION, this.brokerController.getBrokerConfig().getRegionId());<NEW_LINE>response.addExtField(MessageConst.PROPERTY_TRACE_SWITCH, String.valueOf(this.brokerController.getBrokerConfig().isTraceOn()));<NEW_LINE>log.debug("receive SendReplyMessage request command, {}", request);<NEW_LINE>final long startTimstamp = this.brokerController.getBrokerConfig().getStartAcceptSendRequestTimeStamp();<NEW_LINE>if (this.brokerController.getMessageStore().now() < startTimstamp) {<NEW_LINE>response.setCode(ResponseCode.SYSTEM_ERROR);<NEW_LINE>response.setRemark(String.format("broker unable to service, until %s", UtilAll.timeMillisToHumanString2(startTimstamp)));<NEW_LINE>return response;<NEW_LINE>}<NEW_LINE>response.setCode(-1);<NEW_LINE>super.msgCheck(ctx, requestHeader, response);<NEW_LINE>if (response.getCode() != -1) {<NEW_LINE>return response;<NEW_LINE>}<NEW_LINE>final byte[] body = request.getBody();<NEW_LINE>int queueIdInt = requestHeader.getQueueId();<NEW_LINE>TopicConfig topicConfig = this.brokerController.getTopicConfigManager().selectTopicConfig(requestHeader.getTopic());<NEW_LINE>if (queueIdInt < 0) {<NEW_LINE>queueIdInt = ThreadLocalRandom.current().nextInt(99999999) % topicConfig.getWriteQueueNums();<NEW_LINE>}<NEW_LINE>MessageExtBrokerInner msgInner = new MessageExtBrokerInner();<NEW_LINE>msgInner.setTopic(requestHeader.getTopic());<NEW_LINE>msgInner.setQueueId(queueIdInt);<NEW_LINE>msgInner.setBody(body);<NEW_LINE>msgInner.setFlag(requestHeader.getFlag());<NEW_LINE>MessageAccessor.setProperties(msgInner, MessageDecoder.string2messageProperties(requestHeader.getProperties()));<NEW_LINE>msgInner.setPropertiesString(requestHeader.getProperties());<NEW_LINE>msgInner.<MASK><NEW_LINE>msgInner.setBornHost(ctx.channel().remoteAddress());<NEW_LINE>msgInner.setStoreHost(this.getStoreHost());<NEW_LINE>msgInner.setReconsumeTimes(requestHeader.getReconsumeTimes() == null ? 0 : requestHeader.getReconsumeTimes());<NEW_LINE>PushReplyResult pushReplyResult = this.pushReplyMessage(ctx, requestHeader, msgInner);<NEW_LINE>this.handlePushReplyResult(pushReplyResult, response, responseHeader, queueIdInt);<NEW_LINE>if (this.brokerController.getBrokerConfig().isStoreReplyMessageEnable()) {<NEW_LINE>PutMessageResult putMessageResult = this.brokerController.getMessageStore().putMessage(msgInner);<NEW_LINE>this.handlePutMessageResult(putMessageResult, request, msgInner, responseHeader, sendMessageContext, queueIdInt);<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>}
setBornTimestamp(requestHeader.getBornTimestamp());
834,901
protected void createPreViews() {<NEW_LINE>reflectionCam <MASK><NEW_LINE>refractionCam = new Camera(renderWidth, renderHeight);<NEW_LINE>// create a pre-view. a view that is rendered before the main view<NEW_LINE>reflectionView = new ViewPort("Reflection View", reflectionCam);<NEW_LINE>reflectionView.setClearFlags(true, true, true);<NEW_LINE>reflectionView.setBackgroundColor(ColorRGBA.Black);<NEW_LINE>// create offscreen framebuffer<NEW_LINE>reflectionBuffer = new FrameBuffer(renderWidth, renderHeight, 1);<NEW_LINE>// setup framebuffer to use texture<NEW_LINE>reflectionBuffer.setDepthTarget(FrameBufferTarget.newTarget(Format.Depth));<NEW_LINE>reflectionBuffer.addColorTarget(FrameBufferTarget.newTarget(reflectionTexture));<NEW_LINE>// set viewport to render to offscreen framebuffer<NEW_LINE>reflectionView.setOutputFrameBuffer(reflectionBuffer);<NEW_LINE>reflectionView.addProcessor(new ReflectionProcessor(reflectionCam, reflectionBuffer, reflectionClipPlane));<NEW_LINE>// attach the scene to the viewport to be rendered<NEW_LINE>reflectionView.attachScene(reflectionScene);<NEW_LINE>// create a pre-view. a view that is rendered before the main view<NEW_LINE>refractionView = new ViewPort("Refraction View", refractionCam);<NEW_LINE>refractionView.setClearFlags(true, true, true);<NEW_LINE>refractionView.setBackgroundColor(ColorRGBA.Black);<NEW_LINE>// create offscreen framebuffer<NEW_LINE>refractionBuffer = new FrameBuffer(renderWidth, renderHeight, 1);<NEW_LINE>// setup framebuffer to use texture<NEW_LINE>refractionBuffer.addColorTarget(FrameBufferTarget.newTarget(refractionTexture));<NEW_LINE>refractionBuffer.setDepthTarget(FrameBufferTarget.newTarget(depthTexture));<NEW_LINE>// set viewport to render to offscreen framebuffer<NEW_LINE>refractionView.setOutputFrameBuffer(refractionBuffer);<NEW_LINE>refractionView.addProcessor(new RefractionProcessor());<NEW_LINE>// attach the scene to the viewport to be rendered<NEW_LINE>refractionView.attachScene(reflectionScene);<NEW_LINE>}
= new Camera(renderWidth, renderHeight);
695,326
public void addTargets(Iterable<Tuple3<Integer, Long, float[]>> iterable) {<NEW_LINE>List<Tuple3<Integer, Long, float[]>> cache = new ArrayList<>();<NEW_LINE>iterable.forEach(cache::add);<NEW_LINE>int dim = 0;<NEW_LINE>if (cache.size() > 0) {<NEW_LINE>dim = cache.get(0).f2.length;<NEW_LINE>}<NEW_LINE>ids = new long[cache.size()];<NEW_LINE>factors = new float[cache.size() * dim];<NEW_LINE>scoreBuffer = new ArrayList<>(cache.size());<NEW_LINE>buffer = new <MASK><NEW_LINE>for (int i = 0; i < cache.size(); i++) {<NEW_LINE>ids[i] = cache.get(i).f1;<NEW_LINE>scoreBuffer.add(Tuple2.of(ids[i], 0.F));<NEW_LINE>System.arraycopy(cache.get(i).f2, 0, factors, i * dim, dim);<NEW_LINE>}<NEW_LINE>blas = com.github.fommil.netlib.BLAS.getInstance();<NEW_LINE>}
float[cache.size()];
429,074
public com.amazonaws.services.workspacesweb.model.ConflictException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.workspacesweb.model.ConflictException conflictException = new com.amazonaws.services.workspacesweb.model.ConflictException(null);<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 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("resourceId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>conflictException.setResourceId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("resourceType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>conflictException.setResourceType(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 conflictException;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,027,908
public void scrollLines(int firstLine, int lastLine, int distance) throws IOException {<NEW_LINE>final String CSI = "\033[";<NEW_LINE>// some sanity checks:<NEW_LINE>if (distance == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (firstLine < 0) {<NEW_LINE>firstLine = 0;<NEW_LINE>}<NEW_LINE>if (lastLine < firstLine) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>// define range:<NEW_LINE>sb.append(CSI).append(firstLine + 1).append(';').append(lastLine + 1).append('r');<NEW_LINE>// place cursor on line to scroll away from:<NEW_LINE>int target = distance > 0 ? lastLine : firstLine;<NEW_LINE>sb.append(CSI).append(target + 1).append(";1H");<NEW_LINE>// do scroll:<NEW_LINE>if (distance > 0) {<NEW_LINE>int num = Math.min(distance, lastLine - firstLine + 1);<NEW_LINE>for (int i = 0; i < num; i++) {<NEW_LINE>sb.append('\n');<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// distance < 0<NEW_LINE>int num = Math.min(-distance, lastLine - firstLine + 1);<NEW_LINE>for (int i = 0; i < num; i++) {<NEW_LINE>sb.append("\033M");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// reset range:<NEW_LINE>sb.append<MASK><NEW_LINE>// off we go!<NEW_LINE>writeToTerminal(sb.toString().getBytes());<NEW_LINE>}
(CSI).append('r');
714,899
public int run(CommandLine cl) throws IOException {<NEW_LINE>String[] args = cl.getArgs();<NEW_LINE>BackupPRequest.Builder opts = BackupPRequest.newBuilder();<NEW_LINE>if (args.length >= 1) {<NEW_LINE>opts.setTargetDirectory(args[0]);<NEW_LINE>}<NEW_LINE>opts.setOptions(BackupPOptions.newBuilder().setRunAsync(true).setLocalFileSystem(cl.hasOption(LOCAL_OPTION.getLongOpt())).setAllowLeader(cl.hasOption(ALLOW_LEADER_OPTION.getLongOpt())).setBypassDelegation(cl.hasOption(BYPASS_DELEGATION_OPTION.getLongOpt())));<NEW_LINE>// Take backup in async mode.<NEW_LINE>BackupStatus status = mMetaClient.<MASK><NEW_LINE>UUID backupId = status.getBackupId();<NEW_LINE>do {<NEW_LINE>clearProgressLine();<NEW_LINE>// Backup could be after a fail-over.<NEW_LINE>if (status.getState() == BackupState.None) {<NEW_LINE>mPrintStream.printf("Backup lost. Please check Alluxio logs.%n");<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>if (status.getState() == BackupState.Completed) {<NEW_LINE>break;<NEW_LINE>} else if (status.getState() == BackupState.Failed) {<NEW_LINE>throw AlluxioStatusException.fromAlluxioException(status.getError());<NEW_LINE>} else {<NEW_LINE>// Generate progress line that will be replaced until backup is finished.<NEW_LINE>String progressMessage = String.format(" Backup state: %s", status.getState());<NEW_LINE>// Start showing entry count once backup started running.<NEW_LINE>if (status.getState() == BackupState.Running) {<NEW_LINE>progressMessage += String.format(" | Entries processed: %d", status.getEntryCount());<NEW_LINE>}<NEW_LINE>mPrintStream.write(progressMessage.getBytes());<NEW_LINE>mPrintStream.write("\r".getBytes());<NEW_LINE>mPrintStream.flush();<NEW_LINE>}<NEW_LINE>// Sleep half a sec before querying status again.<NEW_LINE>try {<NEW_LINE>Thread.sleep(500);<NEW_LINE>status = mMetaClient.getBackupStatus(backupId);<NEW_LINE>} catch (InterruptedException ie) {<NEW_LINE>throw new RuntimeException("Interrupted while waiting for backup completion.");<NEW_LINE>} finally {<NEW_LINE>// In case exception is thrown.<NEW_LINE>clearProgressLine();<NEW_LINE>}<NEW_LINE>} while (true);<NEW_LINE>clearProgressLine();<NEW_LINE>// Print final state.<NEW_LINE>mPrintStream.printf("Backup Host : %s%n", status.getHostname());<NEW_LINE>mPrintStream.printf("Backup URI : %s%n", status.getBackupUri());<NEW_LINE>mPrintStream.printf("Backup Entry Count : %d%n", status.getEntryCount());<NEW_LINE>return 0;<NEW_LINE>}
backup(opts.build());
1,446,837
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {<NEW_LINE>builder.startObject().field("grant_type", grantType);<NEW_LINE>if (scope != null) {<NEW_LINE>builder.field("scope", scope);<NEW_LINE>}<NEW_LINE>if (username != null) {<NEW_LINE>builder.field("username", username);<NEW_LINE>}<NEW_LINE>if (password != null) {<NEW_LINE>byte[] passwordBytes = CharArrays.toUtf8Bytes(password);<NEW_LINE>try {<NEW_LINE>builder.field("password").utf8Value(passwordBytes, 0, passwordBytes.length);<NEW_LINE>} finally {<NEW_LINE>Arrays.fill(passwordBytes, (byte) 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (refreshToken != null) {<NEW_LINE>builder.field("refresh_token", refreshToken);<NEW_LINE>}<NEW_LINE>if (kerberosTicket != null) {<NEW_LINE>byte[] kerberosTicketBytes = CharArrays.toUtf8Bytes(kerberosTicket);<NEW_LINE>try {<NEW_LINE>builder.field("kerberos_ticket").utf8Value(<MASK><NEW_LINE>} finally {<NEW_LINE>Arrays.fill(kerberosTicketBytes, (byte) 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return builder.endObject();<NEW_LINE>}
kerberosTicketBytes, 0, kerberosTicketBytes.length);
112,052
public static Duration parse(String value) throws ParseException {<NEW_LINE>// Must end with "s".<NEW_LINE>if (value.isEmpty() || value.charAt(value.length() - 1) != 's') {<NEW_LINE>throw new ParseException("Invalid duration string: " + value, 0);<NEW_LINE>}<NEW_LINE>boolean negative = false;<NEW_LINE>if (value.charAt(0) == '-') {<NEW_LINE>negative = true;<NEW_LINE>value = value.substring(1);<NEW_LINE>}<NEW_LINE>String secondValue = value.substring(0, value.length() - 1);<NEW_LINE>String nanoValue = "";<NEW_LINE>int pointPosition = secondValue.indexOf('.');<NEW_LINE>if (pointPosition != -1) {<NEW_LINE>nanoValue = secondValue.substring(pointPosition + 1);<NEW_LINE>secondValue = secondValue.substring(0, pointPosition);<NEW_LINE>}<NEW_LINE>long <MASK><NEW_LINE>int nanos = nanoValue.isEmpty() ? 0 : Timestamps.parseNanos(nanoValue);<NEW_LINE>if (seconds < 0) {<NEW_LINE>throw new ParseException("Invalid duration string: " + value, 0);<NEW_LINE>}<NEW_LINE>if (negative) {<NEW_LINE>seconds = -seconds;<NEW_LINE>nanos = -nanos;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return normalizedDuration(seconds, nanos);<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>ParseException ex = new ParseException("Duration value is out of range.", 0);<NEW_LINE>ex.initCause(e);<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>}
seconds = Long.parseLong(secondValue);
9,360
private void moveNewBundlesToFelixLoadFolder(final File uploadFolderFile, final String[] pathnames) {<NEW_LINE>final File deployDirectory = new File(this.getFelixDeployPath());<NEW_LINE>try {<NEW_LINE>if (deployDirectory.exists() && deployDirectory.canWrite()) {<NEW_LINE>for (final String pathname : pathnames) {<NEW_LINE>final File bundle = new File(uploadFolderFile, pathname);<NEW_LINE>Logger.debug(this, "Moving the bundle: " + bundle + " to " + deployDirectory);<NEW_LINE>final File bundleDestination = new File(deployDirectory, bundle.getName());<NEW_LINE>if (FileUtil.move(bundle, bundleDestination)) {<NEW_LINE>Try.run(() -> APILocator.getSystemEventsAPI().push(SystemEventType.OSGI_BUNDLES_LOADED, new Payload(pathnames))).onFailure(e -> Logger.error(OSGIUtil.this, e.getMessage()));<NEW_LINE>Logger.debug(this, "Moved the bundle: " + bundle + " to " + deployDirectory);<NEW_LINE>} else {<NEW_LINE>Logger.debug(this, "Could not move the bundle: " + bundle + " to " + deployDirectory);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final String messageKey = pathnames.length > 1 ? "new-osgi-plugins-installed" : "new-osgi-plugin-installed";<NEW_LINE>final String successMessage = Try.of(() -> LanguageUtil.get(APILocator.getCompanyAPI().getDefaultCompany().getLocale(), messageKey)).getOrElse(() -> "New OSGi Plugin(s) have been installed");<NEW_LINE>SystemMessageEventUtil.getInstance().pushMessage("OSGI_BUNDLES_LOADED", new SystemMessageBuilder().setMessage(successMessage).setLife(DateUtil.FIVE_SECOND_MILLIS).setSeverity(MessageSeverity.SUCCESS<MASK><NEW_LINE>} else {<NEW_LINE>Logger.warn(this, "The directory: " + this.getFelixDeployPath() + " does not exists or can not read");<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>Logger.error(this, e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
).create(), null);
790,869
public void checkLimitaions(SqlBlockRule rule, Long partitionNum, Long tabletNum, Long cardinality) throws AnalysisException {<NEW_LINE>if (rule.getPartitionNum() == 0 && rule.getTabletNum() == 0 && rule.getCardinality() == 0) {<NEW_LINE>return;<NEW_LINE>} else if (rule.getEnable()) {<NEW_LINE>if ((rule.getPartitionNum() != 0 && rule.getPartitionNum() < partitionNum) || (rule.getTabletNum() != 0 && rule.getTabletNum() < tabletNum) || (rule.getCardinality() != 0 && rule.getCardinality() < cardinality)) {<NEW_LINE>MetricRepo.COUNTER_HIT_SQL_BLOCK_RULE.increase(1L);<NEW_LINE>if (rule.getPartitionNum() < partitionNum && rule.getPartitionNum() != 0) {<NEW_LINE>throw new AnalysisException("sql hits sql block rule: " + rule.getName() + ", reach partition_num : " + rule.getPartitionNum());<NEW_LINE>} else if (rule.getTabletNum() < tabletNum && rule.getTabletNum() != 0) {<NEW_LINE>throw new AnalysisException("sql hits sql block rule: " + rule.getName() + <MASK><NEW_LINE>} else if (rule.getCardinality() < cardinality && rule.getCardinality() != 0) {<NEW_LINE>throw new AnalysisException("sql hits sql block rule: " + rule.getName() + ", reach cardinality : " + rule.getCardinality());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
", reach tablet_num : " + rule.getTabletNum());
551,888
public void applyMigration() {<NEW_LINE>final long start = System.currentTimeMillis();<NEW_LINE>try {<NEW_LINE>if (curator.checkExists().forPath(PENDING_TASKS_ROOT) == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>for (String pendingTaskId : curator.getChildren().forPath(PENDING_TASKS_ROOT)) {<NEW_LINE>SingularityPendingTaskId newPendingTaskId = createFrom(pendingTaskId, start);<NEW_LINE>if (!newPendingTaskId.toString().equals(pendingTaskId)) {<NEW_LINE>LOG.info("Migrating {} to {}", pendingTaskId, newPendingTaskId);<NEW_LINE>Optional<String> cmdLineArgs = getCmdLineArgs(pendingTaskId);<NEW_LINE>taskManager.savePendingTask(new SingularityPendingTaskBuilder().setPendingTaskId(newPendingTaskId).setCmdLineArgsList(cmdLineArgs.isPresent() ? Optional.of(Collections.singletonList(cmdLineArgs.get())) : Optional.<List<String>>empty()).build());<NEW_LINE>curator.delete().forPath(ZKPaths<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}
.makePath(PENDING_TASKS_ROOT, pendingTaskId));
176,222
final ListConfigurationSetsResult executeListConfigurationSets(ListConfigurationSetsRequest listConfigurationSetsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listConfigurationSetsRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListConfigurationSetsRequest> request = null;<NEW_LINE>Response<ListConfigurationSetsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListConfigurationSetsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listConfigurationSetsRequest));<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, "SESv2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListConfigurationSets");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListConfigurationSetsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListConfigurationSetsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,088,032
public void onTraversalStart() {<NEW_LINE>// Users can disable the AVX check to allow an older version of TF that doesn't require AVX to be used.<NEW_LINE>if (this.disableAVXCheck == false) {<NEW_LINE>IntelGKLUtils utils = new IntelGKLUtils();<NEW_LINE>utils.load(null);<NEW_LINE>if (utils.isAvxSupported() == false) {<NEW_LINE>// Give user the bad news, suggest remedies.<NEW_LINE>throw new UserException.HardwareFeatureException(String.format(CNNScoreVariants.AVXREQUIRED_ERROR, DISABLE_AVX_CHECK_NAME));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final VCFHeader inputHeader = getHeaderForVariants();<NEW_LINE>if (inputHeader.getGenotypeSamples().size() > 1) {<NEW_LINE>logger.warn("CNNScoreVariants is a single sample tool but the input VCF has more than 1 sample.");<NEW_LINE>}<NEW_LINE>if (!annotationKeys.equals(defaultAnnotationKeys)) {<NEW_LINE>logger.warn("Annotation keys are not the default you must also provide a trained model that expects these annotations.");<NEW_LINE>}<NEW_LINE>// Start the Python process and initialize a stream writer for streaming data to the Python code<NEW_LINE>pythonExecutor.start(Collections.emptyList(), enableJournal, pythonProfileResults);<NEW_LINE><MASK><NEW_LINE>batchList = new ArrayList<>(transferBatchSize);<NEW_LINE>// Execute Python code to open our output file, where it will write the contents of everything it reads<NEW_LINE>// from the stream.<NEW_LINE>try {<NEW_LINE>// create a local temp that python code can write to<NEW_LINE>scoreFile = File.createTempFile(outputFile.getBaseName().get(), ".temp");<NEW_LINE>if (!keepTempFile) {<NEW_LINE>scoreFile.deleteOnExit();<NEW_LINE>} else {<NEW_LINE>logger.info("Saving temp file from python:" + scoreFile.getAbsolutePath());<NEW_LINE>}<NEW_LINE>pythonExecutor.sendSynchronousCommand(String.format("tempFile = open('%s', 'w+')" + NL, scoreFile.getAbsolutePath()));<NEW_LINE>pythonExecutor.sendSynchronousCommand("import vqsr_cnn" + NL);<NEW_LINE>scoreKey = getScoreKeyAndCheckModelAndReadsHarmony();<NEW_LINE>annotationSetString = annotationKeys.stream().collect(Collectors.joining(DATA_VALUE_SEPARATOR));<NEW_LINE>initializePythonArgsAndModel();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new GATKException("Error when creating temp file and initializing python executor.", e);<NEW_LINE>}<NEW_LINE>}
pythonExecutor.initStreamWriter(AsynchronousStreamWriter.stringSerializer);
952,437
private long calculateDuration(float delta, float width, float velocity) {<NEW_LINE>final float halfScreenSize = width / 2;<NEW_LINE>float distanceRatio = delta / width;<NEW_LINE>float distanceInfluenceForSnapDuration = distanceInfluenceForSnapDuration(distanceRatio);<NEW_LINE>float distance = halfScreenSize + halfScreenSize * distanceInfluenceForSnapDuration;<NEW_LINE><MASK><NEW_LINE>velocity = Math.max(MINIMUM_SNAP_VELOCITY, velocity);<NEW_LINE>long duration = 6 * Math.round(1000 * Math.abs(distance / velocity));<NEW_LINE>if (DEBUG) {<NEW_LINE>Log.e(TAG, "halfScreenSize:" + halfScreenSize + " delta:" + delta + " distanceRatio:" + distanceRatio + " distance:" + distance + " velocity:" + velocity + " duration:" + duration + " distanceInfluenceForSnapDuration:" + distanceInfluenceForSnapDuration);<NEW_LINE>}<NEW_LINE>return duration;<NEW_LINE>}
velocity = Math.abs(velocity);
638,497
ActionResult<WrapOutId> execute(String appDictFlag, String appInfoFlag, String path0, String path1, String path2, String path3, String path4, String path5, JsonElement jsonElement) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<WrapOutId> result = new ActionResult<>();<NEW_LINE>Business business = new Business(emc);<NEW_LINE>AppInfo appInfo = business.getAppInfoFactory().pick(appInfoFlag);<NEW_LINE>if (null == appInfo) {<NEW_LINE>throw new ExceptionAppInfoNotExist(appInfoFlag);<NEW_LINE>}<NEW_LINE>String id = business.getAppDictFactory().getWithAppInfoWithUniqueName(appInfo.getId(), appDictFlag);<NEW_LINE>if (StringUtils.isEmpty(id)) {<NEW_LINE>throw new ExceptionAppDictNotExist(appInfoFlag);<NEW_LINE>}<NEW_LINE>AppDict dict = emc.find(id, AppDict.class);<NEW_LINE>this.update(business, dict, jsonElement, path0, path1, <MASK><NEW_LINE>emc.commit();<NEW_LINE>WrapOutId wrap = new WrapOutId(dict.getId());<NEW_LINE>result.setData(wrap);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
path2, path3, path4, path5);
142,790
public void onSuccess(@NonNull RegistrationResponse registrationResponse, final Context context) {<NEW_LINE>// After successful registration with Applozic server the callback will come here<NEW_LINE>mAuthTask = null;<NEW_LINE>showProgress(false);<NEW_LINE>// Basic setting for context based chat enable...<NEW_LINE>ApplozicClient.getInstance(context).setContextBasedChat(true);<NEW_LINE>Map<ApplozicSetting.RequestCode, String> activityCallbacks = new HashMap<ApplozicSetting.RequestCode, String>();<NEW_LINE>activityCallbacks.put(ApplozicSetting.RequestCode.USER_LOOUT, LoginActivity.class.getName());<NEW_LINE>ApplozicSetting.getInstance<MASK><NEW_LINE>buildContactData();<NEW_LINE>// Start FCM registration....<NEW_LINE>AlTask.execute(new PushNotificationTask(context, Applozic.Store.getDeviceRegistrationId(context), new AlPushNotificationHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(RegistrationResponse registrationResponse) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(RegistrationResponse registrationResponse, Exception exception) {<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>// starting main MainActivity<NEW_LINE>Intent mainActvity = new Intent(context, MainActivity.class);<NEW_LINE>startActivity(mainActvity);<NEW_LINE>Intent intent = new Intent(context, ConversationActivity.class);<NEW_LINE>if (ApplozicClient.getInstance(LoginActivity.this).isContextBasedChat()) {<NEW_LINE>intent.putExtra(ConversationUIService.CONTEXT_BASED_CHAT, true);<NEW_LINE>}<NEW_LINE>startActivity(intent);<NEW_LINE>finish();<NEW_LINE>}
(context).setActivityCallbacks(activityCallbacks);
532,908
protected void doBegin(Object transactionObject, TransactionDefinition transactionDefinition) throws TransactionException {<NEW_LINE>if (transactionDefinition.getIsolationLevel() != TransactionDefinition.ISOLATION_DEFAULT && transactionDefinition.getIsolationLevel() != TransactionDefinition.ISOLATION_SERIALIZABLE) {<NEW_LINE>throw new IllegalStateException("DatastoreTransactionManager supports only isolation level " + "TransactionDefinition.ISOLATION_DEFAULT or ISOLATION_SERIALIZABLE");<NEW_LINE>}<NEW_LINE>if (transactionDefinition.getPropagationBehavior() != TransactionDefinition.PROPAGATION_REQUIRED) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>Tx tx = (Tx) transactionObject;<NEW_LINE>if (transactionDefinition.isReadOnly()) {<NEW_LINE>tx.transaction = tx.datastore.newTransaction(READ_ONLY_OPTIONS);<NEW_LINE>} else {<NEW_LINE>tx.transaction = tx.datastore.newTransaction();<NEW_LINE>}<NEW_LINE>TransactionSynchronizationManager.bindResource(tx.datastore, tx);<NEW_LINE>}
throw new IllegalStateException("DatastoreTransactionManager supports only propagation behavior " + "TransactionDefinition.PROPAGATION_REQUIRED");
483,420
public void onEntityDamage(EntityDamageEvent event) {<NEW_LINE>Entity victim = event.getEntity();<NEW_LINE>if (victim instanceof Player) {<NEW_LINE>Player player = (Player) victim;<NEW_LINE>LocalPlayer localPlayer = WorldGuardPlugin.<MASK><NEW_LINE>if (isInvincible(localPlayer)) {<NEW_LINE>player.setFireTicks(0);<NEW_LINE>event.setCancelled(true);<NEW_LINE>if (event instanceof EntityDamageByEntityEvent) {<NEW_LINE>EntityDamageByEntityEvent byEntityEvent = (EntityDamageByEntityEvent) event;<NEW_LINE>Entity attacker = byEntityEvent.getDamager();<NEW_LINE>if (attacker instanceof Projectile && ((Projectile) attacker).getShooter() instanceof Entity) {<NEW_LINE>attacker = (Entity) ((Projectile) attacker).getShooter();<NEW_LINE>}<NEW_LINE>if (getWorldConfig(player.getWorld()).regionInvinciblityRemovesMobs && attacker instanceof LivingEntity && !(attacker instanceof Player) && !(attacker instanceof Tameable && ((Tameable) attacker).isTamed())) {<NEW_LINE>attacker.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
inst().wrapPlayer(player);
1,385,689
private void loadPresets() {<NEW_LINE>int alpha = Color.alpha(color);<NEW_LINE>presets = getArguments().getIntArray(ARG_PRESETS);<NEW_LINE>if (presets == null)<NEW_LINE>presets = MATERIAL_COLORS;<NEW_LINE>boolean isMaterialColors = presets == MATERIAL_COLORS;<NEW_LINE>// don't update the original array when modifying alpha<NEW_LINE>presets = Arrays.copyOf(presets, presets.length);<NEW_LINE>if (alpha != 255) {<NEW_LINE>// add alpha to the presets<NEW_LINE>for (int i = 0; i < presets.length; i++) {<NEW_LINE>int color = presets[i];<NEW_LINE>int red = Color.red(color);<NEW_LINE>int green = Color.green(color);<NEW_LINE>int blue = Color.blue(color);<NEW_LINE>presets[i] = Color.argb(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>presets = unshiftIfNotExists(presets, color);<NEW_LINE>int initialColor = getArguments().getInt(ARG_COLOR);<NEW_LINE>if (initialColor != color) {<NEW_LINE>// The user clicked a color and a configuration change occurred. Make sure the initial color is in the presets<NEW_LINE>presets = unshiftIfNotExists(presets, initialColor);<NEW_LINE>}<NEW_LINE>if (isMaterialColors && presets.length == 19) {<NEW_LINE>// Add black to have a total of 20 colors if the current color is in the material color palette<NEW_LINE>presets = pushIfNotExists(presets, Color.argb(alpha, 0, 0, 0));<NEW_LINE>}<NEW_LINE>}
alpha, red, green, blue);
1,301,625
public static Map<String, List<DBSnapshot>> fetchRDSDBSnapshots(BasicSessionCredentials temporaryCredentials, String skipRegions, String accountId, String accountName) {<NEW_LINE>Map<String, List<DBSnapshot>> snapshots = new LinkedHashMap<>();<NEW_LINE>String expPrefix <MASK><NEW_LINE>for (Region region : RegionUtils.getRegions()) {<NEW_LINE>try {<NEW_LINE>if (!skipRegions.contains(region.getName())) {<NEW_LINE>AmazonRDS rdsClient = AmazonRDSClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(temporaryCredentials)).withRegion(region.getName()).build();<NEW_LINE>DescribeDBSnapshotsResult rslt;<NEW_LINE>List<DBSnapshot> snapshotsTemp = new ArrayList<>();<NEW_LINE>String marker = null;<NEW_LINE>do {<NEW_LINE>rslt = rdsClient.describeDBSnapshots(new DescribeDBSnapshotsRequest().withIncludePublic(false).withIncludeShared(false).withMarker(marker));<NEW_LINE>snapshotsTemp.addAll(rslt.getDBSnapshots());<NEW_LINE>marker = rslt.getMarker();<NEW_LINE>} while (marker != null);<NEW_LINE>if (!snapshotsTemp.isEmpty()) {<NEW_LINE>log.debug(InventoryConstants.ACCOUNT + accountId + " Type : RDS Snapshot" + region.getName() + " >> " + snapshotsTemp.size());<NEW_LINE>snapshots.put(accountId + delimiter + accountName + delimiter + region.getName(), snapshotsTemp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (region.isServiceSupported(AmazonRDS.ENDPOINT_PREFIX)) {<NEW_LINE>log.warn(expPrefix + region.getName() + InventoryConstants.ERROR_CAUSE + e.getMessage() + "\"}");<NEW_LINE>ErrorManageUtil.uploadError(accountId, region.getName(), "rdssnapshot", e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return snapshots;<NEW_LINE>}
= InventoryConstants.ERROR_PREFIX_CODE + accountId + "\",\"Message\": \"Exception in fetching info for resource in specific region\" ,\"type\": \"RDS Snapshot\" , \"region\":\"";
1,322,716
public double applyAsDouble(FixedNode node) {<NEW_LINE>assert node != null;<NEW_LINE>computeNodeRelativeFrequencyCounter.increment(node.getDebug());<NEW_LINE>FixedNode current = findBegin(node);<NEW_LINE>if (current == null) {<NEW_LINE>// this should only appear for dead code<NEW_LINE>return 1D;<NEW_LINE>}<NEW_LINE>assert current instanceof AbstractBeginNode;<NEW_LINE>Double cachedValue = cache.get(current);<NEW_LINE>if (cachedValue != null) {<NEW_LINE>return cachedValue;<NEW_LINE>}<NEW_LINE>ControlFlowGraph cfg = ControlFlowGraph.compute(node.graph(), false, false, false, false);<NEW_LINE>double relativeFrequency = 0.0;<NEW_LINE>if (current.predecessor() == null) {<NEW_LINE>if (current instanceof AbstractMergeNode) {<NEW_LINE>relativeFrequency = handleMerge(current, relativeFrequency, cfg);<NEW_LINE>} else {<NEW_LINE>assert current instanceof StartNode;<NEW_LINE>relativeFrequency = 1D;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ControlSplitNode split = <MASK><NEW_LINE>relativeFrequency = multiplyRelativeFrequencies(split.probability((AbstractBeginNode) current), applyAsDouble(split));<NEW_LINE>}<NEW_LINE>assert !Double.isNaN(relativeFrequency) && !Double.isInfinite(relativeFrequency) : current + " " + relativeFrequency;<NEW_LINE>cache.put(current, relativeFrequency);<NEW_LINE>return relativeFrequency;<NEW_LINE>}
(ControlSplitNode) current.predecessor();
560,867
protected Object predictResult(Object input) {<NEW_LINE>if (null == input) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>HashMap<Integer, Integer> wordCount = new HashMap<>(0);<NEW_LINE>String content = (String) input;<NEW_LINE>String[] tokens = content.split(NLPConstant.WORD_DELIMITER);<NEW_LINE>double minTermCount = model.minTF >= 1.0 ? model.minTF <MASK><NEW_LINE>double tokenRatio = 1.0 / tokens.length;<NEW_LINE>for (String token : tokens) {<NEW_LINE>int hashValue = Math.abs(HASH.hashUnencodedChars(token).asInt());<NEW_LINE>int index = Math.floorMod(hashValue, model.numFeatures);<NEW_LINE>if (model.idfMap.containsKey(index)) {<NEW_LINE>wordCount.merge(index, 1, Integer::sum);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int[] indexes = new int[wordCount.size()];<NEW_LINE>double[] values = new double[indexes.length];<NEW_LINE>int pos = 0;<NEW_LINE>for (Map.Entry<Integer, Integer> entry : wordCount.entrySet()) {<NEW_LINE>double count = entry.getValue();<NEW_LINE>if (count >= minTermCount) {<NEW_LINE>indexes[pos] = entry.getKey();<NEW_LINE>values[pos++] = featureType.featureValueFunc.apply(model.idfMap.get(entry.getKey()), count, tokenRatio);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new SparseVector(model.numFeatures, Arrays.copyOf(indexes, pos), Arrays.copyOf(values, pos));<NEW_LINE>}
: model.minTF * tokens.length;
1,011,072
final BatchEnableAlarmResult executeBatchEnableAlarm(BatchEnableAlarmRequest batchEnableAlarmRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(batchEnableAlarmRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<BatchEnableAlarmRequest> request = null;<NEW_LINE>Response<BatchEnableAlarmResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new BatchEnableAlarmRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(batchEnableAlarmRequest));<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, "IoT Events Data");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "BatchEnableAlarm");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<BatchEnableAlarmResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new BatchEnableAlarmResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,265,322
public void marshall(NetworkConnectionAction networkConnectionAction, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (networkConnectionAction == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(networkConnectionAction.getBlocked(), BLOCKED_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(networkConnectionAction.getLocalPortDetails(), LOCALPORTDETAILS_BINDING);<NEW_LINE>protocolMarshaller.marshall(networkConnectionAction.getProtocol(), PROTOCOL_BINDING);<NEW_LINE>protocolMarshaller.marshall(networkConnectionAction.getLocalIpDetails(), LOCALIPDETAILS_BINDING);<NEW_LINE>protocolMarshaller.marshall(networkConnectionAction.getRemoteIpDetails(), REMOTEIPDETAILS_BINDING);<NEW_LINE>protocolMarshaller.marshall(networkConnectionAction.getRemotePortDetails(), REMOTEPORTDETAILS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
networkConnectionAction.getConnectionDirection(), CONNECTIONDIRECTION_BINDING);
1,721,534
public Long generateNewDPAE(Employee employee) throws AxelorException {<NEW_LINE>EmploymentContract mainEmploymentContract = employee.getMainEmploymentContract();<NEW_LINE>if (mainEmploymentContract == null) {<NEW_LINE>throw new AxelorException(TraceBackRepository.CATEGORY_MISSING_FIELD, I18n.get(IExceptionMessage.EMPLOYEE_CONTRACT_OF_EMPLOYMENT), employee.getName());<NEW_LINE>}<NEW_LINE>Company payCompany = mainEmploymentContract.getPayCompany();<NEW_LINE>Partner employer = payCompany.getPartner();<NEW_LINE>DPAE newDPAE = new DPAE();<NEW_LINE>// Employer<NEW_LINE>newDPAE.setRegistrationCode(employer.getRegistrationCode());<NEW_LINE>if (employer.getMainActivity() != null && employer.getMainActivity().getFullName() != null) {<NEW_LINE>newDPAE.setMainActivityCode(employer.getMainActivity().getFullName());<NEW_LINE>}<NEW_LINE>newDPAE.setCompany(payCompany);<NEW_LINE>newDPAE.setCompanyAddress(employer.getMainAddress());<NEW_LINE>newDPAE.<MASK><NEW_LINE>if (payCompany.getHrConfig() != null) {<NEW_LINE>newDPAE.setHealthService(payCompany.getHrConfig().getHealthService());<NEW_LINE>newDPAE.setHealthServiceAddress(payCompany.getHrConfig().getHealthServiceAddress());<NEW_LINE>}<NEW_LINE>// Employee<NEW_LINE>newDPAE.setLastName(employee.getContactPartner().getName());<NEW_LINE>newDPAE.setFirstName(employee.getContactPartner().getFirstName());<NEW_LINE>newDPAE.setSocialSecurityNumber(employee.getSocialSecurityNumber());<NEW_LINE>newDPAE.setSexSelect(employee.getSexSelect());<NEW_LINE>newDPAE.setBirthDate(employee.getBirthDate());<NEW_LINE>newDPAE.setDepartmentOfBirth(employee.getDepartmentOfBirth());<NEW_LINE>newDPAE.setCityOfBirth(employee.getCityOfBirth());<NEW_LINE>newDPAE.setCountryOfBirth(employee.getCountryOfBirth());<NEW_LINE>// Contract<NEW_LINE>newDPAE.setHireDate(mainEmploymentContract.getStartDate());<NEW_LINE>newDPAE.setHireTime(mainEmploymentContract.getStartTime());<NEW_LINE>newDPAE.setTrialPeriodDuration(mainEmploymentContract.getTrialPeriodDuration());<NEW_LINE>newDPAE.setContractType(mainEmploymentContract.getContractType());<NEW_LINE>newDPAE.setContractEndDate(mainEmploymentContract.getEndDate());<NEW_LINE>employee.addDpaeListItem(newDPAE);<NEW_LINE>Beans.get(EmployeeRepository.class).save(employee);<NEW_LINE>return newDPAE.getId();<NEW_LINE>}
setCompanyFixedPhone(employer.getFixedPhone());