__key__
stringlengths
16
21
__url__
stringclasses
1 value
txt
stringlengths
183
1.2k
funcom_train/10666804
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected Result assertNotNull(String message, Object obj) { if (obj == null) { String msg = message != null ? message + "\n" : ""; msg += "assertNotNull(Object): " + obj; return fail(msg, 3); } return pass(3); } COM: <s> asserts that the object is not null </s>
funcom_train/2038265
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Sensor build(Document document, Element sensorElement) { String sensorID = sensorElement.getAttributeValue("id"); return new Sensor(Integer.parseInt(sensorID), sensorElement.getAttributeValue(Constants.SENSOR_TYPE_ATTRIBUTE_NAME), getStatusCommand(document, sensorElement), getStateMap(sensorElement)); } COM: <s> builds sensor from xml element like this </s>
funcom_train/25772266
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void setSelection(Object selection, boolean notifyListeners) { if (input != null) { int selectionIndex = input.toList().indexOf(selection); if (selectionIndex != -1) { currentPosition = selectionIndex; onSelectionChange(selection); if (notifyListeners) { fireSelectionEvent(selection); } } redraw(); } } COM: <s> set current selection </s>
funcom_train/18001379
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: static public boolean isBinderUserWorkspace(Binder binder) { // If binder is a Workspace... boolean isUserWs = ((null != binder) && (binder instanceof Workspace)); if (isUserWs) { // ...we consider it a User workspace if its type is // ...user workspace view. Integer type = binder.getDefinitionType(); isUserWs = ((type != null) && (type.intValue() == Definition.USER_WORKSPACE_VIEW)); } return isUserWs; } COM: <s> determines whether a binder is a user workspace </s>
funcom_train/9458083
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public X509CRLEntry getRevokedCertificate(BigInteger serialNumber) { if (!entriesRetrieved) { retrieveEntries(); } if (entries == null) { return null; } for (int i=0; i<nonIndirectEntriesSize; i++) { X509CRLEntry entry = (X509CRLEntry) entries.get(i); if (serialNumber.equals(entry.getSerialNumber())) { return entry; } } return null; } COM: <s> method searches for crl entry with specified serial number </s>
funcom_train/7660362
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testContainsAll() { CopyOnWriteArraySet full = populatedSet(3); Vector v = new Vector(); v.add(one); v.add(two); assertTrue(full.containsAll(v)); v.add(six); assertFalse(full.containsAll(v)); } COM: <s> contains all returns true for collections with subset of elements </s>
funcom_train/11737391
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testSetEmptyMultiValueProperty() throws RepositoryException { Property property = node.setProperty("test", new Value[0], PropertyType.LONG); assertEquals( "JCR-1389: setProperty(name, new Value[0], PropertyType.LONG)" + " loses property type", PropertyType.LONG, property.getType()); } COM: <s> test case for jcr 1389 </s>
funcom_train/43147749
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getUniqueConstraintName(Session session, Table table) { HashMap<String, Constraint> tableConstraints; if (table.isTemporary() && !table.isGlobalTemporary()) { tableConstraints = session.getLocalTempTableConstraints(); } else { tableConstraints = constraints; } return getUniqueName(table, tableConstraints, "CONSTRAINT_"); } COM: <s> create a unique constraint name </s>
funcom_train/34671920
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void resetConfiguration() { // Derive the configuration's name from the class name String cname=getConfigurationNamespace(); String name=cname.substring(cname.lastIndexOf('.')+1); if (name.endsWith("Bean")) { name=name.substring(0, name.length()-4); } resetConfiguration(name); } COM: <s> default component implementation of the reset configuration method </s>
funcom_train/34341018
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public TextField getTextField5() { if (textField5 == null) {//GEN-END:|33-getter|0|33-preInit // write pre-init user code here textField5 = new TextField("textField5", null, 5, TextField.ANY);//GEN-LINE:|33-getter|1|33-postInit // write post-init user code here }//GEN-BEGIN:|33-getter|2| return textField5; } COM: <s> returns an initiliazed instance of text field5 component </s>
funcom_train/1652105
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public FreenetURI popMetaString() { String[] newMetaStr = null; if (metaStr != null) { final int metaStrLength = metaStr.length; if (metaStrLength > 1) { newMetaStr = new String[metaStrLength - 1]; System.arraycopy(metaStr, 1, newMetaStr, 0, newMetaStr.length); } } return setMetaString(newMetaStr); } COM: <s> returns a copy of this uri with the first meta string removed </s>
funcom_train/4805257
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Mode lookupCreateMode(String name) { if (name == null) return null; name = name.trim(); Mode mode = (Mode)modeMap.get(name); if (mode == null) { mode = new Mode(name, defaultBaseMode); modeMap.put(name, mode); } return mode; } COM: <s> gets a mode with the given name from the mode map </s>
funcom_train/39107150
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void storeOpenChanges() { boolean inEDT = JTDB.INSTANCE.isRunInEDT(); JTDB.INSTANCE.setRunInEDT(true); if (ArtistModel.INSTANCE.isChanged()) { storeArtist(ArtistModel.INSTANCE.getBean()); } if (ShowModel.INSTANCE.isChanged()) { storeShow(ShowModel.INSTANCE.getBean()); } if (ArchiveModel.INSTANCE.isChanged()) { storeArchive(ArchiveModel.INSTANCE.getBean()); } JTDB.INSTANCE.setRunInEDT(inEDT); } COM: <s> stores all open changes in the edt </s>
funcom_train/34748956
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void close() throws SQLException { try { if(_stmt != null) { ((AbandonedTrace)_stmt).removeTrace(this); _stmt = null; } if(_conn != null) { ((AbandonedTrace)_conn).removeTrace(this); _conn = null; } _res.close(); } catch (SQLException e) { handleException(e); } } COM: <s> wrapper for close of result set which removes this </s>
funcom_train/5395887
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testError() { System.out.println("error"); SAXParseException e = null; DocumentWriter instance = new DocumentWriter(); instance.error(e); // TODO review the generated test code and remove the default call to fail. fail("The test case is a prototype."); } COM: <s> test of error method of class org </s>
funcom_train/37090450
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void move(long M, float C3) { //move(_C1, _C2, C3, _C4, M); //move(1, 1, 5, 0.001, M); move(JnetConstants.defaultLayoutParam[0], JnetConstants.defaultLayoutParam[1], JnetConstants.defaultLayoutParam[2], JnetConstants.defaultLayoutParam[3], M); } COM: <s> used by pase nba </s>
funcom_train/45038480
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testCorrectFiles() throws Exception { Start[] asts = OclDirectoryParser.parseDirectory( "test_files" + File.separator + "context_checker" + File.separator + "uml14"); UmlMDRepository umlRep = new UmlMDRepository(UmlMDRepository.UML_V14); UmlFacade facade = new UmlFacade(umlRep); ContextChecker cc = new ContextChecker(facade); for (int i = 0; i < asts.length; i++) { Start start = asts[i]; cc.checkContext(start); } } COM: <s> context checks well defined constraints included in </s>
funcom_train/13957551
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setDefaultDelegateOnEditingContext(EOEditingContext ec, boolean validation) { if (log.isDebugEnabled()) { log.debug("Setting default delegate on editing context: " + ec + " allows validation: " + validation); } if (ec != null) { if (validation) { ec.setDelegate(defaultEditingContextDelegate()); } else { ec.setDelegate(defaultNoValidationDelegate()); } } else { log.warn("Attempting to set a default delegate on a null ec!"); } } COM: <s> sets either the default editing context delegate that does or does </s>
funcom_train/1942192
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int countSystems() throws SQLException { int ret = 0; Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("SELECT count(*) From System"); if (rs.first()) ret = rs.getInt(1); stmt.close(); return ret; } COM: <s> returns how many systems are in the database </s>
funcom_train/3117873
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void addButtons(final List/*<JButton>*/ newButtons, int index) { for (Iterator i = newButtons.iterator(); i.hasNext(); ) { final JButton newButton = (JButton)i.next(); if (newButton == null) { addSeparator(index); } else { addButton(newButton, index); setupButton(newButton); } index++; } } COM: <s> adds the specified list of buttons to the toolbox </s>
funcom_train/39281352
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void stop() throws Exception { Set<String> pluginNames = allPlugins.keySet(); for (String name : pluginNames) { System.err.println("-- Unloading Plugin <" + name + ">"); allPlugins.get(name).destroy(); } unloadStages(); profiler.stop(); signalMgr.stop(); } COM: <s> unload the plugins then the stages </s>
funcom_train/32891002
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void resizeInfra(Dimension d) { infraSize = d; viewSize = new Dimension((int)(d.width * zoomFactor), (int)(d.height * zoomFactor)); viewPosition = new Point(-(int)(d.width / 2), -(int)(d.height / 2)); setSize(viewSize); createTransform(); redraw(); } COM: <s> resizes the infrastructure </s>
funcom_train/32007070
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JButton getBtnPeerNetConnect() { if (btnPeerNetConnect == null) { btnPeerNetConnect = new JButton(); btnPeerNetConnect.setText("Connect"); btnPeerNetConnect .addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { setCursor(hourglassCursor); btnPeerNetConnect.setEnabled(false); subscribeClient.startJxta(); btnPeerNetDisconnect.setEnabled(true); btnSubscribe.setEnabled(true); setCursor(normalCursor); } }); } return btnPeerNetConnect; } COM: <s> this method initializes btn peer net connect </s>
funcom_train/45622643
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addCertificateFilePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_ResolveKeySourceType_certificateFile_feature"), getString("_UI_PropertyDescriptor_description", "_UI_ResolveKeySourceType_certificateFile_feature", "_UI_ResolveKeySourceType_type"), MSBPackage.eINSTANCE.getResolveKeySourceType_CertificateFile(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the certificate file feature </s>
funcom_train/43213299
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected boolean isRegisteredWithConnectionHost() { int timeBetweenRegistrations = ConfigureTranche.getInt(ConfigureTranche.CATEGORY_SERVER, ConfigureTranche.PROP_SERVER_TIME_BETWEEN_REGISTRATIONS); if (timeBetweenRegistrations > 0 && TimeUtil.getTrancheTimestamp() - registrationTimestamp > timeBetweenRegistrations) { return true; } return registeredWithConnectionHost; } COM: <s> p returns whether the connection host has been registered with </s>
funcom_train/44161446
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Connection getConnection(String url, String login, String password) { try { Properties props = new Properties(); props.put("user", login); props.put("password", password); return this.driver.connect(url, props); } catch (Exception e) { e.printStackTrace(); return null; } } COM: <s> get connection gets connection by given data </s>
funcom_train/4122548
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getAvailableSpace(Transportable t) { if (t.getTransportLocatable() instanceof Unit) { Unit u = (Unit) t.getTransportLocatable(); return getAvailableSpace(u.getType(), t.getTransportSource(), t.getTransportDestination()); } else { return getAvailableSpace(null, t.getTransportSource(), t.getTransportDestination()); } } COM: <s> returns the available space for the given code transportable code </s>
funcom_train/22785985
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void informUserOfProductLeaving(PhysicalDevice pd){ String device = localizedMessagesBundle.getString("device_left_1"); String inRoom = localizedMessagesBundle.getString("device_left_2"); String hasLeftNetwork = localizedMessagesBundle.getString("device_left_3"); logger.info( device + pd.getUserAssignedName() + inRoom + pd.getRoom().getUserAssignedName() + hasLeftNetwork); } COM: <s> informs the user that a product has been reset and left the network </s>
funcom_train/23182964
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void propertyChange(PropertyChangeEvent e) { boolean update = false; String prop = e.getPropertyName(); if (JFileChooser.DIRECTORY_CHANGED_PROPERTY.equals(prop)) { file = null; update = true; } else if (JFileChooser.SELECTED_FILE_CHANGED_PROPERTY.equals(prop)) { file = (File) e.getNewValue(); update = true; } if (update) { imageThumbnail = null; if (isShowing()) { loadImage(); repaint(); } } } COM: <s> if a property was changed other file was selected this will generate a </s>
funcom_train/19765397
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Command getItemCommand() { if (itemCommand == null) {//GEN-END:|34-getter|0|34-preInit // write pre-init user code here itemCommand = new Command("\u9879", Command.ITEM, 0);//GEN-LINE:|34-getter|1|34-postInit // write post-init user code here }//GEN-BEGIN:|34-getter|2| return itemCommand; } COM: <s> returns an initiliazed instance of item command component </s>
funcom_train/17335804
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public LogFrameGroupDTO getDefaultGroup(LogFrameGroupType type) { LogFrameGroupDTO group = null; // Lists of groups. final List<LogFrameGroupDTO> groups = getGroups(); // Retrieves group. if (groups != null) { for (final LogFrameGroupDTO g : groups) { // Stops at the first group with the given type. if (type == null || type == g.getType()) { group = g; break; } } } return group; } COM: <s> gets the only default group of this type </s>
funcom_train/20885205
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testTextContentWithFormat() { TextContentWithFormatTestDTO obj = new TextContentWithFormatTestDTO(); obj.textContent = getDateForFormat("28.02.2007:15:21:27"); assertTrue(JSefaTestUtil.serialize(XML, obj).indexOf("28.02.2007:15:21:27") >= 0); } COM: <s> tests the format configuration for a text content </s>
funcom_train/43297646
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String toCharString() { String result = new String(); for (int i = 0; i < packet.length; i++) { char n = (char) packet[i]; if (Character.isLetterOrDigit(n)) { result += n; } else if (packet[i] == PACKET_END) { result += "\\r"; } else { result += '.'; } } return result; } COM: <s> converts packet to a simple string </s>
funcom_train/18050913
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public KeydbGroup getGroupParent(int id) throws KeydbException { passLock(); if (id != 0) { for(int i = 0; i < header.numGroups; ++i) { if (this.groupsIds[i] == id) { return this.getGroup(this.groupsGids[i]); }; }; throw new KeydbException(Config.getLocaleString(keys.KD_GROUP_NOT_FOUND)); } else { throw new KeydbException(Config.getLocaleString(keys.KD_ROOT_GROUP_PARENT)); } } COM: <s> get parent group of child group identified by id </s>
funcom_train/43590892
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JPanel getJPanel8() { if (jPanel8 == null) { FlowLayout flowLayout2 = new FlowLayout(); flowLayout2.setHgap(5); flowLayout2.setAlignment(FlowLayout.RIGHT); flowLayout2.setVgap(2); jPanel8 = new JPanel(); jPanel8.setLayout(flowLayout2); jPanel8.setComponentOrientation(ComponentOrientation.UNKNOWN); jPanel8.setName("jPanel8"); jPanel8.add(getUnscrobbledCountLabel(), null); } return jPanel8; } COM: <s> this method initializes j panel8 </s>
funcom_train/36366236
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public double getPatternStrength(Detail a, Detail b) { if (a.getPatterns().size() == 0) return 0.0; List<String> bPatterns = b.getPatterns(); double s = 0; for (String aP : a.getPatterns()) { if (bPatterns.contains(aP)) { s += 1.0; } //TODO accumulate matched super-patterns } return s / ((double)a.getPatterns().size()); } COM: <s> strength of declared pattern correlation a b in 0 </s>
funcom_train/36525461
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int minDist(Position pos) { int distX; int distY; int temp; distX = Math.abs(x - pos.getX()); temp = Math.abs(distX - Constants.MAXCOORD); distX = temp < distX ? temp : distX; distY = Math.abs(y - pos.getY()); temp = Math.abs(distY - Constants.MAXCOORD); distY = temp < distY ? temp : distY; return distX + distY; } COM: <s> calculates minimum direction from this position to given pos </s>
funcom_train/42641212
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setText(String v) { if (MedlineDocument_Type.featOkTst && ((MedlineDocument_Type)jcasType).casFeat_text == null) jcasType.jcas.throwFeatMissing("text", "onto.typesys.MedlineDocument"); jcasType.ll_cas.ll_setStringValue(addr, ((MedlineDocument_Type)jcasType).casFeatCode_text, v);} COM: <s> setter for text sets the document text that it holds </s>
funcom_train/28262431
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void notifyGUI(int emulatorStatus) { // Check which kind of notification is given if (emulatorStatus == GUI.EMU_PROCESS_STOP) { if (cli.autoshutdown) { // Exit application this.exitDioscuri(); } else { // Update GUI status this.updateGUI(GUI.EMU_PROCESS_STOP); } } // TODO: add all notifications here that are done by emulator class. // Currently, emulator class is directly calling gui.update(..) } COM: <s> notify gui about status of emulation process and take appropriate gui </s>
funcom_train/48356881
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private EvaluatorQueryPlan doEvaluatorPlanning(DLAF dlaf, int queryID) throws SchemaMetadataException, TypeMappingException { if (logger.isTraceEnabled()) logger.trace("ENTER doEvaluatorPlanning() for " + queryID); EvaluatorQueryPlan qep = new EvaluatorQueryPlan(dlaf, "Q"+queryID); //TODO: In future, do physical optimization here, rather than in //the evaluator as currently done if (logger.isTraceEnabled()) logger.trace("RETURN doEvaluatorPlanning()"); return qep; } COM: <s> invokes the evaluator query planning steps </s>
funcom_train/15605994
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected String getChangedString(DocumentEvent e){ Document document = (Document)e.getDocument(); try{ return document.getText(0,document.getLength()); }catch(javax.swing.text.BadLocationException err){ err.printStackTrace(); } return ""; } COM: <s> returns a string containing the text of the document that was changed </s>
funcom_train/27805535
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Timestamp readDeadLine(DeadLine dl) { Mysql db = new Mysql(); try { db.select("select date from deadlines where name='" + dl.toString() + "'"); if (!db.eof()) { if (db.getString("date").compareTo("null") == 0) return null; else { System.out.println(db.getString("date")); return db.formatDate(db.getDate("date")); } } else return null; } finally { db.close(); } } COM: <s> function to read the deadline passed by argument </s>
funcom_train/51219874
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JFormattedTextField getStartValueFormattedTextField() { if (startValueFormattedTextField == null) { startValueFormattedTextField = new JFormattedTextField(new NumberFormatter()); startValueFormattedTextField.setColumns(3); startValueFormattedTextField.setValue(new Integer(1)); startValueFormattedTextField.setHorizontalAlignment(JTextField.TRAILING); } return startValueFormattedTextField; } COM: <s> this method initializes start value formatted text field </s>
funcom_train/9900123
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JButton getJButton() { if (jButton == null) { jButton = new JButton(); jButton.setBounds(new Rectangle(55, 36, 106, 21)); jButton.setText("student"); jButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { StudentForm sf = new StudentForm(); String[] niz = {"",""}; sf.main(niz); } }); } return jButton; } COM: <s> this method initializes j button </s>
funcom_train/32012172
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void deactivateDevices() throws DPWSException { for (Iterator<Device> it = localDevices.values().iterator(); it.hasNext();) { Device device = it.next(); if (device.getStatus() == Device.STATUS_RUNNING) { device.shutdown(); } } } COM: <s> method desactivating all devices that are running from the registry </s>
funcom_train/9760808
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void handleCoreException(CoreException exception, String message) { Bundle bundle = Platform.getBundle(PlatformUI.PLUGIN_ID); ILog log= Platform.getLog(bundle); IStatus status= message != null ? new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.OK, message, exception) : exception.getStatus(); log.log(status); } COM: <s> defines the standard procedure to handle code core exceptions code </s>
funcom_train/20979400
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Dimension getPreferredSize(JSplitPane splitpane) { Dimension dimension = null; if (skina.getSplitPane() != null) { dimension = skina.getSplitPane().getPreferredSize(splitpane); } if ((dimension == null) && (skinb.getSplitPane() != null)) { dimension = skinb.getSplitPane().getPreferredSize(splitpane); } return dimension; } COM: <s> gets the preferred size attribute of the compound split pane object </s>
funcom_train/9713885
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ExecutorService newRequestExecutor(int port) { return new ThreadPoolExecutor(requestCoreThreadPoolSize, requestMaxThreadPoolSize, threadKeepAliveTime, threadKeepAliveTimeUnit, newRequestBlockingQueue(), new DefaultThreadFactory( new ThreadGroup("Connection thread group"), "HttpConnection-" + port)); } COM: <s> create the executor use the manage request processing threads </s>
funcom_train/45553580
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void pollingForLEDInfo() { try { if (!theIdMapping.isEmpty()) { System.out.println( "Polling nodes for their LEDs information:"); new PollLEDCommand().execute(); } } catch (IOException theException) { theException.printStackTrace(); } } COM: <s> polling the nodes for their leds information </s>
funcom_train/39558872
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testFillXincoCoreData() { try { XincoCoreNodeServer instance = new XincoCoreNodeServer(1); instance.fillXincoCoreData(); assertTrue(instance.getXincoCoreData().size() > 0); } catch (Exception e) { Logger.getLogger(XincoCoreNodeServerTest.class.getSimpleName()).log(Level.SEVERE, null, e); fail(); } } COM: <s> test of fill xinco core data method of class xinco core node server </s>
funcom_train/10591759
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean select(String expression, Object selectorContext) { if (selectorContext == null) { getLogger().debug("selectorContext is null!" ); return false; } // let SelectorContext do the work DateSelectorContext csc = (DateSelectorContext)selectorContext; return csc.select(expression); } COM: <s> evaluate select for a given expression </s>
funcom_train/1060061
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addLineStylePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_DiagramElement_lineStyle_feature"), getString("_UI_PropertyDescriptor_description", "_UI_DiagramElement_lineStyle_feature", "_UI_DiagramElement_type"), Di2Package.Literals.DIAGRAM_ELEMENT__LINE_STYLE, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the line style feature </s>
funcom_train/45622580
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addOutputDirectoryPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_LCType_outputDirectory_feature"), getString("_UI_PropertyDescriptor_description", "_UI_LCType_outputDirectory_feature", "_UI_LCType_type"), MSBPackage.eINSTANCE.getLCType_OutputDirectory(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the output directory feature </s>
funcom_train/7842769
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testUnXmlEncode() { System.out.println("unXmlEncode"); String s = ""; String expResult = ""; String result = Utilities.unXmlEncode(s); assertEquals(expResult, result); // TODO review the generated test code and remove the default call to fail. fail("The test case is a prototype."); } COM: <s> test of un xml encode method of class org </s>
funcom_train/5338193
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int checksObjects(String empty) throws RemoteException, FaultType { Iterator it = objectsDB.iterator(); while (it.hasNext()) { URI object = (URI)it.next(); //TODO: need to connect to the object to check if it is running //objectsDB.remove(object); } return objectsDB.size(); } COM: <s> checks all managed objects </s>
funcom_train/8097223
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Instance makeInstance(String text, Instances data) { // Create instance of length two. Instance instance = new Instance(2); // Set value for message attribute Attribute messageAtt = data.attribute("Message"); instance.setValue(messageAtt, messageAtt.addStringValue(text)); // Give instance access to attribute information from the dataset. instance.setDataset(data); return instance; } COM: <s> method that converts a text message into an instance </s>
funcom_train/37049962
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testIntervalWithGenAction() { sch.scheduleActionAtInterval(3.2, this, "actionMethod"); sch.execute(); sch.execute(); assertEquals(3.2, results.get(0), 0.01); assertEquals(6.4, results.get(1), 0.01); } COM: <s> tests interval with a generated action </s>
funcom_train/49700801
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Formula defineElected() { final Variable t = Variable.unary("t"); final Formula f1 = elected.join(tfirst).no(); final Variable p = Variable.unary("p"); final Formula c = p.in(p.join(toSend).join(t).difference(p.join(toSend).join(t.join(tord.transpose())))); final Expression comprehension = c.comprehension(p.oneOf(Process)); final Formula f2 = elected.join(t).eq(comprehension).forAll(t.oneOf(Time.difference(tfirst))); return f1.and(f2); } COM: <s> return define elected fact </s>
funcom_train/10206642
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private PaletteContainer createChildNodes2Group() { PaletteGroup paletteContainer = new PaletteGroup( com.ssd.mdaworks.classdiagram.classDiagram.diagram.part.Messages.ChildNodes2Group_title); paletteContainer .setDescription(com.ssd.mdaworks.classdiagram.classDiagram.diagram.part.Messages.ChildNodes2Group_desc); paletteContainer.add(createMAttribute1CreationTool()); paletteContainer.add(createMOperation2CreationTool()); paletteContainer.add(createCreateAnnotationdetails3CreationTool()); return paletteContainer; } COM: <s> creates child nodes palette tool group </s>
funcom_train/17680187
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void getTables(HashSet tables) { if (table != null) { tables.add(table); } int n = 0; if (fields != null) { n = fields.length; } for (int i = 0; i < n; i++) { JdbcField f = fields[i]; if (f != null) f.getTables(tables); } } COM: <s> add all tables that belong to this class to the set </s>
funcom_train/9140464
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JButton getJButton2() { if (jButton2 == null) { jButton2 = new JButton(); jButton2.setText("OK"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { folders = new ArrayList<String>(workingFolders); setVisible(false); } }); } return jButton2; } COM: <s> this method initializes j button2 </s>
funcom_train/13307059
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public GraphStatistics getGraphStats() throws AccessDeniedException { synchronized(this) { if(stats == null && this.repository!=null){ this.stats = GraphStatistics.get(this.repository.getGraph()); this.stats.process(this.call, false, false, false);//CHECK if this.call is wrong that we need to put null there } } return this.stats; } COM: <s> provides easier access to graph statistics object </s>
funcom_train/8345986
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setScale(float scale) { this.scale = scale; OMSVGRect rect = svg.getViewBox().getBaseVal(); svg.getStyle().setWidth(rect.getWidth() * scale, Unit.PX); svg.getStyle().setHeight(rect.getHeight() * scale, Unit.PX); } COM: <s> sets the scaling of the svg </s>
funcom_train/35051281
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JPanel getVarPane() { System.out.println("getVarPane"); JPanel vp=null; if (vt == null) { //TODO when you first run, uncommon the below line // when you finish the first run,, common the below line // TableSaver.Creat(); // TableSaver.Saving(TableSaver.getRandTable()); vt = new varTable(TableSaver.Loading()); // vt = new varTable(TableSaver.loadMatrix()); vp= vt.getTable(); } return vp; } COM: <s> this method initializes variance table </s>
funcom_train/37018941
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void editDveMCard(){ // Name theDveMCard.setName(theMObjectName.getText()); theDveMCard.parentPanel.setName(theMPanelName.getText()); // Appearance DveMAppearance appearance= theDveMCard.getAppearance(); appearance= setAppearanceSelected(appearance); // Display + Image appearance= setBackgroundAppearance(appearance); theDveMCard.setAppearance(appearance, false); setAutoActionValues(theDveMCard); } COM: <s> set the modifications in the dve mcard </s>
funcom_train/1150213
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int getChunkSize(int c) { // if not specified, set as default if (c < 1) { c = DEFAULT_CHUNKSIZE; } // enforce min/max chunksize on c c = Math.max(c, MIN_CHUNKSIZE); c = Math.min(c, MAX_CHUNKSIZE); // enforce as multiple of 4K int div = c / MIN_CHUNKSIZE; c = MIN_CHUNKSIZE * div; // subtract overhead c -= CHUNK_OVERHEAD; return c; } COM: <s> get the chunk size for the current chunker </s>
funcom_train/35318471
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void displayMessage(String caption, String text, MessageType messageType) { if (caption == null && text == null) { throw new NullPointerException("displaying the message with both caption and text being null"); } TrayIconPeer peer = this.peer; if (peer != null) { peer.displayMessage(caption, text, messageType.name()); } } COM: <s> displays a popup message near the tray icon </s>
funcom_train/4615176
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void cleanupBeforeNewApp () { try { if (listener != null) { listener.cancel(); } blinkLEDs(LEDColor.BLUE); quit(); cleanup(); } catch (Throwable th) { System.out.println("Exception quitting application and cleaning up: " + th.toString()); } } COM: <s> auxiliary routine to quit application and cleanup before invoking bootloader </s>
funcom_train/5407795
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void refreshAllPresence(JID jid) { for (ServiceName service : ServiceName.values()) { if (service.isRunning()) { try { service.getService().refreshAllPresence(jid); } catch (ComponentException e) { ZimbraLog.im.debug("Caught ComponentException in refreshPresence(" +jid+") for service "+service.name(), e); } } } } COM: <s> shameless hack to get around auth forbidden with probe requests right now </s>
funcom_train/25367691
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String createCharacterVectorQuery (String [] ns) { String query = "make.unique (make.names (c ("; if (ns.length > 0) { query += enquote (ns [0]); for (int i = 1; i < ns.length; i ++) query += ", " + enquote (ns [i]); } query += ")))\n"; return query; } COM: <s> given a vector of strings create the following r expression </s>
funcom_train/1376095
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: /*public MovementData getVelocity() { //shouldn't be needed, we always need to update //if no new motor command was issued //if (!addedMovementSinceLastPush) addMovementSinceLastPush(); int currentTime = Clock.timestamp(); double dt = (currentTime - lastTime)*1000; //elapsed time in seconds double vx=dx/dt; double vy=dy/dt; lastTime = currentTime; dx=0; dy=0; addedMovementSinceLastPush = false; return new MovementData(currentTime,vx,vy); }*/ COM: <s> returns the velocity since the last call to the ukf positioning filter </s>
funcom_train/17800497
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean save(Vigne vigne, boolean druideDB_commit) { try { if (DDBCave.getInstance().getVigneList().contains(vigne)) { DDBCave.getInstance().getVigneList().remove(vigne); } DDBCave.getInstance().getVigneList().add(vigne); saveDB(druideDB_commit); } catch (Exception e) { return false; } return true; } COM: <s> saves and commit the change if commit is strong true strong </s>
funcom_train/29313441
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public double getMoment(double a, int n){ double sum = 0, x, w; if (type == DISCRETE) w = 1; else w = domain.getWidth(); for (int i = 0; i < domain.getSize(); i++){ x = domain.getValue(i); sum = sum + Math.pow(x - a, n) * getDensity(x) * w; } return sum; } COM: <s> this method returns a default approximation of the moment of a specified order </s>
funcom_train/3391795
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void writeClassName(String classStr) { table(1, 3, 0); trBgcolorStyle("#EEEEFF", "TableSubHeadingColor"); thAlignColspan("left", 3); write(classStr); thEnd(); trEnd(); } COM: <s> print the class name in the table heading </s>
funcom_train/18203828
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void step() { if( m_runnerThread == NO_THREAD ) { throw new IllegalStateException( ENGIN_IS_DOWN ); } else if( m_simulation == NO_SIMULATION ) { // no simulation, nothing to do. return; } else { synchronized( m_renderingLock ) { pause(); stepInternal(); } } } COM: <s> performs a single simulation step and then pauses simulation progress </s>
funcom_train/32056266
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void actionPerformed(ActionEvent e) { this.lastActionCommand = e.getActionCommand() ; if ( PAGE.equals(e.getActionCommand() )) getCurrentGraph().setPageVisible(true); else getCurrentGraph().setPageVisible(false); getCurrentDocument().updatePageFormat(); update(); } COM: <s> displays the view in the specified layout </s>
funcom_train/7443452
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getSchemeSpecificPart() { String result = null; if (hasScheme()) { // Scheme found if (hasFragment()) { // Fragment found result = this.internalRef.substring(this.schemeIndex + 1, this.fragmentIndex); } else { // No fragment found result = this.internalRef.substring(this.schemeIndex + 1); } } return result; } COM: <s> returns the scheme specific part </s>
funcom_train/10954449
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public FastByteArrayOutputStream getContent() throws IOException { //if we are using a writer, we need to flush the //data to the underlying outputstream. //most containers do this - but it seems Jetty 4.0.5 doesn't if (pagePrintWriter != null) { pagePrintWriter.flush(); } return ((PageOutputStream) getOutputStream()).getBuffer(); } COM: <s> return the content buffered inside the </s>
funcom_train/19142719
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void saveOrUpdatePoint(Point point) { Session session = HibernateUtil.currentSession(); Transaction tx = null; try { tx = session.beginTransaction(); session.saveOrUpdate(point); tx.commit(); } catch (HibernateException e) { HibernateUtil.handleHibernateException(tx, e); } finally { HibernateUtil.closeSession(); } } COM: <s> persists a point or updates if it was already persisted </s>
funcom_train/9495655
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean isAncestor(final ClassLoader classLoader) { /* bootstrap classloader, at root of all trees! */ if (classLoader == null) return true; for (int idx = 0; idx < size(); idx++) { for(ClassLoader walker = get(idx); walker != null; walker = walker.getParent()) { if (walker == classLoader) { return true; } } } return false; } COM: <s> check to see if code class loader code is an </s>
funcom_train/1240202
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ArrayList getAllInParams() { ArrayList result = new ArrayList(); for (Iterator i = parameters.iterator(); i.hasNext();) { ParameterDesc desc = (ParameterDesc) i.next(); if (desc.getMode() != ParameterDesc.OUT) { result.add(desc); } } return result; } COM: <s> return a list of all in params including inouts </s>
funcom_train/18166488
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean equals(Object o) { if (o == null) return false; if (o instanceof CAFEGraphComponent) { CAFEGraphComponent component = (CAFEGraphComponent) o; Rectangle bound = component.getBoundary(); if (bound == null) return false; // only true if boundaries are both null. if (boundary == null) { return (bound == null); } // otherwise pass on. return boundary.equals(bound); } // nope return false; } COM: <s> checks if two components are equal </s>
funcom_train/46077167
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getNumNPCInstances() { if (numInstances == -1) { //Recalc numInstances = 0; for (int i=0; i<getNumNPCs(); i++) { if (getNPC(i).instances!=null) numInstances += getNPC(i).instances.length; } } return numInstances; } COM: <s> returns the helper value which marks how many instances </s>
funcom_train/1241256
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean removeNamespaceDeclaration(String namespacePrefix) { makeAttributesEditable(); boolean removed = false; for (int i = 0; namespaces != null && i < namespaces.size() && !removed; i++) { if (((Mapping)namespaces.get(i)).getPrefix().equals(namespacePrefix)) { namespaces.remove(i); removed = true; } } return removed; } COM: <s> remove a namespace declaration </s>
funcom_train/41766609
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void show() { // this behavior allows a use case where dialogs of various sizes are layered // one on top of the other setDisposed(false); if(top > -1) { show(top, bottom, left, right, includeTitle, modal); } else { if(modal) { super.showModal(); } else { showModeless(); } } } COM: <s> the default version of show modal shows the dialog occupying the center portion </s>
funcom_train/8089712
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getMeanStddev() { String result; int i; result = ""; if (m_meanValue != null) { for (i = 0; i < m_meanValue.length; i++) { if (i > 0) result += ","; result += "" + m_meanValue[i] + "," + m_stddevValue[i]; } } return result; } COM: <s> returns the current mean stddev setup </s>
funcom_train/42010492
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getDocumentTypeCount() { String res = ""; try { pm.connect(); ManagementDB managementDB = new ManagementDB(pm.getSqlConnection()); res = managementDB.getDocumentTypeCount(); } catch (Exception ex) { Logger.getLogger(IndexerStatics.class.getName()).log(Level.WARNING, null, ex); } return res; } COM: <s> get the total documents indexed in the db grouped by type </s>
funcom_train/38861656
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Font getFont1() { if (font1 == null) {//GEN-END:|23-getter|0|23-preInit // write pre-init user code here font1 = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_BOLD, Font.SIZE_LARGE);//GEN-LINE:|23-getter|1|23-postInit // write post-init user code here }//GEN-BEGIN:|23-getter|2| return font1; } COM: <s> returns an initialized instance of font1 component </s>
funcom_train/25034056
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void writeBase(DicomOutputStream o) throws IOException { o.writeUnsigned16(getGroup()); o.writeUnsigned16(getElement()); if (o.isExplicitVR()) { byte[] vr = getVR(); o.write(vr,0,2); if (ValueRepresentation.isShortValueLengthVR(vr)) { o.writeUnsigned16((int)getPaddedVL()); } else { o.writeUnsigned16(0); // reserved bytes o.writeUnsigned32(getPaddedVL()); } } else { o.writeUnsigned32(getPaddedVL()); } } COM: <s> p write the common preamble of an attribute to the output stream </s>
funcom_train/45910614
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean within(int px, int py, int pw, int ph) { int s = get().getWidth(); int ax0 = x - s / 2; int ax1 = ax0 + s - 1; int ay0 = y - s / 2; int ay1 = ay0 + s - 1; int bx0 = px - pw / 2; int bx1 = bx0 + s - 1; int by0 = py - ph / 2; int by1 = by0 + s - 1; return !(ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0); } COM: <s> test if the explosion is within the given rectangle </s>
funcom_train/45253986
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void remove(IEditorInput input) { if (input == null) { return; } Iterator iter = fifoList.iterator(); while (iter.hasNext()) { EditorHistoryItem item = (EditorHistoryItem) iter.next(); if (item.matches(input)) { iter.remove(); } } } COM: <s> removes all traces of an editor input from the history </s>
funcom_train/45935959
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void navPreviousNext() { println(openULWithID("PreviousNext")); String prevLink = (prevLetter == null) ? prevLabel : linkToLabelHref(prevLabel, "index-" + prevLetter + CONF.ext); String nextLink = (nextLetter == null) ? nextLabel : linkToLabelHref(nextLabel, "index-" + nextLetter + CONF.ext); println(listItem(prevLink) + listItemLast(nextLink)); println(close("ul")); } COM: <s> print links to previous and next index pages if they exist </s>
funcom_train/13867808
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Node setNamedItem(Node arg) { try { return NodeImpl.build(XMLParserImpl.setNamedItem(this.getJsObject(), ((DOMItem) arg).getJsObject())); } catch (JavaScriptException e) { throw new DOMNodeException(DOMException.INVALID_MODIFICATION_ERR, e, this); } } COM: <s> this function delegates to the native method code set named item code in </s>
funcom_train/7963134
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean add(Option<?> option, boolean throwError) { boolean found = false; for (Option<?> o : this) { if (o.getName().equals(option.getName())) { found = true; o.setDisplayName(option.getDisplayName()); } } if (!found) return super.add(option); if (throwError) Logger.log("Option " + option.getName() + " already exists.", Logger.ERROR); return false; } COM: <s> adds options to the option set </s>
funcom_train/44849001
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void setSerialized(Page inPage, int inLastPageNumber) { StringBuffer lXML = new StringBuffer(HEADER + ROOT_BEGIN); DomainObjectIterator lDomainObjects = inPage.getObjects().elements(); while (lDomainObjects.hasMoreElements()) { DomainObject lObject = (DomainObject)lDomainObjects.nextElement(); XMLSerializer lSerializer = new XMLSerializer(); lObject.accept(lSerializer); lXML.append(lSerializer.toString()); } lXML.append(ROOT_END); inPage.setSerialized(new String(lXML)); } COM: <s> set the serialized string </s>
funcom_train/51186301
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void remove(final BusListener listener) { final DefaultBusMember proxy = (DefaultBusMember) listeners.get(listener); if (proxy != null) { final List<String> buses = proxy.getRegisteredBuses(); String bus; while (!buses.isEmpty()) { bus = buses.get(0); if (isDebug) { log.debug("Removed: " + listener.toString() + " : " + bus); } proxy.unbind(bus); } listeners.remove(listener); } } COM: <s> unbinds a listener from all channels and removes the lister </s>
funcom_train/10618633
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void finalize() { //System.out.println("finalizing system cursors on X11!"); for (int i = 0; i < systemCursors.length; i++) { LinuxCursor cursor = (LinuxCursor) systemCursors[i]; if (cursor != null) { cursor.destroy(); } } } COM: <s> we have to explicitly free system predefined cursors on x11 </s>
funcom_train/48102254
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String readLine() throws IOException { final StringBuffer sb = new StringBuffer(); for (int c = is.read(); c >= 0 && c != '\n'; c = is.read()) { sb.append((char) c); } return sb.toString(); } COM: <s> read single line from input stream </s>
funcom_train/18865126
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void removeObserver(WeakObserver o, ArrayList list) { synchronized (list) { for (Iterator i = list.iterator(); i.hasNext();) { Object obj = ((Reference) i.next()).get(); if (obj == null || obj == o) { i.remove(); } } } } COM: <s> deletes a weak observer from the set of observers of this object </s>
funcom_train/19457473
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testCreateAndDeleteProdos140kDisk() throws IOException { ByteArrayImageLayout imageLayout = new ByteArrayImageLayout(Disk.APPLE_140KB_DISK); ImageOrder imageOrder = new DosOrder(imageLayout); FormattedDisk[] disks = ProdosFormatDisk.create( "createanddelete-test-prodos-140k.dsk", "TEST", //$NON-NLS-1$ //$NON-NLS-2$ imageOrder); createAndDeleteFiles(disks, "BIN"); //$NON-NLS-1$ saveDisks(disks); } COM: <s> test creating and deleting many files on a pro dos 140 k disk </s>