idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
443,700
public FixedResponseActionConfig unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>FixedResponseActionConfig fixedResponseActionConfig = new FixedResponseActionConfig();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return fixedResponseActionConfig;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("MessageBody", targetDepth)) {<NEW_LINE>fixedResponseActionConfig.setMessageBody(StringStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("StatusCode", targetDepth)) {<NEW_LINE>fixedResponseActionConfig.setStatusCode(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("ContentType", targetDepth)) {<NEW_LINE>fixedResponseActionConfig.setContentType(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return fixedResponseActionConfig;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().unmarshall(context));
212,189
protected void addAnnotationFromFieldInvariant(AnnotatedTypeMirror type, AnnotatedTypeMirror accessedVia, VariableElement field) {<NEW_LINE>TypeMirror declaringType = accessedVia.getUnderlyingType();<NEW_LINE>// Find the first upper bound that isn't a wildcard or type variable<NEW_LINE>while (declaringType.getKind() == TypeKind.WILDCARD || declaringType.getKind() == TypeKind.TYPEVAR) {<NEW_LINE>if (declaringType.getKind() == TypeKind.WILDCARD) {<NEW_LINE>declaringType = TypesUtils.wildUpperBound(declaringType, processingEnv);<NEW_LINE>} else if (declaringType.getKind() == TypeKind.TYPEVAR) {<NEW_LINE>declaringType = ((TypeVariable) declaringType).getUpperBound();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>TypeElement typeElement = TypesUtils.getTypeElement(declaringType);<NEW_LINE>if (ElementUtils.enclosingTypeElement(field).equals(typeElement)) {<NEW_LINE>// If the field is declared in the accessedVia class, then the field in the invariant<NEW_LINE>// cannot be this field, even if the field has the same name.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>FieldInvariants invariants = getFieldInvariants(typeElement);<NEW_LINE>if (invariants == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<AnnotationMirror> invariantAnnos = invariants.<MASK><NEW_LINE>type.replaceAnnotations(invariantAnnos);<NEW_LINE>}
getQualifiersFor(field.getSimpleName());
449,153
final CreateComponentVersionResult executeCreateComponentVersion(CreateComponentVersionRequest createComponentVersionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createComponentVersionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateComponentVersionRequest> request = null;<NEW_LINE>Response<CreateComponentVersionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateComponentVersionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createComponentVersionRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateComponentVersion");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateComponentVersionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateComponentVersionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
1,323,725
public boolean editCellAt(int row, int column, EventObject e) {<NEW_LINE>boolean editResult = super.editCellAt(row, column, e);<NEW_LINE>if (e instanceof MouseEvent && isTreeColumn(column)) {<NEW_LINE>MouseEvent me = (MouseEvent) e;<NEW_LINE><MASK><NEW_LINE>if (getRowHeight() != myTree.getRowHeight()) {<NEW_LINE>// fix y if row heights are not equal<NEW_LINE>// [todo]: review setRowHeight to synchronize heights correctly!<NEW_LINE>final Rectangle tableCellRect = getCellRect(row, column, true);<NEW_LINE>y = Math.min(y - tableCellRect.y, myTree.getRowHeight() - 1) + row * myTree.getRowHeight();<NEW_LINE>}<NEW_LINE>MouseEvent newEvent = new MouseEvent(myTree, me.getID(), me.getWhen(), me.getModifiers(), me.getX() - getCellRect(0, column, true).x, y, me.getClickCount(), me.isPopupTrigger());<NEW_LINE>myTree.dispatchEvent(newEvent);<NEW_LINE>// Some LAFs, for example, Aqua under MAC OS X<NEW_LINE>// expand tree node by MOUSE_RELEASED event. Unfortunately,<NEW_LINE>// it's not possible to find easy way to wedge in table's<NEW_LINE>// event sequense. Therefore we send "synthetic" release event.<NEW_LINE>if (newEvent.getID() == MouseEvent.MOUSE_PRESSED) {<NEW_LINE>MouseEvent newME2 = new MouseEvent(myTree, MouseEvent.MOUSE_RELEASED, me.getWhen(), me.getModifiers(), me.getX() - getCellRect(0, column, true).x, y - getCellRect(0, column, true).y, me.getClickCount(), me.isPopupTrigger());<NEW_LINE>myTree.dispatchEvent(newME2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return editResult;<NEW_LINE>}
int y = me.getY();
1,096,826
public void check() {<NEW_LINE>if (iDate().before(legacyFieldDate))<NEW_LINE>return;<NEW_LINE>if (values() != null) {<NEW_LINE>final String[] tempVals = StringUtil.split(values().replaceAll("\r\n", "|").trim(), "|");<NEW_LINE>for (int i = 1; i < tempVals.length; i += 2) {<NEW_LINE>try {<NEW_LINE>if (dataType() == DataTypes.FLOAT) {<NEW_LINE>Float.parseFloat(tempVals[i]);<NEW_LINE>} else if (dataType() == DataTypes.INTEGER) {<NEW_LINE>Integer<MASK><NEW_LINE>} else if (dataType() == DataTypes.BOOL) {<NEW_LINE>final String x = "1".equals(tempVals[i]) ? "true" : "0".equals(tempVals[i]) ? "false" : tempVals[i];<NEW_LINE>final Boolean y = BooleanUtils.toBooleanObject(x);<NEW_LINE>if (null == y) {<NEW_LINE>throw new DotStateException(String.format("Value of field '%s' [%s], CT ID [%s] of type " + "'%s' is not a valid boolean: %s", name(), id(), contentTypeId(), dataType(), x));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (final Exception e) {<NEW_LINE>throw new DotStateException(String.format("Value of field '%s' [%s], CT ID [%s] of type '%s' is " + "not valid: %s", name(), id(), contentTypeId(), dataType(), values()), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.parseInt(tempVals[i]);
1,165,225
// rb_check_argv<NEW_LINE>public static RubyString checkArgv(ThreadContext context, IRubyObject[] argv) {<NEW_LINE>Ruby runtime = context.runtime;<NEW_LINE>IRubyObject tmp;<NEW_LINE>RubyString prog;<NEW_LINE>int i;<NEW_LINE>Arity.checkArgumentCount(runtime, argv, 1, Integer.MAX_VALUE);<NEW_LINE>prog = null;<NEW_LINE>// if first parameter is an array, it is expected to be [program, $0 name]<NEW_LINE>tmp = TypeConverter.checkArrayType(runtime, argv[0]);<NEW_LINE>if (!tmp.isNil()) {<NEW_LINE>RubyArray arrayArg = (RubyArray) tmp;<NEW_LINE>if (arrayArg.size() != 2) {<NEW_LINE>throw runtime.newArgumentError("wrong first argument");<NEW_LINE>}<NEW_LINE>prog = arrayArg.eltOk(0).convertToString();<NEW_LINE>argv[0] = arrayArg.eltOk(1);<NEW_LINE>StringSupport.checkEmbeddedNulls(runtime, prog);<NEW_LINE>prog = prog.strDup(runtime);<NEW_LINE>prog.setFrozen(true);<NEW_LINE>}<NEW_LINE>// process all arguments<NEW_LINE>for (i = 0; i < argv.length; i++) {<NEW_LINE>argv[i] = argv[i].convertToString().newFrozen();<NEW_LINE>StringSupport.checkEmbeddedNulls<MASK><NEW_LINE>}<NEW_LINE>// return program, or null if we did not yet determine it<NEW_LINE>return prog;<NEW_LINE>}
(runtime, argv[i]);
983,907
public void instanceCodegen(CodegenInstanceAux instance, CodegenClassScope classScope, CodegenCtor factoryCtor, List<CodegenTypedParam> factoryMembers) {<NEW_LINE>instance.getMethods().addMethod(SelectExprProcessor.EPTYPE, "getSelectExprProcessor", Collections.emptyList(), this.getClass(), classScope, methodNode -> methodNode.getBlock().methodReturn(MEMBER_SELECTEXPRPROCESSOR));<NEW_LINE>instance.getMethods().addMethod(AggregationService.EPTYPE, "getAggregationService", Collections.emptyList(), this.getClass(), classScope, methodNode -> methodNode.getBlock().methodReturn(MEMBER_AGGREGATIONSVC));<NEW_LINE>instance.getMethods().addMethod(ExprEvaluatorContext.EPTYPE, "getExprEvaluatorContext", Collections.emptyList(), this.getClass(), classScope, methodNode -> methodNode.getBlock().methodReturn(MEMBER_EXPREVALCONTEXT));<NEW_LINE>instance.getMethods().addMethod(EPTypePremade.BOOLEANPRIMITIVE.getEPType(), "hasHavingClause", Collections.emptyList(), this.getClass(), classScope, methodNode -> methodNode.getBlock().methodReturn(constant(optionalHavingNode != null)));<NEW_LINE>instance.getMethods().addMethod(EPTypePremade.BOOLEANPRIMITIVE.getEPType(), "isSelectRStream", Collections.emptyList(), ResultSetProcessorRowForAll.class, classScope, methodNode -> methodNode.getBlock().methodReturn(constant(isSelectRStream)));<NEW_LINE>ResultSetProcessorUtil.evaluateHavingClauseCodegen(optionalHavingNode, classScope, instance);<NEW_LINE>ResultSetProcessorAggregateGroupedImpl.removedAggregationGroupKeyCodegen(classScope, instance);<NEW_LINE>generateGroupKeySingle = ResultSetProcessorGroupedUtil.generateGroupKeySingleCodegen(groupKeyNodeExpressions, multiKeyClassRef, classScope, instance);<NEW_LINE>generateGroupKeyArrayView = generateGroupKeyArrayViewCodegen(generateGroupKeySingle, classScope, instance);<NEW_LINE>generateGroupKeyArrayJoin = ResultSetProcessorGroupedUtil.generateGroupKeyArrayJoinCodegen(generateGroupKeySingle, classScope, instance);<NEW_LINE>ResultSetProcessorAggregateGroupedImpl.<MASK><NEW_LINE>ResultSetProcessorAggregateGroupedImpl.generateOutputBatchedViewUnkeyedCodegen(this, classScope, instance);<NEW_LINE>ResultSetProcessorAggregateGroupedImpl.generateOutputBatchedJoinUnkeyedCodegen(this, classScope, instance);<NEW_LINE>ResultSetProcessorAggregateGroupedImpl.generateOutputBatchedJoinPerKeyCodegen(this, classScope, instance);<NEW_LINE>ResultSetProcessorAggregateGroupedImpl.generateOutputBatchedViewPerKeyCodegen(this, classScope, instance);<NEW_LINE>}
generateOutputBatchedSingleCodegen(this, classScope, instance);
496,600
public static double d(int[] x1, int[] x2, int radius) {<NEW_LINE>int n1 = x1.length;<NEW_LINE>int n2 = x2.length;<NEW_LINE>double[][] table = new double[2][n2 + 1];<NEW_LINE>table[0][0] = 0;<NEW_LINE>for (int i = 1; i <= n2; i++) {<NEW_LINE>table[0][i] = Double.POSITIVE_INFINITY;<NEW_LINE>}<NEW_LINE>for (int i = 1; i <= n1; i++) {<NEW_LINE>int start = Math.max(1, i - radius);<NEW_LINE>int end = Math.min(n2, i + radius);<NEW_LINE>table[1][start - 1] = Double.POSITIVE_INFINITY;<NEW_LINE>if (end < n2)<NEW_LINE>table[1][end + 1] = Double.POSITIVE_INFINITY;<NEW_LINE>for (int j = start; j <= end; j++) {<NEW_LINE>double cost = Math.abs(x1[i - 1] - x2[j - 1]);<NEW_LINE>double min = table<MASK><NEW_LINE>if (min > table[0][j]) {<NEW_LINE>min = table[0][j];<NEW_LINE>}<NEW_LINE>if (min > table[1][j - 1]) {<NEW_LINE>min = table[1][j - 1];<NEW_LINE>}<NEW_LINE>table[1][j] = cost + min;<NEW_LINE>}<NEW_LINE>double[] swap = table[0];<NEW_LINE>table[0] = table[1];<NEW_LINE>table[1] = swap;<NEW_LINE>}<NEW_LINE>return table[0][n2];<NEW_LINE>}
[0][j - 1];
392,386
public void fillMenu(String sColumnName, Menu menu) {<NEW_LINE>List<Object> ds = tv.getSelectedDataSources();<NEW_LINE>final List<ChatInstance> chats = new ArrayList<>();<NEW_LINE>for (Object obj : ds) {<NEW_LINE>if (obj instanceof ChatInstance) {<NEW_LINE>chats.add((ChatInstance) obj);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// show in sidebar<NEW_LINE>MenuItem itemSiS = new MenuItem(menu, SWT.PUSH);<NEW_LINE>Messages.setLanguageText(itemSiS, Utils.isAZ2UI() ? "label.show.in.tab" : "label.show.in.sidebar");<NEW_LINE>itemSiS.setEnabled(chats.size() > 0);<NEW_LINE>itemSiS.addListener(SWT.Selection, new Listener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handleEvent(Event event) {<NEW_LINE>MultipleDocumentInterface mdi = UIFunctionsManager<MASK><NEW_LINE>for (int i = 0, chatsSize = chats.size(); i < chatsSize; i++) {<NEW_LINE>ChatInstance chat = chats.get(i);<NEW_LINE>try {<NEW_LINE>mdi.loadEntryByID("Chat_", i == 0, false, chat.getClone());<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Debug.out(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>MenuItem itemRemove = new MenuItem(menu, SWT.PUSH);<NEW_LINE>Messages.setLanguageText(itemRemove, "MySharesView.menu.remove");<NEW_LINE>Utils.setMenuItemImage(itemRemove, "delete");<NEW_LINE>itemRemove.setEnabled(chats.size() > 0);<NEW_LINE>itemRemove.addListener(SWT.Selection, new Listener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handleEvent(Event e) {<NEW_LINE>for (ChatInstance chat : chats) {<NEW_LINE>chat.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>new MenuItem(menu, SWT.SEPARATOR);<NEW_LINE>}
.getUIFunctions().getMDI();
484,340
public void read(Configuration cfg) {<NEW_LINE>setHostName(cfg.getValue(FtpConnectionProvider.HOST));<NEW_LINE>setPort(cfg.getValue(FtpConnectionProvider.PORT));<NEW_LINE>setEncryption(cfg.getValue(FtpConnectionProvider.ENCRYPTION));<NEW_LINE>setOnlyLoginSecured(Boolean.valueOf(cfg.getValue(FtpConnectionProvider.ONLY_LOGIN_ENCRYPTED)));<NEW_LINE>setUserName(cfg.getValue(FtpConnectionProvider.USER));<NEW_LINE>setPassword(readPassword(cfg));<NEW_LINE>setAnonymousLogin(Boolean.valueOf(cfg.getValue(FtpConnectionProvider.ANONYMOUS_LOGIN)));<NEW_LINE>setInitialDirectory(cfg.getValue(FtpConnectionProvider.INITIAL_DIRECTORY));<NEW_LINE>setTimeout(cfg.getValue(FtpConnectionProvider.TIMEOUT));<NEW_LINE>setKeepAliveInterval(cfg<MASK><NEW_LINE>setPassiveMode(Boolean.valueOf(cfg.getValue(FtpConnectionProvider.PASSIVE_MODE)));<NEW_LINE>setExternalIp(cfg.getValue(FtpConnectionProvider.ACTIVE_EXTERNAL_IP));<NEW_LINE>setMinPortRange(readOptionalNumber(cfg.getValue(FtpConnectionProvider.ACTIVE_PORT_MIN)));<NEW_LINE>setMaxPortRange(readOptionalNumber(cfg.getValue(FtpConnectionProvider.ACTIVE_PORT_MAX)));<NEW_LINE>setIgnoreDisconnectErrors(Boolean.valueOf(cfg.getValue(FtpConnectionProvider.IGNORE_DISCONNECT_ERRORS)));<NEW_LINE>}
.getValue(FtpConnectionProvider.KEEP_ALIVE_INTERVAL));
1,077,188
static List<Mat> applySortedIndsToElements(List<Mat> mats, Mat sortedInds) {<NEW_LINE>int nChannels = mats.get(0).channels();<NEW_LINE>int nRows = mats.get(0).rows();<NEW_LINE>int nCols = mats.get(0).cols();<NEW_LINE><MASK><NEW_LINE>assert sortedInds.cols() == nImages;<NEW_LINE>assert sortedInds.rows() == nRows * nCols;<NEW_LINE>IntIndexer idx = sortedInds.createIndexer();<NEW_LINE>List<Mat> outputMats = new ArrayList<>();<NEW_LINE>List<FloatIndexer> outputIndexers = new ArrayList<>();<NEW_LINE>List<FloatIndexer> indexers = new ArrayList<>();<NEW_LINE>for (int i = 0; i < nImages; i++) {<NEW_LINE>var temp = new Mat(nRows, nCols, opencv_core.CV_32FC(nChannels));<NEW_LINE>outputMats.add(temp);<NEW_LINE>outputIndexers.add(temp.createIndexer());<NEW_LINE>indexers.add(mats.get(i).createIndexer());<NEW_LINE>}<NEW_LINE>long[] inds = new long[3];<NEW_LINE>for (int i = 0; i < nImages; i++) {<NEW_LINE>var outputIdx = outputIndexers.get(i);<NEW_LINE>for (int r = 0; r < nRows; r++) {<NEW_LINE>inds[0] = r;<NEW_LINE>for (int c = 0; c < nCols; c++) {<NEW_LINE>inds[1] = c;<NEW_LINE>int ind = idx.get(r * nCols + c, i);<NEW_LINE>var tempIdx = indexers.get(ind);<NEW_LINE>for (int channel = 0; channel < nChannels; channel++) {<NEW_LINE>inds[2] = channel;<NEW_LINE>outputIdx.put(inds, tempIdx.get(inds));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>outputIndexers.forEach(FloatIndexer::close);<NEW_LINE>indexers.forEach(FloatIndexer::close);<NEW_LINE>return outputMats;<NEW_LINE>}
int nImages = mats.size();
1,169,289
private Integer findSegment(int ip, int index, boolean createIfNotExists) throws IOException {<NEW_LINE>Map<Integer, Integer> map = m_table.get(ip);<NEW_LINE>if (map == null && createIfNotExists) {<NEW_LINE>map = new HashMap<Integer, Integer>();<NEW_LINE>m_table.put(ip, map);<NEW_LINE>}<NEW_LINE>Integer segmentId = map == null ? null : map.get(index);<NEW_LINE>if (segmentId == null && createIfNotExists) {<NEW_LINE>long value = (((long) ip) << 32) + index;<NEW_LINE>segmentId = m_nextSegment;<NEW_LINE>map.put(index, segmentId);<NEW_LINE><MASK><NEW_LINE>m_offset += 8;<NEW_LINE>m_nextSegment++;<NEW_LINE>if (m_nextSegment % (ENTRY_PER_SEGMENT) == 0) {<NEW_LINE>// last segment is full, create new one<NEW_LINE>m_segment.flushAndClose();<NEW_LINE>m_segment = new Segment(m_indexChannel, ((long) m_nextSegment) * SEGMENT_SIZE);<NEW_LINE>// skip self head data<NEW_LINE>m_nextSegment++;<NEW_LINE>// write magic code<NEW_LINE>m_segment.writeLong(0, -1);<NEW_LINE>m_offset = 8;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return segmentId;<NEW_LINE>}
m_segment.writeLong(m_offset, value);
182,913
public String buildMergeStatement(String replicaTable, String stagingTable, List<String> primaryKeyFields, List<String> orderByFields, String deletedFieldName, List<String> allFields) {<NEW_LINE>// Key/Value Map used to replace values in template<NEW_LINE>Map<String, String> mergeQueryValues = new HashMap<>();<NEW_LINE>mergeQueryValues.put("replicaTable", replicaTable);<NEW_LINE>mergeQueryValues.put("replicaAlias", REPLICA_TABLE_NAME);<NEW_LINE>mergeQueryValues.put("stagingAlias", STAGING_TABLE_NAME);<NEW_LINE>mergeQueryValues.put("deleteColumn", deletedFieldName);<NEW_LINE>mergeQueryValues.put("stagingViewSql", buildLatestViewOfStagingTable(stagingTable, allFields, primaryKeyFields, orderByFields, deletedFieldName, configuration.partitionRetention()));<NEW_LINE>mergeQueryValues.put("joinCondition", buildJoinConditions(primaryKeyFields, REPLICA_TABLE_NAME, STAGING_TABLE_NAME));<NEW_LINE>mergeQueryValues.put("timestampCompareSql", <MASK><NEW_LINE>mergeQueryValues.put("mergeUpdateSql", buildUpdateStatement(allFields, configuration.quoteCharacter()));<NEW_LINE>mergeQueryValues.put("mergeInsertSql", buildInsertStatement(allFields, configuration.quoteCharacter()));<NEW_LINE>String mergeStatement = StringSubstitutor.replace(configuration.mergeQueryTemplate(), mergeQueryValues, "{", "}");<NEW_LINE>return mergeStatement;<NEW_LINE>}
buildTimestampCheck(getPrimarySortField(orderByFields)));
33,176
public static DescribeEmgVulGroupResponse unmarshall(DescribeEmgVulGroupResponse describeEmgVulGroupResponse, UnmarshallerContext context) {<NEW_LINE>describeEmgVulGroupResponse.setRequestId(context.stringValue("DescribeEmgVulGroupResponse.RequestId"));<NEW_LINE>describeEmgVulGroupResponse.setTotalCount(context.integerValue("DescribeEmgVulGroupResponse.TotalCount"));<NEW_LINE>List<EmgVulGroup> emgVulGroupList = new ArrayList<EmgVulGroup>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeEmgVulGroupResponse.EmgVulGroupList.Length"); i++) {<NEW_LINE>EmgVulGroup emgVulGroup = new EmgVulGroup();<NEW_LINE>emgVulGroup.setAliasName(context.stringValue("DescribeEmgVulGroupResponse.EmgVulGroupList[" + i + "].AliasName"));<NEW_LINE>emgVulGroup.setPendingCount(context.integerValue("DescribeEmgVulGroupResponse.EmgVulGroupList[" + i + "].PendingCount"));<NEW_LINE>emgVulGroup.setName(context.stringValue("DescribeEmgVulGroupResponse.EmgVulGroupList[" + i + "].Name"));<NEW_LINE>emgVulGroup.setGmtPublish(context.longValue("DescribeEmgVulGroupResponse.EmgVulGroupList[" + i + "].GmtPublish"));<NEW_LINE>emgVulGroup.setDescription(context.stringValue<MASK><NEW_LINE>emgVulGroup.setType(context.stringValue("DescribeEmgVulGroupResponse.EmgVulGroupList[" + i + "].Type"));<NEW_LINE>emgVulGroup.setStatus(context.integerValue("DescribeEmgVulGroupResponse.EmgVulGroupList[" + i + "].Status"));<NEW_LINE>emgVulGroupList.add(emgVulGroup);<NEW_LINE>}<NEW_LINE>describeEmgVulGroupResponse.setEmgVulGroupList(emgVulGroupList);<NEW_LINE>return describeEmgVulGroupResponse;<NEW_LINE>}
("DescribeEmgVulGroupResponse.EmgVulGroupList[" + i + "].Description"));
1,009,193
final GetTrafficPolicyInstanceResult executeGetTrafficPolicyInstance(GetTrafficPolicyInstanceRequest getTrafficPolicyInstanceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getTrafficPolicyInstanceRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetTrafficPolicyInstanceRequest> request = null;<NEW_LINE>Response<GetTrafficPolicyInstanceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetTrafficPolicyInstanceRequestMarshaller().marshall(super.beforeMarshalling(getTrafficPolicyInstanceRequest));<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, "Route 53");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetTrafficPolicyInstance");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<GetTrafficPolicyInstanceResult> responseHandler = new StaxResponseHandler<GetTrafficPolicyInstanceResult>(new GetTrafficPolicyInstanceResultStaxUnmarshaller());<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,606,116
private void handleJobHistoryPage(final HttpServletRequest req, final HttpServletResponse resp, final Session session) throws ServletException, IOException {<NEW_LINE>final Page page = newPage(req, resp, session, "azkaban/webapp/servlet/velocity/jobhistorypage.vm");<NEW_LINE>final String jobId = getParam(req, "job");<NEW_LINE>page.add("jobId", jobId);<NEW_LINE>int pageNum = Math.max(1, getIntParam(req, "page", 1));<NEW_LINE>page.add("page", pageNum);<NEW_LINE>final int pageSize = Math.max(1, getIntParam(req, "size", 25));<NEW_LINE>page.add("pageSize", pageSize);<NEW_LINE>page.add("recordCount", 0);<NEW_LINE>page.add("projectId", "");<NEW_LINE>page.add("projectName", "");<NEW_LINE>page.add("dataSeries", "[]");<NEW_LINE>page.add("history", null);<NEW_LINE>final String projectName = getParam(req, "project");<NEW_LINE>final User user = session.getUser();<NEW_LINE>final Project project = this.projectManager.getProject(projectName);<NEW_LINE>if (project == null) {<NEW_LINE>page.add(<MASK><NEW_LINE>page.render();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!hasPermission(project, user, Type.READ)) {<NEW_LINE>page.add("errorMsg", "No permission to view project " + projectName + ".");<NEW_LINE>page.render();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>page.add("projectId", project.getId());<NEW_LINE>page.add("projectName", project.getName());<NEW_LINE>try {<NEW_LINE>final int numResults = this.executorManagerAdapter.getNumberOfJobExecutions(project, jobId);<NEW_LINE>page.add("recordCount", numResults);<NEW_LINE>final int totalPages = ((numResults - 1) / pageSize) + 1;<NEW_LINE>if (pageNum > totalPages) {<NEW_LINE>pageNum = totalPages;<NEW_LINE>page.add("page", pageNum);<NEW_LINE>}<NEW_LINE>final int elementsToSkip = (pageNum - 1) * pageSize;<NEW_LINE>final List<ExecutableJobInfo> jobInfo = this.executorManagerAdapter.getExecutableJobs(project, jobId, elementsToSkip, pageSize);<NEW_LINE>if (CollectionUtils.isNotEmpty(jobInfo)) {<NEW_LINE>page.add("history", jobInfo);<NEW_LINE>final ArrayList<Object> dataSeries = new ArrayList<>();<NEW_LINE>for (final ExecutableJobInfo info : jobInfo) {<NEW_LINE>final Map<String, Object> map = info.toObject();<NEW_LINE>dataSeries.add(map);<NEW_LINE>}<NEW_LINE>page.add("dataSeries", JSONUtils.toJSON(dataSeries));<NEW_LINE>}<NEW_LINE>} catch (final ExecutorManagerException e) {<NEW_LINE>page.add("errorMsg", e.getMessage());<NEW_LINE>}<NEW_LINE>page.render();<NEW_LINE>}
"errorMsg", "Project " + projectName + " doesn't exist.");
1,623,259
public boolean defaultNetworkRules(final Connect conn, final String vmName, final NicTO nic, final Long vmId, final String secIpStr, final boolean isFirstNic, final boolean checkBeforeApply) {<NEW_LINE>if (!_canBridgeFirewall) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final List<InterfaceDef> intfs = getInterfaces(conn, vmName);<NEW_LINE>if (intfs.size() == 0 || intfs.size() < nic.getDeviceId()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final InterfaceDef intf = intfs.get(nic.getDeviceId());<NEW_LINE>final <MASK><NEW_LINE>final String vif = intf.getDevName();<NEW_LINE>final Script cmd = new Script(_securityGroupPath, _timeout, s_logger);<NEW_LINE>cmd.add("default_network_rules");<NEW_LINE>cmd.add("--vmname", vmName);<NEW_LINE>cmd.add("--vmid", vmId.toString());<NEW_LINE>if (nic.getIp() != null) {<NEW_LINE>cmd.add("--vmip", nic.getIp());<NEW_LINE>}<NEW_LINE>if (nic.getIp6Address() != null) {<NEW_LINE>cmd.add("--vmip6", nic.getIp6Address());<NEW_LINE>}<NEW_LINE>cmd.add("--vmmac", nic.getMac());<NEW_LINE>cmd.add("--vif", vif);<NEW_LINE>cmd.add("--brname", brname);<NEW_LINE>cmd.add("--nicsecips", secIpStr);<NEW_LINE>if (isFirstNic) {<NEW_LINE>cmd.add("--isFirstNic");<NEW_LINE>}<NEW_LINE>if (checkBeforeApply) {<NEW_LINE>cmd.add("--check");<NEW_LINE>}<NEW_LINE>final String result = cmd.execute();<NEW_LINE>if (result != null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
String brname = intf.getBrName();
497,654
private void compare(String sent, EventBean[] received, String measures, SupportTestCaseItem testDesc) {<NEW_LINE>String message = "For sent: " + sent;<NEW_LINE>if (testDesc.getExpected() == null) {<NEW_LINE>assertEquals(message, 0, received.length);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String[] receivedText = new String[received.length];<NEW_LINE>for (int i = 0; i < received.length; i++) {<NEW_LINE>StringBuilder buf = new StringBuilder();<NEW_LINE>String delimiter = "";<NEW_LINE>for (String measure : measures.split(",")) {<NEW_LINE>buf.append(delimiter);<NEW_LINE>Object value = received[i].get(replaceBrackets(measure) + "val");<NEW_LINE>buf.append(value);<NEW_LINE>delimiter = ",";<NEW_LINE>}<NEW_LINE>receivedText[i] = buf.toString();<NEW_LINE>}<NEW_LINE>if (testDesc.getExpected().length != received.length) {<NEW_LINE>log.info("expected: " + Arrays.toString<MASK><NEW_LINE>log.info("received: " + Arrays.toString(receivedText));<NEW_LINE>assertEquals(message, testDesc.getExpected().length, received.length);<NEW_LINE>}<NEW_LINE>log.debug("comparing: " + message);<NEW_LINE>EPAssertionUtil.assertEqualsAnyOrder(testDesc.getExpected(), receivedText);<NEW_LINE>}
(testDesc.getExpected()));
1,783,638
public NDArray truncatedNormal(float loc, float scale, Shape shape, DataType dataType) {<NEW_LINE>if (DataType.STRING.equals(dataType)) {<NEW_LINE>throw new IllegalArgumentException("String data type is not supported!");<NEW_LINE>}<NEW_LINE>NDArray axes = create(shape.getShape());<NEW_LINE>TfOpExecutor opBuilder = opExecutor("TruncatedNormal").addInput(axes).addParam("dtype", dataType);<NEW_LINE>Integer seed <MASK><NEW_LINE>if (seed != null) {<NEW_LINE>// seed1 is graph-level seed<NEW_LINE>// set it to default graph seed used by tensorflow<NEW_LINE>// https://github.com/tensorflow/tensorflow/blob/85c8b2a817f95a3e979ecd1ed95bff1dc1335cff/tensorflow/python/framework/random_seed.py#L31<NEW_LINE>opBuilder.addParam("seed", 87654321);<NEW_LINE>opBuilder.addParam("seed2", seed);<NEW_LINE>}<NEW_LINE>try (NDArray array = opBuilder.buildSingletonOrThrow();<NEW_LINE>NDArray temp = array.mul(scale)) {<NEW_LINE>return temp.add(loc);<NEW_LINE>} finally {<NEW_LINE>axes.close();<NEW_LINE>}<NEW_LINE>}
= getEngine().getSeed();
448,854
public static Class<?> type(String fqn, ClassLoader cl, boolean useCallChain) {<NEW_LINE>int dims = 0;<NEW_LINE>int iBracket = fqn.indexOf('[');<NEW_LINE>String componentFqn = fqn;<NEW_LINE>if (iBracket > 0) {<NEW_LINE>dims = (fqn.length() - iBracket) / 2;<NEW_LINE>componentFqn = <MASK><NEW_LINE>}<NEW_LINE>// openPackage( fqn, null );<NEW_LINE>Class<?> cls;<NEW_LINE>try {<NEW_LINE>cls = Class.forName(componentFqn, false, cl);<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();<NEW_LINE>if (cl != contextClassLoader && contextClassLoader != null) {<NEW_LINE>return type(fqn, contextClassLoader, useCallChain);<NEW_LINE>}<NEW_LINE>cls = useCallChain ? findInCallChain(fqn) : null;<NEW_LINE>}<NEW_LINE>if (cls != null && dims > 0) {<NEW_LINE>cls = Array.newInstance(cls, new int[dims]).getClass();<NEW_LINE>}<NEW_LINE>return cls;<NEW_LINE>}
fqn.substring(0, iBracket);
367,078
public void createVmDataCommand(final VirtualRouter router, final UserVm vm, final NicVO nic, final String publicKey, final Commands cmds) {<NEW_LINE>if (vm != null && router != null && nic != null) {<NEW_LINE>final String serviceOffering = _serviceOfferingDao.findByIdIncludingRemoved(vm.getId(), vm.<MASK><NEW_LINE>final String zoneName = _dcDao.findById(router.getDataCenterId()).getName();<NEW_LINE>final IPAddressVO staticNatIp = _ipAddressDao.findByVmIdAndNetworkId(nic.getNetworkId(), vm.getId());<NEW_LINE>Host host = _hostDao.findById(vm.getHostId());<NEW_LINE>String destHostname = VirtualMachineManager.getHypervisorHostname(host != null ? host.getName() : "");<NEW_LINE>cmds.addCommand("vmdata", generateVmDataCommand(router, nic.getIPv4Address(), vm.getUserData(), serviceOffering, zoneName, staticNatIp == null || staticNatIp.getState() != IpAddress.State.Allocated ? null : staticNatIp.getAddress().addr(), vm.getHostName(), vm.getInstanceName(), vm.getId(), vm.getUuid(), publicKey, nic.getNetworkId(), destHostname));<NEW_LINE>}<NEW_LINE>}
getServiceOfferingId()).getDisplayText();
919,564
// snippet-start:[transcribe.java2.bidir_streaming.main]<NEW_LINE>public static void convertAudio(TranscribeStreamingAsyncClient client) throws Exception {<NEW_LINE>try {<NEW_LINE>StartStreamTranscriptionRequest request = StartStreamTranscriptionRequest.builder().mediaEncoding(MediaEncoding.PCM).languageCode(LanguageCode.EN_US).mediaSampleRateHertz(16_000).build();<NEW_LINE><MASK><NEW_LINE>mic.start();<NEW_LINE>AudioStreamPublisher publisher = new AudioStreamPublisher(new AudioInputStream(mic));<NEW_LINE>StartStreamTranscriptionResponseHandler response = StartStreamTranscriptionResponseHandler.builder().subscriber(e -> {<NEW_LINE>TranscriptEvent event = (TranscriptEvent) e;<NEW_LINE>event.transcript().results().forEach(r -> r.alternatives().forEach(a -> System.out.println(a.transcript())));<NEW_LINE>}).build();<NEW_LINE>// Keeps Streaming until you end the Java program<NEW_LINE>client.startStreamTranscription(request, publisher, response);<NEW_LINE>} catch (TranscribeStreamingException e) {<NEW_LINE>System.err.println(e.awsErrorDetails().errorMessage());<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>}
TargetDataLine mic = Microphone.get();
435,411
public org.python.Object __add__(org.python.Object other) {<NEW_LINE>if (other instanceof org.python.types.Int) {<NEW_LINE>long other_val = ((org.python.types.Int) other).value;<NEW_LINE>return new org.python.types.Float(this.value + ((double) other_val));<NEW_LINE>} else if (other instanceof org.python.types.Bool) {<NEW_LINE>if (((org.python.types.Bool) other).value) {<NEW_LINE>return new org.python.types.Float(this.value + 1.0);<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>} else if (other instanceof org.python.types.Float) {<NEW_LINE>double other_val = ((org.python.types.Float) other).value;<NEW_LINE>return new org.python.types.<MASK><NEW_LINE>} else if (other instanceof org.python.types.Complex) {<NEW_LINE>return ((org.python.types.Complex) other).__add__(this);<NEW_LINE>}<NEW_LINE>throw new org.python.exceptions.TypeError("unsupported operand type(s) for +: 'float' and '" + other.typeName() + "'");<NEW_LINE>}
Float(this.value + other_val);
1,083,661
private static boolean isBroadcast(List<TargetDB> targetDBs, String schemaName, ExecutionContext executionContext) {<NEW_LINE>if (targetDBs.size() != 1) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>TargetDB db = targetDBs.get(0);<NEW_LINE>if (db.getTableNames().size() != 1) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String tableName = db.getTableNames().iterator().next();<NEW_LINE>TddlRuleManager or;<NEW_LINE>if (executionContext != null) {<NEW_LINE>or = executionContext.<MASK><NEW_LINE>} else {<NEW_LINE>or = OptimizerContext.getContext(schemaName).getRuleManager();<NEW_LINE>}<NEW_LINE>// use the physical name to get the tableRule, then use tableRule to see whether it's a broadcast table<NEW_LINE>try {<NEW_LINE>String logicalTableName = null;<NEW_LINE>if (!DbInfoManager.getInstance().isNewPartitionDb(schemaName)) {<NEW_LINE>String fullyQualifiedPhysicalTableName = (db.getDbIndex() + "." + tableName).toLowerCase();<NEW_LINE>Set<String> logicalNameSet = or.getLogicalTableNames(fullyQualifiedPhysicalTableName, schemaName);<NEW_LINE>if (CollectionUtils.isEmpty(logicalNameSet)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>logicalTableName = logicalNameSet.iterator().next();<NEW_LINE>} else {<NEW_LINE>logicalTableName = db.getLogTblName();<NEW_LINE>}<NEW_LINE>return or.isBroadCast(logicalTableName);<NEW_LINE>} catch (Exception e) {<NEW_LINE>return or.isBroadCast(tableName);<NEW_LINE>}<NEW_LINE>}
getSchemaManager(schemaName).getTddlRuleManager();
121,780
public void configure(Binder binder) {<NEW_LINE>// Instantiate eagerly so that we get everything registered and put into the Lifecycle as early as possible<NEW_LINE>// Lifecycle scope is INIT to ensure stop runs in the last phase of lifecycle stop.<NEW_LINE>try {<NEW_LINE>ClassLoader loader = Thread<MASK><NEW_LINE>if (loader == null) {<NEW_LINE>loader = getClass().getClassLoader();<NEW_LINE>}<NEW_LINE>// Reflection to try and allow non Log4j2 stuff to run. This acts as a gateway to stop errors in the next few lines<NEW_LINE>// In log4j api<NEW_LINE>Class.forName("org.apache.logging.log4j.LogManager", false, loader);<NEW_LINE>// In log4j core<NEW_LINE>Class.forName("org.apache.logging.log4j.core.util.ShutdownCallbackRegistry", false, loader);<NEW_LINE>final LoggerContextFactory contextFactory = LogManager.getFactory();<NEW_LINE>if (!(contextFactory instanceof Log4jContextFactory)) {<NEW_LINE>log.warn("Expected [%s] found [%s]. Unknown class for context factory. Not logging shutdown", Log4jContextFactory.class.getName(), contextFactory.getClass().getName());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ShutdownCallbackRegistry registry = ((Log4jContextFactory) contextFactory).getShutdownCallbackRegistry();<NEW_LINE>if (!(registry instanceof Log4jShutdown)) {<NEW_LINE>log.warn("Shutdown callback registry expected class [%s] found [%s]. Skipping shutdown registry", Log4jShutdown.class.getName(), registry.getClass().getName());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>binder.bind(Log4jShutdown.class).toInstance((Log4jShutdown) registry);<NEW_LINE>binder.bind(Key.get(Log4jShutterDowner.class, Names.named("ForTheEagerness"))).to(Log4jShutterDowner.class).asEagerSingleton();<NEW_LINE>} catch (ClassNotFoundException | ClassCastException | LinkageError e) {<NEW_LINE>log.warn(e, "Not registering log4j shutdown hooks. Not using log4j?");<NEW_LINE>}<NEW_LINE>}
.currentThread().getContextClassLoader();
270,374
protected SettableBeanProperty _resolveManagedReferenceProperty(DeserializationContext ctxt, SettableBeanProperty prop) throws JsonMappingException {<NEW_LINE>String refName = prop.getManagedReferenceName();<NEW_LINE>if (refName == null) {<NEW_LINE>return prop;<NEW_LINE>}<NEW_LINE>JsonDeserializer<?<MASK><NEW_LINE>SettableBeanProperty backProp = valueDeser.findBackReference(refName);<NEW_LINE>if (backProp == null) {<NEW_LINE>return ctxt.reportBadDefinition(_beanType, String.format("Cannot handle managed/back reference %s: no back reference property found from type %s", ClassUtil.name(refName), ClassUtil.getTypeDescription(prop.getType())));<NEW_LINE>}<NEW_LINE>// also: verify that type is compatible<NEW_LINE>JavaType referredType = _beanType;<NEW_LINE>JavaType backRefType = backProp.getType();<NEW_LINE>boolean isContainer = prop.getType().isContainerType();<NEW_LINE>if (!backRefType.getRawClass().isAssignableFrom(referredType.getRawClass())) {<NEW_LINE>ctxt.reportBadDefinition(_beanType, String.format("Cannot handle managed/back reference %s: back reference type (%s) not compatible with managed type (%s)", ClassUtil.name(refName), ClassUtil.getTypeDescription(backRefType), referredType.getRawClass().getName()));<NEW_LINE>}<NEW_LINE>return new ManagedReferenceProperty(prop, refName, backProp, isContainer);<NEW_LINE>}
> valueDeser = prop.getValueDeserializer();
1,327,564
protected void run(URL url, Map<String, String> headers) {<NEW_LINE>this.listener = new WatcherWebSocketListener<>(this);<NEW_LINE>Builder builder = client.newWebSocketBuilder();<NEW_LINE>headers.forEach(builder::header);<NEW_LINE>builder.uri(URI.create(url.toString()));<NEW_LINE>this.websocketFuture = builder.buildAsync(this.listener).handle((w, t) -> {<NEW_LINE>if (t != null) {<NEW_LINE>if (t instanceof WebSocketHandshakeException) {<NEW_LINE>WebSocketHandshakeException wshe = (WebSocketHandshakeException) t;<NEW_LINE>HttpResponse<?> response = wshe.getResponse();<NEW_LINE>final int code = response.code();<NEW_LINE>// We do not expect a 200 in response to the websocket connection. If it occurs, we throw<NEW_LINE>// an exception and try the watch via a persistent HTTP Get.<NEW_LINE>// Newer Kubernetes might also return 503 Service Unavailable in case WebSockets are not supported<NEW_LINE>Status status = OperationSupport.createStatus(response);<NEW_LINE>if (HTTP_OK == code || HTTP_UNAVAILABLE == code) {<NEW_LINE>throw OperationSupport.requestFailure(client.newHttpRequestBuilder().url(url).build(), status, "Received " + code + " on websocket");<NEW_LINE>}<NEW_LINE>logger.warn("Exec Failure: HTTP {}, Status: {} - {}", code, status.getCode(), status.getMessage());<NEW_LINE>t = OperationSupport.requestFailure(client.newHttpRequestBuilder().url(url<MASK><NEW_LINE>}<NEW_LINE>if (ready) {<NEW_LINE>// if we're not ready yet, that means we're waiting on the future and there's<NEW_LINE>// no need to invoke the reconnect logic<NEW_LINE>listener.onError(w, t);<NEW_LINE>}<NEW_LINE>throw KubernetesClientException.launderThrowable(t);<NEW_LINE>}<NEW_LINE>if (w != null) {<NEW_LINE>this.ready = true;<NEW_LINE>this.websocket = w;<NEW_LINE>}<NEW_LINE>return w;<NEW_LINE>});<NEW_LINE>}
).build(), status);
737,725
private static void concludeHostParams(ExchangeSpecification exchangeSpecification) {<NEW_LINE>if (exchangeSpecification.getExchangeSpecificParameters() != null) {<NEW_LINE>final boolean useSandbox = exchangeSpecification.getExchangeSpecificParametersItem(PARAM_USE_SANDBOX).equals(true);<NEW_LINE>final boolean usePrime = Boolean.TRUE.equals(exchangeSpecification.getExchangeSpecificParametersItem(PARAM_USE_PRIME));<NEW_LINE>if (useSandbox) {<NEW_LINE>if (usePrime) {<NEW_LINE>exchangeSpecification.setSslUri((String) exchangeSpecification.getExchangeSpecificParametersItem(PARAM_SANDBOX_PRIME_SSL_URI));<NEW_LINE>exchangeSpecification.setHost((String) exchangeSpecification.getExchangeSpecificParametersItem(PARAM_SANDBOX_PRIME_HOST));<NEW_LINE>} else {<NEW_LINE>exchangeSpecification.setSslUri((String) exchangeSpecification.getExchangeSpecificParametersItem(PARAM_SANDBOX_SSL_URI));<NEW_LINE>exchangeSpecification.setHost((String) exchangeSpecification.getExchangeSpecificParametersItem(PARAM_SANDBOX_HOST));<NEW_LINE>}<NEW_LINE>} else if (usePrime) {<NEW_LINE>exchangeSpecification.setSslUri((String) exchangeSpecification.getExchangeSpecificParametersItem(PARAM_PRIME_SSL_URI));<NEW_LINE>exchangeSpecification.setHost((String<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
) exchangeSpecification.getExchangeSpecificParametersItem(PARAM_PRIME_HOST));
1,804,702
final ListInferenceRecommendationsJobsResult executeListInferenceRecommendationsJobs(ListInferenceRecommendationsJobsRequest listInferenceRecommendationsJobsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listInferenceRecommendationsJobsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListInferenceRecommendationsJobsRequest> request = null;<NEW_LINE>Response<ListInferenceRecommendationsJobsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListInferenceRecommendationsJobsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listInferenceRecommendationsJobsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListInferenceRecommendationsJobs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListInferenceRecommendationsJobsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListInferenceRecommendationsJobsResultJsonUnmarshaller());<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,091,104
protected final boolean checkBinaryIndexers(@NullAllowed Pair<Long, Map<Pair<String, Integer>, Integer>> lastState, @NonNull Map<BinaryIndexerFactory, Context> contexts) throws IOException {<NEW_LINE>if (lastState == null || lastState.first() == 0L) {<NEW_LINE>// Nothing known about the last state<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (contexts.size() != lastState.second().size()) {<NEW_LINE>// Factories changed<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final Map<Pair<String, Integer>, Integer> copy = new HashMap<>(lastState.second());<NEW_LINE>for (Map.Entry<BinaryIndexerFactory, Context> e : contexts.entrySet()) {<NEW_LINE>final <MASK><NEW_LINE>final Integer state = copy.remove(Pair.<String, Integer>of(bif.getIndexerName(), bif.getIndexVersion()));<NEW_LINE>if (state == null) {<NEW_LINE>// Factories changed<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>ArchiveTimeStamps.setIndexerState(e.getValue(), state);<NEW_LINE>}<NEW_LINE>return copy.isEmpty();<NEW_LINE>}
BinaryIndexerFactory bif = e.getKey();
39,214
private static void runNonCompile(RegressionEnvironment env, SupportEvalBuilder builder) {<NEW_LINE>EventType eventType = env.runtime().getEventTypeService().getEventTypePreconfigured(builder.getEventType());<NEW_LINE>if (eventType == null) {<NEW_LINE>throw new IllegalArgumentException("Cannot find preconfigured event type '" + <MASK><NEW_LINE>}<NEW_LINE>EventType[] typesPerStream = new EventType[] { eventType };<NEW_LINE>String[] typeAliases = new String[] { builder.getStreamAlias() == null ? "somealias" : builder.getStreamAlias() };<NEW_LINE>Map<String, ExprEvaluator> nodes = new HashMap<>();<NEW_LINE>for (Map.Entry<String, String> entry : builder.getExpressions().entrySet()) {<NEW_LINE>if (builder.getExludeNamesExcept() != null && !builder.getExludeNamesExcept().equals(entry.getKey())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ExprNode node = ((EPRuntimeSPI) env.runtime()).getReflectiveCompileSvc().reflectiveCompileExpression(entry.getValue(), typesPerStream, typeAliases);<NEW_LINE>ExprEvaluator eval = node.getForge().getExprEvaluator();<NEW_LINE>nodes.put(entry.getKey(), eval);<NEW_LINE>}<NEW_LINE>int count = -1;<NEW_LINE>for (SupportEvalAssertionPair assertion : builder.getAssertions()) {<NEW_LINE>count++;<NEW_LINE>if (builder.getExludeAssertionsExcept() != null && count != builder.getExludeAssertionsExcept()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>runNonCompileAssertion(count, eventType, nodes, assertion, env, builder);<NEW_LINE>}<NEW_LINE>}
builder.getEventType() + "'");
1,538,725
private void dispatch() throws IOException {<NEW_LINE><MASK><NEW_LINE>MysqlCommand command = MysqlCommand.fromCode(code);<NEW_LINE>if (command == null) {<NEW_LINE>ErrorReport.report(ErrorCode.ERR_UNKNOWN_COM_ERROR);<NEW_LINE>ctx.getState().setError(ErrorCode.ERR_UNKNOWN_COM_ERROR, "Unknown command(" + code + ")");<NEW_LINE>LOG.warn("Unknown command(" + code + ")");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ctx.setCommand(command);<NEW_LINE>ctx.setStartTime();<NEW_LINE>switch(command) {<NEW_LINE>case COM_INIT_DB:<NEW_LINE>handleInitDb();<NEW_LINE>break;<NEW_LINE>case COM_QUIT:<NEW_LINE>handleQuit();<NEW_LINE>break;<NEW_LINE>case COM_QUERY:<NEW_LINE>handleQuery();<NEW_LINE>break;<NEW_LINE>case COM_FIELD_LIST:<NEW_LINE>handleFieldList();<NEW_LINE>break;<NEW_LINE>case COM_PING:<NEW_LINE>handlePing();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>ctx.getState().setError(ErrorCode.ERR_UNKNOWN_COM_ERROR, "Unsupported command(" + command + ")");<NEW_LINE>LOG.warn("Unsupported command(" + command + ")");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
int code = packetBuf.get();
1,239,971
private void decode(SourceData sourceData) {<NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>Result rawResult = null;<NEW_LINE>sourceData.setCropRect(cropRect);<NEW_LINE>LuminanceSource source = createSource(sourceData);<NEW_LINE>if (source != null) {<NEW_LINE>rawResult = decoder.decode(source);<NEW_LINE>}<NEW_LINE>if (rawResult != null) {<NEW_LINE>// Don't log the barcode contents for security.<NEW_LINE>long end = System.currentTimeMillis();<NEW_LINE>Log.d(TAG, "Found barcode in " + (end - start) + " ms");<NEW_LINE>if (resultHandler != null) {<NEW_LINE>BarcodeResult barcodeResult = new BarcodeResult(rawResult, sourceData);<NEW_LINE>Message message = Message.obtain(resultHandler, R.id.zxing_decode_succeeded, barcodeResult);<NEW_LINE>Bundle bundle = new Bundle();<NEW_LINE>message.setData(bundle);<NEW_LINE>message.sendToTarget();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (resultHandler != null) {<NEW_LINE>Message message = Message.obtain(resultHandler, R.id.zxing_decode_failed);<NEW_LINE>message.sendToTarget();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (resultHandler != null) {<NEW_LINE>List<ResultPoint> resultPoints = BarcodeResult.transformResultPoints(decoder.getPossibleResultPoints(), sourceData);<NEW_LINE>Message message = Message.obtain(resultHandler, <MASK><NEW_LINE>message.sendToTarget();<NEW_LINE>}<NEW_LINE>requestNextPreview();<NEW_LINE>}
R.id.zxing_possible_result_points, resultPoints);
1,403,147
protected void testQueryVertex(GraphManager graph, int threads, int thread, int multiple) {<NEW_LINE>int total = threads * multiple * 100;<NEW_LINE>for (int i = 1; i <= total; i *= 10) {<NEW_LINE>LOG.info(">>>> limit {} <<<<", i);<NEW_LINE>long current = System.currentTimeMillis();<NEW_LINE>List<Vertex> persons = graph.traversal().V().hasLabel("person").limit(i).toList();<NEW_LINE>assert persons.size() == i;<NEW_LINE>LOG.info(">>>> query by label index, cost: {}ms", elapsed(current));<NEW_LINE>current = System.currentTimeMillis();<NEW_LINE>persons = graph.traversal().V().has("city", "Hongkong").limit(i).toList();<NEW_LINE>assert persons.size() == i;<NEW_LINE>LOG.info(">>>> query by secondary index, cost: {}ms", elapsed(current));<NEW_LINE>current = System.currentTimeMillis();<NEW_LINE>persons = graph.traversal().V().has("age", 3).limit(i).toList();<NEW_LINE><MASK><NEW_LINE>LOG.info(">>>> query by range index, cost: {}ms", elapsed(current));<NEW_LINE>}<NEW_LINE>}
assert persons.size() == i;
1,041,239
private static CompoundTag createEndEntry() {<NEW_LINE>CompoundTag tag = new CompoundTag();<NEW_LINE>tag.put("piglin_safe", new ByteTag((byte) 0));<NEW_LINE>tag.put("natural", new ByteTag((byte) 0));<NEW_LINE>tag.put("ambient_light", new FloatTag(0));<NEW_LINE>tag.put("infiniburn", new StringTag("minecraft:infiniburn_end"));<NEW_LINE>tag.put("respawn_anchor_works", new ByteTag((byte) 0));<NEW_LINE>tag.put("has_skylight", new <MASK><NEW_LINE>tag.put("bed_works", new ByteTag((byte) 0));<NEW_LINE>tag.put("fixed_time", new LongTag(6000));<NEW_LINE>tag.put("has_raids", new ByteTag((byte) 1));<NEW_LINE>tag.put("name", new StringTag("minecraft:the_end"));<NEW_LINE>tag.put("logical_height", new IntTag(256));<NEW_LINE>tag.put("shrunk", new ByteTag((byte) 0));<NEW_LINE>tag.put("ultrawarm", new ByteTag((byte) 0));<NEW_LINE>tag.put("has_ceiling", new ByteTag((byte) 0));<NEW_LINE>return tag;<NEW_LINE>}
ByteTag((byte) 0));
346,085
private List<Mismatch> checkMatch(ClassRef reference, TypePool typePool, ClassLoader loader) {<NEW_LINE>try {<NEW_LINE>if (helperClassPredicate.isHelperClass(reference.getClassName())) {<NEW_LINE>// make sure helper class is registered<NEW_LINE>if (!helperClassNames.contains(reference.getClassName())) {<NEW_LINE>return singletonList(new Mismatch.MissingClass(reference));<NEW_LINE>}<NEW_LINE>// helper classes get their own check: whether they implement all abstract methods<NEW_LINE>return checkHelperClassMatch(reference, typePool);<NEW_LINE>} else {<NEW_LINE>TypePool.Resolution resolution = typePool.describe(reference.getClassName());<NEW_LINE>if (!resolution.isResolved()) {<NEW_LINE>return singletonList(new Mismatch.MissingClass(reference));<NEW_LINE>}<NEW_LINE>return checkThirdPartyTypeMatch(reference, resolution.resolve());<NEW_LINE>}<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>if (e.getMessage().startsWith("Cannot resolve type description for ")) {<NEW_LINE>// bytebuddy throws an illegal state exception with this message if it cannot resolve types<NEW_LINE>// TODO: handle missing type resolutions without catching bytebuddy's exceptions<NEW_LINE>String className = e.getMessage().replace("Cannot resolve type description for ", "");<NEW_LINE>return singletonList(new Mismatch<MASK><NEW_LINE>} else {<NEW_LINE>// Shouldn't happen. Fail the reference check and add a mismatch for debug logging.<NEW_LINE>return singletonList(new Mismatch.ReferenceCheckError(e, reference, loader));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.MissingClass(reference, className));
1,483,232
private static List<Converter> prepareConverters() {<NEW_LINE>List<Converter> converters = new ArrayList<>();<NEW_LINE>// Boolean converter.<NEW_LINE>converters.add(BooleanConverter.INSTANCE);<NEW_LINE>// Converters for exact numeric types.<NEW_LINE>converters.add(ByteConverter.INSTANCE);<NEW_LINE>converters.add(ShortConverter.INSTANCE);<NEW_LINE>converters.add(IntegerConverter.INSTANCE);<NEW_LINE>converters.add(LongConverter.INSTANCE);<NEW_LINE>converters.add(BigIntegerConverter.INSTANCE);<NEW_LINE>converters.add(BigDecimalConverter.INSTANCE);<NEW_LINE>// Converters for inexact numeric types.<NEW_LINE>converters.add(FloatConverter.INSTANCE);<NEW_LINE>converters.add(DoubleConverter.INSTANCE);<NEW_LINE>// String converters.<NEW_LINE>converters.add(CharacterConverter.INSTANCE);<NEW_LINE>converters.add(StringConverter.INSTANCE);<NEW_LINE>// Converters for temporal data types.<NEW_LINE>converters.add(DateConverter.INSTANCE);<NEW_LINE>converters.add(CalendarConverter.INSTANCE);<NEW_LINE>converters.add(LocalDateConverter.INSTANCE);<NEW_LINE>converters.add(LocalTimeConverter.INSTANCE);<NEW_LINE>converters.add(LocalDateTimeConverter.INSTANCE);<NEW_LINE>converters.add(InstantConverter.INSTANCE);<NEW_LINE>converters.add(OffsetDateTimeConverter.INSTANCE);<NEW_LINE>converters.add(ZonedDateTimeConverter.INSTANCE);<NEW_LINE>// Object converter.<NEW_LINE>converters.add(ObjectConverter.INSTANCE);<NEW_LINE>// Interval converters.<NEW_LINE><MASK><NEW_LINE>converters.add(IntervalConverter.DAY_SECOND);<NEW_LINE>// MAP converter.<NEW_LINE>converters.add(MapConverter.INSTANCE);<NEW_LINE>// NULL converter.<NEW_LINE>converters.add(NullConverter.INSTANCE);<NEW_LINE>// JSON converter<NEW_LINE>converters.add(JsonConverter.INSTANCE);<NEW_LINE>return converters;<NEW_LINE>}
converters.add(IntervalConverter.YEAR_MONTH);
716,825
// Computes LP smoothed spectrum from LP coefficients<NEW_LINE>public static double[] calcSpecLinear(double[] alpha, double sqrtGain, int fftSize, ComplexArray expTerm) {<NEW_LINE>int p = alpha.length;<NEW_LINE>int maxFreq = SignalProcUtils.halfSpectrumSize(fftSize);<NEW_LINE>double[] vtSpectrum = new double[maxFreq];<NEW_LINE>if (expTerm == null || expTerm.real == null || expTerm.real.length != p * maxFreq)<NEW_LINE><MASK><NEW_LINE>int w, i, fInd;<NEW_LINE>ComplexArray tmp = new ComplexArray(1);<NEW_LINE>for (w = 0; w <= maxFreq - 1; w++) {<NEW_LINE>tmp.real[0] = 1.0;<NEW_LINE>tmp.imag[0] = 0.0;<NEW_LINE>for (i = 0; i <= p - 1; i++) {<NEW_LINE>fInd = i * maxFreq + w;<NEW_LINE>tmp.real[0] -= alpha[i] * expTerm.real[fInd];<NEW_LINE>tmp.imag[0] -= alpha[i] * expTerm.imag[fInd];<NEW_LINE>}<NEW_LINE>vtSpectrum[w] = sqrtGain / Math.sqrt(tmp.real[0] * tmp.real[0] + tmp.imag[0] * tmp.imag[0]);<NEW_LINE>}<NEW_LINE>return vtSpectrum;<NEW_LINE>}
expTerm = calcExpTerm(fftSize, p);
173,831
private void deleteFile(File fileToDelete) {<NEW_LINE>verifyStoragePermissions();<NEW_LINE>// removeThumbnails(RhodesActivity.getContext().getContentResolver(), null);<NEW_LINE>final String strFileToDelete = fileToDelete.toString();<NEW_LINE>new Timer().schedule(new TimerTask() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>MediaScannerConnection.scanFile(RhodesActivity.getContext(), new String[] { strFileToDelete }, null, new MediaScannerConnection.OnScanCompletedListener() {<NEW_LINE><NEW_LINE>public void onScanCompleted(String path, Uri uri) {<NEW_LINE>Logger.T(TAG, "TimerTask: 5000 - ExternalStorage Scanned " + path + ":");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}, 5000);<NEW_LINE>try {<NEW_LINE>if (fileToDelete.exists()) {<NEW_LINE>fileToDelete.delete();<NEW_LINE>if (fileToDelete.exists()) {<NEW_LINE>Logger.T(TAG, "fileToDelete.delete() failed.");<NEW_LINE>fileToDelete.getCanonicalFile().delete();<NEW_LINE>if (fileToDelete.exists()) {<NEW_LINE>Logger.T(TAG, "fileToDelete.getCanonicalFile().delete(); failed.");<NEW_LINE>RhodesActivity.getContext().deleteFile(fileToDelete.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>RhodesActivity.getContext().sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.fromFile(fileToDelete)));<NEW_LINE>if (!fileToDelete.exists()) {<NEW_LINE>Logger.T(TAG, <MASK><NEW_LINE>MediaScannerConnection.scanFile(RhodesActivity.getContext(), new String[] { strFileToDelete }, null, new MediaScannerConnection.OnScanCompletedListener() {<NEW_LINE><NEW_LINE>public void onScanCompleted(String path, Uri uri) {<NEW_LINE>Logger.T(TAG, "ExternalStorage Scanned " + path + ":");<NEW_LINE>Logger.T(TAG, "ExternalStorage -> uri = " + uri);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>Logger.T(TAG, "All delete operations is failed.");<NEW_LINE>}<NEW_LINE>Logger.T(TAG, "deleteFile() function end");<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
fileToDelete.getName() + " is deleted.");
530,541
// query.from() is non-inclusive<NEW_LINE>OverallSummaryCollector readOverallSummary(String agentRollupId, SummaryQuery query, boolean autoRefresh) throws Exception {<NEW_LINE>OverallSummaryCollector collector = new OverallSummaryCollector();<NEW_LINE>long revisedFrom = query.from();<NEW_LINE>long revisedTo;<NEW_LINE>if (autoRefresh) {<NEW_LINE>revisedTo = query.to();<NEW_LINE>} else {<NEW_LINE>revisedTo = liveAggregateRepository.mergeInOverallSummary(agentRollupId, query, collector);<NEW_LINE>}<NEW_LINE>for (int rollupLevel = query.rollupLevel(); rollupLevel >= 0; rollupLevel--) {<NEW_LINE>SummaryQuery revisedQuery = ImmutableSummaryQuery.builder().copyFrom(query).from(revisedFrom).to(revisedTo).rollupLevel(rollupLevel).build();<NEW_LINE>aggregateRepository.mergeOverallSummaryInto(agentRollupId, revisedQuery, collector);<NEW_LINE><MASK><NEW_LINE>revisedFrom = Math.max(revisedFrom, lastRolledUpTime + 1);<NEW_LINE>if (revisedFrom > revisedTo) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return collector;<NEW_LINE>}
long lastRolledUpTime = collector.getLastCaptureTime();
1,675,838
public static DescribeEtlJobLogsResponse unmarshall(DescribeEtlJobLogsResponse describeEtlJobLogsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeEtlJobLogsResponse.setRequestId(_ctx.stringValue("DescribeEtlJobLogsResponse.RequestId"));<NEW_LINE>describeEtlJobLogsResponse.setHttpStatusCode(_ctx.integerValue("DescribeEtlJobLogsResponse.HttpStatusCode"));<NEW_LINE>describeEtlJobLogsResponse.setErrCode(_ctx.stringValue("DescribeEtlJobLogsResponse.ErrCode"));<NEW_LINE>describeEtlJobLogsResponse.setSuccess(_ctx.booleanValue("DescribeEtlJobLogsResponse.Success"));<NEW_LINE>describeEtlJobLogsResponse.setErrMessage<MASK><NEW_LINE>describeEtlJobLogsResponse.setDynamicMessage(_ctx.stringValue("DescribeEtlJobLogsResponse.DynamicMessage"));<NEW_LINE>describeEtlJobLogsResponse.setDynamicCode(_ctx.stringValue("DescribeEtlJobLogsResponse.DynamicCode"));<NEW_LINE>List<EtlRunningLog> etlRunningLogs = new ArrayList<EtlRunningLog>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeEtlJobLogsResponse.EtlRunningLogs.Length"); i++) {<NEW_LINE>EtlRunningLog etlRunningLog = new EtlRunningLog();<NEW_LINE>etlRunningLog.setEtlId(_ctx.stringValue("DescribeEtlJobLogsResponse.EtlRunningLogs[" + i + "].EtlId"));<NEW_LINE>etlRunningLog.setUserId(_ctx.stringValue("DescribeEtlJobLogsResponse.EtlRunningLogs[" + i + "].UserId"));<NEW_LINE>etlRunningLog.setContentKey(_ctx.stringValue("DescribeEtlJobLogsResponse.EtlRunningLogs[" + i + "].ContentKey"));<NEW_LINE>etlRunningLog.setContent(_ctx.stringValue("DescribeEtlJobLogsResponse.EtlRunningLogs[" + i + "].Content"));<NEW_LINE>etlRunningLog.setStatus(_ctx.stringValue("DescribeEtlJobLogsResponse.EtlRunningLogs[" + i + "].Status"));<NEW_LINE>etlRunningLog.setLogDatetime(_ctx.stringValue("DescribeEtlJobLogsResponse.EtlRunningLogs[" + i + "].LogDatetime"));<NEW_LINE>etlRunningLogs.add(etlRunningLog);<NEW_LINE>}<NEW_LINE>describeEtlJobLogsResponse.setEtlRunningLogs(etlRunningLogs);<NEW_LINE>return describeEtlJobLogsResponse;<NEW_LINE>}
(_ctx.stringValue("DescribeEtlJobLogsResponse.ErrMessage"));
1,172,020
public void addPackage(PackageInfo packageInfo, PackageStats packageStats) {<NEW_LINE>synchronized (lock) {<NEW_LINE>if (packageInfo.applicationInfo != null && (packageInfo.applicationInfo.flags & ApplicationInfo.FLAG_INSTALLED) == 0) {<NEW_LINE>Log.w(TAG, "Adding not installed package: " + packageInfo.packageName);<NEW_LINE>}<NEW_LINE>Preconditions.checkArgument(packageInfo.packageName.equals(packageStats.packageName));<NEW_LINE>packageInfos.put(packageInfo.packageName, packageInfo);<NEW_LINE>packageStatsMap.put(packageInfo.packageName, packageStats);<NEW_LINE>packageSettings.put(packageInfo.packageName, new PackageSetting());<NEW_LINE>applicationEnabledSettingMap.put(<MASK><NEW_LINE>if (packageInfo.applicationInfo != null) {<NEW_LINE>uidForPackage.put(packageInfo.packageName, packageInfo.applicationInfo.uid);<NEW_LINE>namesForUid.put(packageInfo.applicationInfo.uid, packageInfo.packageName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
packageInfo.packageName, PackageManager.COMPONENT_ENABLED_STATE_DEFAULT);
1,605,216
public IRubyObject invoke(ThreadContext context, IRubyObject[] args) {<NEW_LINE>checkArity(context, args.length - 1);<NEW_LINE>final IRubyObject invokee = args[0];<NEW_LINE>final Object[] arguments = convertArguments(args, 1);<NEW_LINE>if (invokee.isNil()) {<NEW_LINE>return invokeWithExceptionHandling(context, method, null, arguments);<NEW_LINE>}<NEW_LINE>final Object javaInvokee;<NEW_LINE>if (!isStatic()) {<NEW_LINE>javaInvokee = JavaUtil.unwrapJavaValue(invokee);<NEW_LINE>if (javaInvokee == null) {<NEW_LINE>throw context.runtime.newTypeError("invokee not a java object");<NEW_LINE>}<NEW_LINE>if (!method.getDeclaringClass().isInstance(javaInvokee)) {<NEW_LINE>throw context.runtime.newTypeError("invokee not instance of method's class" + " (got" + javaInvokee.getClass().getName() + " wanted " + method.getDeclaringClass(<MASK><NEW_LINE>}<NEW_LINE>//<NEW_LINE>// this test really means, that this is a ruby-defined subclass of a java class<NEW_LINE>//<NEW_LINE>if (// don't bother to check if final method, it won't<NEW_LINE>javaInvokee instanceof ReifiedJavaProxy && // be there (not generated, can't be!)<NEW_LINE>!isFinal) {<NEW_LINE>JavaProxyClass jpc = ((ReifiedJavaProxy) javaInvokee).___jruby$proxyClass();<NEW_LINE>JavaProxyMethod jpm = jpc.getMethod(method.getName(), parameterTypes);<NEW_LINE>if (jpm != null && jpm.hasSuperImplementation()) {<NEW_LINE>return invokeWithExceptionHandling(context, jpm.getSuperMethod(), javaInvokee, arguments);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>javaInvokee = null;<NEW_LINE>}<NEW_LINE>return invokeWithExceptionHandling(context, method, javaInvokee, arguments);<NEW_LINE>}
).getName() + ")");
290,928
private void addMember(SrcLinkedClass srcClass, NamedNode member, Type type, String name, Predicate<String> duplicateChecker) {<NEW_LINE>SrcType getterType = makeSrcType(srcClass, type, false);<NEW_LINE>SrcType setterType = makeSrcType(srcClass, type, false, true);<NEW_LINE>String propName = makeIdentifier(name, true);<NEW_LINE>if (!propName.equals(name) && duplicateChecker.test(propName)) {<NEW_LINE>// There are two fields that differ in name only by the case of the first character "Foo" v. "foo".<NEW_LINE>// Since the get/set methods capitalize the name, we must differentiate the method names<NEW_LINE>// e.g., getFoo() and get_foo()<NEW_LINE>propName = '_' + makeIdentifier(name, false);<NEW_LINE>}<NEW_LINE>// //noinspection unused<NEW_LINE>// StringBuilder propertyType = getterType.render( new StringBuilder(), 0, false );<NEW_LINE>// //noinspection unused<NEW_LINE>// StringBuilder componentType = getComponentType( getterType ).render( new StringBuilder(), 0, false );<NEW_LINE>SrcGetProperty getter = new SrcGetProperty(propName, getterType);<NEW_LINE>addActualNameAnnotation(getter, name, true);<NEW_LINE>if (member != null) {<NEW_LINE>addSourcePositionAnnotation(<MASK><NEW_LINE>}<NEW_LINE>srcClass.addGetProperty(getter).modifiers(Modifier.PUBLIC);<NEW_LINE>SrcSetProperty setter = new SrcSetProperty(propName, setterType);<NEW_LINE>addActualNameAnnotation(setter, name, true);<NEW_LINE>if (member != null) {<NEW_LINE>addSourcePositionAnnotation(srcClass, member, name, setter);<NEW_LINE>}<NEW_LINE>srcClass.addSetProperty(setter).modifiers(Modifier.PUBLIC);<NEW_LINE>}
srcClass, member, name, getter);
1,202,158
public void load(Map<CharSequence, Object> attrs) {<NEW_LINE>Long creationTime = (<MASK><NEW_LINE>if (creationTime != null) {<NEW_LINE>this.creationTime = Instant.ofEpochMilli(creationTime);<NEW_LINE>}<NEW_LINE>Long lastAccessedTime = (Long) attrs.remove(LAST_ACCESSED_TIME_ATTR);<NEW_LINE>if (lastAccessedTime != null) {<NEW_LINE>super.setLastAccessedTime(Instant.ofEpochMilli(lastAccessedTime));<NEW_LINE>}<NEW_LINE>Long maxInactiveInterval = (Long) attrs.remove(MAX_INACTIVE_INTERVAL_ATTR);<NEW_LINE>if (maxInactiveInterval != null) {<NEW_LINE>super.setMaxInactiveInterval(Duration.ofMillis(maxInactiveInterval));<NEW_LINE>}<NEW_LINE>setNew(false);<NEW_LINE>for (Map.Entry<CharSequence, Object> entry : attrs.entrySet()) {<NEW_LINE>attributeMap.put(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>}
Long) attrs.remove(CREATION_TIME_ATTR);
911,925
public Bundle installBundle(String url, InputStream in) throws BundleException {<NEW_LINE>final String pref = "reference:";<NEW_LINE>if (url.startsWith(pref)) {<NEW_LINE>// workaround for problems with space in path<NEW_LINE>url = <MASK><NEW_LINE>String filePart = url.substring(pref.length());<NEW_LINE>if (installArea != null && filePart.startsWith(installArea)) {<NEW_LINE>String relPath = filePart.substring(installArea.length());<NEW_LINE>if (relPath.startsWith("/")) {<NEW_LINE>// NOI18N<NEW_LINE>relPath = relPath.substring(1);<NEW_LINE>}<NEW_LINE>url = pref + "file:" + relPath;<NEW_LINE>NetbinoxFactory.LOG.log(Level.FINE, "Converted to relative {0}", url);<NEW_LINE>} else {<NEW_LINE>NetbinoxFactory.LOG.log(Level.FINE, "Kept absolute {0}", url);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return delegate.installBundle(url, in);<NEW_LINE>}
url.replace("%20", " ");
100,963
public final void run() {<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("Starting the AcquireTimeoutTask to clean for endpoint [{}].", this.pool.remoteAddress());<NEW_LINE>}<NEW_LINE>long currentNanoTime = System.nanoTime();<NEW_LINE>while (true) {<NEW_LINE>AcquireListener removedTask = this<MASK><NEW_LINE>if (removedTask == null) {<NEW_LINE>// queue is empty<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>long expiryTime = removedTask.getAcquisitionTimeoutInNanos();<NEW_LINE>// Compare nanoTime as described in the System.nanoTime documentation<NEW_LINE>// See:<NEW_LINE>// * https://docs.oracle.com/javase/7/docs/api/java/lang/System.html#nanoTime()<NEW_LINE>// * https://github.com/netty/netty/issues/3705<NEW_LINE>if (expiryTime - currentNanoTime <= 0) {<NEW_LINE>this.onTimeout(removedTask);<NEW_LINE>} else {<NEW_LINE>if (!this.pool.pendingAcquisitions.offer(removedTask)) {<NEW_LINE>logger.error("Unexpected failure when returning the removed task" + " to pending acquisition queue. current size [{}]", this.pool.pendingAcquisitions.size());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.pool.pendingAcquisitions.poll();
794,758
public void onPermissionGranted() {<NEW_LINE>drawer.refreshDrawer();<NEW_LINE>TabFragment tabFragment = getTabFragment();<NEW_LINE>boolean b = getBoolean(PREFERENCE_NEED_TO_SET_HOME);<NEW_LINE>// reset home and current paths according to new storages<NEW_LINE>if (b) {<NEW_LINE>TabHandler tabHandler = TabHandler.getInstance();<NEW_LINE>tabHandler.clear().subscribe(() -> {<NEW_LINE>if (tabFragment != null) {<NEW_LINE>tabFragment.refactorDrawerStorages(false);<NEW_LINE>Fragment main = tabFragment.getFragmentAtIndex(0);<NEW_LINE>if (main != null)<NEW_LINE>((MainFragment) main).updateTabWithDb(tabHandler.findTab(1));<NEW_LINE>Fragment main1 = tabFragment.getFragmentAtIndex(1);<NEW_LINE>if (main1 != null)<NEW_LINE>((MainFragment) main1).updateTabWithDb(tabHandler.findTab(2));<NEW_LINE>}<NEW_LINE>getPrefs().edit().putBoolean(PREFERENCE_NEED_TO_SET_HOME, false).commit();<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>// just refresh list<NEW_LINE>if (tabFragment != null) {<NEW_LINE>Fragment main = tabFragment.getFragmentAtIndex(0);<NEW_LINE>if (main != null)<NEW_LINE>((<MASK><NEW_LINE>Fragment main1 = tabFragment.getFragmentAtIndex(1);<NEW_LINE>if (main1 != null)<NEW_LINE>((MainFragment) main1).updateList();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
MainFragment) main).updateList();
1,514,786
private static Optional<I_M_ProductPrice> retrieveProductPriceAttributeIfValid(final IPricingContext pricingCtx, final int productPriceId) {<NEW_LINE>if (productPriceId <= 0) {<NEW_LINE>logger.debug("Returning null because M_ProductPrice_ID is not set: {}", pricingCtx);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>final I_M_ProductPrice productPrice = InterfaceWrapperHelper.create(pricingCtx.getCtx(), productPriceId, I_M_ProductPrice.class, pricingCtx.getTrxName());<NEW_LINE>if (productPrice == null || productPrice.getM_ProductPrice_ID() <= 0) {<NEW_LINE><MASK><NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>// Make sure the product price attribute is still active.<NEW_LINE>if (!productPrice.isActive()) {<NEW_LINE>logger.debug("Returning null because M_ProductPrice_ID={} is not active", productPriceId);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>// Make sure if the product price matches our pricing context<NEW_LINE>if (productPrice.getM_Product_ID() != ProductId.toRepoId(pricingCtx.getProductId())) {<NEW_LINE>logger.debug("Returning null because M_ProductPrice.M_Product_ID is not matching pricing context product: {}", productPrice);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>logger.debug("M_ProductPrice_ID={} is valid", productPriceId);<NEW_LINE>return Optional.of(productPrice);<NEW_LINE>}
logger.debug("Returning null because M_ProductPrice_ID={} was not found", productPriceId);
697,791
public void onDeleteAsUserAction(final I_M_PickingSlot_HU pickingSlotHU) {<NEW_LINE>final boolean isUserAction = InterfaceWrapperHelper.isUIAction(pickingSlotHU);<NEW_LINE>final IHUPickingSlotBL pickingSlotBL = <MASK><NEW_LINE>final I_M_PickingSlot pickingSlot = InterfaceWrapperHelper.load(pickingSlotHU.getM_PickingSlot_ID(), I_M_PickingSlot.class);<NEW_LINE>final I_M_HU hu = pickingSlotHU.getM_HU();<NEW_LINE>if (isUserAction) {<NEW_LINE>final IHUPickingSlotBL.IQueueActionResult result = pickingSlotBL.removeFromPickingSlotQueue(pickingSlot, hu);<NEW_LINE>final I_M_PickingSlot_Trx pickingSlotTrx = result.getM_PickingSlot_Trx();<NEW_LINE>Check.assumeNotNull(pickingSlotTrx, "The result of addToPickingSlotQueue contains a M_PickingSlot_Trx for {} and {} ", pickingSlot, hu);<NEW_LINE>pickingSlotTrx.setIsUserAction(true);<NEW_LINE>InterfaceWrapperHelper.save(pickingSlotTrx);<NEW_LINE>}<NEW_LINE>}
Services.get(IHUPickingSlotBL.class);
1,439,476
protected EntityTypesMap retrieveEntityTypesMap() {<NEW_LINE>final List<EntityTypeEntry> entries = new ArrayList<>(50);<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>final String sql = "SELECT * FROM AD_EntityType WHERE IsActive=? ORDER BY AD_EntityType_ID";<NEW_LINE>final Object[] sqlParams = new Object[] { true };<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, ITrx.TRXNAME_None);<NEW_LINE>DB.setParameters(pstmt, sqlParams);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>final EntityTypeEntry entry = loadEntityTypeEntry(rs);<NEW_LINE>entries.add(entry);<NEW_LINE>}<NEW_LINE>return EntityTypesMap.of(entries);<NEW_LINE>} catch (final SQLException e) {<NEW_LINE>throw new <MASK><NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>rs = null;<NEW_LINE>pstmt = null;<NEW_LINE>}<NEW_LINE>}
DBException(e, sql, sqlParams);
715,039
protected void onResumeFragments() {<NEW_LINE>super.onResumeFragments();<NEW_LINE>if (BuildConfig.LOG_DEBUG)<NEW_LINE>LogUtils.d(TAG);<NEW_LINE>if (runnableOnResumeFragments != null) {<NEW_LINE>runnableOnResumeFragments.run();<NEW_LINE>runnableOnResumeFragments = null;<NEW_LINE>}<NEW_LINE>LocalBroadcastManager bm = LocalBroadcastManager.getInstance(this);<NEW_LINE>bm.registerReceiver(receiver, new IntentFilter(AppIntent.ACTION_OPEN_NOTE));<NEW_LINE>bm.registerReceiver(receiver, <MASK><NEW_LINE>bm.registerReceiver(receiver, new IntentFilter(AppIntent.ACTION_FOLLOW_LINK_TO_FILE));<NEW_LINE>bm.registerReceiver(receiver, new IntentFilter(AppIntent.ACTION_OPEN_SAVED_SEARCHES));<NEW_LINE>bm.registerReceiver(receiver, new IntentFilter(AppIntent.ACTION_OPEN_QUERY));<NEW_LINE>bm.registerReceiver(receiver, new IntentFilter(AppIntent.ACTION_OPEN_BOOKS));<NEW_LINE>bm.registerReceiver(receiver, new IntentFilter(AppIntent.ACTION_OPEN_BOOK));<NEW_LINE>bm.registerReceiver(receiver, new IntentFilter(AppIntent.ACTION_OPEN_SETTINGS));<NEW_LINE>}
new IntentFilter(AppIntent.ACTION_FOLLOW_LINK_TO_NOTE_WITH_PROPERTY));
570,768
public static Query<Collection<ActivityIndex>> activityIndexForNewPlayers(long after, long before, ServerUUID serverUUID, Long threshold) {<NEW_LINE>String selectNewUUIDs = SELECT + UserInfoTable.USER_UUID + FROM + UserInfoTable.TABLE_NAME + WHERE + UserInfoTable.REGISTERED + "<=?" + AND + UserInfoTable.REGISTERED + ">=?" <MASK><NEW_LINE>String sql = SELECT + "activity_index" + FROM + '(' + selectNewUUIDs + ") n" + INNER_JOIN + '(' + selectActivityIndexSQL() + ") a on n." + SessionsTable.USER_UUID + "=a." + SessionsTable.USER_UUID;<NEW_LINE>return new QueryStatement<Collection<ActivityIndex>>(sql) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void prepare(PreparedStatement statement) throws SQLException {<NEW_LINE>statement.setLong(1, before);<NEW_LINE>statement.setLong(2, after);<NEW_LINE>statement.setString(3, serverUUID.toString());<NEW_LINE>setSelectActivityIndexSQLParameters(statement, 4, threshold, serverUUID, before);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Collection<ActivityIndex> processResults(ResultSet set) throws SQLException {<NEW_LINE>Collection<ActivityIndex> indexes = new ArrayList<>();<NEW_LINE>while (set.next()) {<NEW_LINE>indexes.add(new ActivityIndex(set.getDouble("activity_index"), before));<NEW_LINE>}<NEW_LINE>return indexes;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
+ AND + UserInfoTable.SERVER_UUID + "=?";
808,042
private void transformTimerEventDefinition(final ExpressionLanguage expressionLanguage, final ExecutableCatchEventElement executableElement, final TimerEventDefinition timerEventDefinition) {<NEW_LINE>final Expression expression;<NEW_LINE>if (timerEventDefinition.getTimeDuration() != null) {<NEW_LINE>final String duration = timerEventDefinition.getTimeDuration().getTextContent();<NEW_LINE>expression = expressionLanguage.parseExpression(duration);<NEW_LINE>executableElement.setTimerFactory((expressionProcessor, scopeKey) -> expressionProcessor.evaluateIntervalExpression(expression, scopeKey).map(interval -> new RepeatingInterval(1, interval)));<NEW_LINE>} else if (timerEventDefinition.getTimeCycle() != null) {<NEW_LINE>final String cycle = timerEventDefinition.getTimeCycle().getTextContent();<NEW_LINE>expression = expressionLanguage.parseExpression(cycle);<NEW_LINE>executableElement.setTimerFactory((expressionProcessor, scopeKey) -> {<NEW_LINE>try {<NEW_LINE>return expressionProcessor.evaluateStringExpression(expression, scopeKey<MASK><NEW_LINE>} catch (final DateTimeParseException e) {<NEW_LINE>// todo(#4323): replace this caught exception with Either<NEW_LINE>return Either.left(new Failure(e.getMessage(), ErrorType.EXTRACT_VALUE_ERROR, scopeKey));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else if (timerEventDefinition.getTimeDate() != null) {<NEW_LINE>final String timeDate = timerEventDefinition.getTimeDate().getTextContent();<NEW_LINE>expression = expressionLanguage.parseExpression(timeDate);<NEW_LINE>executableElement.setTimerFactory((expressionProcessor, scopeKey) -> expressionProcessor.evaluateDateTimeExpression(expression, scopeKey).map(TimeDateTimer::new));<NEW_LINE>}<NEW_LINE>}
).map(RepeatingInterval::parse);
1,710,283
void doGeneric(JSDynamicObject target, Object key, Object value, Object receiver, @Cached("create()") ToArrayIndexNode toArrayIndexNode, @Cached("createBinaryProfile()") ConditionProfile getType, @Cached("create()") JSClassProfile jsclassProfile, @Cached("createBinaryProfile()") ConditionProfile highFrequency, @Cached("createFrequencyBasedPropertySet(context, setOwn, strict, superProperty)") FrequencyBasedPropertySetNode hotKey, @Cached TruffleString.EqualNode equalsNode) {<NEW_LINE>Object <MASK><NEW_LINE>if (getType.profile(arrayIndex instanceof Long)) {<NEW_LINE>long index = (long) arrayIndex;<NEW_LINE>doArrayIndexLong(target, index, value, receiver, jsclassProfile.getJSClass(target));<NEW_LINE>} else {<NEW_LINE>assert JSRuntime.isPropertyKey(arrayIndex);<NEW_LINE>if (highFrequency.profile(hotKey.executeFastSet(target, arrayIndex, value, receiver, equalsNode))) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (setOwn) {<NEW_LINE>createDataPropertyOrThrow(target, arrayIndex, value);<NEW_LINE>} else {<NEW_LINE>JSObject.setWithReceiver(target, arrayIndex, value, receiver, strict, jsclassProfile, this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
arrayIndex = toArrayIndexNode.execute(key);
975,837
public void visit(RelNode node, int ordinal, RelNode parent) {<NEW_LINE>if (node instanceof LogicalProject) {<NEW_LINE>for (RexNode rexNode : ((LogicalProject) node).getProjects()) {<NEW_LINE>rexNode.accept(accessFiledFinder);<NEW_LINE>RexUtil.DynamicDeepFinder dynamicDeepFinder = new RexUtil.DynamicDeepFinder(Lists.newLinkedList());<NEW_LINE>rexNode.accept(dynamicDeepFinder);<NEW_LINE>for (RexDynamicParam rexDynamicParam : dynamicDeepFinder.getScalar()) {<NEW_LINE>if (rexDynamicParam.getRel() != null) {<NEW_LINE>this.go(rexDynamicParam.getRel());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (node instanceof LogicalFilter) {<NEW_LINE>((LogicalFilter) node).getCondition().accept(accessFiledFinder);<NEW_LINE>RexUtil.DynamicDeepFinder dynamicDeepFinder = new RexUtil.<MASK><NEW_LINE>((LogicalFilter) node).getCondition().accept(dynamicDeepFinder);<NEW_LINE>for (RexDynamicParam rexDynamicParam : dynamicDeepFinder.getScalar()) {<NEW_LINE>if (rexDynamicParam.getRel() != null) {<NEW_LINE>this.go(rexDynamicParam.getRel());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>super.visit(node, ordinal, parent);<NEW_LINE>}
DynamicDeepFinder(Lists.newLinkedList());
196,676
private static // can't find a good import tool framework, may ref mysqlimport<NEW_LINE>void insertImportByRange(int X, List<CSVRecord> rows, SqlExecutor router, String dbName, String tableName) {<NEW_LINE>int quotient = rows.size() / X;<NEW_LINE>int remainder = rows.size() % X;<NEW_LINE>// range is [left, right)<NEW_LINE>List<Pair<Integer, Integer>> ranges = new ArrayList<>();<NEW_LINE>int start = 0;<NEW_LINE>for (int i = 0; i < remainder; ++i) {<NEW_LINE>int rangeEnd = Math.min(start + quotient + 1, rows.size());<NEW_LINE>ranges.add(Pair<MASK><NEW_LINE>start = rangeEnd;<NEW_LINE>}<NEW_LINE>for (int i = remainder; i < X; ++i) {<NEW_LINE>int rangeEnd = Math.min(start + quotient, rows.size());<NEW_LINE>ranges.add(Pair.of(start, rangeEnd));<NEW_LINE>start = rangeEnd;<NEW_LINE>}<NEW_LINE>List<Thread> threads = new ArrayList<>();<NEW_LINE>for (Pair<Integer, Integer> range : ranges) {<NEW_LINE>threads.add(new Thread(new InsertImporter(router, dbName, tableName, rows, range)));<NEW_LINE>}<NEW_LINE>threads.forEach(Thread::start);<NEW_LINE>threads.forEach(thread -> {<NEW_LINE>try {<NEW_LINE>thread.join();<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>logger.error(e.getMessage());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
.of(start, rangeEnd));
588,037
private UncachedKeyRing fetchKeyFromFacebook(@NonNull ParcelableProxy proxy, OperationLog log, ParcelableKeyRing entry) throws PgpGeneralException, IOException {<NEW_LINE>if (facebookServer == null) {<NEW_LINE>facebookServer = FacebookKeyserverClient.getInstance();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>log.add(LogType.MSG_IMPORT_FETCH_FACEBOOK, 2, entry.getFbUsername());<NEW_LINE>byte[] data = facebookServer.get(entry.getFbUsername(<MASK><NEW_LINE>UncachedKeyRing facebookKey = UncachedKeyRing.decodeFromData(data);<NEW_LINE>if (facebookKey != null) {<NEW_LINE>log.add(LogType.MSG_IMPORT_FETCH_KEYSERVER_OK, 3);<NEW_LINE>} else {<NEW_LINE>log.add(LogType.MSG_IMPORT_FETCH_ERROR_DECODE, 3);<NEW_LINE>}<NEW_LINE>return facebookKey;<NEW_LINE>} catch (KeyserverClient.QueryFailedException e) {<NEW_LINE>// download failed, too bad. just proceed<NEW_LINE>Timber.e(e, "query failed");<NEW_LINE>log.add(LogType.MSG_IMPORT_FETCH_ERROR_KEYSERVER, 3, e.getMessage());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
), proxy).getBytes();
1,787,986
public static Object value(String strValue, Field field) {<NEW_LINE>requireNonNull(field);<NEW_LINE>// if field is not primitive type<NEW_LINE>Type fieldType = field.getGenericType();<NEW_LINE>if (fieldType instanceof ParameterizedType) {<NEW_LINE>Class<?> clazz = (Class<?>) ((ParameterizedType) field.getGenericType()<MASK><NEW_LINE>if (field.getType().equals(List.class)) {<NEW_LINE>// convert to list<NEW_LINE>return stringToList(strValue, clazz);<NEW_LINE>} else if (field.getType().equals(Set.class)) {<NEW_LINE>// covert to set<NEW_LINE>return stringToSet(strValue, clazz);<NEW_LINE>} else if (field.getType().equals(Map.class)) {<NEW_LINE>Class<?> valueClass = (Class<?>) ((ParameterizedType) field.getGenericType()).getActualTypeArguments()[1];<NEW_LINE>return stringToMap(strValue, clazz, valueClass);<NEW_LINE>} else if (field.getType().equals(Optional.class)) {<NEW_LINE>Type typeClazz = ((ParameterizedType) fieldType).getActualTypeArguments()[0];<NEW_LINE>if (typeClazz instanceof ParameterizedType) {<NEW_LINE>throw new IllegalArgumentException(format("unsupported non-primitive Optional<%s> for %s", typeClazz.getClass(), field.getName()));<NEW_LINE>}<NEW_LINE>return Optional.ofNullable(convert(strValue, (Class) typeClazz));<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException(format("unsupported field-type %s for %s", field.getType(), field.getName()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return convert(strValue, field.getType());<NEW_LINE>}<NEW_LINE>}
).getActualTypeArguments()[0];
931,961
public InitializationConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>InitializationConfiguration initializationConfiguration = new InitializationConfiguration();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><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("disabledOnInitialization", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>initializationConfiguration.setDisabledOnInitialization(context.getUnmarshaller(Boolean.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 initializationConfiguration;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
1,563,056
final DescribeAvailablePatchesResult executeDescribeAvailablePatches(DescribeAvailablePatchesRequest describeAvailablePatchesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeAvailablePatchesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeAvailablePatchesRequest> request = null;<NEW_LINE>Response<DescribeAvailablePatchesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeAvailablePatchesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeAvailablePatchesRequest));<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, "SSM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeAvailablePatches");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeAvailablePatchesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeAvailablePatchesResultJsonUnmarshaller());<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());
810,883
static DataFrameClassifier of(Formula formula, DataFrame data, Properties params, Classifier.Trainer<double[], ?> trainer) {<NEW_LINE>DataFrame X = formula.x(data);<NEW_LINE>StructType schema = X.schema();<NEW_LINE>double[][] x = X.<MASK><NEW_LINE>int[] y = formula.y(data).toIntArray();<NEW_LINE>Classifier<double[]> model = trainer.fit(x, y, params);<NEW_LINE>return new DataFrameClassifier() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Formula formula() {<NEW_LINE>return formula;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public StructType schema() {<NEW_LINE>return schema;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int numClasses() {<NEW_LINE>return model.numClasses();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int[] classes() {<NEW_LINE>return model.classes();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int predict(Tuple x) {<NEW_LINE>return model.predict(formula.x(x).toArray());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int predict(Tuple x, double[] posteriori) {<NEW_LINE>return model.predict(formula.x(x).toArray(), posteriori);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
toArray(false, CategoricalEncoder.DUMMY);
1,850,605
public String serializeLoginData() {<NEW_LINE>Date loginTime = this.loginTime;<NEW_LINE>if (refreshToken == null || loginTime == null) {<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>// version<NEW_LINE>builder.append("7\n");<NEW_LINE>builder.append(frc);<NEW_LINE>builder.append("\n");<NEW_LINE>builder.append(serial);<NEW_LINE>builder.append("\n");<NEW_LINE>builder.append(deviceId);<NEW_LINE>builder.append("\n");<NEW_LINE>builder.append(refreshToken);<NEW_LINE>builder.append("\n");<NEW_LINE>builder.append(amazonSite);<NEW_LINE>builder.append("\n");<NEW_LINE>builder.append(deviceName);<NEW_LINE>builder.append("\n");<NEW_LINE>builder.append(accountCustomerId);<NEW_LINE>builder.append("\n");<NEW_LINE>builder.append(loginTime.getTime());<NEW_LINE>builder.append("\n");<NEW_LINE>List<HttpCookie> cookies = cookieManager<MASK><NEW_LINE>builder.append(cookies.size());<NEW_LINE>builder.append("\n");<NEW_LINE>for (HttpCookie cookie : cookies) {<NEW_LINE>writeValue(builder, cookie.getName());<NEW_LINE>writeValue(builder, cookie.getValue());<NEW_LINE>writeValue(builder, cookie.getComment());<NEW_LINE>writeValue(builder, cookie.getCommentURL());<NEW_LINE>writeValue(builder, cookie.getDomain());<NEW_LINE>writeValue(builder, cookie.getMaxAge());<NEW_LINE>writeValue(builder, cookie.getPath());<NEW_LINE>writeValue(builder, cookie.getPortlist());<NEW_LINE>writeValue(builder, cookie.getVersion());<NEW_LINE>writeValue(builder, cookie.getSecure());<NEW_LINE>writeValue(builder, cookie.getDiscard());<NEW_LINE>}<NEW_LINE>return builder.toString();<NEW_LINE>}
.getCookieStore().getCookies();
301,356
static Frame read(final int marker, final DataInput data, final int length) throws IOException {<NEW_LINE>int samplePrecision = data.readUnsignedByte();<NEW_LINE>int lines = data.readUnsignedShort();<NEW_LINE>int samplesPerLine = data.readUnsignedShort();<NEW_LINE>int componentsInFrame = data.readUnsignedByte();<NEW_LINE>int expected = 8 + componentsInFrame * 3;<NEW_LINE>if (length != expected) {<NEW_LINE>throw new IIOException(String.format("Unexpected SOF length: %d != %d", length, expected));<NEW_LINE>}<NEW_LINE>Component[] components = new Component[componentsInFrame];<NEW_LINE>for (int i = 0; i < componentsInFrame; i++) {<NEW_LINE>int id = data.readUnsignedByte();<NEW_LINE>int sub = data.readUnsignedByte();<NEW_LINE>int qtSel = data.readUnsignedByte();<NEW_LINE>components[i] = new Component(id, ((sub & 0xF0) >> 4), <MASK><NEW_LINE>}<NEW_LINE>return new Frame(marker, samplePrecision, lines, samplesPerLine, components);<NEW_LINE>}
(sub & 0xF), qtSel);
706,714
public static Object resolveVariables(final String iText, final String iBegin, final String iEnd, final OVariableParserListener iListener, final Object iDefaultValue) {<NEW_LINE>if (iListener == null)<NEW_LINE>throw new IllegalArgumentException("Missed VariableParserListener listener");<NEW_LINE>int beginPos = iText.lastIndexOf(iBegin);<NEW_LINE>if (beginPos == -1)<NEW_LINE>return iText;<NEW_LINE>int endPos = iText.indexOf(iEnd, beginPos + 1);<NEW_LINE>if (endPos == -1)<NEW_LINE>return iText;<NEW_LINE>String pre = iText.substring(0, beginPos);<NEW_LINE>String var = iText.substring(beginPos + iBegin.length(), endPos);<NEW_LINE>String post = iText.substring(endPos + iEnd.length());<NEW_LINE>Object resolved = iListener.resolve(var);<NEW_LINE>if (resolved == null) {<NEW_LINE>if (iDefaultValue == null)<NEW_LINE>OLogManager.instance().info(null, "[OVariableParser.resolveVariables] Property not found: %s", var);<NEW_LINE>else<NEW_LINE>resolved = iDefaultValue;<NEW_LINE>}<NEW_LINE>if (pre.length() > 0 || post.length() > 0) {<NEW_LINE>final String path = pre + (resolved != null ? resolved.toString() : "") + post;<NEW_LINE>return resolveVariables(<MASK><NEW_LINE>}<NEW_LINE>return resolved;<NEW_LINE>}
path, iBegin, iEnd, iListener);
399,359
protected long doI64(VirtualFrame frame, long left, long right, boolean cf) {<NEW_LINE>long c = cf ? 1 : 0;<NEW_LINE>long result = left + right + c;<NEW_LINE>boolean overflow;<NEW_LINE>boolean carry;<NEW_LINE>if (noCfProfile.profile(!cf)) {<NEW_LINE>overflow = (result < 0 && left > 0 && right > 0) || (result >= 0 && left < 0 && right < 0);<NEW_LINE>carry = ((left < 0 || right < 0) && result >= 0) || (left < 0 && right < 0);<NEW_LINE>} else if (smallLeftProfile.profile(left != -1)) {<NEW_LINE>overflow = overflow(left + 1, right);<NEW_LINE>carry = carry(left + 1, right);<NEW_LINE>} else if (smallRightProfile.profile(right != -1)) {<NEW_LINE>overflow = overflow(left, right + 1);<NEW_LINE>carry = carry(left, right + 1);<NEW_LINE>} else {<NEW_LINE>overflow = false;<NEW_LINE>carry = true;<NEW_LINE>}<NEW_LINE>flags.execute(<MASK><NEW_LINE>return result;<NEW_LINE>}
frame, overflow, carry, result);
284,390
public static void main(String[] args) {<NEW_LINE>Region region = Region.US_EAST_1;<NEW_LINE>DynamoDbClient ddb = DynamoDbClient.builder().region(region).build();<NEW_LINE>AttributeValue att1 = AttributeValue.builder().s("Acme Band").build();<NEW_LINE>AttributeValue att2 = AttributeValue.builder().s("PartiQL Rocks").build();<NEW_LINE>List<AttributeValue> parameters = new ArrayList<AttributeValue>();<NEW_LINE>parameters.add(att1);<NEW_LINE>parameters.add(att2);<NEW_LINE>// Retrieve an item from the Music table using the SELECT PartiQL statement.<NEW_LINE>ExecuteStatementResponse response = executeStatementRequest(ddb, "SELECT * FROM Music where Artist=? and SongTitle=?", parameters);<NEW_LINE>processResults(response);<NEW_LINE>// Update an item in the Music table using the UPDATE PartiQL statement.<NEW_LINE>processResults(executeStatementRequest(ddb, "UPDATE Music SET AwardsWon=1 SET AwardDetail={'Grammys':[2020, 2018]} where Artist=? and SongTitle=?", parameters));<NEW_LINE>// Add a list value for an item in the Music table.<NEW_LINE>ExecuteStatementResponse resp2 = executeStatementRequest(ddb, "UPDATE Music SET AwardDetail.Grammys =LIST_APPEND(AwardDetail.Grammys,[2016]) where Artist=? and SongTitle=?", parameters);<NEW_LINE>processResults(resp2);<NEW_LINE>// Add a new string set attribute for an item in the Music table.<NEW_LINE>processResults(executeStatementRequest(ddb, "UPDATE Music SET BandMembers =<<'member1', 'member2'>> where Artist=? and SongTitle=?", parameters));<NEW_LINE>// Add a list value for an item in the Music table.<NEW_LINE>processResults(executeStatementRequest(ddb, "UPDATE Music SET AwardDetail.Grammys =list_append(AwardDetail.Grammys,[2016]) where Artist=? and SongTitle=?", parameters));<NEW_LINE>// Remove a list value for an item in the Music table.<NEW_LINE>processResults(executeStatementRequest<MASK><NEW_LINE>// Add a new map member for an item in the Music table.<NEW_LINE>processResults(executeStatementRequest(ddb, "UPDATE Music set AwardDetail.BillBoard=[2020] where Artist=? and SongTitle=?", parameters));<NEW_LINE>// Add a new string set attribute for an item in the Music table.<NEW_LINE>processResults(executeStatementRequest(ddb, "UPDATE Music SET BandMembers =<<'member1', 'member2'>> where Artist=? and SongTitle=?", parameters));<NEW_LINE>// Update a string set attribute for an item in the Music table.<NEW_LINE>processResults(executeStatementRequest(ddb, "UPDATE Music SET BandMembers =set_add(BandMembers, <<'newmember'>>) where Artist=? and SongTitle=?", parameters));<NEW_LINE>System.out.println("This code example has completed");<NEW_LINE>ddb.close();<NEW_LINE>}
(ddb, "UPDATE Music REMOVE AwardDetail.Grammys[2] where Artist=? and SongTitle=?", parameters));
373,076
final UntagStreamResult executeUntagStream(UntagStreamRequest untagStreamRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(untagStreamRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<UntagStreamRequest> request = null;<NEW_LINE>Response<UntagStreamResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UntagStreamRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(untagStreamRequest));<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, "Kinesis Video");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UntagStream");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UntagStreamResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UntagStreamResultJsonUnmarshaller());<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.ClientExecuteTime);
583,256
public static int ycbcrToRgb(int y, int cb, int cr) {<NEW_LINE>// multiply coefficients in book by 1024, which is 2^10<NEW_LINE>y = 1191 * (y - 16);<NEW_LINE>if (y < 0)<NEW_LINE>y = 0;<NEW_LINE>cb -= 128;<NEW_LINE>cr -= 128;<NEW_LINE>int r = (y + 1836 * cr) >> 10;<NEW_LINE>int g = (y - 547 * cr <MASK><NEW_LINE>int b = (y + 2165 * cb) >> 10;<NEW_LINE>if (r < 0)<NEW_LINE>r = 0;<NEW_LINE>else if (r > 255)<NEW_LINE>r = 255;<NEW_LINE>if (g < 0)<NEW_LINE>g = 0;<NEW_LINE>else if (g > 255)<NEW_LINE>g = 255;<NEW_LINE>if (b < 0)<NEW_LINE>b = 0;<NEW_LINE>else if (b > 255)<NEW_LINE>b = 255;<NEW_LINE>return (r << 16) | (g << 8) | b;<NEW_LINE>}
- 218 * cb) >> 10;
1,489,771
private void updateCompassPaths(QuadPoint center, float innerRadiusLength, float radiusLength) {<NEW_LINE>compass.addCircle(center.x, center.y, radiusLength, Path.Direction.CCW);<NEW_LINE>arrowArc.addArc(new RectF(center.x - radiusLength, center.y - radiusLength, center.x + radiusLength, center.y + radiusLength), -45, -90);<NEW_LINE>for (int i = 0; i < degrees.length; i++) {<NEW_LINE>double degree = degrees[i];<NEW_LINE>float x = (float) Math.cos(degree);<NEW_LINE>float y = -(float) Math.sin(degree);<NEW_LINE>float lineStartX = center.x + x * innerRadiusLength;<NEW_LINE>float lineStartY = center.y + y * innerRadiusLength;<NEW_LINE>float lineLength = getCompassLineHeight(i);<NEW_LINE>float lineStopX = center.x + x * (innerRadiusLength - lineLength);<NEW_LINE>float lineStopY = center.y + y * (innerRadiusLength - lineLength);<NEW_LINE>if (i == 18) {<NEW_LINE>float shortLineMargin = AndroidUtils.dpToPx(app, 5.66f);<NEW_LINE>float shortLineHeight = AndroidUtils.dpToPx(app, 2.94f);<NEW_LINE>float startY = center.y + y * (radiusLength - shortLineMargin);<NEW_LINE>float stopY = center.y + y <MASK><NEW_LINE>compass.moveTo(center.x, startY);<NEW_LINE>compass.lineTo(center.x, stopY);<NEW_LINE>float firstPointY = center.y + y * (radiusLength + AndroidUtils.dpToPx(app, 5));<NEW_LINE>float secondPointX = center.x - AndroidUtils.dpToPx(app, 4);<NEW_LINE>float secondPointY = center.y + y * (radiusLength - AndroidUtils.dpToPx(app, 2));<NEW_LINE>float thirdPointX = center.x + AndroidUtils.dpToPx(app, 4);<NEW_LINE>float thirdPointY = center.y + y * (radiusLength - AndroidUtils.dpToPx(app, 2));<NEW_LINE>arrow.moveTo(center.x, firstPointY);<NEW_LINE>arrow.lineTo(secondPointX, secondPointY);<NEW_LINE>arrow.lineTo(thirdPointX, thirdPointY);<NEW_LINE>arrow.lineTo(center.x, firstPointY);<NEW_LINE>arrow.close();<NEW_LINE>} else {<NEW_LINE>compass.moveTo(lineStartX, lineStartY);<NEW_LINE>compass.lineTo(lineStopX, lineStopY);<NEW_LINE>}<NEW_LINE>if (i % 9 == 0 && i != 18) {<NEW_LINE>redCompassLines.moveTo(lineStartX, lineStartY);<NEW_LINE>redCompassLines.lineTo(lineStopX, lineStopY);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
* (radiusLength - shortLineMargin - shortLineHeight);
1,082,961
final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(tagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TagResourceRequest> request = null;<NEW_LINE>Response<TagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new TagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(tagResourceRequest));<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, "signer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><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>}
false), new TagResourceResultJsonUnmarshaller());
1,621,094
public void create() throws IOException {<NEW_LINE>cx = Context.enter();<NEW_LINE>cx.setOptimizationLevel(9);<NEW_LINE>cx.setLanguageVersion(Context.VERSION_ES6);<NEW_LINE>scope = new Global(cx);<NEW_LINE>runCode(cx, scope, "testsrc/benchmarks/caliper/fieldTests.js");<NEW_LINE>Object[<MASK><NEW_LINE>for (int i = 0; i < stringKeys; i++) {<NEW_LINE>int len = rand.nextInt(49) + 1;<NEW_LINE>char[] c = new char[len];<NEW_LINE>for (int cc = 0; cc < len; cc++) {<NEW_LINE>c[cc] = (char) ('a' + rand.nextInt(25));<NEW_LINE>}<NEW_LINE>sarray[i] = new String(c);<NEW_LINE>}<NEW_LINE>strings = cx.newArray(scope, sarray);<NEW_LINE>Object[] iarray = new Object[intKeys];<NEW_LINE>for (int i = 0; i < intKeys; i++) {<NEW_LINE>iarray[i] = rand.nextInt(10000);<NEW_LINE>}<NEW_LINE>ints = cx.newArray(scope, iarray);<NEW_LINE>}
] sarray = new Object[stringKeys];
802,006
// Method to deserialize the Enum using property based methodology<NEW_LINE>protected Object deserializeEnumUsingPropertyBased(final JsonParser p, final DeserializationContext ctxt, final PropertyBasedCreator creator) throws IOException {<NEW_LINE>PropertyValueBuffer buffer = creator.startBuilding(p, ctxt, null);<NEW_LINE>JsonToken t = p.currentToken();<NEW_LINE>for (; t == JsonToken.FIELD_NAME; t = p.nextToken()) {<NEW_LINE>String propName = p.currentName();<NEW_LINE>// to point to value<NEW_LINE>p.nextToken();<NEW_LINE>final SettableBeanProperty <MASK><NEW_LINE>if (buffer.readIdProperty(propName) && creatorProp == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (creatorProp != null) {<NEW_LINE>buffer.assignParameter(creatorProp, _deserializeWithErrorWrapping(p, ctxt, creatorProp));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// 26-Nov-2020, tatu: ... what should we do here tho?<NEW_LINE>p.skipChildren();<NEW_LINE>}<NEW_LINE>return creator.build(ctxt, buffer);<NEW_LINE>}
creatorProp = creator.findCreatorProperty(propName);
1,312,953
public JSONObject toJSON() {<NEW_LINE>JSONObject json = new JSONObject();<NEW_LINE>if (originalLocation != null) {<NEW_LINE>json.put("lat", String.format(Locale.US, "%.5f", originalLocation.getLatitude()));<NEW_LINE>json.put("lon", String.format(Locale.US, "%.5f", originalLocation.getLongitude()));<NEW_LINE>}<NEW_LINE>if (regionLang != null) {<NEW_LINE>json.put("regionLang", regionLang);<NEW_LINE>}<NEW_LINE>json.put("radiusLevel", radiusLevel);<NEW_LINE>json.put("totalLimit", totalLimit);<NEW_LINE>json.put("lang", lang);<NEW_LINE>json.put("transliterateIfMissing", transliterateIfMissing);<NEW_LINE>json.put("emptyQueryAllowed", emptyQueryAllowed);<NEW_LINE><MASK><NEW_LINE>if (searchTypes != null && searchTypes.length > 0) {<NEW_LINE>JSONArray searchTypesArr = new JSONArray();<NEW_LINE>for (ObjectType type : searchTypes) {<NEW_LINE>searchTypesArr.put(type.name());<NEW_LINE>}<NEW_LINE>json.put("searchTypes", searchTypes);<NEW_LINE>}<NEW_LINE>return json;<NEW_LINE>}
json.put("sortByName", sortByName);
934,530
protected void addEventRegistryProperties(FlowElement flowElement, ObjectNode propertiesNode) {<NEW_LINE>String eventType = getExtensionValue("eventType", flowElement);<NEW_LINE>if (StringUtils.isNotEmpty(eventType)) {<NEW_LINE>setPropertyValue(PROPERTY_EVENT_REGISTRY_EVENT_KEY, eventType, propertiesNode);<NEW_LINE>setPropertyValue(PROPERTY_EVENT_REGISTRY_EVENT_NAME, getExtensionValue("eventName", flowElement), propertiesNode);<NEW_LINE>addEventOutParameters(flowElement.getExtensionElements().get("eventOutParameter"), propertiesNode);<NEW_LINE>addEventCorrelationParameters(flowElement.getExtensionElements().get("eventCorrelationParameter"), propertiesNode);<NEW_LINE>setPropertyValue(PROPERTY_EVENT_REGISTRY_CHANNEL_KEY, getExtensionValue("channelKey", flowElement), propertiesNode);<NEW_LINE>setPropertyValue(PROPERTY_EVENT_REGISTRY_CHANNEL_NAME, getExtensionValue("channelName", flowElement), propertiesNode);<NEW_LINE>setPropertyValue(PROPERTY_EVENT_REGISTRY_CHANNEL_TYPE, getExtensionValue("channelType", flowElement), propertiesNode);<NEW_LINE>setPropertyValue(PROPERTY_EVENT_REGISTRY_CHANNEL_DESTINATION, getExtensionValue("channelDestination", flowElement), propertiesNode);<NEW_LINE>String keyDetectionType = getExtensionValue("keyDetectionType", flowElement);<NEW_LINE>String keyDetectionValue = getExtensionValue("keyDetectionValue", flowElement);<NEW_LINE>if (StringUtils.isNotEmpty(keyDetectionType) && StringUtils.isNotEmpty(keyDetectionValue)) {<NEW_LINE>if ("fixedValue".equalsIgnoreCase(keyDetectionType)) {<NEW_LINE>setPropertyValue(PROPERTY_EVENT_REGISTRY_KEY_DETECTION_FIXED_VALUE, keyDetectionValue, propertiesNode);<NEW_LINE>} else if ("jsonField".equalsIgnoreCase(keyDetectionType)) {<NEW_LINE>setPropertyValue(PROPERTY_EVENT_REGISTRY_KEY_DETECTION_JSON_FIELD, keyDetectionValue, propertiesNode);<NEW_LINE>} else if ("jsonPointer".equalsIgnoreCase(keyDetectionType)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
setPropertyValue(PROPERTY_EVENT_REGISTRY_KEY_DETECTION_JSON_POINTER, keyDetectionValue, propertiesNode);
1,512,995
public static void main(String[] args) {<NEW_LINE>String dstDir = "./data/";<NEW_LINE>String[] path = new String[] { null, null };<NEW_LINE>for (int i = 0; i < args.length; i++) {<NEW_LINE>if (args[i].equals("-src")) {<NEW_LINE>path[0] = args[++i];<NEW_LINE>} else if (args[i].equals("-region")) {<NEW_LINE>path[1] = args[++i];<NEW_LINE>} else if (args[i].equals("-dst")) {<NEW_LINE>dstDir = args[++i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < path.length; i++) {<NEW_LINE>if (path[i] == null) {<NEW_LINE>System.out.<MASK><NEW_LINE>System.out.println("eg: java -jar dbMaker.jar " + "-src ./data/ip.merge.txt -region ./data/origin/global_region.csv");<NEW_LINE>System.exit(0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// check and stdlize the destination directory<NEW_LINE>if (!dstDir.endsWith("/")) {<NEW_LINE>dstDir = dstDir + "/";<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>DbConfig config = new DbConfig();<NEW_LINE>DbMaker dbMaker = new DbMaker(config, path[0], path[1]);<NEW_LINE>dbMaker.make(dstDir + "ip2region.db");<NEW_LINE>} catch (DbMakerConfigException e) {<NEW_LINE>// TODO Auto-generated catch block<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (IOException e) {<NEW_LINE>// TODO Auto-generated catch block<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
println("Usage: java -jar dbMaker.jar " + "-src [source text file path] " + "-region [global region file path]");
435,400
void addEntries(String category, GwtLocale locale, InputFactory cldrFactory, String prefix, String tag, String keyAttribute) {<NEW_LINE>Map<String, String> <MASK><NEW_LINE>InputFile cldr = cldrFactory.load(allLocales.get(locale));<NEW_LINE>XPathParts parts = new XPathParts();<NEW_LINE>for (String path : cldr.listPaths(prefix)) {<NEW_LINE>String fullXPath = cldr.getFullXPath(path);<NEW_LINE>if (fullXPath == null) {<NEW_LINE>fullXPath = path;<NEW_LINE>}<NEW_LINE>parts.set(fullXPath);<NEW_LINE>if (parts.containsAttribute("alt")) {<NEW_LINE>// ignore alternate strings<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Map<String, String> attr = parts.findAttributes(tag);<NEW_LINE>if (attr == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String value = cldr.getStringValue(path);<NEW_LINE>boolean draft = parts.containsAttribute("draft");<NEW_LINE>String key = keyAttribute != null ? attr.get(keyAttribute) : "value";<NEW_LINE>if (!draft || !map.containsKey(key)) {<NEW_LINE>map.put(key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
map = getMap(category, locale);
1,489,665
public DataSerializableFactory createFactory() {<NEW_LINE>ConstructorFunction<Integer, IdentifiedDataSerializable>[] constructors = new ConstructorFunction[LEN];<NEW_LINE>constructors[JSON_QUERY] = arg -> new JsonQueryFunction();<NEW_LINE>constructors[JSON_PARSE] = arg -> new JsonParseFunction();<NEW_LINE>constructors[JSON_VALUE] = arg -> new JsonValueFunction<>();<NEW_LINE>constructors[JSON_OBJECT] = arg -> new JsonObjectFunction();<NEW_LINE>constructors[JSON_ARRAY] = arg -> new JsonArrayFunction();<NEW_LINE>constructors[MAP_INDEX_SCAN_METADATA] = arg -> new MapIndexScanMetadata();<NEW_LINE>constructors[ROW_PROJECTOR_PROCESSOR_SUPPLIER] = arg -> new RowProjectorProcessorSupplier();<NEW_LINE>constructors[KV_ROW_PROJECTOR_SUPPLIER] = arg -> new KvRowProjector.Supplier();<NEW_LINE>constructors[ROOT_RESULT_CONSUMER_SINK_SUPPLIER] = <MASK><NEW_LINE>constructors[SQL_ROW_COMPARATOR] = arg -> new ExpressionUtil.SqlRowComparator();<NEW_LINE>constructors[FIELD_COLLATION] = arg -> new FieldCollation();<NEW_LINE>constructors[ROW_GET_MAYBE_SERIALIZED_FN] = arg -> new AggregateAbstractPhysicalRule.RowGetMaybeSerializedFn();<NEW_LINE>constructors[NULL_FUNCTION] = arg -> AggregateAbstractPhysicalRule.NullFunction.INSTANCE;<NEW_LINE>constructors[ROW_GET_FN] = arg -> new AggregateAbstractPhysicalRule.RowGetFn();<NEW_LINE>constructors[AGGREGATE_CREATE_SUPPLIER] = arg -> new AggregateAbstractPhysicalRule.AggregateCreateSupplier();<NEW_LINE>constructors[AGGREGATE_ACCUMULATE_FUNCTION] = arg -> new AggregateAbstractPhysicalRule.AggregateAccumulateFunction();<NEW_LINE>constructors[AGGREGATE_COMBINE_FUNCTION] = arg -> AggregateAbstractPhysicalRule.AggregateCombineFunction.INSTANCE;<NEW_LINE>constructors[AGGREGATE_EXPORT_FINISH_FUNCTION] = arg -> AggregateAbstractPhysicalRule.AggregateExportFinishFunction.INSTANCE;<NEW_LINE>constructors[AGGREGATE_SUM_SUPPLIER] = arg -> new AggregateAbstractPhysicalRule.AggregateSumSupplier();<NEW_LINE>constructors[AGGREGATE_AVG_SUPPLIER] = arg -> new AggregateAbstractPhysicalRule.AggregateAvgSupplier();<NEW_LINE>constructors[AGGREGATE_COUNT_SUPPLIER] = arg -> new AggregateAbstractPhysicalRule.AggregateCountSupplier();<NEW_LINE>return new ArrayDataSerializableFactory(constructors);<NEW_LINE>}
arg -> new RootResultConsumerSink.Supplier();
313,028
public CreateGroupResult createGroup(CreateGroupRequest createGroupRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateGroupRequest> request = null;<NEW_LINE>Response<CreateGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateGroupRequestMarshaller().marshall(createGroupRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>Unmarshaller<CreateGroupResult, JsonUnmarshallerContext> unmarshaller = new CreateGroupResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<CreateGroupResult> responseHandler = new JsonResponseHandler<CreateGroupResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1,073,154
public void delete(@PathParam("organizationId") String organizationId) throws OrganizationNotFoundException, NotAuthorizedException, EntityStillActiveException {<NEW_LINE>securityContext.<MASK><NEW_LINE>try {<NEW_LINE>storage.beginTx();<NEW_LINE>OrganizationBean organizationBean = getOrganizationFromStorage(organizationId);<NEW_LINE>// Any active app versions?<NEW_LINE>Iterator<ClientVersionBean> clientAppsVers = storage.getAllClientVersions(organizationBean, ClientStatus.Registered, 5);<NEW_LINE>if (clientAppsVers.hasNext()) {<NEW_LINE>throw ExceptionFactory.entityStillActiveExceptionClientVersions(clientAppsVers);<NEW_LINE>}<NEW_LINE>// Any active API versions?<NEW_LINE>Iterator<ApiVersionBean> apiVers = storage.getAllApiVersions(organizationBean, ApiStatus.Published, 5);<NEW_LINE>if (apiVers.hasNext()) {<NEW_LINE>throw ExceptionFactory.entityStillActiveExceptionApiVersions(apiVers);<NEW_LINE>}<NEW_LINE>// Any unbroken contracts?<NEW_LINE>Iterator<ContractBean> contracts = storage.getAllContracts(organizationBean, 5);<NEW_LINE>if (contracts.hasNext()) {<NEW_LINE>throw ExceptionFactory.entityStillActiveExceptionContracts(contracts);<NEW_LINE>}<NEW_LINE>// Any active plans versions?<NEW_LINE>Iterator<PlanVersionBean> planVers = storage.getAllPlanVersions(organizationBean, 5);<NEW_LINE>if (planVers.hasNext()) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>log.warn("There are locked plans(s): these will be deleted.");<NEW_LINE>}<NEW_LINE>// Delete org<NEW_LINE>storage.deleteOrganization(organizationBean);<NEW_LINE>storage.commitTx();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>log.debug("Deleted Organization: " + organizationBean.getName());<NEW_LINE>} catch (AbstractRestException e) {<NEW_LINE>storage.rollbackTx();<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>storage.rollbackTx();<NEW_LINE>throw new SystemErrorException(e);<NEW_LINE>}<NEW_LINE>}
checkPermissions(PermissionType.orgAdmin, organizationId);
393,150
protected AlGetMembersModel doInBackground() {<NEW_LINE>AlGetMembersModel model = new AlGetMembersModel();<NEW_LINE>try {<NEW_LINE>ChannelFeedListResponse response = ChannelClientService.getInstance(context.get()).getMemebersFromContactGroupIds(groupIds, groupNames, groupType);<NEW_LINE>if (response != null) {<NEW_LINE>if (ChannelFeedListResponse.SUCCESS.equals(response.getStatus())) {<NEW_LINE>Set<String> contactIds = new HashSet<String>();<NEW_LINE>if (!response.getResponse().isEmpty()) {<NEW_LINE>ChannelService.getInstance(context.get()).processChannelFeedList(response.getResponse().toArray(new ChannelFeed[response.getResponse().<MASK><NEW_LINE>for (ChannelFeed feed : response.getResponse()) {<NEW_LINE>contactIds.addAll(feed.getContactGroupMembersId());<NEW_LINE>}<NEW_LINE>model.setMembers(contactIds.toArray(new String[contactIds.size()]));<NEW_LINE>UserService.getInstance(context.get()).processUserDetailsByUserIds(contactIds);<NEW_LINE>model.setResponse("Successfully fetched");<NEW_LINE>}<NEW_LINE>} else if (response.getErrorResponse() != null) {<NEW_LINE>model.setResponse(GsonUtils.getJsonFromObject(response.getErrorResponse(), ErrorResponseFeed[].class));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>model.setResponse("Some Error occurred");<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>model.setException(e);<NEW_LINE>}<NEW_LINE>return model;<NEW_LINE>}
size()]), false);
148,545
private void assignExportedMethodsKeys(String moduleName, List<Map<String, Object>> exportedMethodsInfos) {<NEW_LINE>if (mExportedMethodsKeys.get(moduleName) == null) {<NEW_LINE>mExportedMethodsKeys.put(moduleName, new HashMap<String, Integer>());<NEW_LINE>}<NEW_LINE>if (mExportedMethodsReverseKeys.get(moduleName) == null) {<NEW_LINE>mExportedMethodsReverseKeys.put(moduleName, new SparseArray<String>());<NEW_LINE>}<NEW_LINE>for (int i = 0; i < exportedMethodsInfos.size(); i++) {<NEW_LINE>Map<String, Object> methodInfo = exportedMethodsInfos.get(i);<NEW_LINE>if (methodInfo.get(METHOD_INFO_NAME) == null || !(methodInfo.get(METHOD_INFO_NAME) instanceof String)) {<NEW_LINE>throw new RuntimeException("No method name in MethodInfo - " + methodInfo.toString());<NEW_LINE>}<NEW_LINE>String methodName = (String) methodInfo.get(METHOD_INFO_NAME);<NEW_LINE>Integer maybePreviousIndex = mExportedMethodsKeys.get(moduleName).get(methodName);<NEW_LINE>if (maybePreviousIndex == null) {<NEW_LINE>int key = mExportedMethodsKeys.get(moduleName)<MASK><NEW_LINE>methodInfo.put(METHOD_INFO_KEY, key);<NEW_LINE>mExportedMethodsKeys.get(moduleName).put(methodName, key);<NEW_LINE>mExportedMethodsReverseKeys.get(moduleName).put(key, methodName);<NEW_LINE>} else {<NEW_LINE>int key = maybePreviousIndex;<NEW_LINE>methodInfo.put(METHOD_INFO_KEY, key);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.values().size();
1,140,225
private DDlogExpression aggregateComplete(Node node, String aggregate, DDlogExpression value, DDlogType resultType) {<NEW_LINE>switch(aggregate) {<NEW_LINE>case "avg":<NEW_LINE>{<NEW_LINE>String suffix;<NEW_LINE>DDlogType argType = value.getType();<NEW_LINE>DDlogTTuple tuple = argType.as(DDlogTTuple.class, "Expected a tuple");<NEW_LINE>DDlogType sumType = tuple.component(0);<NEW_LINE>if (argType.mayBeNull) {<NEW_LINE>suffix = "N";<NEW_LINE>} else {<NEW_LINE>suffix = "R";<NEW_LINE>}<NEW_LINE>IsNumericType num = sumType.toNumeric();<NEW_LINE>DDlogExpression compute = new DDlogEApply(node, "avg_" + num.simpleName() + "_" + suffix, sumType, value);<NEW_LINE>return DDlogEAs.cast(compute, resultType);<NEW_LINE>}<NEW_LINE>case "min":<NEW_LINE>case "max":<NEW_LINE>return new DDlogETupField(node, value, 1);<NEW_LINE>case "count_distinct":<NEW_LINE>{<NEW_LINE>return DDlogEAs.cast(new DDlogEApply(node, "set_size", new DDlogTBit(node, 32, false), value), resultType);<NEW_LINE>}<NEW_LINE>case "sum_distinct":<NEW_LINE>{<NEW_LINE>DDlogTUser set = value.getType().<MASK><NEW_LINE>DDlogType elemType = set.getTypeArg(0);<NEW_LINE>IsNumericType num = elemType.toNumeric();<NEW_LINE>DDlogExpression compute = new DDlogEApply(node, "set_" + num.simpleName() + "_sum", elemType, value);<NEW_LINE>return DDlogEAs.cast(compute, resultType);<NEW_LINE>}<NEW_LINE>case "set_agg":<NEW_LINE>case "array_agg":<NEW_LINE>return DDlogTRef.ref_new(value);<NEW_LINE>default:<NEW_LINE>return DDlogEAs.cast(value, resultType);<NEW_LINE>}<NEW_LINE>}
as(DDlogTUser.class, "expected a set");
472,084
public void execute() {<NEW_LINE>final BaseDMLHandler nextHandler = this.nextHandler;<NEW_LINE>final boolean left = this.isLeft;<NEW_LINE>DbleServer.getInstance().getComplexQueryExecutor().execute(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>final MySQLResponseService service = new FakeResponseService(null);<NEW_LINE>List<MASK><NEW_LINE>nextHandler.fieldEofResponse(null, null, fields, null, left, service);<NEW_LINE>List<RowDataPacket> data = makeRowData();<NEW_LINE>for (RowDataPacket row : data) {<NEW_LINE>nextHandler.rowResponse(null, row, left, service);<NEW_LINE>}<NEW_LINE>nextHandler.rowEofResponse(null, left, service);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.warn("execute error", e);<NEW_LINE>((ManagerService) session.getSource().getService()).writeErrMessage((byte) 1, ErrorCode.ER_UNKNOWN_ERROR, e.getMessage() == null ? e.toString() : e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
<FieldPacket> fields = makeField();
1,313,548
protected Content prepare(@Nonnull T field, @Nonnull Function<? super String, String> onShow) {<NEW_LINE>Font font = field.getFont();<NEW_LINE>FontMetrics metrics = font == null ? null : field.getFontMetrics(font);<NEW_LINE>int height = metrics == null ? 16 : metrics.getHeight();<NEW_LINE>Dimension size = new Dimension(field.getWidth(), height * 16);<NEW_LINE>JPanel mainPanel = new JPanel(new BorderLayout());<NEW_LINE>JTextArea area = new JTextArea(onShow.fun(field.getText()));<NEW_LINE>area.putClientProperty(Expandable.class, this);<NEW_LINE>area.setEditable(field.isEditable());<NEW_LINE>// area.setBackground(field.getBackground());<NEW_LINE>// area.setForeground(field.getForeground());<NEW_LINE>area.setFont(font);<NEW_LINE>area.setWrapStyleWord(true);<NEW_LINE>area.setLineWrap(true);<NEW_LINE>IntelliJExpandableSupport.copyCaretPosition(field, area);<NEW_LINE>UIUtil.addUndoRedoActions(area);<NEW_LINE>JLabel label = ExpandableSupport.createLabel(createCollapseExtension());<NEW_LINE>label.setBorder(JBUI.Borders.empty(5));<NEW_LINE>JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(area, true);<NEW_LINE>mainPanel.add(scrollPane, BorderLayout.CENTER);<NEW_LINE>JPanel eastPanel = new JPanel(new VerticalFlowLayout(0, 0));<NEW_LINE>eastPanel.add(label);<NEW_LINE>mainPanel.<MASK><NEW_LINE>scrollPane.setPreferredSize(size);<NEW_LINE>return new Content() {<NEW_LINE><NEW_LINE>@Nonnull<NEW_LINE>@Override<NEW_LINE>public JComponent getContentComponent() {<NEW_LINE>return mainPanel;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public JComponent getFocusableComponent() {<NEW_LINE>return area;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void cancel(@Nonnull Function<? super String, String> onHide) {<NEW_LINE>if (field.isEditable()) {<NEW_LINE>field.setText(onHide.fun(area.getText()));<NEW_LINE>IntelliJExpandableSupport.copyCaretPosition(area, field);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
add(eastPanel, BorderLayout.EAST);
665,979
public void readFrom(StreamInput in) throws IOException {<NEW_LINE>super.readFrom(in);<NEW_LINE>cause = in.readString();<NEW_LINE>name = in.readString();<NEW_LINE>if (in.getVersion().onOrAfter(Version.V_6_0_0_alpha1)) {<NEW_LINE>indexPatterns = in.readStringList();<NEW_LINE>} else {<NEW_LINE>indexPatterns = Collections.singletonList(in.readString());<NEW_LINE>}<NEW_LINE>order = in.readInt();<NEW_LINE>create = in.readBoolean();<NEW_LINE>settings = readSettingsFromStream(in);<NEW_LINE>int size = in.readVInt();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>final String type = in.readString();<NEW_LINE>String mappingSource = in.readString();<NEW_LINE>if (in.getVersion().before(Version.V_5_3_0)) {<NEW_LINE>// we do not know the incoming type so convert it if needed<NEW_LINE>mappingSource = XContentHelper.convertToJson(new BytesArray(mappingSource), false, false, XContentFactory.xContentType(mappingSource));<NEW_LINE>}<NEW_LINE>mappings.put(type, mappingSource);<NEW_LINE>}<NEW_LINE>if (in.getVersion().before(Version.V_6_5_0)) {<NEW_LINE>// Used to be used for custom index metadata<NEW_LINE>int customSize = in.readVInt();<NEW_LINE>assert customSize == 0 : "expected not to have any custom metadata";<NEW_LINE>if (customSize > 0) {<NEW_LINE>throw new IllegalStateException("unexpected custom metadata when none is supported");<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < aliasesSize; i++) {<NEW_LINE>aliases.add(Alias.read(in));<NEW_LINE>}<NEW_LINE>version = in.readOptionalVInt();<NEW_LINE>}
int aliasesSize = in.readVInt();
37,961
private void saveGridFSFile(GridFSInputFile gfsInputFile, EntityMetadata m) {<NEW_LINE>try {<NEW_LINE>DBCollection coll = mongoDb.getCollection(m.getTableName() + MongoDBUtils.FILES);<NEW_LINE>createUniqueIndexGFS(coll, ((AbstractAttribute) m.getIdAttribute()).getJPAColumnName());<NEW_LINE>gfsInputFile.save();<NEW_LINE>log.info("Input GridFS file: " + gfsInputFile.getFilename() + " is saved successfully in " + m.getTableName() + MongoDBUtils.CHUNKS + " and metadata in " + m.<MASK><NEW_LINE>} catch (MongoException e) {<NEW_LINE>log.error("Error in saving GridFS file in " + m.getTableName() + MongoDBUtils.FILES + " or " + m.getTableName() + MongoDBUtils.CHUNKS + " collections.");<NEW_LINE>throw new KunderaException("Error in saving GridFS file in " + m.getTableName() + MongoDBUtils.FILES + " or " + m.getTableName() + MongoDBUtils.CHUNKS + " collections. Caused By: ", e);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>gfsInputFile.validate();<NEW_LINE>log.info("Input GridFS file: " + gfsInputFile.getFilename() + " is validated.");<NEW_LINE>} catch (MongoException e) {<NEW_LINE>log.error("Error in validating GridFS file in " + m.getTableName() + MongoDBUtils.FILES + " collection.");<NEW_LINE>throw new KunderaException("Error in validating GridFS file in " + m.getTableName() + MongoDBUtils.FILES + " collection. Caused By: ", e);<NEW_LINE>}<NEW_LINE>}
getTableName() + MongoDBUtils.FILES);
250,636
private void handleContentCrashIntent(@NonNull final Intent intent) {<NEW_LINE>Log.e(LOGTAG, "Got content crashed intent");<NEW_LINE>final String dumpFile = <MASK><NEW_LINE>final String extraFile = intent.getStringExtra(GeckoRuntime.EXTRA_EXTRAS_PATH);<NEW_LINE>Log.d(LOGTAG, "Dump File: " + dumpFile);<NEW_LINE>Log.d(LOGTAG, "Extras File: " + extraFile);<NEW_LINE>Log.d(LOGTAG, "Fatal: " + intent.getBooleanExtra(GeckoRuntime.EXTRA_CRASH_FATAL, false));<NEW_LINE>boolean isCrashReportingEnabled = SettingsStore.getInstance(this).isCrashReportingEnabled();<NEW_LINE>if (isCrashReportingEnabled) {<NEW_LINE>SystemUtils.postCrashFiles(this, dumpFile, extraFile);<NEW_LINE>} else {<NEW_LINE>if (mCrashDialog == null) {<NEW_LINE>mCrashDialog = new CrashDialogWidget(this, dumpFile, extraFile);<NEW_LINE>}<NEW_LINE>mCrashDialog.show(UIWidget.REQUEST_FOCUS);<NEW_LINE>}<NEW_LINE>}
intent.getStringExtra(GeckoRuntime.EXTRA_MINIDUMP_PATH);
1,625,096
public Void scan(Tree tree, Void p) {<NEW_LINE>if (tree != null) {<NEW_LINE>long endPos = sourcePositions.getEndPosition(getCurrentPath().getCompilationUnit(), tree);<NEW_LINE>if (endPos == (-1) && tree.getKind() == Kind.ASSIGNMENT && getCurrentPath().getLeaf().getKind() == Kind.ANNOTATION) {<NEW_LINE>ExpressionTree value = ((AssignmentTree) tree).getExpression();<NEW_LINE>endPos = sourcePositions.getEndPosition(getCurrentPath().getCompilationUnit(), value);<NEW_LINE>}<NEW_LINE>if (sourcePositions.getStartPosition(getCurrentPath().getCompilationUnit(), tree) < pos && endPos >= pos) {<NEW_LINE>if (tree.getKind() == Tree.Kind.ERRONEOUS) {<NEW_LINE>tree.accept(this, p);<NEW_LINE>throw new Result(getCurrentPath());<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>throw new Result(new TreePath(getCurrentPath(), tree));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
super.scan(tree, p);
1,744,381
protected boolean checkValidityInPercentage(MoveTemplate moveTemplate) {<NEW_LINE>BigDecimal debitPercent = BigDecimal.ZERO;<NEW_LINE>BigDecimal creditPercent = BigDecimal.ZERO;<NEW_LINE>for (MoveTemplateLine line : moveTemplate.getMoveTemplateLineList()) {<NEW_LINE>LOG.debug(<MASK><NEW_LINE>if (MoveTemplateLineRepository.DEBIT.equals(line.getDebitCreditSelect())) {<NEW_LINE>debitPercent = debitPercent.add(line.getPercentage());<NEW_LINE>} else {<NEW_LINE>creditPercent = creditPercent.add(line.getPercentage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOG.debug("Debit percent: {}, Credit percent: {}", debitPercent, creditPercent);<NEW_LINE>if (debitPercent.compareTo(BigDecimal.ZERO) != 0 && creditPercent.compareTo(BigDecimal.ZERO) != 0 && debitPercent.compareTo(creditPercent) == 0) {<NEW_LINE>this.validateMoveTemplateLine(moveTemplate);<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
"Adding percent: {}", line.getPercentage());
1,414,321
private S internalTest(E event, C context) {<NEW_LINE>checkState(status != StateMachineStatus.ERROR && status != StateMachineStatus.TERMINATED, "Cannot test state machine under " + status + " status.");<NEW_LINE>S testResult = null;<NEW_LINE>queuedTestEvents.add(new Pair<E, <MASK><NEW_LINE>if (!isProcessingTestEvent) {<NEW_LINE>isProcessingTestEvent = true;<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>StateMachineData<T, S, E, C> cloneData = (StateMachineData<T, S, E, C>) dumpSavedData();<NEW_LINE>ActionExecutionService<T, S, E, C> dummyExecutor = getDummyExecutor();<NEW_LINE>if (getStatus() == StateMachineStatus.INITIALIZED) {<NEW_LINE>if (isAutoStartEnabled) {<NEW_LINE>internalStart(context, cloneData, dummyExecutor);<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("The state machine is not running.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Pair<E, C> eventInfo = null;<NEW_LINE>while ((eventInfo = queuedTestEvents.poll()) != null) {<NEW_LINE>E testEvent = eventInfo.first();<NEW_LINE>C testContext = eventInfo.second();<NEW_LINE>processEvent(testEvent, testContext, cloneData, dummyExecutor, false);<NEW_LINE>}<NEW_LINE>testResult = resolveState(cloneData.read().currentState(), cloneData);<NEW_LINE>} finally {<NEW_LINE>isProcessingTestEvent = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return testResult;<NEW_LINE>}
C>(event, context));
356,105
public void handleWindow(Window window, int eventID) {<NEW_LINE>final String MESSAGE_STUB = DIALOG_TITLE + " dialog; ";<NEW_LINE>final String INFO_MESSAGE = MESSAGE_STUB + "{}";<NEW_LINE>final String ERROR_MESSAGE = MESSAGE_STUB + "error: {}";<NEW_LINE>final String COULD_NOT_HANDLE_MESSAGE = MESSAGE_STUB + "could not handle because {}";<NEW_LINE>String setting = Settings.settings(<MASK><NEW_LINE>if (setting.equalsIgnoreCase("primary")) {<NEW_LINE>Utils.logToConsole(String.format(INFO_MESSAGE, "end the other session and continue this one"));<NEW_LINE>if (!SwingUtils.clickButton(window, "Disconnect Other Session")) {<NEW_LINE>Utils.logError(String.format(COULD_NOT_HANDLE_MESSAGE, "the 'Disconnect Other Session' button wasn't found."));<NEW_LINE>}<NEW_LINE>} else if (setting.equalsIgnoreCase("primaryoverride")) {<NEW_LINE>Utils.exitWithError(ErrorCodes.ERROR_CODE_INVALID_STATE, String.format(ERROR_MESSAGE, "ExistingSessionDetectedAction=primaryoverride"));<NEW_LINE>} else if (setting.equalsIgnoreCase("secondary")) {<NEW_LINE>Utils.exitWithError(ErrorCodes.ERROR_CODE_INVALID_STATE, String.format(ERROR_MESSAGE, "ExistingSessionDetectedAction=secondary"));<NEW_LINE>} else if (setting.equalsIgnoreCase("manual")) {<NEW_LINE>Utils.logToConsole(String.format(INFO_MESSAGE, "user must choose whether to continue with this session"));<NEW_LINE>// nothing to do<NEW_LINE>} else {<NEW_LINE>Utils.logError(String.format(COULD_NOT_HANDLE_MESSAGE, "the 'ExistingSessionDetectedAction' setting is invalid."));<NEW_LINE>}<NEW_LINE>}
).getString("ExistingSessionDetectedAction", "manual");
461,746
private Optional<ImportIssueInfo> buildImportIssueInfo(@NonNull final Issue issue, @NonNull final ImportIssuesRequest importIssuesRequest, @NonNull final HashMap<GithubIdSearchKey, String> seenExternalIdsByKey) {<NEW_LINE>final GithubIdSearchKey githubIdSearchKey = GithubIdSearchKey.builder().repository(importIssuesRequest.getRepoId()).repositoryOwner(importIssuesRequest.getRepoOwner()).issueNo(String.valueOf(issue.getNumber())).build();<NEW_LINE>if (seenExternalIdsByKey.put(githubIdSearchKey, issue.getId()) != null) {<NEW_LINE>// means it was already imported once in this process run so it will be skipped<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>final ImportIssueInfo.ImportIssueInfoBuilder importInfoBuilder = ImportIssueInfo.builder().externalProjectReferenceId(importIssuesRequest.getExternalProjectReferenceId()).externalProjectType(importIssuesRequest.getExternalProjectType()).externalIssueId(ExternalId.of(ExternalSystem.GITHUB, issue.getId())).externalIssueURL(issue.getHtmlUrl()).externalIssueNo(issue.getNumber()).name(issue.getTitle()).description(issue.getBody()).orgId(importIssuesRequest.getOrgId()).projectId(importIssuesRequest.getProjectId()).effortUomId(HOUR_UOM_ID);<NEW_LINE>if (issue.getGithubMilestone() != null) {<NEW_LINE>importInfoBuilder.milestone(buildMilestone(issue.getGithubMilestone(), importIssuesRequest.getOrgId()));<NEW_LINE>}<NEW_LINE>if (issue.getAssignee() != null) {<NEW_LINE>importInfoBuilder.assigneeId(getUserIdByExternalId(importIssuesRequest.getOrgId(), issue.getAssignee().getId()));<NEW_LINE>}<NEW_LINE>processLabels(issue.getLabelList(), importInfoBuilder, importIssuesRequest.getOrgId());<NEW_LINE>if (ResourceState.CLOSED.getValue().equals(issue.getState())) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>lookForParentIssue(importIssuesRequest, importInfoBuilder, seenExternalIdsByKey, issue.getBody());<NEW_LINE>return Optional.of(importInfoBuilder.build());<NEW_LINE>}
importInfoBuilder.status(Status.CLOSED);
803,904
public void relocate(ElfRelocationContext elfRelocationContext, ElfRelocation relocation, Address relocationAddress) throws MemoryAccessException, NotFoundException {<NEW_LINE>ElfHeader elf = elfRelocationContext.getElfHeader();<NEW_LINE>if (elf.e_machine() != ElfConstants.EM_MIPS) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MIPS_ElfRelocationContext mipsRelocationContext = (MIPS_ElfRelocationContext) elfRelocationContext;<NEW_LINE>mipsRelocationContext.lastSymbolAddr = null;<NEW_LINE><MASK><NEW_LINE>int symbolIndex = relocation.getSymbolIndex();<NEW_LINE>boolean saveValueForNextReloc = mipsRelocationContext.nextRelocationHasSameOffset(relocation);<NEW_LINE>if (elf.is64Bit()) {<NEW_LINE>// Each relocation can pack upto 3 relocations for 64-bit<NEW_LINE>for (int n = 0; n < 3; n++) {<NEW_LINE>int relocType = type & 0xff;<NEW_LINE>type >>= 8;<NEW_LINE>int nextRelocType = (n < 2) ? (type & 0xff) : 0;<NEW_LINE>doRelocate(mipsRelocationContext, relocType, symbolIndex, relocation, relocationAddress, nextRelocType != MIPS_ElfRelocationConstants.R_MIPS_NONE || saveValueForNextReloc);<NEW_LINE>// set to STN_UNDEF(0) once symbol used by first relocation<NEW_LINE>symbolIndex = 0;<NEW_LINE>if (nextRelocType == MIPS_ElfRelocationConstants.R_MIPS_NONE) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>doRelocate(mipsRelocationContext, type, symbolIndex, relocation, relocationAddress, saveValueForNextReloc);<NEW_LINE>}<NEW_LINE>}
int type = relocation.getType();
1,494,921
public static Boolean writeCsvFile(SessionDataSet sessionDataSet, String filePath) throws IOException, IoTDBConnectionException, StatementExecutionException {<NEW_LINE>CSVPrinter printer = CSVFormat.Builder.create(CSVFormat.DEFAULT).setHeader().setSkipHeaderRecord(true).setEscape('\\').setQuoteMode(QuoteMode.NONE).build().print(new PrintWriter(filePath));<NEW_LINE>List<Object> headers = new ArrayList<>();<NEW_LINE>List<String> names = sessionDataSet.getColumnNames();<NEW_LINE>List<String> types = sessionDataSet.getColumnTypes();<NEW_LINE>if (needDataTypePrinted) {<NEW_LINE>for (int i = 0; i < names.size(); i++) {<NEW_LINE>if (!"Time".equals(names.get(i)) && !"Device".equals(names.get(i))) {<NEW_LINE>headers.add(String.format("%s(%s)", names.get(i), types.get(i)));<NEW_LINE>} else {<NEW_LINE>headers.add<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>headers.addAll(names);<NEW_LINE>}<NEW_LINE>printer.printRecord(headers);<NEW_LINE>while (sessionDataSet.hasNext()) {<NEW_LINE>RowRecord rowRecord = sessionDataSet.next();<NEW_LINE>ArrayList<String> record = new ArrayList<>();<NEW_LINE>if (rowRecord.getTimestamp() != 0) {<NEW_LINE>record.add(timeTrans(rowRecord.getTimestamp()));<NEW_LINE>}<NEW_LINE>rowRecord.getFields().forEach(field -> {<NEW_LINE>String fieldStringValue = field.getStringValue();<NEW_LINE>if (!"null".equals(field.getStringValue())) {<NEW_LINE>if (field.getDataType() == TSDataType.TEXT && !fieldStringValue.startsWith("root.")) {<NEW_LINE>fieldStringValue = "\"" + fieldStringValue + "\"";<NEW_LINE>}<NEW_LINE>record.add(fieldStringValue);<NEW_LINE>} else {<NEW_LINE>record.add("");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>printer.printRecord(record);<NEW_LINE>}<NEW_LINE>printer.flush();<NEW_LINE>printer.close();<NEW_LINE>return true;<NEW_LINE>}
(names.get(i));
1,508,407
public static JCExpression unbox(Types types, TreeMaker make, Names names, Context context, CompilationUnitTree compUnit, JCExpression tree, Type primitive) {<NEW_LINE>Type unboxedType = <MASK><NEW_LINE>if (unboxedType.hasTag(NONE)) {<NEW_LINE>unboxedType = primitive;<NEW_LINE>if (!unboxedType.isPrimitive()) {<NEW_LINE>throw new AssertionError(unboxedType);<NEW_LINE>}<NEW_LINE>make.at(tree.pos());<NEW_LINE>tree = make.TypeCast(types.boxedClass(unboxedType).type, tree);<NEW_LINE>} else {<NEW_LINE>// There must be a conversion from unboxedType to primitive.<NEW_LINE>if (!types.isSubtype(unboxedType, primitive)) {<NEW_LINE>throw new AssertionError(tree);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>make.at(tree.pos());<NEW_LINE>Symbol valueSym = // x.intValue()<NEW_LINE>resolveMethod(// x.intValue()<NEW_LINE>tree.pos(), // x.intValue()<NEW_LINE>context, // x.intValue()<NEW_LINE>(JCTree.JCCompilationUnit) compUnit, unboxedType.tsym.name.append(names.Value), tree.type, List.<Type>nil());<NEW_LINE>return make.App(make.Select(tree, valueSym));<NEW_LINE>}
types.unboxedType(tree.type);
1,486,808
public String format(final String input) {<NEW_LINE>Objects.requireNonNull(input);<NEW_LINE>if (regex == null || replacement == null) {<NEW_LINE>return input;<NEW_LINE>}<NEW_LINE>Matcher escapedOpeningCurlyBrace = ESCAPED_OPENING_CURLY_BRACE.matcher(input);<NEW_LINE>String <MASK><NEW_LINE>Matcher escapedClosingCurlyBrace = ESCAPED_CLOSING_CURLY_BRACE.matcher(inputWithPlaceholder);<NEW_LINE>inputWithPlaceholder = escapedClosingCurlyBrace.replaceAll(PLACEHOLDER_FOR_CLOSING_CURLY_BRACE);<NEW_LINE>final String regexMatchesReplaced = replaceHonoringProtectedGroups(inputWithPlaceholder);<NEW_LINE>return regexMatchesReplaced.replaceAll(PLACEHOLDER_FOR_OPENING_CURLY_BRACE, "\\\\{").replaceAll(PLACEHOLDER_FOR_CLOSING_CURLY_BRACE, "\\\\}");<NEW_LINE>}
inputWithPlaceholder = escapedOpeningCurlyBrace.replaceAll(PLACEHOLDER_FOR_OPENING_CURLY_BRACE);
91,675
public Set<Veto> filter(UnusedResource resource, ResourceRequest request) {<NEW_LINE>// Apply veto filtering rules from higher to lower score making sure we cut over and return<NEW_LINE>// early any time a veto from a score group is applied. This helps to more accurately report<NEW_LINE>// a veto reason in the NearestFit.<NEW_LINE>// 1. Dedicated constraint check (highest score).<NEW_LINE>if (!ConfigurationManager.isDedicated(request.getConstraints()) && isDedicated(resource.getAttributes())) {<NEW_LINE>return ImmutableSet.of(Veto.dedicatedHostConstraintMismatch());<NEW_LINE>}<NEW_LINE>// 2. Host maintenance check.<NEW_LINE>Optional<Veto> maintenanceVeto = getAuroraMaintenanceVeto(resource.getAttributes().getMode());<NEW_LINE>if (maintenanceVeto.isPresent()) {<NEW_LINE>return ImmutableSet.<MASK><NEW_LINE>}<NEW_LINE>Optional<Veto> mesosMaintenanceVeto = getMesosMaintenanceVeto(resource.getUnavailabilityStart());<NEW_LINE>if (mesosMaintenanceVeto.isPresent()) {<NEW_LINE>return ImmutableSet.of(mesosMaintenanceVeto.get());<NEW_LINE>}<NEW_LINE>// 3. Value and limit constraint check.<NEW_LINE>Optional<Veto> constraintVeto = getConstraintVeto(request.getConstraints(), request.getJobState(), resource.getAttributes().getAttributes());<NEW_LINE>if (constraintVeto.isPresent()) {<NEW_LINE>return ImmutableSet.of(constraintVeto.get());<NEW_LINE>}<NEW_LINE>// 4. Resource check (lowest score).<NEW_LINE>return getResourceVetoes(resource.getResourceBag(), request.getResourceBag());<NEW_LINE>}
of(maintenanceVeto.get());
199,744
private static SegmentGenerationJobSpec generateSegmentUploadSpec(String tableName, BatchConfig batchConfig, @Nullable AuthContext authContext) {<NEW_LINE>TableSpec tableSpec = new TableSpec();<NEW_LINE>tableSpec.setTableName(tableName);<NEW_LINE>PinotClusterSpec pinotClusterSpec = new PinotClusterSpec();<NEW_LINE>pinotClusterSpec.setControllerURI(batchConfig.getPushControllerURI());<NEW_LINE>PinotClusterSpec[] pinotClusterSpecs <MASK><NEW_LINE>PushJobSpec pushJobSpec = new PushJobSpec();<NEW_LINE>pushJobSpec.setPushAttempts(batchConfig.getPushAttempts());<NEW_LINE>pushJobSpec.setPushParallelism(batchConfig.getPushParallelism());<NEW_LINE>pushJobSpec.setPushRetryIntervalMillis(batchConfig.getPushIntervalRetryMillis());<NEW_LINE>pushJobSpec.setSegmentUriPrefix(batchConfig.getPushSegmentURIPrefix());<NEW_LINE>pushJobSpec.setSegmentUriSuffix(batchConfig.getPushSegmentURISuffix());<NEW_LINE>SegmentGenerationJobSpec spec = new SegmentGenerationJobSpec();<NEW_LINE>spec.setPushJobSpec(pushJobSpec);<NEW_LINE>spec.setTableSpec(tableSpec);<NEW_LINE>spec.setPinotClusterSpecs(pinotClusterSpecs);<NEW_LINE>if (authContext != null && StringUtils.isNotBlank(authContext.getAuthToken())) {<NEW_LINE>spec.setAuthToken(authContext.getAuthToken());<NEW_LINE>}<NEW_LINE>return spec;<NEW_LINE>}
= new PinotClusterSpec[] { pinotClusterSpec };
1,140,494
public static void main(String[] args) {<NEW_LINE>Loader.loadNativeLibraries();<NEW_LINE>// [START solver]<NEW_LINE>// Create the linear solver with the GLOP backend.<NEW_LINE>MPSolver solver = MPSolver.createSolver("GLOP");<NEW_LINE>if (solver == null) {<NEW_LINE>System.out.println("Could not create solver SCIP");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// [END solver]<NEW_LINE>// [START variables]<NEW_LINE>double infinity = java.lang.Double.POSITIVE_INFINITY;<NEW_LINE>// Create the variables x and y.<NEW_LINE>MPVariable x = solver.makeNumVar(0.0, infinity, "x");<NEW_LINE>MPVariable y = solver.makeNumVar(0.0, infinity, "y");<NEW_LINE>System.out.println("Number of variables = " + solver.numVariables());<NEW_LINE>// [END variables]<NEW_LINE>// [START constraints]<NEW_LINE>// x + 7 * y <= 17.5.<NEW_LINE>MPConstraint c0 = solver.makeConstraint(-infinity, 17.5, "c0");<NEW_LINE>c0.setCoefficient(x, 1);<NEW_LINE>c0.setCoefficient(y, 7);<NEW_LINE>// x <= 3.5.<NEW_LINE>MPConstraint c1 = solver.makeConstraint(-infinity, 3.5, "c1");<NEW_LINE>c1.setCoefficient(x, 1);<NEW_LINE>c1.setCoefficient(y, 0);<NEW_LINE>System.out.println("Number of constraints = " + solver.numConstraints());<NEW_LINE>// [END constraints]<NEW_LINE>// [START objective]<NEW_LINE>// Maximize x + 10 * y.<NEW_LINE>MPObjective objective = solver.objective();<NEW_LINE>objective.setCoefficient(x, 1);<NEW_LINE>objective.setCoefficient(y, 10);<NEW_LINE>objective.setMaximization();<NEW_LINE>// [END objective]<NEW_LINE>// [START solve]<NEW_LINE>final MPSolver.ResultStatus resultStatus = solver.solve();<NEW_LINE>// [END solve]<NEW_LINE>// [START print_solution]<NEW_LINE>if (resultStatus == MPSolver.ResultStatus.OPTIMAL) {<NEW_LINE>System.out.println("Solution:");<NEW_LINE>System.out.println("Objective value = " + objective.value());<NEW_LINE>System.out.println(<MASK><NEW_LINE>System.out.println("y = " + y.solutionValue());<NEW_LINE>} else {<NEW_LINE>System.err.println("The problem does not have an optimal solution!");<NEW_LINE>}<NEW_LINE>// [END print_solution]<NEW_LINE>// [START advanced]<NEW_LINE>System.out.println("\nAdvanced usage:");<NEW_LINE>System.out.println("Problem solved in " + solver.wallTime() + " milliseconds");<NEW_LINE>System.out.println("Problem solved in " + solver.iterations() + " iterations");<NEW_LINE>// [END advanced]<NEW_LINE>}
"x = " + x.solutionValue());