idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,679,257
public void showFrame() {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>editorAntialiasBox.setSelected(Preferences.getBoolean("editor.smooth"));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>inputMethodBox.setSelected(Preferences.getBoolean("editor.input_method_support"));<NEW_LINE>errorCheckerBox.setSelected(Preferences.getBoolean("pdex.errorCheckEnabled"));<NEW_LINE>warningsCheckerBox.setSelected(Preferences.getBoolean("pdex.warningsEnabled"));<NEW_LINE>warningsCheckerBox.setEnabled(errorCheckerBox.isSelected());<NEW_LINE>codeCompletionBox.setSelected(Preferences.getBoolean("pdex.completion"));<NEW_LINE>// codeCompletionTriggerBox.setSelected(Preferences.getBoolean("pdex.completion.trigger"));<NEW_LINE>// codeCompletionTriggerBox.setEnabled(codeCompletionBox.isSelected());<NEW_LINE>importSuggestionsBox.setSelected(Preferences.getBoolean("pdex.suggest.imports"));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>deletePreviousBox.setSelected(Preferences.getBoolean("export.delete_target_folder"));<NEW_LINE>sketchbookLocationField.setText(Preferences.getSketchbookPath());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>checkUpdatesBox.setSelected(Preferences.getBoolean("update.check"));<NEW_LINE>int defaultDisplayNum = updateDisplayList();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>int displayNum = Preferences.getInteger("run.display");<NEW_LINE>// if (displayNum > 0 && displayNum <= displayCount) {<NEW_LINE>if (displayNum < 1 || displayNum > displayCount) {<NEW_LINE>displayNum = defaultDisplayNum;<NEW_LINE>Preferences.setInteger("run.display", displayNum);<NEW_LINE>}<NEW_LINE>displaySelectionBox.setSelectedIndex(displayNum - 1);<NEW_LINE>// This takes a while to load, so run it from a separate thread<NEW_LINE>// EventQueue.invokeLater(new Runnable() {<NEW_LINE>new Thread(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>initFontList();<NEW_LINE>}<NEW_LINE>}).start();<NEW_LINE>fontSizeField.setSelectedItem(Preferences.getInteger("editor.font.size"));<NEW_LINE>consoleFontSizeField.setSelectedItem(Preferences.getInteger("console.font.size"));<NEW_LINE>boolean zoomAuto = Preferences.getBoolean("editor.zoom.auto");<NEW_LINE>if (zoomAuto) {<NEW_LINE>zoomAutoBox.setSelected(zoomAuto);<NEW_LINE>zoomSelectionBox.setEnabled(!zoomAuto);<NEW_LINE>}<NEW_LINE>String zoomSel = Preferences.get("editor.zoom");<NEW_LINE>int zoomIndex = Toolkit.zoomOptions.index(zoomSel);<NEW_LINE>if (zoomIndex != -1) {<NEW_LINE>zoomSelectionBox.setSelectedIndex(zoomIndex);<NEW_LINE>} else {<NEW_LINE>zoomSelectionBox.setSelectedIndex(0);<NEW_LINE>}<NEW_LINE>presentColor.setBackground(Preferences.getColor("run.present.bgcolor"));<NEW_LINE>presentColorHex.setText(Preferences.get("run.present.bgcolor").substring(1));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>memoryOverrideBox.// $NON-NLS-1$<NEW_LINE>setSelected<MASK><NEW_LINE>// $NON-NLS-1$<NEW_LINE>memoryField.// $NON-NLS-1$<NEW_LINE>setText(Preferences.get("run.options.memory.maximum"));<NEW_LINE>memoryField.setEnabled(memoryOverrideBox.isSelected());<NEW_LINE>if (autoAssociateBox != null) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>autoAssociateBox.setSelected(Preferences.getBoolean("platform.auto_file_type_associations"));<NEW_LINE>}<NEW_LINE>// The OK Button has to be set as the default button every time the<NEW_LINE>// PrefWindow is to be displayed<NEW_LINE>frame.getRootPane().setDefaultButton(okButton);<NEW_LINE>// The pack is called again here second time to fix layout bugs<NEW_LINE>// the bugs are not due to groupLayout but due to HTML rendering of components<NEW_LINE>// more info can be found here -> https://netbeans.org/bugzilla/show_bug.cgi?id=79967<NEW_LINE>frame.pack();<NEW_LINE>frame.setVisible(true);<NEW_LINE>}
(Preferences.getBoolean("run.options.memory"));
676,551
private void createVPM(final OAtomicOperation atomicOperation) throws IOException {<NEW_LINE>fileId = addFile(atomicOperation, getFullName());<NEW_LINE>final int sizeOfIntInBytes = Integer.SIZE / 8;<NEW_LINE>numberOfPages = (int) Math.ceil((DEFAULT_VERSION_ARRAY_SIZE * sizeOfIntInBytes * 1.0) / OVersionPage.PAGE_SIZE);<NEW_LINE>final long <MASK><NEW_LINE>OLogManager.instance().debug(this, "VPM created with fileId:%s: fileName = %s, expected #pages = %d, actual #pages = %d", fileId, getFullName(), numberOfPages, foundNumberOfPages);<NEW_LINE>if (foundNumberOfPages != numberOfPages) {<NEW_LINE>for (int i = 0; i < numberOfPages; i++) {<NEW_LINE>addInitializedPage(atomicOperation);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final OCacheEntry cacheEntry = loadPageForWrite(atomicOperation, fileId, 0, false, false);<NEW_LINE>try {<NEW_LINE>final MapEntryPoint mapEntryPoint = new MapEntryPoint(cacheEntry);<NEW_LINE>mapEntryPoint.setFileSize(0);<NEW_LINE>} finally {<NEW_LINE>releasePageFromWrite(atomicOperation, cacheEntry);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
foundNumberOfPages = getFilledUpTo(atomicOperation, fileId);
710,346
private static Node superTypeHierarchy(@NonNull final DeclaredType type, @NonNull final ClasspathInfo cpInfo, @NonNull final HierarchyFilters filters, final int order) {<NEW_LINE>final TypeElement element = (TypeElement) type.asElement();<NEW_LINE>final TypeMirror superClass = element.getSuperclass();<NEW_LINE>final List<? extends TypeMirror<MASK><NEW_LINE>final List<Node> childNodes = new ArrayList<Node>(interfaces.size() + 1);<NEW_LINE>int childOrder = 0;<NEW_LINE>if (superClass.getKind() != TypeKind.NONE) {<NEW_LINE>childNodes.add(superTypeHierarchy((DeclaredType) superClass, cpInfo, filters, childOrder));<NEW_LINE>}<NEW_LINE>for (TypeMirror superInterface : interfaces) {<NEW_LINE>childOrder++;<NEW_LINE>childNodes.add(superTypeHierarchy((DeclaredType) superInterface, cpInfo, filters, childOrder));<NEW_LINE>}<NEW_LINE>final Children cld;<NEW_LINE>if (childNodes.isEmpty()) {<NEW_LINE>cld = Children.LEAF;<NEW_LINE>} else {<NEW_LINE>cld = new SuperTypeChildren(filters);<NEW_LINE>cld.add(childNodes.toArray(new Node[childNodes.size()]));<NEW_LINE>}<NEW_LINE>return new TypeNode(cld, new Description(cpInfo, ElementHandle.create(element), order), filters, globalActions(filters));<NEW_LINE>}
> interfaces = element.getInterfaces();
1,380,227
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>View v = inflater.inflate(R.layout.layout_drawlines, null);<NEW_LINE>btnRotateLeft = v.findViewById(R.id.btnRotateLeft);<NEW_LINE>btnRotateRight = v.<MASK><NEW_LINE>btnRotateRight.setOnClickListener(this);<NEW_LINE>btnRotateLeft.setOnClickListener(this);<NEW_LINE>textViewCurrentLocation = v.findViewById(R.id.textViewCurrentLocation);<NEW_LINE>mMapView = v.findViewById(R.id.mapview);<NEW_LINE>mMapView.setMapListener(new MapListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onScroll(ScrollEvent event) {<NEW_LINE>Log.i(IMapView.LOGTAG, System.currentTimeMillis() + " onScroll " + event.getX() + "," + event.getY());<NEW_LINE>// Toast.makeText(getActivity(), "onScroll", Toast.LENGTH_SHORT).show();<NEW_LINE>updateInfo();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onZoom(ZoomEvent event) {<NEW_LINE>Log.i(IMapView.LOGTAG, System.currentTimeMillis() + " onZoom " + event.getZoomLevel());<NEW_LINE>updateInfo();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>RotationGestureOverlay mRotationGestureOverlay = new RotationGestureOverlay(mMapView);<NEW_LINE>mRotationGestureOverlay.setEnabled(true);<NEW_LINE>mMapView.setMultiTouchControls(true);<NEW_LINE>mMapView.getOverlayManager().add(mRotationGestureOverlay);<NEW_LINE>mMapView.setOnLongClickListener(this);<NEW_LINE>panning = v.findViewById(R.id.enablePanning);<NEW_LINE>panning.setVisibility(View.GONE);<NEW_LINE>painting = v.findViewById(R.id.enablePainting);<NEW_LINE>painting.setVisibility(View.GONE);<NEW_LINE>IconPlottingOverlay plotter = new IconPlottingOverlay(this.getResources().getDrawable(R.drawable.ic_follow_me_on));<NEW_LINE>mMapView.getOverlayManager().add(plotter);<NEW_LINE>return v;<NEW_LINE>}
findViewById(R.id.btnRotateRight);
42,280
private static void queryCaches(XmlGenerator gen, Map<String, Map<String, QueryCacheConfig>> queryCaches) {<NEW_LINE>if (queryCaches.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>gen.open("query-caches");<NEW_LINE>for (Map.Entry<String, Map<String, QueryCacheConfig>> entry : queryCaches.entrySet()) {<NEW_LINE><MASK><NEW_LINE>Map<String, QueryCacheConfig> queryCachesPerMap = entry.getValue();<NEW_LINE>for (QueryCacheConfig queryCache : queryCachesPerMap.values()) {<NEW_LINE>EvictionConfig evictionConfig = queryCache.getEvictionConfig();<NEW_LINE>gen.open("query-cache", "mapName", mapName, "name", queryCache.getName()).node("include-value", queryCache.isIncludeValue()).node("in-memory-format", queryCache.getInMemoryFormat()).node("populate", queryCache.isPopulate()).node("coalesce", queryCache.isCoalesce()).node("delay-seconds", queryCache.getDelaySeconds()).node("batch-size", queryCache.getBatchSize()).node("serialize-keys", queryCache.isSerializeKeys()).node("buffer-size", queryCache.getBufferSize()).node("eviction", null, "size", evictionConfig.getSize(), "max-size-policy", evictionConfig.getMaxSizePolicy(), "eviction-policy", evictionConfig.getEvictionPolicy(), "comparator-class-name", classNameOrImplClass(evictionConfig.getComparatorClassName(), evictionConfig.getComparator()));<NEW_LINE>queryCachePredicate(gen, queryCache.getPredicateConfig());<NEW_LINE>entryListeners(gen, queryCache.getEntryListenerConfigs());<NEW_LINE>IndexUtils.generateXml(gen, queryCache.getIndexConfigs());<NEW_LINE>// close query-cache<NEW_LINE>gen.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// close query-caches<NEW_LINE>gen.close();<NEW_LINE>}
String mapName = entry.getKey();
1,492,113
public void processTimeEvent(long timeEventTime) {<NEW_LINE>if (!specification.isEnableMetricsReporting()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>schedule.setTime(timeEventTime);<NEW_LINE>if (!isScheduled) {<NEW_LINE>if (executionContext != null) {<NEW_LINE>scheduleExecutions();<NEW_LINE>isScheduled = true;<NEW_LINE>} else {<NEW_LINE>// not initialized yet, race condition and must wait till initialized<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// fast evaluation against nearest scheduled time<NEW_LINE>Long nearestTime = schedule.getNearestTime();<NEW_LINE>if ((nearestTime == null) || (nearestTime > timeEventTime)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// get executions<NEW_LINE>List<MetricExec> executions = new ArrayList<MetricExec>(2);<NEW_LINE>schedule.evaluate(executions);<NEW_LINE>if (executions.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// execute<NEW_LINE>if (executionContext == null) {<NEW_LINE>log.debug(".processTimeEvent No execution context");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (MetricExec execution : executions) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
metricsExecutor.execute(execution, executionContext);
1,507,832
protected void createSocksGroup(Composite parent) {<NEW_LINE>final Composite composite = UIUtils.createControlGroup(parent, "SOCKS", 4, GridData.FILL_HORIZONTAL, SWT.DEFAULT);<NEW_LINE>// $NON-NLS-2$<NEW_LINE>hostText = UIUtils.createLabelText(<MASK><NEW_LINE>hostText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));<NEW_LINE>portText = UIUtils.createLabelSpinner(composite, UIConnectionMessages.dialog_connection_network_socket_label_port, SocksConstants.DEFAULT_SOCKS_PORT, 0, 65535);<NEW_LINE>GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);<NEW_LINE>gd.widthHint = UIUtils.getFontHeight(portText) * 7;<NEW_LINE>portText.setLayoutData(gd);<NEW_LINE>// $NON-NLS-2$<NEW_LINE>userNameText = UIUtils.createLabelText(composite, UIConnectionMessages.dialog_connection_network_socket_label_username, null);<NEW_LINE>userNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));<NEW_LINE>// $NON-NLS-2$<NEW_LINE>passwordText = UIUtils.createLabelText(composite, UIConnectionMessages.dialog_connection_network_socket_label_password, "", SWT.BORDER | SWT.PASSWORD);<NEW_LINE>UIUtils.createEmptyLabel(composite, 1, 1);<NEW_LINE>savePasswordCheckbox = UIUtils.createCheckbox(composite, UIConnectionMessages.dialog_connection_auth_checkbox_save_password, false);<NEW_LINE>UIUtils.createLink(parent, UIConnectionMessages.dialog_connection_open_global_network_preferences_link, new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(UIUtils.getActiveWorkbenchShell(), NETWORK_PREF_PAGE_ID, null, null);<NEW_LINE>dialog.open();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
composite, UIConnectionMessages.dialog_connection_network_socket_label_host, null);
1,447,881
protected void createRemotePack(final AttachSettings settings) {<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>JFileChooser chooser = new JFileChooser();<NEW_LINE>// NOI18N<NEW_LINE>File tmpDir = new File(System.getProperty("java.io.tmpdir"));<NEW_LINE>chooser.<MASK><NEW_LINE>chooser.setAcceptAllFileFilterUsed(false);<NEW_LINE>chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);<NEW_LINE>chooser.setSelectedFile(tmpDir);<NEW_LINE>chooser.setCurrentDirectory(tmpDir);<NEW_LINE>chooser.setMultiSelectionEnabled(false);<NEW_LINE>if ((JFileChooser.CANCEL_OPTION & chooser.showSaveDialog(chooser)) == 0) {<NEW_LINE>final String path = chooser.getSelectedFile().getAbsolutePath();<NEW_LINE>final String jdkF = currentJDK;<NEW_LINE>RequestProcessor.getDefault().post(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>String packPath = exportRemotePack(path, settings, jdkF);<NEW_LINE>ProfilerDialogs.displayInfo(Bundle.AttachDialog_RemotePackSaved(packPath));<NEW_LINE>} catch (IOException ex) {<NEW_LINE>// NOI18N<NEW_LINE>System.err.println("Exception creating remote pack: " + ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
setDialogTitle(Bundle.AttachDialog_RemotePackDialogCaption());
950,460
private Object readValue(ByteBuf buf, int sensorType) {<NEW_LINE>switch(sensorType) {<NEW_LINE>case 0:<NEW_LINE>return false;<NEW_LINE>case 1:<NEW_LINE>return true;<NEW_LINE>case 3:<NEW_LINE>return 0;<NEW_LINE>case 4:<NEW_LINE>return buf.readUnsignedByte();<NEW_LINE>case 5:<NEW_LINE>return buf.readUnsignedShortLE();<NEW_LINE>case 6:<NEW_LINE>return buf.readUnsignedIntLE();<NEW_LINE>case 7:<NEW_LINE>case 11:<NEW_LINE>return buf.readLongLE();<NEW_LINE>case 8:<NEW_LINE>return buf.readByte();<NEW_LINE>case 9:<NEW_LINE>return buf.readShortLE();<NEW_LINE>case 10:<NEW_LINE>return buf.readIntLE();<NEW_LINE>case 12:<NEW_LINE>return buf.readFloatLE();<NEW_LINE>case 13:<NEW_LINE>return buf.readDoubleLE();<NEW_LINE>case 32:<NEW_LINE>return buf.readCharSequence(buf.readUnsignedByte(), <MASK><NEW_LINE>case 33:<NEW_LINE>return ByteBufUtil.hexDump(buf.readSlice(buf.readUnsignedByte()));<NEW_LINE>case 64:<NEW_LINE>return buf.readCharSequence(buf.readUnsignedShortLE(), StandardCharsets.US_ASCII).toString();<NEW_LINE>case 65:<NEW_LINE>return ByteBufUtil.hexDump(buf.readSlice(buf.readUnsignedShortLE()));<NEW_LINE>case 2:<NEW_LINE>default:<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
StandardCharsets.US_ASCII).toString();
708,963
private int querySkuDetails(String itemType, Inventory inv, List<String> moreSkus) throws RemoteException, JSONException {<NEW_LINE>logDebug("Querying SKU details.");<NEW_LINE>ArrayList<String> skuList = new ArrayList<>(inv.getAllOwnedSkus(itemType));<NEW_LINE>if (moreSkus != null) {<NEW_LINE>for (String sku : moreSkus) {<NEW_LINE>if (!skuList.contains(sku)) {<NEW_LINE>skuList.add(sku);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (skuList.isEmpty()) {<NEW_LINE>logDebug("queryPrices: nothing to do because there are no SKUs.");<NEW_LINE>return BILLING_RESPONSE_RESULT_OK;<NEW_LINE>}<NEW_LINE>Bundle querySkus = new Bundle();<NEW_LINE>querySkus.putStringArrayList(GET_SKU_DETAILS_ITEM_LIST, skuList);<NEW_LINE>Bundle skuDetails = mService.getSkuDetails(3, "me.ccrama.redditslide", itemType, querySkus);<NEW_LINE>if (!skuDetails.containsKey(RESPONSE_GET_SKU_DETAILS_LIST)) {<NEW_LINE>int response = getResponseCodeFromBundle(skuDetails);<NEW_LINE>if (response != BILLING_RESPONSE_RESULT_OK) {<NEW_LINE>logDebug("getSkuDetails() failed: " + getResponseDesc(response));<NEW_LINE>return response;<NEW_LINE>} else {<NEW_LINE>logError("getSkuDetails() returned a bundle with neither an error nor a detail list.");<NEW_LINE>return IABHELPER_BAD_RESPONSE;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<String> responseList = skuDetails.getStringArrayList(RESPONSE_GET_SKU_DETAILS_LIST);<NEW_LINE>for (String thisResponse : responseList) {<NEW_LINE>SkuDetails d <MASK><NEW_LINE>logDebug("Got sku details: " + d);<NEW_LINE>inv.addSkuDetails(d);<NEW_LINE>}<NEW_LINE>return BILLING_RESPONSE_RESULT_OK;<NEW_LINE>}
= new SkuDetails(itemType, thisResponse);
318,001
public Object configure(String json) throws IOException {<NEW_LINE>IDHCPService dhcpService = (IDHCPService) getContext().getAttributes().get(IDHCPService.class.getCanonicalName());<NEW_LINE>if (json == null) {<NEW_LINE>setStatus(org.restlet.data.Status.CLIENT_ERROR_BAD_REQUEST, "One or more required fields missing.");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>JsonNode jsonNode = new ObjectMapper().readTree(json);<NEW_LINE>JsonNode enableNode = jsonNode.get("enable");<NEW_LINE>JsonNode <MASK><NEW_LINE>JsonNode dynamicLeaseNode = jsonNode.get("dynamic-lease");<NEW_LINE>if (enableNode == null || leaseGCPeriodNode == null || dynamicLeaseNode == null) {<NEW_LINE>setStatus(Status.CLIENT_ERROR_BAD_REQUEST, "One or more required fields missing.");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (enableNode.asBoolean()) {<NEW_LINE>dhcpService.enableDHCP();<NEW_LINE>dhcpService.setCheckExpiredLeasePeriod(leaseGCPeriodNode.asLong());<NEW_LINE>} else<NEW_LINE>dhcpService.disableDHCP();<NEW_LINE>if (dynamicLeaseNode.asBoolean()) {<NEW_LINE>dhcpService.enableDHCPDynamic();<NEW_LINE>} else {<NEW_LINE>dhcpService.disableDHCDynamic();<NEW_LINE>}<NEW_LINE>return getConfig();<NEW_LINE>}
leaseGCPeriodNode = jsonNode.get("lease-gc-period");
992,041
public ResponseEntity<Void> updateUserWithHttpInfo(String username, User body) throws RestClientException {<NEW_LINE>Object postBody = body;<NEW_LINE>// verify the required parameter 'username' is set<NEW_LINE>if (username == null) {<NEW_LINE>throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'username' when calling updateUser");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling updateUser");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>final Map<String, Object> uriVariables = new HashMap<String, Object>();<NEW_LINE>uriVariables.put("username", username);<NEW_LINE>String path = apiClient.expandPath("/user/{username}", uriVariables);<NEW_LINE>final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final HttpHeaders headerParams = new HttpHeaders();<NEW_LINE>final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final MultiValueMap formParams = new LinkedMultiValueMap();<NEW_LINE>final String[] accepts = {};<NEW_LINE>final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);<NEW_LINE>final String[] contentTypes = { "application/json" };<NEW_LINE>final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);<NEW_LINE>String[] <MASK><NEW_LINE>ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType);<NEW_LINE>}
authNames = new String[] {};
506,493
private List<OsmNodeNamed> readLonlats(final Bundle params) {<NEW_LINE>final List<OsmNodeNamed> wplist = new ArrayList<>();<NEW_LINE>final String lonLats = params.getString("lonlats");<NEW_LINE>if (lonLats == null) {<NEW_LINE>throw new IllegalArgumentException("lonlats parameter not set");<NEW_LINE>}<NEW_LINE>final String[] coords = lonLats.split("\\|");<NEW_LINE>if (coords.length < 2) {<NEW_LINE>throw new IllegalArgumentException("we need two lat/lon points at least!");<NEW_LINE>}<NEW_LINE>for (int i = 0; i < coords.length; i++) {<NEW_LINE>final String[] lonLat = coords[i].split(",");<NEW_LINE>if (lonLat.length < 2) {<NEW_LINE>throw new IllegalArgumentException("we need two lat/lon points at least!");<NEW_LINE>}<NEW_LINE>wplist.add(readPosition(lonLat[0], lonLat[1], "via" + i));<NEW_LINE>}<NEW_LINE>wplist.get(0).name = "from";<NEW_LINE>wplist.get(wplist.size(<MASK><NEW_LINE>return wplist;<NEW_LINE>}
) - 1).name = "to";
1,248,667
public IntermediateLayer constructIntermediateLayer(long queryId, UDTFPlan udtfPlan, RawQueryInputLayer rawTimeSeriesInputLayer, Map<Expression, IntermediateLayer> expressionIntermediateLayerMap, Map<Expression, TSDataType> expressionDataTypeMap, LayerMemoryAssigner memoryAssigner) throws QueryProcessException, IOException {<NEW_LINE>if (!expressionIntermediateLayerMap.containsKey(this)) {<NEW_LINE>float memoryBudgetInMB = memoryAssigner.assign();<NEW_LINE>IntermediateLayer parentLayerPointReader = expression.constructIntermediateLayer(queryId, udtfPlan, rawTimeSeriesInputLayer, expressionIntermediateLayerMap, expressionDataTypeMap, memoryAssigner);<NEW_LINE>Transformer transformer = new LogicNotTransformer(parentLayerPointReader.constructPointReader());<NEW_LINE>expressionDataTypeMap.put(this, transformer.getDataType());<NEW_LINE>// SingleInputColumnMultiReferenceIntermediateLayer doesn't support ConstantLayerPointReader<NEW_LINE>// yet. And since a ConstantLayerPointReader won't produce too much IO,<NEW_LINE>// SingleInputColumnSingleReferenceIntermediateLayer could be a better choice.<NEW_LINE>expressionIntermediateLayerMap.put(this, memoryAssigner.getReference(this) == 1 || isConstantOperand() ? new SingleInputColumnSingleReferenceIntermediateLayer(this, queryId, memoryBudgetInMB, transformer) : new SingleInputColumnMultiReferenceIntermediateLayer(this<MASK><NEW_LINE>}<NEW_LINE>return expressionIntermediateLayerMap.get(this);<NEW_LINE>}
, queryId, memoryBudgetInMB, transformer));
745,797
public void updateStatusTypes(List<StatusTypeFilter> statusTypes) {<NEW_LINE>if (this.statusTypeItems == null && statusTypes != null) {<NEW_LINE>statusTypeSeparator = new ViewHolderAdapter(FilterSeparatorView_.build(context).setText(context.getString(<MASK><NEW_LINE>statusTypeSeparator.setViewVisibility(statusTypes.isEmpty() ? View.GONE : View.VISIBLE);<NEW_LINE>addAdapter(statusTypeSeparator);<NEW_LINE>this.statusTypeItems = new FilterListItemAdapter(context, statusTypes);<NEW_LINE>addAdapter(statusTypeItems);<NEW_LINE>} else if (this.statusTypeItems != null && statusTypes != null) {<NEW_LINE>statusTypeSeparator.setViewVisibility(statusTypes.isEmpty() ? View.GONE : View.VISIBLE);<NEW_LINE>this.statusTypeItems.update(statusTypes);<NEW_LINE>} else {<NEW_LINE>statusTypeSeparator.setViewVisibility(View.GONE);<NEW_LINE>this.statusTypeItems.update(new ArrayList<>());<NEW_LINE>}<NEW_LINE>notifyDataSetChanged();<NEW_LINE>}
R.string.navigation_status)));
497,109
public void updateClient(String organizationId, String clientId, UpdateClientBean bean) throws ClientNotFoundException, NotAuthorizedException {<NEW_LINE>securityContext.checkPermissions(PermissionType.clientEdit, organizationId);<NEW_LINE>try {<NEW_LINE>storage.beginTx();<NEW_LINE>ClientBean clientForUpdate = getClientFromStorage(organizationId, clientId);<NEW_LINE>EntityUpdatedData auditData = new EntityUpdatedData();<NEW_LINE>if (AuditUtils.valueChanged(clientForUpdate.getDescription(), bean.getDescription())) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>auditData.addChange("description", clientForUpdate.getDescription(), bean.getDescription());<NEW_LINE>clientForUpdate.<MASK><NEW_LINE>}<NEW_LINE>storage.updateClient(clientForUpdate);<NEW_LINE>storage.createAuditEntry(AuditUtils.clientUpdated(clientForUpdate, auditData, securityContext));<NEW_LINE>storage.commitTx();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>log.debug(String.format("Updated client %s: %s", clientForUpdate.getName(), clientForUpdate));<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>}
setDescription(bean.getDescription());
1,036,272
void createDataChannel(String label, ConstraintsMap config, Result result) {<NEW_LINE>DataChannel.Init init = new DataChannel.Init();<NEW_LINE>if (config != null) {<NEW_LINE>if (config.hasKey("id")) {<NEW_LINE>init.id = config.getInt("id");<NEW_LINE>}<NEW_LINE>if (config.hasKey("ordered")) {<NEW_LINE>init.ordered = config.getBoolean("ordered");<NEW_LINE>}<NEW_LINE>if (config.hasKey("maxRetransmits")) {<NEW_LINE>init.maxRetransmits = config.getInt("maxRetransmits");<NEW_LINE>}<NEW_LINE>if (config.hasKey("protocol")) {<NEW_LINE>init.protocol = config.getString("protocol");<NEW_LINE>}<NEW_LINE>if (config.hasKey("negotiated")) {<NEW_LINE>init.negotiated = config.getBoolean("negotiated");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>DataChannel dataChannel = peerConnection.createDataChannel(label, init);<NEW_LINE>// XXX RTP data channels are not defined by the WebRTC standard, have<NEW_LINE>// been deprecated in Chromium, and Google have decided (in 2015) to no<NEW_LINE>// longer support them (in the face of multiple reported issues of<NEW_LINE>// breakages).<NEW_LINE>int dataChannelId = init.id;<NEW_LINE>if (dataChannel != null && -1 != dataChannelId) {<NEW_LINE>dataChannels.put(dataChannelId, dataChannel);<NEW_LINE>registerDataChannelObserver(dataChannelId, dataChannel);<NEW_LINE>ConstraintsMap params = new ConstraintsMap();<NEW_LINE>params.putInt("id", dataChannelId);<NEW_LINE>params.putString("label", dataChannel.label());<NEW_LINE>result.<MASK><NEW_LINE>} else {<NEW_LINE>resultError("createDataChannel", "Can't create data-channel for id: " + dataChannelId, result);<NEW_LINE>}<NEW_LINE>}
success(params.toMap());
1,340,417
public TreePath findNextPathElement(final TreePath irParentPath, final String isName, final int inIndex) {<NEW_LINE>if (!isExpanded(irParentPath)) {<NEW_LINE>expandPath(irParentPath);<NEW_LINE>}<NEW_LINE>TreePath lrTreePath;<NEW_LINE>Timeouts lrTimes <MASK><NEW_LINE>// behavior should be similar to JTreeOperator, so we can use its timeout values<NEW_LINE>lrTimes.setTimeout("Waiter.WaitingTime", getTimeouts().getTimeout("JTreeOperator.WaitNextNodeTimeout"));<NEW_LINE>try {<NEW_LINE>Waiter lrWaiter = new Waiter(new NodeWaiter(irParentPath, isName, inIndex));<NEW_LINE>lrWaiter.setTimeouts(lrTimes);<NEW_LINE>lrTreePath = (TreePath) lrWaiter.waitAction(null);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>throw new JemmyException("Interrupted.", e);<NEW_LINE>}<NEW_LINE>return lrTreePath;<NEW_LINE>}
= getTimeouts().cloneThis();
1,229,605
final CreateUserResult executeCreateUser(CreateUserRequest createUserRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createUserRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateUserRequest> request = null;<NEW_LINE>Response<CreateUserResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateUserRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createUserRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "MemoryDB");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateUser");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateUserResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateUserResultJsonUnmarshaller());<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.SIGNING_REGION, getSigningRegion());
274,208
private void fillInFunctionDefinition(ExpressionDeserialization defDeserializer, DefinitionProtos.Definition.FunctionData functionProto, FunctionDefinition functionDef) throws DeserializationException {<NEW_LINE>functionDef.setOmegaParameters(functionProto.getOmegaParameterList());<NEW_LINE>functionDef.setLevelParameters(readLevelParameters(functionProto.getLevelParamList(), functionProto.getIsStdLevels()));<NEW_LINE>if (functionProto.getHasEnclosingClass()) {<NEW_LINE>functionDef.setHasEnclosingClass(true);<NEW_LINE>}<NEW_LINE>List<Boolean> strictParameters = functionProto.getStrictParametersList();<NEW_LINE>if (!strictParameters.isEmpty()) {<NEW_LINE>functionDef.setStrictParameters(strictParameters);<NEW_LINE>}<NEW_LINE>functionDef.setParameters(defDeserializer.readParameters(functionProto.getParamList()));<NEW_LINE>List<Integer> parametersTypecheckingOrder = functionProto.getParametersTypecheckingOrderList();<NEW_LINE>if (!parametersTypecheckingOrder.isEmpty()) {<NEW_LINE>functionDef.setParametersTypecheckingOrder(parametersTypecheckingOrder);<NEW_LINE>}<NEW_LINE>List<Boolean> goodThisParameters = functionProto.getGoodThisParametersList();<NEW_LINE>if (!goodThisParameters.isEmpty()) {<NEW_LINE>functionDef.setGoodThisParameters(goodThisParameters);<NEW_LINE>}<NEW_LINE>functionDef.setTypeClassParameters(readTypeClassParametersKind(functionProto.getTypeClassParametersList()));<NEW_LINE>for (DefinitionProtos.Definition.ParametersLevel parametersLevelProto : functionProto.getParametersLevelsList()) {<NEW_LINE>functionDef.addParametersLevel(readParametersLevel(defDeserializer, parametersLevelProto));<NEW_LINE>}<NEW_LINE>List<Integer<MASK><NEW_LINE>if (!recursiveDefIndices.isEmpty()) {<NEW_LINE>Set<Definition> recursiveDefs = new HashSet<>();<NEW_LINE>for (Integer index : recursiveDefIndices) {<NEW_LINE>recursiveDefs.add(myCallTargetProvider.getCallTarget(index));<NEW_LINE>}<NEW_LINE>functionDef.setRecursiveDefinitions(recursiveDefs);<NEW_LINE>}<NEW_LINE>if (functionProto.hasType()) {<NEW_LINE>functionDef.setResultType(defDeserializer.readExpr(functionProto.getType()));<NEW_LINE>}<NEW_LINE>if (functionProto.hasTypeLevel()) {<NEW_LINE>functionDef.setResultTypeLevel(defDeserializer.readExpr(functionProto.getTypeLevel()));<NEW_LINE>}<NEW_LINE>switch(functionProto.getBodyHiddenStatus()) {<NEW_LINE>case HIDDEN:<NEW_LINE>functionDef.hideBody();<NEW_LINE>break;<NEW_LINE>case REALLY_HIDDEN:<NEW_LINE>functionDef.reallyHideBody();<NEW_LINE>}<NEW_LINE>FunctionDefinition.Kind kind;<NEW_LINE>switch(functionProto.getKind()) {<NEW_LINE>case LEMMA:<NEW_LINE>case COCLAUSE_LEMMA:<NEW_LINE>kind = CoreFunctionDefinition.Kind.LEMMA;<NEW_LINE>break;<NEW_LINE>case SFUNC:<NEW_LINE>kind = CoreFunctionDefinition.Kind.SFUNC;<NEW_LINE>break;<NEW_LINE>case TYPE:<NEW_LINE>kind = CoreFunctionDefinition.Kind.TYPE;<NEW_LINE>break;<NEW_LINE>case INSTANCE:<NEW_LINE>kind = CoreFunctionDefinition.Kind.INSTANCE;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>kind = CoreFunctionDefinition.Kind.FUNC;<NEW_LINE>}<NEW_LINE>functionDef.setKind(kind);<NEW_LINE>functionDef.setVisibleParameter(functionProto.getVisibleParameter());<NEW_LINE>if (functionProto.hasBody()) {<NEW_LINE>functionDef.setBody(readBody(defDeserializer, functionProto.getBody(), DependentLink.Helper.size(functionDef.getParameters())));<NEW_LINE>}<NEW_LINE>// setTypeClassReference(functionDef.getReferable(), functionDef.getParameters(), functionDef.getResultType());<NEW_LINE>}
> recursiveDefIndices = functionProto.getRecursiveDefinitionList();
588,307
public FailedTimeBookingId save(@NonNull final FailedTimeBooking failedTimeBooking) {<NEW_LINE>final Supplier<FailedTimeBookingId> failedIdByExternalIdAndSystemSupplier = () -> getOptionalByExternalIdAndSystem(failedTimeBooking.getExternalSystem(), failedTimeBooking.getExternalId()).map(FailedTimeBooking::getFailedTimeBookingId).orElse(null);<NEW_LINE>final FailedTimeBookingId failedTimeBookingId = CoalesceUtil.coalesceSuppliers(failedTimeBooking::getFailedTimeBookingId, failedIdByExternalIdAndSystemSupplier);<NEW_LINE>final I_S_FailedTimeBooking record = InterfaceWrapperHelper.loadOrNew(failedTimeBookingId, I_S_FailedTimeBooking.class);<NEW_LINE>record.setExternalId(failedTimeBooking.getExternalId());<NEW_LINE>record.setExternalSystem(failedTimeBooking.<MASK><NEW_LINE>record.setJSONValue(failedTimeBooking.getJsonValue());<NEW_LINE>record.setImportErrorMsg(failedTimeBooking.getErrorMsg());<NEW_LINE>InterfaceWrapperHelper.saveRecord(record);<NEW_LINE>return FailedTimeBookingId.ofRepoId(record.getS_FailedTimeBooking_ID());<NEW_LINE>}
getExternalSystem().getCode());
489,191
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {<NEW_LINE>HttpServletRequest r = <MASK><NEW_LINE>if (Utils.webSocketEnabled(r)) {<NEW_LINE>int draft = r.getIntHeader("Sec-WebSocket-Version");<NEW_LINE>if (draft < 0) {<NEW_LINE>draft = r.getIntHeader("Sec-WebSocket-Draft");<NEW_LINE>}<NEW_LINE>if (bannedVersion != null) {<NEW_LINE>for (String s : bannedVersion) {<NEW_LINE>if (Integer.parseInt(s) == draft) {<NEW_LINE>logger.trace("Invalid WebSocket Specification {} with {} ", r.getHeader("Connection"), r.getIntHeader("Sec-WebSocket-Version"));<NEW_LINE>HttpServletResponse.class.cast(response).addHeader(X_ATMOSPHERE_ERROR, "Websocket protocol not supported");<NEW_LINE>HttpServletResponse.class.cast(response).sendError(501, "Websocket protocol not supported");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>chain.doFilter(request, response);<NEW_LINE>}
HttpServletRequest.class.cast(request);
358,073
public RuleClass build(RuleClass.Builder builder, RuleDefinitionEnvironment env) {<NEW_LINE>return builder.requiresConfigurationFragments(CppConfiguration.class)./* <!-- #BLAZE_RULE(fdo_prefetch_hints).ATTRIBUTE(profile) --><NEW_LINE>Label of the hints profile. The hints file has the .afdo extension<NEW_LINE>The label can also point to an fdo_absolute_path_profile rule.<NEW_LINE><!-- #END_BLAZE_RULE.ATTRIBUTE --> */<NEW_LINE>add(attr("profile", LABEL).allowedFileTypes(FileTypeSet.of(FileType.of(".afdo"))).singleArtifact())./* <!-- #BLAZE_RULE(fdo_profile).ATTRIBUTE(absolute_path_profile) --><NEW_LINE>Absolute path to the FDO profile. The FDO file may only have the .afdo extension.<NEW_LINE><!-- #END_BLAZE_RULE.ATTRIBUTE --> */<NEW_LINE>add(attr("absolute_path_profile", Type.STRING)).advertiseProvider(<MASK><NEW_LINE>}
FdoPrefetchHintsProvider.class).build();
786,057
public void marshall(User user, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (user == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(user.getUserId(), USERID_BINDING);<NEW_LINE>protocolMarshaller.marshall(user.getAccountId(), ACCOUNTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(user.getPrimaryEmail(), PRIMARYEMAIL_BINDING);<NEW_LINE>protocolMarshaller.marshall(user.getPrimaryProvisionedNumber(), PRIMARYPROVISIONEDNUMBER_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(user.getLicenseType(), LICENSETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(user.getUserType(), USERTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(user.getUserRegistrationStatus(), USERREGISTRATIONSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(user.getUserInvitationStatus(), USERINVITATIONSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(user.getRegisteredOn(), REGISTEREDON_BINDING);<NEW_LINE>protocolMarshaller.marshall(user.getInvitedOn(), INVITEDON_BINDING);<NEW_LINE>protocolMarshaller.marshall(user.getAlexaForBusinessMetadata(), ALEXAFORBUSINESSMETADATA_BINDING);<NEW_LINE>protocolMarshaller.marshall(user.getPersonalPIN(), PERSONALPIN_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
user.getDisplayName(), DISPLAYNAME_BINDING);
566,254
final AssociateEncryptionConfigResult executeAssociateEncryptionConfig(AssociateEncryptionConfigRequest associateEncryptionConfigRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(associateEncryptionConfigRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AssociateEncryptionConfigRequest> request = null;<NEW_LINE>Response<AssociateEncryptionConfigResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AssociateEncryptionConfigRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(associateEncryptionConfigRequest));<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, "EKS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateEncryptionConfig");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AssociateEncryptionConfigResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AssociateEncryptionConfigResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
191,025
public final WeekDayOperatorContext weekDayOperator() throws RecognitionException {<NEW_LINE>WeekDayOperatorContext _localctx = new WeekDayOperatorContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 452, RULE_weekDayOperator);<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(2983);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>switch(_input.LA(1)) {<NEW_LINE>case IntegerLiteral:<NEW_LINE>case FloatingPointLiteral:<NEW_LINE>{<NEW_LINE>setState(2980);<NEW_LINE>number();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case IDENT:<NEW_LINE>{<NEW_LINE>setState(2981);<NEW_LINE>((WeekDayOperatorContext) _localctx<MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case QUESTION:<NEW_LINE>{<NEW_LINE>setState(2982);<NEW_LINE>substitution();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new NoViableAltException(this);<NEW_LINE>}<NEW_LINE>setState(2985);<NEW_LINE>match(WEEKDAY);<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
).i = match(IDENT);
346,112
public static void main(String[] args) throws Exception {<NEW_LINE>if (args.length != 2) {<NEW_LINE>System.err.println("Usage: YodaQA_GS INPUT.json OUTPUT.TSV");<NEW_LINE>System.err.println("Measures YodaQA performance on some Gold Standard questions.");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>CollectionReaderDescription reader = createReaderDescription(JSONQuestionReader.class, JSONQuestionReader.PARAM_JSONFILE, args[0<MASK><NEW_LINE>AnalysisEngineDescription pipeline = YodaQA.createEngineDescription();<NEW_LINE>AnalysisEngineDescription printer = createEngineDescription(GoldStandardAnswerPrinter.class, GoldStandardAnswerPrinter.PARAM_TSVFILE, args[1], ParallelEngineFactory.PARAM_NO_MULTIPROCESSING, 1);<NEW_LINE>// comment out for a linear single-thread flow<NEW_LINE>ParallelEngineFactory.registerFactory();<NEW_LINE>MultiCASPipeline.runPipeline(reader, pipeline, printer);<NEW_LINE>}
], JSONQuestionReader.PARAM_LANGUAGE, "en");
1,466,089
public CanvasSize estimateViewport() {<NEW_LINE>if (viewport == null) {<NEW_LINE>final int dim = proj.getDimensionality();<NEW_LINE>DoubleMinMax minmaxx = new DoubleMinMax();<NEW_LINE>DoubleMinMax minmaxy = new DoubleMinMax();<NEW_LINE>// Origin<NEW_LINE>final double[] vec = new double[dim];<NEW_LINE>double[] orig = projectScaledToRender(vec);<NEW_LINE>minmaxx.put(orig[0]);<NEW_LINE>minmaxy.put(orig[1]);<NEW_LINE>// Diagonal point<NEW_LINE>Arrays.fill(vec, 1.);<NEW_LINE>double[] diag = projectScaledToRender(vec);<NEW_LINE>minmaxx<MASK><NEW_LINE>minmaxy.put(diag[1]);<NEW_LINE>// Axis end points<NEW_LINE>for (int d = 0; d < dim; d++) {<NEW_LINE>Arrays.fill(vec, 0.);<NEW_LINE>vec[d] = 1.;<NEW_LINE>double[] ax = projectScaledToRender(vec);<NEW_LINE>minmaxx.put(ax[0]);<NEW_LINE>minmaxy.put(ax[1]);<NEW_LINE>}<NEW_LINE>viewport = new CanvasSize(minmaxx.getMin(), minmaxx.getMax(), minmaxy.getMin(), minmaxy.getMax());<NEW_LINE>}<NEW_LINE>return viewport;<NEW_LINE>}
.put(diag[0]);
1,096,473
public void forget(Xid xid) throws XAException {<NEW_LINE>svLogger.entering(CLASSNAME, "forget", new Object[] { this, ivMC, xid });<NEW_LINE>if (ivXid == null) {<NEW_LINE>// d131094<NEW_LINE>svLogger.info("XAResource.start was never issued; allowing to forget for recovery.");<NEW_LINE>}<NEW_LINE>// For XAResource.forget, only trace an Xid mismatch. [d129064.1]<NEW_LINE>if (!xid.equals(ivXid))<NEW_LINE>svLogger.info("Xid does not match - XAResource.start: " + ivXid + ", XAResource.forget: " + xid);<NEW_LINE>try {<NEW_LINE>// 112946<NEW_LINE>// Note that there is no call to the physical xaresource.forget. This is because only<NEW_LINE>// heuristic exceptions cause the forget to get called. If I catch a heuristic exception<NEW_LINE>// I will have already called forget.<NEW_LINE>ivStateManager.setState(StateManager.XA_FORGET);<NEW_LINE>} catch (ResourceException te) {<NEW_LINE>// Exception means setState failed because it was invalid to set the state in this case<NEW_LINE>svLogger.info("INVALID_TX_STATE - forget: " + ivMC.getTransactionStateAsString());<NEW_LINE>traceXAException(new XAException<MASK><NEW_LINE>}<NEW_LINE>svLogger.exiting(CLASSNAME, "forget");<NEW_LINE>}
(XAException.XA_RBPROTO), currClass);
632,368
private void initKafkaConsumerPool(ClusterDO clusterDO) {<NEW_LINE>lock.lock();<NEW_LINE>try {<NEW_LINE>GenericObjectPool<KafkaConsumer<String, String>> objectPool = KAFKA_CONSUMER_POOL.<MASK><NEW_LINE>if (objectPool != null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>GenericObjectPoolConfig<KafkaConsumer<String, String>> config = new GenericObjectPoolConfig<>();<NEW_LINE>config.setMaxIdle(kafkaConsumerMaxIdleClientNum);<NEW_LINE>config.setMinIdle(kafkaConsumerMinIdleClientNum);<NEW_LINE>config.setMaxTotal(kafkaConsumerMaxTotalClientNum);<NEW_LINE>KAFKA_CONSUMER_POOL.put(clusterDO.getId(), new GenericObjectPool<>(new KafkaConsumerFactory(clusterDO), config));<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("create kafka consumer pool failed, clusterDO:{}.", clusterDO, e);<NEW_LINE>} finally {<NEW_LINE>lock.unlock();<NEW_LINE>}<NEW_LINE>}
get(clusterDO.getId());
651,791
private void consolidateEntry(final int entryIndex) {<NEW_LINE>int previousVersionIndex = getPreviousVersionIndex(entryIndex);<NEW_LINE>if (previousVersionIndex == 0)<NEW_LINE>return;<NEW_LINE>if (getPreviousVersionIndex(previousVersionIndex) != 0) {<NEW_LINE>throw new IllegalStateException("Encountered Previous Version Entry that is not itself consolidated.");<NEW_LINE>}<NEW_LINE>int previousVersionPackedSlotsIndicators = getPackedSlotIndicators(previousVersionIndex);<NEW_LINE>// Previous version exists, needs consolidation<NEW_LINE>int packedSlotsIndicators = getPackedSlotIndicators(entryIndex);<NEW_LINE>// only bit that differs<NEW_LINE>int insertedSlotMask = packedSlotsIndicators ^ previousVersionPackedSlotsIndicators;<NEW_LINE>int slotsBelowBitNumber = packedSlotsIndicators & (insertedSlotMask - 1);<NEW_LINE>int insertedSlotIndex = Integer.bitCount(slotsBelowBitNumber);<NEW_LINE>int numberOfSlotsInEntry = Integer.bitCount(packedSlotsIndicators);<NEW_LINE>// Copy the entry slots from previous version, skipping the newly inserted slot in the target:<NEW_LINE>int sourceSlot = 0;<NEW_LINE>for (int targetSlot = 0; targetSlot < numberOfSlotsInEntry; targetSlot++) {<NEW_LINE>if (targetSlot != insertedSlotIndex) {<NEW_LINE>boolean success = true;<NEW_LINE>do {<NEW_LINE>short indexAtSlot = getIndexAtEntrySlot(previousVersionIndex, sourceSlot);<NEW_LINE>if (indexAtSlot != 0) {<NEW_LINE>// Copy observed index at slot to current entry<NEW_LINE>// (only copy value in if previous value is less than new one AND is non-zero)<NEW_LINE>casIndexAtEntrySlotIfNonZeroAndLessThan(entryIndex, targetSlot, indexAtSlot);<NEW_LINE>// CAS the previous version slot to 0.<NEW_LINE>// (Succeeds only if the index in that slot has not changed. Retry if it did).<NEW_LINE>success = casIndexAtEntrySlot(previousVersionIndex, sourceSlot, indexAtSlot, (short) 0);<NEW_LINE>}<NEW_LINE>} while (!success);<NEW_LINE>sourceSlot++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setPreviousVersionIndex<MASK><NEW_LINE>}
(entryIndex, (short) 0);
1,534,517
private InputStream openResource(Context context) throws IOException {<NEW_LINE>if (BuildConfig.DEBUG)<NEW_LINE>Log.v(TAG, "Trying to open resources in a package");<NEW_LINE>PackageInfo pi = getPackageInfo(context);<NEW_LINE>if (pi == null) {<NEW_LINE>if (BuildConfig.DEBUG)<NEW_LINE>Log.v(TAG, "No package found");<NEW_LINE>throw new IOException("No package for " + getName());<NEW_LINE>}<NEW_LINE>if (pi.versionCode != getVersionCode()) {<NEW_LINE>if (BuildConfig.DEBUG)<NEW_LINE>Log.w(TAG, "Package version mismatch");<NEW_LINE>throw new IOException("Version mismatch for " + getName());<NEW_LINE>}<NEW_LINE>Context pkgContext = null;<NEW_LINE>try {<NEW_LINE>pkgContext = context.createPackageContext(pi.packageName, 0);<NEW_LINE>} catch (PackageManager.NameNotFoundException e) {<NEW_LINE>if (BuildConfig.DEBUG)<NEW_LINE>Log.e(TAG, "Failed to get package context");<NEW_LINE>throw new IOException(e);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>int id = resources.getIdentifier("data", "raw", pi.packageName);<NEW_LINE>if (id == 0) {<NEW_LINE>if (BuildConfig.DEBUG)<NEW_LINE>Log.w(TAG, "Resource not found");<NEW_LINE>throw new IOException("Resource not found");<NEW_LINE>}<NEW_LINE>return resources.openRawResource(id);<NEW_LINE>}
Resources resources = pkgContext.getResources();
295,372
protected Control createCustomArea(Composite parent) {<NEW_LINE>Composite container = createComposite(parent, new GridLayout(2, false));<NEW_LINE>container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));<NEW_LINE>createLabel(container, Messages.COMMAND_ID + ":");<NEW_LINE>text = createTextbox(container, "");<NEW_LINE>text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));<NEW_LINE>error = createLabel(container, "");<NEW_LINE>error.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));<NEW_LINE>error.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_DARK_RED));<NEW_LINE>text.addListener(SWT.Modify, evt -> {<NEW_LINE>String input = text.getText();<NEW_LINE>Button button = getButton(IDialogConstants.OK_ID);<NEW_LINE>error.setVisible(false);<NEW_LINE>error.setText("");<NEW_LINE>if (button != null) {<NEW_LINE>button.setEnabled(false);<NEW_LINE>if (input.length() > 0) {<NEW_LINE>try {<NEW_LINE>String[] strings = input.split("\\.");<NEW_LINE>value <MASK><NEW_LINE>for (String s : strings) {<NEW_LINE>value.add(Long.parseLong(s));<NEW_LINE>}<NEW_LINE>button.setEnabled(true);<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>error.setText("Invalid index: " + e.getMessage());<NEW_LINE>error.setVisible(true);<NEW_LINE>error.requestLayout();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return container;<NEW_LINE>}
= new ArrayList<Long>();
358,954
protected void startup() {<NEW_LINE>super.startup();<NEW_LINE>View view = getMainView();<NEW_LINE>view.setMenuBar(createMenuBar());<NEW_LINE>view.setToolBar(createToolBar());<NEW_LINE>view.setComponent(createMainPanel());<NEW_LINE>// Build the popup menu.<NEW_LINE>popupMenu = new JPopupMenu() {<NEW_LINE><NEW_LINE>{<NEW_LINE>add(new JMenuItem(runSlavesAction));<NEW_LINE>add(new JMenuItem(stopSlavesAction));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>setConnectionState(false);<NEW_LINE>show(view);<NEW_LINE>JFrame mainFrame = getMainFrame();<NEW_LINE><MASK><NEW_LINE>mainFrame.setBounds(new Rectangle(Integer.parseInt(trickProperties.getProperty(xKey, Integer.toString(bounds.x))), Integer.parseInt(trickProperties.getProperty(yKey, Integer.toString(bounds.y))), Integer.parseInt(trickProperties.getProperty(widthKey, Integer.toString(bounds.width))), Integer.parseInt(trickProperties.getProperty(heightKey, Integer.toString(bounds.height)))));<NEW_LINE>}
Rectangle bounds = mainFrame.getBounds();
1,160,470
//<NEW_LINE>// graphics methods<NEW_LINE>//<NEW_LINE>@Override<NEW_LINE>public void paintInstance(InstancePainter painter) {<NEW_LINE>Graphics g = painter.getGraphics();<NEW_LINE>FontMetrics fm = g.getFontMetrics();<NEW_LINE>int asc = fm.getAscent();<NEW_LINE>painter.drawBounds();<NEW_LINE>String s0;<NEW_LINE>String type = getType(painter.getAttributeSet());<NEW_LINE>switch(type) {<NEW_LINE>case "zero":<NEW_LINE>s0 = S.get("extenderZeroLabel");<NEW_LINE>break;<NEW_LINE>case "one":<NEW_LINE>s0 = S.get("extenderOneLabel");<NEW_LINE>break;<NEW_LINE>case "sign":<NEW_LINE>s0 = S.get("extenderSignLabel");<NEW_LINE>break;<NEW_LINE>case "input":<NEW_LINE>s0 = S.get("extenderInputLabel");<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>// should never happen<NEW_LINE>s0 = "???";<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>String s1 = S.get("extenderMainLabel");<NEW_LINE>Bounds bds = painter.getBounds();<NEW_LINE>int x = bds.getX() + bds.getWidth() / 2;<NEW_LINE>int y0 = bds.getY() + (bds.getHeight() / 2 + asc) / 2;<NEW_LINE>int y1 = bds.getY() + (3 * bds.getHeight(<MASK><NEW_LINE>GraphicsUtil.drawText(g, s0, x, y0, GraphicsUtil.H_CENTER, GraphicsUtil.V_BASELINE);<NEW_LINE>GraphicsUtil.drawText(g, s1, x, y1, GraphicsUtil.H_CENTER, GraphicsUtil.V_BASELINE);<NEW_LINE>BitWidth w0 = painter.getAttributeValue(ATTR_OUT_WIDTH);<NEW_LINE>BitWidth w1 = painter.getAttributeValue(ATTR_IN_WIDTH);<NEW_LINE>painter.drawPort(0, "" + w0.getWidth(), Direction.WEST);<NEW_LINE>painter.drawPort(1, "" + w1.getWidth(), Direction.EAST);<NEW_LINE>if (type.equals("input"))<NEW_LINE>painter.drawPort(2);<NEW_LINE>}
) / 2 + asc) / 2;
1,428,082
final protected CommandExecutionResult executeArg(SequenceDiagram diagram, LineLocation location, RegexResult arg) throws NoSuchColorException {<NEW_LINE>final String code = arg.get("CODE", 0);<NEW_LINE>if (diagram.participantsContainsKey(code)) {<NEW_LINE>diagram.putParticipantInLast(code);<NEW_LINE>return CommandExecutionResult.ok();<NEW_LINE>}<NEW_LINE>Display strings = Display.NULL;<NEW_LINE>if (arg.get("FULL", 0) != null) {<NEW_LINE>strings = Display.getWithNewlines(arg.get("FULL", 0));<NEW_LINE>}<NEW_LINE>final String typeString1 = arg.get("TYPE", 0);<NEW_LINE>final String typeCreate1 = arg.get("CREATE", 0);<NEW_LINE>final ParticipantType type;<NEW_LINE>final boolean create;<NEW_LINE>if (typeCreate1 != null) {<NEW_LINE>type = ParticipantType.valueOf(StringUtils.goUpperCase(typeCreate1));<NEW_LINE>create = true;<NEW_LINE>} else if (typeString1.equalsIgnoreCase("CREATE")) {<NEW_LINE>type = ParticipantType.PARTICIPANT;<NEW_LINE>create = true;<NEW_LINE>} else {<NEW_LINE>type = ParticipantType.valueOf(StringUtils.goUpperCase(typeString1));<NEW_LINE>create = false;<NEW_LINE>}<NEW_LINE>final String orderString = arg.get("ORDER", 0);<NEW_LINE>final int order = orderString == null ? 0 : Integer.parseInt(orderString);<NEW_LINE>final Participant participant = diagram.createNewParticipant(type, code, strings, order);<NEW_LINE>final String stereotype = arg.get("STEREO", 0);<NEW_LINE>if (stereotype != null) {<NEW_LINE>final ISkinParam skinParam = diagram.getSkinParam();<NEW_LINE>final <MASK><NEW_LINE>final UFont font = skinParam.getFont(null, false, FontParam.CIRCLED_CHARACTER);<NEW_LINE>participant.setStereotype(Stereotype.build(stereotype, skinParam.getCircledCharacterRadius(), font, diagram.getSkinParam().getIHtmlColorSet()), stereotypePositionTop);<NEW_LINE>}<NEW_LINE>final String s = arg.get("COLOR", 0);<NEW_LINE>participant.setSpecificColorTOBEREMOVED(ColorType.BACK, s == null ? null : diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), s));<NEW_LINE>final String urlString = arg.get("URL", 0);<NEW_LINE>if (urlString != null) {<NEW_LINE>final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), UrlMode.STRICT);<NEW_LINE>final Url url = urlBuilder.getUrl(urlString);<NEW_LINE>participant.setUrl(url);<NEW_LINE>}<NEW_LINE>if (create) {<NEW_LINE>final String error = diagram.activate(participant, LifeEventType.CREATE, null);<NEW_LINE>if (error != null) {<NEW_LINE>return CommandExecutionResult.error(error);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return CommandExecutionResult.ok();<NEW_LINE>}
boolean stereotypePositionTop = skinParam.stereotypePositionTop();
1,121,404
// Task: parser string with text and show all indexes of all words<NEW_LINE>public static void main(String[] args) {<NEW_LINE>String INPUT_TEXT = "Hello World! Hello All! Hi World!";<NEW_LINE>// Parse text to words and index<NEW_LINE>List<String> words = Arrays.asList(INPUT_TEXT.split(" "));<NEW_LINE>// Create Multimap<NEW_LINE>Multimap<String, Integer> multiMap = HashMultimap.create();<NEW_LINE>// Fill Multimap<NEW_LINE>int i = 0;<NEW_LINE>for (String word : words) {<NEW_LINE>multiMap.put(word, i);<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>// Print all words<NEW_LINE>// print {Hi=[4], Hello=[0, 2], World!=[1, 5], All!=[3]} - keys and values in random orders<NEW_LINE>System.out.println(multiMap);<NEW_LINE>// Print all unique words<NEW_LINE>// print [Hi, Hello, World!, All!] - in random orders<NEW_LINE>System.out.println(multiMap.keySet());<NEW_LINE>// Print all indexes<NEW_LINE>// print [0, 2]<NEW_LINE>System.out.println("Hello = " <MASK><NEW_LINE>// print [1, 5]<NEW_LINE>System.out.println("World = " + multiMap.get("World!"));<NEW_LINE>// print [3]<NEW_LINE>System.out.println("All = " + multiMap.get("All!"));<NEW_LINE>// print [4]<NEW_LINE>System.out.println("Hi = " + multiMap.get("Hi"));<NEW_LINE>// print []<NEW_LINE>System.out.println("Empty = " + multiMap.get("Empty"));<NEW_LINE>// Print count all words<NEW_LINE>// print 6<NEW_LINE>System.out.println(multiMap.size());<NEW_LINE>// Print count unique words<NEW_LINE>// print 4<NEW_LINE>System.out.println(multiMap.keySet().size());<NEW_LINE>}
+ multiMap.get("Hello"));
214,370
private void compareByIndex(Node newNode, Node current) {<NEW_LINE>NodeList newnodes = newNode.getChildNodes();<NEW_LINE>NodeList children = current.getChildNodes();<NEW_LINE>int oldTreesize = children.getLength();<NEW_LINE>int newTreesize = newnodes.getLength();<NEW_LINE>int lastEqualIndex = Math.min(oldTreesize, newTreesize);<NEW_LINE>// these nodes are comparable<NEW_LINE>for (int i = 0; i < lastEqualIndex; i++) {<NEW_LINE>target = (Node) newnodes.item(i);<NEW_LINE>Node n = (Node) children.item(i);<NEW_LINE>n.accept(this);<NEW_LINE>}<NEW_LINE>// reset target as the rest of the tree will need to be walked<NEW_LINE>target = newNode;<NEW_LINE>// delete removed nodes from oldTree<NEW_LINE>for (int i = oldTreesize - 1; i >= lastEqualIndex; i--) {<NEW_LINE>xmlModel.delete((Node) children.item(i));<NEW_LINE>}<NEW_LINE>// add nodes from newTree<NEW_LINE>for (int i = lastEqualIndex; i < newTreesize; i++) {<NEW_LINE>Node n = (Node) newnodes.item(i);<NEW_LINE>xmlModel.add(current, (Node) n.clone(false<MASK><NEW_LINE>}<NEW_LINE>}
, false, false), i);
1,603,030
private static boolean startsWithBrace(int ln, StyledDocument document, org.netbeans.modules.editor.indent.spi.Context context, Object[] params, Set<Integer> whitespaces) throws BadLocationException {<NEW_LINE>int start = NbDocument.findLineOffset(document, ln);<NEW_LINE>int end = document.getLength();<NEW_LINE>try {<NEW_LINE>end = NbDocument.findLineOffset(document, ln + 1) - 1;<NEW_LINE>} catch (IndexOutOfBoundsException ex) {<NEW_LINE>}<NEW_LINE>TokenSequence ts = Utils.getTokenSequence(document, start);<NEW_LINE>if (ts.token() == null)<NEW_LINE>return false;<NEW_LINE>while (whitespaces.contains(ts.token().id().ordinal())) {<NEW_LINE>if (!ts.moveNext())<NEW_LINE>return false;<NEW_LINE>if (ts.offset() > end)<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Token t = ts.token();<NEW_LINE>String id = t.text().toString();<NEW_LINE>String trimedId = id.trim();<NEW_LINE>// If id has more than 2 leading newlines, should return false<NEW_LINE>int <MASK><NEW_LINE>if (nlIdx >= 0) {<NEW_LINE>nlIdx = id.indexOf("\n", nlIdx + 1);<NEW_LINE>if (nlIdx >= 0 && nlIdx < id.indexOf(trimedId)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ((Set) params[2]).contains(trimedId);<NEW_LINE>}
nlIdx = id.indexOf("\n");
1,826,390
private JsMessage addLinkProps(JsMessage msg) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "addLinkProps");<NEW_LINE>// Add Link specific properties to message<NEW_LINE>msg.setGuaranteedCrossBusLinkName(linkName);<NEW_LINE>msg.setGuaranteedCrossBusSourceBusUUID(messageProcessor.getMessagingEngineBusUuid());<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>SibTr.debug(tc, "Test whether outbound userid should be set in message");<NEW_LINE>// Check whether we need to override the outbound Userid<NEW_LINE>String linkOutboundUserid = ((<MASK><NEW_LINE>if (linkOutboundUserid != null) {<NEW_LINE>// Check whether this message was sent by the privileged<NEW_LINE>// Jetstream SIBServerSubject.If it was then we don't reset<NEW_LINE>// the userid in the message<NEW_LINE>if (!messageProcessor.getAuthorisationUtils().sentBySIBServer(msg)) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>SibTr.debug(tc, "Set outbound userid: " + linkOutboundUserid + ", in message");<NEW_LINE>// Call SIB.security (ultimately) to set outbounduserid into msg<NEW_LINE>messageProcessor.getAccessChecker().setSecurityIDInMessage(linkOutboundUserid, msg);<NEW_LINE>// Set the application userid (JMSXuserid)<NEW_LINE>msg.setApiUserId(linkOutboundUserid);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "addLinkProps");<NEW_LINE>return msg;<NEW_LINE>}
LinkHandler) destinationHandler).getOutboundUserid();
1,809,283
private com.netflix.genie.proto.JobMetadata toJobMetadataProto(final AgentJobRequest jobRequest) throws GenieConversionException {<NEW_LINE>final JobMetadata jobMetadata = jobRequest.getMetadata();<NEW_LINE>final ExecutionEnvironment jobResources = jobRequest.getResources();<NEW_LINE>final com.netflix.genie.proto.JobMetadata.Builder builder = com.netflix.genie.proto.JobMetadata.newBuilder();<NEW_LINE>jobRequest.getRequestedId().ifPresent(builder::setId);<NEW_LINE>builder.<MASK><NEW_LINE>builder.setUser(jobMetadata.getUser());<NEW_LINE>builder.setVersion(jobMetadata.getVersion());<NEW_LINE>jobMetadata.getDescription().ifPresent(builder::setDescription);<NEW_LINE>builder.addAllTags(jobMetadata.getTags());<NEW_LINE>if (jobMetadata.getMetadata().isPresent()) {<NEW_LINE>final String serializedMetadata;<NEW_LINE>try {<NEW_LINE>serializedMetadata = GenieObjectMapper.getMapper().writeValueAsString(jobMetadata.getMetadata().get());<NEW_LINE>} catch (JsonProcessingException e) {<NEW_LINE>throw new GenieConversionException("Failed to serialize job metadata to JSON", e);<NEW_LINE>}<NEW_LINE>builder.setMetadata(serializedMetadata);<NEW_LINE>}<NEW_LINE>jobMetadata.getEmail().ifPresent(builder::setEmail);<NEW_LINE>jobMetadata.getGrouping().ifPresent(builder::setGrouping);<NEW_LINE>jobMetadata.getGroupingInstance().ifPresent(builder::setGroupingInstance);<NEW_LINE>jobResources.getSetupFile().ifPresent(builder::setSetupFile);<NEW_LINE>builder.addAllConfigs(jobResources.getConfigs());<NEW_LINE>builder.addAllDependencies(jobResources.getDependencies());<NEW_LINE>builder.addAllCommandArgs(jobRequest.getCommandArgs());<NEW_LINE>return builder.build();<NEW_LINE>}
setName(jobMetadata.getName());
804,756
public static void convolve(Kernel2D_F32 kernel, GrayF32 src, GrayF32 dest) {<NEW_LINE>final float[] dataKernel = kernel.data;<NEW_LINE>final float[] dataSrc = src.data;<NEW_LINE>final float[] dataDst = dest.data;<NEW_LINE>final <MASK><NEW_LINE>final int height = src.getHeight();<NEW_LINE>int offsetL = kernel.offset;<NEW_LINE>int offsetR = kernel.width - kernel.offset - 1;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(offsetL, height - offsetR, y -> {<NEW_LINE>for (int y = offsetL; y < height - offsetR; y++) {<NEW_LINE>int indexDst = dest.startIndex + y * dest.stride + offsetL;<NEW_LINE>for (int x = offsetL; x < width - offsetR; x++) {<NEW_LINE>float total = 0;<NEW_LINE>int indexKer = 0;<NEW_LINE>for (int ki = 0; ki < kernel.width; ki++) {<NEW_LINE>int indexSrc = src.startIndex + (y + ki - offsetL) * src.stride + x - offsetL;<NEW_LINE>for (int kj = 0; kj < kernel.width; kj++) {<NEW_LINE>total += (dataSrc[indexSrc + kj]) * dataKernel[indexKer++];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>dataDst[indexDst++] = total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
int width = src.getWidth();
691,682
public static ListRolesResponse unmarshall(ListRolesResponse listRolesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listRolesResponse.setRequestId(_ctx.stringValue("ListRolesResponse.RequestId"));<NEW_LINE>listRolesResponse.setPageSize<MASK><NEW_LINE>listRolesResponse.setTotalCount(_ctx.integerValue("ListRolesResponse.TotalCount"));<NEW_LINE>listRolesResponse.setPageNumber(_ctx.integerValue("ListRolesResponse.PageNumber"));<NEW_LINE>listRolesResponse.setSuccess(_ctx.booleanValue("ListRolesResponse.Success"));<NEW_LINE>List<SysRoleModel> roles = new ArrayList<SysRoleModel>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListRolesResponse.Roles.Length"); i++) {<NEW_LINE>SysRoleModel sysRoleModel = new SysRoleModel();<NEW_LINE>sysRoleModel.setMerchantId(_ctx.longValue("ListRolesResponse.Roles[" + i + "].MerchantId"));<NEW_LINE>sysRoleModel.setRoleId(_ctx.integerValue("ListRolesResponse.Roles[" + i + "].RoleId"));<NEW_LINE>sysRoleModel.setRemark(_ctx.stringValue("ListRolesResponse.Roles[" + i + "].Remark"));<NEW_LINE>sysRoleModel.setName(_ctx.stringValue("ListRolesResponse.Roles[" + i + "].Name"));<NEW_LINE>sysRoleModel.setStatus(_ctx.integerValue("ListRolesResponse.Roles[" + i + "].Status"));<NEW_LINE>List<BaseModel> apis = new ArrayList<BaseModel>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListRolesResponse.Roles[" + i + "].Apis.Length"); j++) {<NEW_LINE>BaseModel baseModel = new BaseModel();<NEW_LINE>baseModel.setId(_ctx.integerValue("ListRolesResponse.Roles[" + i + "].Apis[" + j + "].Id"));<NEW_LINE>baseModel.setName(_ctx.stringValue("ListRolesResponse.Roles[" + i + "].Apis[" + j + "].Name"));<NEW_LINE>baseModel.setCode(_ctx.stringValue("ListRolesResponse.Roles[" + i + "].Apis[" + j + "].Code"));<NEW_LINE>apis.add(baseModel);<NEW_LINE>}<NEW_LINE>sysRoleModel.setApis(apis);<NEW_LINE>List<BaseModel> menus = new ArrayList<BaseModel>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListRolesResponse.Roles[" + i + "].Menus.Length"); j++) {<NEW_LINE>BaseModel baseModel_ = new BaseModel();<NEW_LINE>baseModel_.setId(_ctx.integerValue("ListRolesResponse.Roles[" + i + "].Menus[" + j + "].Id"));<NEW_LINE>baseModel_.setName(_ctx.stringValue("ListRolesResponse.Roles[" + i + "].Menus[" + j + "].Name"));<NEW_LINE>baseModel_.setCode(_ctx.stringValue("ListRolesResponse.Roles[" + i + "].Menus[" + j + "].Code"));<NEW_LINE>menus.add(baseModel_);<NEW_LINE>}<NEW_LINE>sysRoleModel.setMenus(menus);<NEW_LINE>roles.add(sysRoleModel);<NEW_LINE>}<NEW_LINE>listRolesResponse.setRoles(roles);<NEW_LINE>return listRolesResponse;<NEW_LINE>}
(_ctx.integerValue("ListRolesResponse.PageSize"));
1,720,880
public void run(RegressionEnvironment env) {<NEW_LINE>SupportBeanCombinedProps combined = SupportBeanCombinedProps.makeDefaultBean();<NEW_LINE>SupportBeanComplexProps complex = SupportBeanComplexProps.makeDefaultBean();<NEW_LINE>assertEquals("0ma0", combined.getIndexed(0).getMapped("0ma").getValue());<NEW_LINE>String epl = "@name('s0') select nested.nested, s1.indexed[0], nested.indexed[1] from " + "SupportBeanComplexProps#length(3) nested, " + "SupportBeanCombinedProps#length(3) s1" + " where mapped('keyOne') = indexed[2].mapped('2ma').value and" + " indexed[0].mapped('0ma').value = '0ma0'";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>env.sendEventBean(combined);<NEW_LINE>env.sendEventBean(complex);<NEW_LINE>env.assertListener("s0", listener -> {<NEW_LINE>EventBean theEvent = listener.getAndResetLastNewData()[0];<NEW_LINE>assertSame(complex.getNested()<MASK><NEW_LINE>assertSame(combined.getIndexed(0), theEvent.get("s1.indexed[0]"));<NEW_LINE>assertEquals(complex.getIndexed(1), theEvent.get("nested.indexed[1]"));<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>}
, theEvent.get("nested.nested"));
1,771,858
public static DescribeDeletedInstancesResponse unmarshall(DescribeDeletedInstancesResponse describeDeletedInstancesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDeletedInstancesResponse.setRequestId(_ctx.stringValue("DescribeDeletedInstancesResponse.RequestId"));<NEW_LINE>describeDeletedInstancesResponse.setTotalCount(_ctx.longValue("DescribeDeletedInstancesResponse.TotalCount"));<NEW_LINE>describeDeletedInstancesResponse.setPageNumber(_ctx.integerValue("DescribeDeletedInstancesResponse.PageNumber"));<NEW_LINE>describeDeletedInstancesResponse.setPageSize(_ctx.integerValue("DescribeDeletedInstancesResponse.PageSize"));<NEW_LINE>List<Instance> instances = new ArrayList<Instance>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDeletedInstancesResponse.Instances.Length"); i++) {<NEW_LINE>Instance instance = new Instance();<NEW_LINE>instance.setInstanceId(_ctx.stringValue("DescribeDeletedInstancesResponse.Instances[" + i + "].InstanceId"));<NEW_LINE>instance.setInstanceName(_ctx.stringValue("DescribeDeletedInstancesResponse.Instances[" + i + "].InstanceName"));<NEW_LINE>instance.setStatus(_ctx.stringValue("DescribeDeletedInstancesResponse.Instances[" + i + "].Status"));<NEW_LINE>instance.setMajorVersion(_ctx.stringValue("DescribeDeletedInstancesResponse.Instances[" + i + "].MajorVersion"));<NEW_LINE>instance.setEngine(_ctx.stringValue("DescribeDeletedInstancesResponse.Instances[" + i + "].Engine"));<NEW_LINE>instance.setRegionId(_ctx.stringValue("DescribeDeletedInstancesResponse.Instances[" + i + "].RegionId"));<NEW_LINE>instance.setZoneId(_ctx.stringValue("DescribeDeletedInstancesResponse.Instances[" + i + "].ZoneId"));<NEW_LINE>instance.setCreatedTime(_ctx.stringValue("DescribeDeletedInstancesResponse.Instances[" + i + "].CreatedTime"));<NEW_LINE>instance.setDeleteTime(_ctx.stringValue("DescribeDeletedInstancesResponse.Instances[" + i + "].DeleteTime"));<NEW_LINE>instance.setClusterType(_ctx.stringValue("DescribeDeletedInstancesResponse.Instances[" + i + "].ClusterType"));<NEW_LINE>instance.setModuleStackVersion(_ctx.stringValue<MASK><NEW_LINE>instance.setParentId(_ctx.stringValue("DescribeDeletedInstancesResponse.Instances[" + i + "].ParentId"));<NEW_LINE>instances.add(instance);<NEW_LINE>}<NEW_LINE>describeDeletedInstancesResponse.setInstances(instances);<NEW_LINE>return describeDeletedInstancesResponse;<NEW_LINE>}
("DescribeDeletedInstancesResponse.Instances[" + i + "].ModuleStackVersion"));
1,682,198
protected boolean doGeneric(JSDynamicObject proxy, Object key, @Cached("createBinaryProfile()") ConditionProfile trapFunProfile) {<NEW_LINE>assert JSProxy.isJSProxy(proxy);<NEW_LINE>Object propertyKey = toPropertyKeyNode.execute(key);<NEW_LINE>JSDynamicObject handler = JSProxy.getHandlerChecked(proxy, errorBranch);<NEW_LINE>Object target = JSProxy.getTarget(proxy);<NEW_LINE>Object trapFun = trapGetter.executeWithTarget(handler);<NEW_LINE>if (trapFunProfile.profile(trapFun == Undefined.instance)) {<NEW_LINE>if (JSDynamicObject.isJSDynamicObject(target)) {<NEW_LINE>return JSObject.hasProperty((JSDynamicObject) target, propertyKey);<NEW_LINE>} else {<NEW_LINE>return JSInteropUtil.hasProperty(target, propertyKey);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Object callResult = callNode.executeCall(JSArguments.create(handler, trapFun, target, propertyKey));<NEW_LINE>boolean trapResult = toBooleanNode.executeBoolean(callResult);<NEW_LINE>if (!trapResult) {<NEW_LINE>if (!JSProxy.checkPropertyIsSettable(target, propertyKey)) {<NEW_LINE>errorBranch.enter();<NEW_LINE>throw <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return trapResult;<NEW_LINE>}<NEW_LINE>}
Errors.createTypeError("Proxy can't successfully access a non-writable, non-configurable property", this);
526,386
public boolean updateGpsFiltersConfig(@NonNull GpxDataItem item, @NonNull FilteredSelectedGpxFile selectedGpxFile) {<NEW_LINE>SQLiteConnection db = openConnection(false);<NEW_LINE>if (db != null) {<NEW_LINE>try {<NEW_LINE>double smoothingThreshold = selectedGpxFile.getSmoothingFilter().getSelectedMaxValue();<NEW_LINE>double minSpeed = selectedGpxFile.getSpeedFilter().getSelectedMinValue();<NEW_LINE>double maxSpeed = selectedGpxFile<MASK><NEW_LINE>double minAltitude = selectedGpxFile.getAltitudeFilter().getSelectedMinValue();<NEW_LINE>double maxAltitude = selectedGpxFile.getAltitudeFilter().getSelectedMaxValue();<NEW_LINE>double maxHdop = selectedGpxFile.getHdopFilter().getSelectedMaxValue();<NEW_LINE>String fileName = getFileName(item.file);<NEW_LINE>String fileDir = getFileDir(item.file);<NEW_LINE>db.execSQL(GPX_TABLE_UPDATE_FILTERS + " WHERE " + GPX_COL_NAME + " = ? AND " + GPX_COL_DIR + " = ?", new Object[] { smoothingThreshold, minSpeed, maxSpeed, minAltitude, maxAltitude, maxHdop, fileName, fileDir });<NEW_LINE>item.smoothingThreshold = smoothingThreshold;<NEW_LINE>item.minFilterSpeed = minSpeed;<NEW_LINE>item.maxFilterSpeed = maxSpeed;<NEW_LINE>item.minFilterAltitude = minAltitude;<NEW_LINE>item.maxFilterAltitude = maxAltitude;<NEW_LINE>item.maxFilterHdop = maxHdop;<NEW_LINE>} finally {<NEW_LINE>db.close();<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
.getSpeedFilter().getSelectedMaxValue();
282,110
final ListPartsResult executeListParts(ListPartsRequest listPartsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listPartsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListPartsRequest> request = null;<NEW_LINE>Response<ListPartsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListPartsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listPartsRequest));<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, "Glacier");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListParts");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListPartsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListPartsResultJsonUnmarshaller());<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.ADVANCED_CONFIG, advancedConfig);
1,049,575
private static SpanContext extractContextFromTraceParent(String traceparent) {<NEW_LINE>// TODO(bdrutu): Do we need to verify that version is hex and that<NEW_LINE>// for the version the length is the expected one?<NEW_LINE>boolean isValid = (traceparent.length() == TRACEPARENT_HEADER_SIZE || (traceparent.length() > TRACEPARENT_HEADER_SIZE && traceparent.charAt(TRACEPARENT_HEADER_SIZE) == TRACEPARENT_DELIMITER)) && traceparent.charAt(TRACE_ID_OFFSET - 1) == TRACEPARENT_DELIMITER && traceparent.charAt(SPAN_ID_OFFSET - 1) == TRACEPARENT_DELIMITER && traceparent.charAt(TRACE_OPTION_OFFSET - 1) == TRACEPARENT_DELIMITER;<NEW_LINE>if (!isValid) {<NEW_LINE>logger.fine("Unparseable traceparent header. Returning INVALID span context.");<NEW_LINE>return SpanContext.getInvalid();<NEW_LINE>}<NEW_LINE>String version = traceparent.substring(0, 2);<NEW_LINE>if (!VALID_VERSIONS.contains(version)) {<NEW_LINE>return SpanContext.getInvalid();<NEW_LINE>}<NEW_LINE>if (version.equals(VERSION_00) && traceparent.length() > TRACEPARENT_HEADER_SIZE) {<NEW_LINE>return SpanContext.getInvalid();<NEW_LINE>}<NEW_LINE>String traceId = traceparent.substring(TRACE_ID_OFFSET, TRACE_ID_OFFSET + TraceId.getLength());<NEW_LINE>String spanId = traceparent.substring(SPAN_ID_OFFSET, SPAN_ID_OFFSET + SpanId.getLength());<NEW_LINE>char firstTraceFlagsChar = traceparent.charAt(TRACE_OPTION_OFFSET);<NEW_LINE>char secondTraceFlagsChar = traceparent.charAt(TRACE_OPTION_OFFSET + 1);<NEW_LINE>if (!OtelEncodingUtils.isValidBase16Character(firstTraceFlagsChar) || !OtelEncodingUtils.isValidBase16Character(secondTraceFlagsChar)) {<NEW_LINE>return SpanContext.getInvalid();<NEW_LINE>}<NEW_LINE>TraceFlags traceFlags = TraceFlags.fromByte(OtelEncodingUtils<MASK><NEW_LINE>return SpanContext.createFromRemoteParent(traceId, spanId, traceFlags, TraceState.getDefault());<NEW_LINE>}
.byteFromBase16(firstTraceFlagsChar, secondTraceFlagsChar));
53,213
public Response harvestingClient(@PathParam("nickName") String nickName, @QueryParam("key") String apiKey) throws IOException {<NEW_LINE>HarvestingClient harvestingClient = null;<NEW_LINE>try {<NEW_LINE>harvestingClient = harvestingClientService.findByNickname(nickName);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>logger.warning("Exception caught looking up harvesting client " + nickName + ": " + ex.getMessage());<NEW_LINE>return error(Response.Status.BAD_REQUEST, "Internal error: failed to look up harvesting client " + nickName + ".");<NEW_LINE>}<NEW_LINE>if (harvestingClient == null) {<NEW_LINE>return error(Response.Status.NOT_FOUND, "Harvesting client " + nickName + " not found.");<NEW_LINE>}<NEW_LINE>HarvestingClient retrievedHarvestingClient = null;<NEW_LINE>try {<NEW_LINE>// findUserOrDie() and execCommand() both throw WrappedResponse<NEW_LINE>// exception, that already has a proper HTTP response in it.<NEW_LINE>retrievedHarvestingClient = execCommand(new GetHarvestingClientCommand(createDataverseRequest(findUserOrDie()), harvestingClient));<NEW_LINE>logger.info("retrieved Harvesting Client " + <MASK><NEW_LINE>} catch (WrappedResponse wr) {<NEW_LINE>return wr.getResponse();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>logger.warning("Unknown exception caught while executing GetHarvestingClientCommand: " + ex.getMessage());<NEW_LINE>retrievedHarvestingClient = null;<NEW_LINE>}<NEW_LINE>if (retrievedHarvestingClient == null) {<NEW_LINE>return error(Response.Status.BAD_REQUEST, "Internal error: failed to retrieve harvesting client " + nickName + ".");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return ok(harvestingConfigAsJson(retrievedHarvestingClient));<NEW_LINE>} catch (Exception ex) {<NEW_LINE>logger.warning("Unknown exception caught while trying to format harvesting client config as json: " + ex.getMessage());<NEW_LINE>return error(Response.Status.BAD_REQUEST, "Internal error: failed to produce output for harvesting client " + nickName + ".");<NEW_LINE>}<NEW_LINE>}
retrievedHarvestingClient.getName() + " with the GetHarvestingClient command.");
1,461,894
private static void generateGetMsg(StringBuilder pysb, Class<?> clazz) {<NEW_LINE>String actionName = populateActionName(clazz);<NEW_LINE>pysb.append(String.format("\n\nclass %s(inventory.%s):", actionName, clazz.getSimpleName()));<NEW_LINE>pysb.append(String.format("\n%sdef __init__(self):", whiteSpace(4)));<NEW_LINE>pysb.append(String.format("\n%ssuper(%s, self).__init__()", whiteSpace(8), actionName));<NEW_LINE>pysb.append(String.format("\n%sself.sessionUuid = None", whiteSpace(8)));<NEW_LINE>pysb.append(String.format(<MASK><NEW_LINE>pysb.append(String.format("\n%sdef run(self):", whiteSpace(4)));<NEW_LINE>pysb.append(String.format("\n%sif not self.sessionUuid:", whiteSpace(8)));<NEW_LINE>pysb.append(String.format("\n%sraise Exception('sessionUuid of action[%s] cannot be None')", whiteSpace(12), actionName));<NEW_LINE>pysb.append(String.format("\n%sreply = api.sync_call(self, self.sessionUuid)", whiteSpace(8)));<NEW_LINE>pysb.append(String.format("\n%sself.out = jsonobject.loads(reply.inventory)", whiteSpace(8)));<NEW_LINE>pysb.append(String.format("\n%sreturn self.out", whiteSpace(8)));<NEW_LINE>}
"\n%sself.out = None", whiteSpace(8)));
998,501
private void drawTextHelper(final StringStyle line, PointDouble p, AlignHorizontal align, double fontSize) {<NEW_LINE>ctxSetFont(fontSize, line);<NEW_LINE>String textToDraw = line.getStringWithoutMarkup();<NEW_LINE>if (textToDraw == null || textToDraw.isEmpty()) {<NEW_LINE>// if nothing should be drawn return (some browsers like Opera have problems with ctx.fillText calls on empty strings)<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (ctx instanceof Context2dPdfWrapper) {<NEW_LINE>// Replacing tabulator unicode because some fonts don't include it<NEW_LINE>textToDraw = textToDraw.replaceAll("\u0009", " ");<NEW_LINE>}<NEW_LINE>ctxSetTextAlign(align);<NEW_LINE>ctx.fillText(textToDraw, p.x, p.y);<NEW_LINE>if (line.getFormat().contains(FormatLabels.UNDERLINE)) {<NEW_LINE>ctx.setLineWidth(1.0f);<NEW_LINE>setLineDash(ctx, LineType.SOLID, 1.0f);<NEW_LINE>double textWidth = textWidth(line) * zoomFactor;<NEW_LINE>int vDist = 1;<NEW_LINE>switch(align) {<NEW_LINE>case LEFT:<NEW_LINE>drawLineHelper(true, new PointDouble(p.x, p.y + vDist), new PointDouble(p.x + textWidth, p.y + vDist));<NEW_LINE>break;<NEW_LINE>case CENTER:<NEW_LINE>drawLineHelper(true, new PointDouble(p.x - textWidth / 2, p.y + vDist), new PointDouble(p.x + textWidth / 2, p.y + vDist));<NEW_LINE>break;<NEW_LINE>case RIGHT:<NEW_LINE>drawLineHelper(true, new PointDouble(p.x - textWidth, p.y + vDist), new PointDouble(p.x<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, p.y + vDist));
487,822
public final List findByRowKeys(Class entityClass, List<String> relationNames, boolean isWrapReq, EntityMetadata metadata, Object... rowIds) {<NEW_LINE>List entities = null;<NEW_LINE>MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(metadata.getPersistenceUnit());<NEW_LINE>EntityType entityType = metaModel.entity(metadata.getEntityClazz());<NEW_LINE>List<AbstractManagedType> subManagedType = ((<MASK><NEW_LINE>try {<NEW_LINE>if (!subManagedType.isEmpty()) {<NEW_LINE>for (AbstractManagedType subEntity : subManagedType) {<NEW_LINE>EntityMetadata subEntityMetadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, subEntity.getJavaType());<NEW_LINE>entities = getDataHandler().fromThriftRow(entityClass, subEntityMetadata, subEntityMetadata.getRelationNames(), isWrapReq, getConsistencyLevel(), rowIds);<NEW_LINE>if (entities != null && !entities.isEmpty()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>entities = getDataHandler().fromThriftRow(entityClass, metadata, relationNames, isWrapReq, getConsistencyLevel(), rowIds);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Error while retrieving records for entity {}, row keys {}", entityClass, rowIds);<NEW_LINE>throw new KunderaException(e);<NEW_LINE>}<NEW_LINE>return entities;<NEW_LINE>}
AbstractManagedType) entityType).getSubManagedType();
1,596,091
public static Value RandomSetOfSubsets(final Value v1, final Value v2, final Value v3) {<NEW_LINE>// first parameter<NEW_LINE>if (!(v1 instanceof IntValue)) {<NEW_LINE>throw new EvalException(EC.TLC_MODULE_ARGUMENT_ERROR, new String[] { "first", "RandomSetOfSubsets", "nonnegative integer", Values.ppr(v1.toString()) });<NEW_LINE>}<NEW_LINE>final int numberOfPicks = ((IntValue) v1).val;<NEW_LINE>if (numberOfPicks < 0) {<NEW_LINE>throw new EvalException(EC.TLC_MODULE_ARGUMENT_ERROR, new String[] { "first", "RandomSetOfSubsets", "nonnegative integer", Values.ppr(v1.toString()) });<NEW_LINE>}<NEW_LINE>// second parameter<NEW_LINE>if (!(v2 instanceof IntValue)) {<NEW_LINE>throw new EvalException(EC.TLC_MODULE_ARGUMENT_ERROR, new String[] { "second", "RandomSetOfSubsets", "nonnegative integer", Values.ppr(v2.toString()) });<NEW_LINE>}<NEW_LINE>final int n = ((IntValue) v2).val;<NEW_LINE>if (n < 0) {<NEW_LINE>throw new EvalException(EC.TLC_MODULE_ARGUMENT_ERROR, new String[] { "second", "RandomSetOfSubsets", "nonnegative integer", Values.ppr(v2.toString()) });<NEW_LINE>}<NEW_LINE>// third parameter<NEW_LINE>if (!(v3 instanceof EnumerableValue) || !((EnumerableValue) v3).isFinite()) {<NEW_LINE>throw new EvalException(EC.TLC_MODULE_ARGUMENT_ERROR, new String[] { "third", "RandomSetOfSubsets", "finite set", Values.ppr(v3.toString()) });<NEW_LINE>}<NEW_LINE>final EnumerableValue ev = (EnumerableValue) v3;<NEW_LINE>if (31 - Integer.numberOfLeadingZeros(numberOfPicks) + 1 > ev.size() && numberOfPicks > (1 << ev.size())) {<NEW_LINE>// First compare exponents before explicit calculating size of subset. The<NEW_LINE>// calculated value which is the subset's size then won't overflow.<NEW_LINE>throw new EvalException(EC.TLC_MODULE_ARGUMENT_ERROR, new String[] { "first", "RandomSetOfSubsets", "nonnegative integer that is smaller than the subset's size of 2^" + ev.size(), <MASK><NEW_LINE>}<NEW_LINE>// second parameter (now that we know third is enumerable)<NEW_LINE>if (ev.size() < n) {<NEW_LINE>throw new EvalException(EC.TLC_MODULE_ARGUMENT_ERROR, new String[] { "second", "RandomSetOfSubsets", "nonnegative integer in range 0..Cardinality(S)", Values.ppr(v2.toString()) });<NEW_LINE>}<NEW_LINE>final double probability = (1d * n) / ev.size();<NEW_LINE>if (probability < 0d || 1d < probability) {<NEW_LINE>throw new EvalException(EC.TLC_MODULE_ARGUMENT_ERROR, new String[] { "second", "RandomSetOfSubsets", "nonnegative integer in range 0..Cardinality(S)", Values.ppr(v2.toString()) });<NEW_LINE>}<NEW_LINE>return new SubsetValue(ev).getRandomSetOfSubsets(numberOfPicks, probability);<NEW_LINE>}
Integer.toString(numberOfPicks) });
558,162
private List<InputValueDefinition> createInputValueDefinitions(JSGraphQLEndpointArgumentsDefinition argumentsDefinition, List<GraphQLException> errors) {<NEW_LINE>if (argumentsDefinition != null && argumentsDefinition.getInputValueDefinitions() != null) {<NEW_LINE>final List<InputValueDefinition> result = Lists.newArrayList();<NEW_LINE>for (JSGraphQLEndpointInputValueDefinition psiArgument : argumentsDefinition.getInputValueDefinitions().getInputValueDefinitionList()) {<NEW_LINE>final String argumentName = psiArgument.getInputValueDefinitionIdentifier().getIdentifier().getText();<NEW_LINE>final JSGraphQLEndpointCompositeType psiCompositeType = psiArgument.getCompositeType();<NEW_LINE>if (psiCompositeType != null) {<NEW_LINE><MASK><NEW_LINE>if (type != null) {<NEW_LINE>result.add(new InputValueDefinition(argumentName, type));<NEW_LINE>} else {<NEW_LINE>errors.add(new JSGraphQLEndpointSchemaError("Unable to create schema type from '" + psiCompositeType.getText() + "' has no type", psiCompositeType));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>errors.add(new JSGraphQLEndpointSchemaError("Argument '" + argumentName + "' has no type", psiArgument));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>return Collections.emptyList();<NEW_LINE>}
final Type type = createType(psiCompositeType);
468,571
private int addLeases(List<VirtualMachineLease> leases) {<NEW_LINE>if (logger.isDebugEnabled())<NEW_LINE>logger.debug("Adding leases");<NEW_LINE>for (AssignableVirtualMachine avm : vmCollection.getAllVMs<MASK><NEW_LINE>int rejected = 0;<NEW_LINE>for (VirtualMachineLease l : leases) {<NEW_LINE>if (vmCollection.addLease(l))<NEW_LINE>rejected++;<NEW_LINE>}<NEW_LINE>for (AssignableVirtualMachine avm : vmCollection.getAllVMs()) {<NEW_LINE>if (logger.isDebugEnabled())<NEW_LINE>logger.debug("Updating total lease on " + avm.getHostname());<NEW_LINE>avm.updateCurrTotalLease();<NEW_LINE>final VirtualMachineLease currTotalLease = avm.getCurrTotalLease();<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>if (currTotalLease == null)<NEW_LINE>logger.debug("Updated total lease is null for " + avm.getHostname());<NEW_LINE>else {<NEW_LINE>logger.debug("Updated total lease for {} has cpu={}, mem={}, disk={}, network={}", avm.getHostname(), currTotalLease.cpuCores(), currTotalLease.memoryMB(), currTotalLease.diskMB(), currTotalLease.networkMbps());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return rejected;<NEW_LINE>}
()) avm.resetResources();
884,035
public static void vertical(Kernel1D_F64 kernel, GrayF64 input, GrayF64 output) {<NEW_LINE>final double[] dataSrc = input.data;<NEW_LINE>final double[] dataDst = output.data;<NEW_LINE>final double[] dataKer = kernel.data;<NEW_LINE>final int kernelWidth = kernel.getWidth();<NEW_LINE>final int offsetL = kernel.getOffset();<NEW_LINE>final int offsetR = kernelWidth - offsetL - 1;<NEW_LINE>final <MASK><NEW_LINE>final int imgHeight = output.getHeight();<NEW_LINE>final int yEnd = imgHeight - offsetR;<NEW_LINE>for (int y = 0; y < offsetL; y++) {<NEW_LINE>int indexDst = output.startIndex + y * output.stride;<NEW_LINE>int i = input.startIndex + y * input.stride;<NEW_LINE>final int iEnd = i + imgWidth;<NEW_LINE>int kStart = offsetL - y;<NEW_LINE>double weight = 0;<NEW_LINE>for (int k = kStart; k < kernelWidth; k++) {<NEW_LINE>weight += dataKer[k];<NEW_LINE>}<NEW_LINE>for (; i < iEnd; i++) {<NEW_LINE>double total = 0;<NEW_LINE>int indexSrc = i - y * input.stride;<NEW_LINE>for (int k = kStart; k < kernelWidth; k++, indexSrc += input.stride) {<NEW_LINE>total += (dataSrc[indexSrc]) * dataKer[k];<NEW_LINE>}<NEW_LINE>dataDst[indexDst++] = (total / weight);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int y = yEnd; y < imgHeight; y++) {<NEW_LINE>int indexDst = output.startIndex + y * output.stride;<NEW_LINE>int i = input.startIndex + y * input.stride;<NEW_LINE>final int iEnd = i + imgWidth;<NEW_LINE>int kEnd = imgHeight - (y - offsetL);<NEW_LINE>double weight = 0;<NEW_LINE>for (int k = 0; k < kEnd; k++) {<NEW_LINE>weight += dataKer[k];<NEW_LINE>}<NEW_LINE>for (; i < iEnd; i++) {<NEW_LINE>double total = 0;<NEW_LINE>int indexSrc = i - offsetL * input.stride;<NEW_LINE>for (int k = 0; k < kEnd; k++, indexSrc += input.stride) {<NEW_LINE>total += (dataSrc[indexSrc]) * dataKer[k];<NEW_LINE>}<NEW_LINE>dataDst[indexDst++] = (total / weight);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int imgWidth = output.getWidth();
1,201,693
private Map<Long, Set<String>> separateClustersByOrg(Set<Long> orgIds) {<NEW_LINE>XpipeMeta xpipeMeta = metaCache.getXpipeMeta();<NEW_LINE>if (null == xpipeMeta)<NEW_LINE>return null;<NEW_LINE>Map<Long, Set<String>> clustersByOrg = new HashMap<<MASK><NEW_LINE>orgIds.forEach(orgId -> clustersByOrg.put(orgId, new HashSet<>()));<NEW_LINE>for (DcMeta dcMeta : xpipeMeta.getDcs().values()) {<NEW_LINE>for (ClusterMeta clusterMeta : dcMeta.getClusters().values()) {<NEW_LINE>if (!ClusterType.lookup(clusterMeta.getType()).supportMigration()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (orgIds.contains((long) clusterMeta.getOrgId())) {<NEW_LINE>clustersByOrg.get((long) clusterMeta.getOrgId()).add(clusterMeta.getId());<NEW_LINE>} else if (orgIds.contains(DEFAULT_ORG_ID)) {<NEW_LINE>clustersByOrg.get(DEFAULT_ORG_ID).add(clusterMeta.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return clustersByOrg;<NEW_LINE>}
>(orgIds.size());
390,168
public View createTabView(ViewGroup container, int position, PagerAdapter adapter) {<NEW_LINE>LayoutInflater inflater = LayoutInflater.from(container.getContext());<NEW_LINE>Resources res = container.getContext().getResources();<NEW_LINE>View tab = inflater.inflate(R.layout.custom_tab_icon_and_notification_mark, container, false);<NEW_LINE>View mark = tab.<MASK><NEW_LINE>mark.setVisibility(View.GONE);<NEW_LINE>ImageView icon = (ImageView) tab.findViewById(R.id.custom_tab_icon);<NEW_LINE>switch(position) {<NEW_LINE>case 0:<NEW_LINE>icon.setImageDrawable(res.getDrawable(R.drawable.ic_home_white_24dp));<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>icon.setImageDrawable(res.getDrawable(R.drawable.ic_search_white_24dp));<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>icon.setImageDrawable(res.getDrawable(R.drawable.ic_person_white_24dp));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("Invalid position: " + position);<NEW_LINE>}<NEW_LINE>return tab;<NEW_LINE>}
findViewById(R.id.custom_tab_notification_mark);
974,931
private byte[] encryptPassword(String pwd) {<NEW_LINE>// Changed to handle non ascii passwords<NEW_LINE>if (pwd == null)<NEW_LINE>pwd = "";<NEW_LINE>int len = pwd.length();<NEW_LINE>byte[] data = new byte[len * 2];<NEW_LINE>for (int i1 = 0; i1 < len; i1++) {<NEW_LINE>int j1 = pwd.charAt(i1) ^ 0x5a5a;<NEW_LINE>j1 = (j1 & 0xf) << 4 | (j1 & 0xf0) >> 4 | (j1 & 0xf00) << 4 | (j1 & 0xf000) >> 4;<NEW_LINE>byte b1 = (byte) ((<MASK><NEW_LINE>data[(i1 * 2) + 1] = b1;<NEW_LINE>byte b2 = (byte) ((j1 & 0x00FF));<NEW_LINE>data[(i1 * 2) + 0] = b2;<NEW_LINE>}<NEW_LINE>return data;<NEW_LINE>}
j1 & 0xFF00) >> 8);
758,816
SecurityDomainBuildItem build(ElytronRecorder recorder, List<SecurityRealmBuildItem> realms) throws Exception {<NEW_LINE>if (realms.size() > 0) {<NEW_LINE>// Configure the SecurityDomain.Builder from the main realm<NEW_LINE>SecurityRealmBuildItem realmBuildItem = realms.get(0);<NEW_LINE>RuntimeValue<SecurityDomain.Builder> securityDomainBuilder = recorder.configureDomainBuilder(realmBuildItem.getName(), realmBuildItem.getRealm());<NEW_LINE>// Add any additional SecurityRealms<NEW_LINE>for (int n = 1; n < realms.size(); n++) {<NEW_LINE>realmBuildItem = realms.get(n);<NEW_LINE>RuntimeValue<SecurityRealm> realm = realmBuildItem.getRealm();<NEW_LINE>recorder.addRealm(securityDomainBuilder, <MASK><NEW_LINE>}<NEW_LINE>// Actually build the runtime value for the SecurityDomain<NEW_LINE>RuntimeValue<SecurityDomain> securityDomain = recorder.buildDomain(securityDomainBuilder);<NEW_LINE>// Return the build item for the SecurityDomain runtime value<NEW_LINE>return new SecurityDomainBuildItem(securityDomain);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
realmBuildItem.getName(), realm);
315,849
public static String compileQuery(FAFQueryMethodForge query, String classPostfix, CompilerAbstractionClassCollection compilerState, ModuleCompileTimeServices compileTimeServices, CompilerPath path) throws StatementSpecCompileException {<NEW_LINE>String statementFieldsClassName = CodeGenerationIDGenerator.generateClassNameSimple(StatementFields.class, classPostfix);<NEW_LINE>CodegenPackageScope packageScope = new CodegenPackageScope(compileTimeServices.getPackageName(), statementFieldsClassName, compileTimeServices.isInstrumented(), compileTimeServices.getConfiguration().getCompiler().getByteCode());<NEW_LINE>String queryMethodProviderClassName = CodeGenerationIDGenerator.generateClassNameSimple(FAFQueryMethodProvider.class, classPostfix);<NEW_LINE>List<StmtClassForgeable> forgeablesQueryMethod = query.makeForgeables(queryMethodProviderClassName, classPostfix, packageScope);<NEW_LINE>List<StmtClassForgeable> forgeables = new ArrayList<>(forgeablesQueryMethod);<NEW_LINE>forgeables.add(new StmtClassForgeableStmtFields(statementFieldsClassName, packageScope));<NEW_LINE>// forge with statement-fields last<NEW_LINE>List<CodegenClass> classes = new ArrayList<>(forgeables.size());<NEW_LINE>for (StmtClassForgeable forgeable : forgeables) {<NEW_LINE>CodegenClass clazz = forgeable.forge(true, true);<NEW_LINE>if (clazz == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>classes.add(clazz);<NEW_LINE>}<NEW_LINE>// compile with statement-field first<NEW_LINE>classes.sort((o1, o2) -> Integer.compare(o1.getClassType().getSortCode(), o2.getClassType().getSortCode()));<NEW_LINE>// remove statement field initialization when unused<NEW_LINE>packageScope.rewriteStatementFieldUse(classes);<NEW_LINE>// add class-provided create-class to classpath<NEW_LINE>compileTimeServices.getClassProvidedCompileTimeResolver().addTo(compilerState::add);<NEW_LINE>CompilerAbstractionCompilationContext ctx = new CompilerAbstractionCompilationContext(compileTimeServices, path.getCompileds());<NEW_LINE>compileTimeServices.getCompilerAbstraction().compileClasses(classes, ctx, compilerState);<NEW_LINE>// remove path create-class class-provided byte code<NEW_LINE>compileTimeServices.getClassProvidedCompileTimeResolver(<MASK><NEW_LINE>return queryMethodProviderClassName;<NEW_LINE>}
).removeFrom(compilerState::remove);
339,382
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>* @see com.fasterxml.jackson.databind.ser.std.StdSerializer#serialize(java.lang.Object, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializerProvider)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>@SuppressWarnings("null")<NEW_LINE>public void serialize(Links value, JsonGenerator jgen, SerializerProvider provider) throws IOException {<NEW_LINE>// sort links according to their relation<NEW_LINE>MultiValueMap<String, Object> sortedLinks = new LinkedMultiValueMap<>();<NEW_LINE>List<Link> links = new ArrayList<>();<NEW_LINE>boolean prefixingRequired = curieProvider != CurieProvider.NONE;<NEW_LINE>boolean curiedLinkPresent = false;<NEW_LINE>boolean skipCuries = !jgen.getOutputContext().getParent().inRoot();<NEW_LINE>Object currentValue = jgen.getCurrentValue();<NEW_LINE>PropertyNamingStrategy propertyNamingStrategy = provider.getConfig().getPropertyNamingStrategy();<NEW_LINE>//<NEW_LINE>EmbeddedMapper //<NEW_LINE>transformingMapper = halConfiguration.isApplyPropertyNamingStrategy() ? mapper.with(propertyNamingStrategy) : mapper;<NEW_LINE>if (currentValue instanceof CollectionModel && transformingMapper.hasCuriedEmbed((CollectionModel<?>) currentValue)) {<NEW_LINE>curiedLinkPresent = true;<NEW_LINE>}<NEW_LINE>for (Link link : value) {<NEW_LINE>if (link.equals(CURIES_REQUIRED_DUE_TO_EMBEDS)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>LinkRelation rel = prefixingRequired ? curieProvider.getNamespacedRelFrom(link) : link.getRel();<NEW_LINE>HalLinkRelation <MASK><NEW_LINE>if (relation.isCuried()) {<NEW_LINE>curiedLinkPresent = true;<NEW_LINE>}<NEW_LINE>sortedLinks.add(relation.value(), toHalLink(link, relation));<NEW_LINE>links.add(link);<NEW_LINE>}<NEW_LINE>if (!skipCuries && prefixingRequired && curiedLinkPresent) {<NEW_LINE>Collection<?> curies = curieProvider.getCurieInformation(Links.of(links));<NEW_LINE>if (!curies.isEmpty()) {<NEW_LINE>sortedLinks.addAll(HalLinkRelation.CURIES.value(), new ArrayList<>(curies));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>TypeFactory typeFactory = provider.getConfig().getTypeFactory();<NEW_LINE>JavaType keyType = typeFactory.constructType(String.class);<NEW_LINE>JavaType valueType = typeFactory.constructCollectionType(ArrayList.class, Object.class);<NEW_LINE>JavaType mapType = typeFactory.constructMapType(HashMap.class, keyType, valueType);<NEW_LINE>MapSerializer serializer = MapSerializer.construct(Collections.emptySet(), mapType, true, null, provider.findKeySerializer(keyType, null), new OptionalListJackson2Serializer(property, halConfiguration), null);<NEW_LINE>serializer.serialize(sortedLinks, jgen, provider);<NEW_LINE>}
relation = transformingMapper.map(rel);
1,475,393
public boolean isValid(final String value) throws ValidationException {<NEW_LINE>if (selectValues == null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>Set<String> <MASK><NEW_LINE>if (value.indexOf(',') > 0) {<NEW_LINE>Stream<String> stream = Arrays.stream(value.split(", *"));<NEW_LINE>propvalset.addAll(stream.map(new Function<java.lang.String, java.lang.String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String apply(final String s1) {<NEW_LINE>return s1.trim();<NEW_LINE>}<NEW_LINE>}).filter(new Predicate<java.lang.String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean test(final String s) {<NEW_LINE>return !"".equals(s);<NEW_LINE>}<NEW_LINE>}).collect(Collectors.toSet()));<NEW_LINE>} else {<NEW_LINE>propvalset.add(value);<NEW_LINE>}<NEW_LINE>return selectValues.containsAll(propvalset);<NEW_LINE>}
propvalset = new HashSet<>();
1,593,573
private void acquireEventTickets(PaymentProxy paymentProxy, String reservationId, PurchaseContext purchaseContext, Event event) {<NEW_LINE>TicketStatus ticketStatus = paymentProxy.isDeskPaymentRequired() ? TicketStatus.TO_BE_PAID : TicketStatus.ACQUIRED;<NEW_LINE>AdditionalServiceItemStatus asStatus = paymentProxy.isDeskPaymentRequired() ? AdditionalServiceItemStatus.TO_BE_PAID : AdditionalServiceItemStatus.ACQUIRED;<NEW_LINE>Map<Integer, Ticket> preUpdateTicket = ticketRepository.findTicketsInReservation(reservationId).stream().collect(toMap(Ticket::getId, Function.identity()));<NEW_LINE>int updatedTickets = ticketRepository.updateTicketsStatusWithReservationId(reservationId, ticketStatus.toString());<NEW_LINE>if (!configurationManager.getFor(ENABLE_TICKET_TRANSFER, purchaseContext.getConfigurationLevel()).getValueAsBooleanOrDefault()) {<NEW_LINE>// automatically lock assignment<NEW_LINE>int locked = ticketRepository.forbidReassignment(preUpdateTicket.keySet());<NEW_LINE>Validate.isTrue(updatedTickets == locked, "Expected to lock " + updatedTickets + " tickets, locked " + locked);<NEW_LINE>Map<Integer, Ticket> postUpdateTicket = ticketRepository.findTicketsInReservation(reservationId).stream().collect(toMap(Ticket::getId, Function.identity()));<NEW_LINE>postUpdateTicket.forEach((id, ticket) -> auditUpdateTicket(preUpdateTicket.get(id), Collections.emptyMap(), ticket, Collections.emptyMap(), event.getId()));<NEW_LINE>}<NEW_LINE>var ticketsWithMetadataById = ticketRepository.findTicketsInReservationWithMetadata(reservationId).stream().collect(toMap(twm -> twm.getTicket().getId()<MASK><NEW_LINE>ticketsWithMetadataById.forEach((id, ticketWithMetadata) -> {<NEW_LINE>var newMetadataOptional = extensionManager.handleTicketAssignmentMetadata(ticketWithMetadata, event);<NEW_LINE>newMetadataOptional.ifPresent(metadata -> {<NEW_LINE>var existingContainer = TicketMetadataContainer.copyOf(ticketWithMetadata.getMetadata());<NEW_LINE>var general = new HashMap<>(existingContainer.getMetadataForKey(TicketMetadataContainer.GENERAL).orElseGet(TicketMetadata::empty).getAttributes());<NEW_LINE>general.putAll(metadata.getAttributes());<NEW_LINE>existingContainer.putMetadata(TicketMetadataContainer.GENERAL, new TicketMetadata(null, null, general));<NEW_LINE>ticketRepository.updateTicketMetadata(id, existingContainer);<NEW_LINE>auditUpdateMetadata(reservationId, id, event.getId(), existingContainer, ticketWithMetadata.getMetadata());<NEW_LINE>});<NEW_LINE>auditUpdateTicket(preUpdateTicket.get(id), Collections.emptyMap(), ticketWithMetadata.getTicket(), Collections.emptyMap(), event.getId());<NEW_LINE>});<NEW_LINE>int updatedAS = additionalServiceItemRepository.updateItemsStatusWithReservationUUID(reservationId, asStatus);<NEW_LINE>Validate.isTrue(updatedTickets + updatedAS > 0, "no items have been updated");<NEW_LINE>}
, Function.identity()));
16,466
final OptionGroup executeCreateOptionGroup(CreateOptionGroupRequest createOptionGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createOptionGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateOptionGroupRequest> request = null;<NEW_LINE>Response<OptionGroup> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateOptionGroupRequestMarshaller().marshall(super.beforeMarshalling(createOptionGroupRequest));<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, "RDS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateOptionGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<OptionGroup> responseHandler = new StaxResponseHandler<OptionGroup>(new OptionGroupStaxUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
1,831,988
private static void outputConfigurationToLog(final PwmApplication pwmApplication) {<NEW_LINE>final Instant startTime = Instant.now();<NEW_LINE>final Function<Map.Entry<String, String>, String> valueFormatter = entry -> {<NEW_LINE>final String spacedValue = entry.getValue().replace("\n", "\n ");<NEW_LINE>return " " + entry.getKey() + "\n " + spacedValue + "\n";<NEW_LINE>};<NEW_LINE>final StoredConfiguration storedConfiguration = pwmApplication.getConfig().getStoredConfiguration();<NEW_LINE>final List<StoredConfigKey> keys = CollectionUtil.iteratorToStream(storedConfiguration.keys()).collect(Collectors.toList());<NEW_LINE>final Map<String, String> debugStrings = StoredConfigurationUtil.makeDebugMap(storedConfiguration, keys, PwmConstants.DEFAULT_LOCALE);<NEW_LINE>LOGGER.trace(() -> "--begin current configuration output--");<NEW_LINE>final long itemCount = debugStrings.entrySet().stream().map(valueFormatter).map(s -> (Supplier<CharSequence>) () -> s).peek(<MASK><NEW_LINE>LOGGER.trace(() -> "--end current configuration output of " + itemCount + " items --", () -> TimeDuration.fromCurrent(startTime));<NEW_LINE>}
LOGGER::trace).count();
167,484
public JavaFileObject createFileObject(@NonNull final Location location, @NonNull final File file, @NonNull final File root, @NullAllowed final JavaFileFilterImplementation filter, @NullAllowed final Charset encoding) {<NEW_LINE>final String[] pkgNamePair = FileObjects.getFolderAndBaseName(FileObjects.getRelativePath(root, file), File.separatorChar);<NEW_LINE>String pname = FileObjects.convertFolder2Package(pkgNamePair[0], File.separatorChar);<NEW_LINE>CachedFileObject cfo = getFileObject(location, pname, pkgNamePair[1], false);<NEW_LINE>if (cfo != null) {<NEW_LINE>return cfo;<NEW_LINE>}<NEW_LINE>String relPath = FileObjects.getRelativePath(root, file);<NEW_LINE>File shadowRoot = new File(root.getParent(), root.getName() + WORK_SUFFIX);<NEW_LINE>File shadowFile = new File(shadowRoot, relPath);<NEW_LINE>workDirs.add(shadowRoot);<NEW_LINE>cfo = new CachedFileObject(this, file, pname, pkgNamePair[1], filter, encoding);<NEW_LINE>cfo.setShadowFile(shadowFile);<NEW_LINE><MASK><NEW_LINE>if (!shadowRoot.mkdirs() && !shadowRoot.exists() && !shadowRoot.isDirectory()) {<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}<NEW_LINE>return cfo;<NEW_LINE>}
addFile(location, pname, cfo);
658,057
public AbstractIntegrationMessageBuilder<T> popSequenceDetails() {<NEW_LINE>List<List<Object>> incomingSequenceDetails = getSequenceDetails();<NEW_LINE>if (incomingSequenceDetails == null) {<NEW_LINE>return this;<NEW_LINE>} else {<NEW_LINE>incomingSequenceDetails = new ArrayList<>(incomingSequenceDetails);<NEW_LINE>}<NEW_LINE>List<Object> sequenceDetails = incomingSequenceDetails.remove(incomingSequenceDetails.size() - 1);<NEW_LINE>// NOSONAR<NEW_LINE>// NOSONAR<NEW_LINE>Assert.// NOSONAR<NEW_LINE>state(sequenceDetails.size() == 3, () -> "Wrong sequence details (not created by MessageBuilder?): " + sequenceDetails);<NEW_LINE>setCorrelationId(sequenceDetails.get(0));<NEW_LINE>Integer sequenceNumber = (Integer) sequenceDetails.get(1);<NEW_LINE>Integer sequenceSize = (Integer) sequenceDetails.get(2);<NEW_LINE>if (sequenceNumber != null) {<NEW_LINE>setSequenceNumber(sequenceNumber);<NEW_LINE>}<NEW_LINE>if (sequenceSize != null) {<NEW_LINE>setSequenceSize(sequenceSize);<NEW_LINE>}<NEW_LINE>if (!incomingSequenceDetails.isEmpty()) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>removeHeader(IntegrationMessageHeaderAccessor.SEQUENCE_DETAILS);<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
setHeader(IntegrationMessageHeaderAccessor.SEQUENCE_DETAILS, incomingSequenceDetails);
140,035
private static boolean hasFillerValue(Type type, List<Type> unanalyzedTypes) {<NEW_LINE>if (type == null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>int typeTag = type.getTag();<NEW_LINE>if (TypeTags.isXMLTypeTag(typeTag)) {<NEW_LINE>return typeTag == TypeTags.XML_TAG || typeTag == TypeTags.XML_TEXT_TAG;<NEW_LINE>}<NEW_LINE>if (typeTag < TypeTags.RECORD_TYPE_TAG && !(typeTag == TypeTags.CHAR_STRING_TAG || typeTag == TypeTags.NEVER_TAG)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>switch(typeTag) {<NEW_LINE>case TypeTags.STREAM_TAG:<NEW_LINE>case TypeTags.MAP_TAG:<NEW_LINE>case TypeTags.ANY_TAG:<NEW_LINE>return true;<NEW_LINE>case TypeTags.ARRAY_TAG:<NEW_LINE>return checkFillerValue((BArrayType) type, unanalyzedTypes);<NEW_LINE>case TypeTags.FINITE_TYPE_TAG:<NEW_LINE>return checkFillerValue((BFiniteType) type);<NEW_LINE>case TypeTags.OBJECT_TYPE_TAG:<NEW_LINE><MASK><NEW_LINE>case TypeTags.RECORD_TYPE_TAG:<NEW_LINE>return checkFillerValue((BRecordType) type, unanalyzedTypes);<NEW_LINE>case TypeTags.TUPLE_TAG:<NEW_LINE>return checkFillerValue((BTupleType) type, unanalyzedTypes);<NEW_LINE>case TypeTags.UNION_TAG:<NEW_LINE>return checkFillerValue((BUnionType) type, unanalyzedTypes);<NEW_LINE>default:<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
return checkFillerValue((BObjectType) type);
100,559
public synchronized JSONObject startEatingSnake(final String userId) {<NEW_LINE>final JSONObject ret = new JSONObject().put(Keys.CODE, StatusCodes.ERR);<NEW_LINE>final int startPoint = pointtransferRepository.getActivityEatingSnakeAvg(userId);<NEW_LINE>final boolean succ = null != pointtransferMgmtService.transfer(userId, Pointtransfer.ID_C_SYS, Pointtransfer.TRANSFER_TYPE_C_ACTIVITY_EATINGSNAKE, startPoint, "", System.currentTimeMillis(), "");<NEW_LINE>if (succ) {<NEW_LINE>ret.put(Keys.CODE, StatusCodes.SUCC);<NEW_LINE>}<NEW_LINE>final String msg = succ ? "started" : langPropsService.get("activityStartEatingSnakeFailLabel");<NEW_LINE>ret.<MASK><NEW_LINE>livenessMgmtService.incLiveness(userId, Liveness.LIVENESS_ACTIVITY);<NEW_LINE>return ret;<NEW_LINE>}
put(Keys.MSG, msg);
1,426,856
private DataSet generateDataSet(int batchSize) {<NEW_LINE>int w = (int) originalImage.getWidth();<NEW_LINE>int h = (int) originalImage.getHeight();<NEW_LINE>PixelReader reader = originalImage.getPixelReader();<NEW_LINE>INDArray xy = Nd4j.zeros(batchSize, 2);<NEW_LINE>INDArray out = Nd4j.zeros(batchSize, 3);<NEW_LINE>for (int index = 0; index < batchSize; index++) {<NEW_LINE>int i = r.nextInt(w);<NEW_LINE>int j = r.nextInt(h);<NEW_LINE>double xp = scaleXY(i, w);<NEW_LINE>double yp = scaleXY(j, h);<NEW_LINE>Color c = reader.getColor(i, j);<NEW_LINE>// 2 inputs. x and y.<NEW_LINE>xy.put(index, 0, xp);<NEW_LINE>xy.put(index, 1, yp);<NEW_LINE>// 3 outputs. the RGB values.<NEW_LINE>out.put(index, <MASK><NEW_LINE>out.put(index, 1, c.getGreen());<NEW_LINE>out.put(index, 2, c.getBlue());<NEW_LINE>}<NEW_LINE>return new DataSet(xy, out);<NEW_LINE>}
0, c.getRed());
493,730
public static void validateSettings(Settings settings) {<NEW_LINE>// wan means all node restrictions are off the table<NEW_LINE>if (settings.getNodesWANOnly()) {<NEW_LINE>Assert.isTrue(!settings.getNodesDiscovery(), "Discovery cannot be enabled when running in WAN mode");<NEW_LINE>Assert.isTrue(!<MASK><NEW_LINE>Assert.isTrue(!settings.getNodesDataOnly(), "Data-only nodes cannot be enabled when running in WAN mode");<NEW_LINE>Assert.isTrue(!settings.getNodesIngestOnly(), "Ingest-only nodes cannot be enabled when running in WAN mode");<NEW_LINE>}<NEW_LINE>// pick between data or client or ingest only nodes<NEW_LINE>boolean alreadyRestricted = false;<NEW_LINE>boolean[] restrictions = { settings.getNodesClientOnly(), settings.getNodesDataOnly(), settings.getNodesIngestOnly() };<NEW_LINE>for (boolean restriction : restrictions) {<NEW_LINE>Assert.isTrue((alreadyRestricted && restriction) == false, "Use either client-only or data-only or ingest-only nodes but not a combination");<NEW_LINE>alreadyRestricted = alreadyRestricted || restriction;<NEW_LINE>}<NEW_LINE>// field inclusion/exclusion + input as json does not mix and the user should be informed.<NEW_LINE>if (settings.getInputAsJson()) {<NEW_LINE>Assert.isTrue(settings.getMappingIncludes().isEmpty(), "When writing data as JSON, the field inclusion feature is ignored. This is most likely not what the user intended. Bailing out...");<NEW_LINE>Assert.isTrue(settings.getMappingExcludes().isEmpty(), "When writing data as JSON, the field exclusion feature is ignored. This is most likely not what the user intended. Bailing out...");<NEW_LINE>}<NEW_LINE>// check the configuration is coherent in order to use the delete operation<NEW_LINE>if (ConfigurationOptions.ES_OPERATION_DELETE.equals(settings.getOperation())) {<NEW_LINE>Assert.isTrue(!settings.getInputAsJson(), "When using delete operation, providing data as JSON is not coherent because this operation does not need document as a payload. This is most likely not what the user intended. Bailing out...");<NEW_LINE>Assert.isTrue(settings.getMappingIncludes().isEmpty(), "When using delete operation, the field inclusion feature is ignored. This is most likely not what the user intended. Bailing out...");<NEW_LINE>Assert.isTrue(settings.getMappingExcludes().isEmpty(), "When using delete operation, the field exclusion feature is ignored. This is most likely not what the user intended. Bailing out...");<NEW_LINE>Assert.isTrue(settings.getMappingId() != null && !StringUtils.EMPTY.equals(settings.getMappingId()), "When using delete operation, the property " + ConfigurationOptions.ES_MAPPING_ID + " must be set and must not be empty since we need the document id in order to delete it. Bailing out...");<NEW_LINE>}<NEW_LINE>// Check to make sure user doesn't specify more than one script type<NEW_LINE>boolean hasScript = false;<NEW_LINE>String[] scripts = { settings.getUpdateScriptInline(), settings.getUpdateScriptFile(), settings.getUpdateScriptStored() };<NEW_LINE>for (String script : scripts) {<NEW_LINE>boolean isSet = StringUtils.hasText(script);<NEW_LINE>Assert.isTrue((hasScript && isSet) == false, "Multiple scripts are specified. Please specify only one via [es.update.script.inline], [es.update.script.file], or [es.update.script.stored]");<NEW_LINE>hasScript = hasScript || isSet;<NEW_LINE>}<NEW_LINE>// Early attempt to catch the internal field filtering clashing with user specified field filtering<NEW_LINE>// ignore return, just checking for the throw.<NEW_LINE>SettingsUtils.determineSourceFields(settings);<NEW_LINE>}
settings.getNodesClientOnly(), "Client-only nodes cannot be enabled when running in WAN mode");
1,696,120
private void testSynthesizeFromDatagrams(LinkedList<HnmDatagram> datagrams, int startIndex, int endIndex, DataOutputStream output) throws IOException {<NEW_LINE>HntmSynthesizer s = new HntmSynthesizer();<NEW_LINE>// TODO: These should come from timeline and user choices...<NEW_LINE>HntmAnalyzerParams hnmAnalysisParams = new HntmAnalyzerParams();<NEW_LINE>HntmSynthesizerParams synthesisParams = new HntmSynthesizerParams();<NEW_LINE>BasicProsodyModifierParams pmodParams = new BasicProsodyModifierParams();<NEW_LINE><MASK><NEW_LINE>int totalFrm = 0;<NEW_LINE>int i;<NEW_LINE>float originalDurationInSeconds = 0.0f;<NEW_LINE>float deltaTimeInSeconds;<NEW_LINE>for (i = startIndex; i <= endIndex; i++) {<NEW_LINE>HnmDatagram datagram;<NEW_LINE>try {<NEW_LINE>datagram = datagrams.get(i);<NEW_LINE>} catch (IndexOutOfBoundsException e) {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>if (datagram != null && datagram instanceof HnmDatagram) {<NEW_LINE>totalFrm++;<NEW_LINE>// deltaTimeInSeconds = SignalProcUtils.sample2time(((HnmDatagram)datagrams.get(i)).getDuration(),<NEW_LINE>// samplingRateInHz);<NEW_LINE>deltaTimeInSeconds = datagram.frame.deltaAnalysisTimeInSeconds;<NEW_LINE>originalDurationInSeconds += deltaTimeInSeconds;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>HntmSpeechSignal hnmSignal = new HntmSpeechSignal(totalFrm, samplingRateInHz, originalDurationInSeconds);<NEW_LINE>int frameCount = 0;<NEW_LINE>float tAnalysisInSeconds = 0.0f;<NEW_LINE>for (i = startIndex; i <= endIndex; i++) {<NEW_LINE>HnmDatagram datagram;<NEW_LINE>try {<NEW_LINE>datagram = datagrams.get(i);<NEW_LINE>} catch (IndexOutOfBoundsException e) {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>if (datagram != null && datagram instanceof HnmDatagram) {<NEW_LINE>// tAnalysisInSeconds += SignalProcUtils.sample2time(((HnmDatagram)datagrams.get(i)).getDuration(),<NEW_LINE>// samplingRateInHz);<NEW_LINE>tAnalysisInSeconds += datagram.getFrame().deltaAnalysisTimeInSeconds;<NEW_LINE>if (frameCount < totalFrm) {<NEW_LINE>hnmSignal.frames[frameCount] = new HntmSpeechFrame(datagram.getFrame());<NEW_LINE>hnmSignal.frames[frameCount].tAnalysisInSeconds = tAnalysisInSeconds;<NEW_LINE>frameCount++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>HntmSynthesizedSignal ss = null;<NEW_LINE>if (totalFrm > 0) {<NEW_LINE>ss = s.synthesize(hnmSignal, null, null, pmodParams, null, hnmAnalysisParams, synthesisParams);<NEW_LINE>FileUtils.writeBinaryFile(ArrayUtils.copyDouble2Short(ss.output), output);<NEW_LINE>if (ss.output != null) {<NEW_LINE>// why is this done here?<NEW_LINE>ss.output = MathUtils.multiply(ss.output, 1.0 / 32768.0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}
int samplingRateInHz = this.getSampleRate();
1,662,987
private OnHeapValueHolder<V> newUpdateValueHolder(K key, OnHeapValueHolder<V> oldValue, V newValue, long now, StoreEventSink<K, V> eventSink) {<NEW_LINE>Objects.requireNonNull(oldValue);<NEW_LINE>Objects.requireNonNull(newValue);<NEW_LINE>Duration duration = strategy.getUpdateDuration(key, oldValue, newValue);<NEW_LINE>if (Duration.ZERO.equals(duration)) {<NEW_LINE>eventSink.updated(key, oldValue, newValue);<NEW_LINE>eventSink.expired(key, () -> newValue);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>long expirationTime;<NEW_LINE>if (duration == null) {<NEW_LINE>expirationTime = oldValue.expirationTime();<NEW_LINE>} else {<NEW_LINE>if (isExpiryDurationInfinite(duration)) {<NEW_LINE>expirationTime = ValueHolder.NO_EXPIRE;<NEW_LINE>} else {<NEW_LINE>expirationTime = ExpiryUtils.getExpirationMillis(now, duration);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>OnHeapValueHolder<V> holder = null;<NEW_LINE>try {<NEW_LINE>holder = makeValue(key, newValue, now, expirationTime, this.valueCopier);<NEW_LINE>eventSink.updated(key, oldValue, newValue);<NEW_LINE>} catch (LimitExceededException e) {<NEW_LINE>LOG.warn(e.getMessage());<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return holder;<NEW_LINE>}
eventSink.removed(key, oldValue);
1,597,616
private ImmutableList<DocumentLayoutElementGroupDescriptor.Builder> createLayoutElemementTab(@NonNull final DataEntrySection dataEntrySection) {<NEW_LINE>final int columnCount = dataEntrySection.getLines().stream().map(DataEntryLine::getFields).map(Collection::size).max(Comparator.naturalOrder<MASK><NEW_LINE>final ImmutableList.Builder<DocumentLayoutElementGroupDescriptor.Builder> elementGroups = ImmutableList.builder();<NEW_LINE>final List<DataEntryLine> dataEntryLines = dataEntrySection.getLines();<NEW_LINE>for (final DataEntryLine dataEntryLine : dataEntryLines) {<NEW_LINE>final DocumentLayoutElementGroupDescriptor.Builder elementGroup = DocumentLayoutElementGroupDescriptor.builder().setColumnCount(columnCount);<NEW_LINE>final ImmutableList<DocumentLayoutElementLineDescriptor.Builder> elementLines = createLayoutElemementLine(dataEntryLine, columnCount);<NEW_LINE>elementGroup.addElementLines(elementLines);<NEW_LINE>elementGroups.add(elementGroup);<NEW_LINE>}<NEW_LINE>return elementGroups.build();<NEW_LINE>}
()).orElse(0);
798,777
public void execute() throws BuildException {<NEW_LINE>DownloadXml downloadXml = this.parseDownloadXml();<NEW_LINE>// If we weren't supplied a download xml file then exit now<NEW_LINE>if (downloadXml == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DownloadItem downloadItem = new DownloadItem();<NEW_LINE>downloadItem.setName(this.name);<NEW_LINE>downloadItem.setLicenses(this.licenses);<NEW_LINE>downloadItem.setFile(this.filePath);<NEW_LINE>downloadItem.setProductId(this.productId);<NEW_LINE>downloadItem.setProductEdition(this.productEdition);<NEW_LINE>downloadItem.setType(this.type);<NEW_LINE>downloadItem.setProductLicenseType(this.licenseType);<NEW_LINE>downloadItem.setProductVersion(this.productVersion);<NEW_LINE><MASK><NEW_LINE>downloadItem.setDownloadSize(Long.parseLong(this.archiveSize));<NEW_LINE>downloadItem.setAppliesTo(this.appliesTo);<NEW_LINE>downloadItem.setProvideFeature(this.provideFeature);<NEW_LINE>downloadItem.setDescription(this.description);<NEW_LINE>downloadXml.getDownloadItems().add(downloadItem);<NEW_LINE>this.writeDownloadXml(downloadXml);<NEW_LINE>}
downloadItem.setProductInstallType(this.installType);
1,504,851
public XContentBuilder toXContentEmbedded(XContentBuilder builder, Params params) throws IOException {<NEW_LINE>if (seqNo != UNASSIGNED_SEQ_NO) {<NEW_LINE>// seqNo may not be assigned if read from an old node<NEW_LINE>builder.field(_SEQ_NO, seqNo);<NEW_LINE>builder.field(_PRIMARY_TERM, primaryTerm);<NEW_LINE>}<NEW_LINE>for (DocumentField field : metaFields.values()) {<NEW_LINE>// TODO: can we avoid having an exception here?<NEW_LINE>if (field.getName().equals(IgnoredFieldMapper.NAME)) {<NEW_LINE>builder.field(field.getName(), field.getValues());<NEW_LINE>} else {<NEW_LINE>builder.field(field.getName(), field.<Object>getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (source != null) {<NEW_LINE>XContentHelper.writeRawField(SourceFieldMapper.NAME, source, builder, params);<NEW_LINE>}<NEW_LINE>if (!documentFields.isEmpty()) {<NEW_LINE>builder.startObject(FIELDS);<NEW_LINE>for (DocumentField field : documentFields.values()) {<NEW_LINE>field.toXContent(builder, params);<NEW_LINE>}<NEW_LINE>builder.endObject();<NEW_LINE>}<NEW_LINE>return builder;<NEW_LINE>}
builder.field(FOUND, exists);
40,214
public final void moduleName() throws RecognitionException, TokenStreamException {<NEW_LINE>returnAST = null;<NEW_LINE>ASTPair currentAST = new ASTPair();<NEW_LINE>AST moduleName_AST = null;<NEW_LINE>switch(LA(1)) {<NEW_LINE>case CONSTANT:<NEW_LINE>{<NEW_LINE>AST tmp379_AST = null;<NEW_LINE>tmp379_AST = astFactory.create(LT(1));<NEW_LINE>astFactory.addASTChild(currentAST, tmp379_AST);<NEW_LINE>match(CONSTANT);<NEW_LINE>{<NEW_LINE>_loop309: do {<NEW_LINE>if ((LA(1) == COLON2)) {<NEW_LINE>AST tmp380_AST = null;<NEW_LINE>tmp380_AST = astFactory.create(LT(1));<NEW_LINE>astFactory.makeASTRoot(currentAST, tmp380_AST);<NEW_LINE>match(COLON2);<NEW_LINE>AST tmp381_AST = null;<NEW_LINE>tmp381_AST = astFactory.create(LT(1));<NEW_LINE>astFactory.addASTChild(currentAST, tmp381_AST);<NEW_LINE>match(CONSTANT);<NEW_LINE>} else {<NEW_LINE>break _loop309;<NEW_LINE>}<NEW_LINE>} while (true);<NEW_LINE>}<NEW_LINE>moduleName_AST = (AST) currentAST.root;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case LEADING_COLON2:<NEW_LINE>{<NEW_LINE>{<NEW_LINE>AST tmp382_AST = null;<NEW_LINE>tmp382_AST = astFactory.create(LT(1));<NEW_LINE>astFactory.addASTChild(currentAST, tmp382_AST);<NEW_LINE>match(LEADING_COLON2);<NEW_LINE>AST tmp383_AST = null;<NEW_LINE>tmp383_AST = astFactory.create(LT(1));<NEW_LINE>astFactory.addASTChild(currentAST, tmp383_AST);<NEW_LINE>match(CONSTANT);<NEW_LINE>}<NEW_LINE>{<NEW_LINE>_loop312: do {<NEW_LINE>if ((LA(1) == COLON2)) {<NEW_LINE>AST tmp384_AST = null;<NEW_LINE>tmp384_AST = astFactory.create(LT(1));<NEW_LINE><MASK><NEW_LINE>match(COLON2);<NEW_LINE>AST tmp385_AST = null;<NEW_LINE>tmp385_AST = astFactory.create(LT(1));<NEW_LINE>astFactory.addASTChild(currentAST, tmp385_AST);<NEW_LINE>match(CONSTANT);<NEW_LINE>} else {<NEW_LINE>break _loop312;<NEW_LINE>}<NEW_LINE>} while (true);<NEW_LINE>}<NEW_LINE>moduleName_AST = (AST) currentAST.root;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>throw new NoViableAltException(LT(1), getFilename());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>returnAST = moduleName_AST;<NEW_LINE>}
astFactory.makeASTRoot(currentAST, tmp384_AST);
1,714,884
public void marshall(ExportJobProperties exportJobProperties, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (exportJobProperties == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(exportJobProperties.getJobId(), JOBID_BINDING);<NEW_LINE>protocolMarshaller.marshall(exportJobProperties.getJobName(), JOBNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(exportJobProperties.getJobStatus(), JOBSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(exportJobProperties.getEndTime(), ENDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(exportJobProperties.getDatastoreId(), DATASTOREID_BINDING);<NEW_LINE>protocolMarshaller.marshall(exportJobProperties.getOutputDataConfig(), OUTPUTDATACONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(exportJobProperties.getDataAccessRoleArn(), DATAACCESSROLEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(exportJobProperties.getMessage(), MESSAGE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
exportJobProperties.getSubmitTime(), SUBMITTIME_BINDING);
1,142,856
public static void response(ByteString stmt, ServerConnection c, int offset, boolean hasMore) {<NEW_LINE>List<SQLStatement> stmtList = FastsqlUtils.parseSql(stmt);<NEW_LINE>if (stmtList.size() != 1) {<NEW_LINE>c.writeErrMessage(ErrorCode.ERR_HANDLE_DATA, "dose not support multi statement in flush tables");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!(stmtList.get(0) instanceof MySqlFlushStatement)) {<NEW_LINE>c.writeErrMessage(ErrorCode.ERR_HANDLE_DATA, "illegal flush statement");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MySqlFlushStatement flushStmt = (MySqlFlushStatement) stmtList.get(0);<NEW_LINE>if (!isFlushTableWithReadLock(flushStmt) && !isFlushPrivileges(flushStmt)) {<NEW_LINE>c.writeErrMessage(ErrorCode.ERR_HANDLE_DATA, "unsupported flush statement");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// do nothing<NEW_LINE>PacketOutputProxyFactory.getInstance().createProxy(c).writeArrayAsPacket(hasMore ? <MASK><NEW_LINE>}
OkPacket.OK_WITH_MORE : OkPacket.OK);
415,260
private void insertIntoDatabaseInTrx(final List<ImpDataLine> lines) {<NEW_LINE>final SqlAndParamsExtractor<ImpDataLine> sqlAndParamsExtractor = getInsertIntoImportTableSql();<NEW_LINE>final String sql = sqlAndParamsExtractor.getSql();<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>final ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, ITrx.TRXNAME_ThreadInherited);<NEW_LINE>for (final ImpDataLine line : lines) {<NEW_LINE>final List<Object> params = sqlAndParamsExtractor.extractParameters(line);<NEW_LINE>DB.setParameters(pstmt, params);<NEW_LINE>pstmt.addBatch();<NEW_LINE>// Update stats:<NEW_LINE>countTotalRows++;<NEW_LINE>if (line.hasErrors()) {<NEW_LINE>errors.add(InsertIntoImportTableResult.Error.builder().message(line.getErrorMessageAsStringOrNull()).lineNo(line.getFileLineNo()).lineContent(line.getLineString<MASK><NEW_LINE>} else {<NEW_LINE>countValidRows++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>pstmt.executeBatch();<NEW_LINE>} catch (final SQLException ex) {<NEW_LINE>throw new DBException(ex, sql);<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>}<NEW_LINE>}
()).build());
1,350,211
// Non-static to support DI.<NEW_LINE>@SuppressWarnings("MethodMayBeStatic")<NEW_LINE>public long parse(final String text) {<NEW_LINE>final String date;<NEW_LINE>final String time;<NEW_LINE>final String timezone;<NEW_LINE>if (text.contains("T")) {<NEW_LINE>date = text.substring(0, text.indexOf('T'));<NEW_LINE>final String withTimezone = completeTime(text.substring(text.indexOf('T') + 1));<NEW_LINE>timezone = getTimezone(withTimezone);<NEW_LINE>time = completeTime(withTimezone.substring(0, withTimezone.length() <MASK><NEW_LINE>} else {<NEW_LINE>date = completeDate(text);<NEW_LINE>time = completeTime("");<NEW_LINE>timezone = "";<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final ZoneId zoneId = parseTimezone(timezone);<NEW_LINE>return PARSER.parse(date + "T" + time, zoneId);<NEW_LINE>} catch (final RuntimeException e) {<NEW_LINE>throw new KsqlException("Failed to parse timestamp '" + text + "': " + e.getMessage() + HELP_MESSAGE, e);<NEW_LINE>}<NEW_LINE>}
- timezone.length()));
1,084,272
private Dll closestDll(Edb edb, long address) throws IOException {<NEW_LINE>Dll closestDll = null;<NEW_LINE>long closestDist = Long.MAX_VALUE;<NEW_LINE>for (Dll dll = edb.getFirstDll(); dll != null; dll = dll.getNext()) {<NEW_LINE>final DllFunction[] f = dll.getFunctions();<NEW_LINE>for (int i = 0; i < f.length; ++i) {<NEW_LINE>long dist = Math.abs(f<MASK><NEW_LINE>if (dist < closestDist) {<NEW_LINE>closestDll = dll;<NEW_LINE>closestDist = dist;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final DllVariable[] g = dll.getVariables();<NEW_LINE>for (int i = 0; i < g.length; ++i) {<NEW_LINE>long dist = Math.abs(g[i].address - address);<NEW_LINE>if (dist < closestDist) {<NEW_LINE>closestDll = dll;<NEW_LINE>closestDist = dist;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return closestDll;<NEW_LINE>}
[i].address - address);
1,191,170
public void sendHttpRequest(final HttpRequest httpRequest, final HttpResponseListener httpResultListener) {<NEW_LINE>if (httpRequest.getUrl() == null) {<NEW_LINE>httpResultListener.failed(new GdxRuntimeException("can't process a HTTP request without URL set"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String method = httpRequest.getMethod();<NEW_LINE>final String value = httpRequest.getContent();<NEW_LINE>final boolean valueInBody = method.equalsIgnoreCase(HttpMethods.POST) || <MASK><NEW_LINE>RequestBuilder builder;<NEW_LINE>String url = httpRequest.getUrl();<NEW_LINE>if (method.equalsIgnoreCase(HttpMethods.HEAD)) {<NEW_LINE>if (value != null) {<NEW_LINE>url += "?" + value;<NEW_LINE>}<NEW_LINE>builder = new RequestBuilder(RequestBuilder.HEAD, url);<NEW_LINE>} else if (method.equalsIgnoreCase(HttpMethods.GET)) {<NEW_LINE>if (value != null) {<NEW_LINE>url += "?" + value;<NEW_LINE>}<NEW_LINE>builder = new RequestBuilder(RequestBuilder.GET, url);<NEW_LINE>} else if (method.equalsIgnoreCase(HttpMethods.POST)) {<NEW_LINE>builder = new RequestBuilder(RequestBuilder.POST, url);<NEW_LINE>} else if (method.equalsIgnoreCase(HttpMethods.DELETE)) {<NEW_LINE>if (value != null) {<NEW_LINE>url += "?" + value;<NEW_LINE>}<NEW_LINE>builder = new RequestBuilder(RequestBuilder.DELETE, url);<NEW_LINE>} else if (method.equalsIgnoreCase(HttpMethods.PUT)) {<NEW_LINE>builder = new RequestBuilder(RequestBuilder.PUT, url);<NEW_LINE>} else {<NEW_LINE>throw new GdxRuntimeException("Unsupported HTTP Method");<NEW_LINE>}<NEW_LINE>Map<String, String> content = httpRequest.getHeaders();<NEW_LINE>Set<String> keySet = content.keySet();<NEW_LINE>for (String name : keySet) {<NEW_LINE>builder.setHeader(name, content.get(name));<NEW_LINE>}<NEW_LINE>builder.setTimeoutMillis(httpRequest.getTimeOut());<NEW_LINE>builder.setIncludeCredentials(httpRequest.getIncludeCredentials());<NEW_LINE>try {<NEW_LINE>Request request = builder.sendRequest(valueInBody ? value : null, new RequestCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponseReceived(Request request, Response response) {<NEW_LINE>if (response.getStatusCode() > 0) {<NEW_LINE>httpResultListener.handleHttpResponse(new HttpClientResponse(response));<NEW_LINE>requests.remove(httpRequest);<NEW_LINE>listeners.remove(httpRequest);<NEW_LINE>} else {<NEW_LINE>onError(request, new IOException("HTTP request failed"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(Request request, Throwable exception) {<NEW_LINE>httpResultListener.failed(exception);<NEW_LINE>requests.remove(httpRequest);<NEW_LINE>listeners.remove(httpRequest);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>requests.put(httpRequest, request);<NEW_LINE>listeners.put(httpRequest, httpResultListener);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>httpResultListener.failed(e);<NEW_LINE>}<NEW_LINE>}
method.equals(HttpMethods.PUT);
1,547,111
public DescribeMovingAddressesResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeMovingAddressesResult describeMovingAddressesResult = new DescribeMovingAddressesResult();<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>int xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent == XmlPullParser.END_DOCUMENT)<NEW_LINE>return describeMovingAddressesResult;<NEW_LINE>if (xmlEvent == XmlPullParser.START_TAG) {<NEW_LINE>if (context.testExpression("movingAddressStatusSet/item", targetDepth)) {<NEW_LINE>describeMovingAddressesResult.getMovingAddressStatuses().add(MovingAddressStatusStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>describeMovingAddressesResult.setNextToken(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent == XmlPullParser.END_TAG) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return describeMovingAddressesResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().unmarshall(context));
581,606
private Map<String, List<Token>> readSimpleDict() throws IOException {<NEW_LINE>Map<String, List<Token>> dict = new HashMap<String, List<Token>>();<NEW_LINE>int length = read(<MASK><NEW_LINE>read(Token.NAME, "dict");<NEW_LINE>readMaybe(Token.NAME, "dup");<NEW_LINE>read(Token.NAME, "begin");<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>if (lexer.peekToken() == null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (lexer.peekToken().getKind() == Token.NAME && !lexer.peekToken().getText().equals("end")) {<NEW_LINE>read(Token.NAME);<NEW_LINE>}<NEW_LINE>// premature end<NEW_LINE>if (lexer.peekToken() == null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (lexer.peekToken().getKind() == Token.NAME && lexer.peekToken().getText().equals("end")) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// simple value<NEW_LINE>String key = read(Token.LITERAL).getText();<NEW_LINE>List<Token> value = readDictValue();<NEW_LINE>dict.put(key, value);<NEW_LINE>}<NEW_LINE>read(Token.NAME, "end");<NEW_LINE>readMaybe(Token.NAME, "readonly");<NEW_LINE>read(Token.NAME, "def");<NEW_LINE>return dict;<NEW_LINE>}
Token.INTEGER).intValue();
902,332
private HoodieLogBlock createCorruptBlock() throws IOException {<NEW_LINE>LOG.info("Log " + logFile + <MASK><NEW_LINE>long currentPos = inputStream.getPos();<NEW_LINE>long nextBlockOffset = scanForNextAvailableBlockOffset();<NEW_LINE>// Rewind to the initial start and read corrupted bytes till the nextBlockOffset<NEW_LINE>inputStream.seek(currentPos);<NEW_LINE>LOG.info("Next available block in " + logFile + " starts at " + nextBlockOffset);<NEW_LINE>int corruptedBlockSize = (int) (nextBlockOffset - currentPos);<NEW_LINE>long contentPosition = inputStream.getPos();<NEW_LINE>Option<byte[]> corruptedBytes = HoodieLogBlock.tryReadContent(inputStream, corruptedBlockSize, readBlockLazily);<NEW_LINE>HoodieLogBlock.HoodieLogBlockContentLocation logBlockContentLoc = new HoodieLogBlock.HoodieLogBlockContentLocation(hadoopConf, logFile, contentPosition, corruptedBlockSize, nextBlockOffset);<NEW_LINE>return new HoodieCorruptBlock(corruptedBytes, inputStream, readBlockLazily, Option.of(logBlockContentLoc), new HashMap<>(), new HashMap<>());<NEW_LINE>}
" has a corrupted block at " + inputStream.getPos());
258,348
public static String resetPassword(Main main, String token, String password) throws ResetPasswordInvalidTokenException, NoSuchAlgorithmException, StorageQueryException, StorageTransactionLogicException {<NEW_LINE>String hashedToken = Utils.hashSHA256(token);<NEW_LINE>String hashedPassword = PasswordHashing.getInstance(main).createHashWithSalt(password);<NEW_LINE>EmailPasswordSQLStorage storage = StorageLayer.getEmailPasswordStorage(main);<NEW_LINE>PasswordResetTokenInfo resetInfo = storage.getPasswordResetTokenInfo(hashedToken);<NEW_LINE>if (resetInfo == null) {<NEW_LINE>throw new ResetPasswordInvalidTokenException();<NEW_LINE>}<NEW_LINE>final String userId = resetInfo.userId;<NEW_LINE>try {<NEW_LINE>return storage.startTransaction(con -> {<NEW_LINE>PasswordResetTokenInfo[] allTokens = storage.getAllPasswordResetTokenInfoForUser_Transaction(con, userId);<NEW_LINE>PasswordResetTokenInfo matchedToken = null;<NEW_LINE>for (PasswordResetTokenInfo tok : allTokens) {<NEW_LINE>if (tok.token.equals(hashedToken)) {<NEW_LINE>matchedToken = tok;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (matchedToken == null) {<NEW_LINE>throw new StorageTransactionLogicException(new ResetPasswordInvalidTokenException());<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (matchedToken.tokenExpiry < System.currentTimeMillis()) {<NEW_LINE>storage.commitTransaction(con);<NEW_LINE>throw new StorageTransactionLogicException(new ResetPasswordInvalidTokenException());<NEW_LINE>}<NEW_LINE>storage.updateUsersPassword_Transaction(con, userId, hashedPassword);<NEW_LINE>storage.commitTransaction(con);<NEW_LINE>return userId;<NEW_LINE>});<NEW_LINE>} catch (StorageTransactionLogicException e) {<NEW_LINE>if (e.actualException instanceof ResetPasswordInvalidTokenException) {<NEW_LINE>throw (ResetPasswordInvalidTokenException) e.actualException;<NEW_LINE>}<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}
storage.deleteAllPasswordResetTokensForUser_Transaction(con, userId);
135,442
private static File downLoadEnv(MLContext MLContext) throws IOException {<NEW_LINE>Path remote = new Path(MLContext.getEnvPath());<NEW_LINE>FileSystem fs = remote.getFileSystem(new Configuration());<NEW_LINE>// virtual env is shared across jobs, so we can't use mlContext's temp dir here<NEW_LINE>File tmp = Files.createTempDirectory(null).toFile();<NEW_LINE>Runtime.getRuntime().addShutdownHook(new Thread(() -> FileUtils.deleteQuietly(tmp)));<NEW_LINE>Path local = new Path(tmp.getPath(), remote.getName());<NEW_LINE>LOG.info("local path:" + local.getName());<NEW_LINE>LOG.info("remote path:" + remote.getName());<NEW_LINE>fs.copyToLocalFile(remote, local);<NEW_LINE>Preconditions.checkState(ShellExec.run(String.format("unzip -q -d %s %s", tmp.getPath(), local.toString())<MASK><NEW_LINE>String name = remote.getName();<NEW_LINE>int index = name.indexOf(".");<NEW_LINE>if (index != -1) {<NEW_LINE>name = name.substring(0, index);<NEW_LINE>}<NEW_LINE>File res = new File(tmp, name);<NEW_LINE>if (!res.exists()) {<NEW_LINE>res = tmp;<NEW_LINE>}<NEW_LINE>LOG.info("Virtual env deployed to " + res.toString());<NEW_LINE>return res;<NEW_LINE>}
, LOG::info), "Failed to unzip virtual env");
848,044
public void initGui() {<NEW_LINE>super.initGui();<NEW_LINE>Keyboard.enableRepeatEvents(true);<NEW_LINE>optionRotate = new GuiBetterButton(0, guiLeft + 5, <MASK><NEW_LINE>buttonList.add(optionRotate);<NEW_LINE>optionExcavate = new GuiBetterButton(1, guiLeft + 5, guiTop + 55, 79, "");<NEW_LINE>buttonList.add(optionExcavate);<NEW_LINE>optionAllowCreative = new GuiBetterButton(2, guiLeft + 5, guiTop + 80, 79, "");<NEW_LINE>optionAllowCreative.setToolTip(new ToolTip(500, new ToolTipLine(LocaleUtil.localize("tile.architect.tooltip.allowCreative.1")), new ToolTipLine(LocaleUtil.localize("tile.architect.tooltip.allowCreative.2"))));<NEW_LINE>buttonList.add(optionAllowCreative);<NEW_LINE>textField = new GuiTextField(0, this.fontRendererObj, TEXT_X, TEXT_Y, TEXT_WIDTH, TEXT_HEIGHT);<NEW_LINE>textField.setMaxStringLength(DefaultProps.MAX_NAME_SIZE);<NEW_LINE>textField.setText(architect.name);<NEW_LINE>textField.setFocused(true);<NEW_LINE>updateButtons();<NEW_LINE>}
guiTop + 30, 79, "");
315,929
public void create(final ConnectorRequestContext context, final DatabaseInfo databaseInfo) {<NEW_LINE>final QualifiedName name = databaseInfo.getName();<NEW_LINE>final String createdBy = PolarisUtils.getUserOrDefault(context);<NEW_LINE>// check exists then create in non-transactional optimistic manner<NEW_LINE>if (exists(context, name)) {<NEW_LINE>throw new DatabaseAlreadyExistsException(name);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final String location = databaseInfo.getUri() == null ? this.defaultLocationPrefix + name.getDatabaseName() + DEFAULT_LOCATION_SUFFIX : databaseInfo.getUri();<NEW_LINE>this.polarisStoreService.createDatabase(name.getDatabaseName(), location, createdBy);<NEW_LINE>} catch (DataIntegrityViolationException exception) {<NEW_LINE><MASK><NEW_LINE>} catch (Exception exception) {<NEW_LINE>throw new ConnectorException(String.format("Failed creating polaris database %s", name), exception);<NEW_LINE>}<NEW_LINE>}
throw new InvalidMetaException(name, exception);
100,655
protected Pattern predefinedToPattern(YamlContract.PredefinedRegex predefinedRegex) {<NEW_LINE>switch(predefinedRegex) {<NEW_LINE>case only_alpha_unicode:<NEW_LINE>return RegexPatterns.onlyAlphaUnicode().getPattern();<NEW_LINE>case number:<NEW_LINE>return RegexPatterns.number().getPattern();<NEW_LINE>case any_double:<NEW_LINE>return RegexPatterns.aDouble().getPattern();<NEW_LINE>case any_boolean:<NEW_LINE>return RegexPatterns.anyBoolean().getPattern();<NEW_LINE>case ip_address:<NEW_LINE>return RegexPatterns.ipAddress().getPattern();<NEW_LINE>case hostname:<NEW_LINE>return RegexPatterns.hostname().getPattern();<NEW_LINE>case email:<NEW_LINE>return RegexPatterns<MASK><NEW_LINE>case url:<NEW_LINE>return RegexPatterns.url().getPattern();<NEW_LINE>case uuid:<NEW_LINE>return RegexPatterns.uuid().getPattern();<NEW_LINE>case iso_date:<NEW_LINE>return RegexPatterns.isoDate().getPattern();<NEW_LINE>case iso_date_time:<NEW_LINE>return RegexPatterns.isoDateTime().getPattern();<NEW_LINE>case iso_time:<NEW_LINE>return RegexPatterns.isoTime().getPattern();<NEW_LINE>case iso_8601_with_offset:<NEW_LINE>return RegexPatterns.iso8601WithOffset().getPattern();<NEW_LINE>case non_empty:<NEW_LINE>return RegexPatterns.nonEmpty().getPattern();<NEW_LINE>case non_blank:<NEW_LINE>return RegexPatterns.nonBlank().getPattern();<NEW_LINE>default:<NEW_LINE>throw new UnsupportedOperationException("The predefined regex [" + predefinedRegex + "] is unsupported. Use one of " + Arrays.toString(YamlContract.PredefinedRegex.values()));<NEW_LINE>}<NEW_LINE>}
.email().getPattern();
1,069,673
public DeleteRelationalDatabaseResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DeleteRelationalDatabaseResult deleteRelationalDatabaseResult = new DeleteRelationalDatabaseResult();<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 deleteRelationalDatabaseResult;<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("operations", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteRelationalDatabaseResult.setOperations(new ListUnmarshaller<Operation>(OperationJsonUnmarshaller.getInstance()).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 deleteRelationalDatabaseResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
1,158,624
public int maxPoints(int[][] points) {<NEW_LINE>int n = points.length;<NEW_LINE>if (n < 3) {<NEW_LINE>return n;<NEW_LINE>}<NEW_LINE>int res = 0;<NEW_LINE>for (int i = 0; i < n - 1; ++i) {<NEW_LINE>Map<String, Integer> kCounter = new HashMap<>();<NEW_LINE>int max = 0;<NEW_LINE>int duplicate = 0;<NEW_LINE>for (int j = i + 1; j < n; ++j) {<NEW_LINE>int deltaX = points[i][0] - points[j][0];<NEW_LINE>int deltaY = points[i][1] <MASK><NEW_LINE>if (deltaX == 0 && deltaY == 0) {<NEW_LINE>++duplicate;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int gcd = gcd(deltaX, deltaY);<NEW_LINE>int dX = deltaX / gcd;<NEW_LINE>int dY = deltaY / gcd;<NEW_LINE>String key = dX + "." + dY;<NEW_LINE>kCounter.put(key, kCounter.getOrDefault(key, 0) + 1);<NEW_LINE>max = Math.max(max, kCounter.get(key));<NEW_LINE>}<NEW_LINE>res = Math.max(res, max + duplicate + 1);<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>}
- points[j][1];
1,814,144
public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> objs, List<ModelMap> allModels) {<NEW_LINE>objs = super.postProcessOperationsWithModels(objs, allModels);<NEW_LINE>Map<String, Object> operations = (Map<String, Object>) objs.get("operations");<NEW_LINE>HashMap<String, CodegenModel> modelMaps = new HashMap<String, CodegenModel>();<NEW_LINE>HashMap<String, Integer> processedModelMaps = new HashMap<String, Integer>();<NEW_LINE>for (ModelMap modelMap : allModels) {<NEW_LINE>CodegenModel m = modelMap.getModel();<NEW_LINE>modelMaps.put(m.classname, m);<NEW_LINE>}<NEW_LINE>List<CodegenOperation> operationList = (List<CodegenOperation>) operations.get("operation");<NEW_LINE>for (CodegenOperation op : operationList) {<NEW_LINE>for (CodegenParameter p : op.allParams) {<NEW_LINE>p.vendorExtensions.put("x-ruby-example", constructExampleCode(p, modelMaps, processedModelMaps));<NEW_LINE>}<NEW_LINE>processedModelMaps.clear();<NEW_LINE>for (CodegenParameter p : op.requiredParams) {<NEW_LINE>p.vendorExtensions.put("x-ruby-example", constructExampleCode<MASK><NEW_LINE>}<NEW_LINE>processedModelMaps.clear();<NEW_LINE>for (CodegenParameter p : op.optionalParams) {<NEW_LINE>p.vendorExtensions.put("x-ruby-example", constructExampleCode(p, modelMaps, processedModelMaps));<NEW_LINE>}<NEW_LINE>processedModelMaps.clear();<NEW_LINE>for (CodegenParameter p : op.bodyParams) {<NEW_LINE>p.vendorExtensions.put("x-ruby-example", constructExampleCode(p, modelMaps, processedModelMaps));<NEW_LINE>}<NEW_LINE>processedModelMaps.clear();<NEW_LINE>for (CodegenParameter p : op.pathParams) {<NEW_LINE>p.vendorExtensions.put("x-ruby-example", constructExampleCode(p, modelMaps, processedModelMaps));<NEW_LINE>}<NEW_LINE>processedModelMaps.clear();<NEW_LINE>}<NEW_LINE>return objs;<NEW_LINE>}
(p, modelMaps, processedModelMaps));
293,410
private Map<String, Map<String, List<String>>> buildAlertLinks(Map<String, StorageAlertInfo> alertInfos, String type) {<NEW_LINE>Map<String, Map<String, List<String>>> links = new LinkedHashMap<String, Map<String, List<String>>>();<NEW_LINE>String format = m_storageGroupConfigManager.queryLinkFormat(type);<NEW_LINE>if (format != null) {<NEW_LINE>for (Entry<String, StorageAlertInfo> alertInfo : alertInfos.entrySet()) {<NEW_LINE>String key = alertInfo.getKey();<NEW_LINE>Map<String, List<String>> linkMap = links.get(key);<NEW_LINE>if (linkMap == null) {<NEW_LINE>linkMap = new LinkedHashMap<String, List<String>>();<NEW_LINE>links.put(key, linkMap);<NEW_LINE>}<NEW_LINE>for (Entry<String, Storage> entry : alertInfo.getValue().getStorages().entrySet()) {<NEW_LINE>String id = entry.getKey();<NEW_LINE>Storage storage = entry.getValue();<NEW_LINE>List<String> ls = linkMap.get(id);<NEW_LINE>if (ls == null) {<NEW_LINE>ls = new ArrayList<String>();<NEW_LINE>linkMap.put(id, ls);<NEW_LINE>}<NEW_LINE>for (String ip : storage.getMachines().keySet()) {<NEW_LINE>String url = m_storageGroupConfigManager.<MASK><NEW_LINE>if (url != null) {<NEW_LINE>ls.add(url);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return links;<NEW_LINE>}
buildUrl(format, id, ip);
1,382,778
final RevokeSecurityGroupEgressResult executeRevokeSecurityGroupEgress(RevokeSecurityGroupEgressRequest revokeSecurityGroupEgressRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(revokeSecurityGroupEgressRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RevokeSecurityGroupEgressRequest> request = null;<NEW_LINE>Response<RevokeSecurityGroupEgressResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RevokeSecurityGroupEgressRequestMarshaller().marshall(super.beforeMarshalling(revokeSecurityGroupEgressRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RevokeSecurityGroupEgress");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<RevokeSecurityGroupEgressResult> responseHandler = new StaxResponseHandler<RevokeSecurityGroupEgressResult>(new RevokeSecurityGroupEgressResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,283,556
final StartDeploymentResult executeStartDeployment(StartDeploymentRequest startDeploymentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(startDeploymentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StartDeploymentRequest> request = null;<NEW_LINE>Response<StartDeploymentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StartDeploymentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(startDeploymentRequest));<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, "Amplify");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StartDeploymentResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartDeploymentResultJsonUnmarshaller());<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.OPERATION_NAME, "StartDeployment");
1,348,256
private void writeRelationFiles(String festivalUtt) throws IOException {<NEW_LINE>BufferedReader buf = new BufferedReader(new StringReader(festivalUtt));<NEW_LINE>String line;<NEW_LINE>String relation = null;<NEW_LINE>PrintWriter pw = null;<NEW_LINE>while ((line = buf.readLine()) != null) {<NEW_LINE>if (line.startsWith("==") && !line.startsWith("===")) {<NEW_LINE>relation = line.substring(2, line.indexOf('=', 2));<NEW_LINE>logger.debug("Writing " + relation + " relation:");<NEW_LINE>if (pw != null) {<NEW_LINE>pw.close();<NEW_LINE>}<NEW_LINE>pw = new PrintWriter(new OutputStreamWriter(new FileOutputStream(relationsDir.getPath() + File.separator + relation + File.separator + <MASK><NEW_LINE>} else if (pw != null) {<NEW_LINE>pw.println(line);<NEW_LINE>logger.debug(line);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (pw != null)<NEW_LINE>pw.close();<NEW_LINE>}
"mary." + relation), "ISO-8859-15"));