__key__
stringlengths
16
21
__url__
stringclasses
1 value
txt
stringlengths
183
1.2k
funcom_train/27866946
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testCreateAndRemove() { String name = null; try { DataSource dataSource = createTestDataSource(); name = dataSource.getName(); assertTrue(handler.getObject(name) != null); handler.removeObject(name); assertTrue(handler.getObject(name) == null); } catch (Exception e) { fail(e.toString()); } } COM: <s> test to create a datasource and then remove from handler </s>
funcom_train/9643786
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Map getExpandedNodes() { Map map = new IdentityHashMap(); for (Iterator iter = trees.iterator(); iter.hasNext();) { JTree tree = (JTree) iter.next(); List list = new LinkedList(); TreePath rootPath = new TreePath(getRoot()); Enumeration expanded = tree.getExpandedDescendants(rootPath); if (expanded != null) { list.addAll(Collections.list(expanded)); } map.put(tree, list); } return map; } COM: <s> gets the expanded nodes </s>
funcom_train/31670146
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String tryUnzippingFile(String filename) throws Exception { ZipFile file = new ZipFile(filename); for (Enumeration e = file.entries(); e.hasMoreElements(); ){ ZipEntry entry = (ZipEntry)e.nextElement(); InputStream input = file.getInputStream(entry); ByteArrayOutputStream output = new ByteArrayOutputStream(); TEKUtil.writeStreamToStream(input, output); return new String(output.toByteArray()); } throw new Exception("Did not find any entries."); } COM: <s> tries to treat filename as a zip file returning the unzipped </s>
funcom_train/17774299
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setSquareColor(int x, int y, Color color) { if (x < 0 || x >= width || y < 0 || y >= height) { return; } matrix[y][x] = color; if (component != null) { component.invalidateSquare(x, y); } } COM: <s> changes the color of an individual square on the board </s>
funcom_train/31765257
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected List findLiveChildren(Inode parent, WebAsset webAsset){ String condition = (" and deleted =" + com.dotmarketing.db.DbConnectionFactory.getDBFalse() + " and live =" + com.dotmarketing.db.DbConnectionFactory.getDBTrue()); return getChildrenClassByCondition(parent, webAsset.getClass(), condition); } COM: <s> please remove me </s>
funcom_train/41416587
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void onModuleLoad() { // Show website showWebsite(); // Check login status using login service. LoginServiceAsync loginService = GWT.create(LoginService.class); loginService.login(GWT.getHostPageBaseURL(), new AsyncCallback<LoginInfo>() { public void onFailure(Throwable error) { } public void onSuccess(LoginInfo result) { loginInfo = result; if (loginInfo.isLoggedIn()) { onSuccesfulLogin(); } else { loadLogin(); } } }); } COM: <s> this is the entry point method </s>
funcom_train/50326730
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int readInt4(InputStream s) throws java.io.IOException { int i1 = s.read()&0xFF; int i2 = s.read()&0xFF; int i3 = s.read()&0xFF; int i4 = s.read()&0xFF; return i1+(i2<<8)+(i3<<16)+(i4<<24); } COM: <s> read a 4 byte integer handling endian ness of spj files </s>
funcom_train/9662960
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public LazyHierarchicalGridDataModel (DataModelCallbackHandler<Editable> handler) { super((Object[][])null); final LazyHierarchicalGridDataModel source = this; setDelegate(new LazyGridDataModel(handler) { protected void prepareEvent(EditableModelEvent event) { event.setSource(source); } }); } COM: <s> creates a new instnace of this class and defines the handler </s>
funcom_train/7238797
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected boolean lookaheadIsEmpty(Alternative alt, int maxDepth) { int depth = alt.lookaheadDepth; if ( depth == GrammarAnalyzer.NONDETERMINISTIC ) { depth = grammar.maxk; } for (int i=1; i<=depth && i<=maxDepth; i++) { BitSet p = alt.cache[i].fset; if (p.degree() != 0) { return false; } } return true; } COM: <s> is the lookahead for this alt empty </s>
funcom_train/36111033
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void harvestCurrentDisabled() { if (selectedSet != null) { disabledCats.removeAll(selectedSet.getDocuments()); disabledCats.addAll(catBox.getDisabledDocuments()); } if (selectedCat != null) { disabledDocs.removeAll(selectedCat.getDocuments()); disabledDocs.addAll(docBox.getDisabledDocuments()); } } COM: <s> harvests currently disabled documents for all document boxes </s>
funcom_train/48153866
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void stateChanged(ChangeEvent e){ if (e.getSource() == tScroll.getSlider()){ t = tScroll.getValue(); timeStep = t / 100; timeline.setDomain(new Domain(0, t, timeStep, Domain.CONTINUOUS)); setDistribution(); } else if (e.getSource() == rScroll.getSlider()){ r = rScroll.getValue(); setDistribution(); } else if (e.getSource() == pScroll.getSlider()){ p = pScroll.getValue(); setDistribution(); } } COM: <s> this method handles the scrollbar events for adjusting the size </s>
funcom_train/41782706
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private WTextBox getTextBox( String id, String initialText ){ WTextBox tb = new WTextBox( id, getDefaultFont(), _imgs[IMG_IDX_TEXTBOX], _imgs[IMG_IDX_TEXTBOX_SEL] ); tb.setText( initialText ); tb.setAlignment( Constants.ALIGN_CENTRE_V | Constants.ALIGN_LEFT ); return tb; } COM: <s> helper method used to create a textbox widget </s>
funcom_train/20060942
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public SwscaleLibrary yuv422ptoyuy2(Pointer<SwscaleLibrary.yuv422ptoyuy2_callback > yuv422ptoyuy2) { try { { BridJ.getNativeLibrary("swscale").getSymbolPointer("yuv422ptoyuy2").as(org.bridj.util.DefaultParameterizedType.paramType(org.bridj.Pointer.class, com.nativelibs4java.ffmpeg.swscale.SwscaleLibrary.yuv422ptoyuy2_callback.class)).set(yuv422ptoyuy2); return this; } }catch (Throwable $ex$) { throw new RuntimeException($ex$); } } COM: <s> width should be a multiple of 16 </s>
funcom_train/17818431
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JMenu setupOptionsJM() { if (logger.isDebugEnabled()) { logger.debug("setupOptionsJM() - start"); } JMenu jm = new JMenu(rbLocale.getString("Menu.Options")); jmiO_prefs = createMenuItem("Options.Preferences"); jmiO_prefs.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, ActionEvent.CTRL_MASK)); jm.add(jmiO_prefs); if (logger.isDebugEnabled()) { logger.debug("setupOptionsJM() - end"); } return jm; } COM: <s> setups the options menu on the menu bar </s>
funcom_train/1033011
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void checkTransactionIsolationLevel() throws SQLException { String txIsolationName = null; if (versionMeetsMinimum(4, 0, 3)) { txIsolationName = "tx_isolation"; } else { txIsolationName = "transaction_isolation"; } String s = (String) this.serverVariables.get(txIsolationName); if (s != null) { Integer intTI = (Integer) mapTransIsolationNameToValue.get(s); if (intTI != null) { this.isolationLevel = intTI.intValue(); } } } COM: <s> set transaction isolation level to the value received from server if any </s>
funcom_train/25920963
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void drawCursor(Graphics graphics) throws GUIException { graphics.setColor(new Color(cursorColor.getRed(), cursorColor.getGreen(), cursorColor.getBlue(), 255)); graphics.drawLine(onScreenCursorPosition, getYTextPosition(), onScreenCursorPosition, getYTextPosition() + textFont.getHeight()); } COM: <s> draws cursors on position specified by on screen cursor position </s>
funcom_train/9524258
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: @Test public void testGatherInformation() { artifactSubset.add("fact"); options.put("source", "asdasd"); //options.put("appid", "tempappid"); options.put("culture", "en-US"); options.put("safesearch", "asdasd"); searchAgent.setArtifactSubset(artifactSubset); searchAgent.setOptions(options); searchAgent.start(); do{}while(searchAgent.isAlive()); Map<Object,Object> resultSet = searchAgent.getResultSet(); System.out.println(resultSet.toString()); assertNotNull(resultSet); } COM: <s> tests the gather information functionality </s>
funcom_train/18728936
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testClearAll() { instance.setSaveFileName("saveMeAs"); instance.setSaved(true); instance.clearAll(); assertFalse(instance.isSaved()); instance.setSaved(true); instance.clearAll(); assertTrue(instance.isSaved()); } COM: <s> test of clear all method of class net </s>
funcom_train/882687
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testRemoveInstance() throws NamingException { EntityType et = om .createEntityType("testType4", "testTypeDescription4"); //$NON-NLS-1$ //$NON-NLS-2$ Instance inst = et.createInstance(false); assertNotNull(inst); Iterator it = et.getInstances(); assertNotNull(it); assertTrue(it.hasNext()); inst.remove(); it = et.getInstances(); assertNotNull(it); assertFalse(it.hasNext()); } COM: <s> test remove instance </s>
funcom_train/32056367
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object createCell(GraphModel model, int type, Object userObject, Map map) { switch (type){ case CELL_EDGE_DEFAULT : return new DefaultEdge(userObject); case CELL_VERTEX_ELLIPSE: return new EllipseCell(userObject); case CELL_VERTEX_IMAGE : return new ImageCell(userObject); case CELL_PORT_DEFAULT: return new DefaultPort(userObject); case CELL_VERTEX_TEXT: return new TextCell(userObject, true); } return new DefaultGraphCell(userObject); } COM: <s> creates the cells for the default graph model </s>
funcom_train/2969261
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean isOnline() { int tries = 5; for (int i = 0; i < tries; i ++) { try { Thread.sleep(500); server.ping(); return true; } catch (Exception ex) { GLog.warn(L.tr("Exception after sleeping."), ex); } } return false; } COM: <s> this method will try to connect to server via ping </s>
funcom_train/41466723
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setSvcChngMethodExtension(java.lang.String extMethod) throws javax.megaco.association.MethodExtensionException, IllegalArgumentException { if (this.srvChngMethod == null || this.srvChngMethod.getSrvChngMethodId() != srvChngMethod.M_EXTENSION) { throw new MethodExtensionException("SrvChngMethod must be set to: SVC_CHNG_METHOD_EXTENSION"); } DescriptorUtils.checkMethodExtensionRules(extMethod); this.svcChngMethodExtension = extMethod; } COM: <s> this method sets the extended service change method </s>
funcom_train/16501873
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: @Test public void testHelloWorld() throws IOException { assertTrue("Hello World".equals(received)); reactor.register(new SimpleTimer(this,100)); long time = (new Date()).getTime(); System.out.println(time); while ((new Date()).getTime()- time<1000) { reactor.handleEvents(10); } assertTrue("Hello World".equals(fromTimer)); } COM: <s> test method called by the test framework </s>
funcom_train/47236115
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Calendar getFeNacAgregar() { if (checkDatosAgregar()) { Calendar aux = Calendar.getInstance(); aux.set(Integer.parseInt(AAAAField02.getText()), Integer.parseInt(MMField02.getText()) - 1, Integer.parseInt(DDField02.getText())); return aux; } else { return null; } } COM: <s> public string get idagregar </s>
funcom_train/22232295
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setBoundaryModeR(int boundaryModeR) { checkForLiveOrCompiled(); switch (boundaryModeR) { case Texture.CLAMP: case Texture.WRAP: case Texture.CLAMP_TO_EDGE: case Texture.CLAMP_TO_BOUNDARY: break; default: throw new IllegalArgumentException(J3dI18N.getString("Texture31")); } ((Texture3DRetained)this.retained).initBoundaryModeR(boundaryModeR); } COM: <s> sets the boundary mode for the r coordinate in this texture object </s>
funcom_train/38857155
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String toString(final List<Class<?>> paramSignature){ final StringBuilder sb = new StringBuilder(); for (Class cls : paramSignature) { sb.append(cls == null ? "null" : cls.getSimpleName() + ", "); } return sb.toString(); } COM: <s> get a string representation of param signature </s>
funcom_train/14344877
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Double findLatestVersion() { String version = null; String filesPageSource = null; try { StringBuffer buf = WebpageRetriever.retrieve(FILES_PAGE_LINK); filesPageSource = buf.toString(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } Pattern pattern = Pattern.compile("Latest.*?brutalchess.*?brutalchess-alpha-([^<]+)", Pattern.MULTILINE | Pattern.DOTALL); Matcher matcher = pattern.matcher(filesPageSource); matcher.find(); version = matcher.group(1); return Double.parseDouble(version); } COM: <s> scrapes the sf downloads page to find the latest version available for </s>
funcom_train/50310636
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void send(byte[] buffer) throws ClusterException { Logger.log(Logger.DEBUG, "Cluster: Sending serial data [" + buffer + "] length [" + buffer.length + "]", this); DatagramPacket packet = new DatagramPacket(buffer, buffer.length, localInetAddress, clusterPort); try { socket.send(packet); } catch (IOException e) { throw new ClusterException("Couldn't send data"); } } COM: <s> multicasts data to the cluster </s>
funcom_train/5537159
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void save(String fileName) throws IOException { Iterator<String> i = list.iterator(); // will throw NPE if i==null String file = ""; while (i.hasNext()) file += i.next() + "\n"; FileWriter fw = new FileWriter(fileName); fw.write(file); fw.close(); } COM: <s> saves the message idlist in a line by line format </s>
funcom_train/13203771
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected ISupport accept(Node node) { ISupport ret; if (node instanceof ISupport) { ret = ((ISupport)node).cast(m_install); if (ret!=null) { if ((m_mandate!=null && !m_mandate.isAssignableFrom(ret.getClass()) || ((m_filter!=null && !m_filter.acceptObject(ret))))) { ret = null; } } } else { ret = null; } return ret; } COM: <s> tests if a node implements the node </s>
funcom_train/4085857
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Widget createCell( Vec2i loc, String... styleNames ) { Widget widget = GWT.create( FlowPanel.class ); widget.addStyleName( resources.style().cell() ); for( String style : styleNames ) widget.addStyleName( style ); addCellWidget( loc, widget ); return widget; } COM: <s> creates a standard cell widget and adds it at a specific cell </s>
funcom_train/9874479
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void onSelected(IFramework framework) { ICGHDisplayMenu cghMenu = framework.getCghDisplayMenu(); IDisplayMenu menu = framework.getDisplayMenu(); ICGHCloneValueMenu cloneValueMenu = framework.getCghCloneValueMenu(); onMenuChanged(menu); onMenuChanged(cghMenu); onCloneValuesChanged(cloneValueMenu); //repaint(); } COM: <s> invoked by the framework when this viewer is selected </s>
funcom_train/29830203
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void fireSubscriptionResult(InfoQuery iq, PubsubEntity entity, String id) { for (Enumeration e = pubsubListeners.elements(); e.hasMoreElements(); ) { BSPubsubListener listener = (BSPubsubListener) e.nextElement(); listener.subscriptionResult(iq, entity, id); } } COM: <s> notifies pubsub listeners about result of subscription request </s>
funcom_train/48417783
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String removeUrls(String text) { List<String> urls = extractor.extractURLs(text); if (urls.size() > 0) { //System.out.println("text before removing urls == " + text); //System.out.println("urls == " + urls.toString()); } for (String url : urls) { text = text.replaceAll(url, " "); //System.out.println("text after removing urls == " + text); } return text; } COM: <s> removes the urls from the source text </s>
funcom_train/40335094
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public JMenuBar createMenubar() { JMenuBar mb = new JMenuBar(); String[] menuKeys = tokenize(getResourceString("menubar")); for (int i = 0; i < menuKeys.length; i++) { JMenu m = createMenu(menuKeys[i]); if (m != null) { mb.add(m); } } return mb; } COM: <s> create the menubar for the app </s>
funcom_train/1712697
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: final private void readColorSpaceSettings(Map rawValues) { LogWriter.writeMethod("{readColorSpaces}", 0); String col_id = "",currentRawValue=""; Iterator colList = rawValues.keySet().iterator(); while (colList.hasNext()) { col_id = (String) colList.next(); currentRawValue=(String) rawValues.get(col_id); rawColorspaceValues.put(col_id,currentRawValue); } } COM: <s> examine and decode color space command </s>
funcom_train/1304025
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Segment getPreviousSegment(Segment segment) { Segment result = null; if (segment == null) { if (segments.size() > 0) { result = segments.get(segments.size() - 1); } } else { final int position = segments.indexOf(segment); if (position - 1 >= 0) { result = segments.get(position - 1); } } return result; } COM: <s> get the segment that precedes the given segment in this sequence </s>
funcom_train/28744009
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public MaterialSupSetInfo getMaterialSupSetInfoById(Integer id) throws SimsException { //String errMsg = clsName + ".getMaterialSupSetInfoById(): "; MaterialSupSetInfo info; try { local = this.getMaterialSupSetLocalById(id); info = local.getMaterialSupSetInfo(); } catch (RuntimeException e) { //Propagate. throw e; } return info; } COM: <s> get material sup set info object by id </s>
funcom_train/51162768
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object eval(Object x, Object env) { DynamicEnvironment dynamicEnv = ((env == U.MISSING) ? interactionEnvironment : (DynamicEnvironment) env); Object analyzedCode = analyze(x,dynamicEnv,LexicalEnvironment.NULLENV); return execute(analyzedCode,LexicalEnvironment.NULLENV); } COM: <s> evaluate an s expression in a lexical environment </s>
funcom_train/9522729
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean playTone(int frequency, int duration) { playTone.setFrequency(frequency); playTone.setDuration(duration); try { brick.getChannel().sendCommand(playTone); } catch (IOException ioe) { System.err.println("IOException: " + ioe.getMessage()); return false; } return true; } COM: <s> plays a tone on the brick </s>
funcom_train/18433426
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int hashCode() { int result; result = (this.period != null ? this.period.hashCode() : 0); result = 29 * result + (this.value != null ? this.value.hashCode() : 0); result = HashUtilities.hashCode(result, this.selected); return result; } COM: <s> returns a hash code </s>
funcom_train/16530260
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean saveCurnit() { try { forceAuthoringOff(); boolean savedSuccessfully = sessionManager.save(workingCurnit); if(savedSuccessfully) { //popup to notify user save was successful JOptionPane.showMessageDialog(this.getMainAuthoringFrame(), "Project has been saved."); } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); return false; } return true; } COM: <s> save the curnit to where it was last saved to or loaded from </s>
funcom_train/7243862
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void writeInt(int x, OutputStream os) throws IOException { os.write((byte)(x >> 24)); os.write((byte)(x >> 16)); os.write((byte)(x >> 8)); os.write((byte) x ); } COM: <s> writes an int to code os code in big endian byte order </s>
funcom_train/38494758
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public OutputStream openStream() throws IllegalStateException { if (mClass != null) { throw new IllegalStateException("New class has already been defined"); } ByteArrayOutputStream data = mData; if (data != null) { throw new IllegalStateException("Stream already opened"); } mData = data = new ByteArrayOutputStream(); return data; } COM: <s> open a stream to define the new class into </s>
funcom_train/9994211
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testGetNotiz() throws AssertionFailedException { System.out.println("getNotiz"); Termin instance = new Termin(); String expResult_1 = ""; String result_1 = instance.getNotiz(); assertEquals(expResult_1, result_1); fail("The test case is a prototype."); } COM: <s> test of test get notiz method of class termin </s>
funcom_train/8602249
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException { if ("MerlotTargetServiceBinding".equals(portName)) { setMerlotTargetServiceBindingEndpointAddress(address); } else { // Unknown Port Name throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName); } } COM: <s> set the endpoint address for the specified port name </s>
funcom_train/42434105
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void restoreExpandedState() { for(int i = 0; i < expandedPaths.size(); i++) { try{ //System.out.println("Expand Path :"+((TreePath)expandedPaths.get(i)).toString()); expandPath((TreePath)expandedPaths.get(i)); }catch(Exception e){e.printStackTrace();} } } COM: <s> re expands the expanded paths in the specified tree </s>
funcom_train/28470836
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: static public int createDB(int creator, int flags, int cardNo, String name, int type) throws SyncException { dbCreateDB data = new dbCreateDB(creator, flags, cardNo, name, type); verifyResult(SyncCreateDB(data), "Error Creating Database"); return data.fileHandle; } COM: <s> creates a new database on the palm os device </s>
funcom_train/9877134
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private FloatMatrix getVariances(FloatMatrix data, FloatMatrix means, int [][] clusters){ int nSamples = data.getColumnDimension(); FloatMatrix variances = new FloatMatrix(clusters.length, nSamples); for(int i = 0; i < clusters.length; i++){ variances.A[i] = getVariances(data, means, clusters[i], i); } return variances; } COM: <s> returns a matrix of standard deviations grouped by cluster and element </s>
funcom_train/14402312
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void notifyReportChangesListener() { if (mChangesListener != null && !mChangesListener.isEmpty()) { Vector targets; synchronized (mChangesListener) { targets = (Vector) mChangesListener.clone(); } Enumeration e = targets.elements(); while (e.hasMoreElements()) { ((IReportChangesListener) e.nextElement()) .reportResultHasChanged(mReturnCode); } } } COM: <s> notifies all added code report changes listener code about a report </s>
funcom_train/4427828
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Action createAction() { Procedure scheduler = createScheduler(); Procedure body = createBody(); Pattern input = staticCls.getInputPattern(); Pattern output = staticCls.getOutputPattern(); Tag tag = DfFactory.eINSTANCE.createTag(ACTION_NAME); return DfFactory.eINSTANCE.createAction(tag, input, output, DfFactory.eINSTANCE.createPattern(), scheduler, body); } COM: <s> creates the static action for this actor </s>
funcom_train/37756141
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void renderBodyAreaContainer(BodyAreaContainer area) { writeStartTag("<BodyAreaContainer>"); List children = area.getChildren(); for (int i = 0; i < children.size(); i++) { Box b = (Box)children.get(i); b.render(this); } writeEndTag("</BodyAreaContainer>"); } COM: <s> render a body area container to xml </s>
funcom_train/49916346
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void keyReleased(KeyEvent e) { if (bKeyDown) { bKeyDown = false; if (e.getKeyCode() == KeyEvent.VK_T) { map.bSoundEnabled = !map.bSoundEnabled; repaint(); } else eventActionListener.actionPerformed( new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "Speed")); } } COM: <s> invoked when a key has been released </s>
funcom_train/1153961
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void paintTour(java.awt.Graphics2D g2) { MapAgentModel maModel = (MapAgentModel) model; Point2D lastPt = null; g2.setColor(Color.red); for (String loc : maModel.getTourHistory()) { Point2D pt = maModel.getLocCoords(loc); if (pt != null && lastPt != null) { g2.drawLine(x(pt), y(pt), x(lastPt), y(lastPt)); } lastPt = pt; } } COM: <s> the track of the agent is visualized with red lines </s>
funcom_train/36906207
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void PrintPayroll () throws com.intersys.objects.CacheException { com.intersys.cache.Dataholder[] args = new com.intersys.cache.Dataholder[0]; com.intersys.cache.Dataholder res=mInternal.runInstanceMethod("PrintPayroll",args,com.intersys.objects.Database.RET_NONE); return; } COM: <s> p runs method print payroll in cache </s>
funcom_train/39314516
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testCloseDialog() { System.out.println("testCloseDialog"); Frame f2=new Frame(); //JFrame jf = new JFrame(); canvas_size tester=new canvas_size(f, true); tester.initComponents(); Window p = new Window(f2); WindowEvent myEvent=new WindowEvent(p, 1); tester.closeDialog(myEvent); assertNotNull(tester); } COM: <s> test of close dialog method of class canvas size </s>
funcom_train/12163047
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testOuterRenderer() throws Exception { // Testing the outer renderer MenuItemBracketingRenderer factoryRenderer = factory.createOuterRenderer(); assertNotNull("Should be a plain image renderer", factoryRenderer); if (!(factoryRenderer instanceof DefaultSpanMenuItemRenderer)) { fail("The factory did not return the expected outer renderer"); } } COM: <s> this tests create outer renderer </s>
funcom_train/11379098
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public IndexEntry findEntry(String partName, long partFileOffset) { for (IndexEntry e: entries) { boolean nameMatch = partName.equals(e.partFileName); boolean inRange = (partFileOffset >= e.startOffset) && (partFileOffset < e.startOffset + e.length); if (nameMatch && inRange) { return e; } } return null; } COM: <s> finds the index entry corresponding to a har part file at an offset </s>
funcom_train/18799825
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void runTest() { LOG.fine("running PredTest("+getName()+")"); Pred result = animator_.evalPred(pred_); assertNotNull(result); assertTrue(result instanceof TruePred); System.out.println("Passed test:" + getName()); } COM: <s> test that a predicate evaluates to true pred </s>
funcom_train/44813155
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void initFirstCall(Connection connection) throws SQLException { if (INCREMENT_STRATEGY.equals(strategy)) { // INCREMENT String sql = getMaxValueSQL(tableName, columnName); selectStm = connection.prepareStatement(sql); value = getValue(selectStm); } else if (SEQUENCE_STRATEGY.equals(strategy)) { // SEQUENCE String sql = getNextValueSQL(connection, sequenceName); selectStm = connection.prepareStatement(sql); } } COM: <s> initialize first call </s>
funcom_train/34628452
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addSeparator(Composite parent) { Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL); GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); gridData.horizontalSpan = 2; separator.setLayoutData(gridData); } COM: <s> add a separator to the page </s>
funcom_train/18070981
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JMenuItem getLoadGMapMenuItem() { if (loadGMapMenuItem == null) { loadGMapMenuItem = new JMenuItem(); loadGMapMenuItem.setText("Load GMap"); loadGMapMenuItem .addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { loadGMap(); } }); } return loadGMapMenuItem; } COM: <s> this method initializes load gmap menu item </s>
funcom_train/43326971
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: final public void writeVar2(Printf outfile) throws IOException { outfile.printf("%d",n); outfile.printf(" %d 2",env + 4 * res2NumDefay(type) + 1); outfile.printf(" %f",predH); outfile.printf(" %f",predE); outfile.printf(" %c\n", structure); } COM: <s> writes out this residue in var2 format </s>
funcom_train/8994976
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addDocument(Document doc) throws ApplicationException { if (doc==null) { return; } try { IndexFactory.getIndexModifier().addDocument(doc); }catch (Exception ex) { log.fatal("Error occurs at adding document!", ex); throw new ApplicationException(ErrorConstant.INDEX_CANNOT_WRITE_INDEX, ex, ex.toString()); } } COM: <s> insert a dcoument to lucene </s>
funcom_train/30197030
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testSuggestpopup() { System.out.println("suggestpopup"); /* ActionMapping mapping = null; ActionForm form = null; HttpServletRequest request = null; HttpServletResponse response = null; InserisciCVAction instance = new InserisciCVAction(); ActionForward expResult = null; ActionForward result = instance.suggestpopup(mapping, form, request, response); assertEquals(expResult, result); */ } COM: <s> test of suggestpopup method of class com </s>
funcom_train/9709115
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public AxisConfiguration getAxisConfiguration() throws AxisFault { try { InputStream inputStream = axis2XmlUrl.openStream(); populateAxisConfiguration(inputStream); axisConfig.validateSystemPredefinedPhases(); return axisConfig; } catch (IOException e) { String msg = "Error occured while creating axisConfiguration"; throw new AxisFault(msg, e); } } COM: <s> osgi server configurator will create an specifict axis configuration based on axis2 </s>
funcom_train/41265419
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void initIO() throws IOException { compressionEnabled = false; if( !isCompressionEnabled() ) { xmppWriter = new XmppBufferedWriter( new OutputStreamWriter( socket.getOutputStream(), "UTF-8" ) ); xmppReader = new XmppBufferedReader( new InputStreamReader( socket.getInputStream(), "UTF-8" ) ); } else { // TODO Enbale Compression } } COM: <s> initiate the i o streams </s>
funcom_train/37073795
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean hasNames() { if (getName1() == null) return false; if (getName1().equals(Range.NO_NAME)) return false; if (getName2() == null) return false; if (getName2().equals(Range.NO_NAME)) return false; return true; } COM: <s> returns true if query and hit have names </s>
funcom_train/16454076
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public List getPreferenceKeys() { Enumeration keysEnum = userPrefs.propertyNames(); List keys = new ArrayList(); while (keysEnum.hasMoreElements()) { keys.add(keysEnum.nextElement()); } Collections.sort(keys, String.CASE_INSENSITIVE_ORDER); return keys; } COM: <s> returns list of the preference keys </s>
funcom_train/21080792
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void markServerDown(Server server) { synchronized (_knownServers) { ServerState state = (ServerState)_knownServers.get(server); if (state != null && !state.isDown()) { LOGGER.info("server is down: "+server); state.setUp(false); } } } COM: <s> marks the given server as being down </s>
funcom_train/27843790
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void registerSubModel(Pointer relativePointer, ModelChangeSource subModel) { if (subModel == null) { return; } if (_subModels == null) { _subModels = new HashMap(); } _subModels.put(relativePointer, subModel); subModel.setModelWrapper(_wrapper); subModel.setPointerToRoot(getAbsolutePointer(relativePointer)); } COM: <s> registers a sub model </s>
funcom_train/13249271
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void setIsTextEncrypted(boolean isTextEncrypted) { this.isTextEncrypted = isTextEncrypted; getEncryptButton().setEnabled(!isTextEncrypted); getEncryptMenuItem().setEnabled(!isTextEncrypted); getDecryptButton().setEnabled(isTextEncrypted); getDecryptMenuItem().setEnabled(isTextEncrypted); getTextArea().setEditable(!isTextEncrypted); } COM: <s> sets the boolean value indicating whether the currently viewed text </s>
funcom_train/7384422
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String addStylename(String style, String stylename) { if (indexOfStylename(style, stylename) < 0) { if (style == null) { style = ""; } else if (style.length() > 0 && style.charAt(style.length() - 1) != ';') { style += ';'; } style += stylename; } return style; } COM: <s> adds the specified stylename to the given style if it does not already </s>
funcom_train/46579754
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void update(Observable observable, Object arg) { if (action == null) return; if (!descriptionText.getText().equals(action.getDescription())) { descriptionText.setText(action.getDescription()); } if (!Utils.equal(action.getContext(), contextsCombo.getSelectedItem())) { contextsCombo.setSelectedItem(action.getContext()); } } COM: <s> handle observed changes to the action </s>
funcom_train/22600334
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JButton getJButton1() { if (jButton1 == null) { jButton1 = new JButton(); jButton1.setText("+"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { scaler.scale(visualizationViewer, 1.1f, visualizationViewer.getCenter()); } }); } return jButton1; } COM: <s> this method initializes j button1 </s>
funcom_train/5655202
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setCoordinates(boolean tackle, int newX, int newY){ Iterator iter = beginEdges.getListIterator(); Point New = new Point(newX,newY); if (tackle){ while(iter.hasNext()) { Edge current = (Edge)iter.next(); current.tackle(origin,New); } iter = endEdges.getListIterator(); while(iter.hasNext()) { Edge current = (Edge)iter.next(); current.tackle(origin,New); } } origin.setLocation(newX, newY); } COM: <s> sets this vertexs coordinates to code new x new y code </s>
funcom_train/47109573
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JLabel getJLabelPlayerMartArtsAbil() { jLabelPlayerMartArtsAbil = new JLabel(); jLabelPlayerMartArtsAbil.setBounds(new Rectangle(5, 80, 200, 20)); jLabelPlayerMartArtsAbil.setText("Martial Arts Ability: " + controller.getPlayerMartialArtsAbility()); return jLabelPlayerMartArtsAbil; } COM: <s> creates the label for the player martial arts ability </s>
funcom_train/20333655
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean equals(Object obj) { if (obj instanceof Wall) { Wall cmp=(Wall)obj; if (getInstanceName()!=cmp.getInstanceName() && (getInstanceName()==null || !getInstanceName().equals(cmp.getInstanceName())) ) return false; return true; } return false; } COM: <s> test the equality of this code wall code </s>
funcom_train/21527559
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int OR(int data1, int data2) { int[] bits1 = new int[8]; int[] bits2 = new int[8]; bits1 = this.byte2Bit(data1); bits2 = this.byte2Bit(data2); for (int i = 0; i <= 7; i++) { if (bits1[i] != bits2[i]) { bits1[i] = 1; } } return this.bit2Byte(bits1); } COM: <s> find out the result for data1 or data2 </s>
funcom_train/6481509
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void buildGraph(int layoutType) { this.layoutType = layoutType; getContentPane().removeAll(); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setTitle("Agent Graph Viewer"); getContentPane().setLayout(new BorderLayout()); // create a Jung graph UndirectedSparseMultigraph<Node, Edge> graph = new UndirectedSparseMultigraph<Node, Edge>(); // add nodes and edges addNodesAndEdges(graph); // setup visualisation switch (layoutType) { case LayoutTypeConstants.AGGREGATE: setupClustererViewer(graph); break; case LayoutTypeConstants.CIRCLE: setupCircleViewer(graph); break; default: return; } pack(); setVisible(true); } COM: <s> draws the jung graph </s>
funcom_train/2812627
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void drawCenterGuard(ClassicBarcodeLogicHandler logic) { //draw guard bars 01010 logic.startBarGroup(BarGroup.UPC_EAN_GUARD, null); logic.addBar(false, 1); logic.addBar(true, 1); logic.addBar(false, 1); logic.addBar(true, 1); logic.addBar(false, 1); logic.endBarGroup(); } COM: <s> generates a center guard </s>
funcom_train/41164116
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public StoredOpenResponse3 update(StoredOpenResponse3 entity) { EntityManagerHelper.log("updating StoredOpenResponse3 instance", Level.INFO, null); try { StoredOpenResponse3 result = getEntityManager().merge(entity); EntityManagerHelper.log("update successful", Level.INFO, null); return result; } catch (RuntimeException re) { EntityManagerHelper.log("update failed", Level.SEVERE, re); throw re; } } COM: <s> persist a previously saved stored open response3 entity and return it or a </s>
funcom_train/44465868
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void answerEvent (AnswerEvent e) { if (chapterStatistics == null) { ChapterStatistics cs = e.getChapterStatistics (); chapterStatistics = cs.deepCopy (); } if (e.isCorrect ()) chapterStatistics.addRight (e.getQuestionData ()); else chapterStatistics.addWrong (e.getQuestionData ()); setStatistics (chapterStatistics); } COM: <s> user answered a question refresh statistics and generate text </s>
funcom_train/46729607
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Component getParentFrameOrDialog(Component alternateFrameOrDialog) { ISDialog dialog = SwingUtil.getParentDialog(getSource()); if (dialog != null) { return dialog; } ISFrame frame = SwingUtil.getParentFrame(getSource()); if (frame != null) { return frame; } if (getParentFrame() != null) { return getParentFrame(); } else if (getParentDialog() != null) { return getParentDialog(); } else { return alternateFrameOrDialog; } } COM: <s> get the calling components parent frame </s>
funcom_train/18565327
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private DefaultTreeModel createModel() { UserNodeRenderer renderer = new UserNodeRenderer(); UserNodeEditor editor = new UserNodeEditor(tree, renderer, null); tree.setCellRenderer(renderer); tree.setCellEditor(editor); DefaultMutableTreeNode root = new DefaultMutableTreeNode(title); return new DefaultTreeModel(root); } COM: <s> method create model </s>
funcom_train/34626629
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private BibOutlineContainer childCopy(String sorting) { BibOutlineContainer newboc = new BibOutlineContainer(new ArrayList(), topLevel); newboc.sorting = sorting; for (Iterator iter = childEntries.iterator(); iter.hasNext();) { ReferenceEntry re = (ReferenceEntry) iter.next(); newboc.childEntries.add(re.copy()); } return newboc; } COM: <s> makes a copy of this container so that first level children are copied </s>
funcom_train/22569515
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setAttainedLevelForUser(final ICompetenceLevel level) throws SystemException, PortalException { // Only allowed to set an attained level on a Leaf CompetenceLevel! if (level != null && !level.hasChildLevels()) { JournalEntryFactory.logAttainedLevelEvent(userId, level, ctx); getAttainedLevelJournalEntries().put(level.getCompetence(), level); computeAllCompetenceLevels(level.getCompetenceMapId(), ctx); } } COM: <s> set attained competence level for a user </s>
funcom_train/39396044
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void refreshDocumentation() { if (currentElement == null) { getPnlDocumentation().setEditable(false); getPnlDocumentation().setText(null); } else { if ((getPnlDocumentation().getText() != null) && (!getPnlDocumentation().getText().equals(currentElement.getDocumentation()))) { getPnlDocumentation().setText(currentElement.getDocumentation()); } getPnlDocumentation().setEditable(true); } } COM: <s> show refreshed documentation of the currently selected element in </s>
funcom_train/42639702
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected DecisionSolution initSolution(boolean withGroups, Object scores) { if(withGroups) return new DefaultDecisionSolution(){ public Number getScoreForAlternative(int alternativeIndex) { return getAlternativeScore(alternativeIndex); } public int getAlternativesCount() { return getAlternativeCount(); } }; else return new VirtualDecisionSolution(){ public Number getScoreForAlternative(int alternativeIndex) { return getAlternativeScore(alternativeIndex); } public int getAlternativesCount() { return getAlternativeCount(); } }; } COM: <s> overrides alternatives methods not only of virtual but of default solution </s>
funcom_train/7792380
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int skipDelimiters(int startPos) { if (delimiters == null) throw new NullPointerException(); int position = startPos; while (!retDelims && position < maxPosition) { char c = str.charAt(position); if ((c > maxDelimCodePoint) || (delimiters.indexOf(c) < 0)) break; position++; } return position; } COM: <s> skips delimiters starting from the specified position </s>
funcom_train/45250226
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void selectNext(ProgressInfoItem item) { Control[] children = control.getChildren(); for (int i = 0; i < children.length; i++) { ProgressInfoItem child = (ProgressInfoItem) children[i]; if (item.equals(child)) { ProgressInfoItem next; if (i == children.length - 1) { next = (ProgressInfoItem) children[0]; } else { next = (ProgressInfoItem) children[i + 1]; } item.selectWidgets(false); next.selectWidgets(true); return; } } } COM: <s> select the next item in the receiver </s>
funcom_train/4520311
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public JaretDate dateForXY(int x, int y) { if (_startDate == null) { return null; } int coord; if (_orientation == Orientation.HORIZONTAL) { coord = x; } else { coord = y; } if (!_variableXScale) { return dateForCoordPlain(coord); } else { return dateForCoordVariable(coord); } } COM: <s> retrieve the date for a position on the screen </s>
funcom_train/14121510
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getStatus() { Date now = new Date(); if (this.startDate.after(now)) { // scheduled return 0; } else if (this.endDate.after(now) || (this.estimatedEndDate == null)) { // open return 1; } else { // close return 2; } } COM: <s> calculates current status of pac event based on code start date code </s>
funcom_train/31733127
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ACL readMsg() throws IOException,BEParseException { m = new ACL(); if (getCoding(getByte()) < 0) throw new BEParseException ("Unsupported coding", null); if (getVersion(getByte()) < 0) throw new BEParseException ("Unsupported version", null); if (getType(getByte()) < 0) throw new BEParseException ("Unsupported type", null); while (getMsgParam() != -1); return m; } COM: <s> reads an acl message from the input stream </s>
funcom_train/21616621
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void initAccounts() { accounts = new HashMap<String, Account>(); String[] accountResponse = Connection.getInstance().readArray(UserConnectionThread.ACCOUNT_GET_ALL+""); for (String a : accountResponse) { StringTokenizer strTok = new StringTokenizer(a, ConnectionThread.SPLIT); String sym = strTok.nextToken(); float amount = new Float(strTok.nextToken()); long time = new Long(strTok.nextToken()); accounts.put(sym, new Account(sym, amount, time)); } } COM: <s> private method for initializing accounts </s>
funcom_train/37139180
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void add(final ByteBuffer b1, final ByteBuffer b2) throws IOException { final long length = (b1.limit() - b1.position()) + (b2.limit() - b2.position()); // Create a partial loader for our cache memory buffer and do the insert final PartialLoader record = new MemoryCacheLoader(b1, b2, headerReader); this.edits.insert(this.global, length, record); // Advance past the record we just added this.setPosition(this.global + length); this.autoflush.autoflushChange(length); } COM: <s> adds a new record using two buffers </s>
funcom_train/11345170
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void addMethod(MethodMetadata method) { if (m_methods.length > 0) { MethodMetadata[] newInstances = new MethodMetadata[m_methods.length + 1]; System.arraycopy(m_methods, 0, newInstances, 0, m_methods.length); newInstances[m_methods.length] = method; m_methods = newInstances; } else { m_methods = new MethodMetadata[] { method }; } } COM: <s> adds a method to the list </s>
funcom_train/44799001
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Dimension minimumLayoutSize(final Container parent) { Dimension minimumSize = insetSize(parent); if (parent.getComponentCount() > 0) { Dimension childSize = getComponent(0).getMinimumSize(); minimumSize.width += childSize.width; // minimumSize.height += childSize.height; minimumSize.height = childSize.height; } return minimumSize; } COM: <s> returns the minimum size of first and only child plus the </s>
funcom_train/44925240
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void addPrmitiveElement( DisplayElement displayElement ) { DisplayElemParams prams = displayElement.params; //Sean TODO need to see how we can check this using Primitive Type // Class I think we should Introduce a class PrimitiveDisplayElemParams // where we can store PrimitiveType and use it if( prams instanceof LineDisplayElemParams ) { addLineElement( displayElement ); } else { //TODO handle Rectange Element } } COM: <s> dispatch to handler for the type of primitive in the display element </s>
funcom_train/31904555
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected DOMException createInvalidStringTypeDOMException(short t) { Object[] p = new Object[] { getPropertyName(), new Integer(t) }; String s = Messages.formatMessage("invalid.string.type", p); return new DOMException(DOMException.INVALID_ACCESS_ERR, s); } COM: <s> creates a dom exception given an invalid string type </s>