__key__
stringlengths
16
21
__url__
stringclasses
1 value
txt
stringlengths
183
1.2k
funcom_train/50421447
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setServerToUse(int index) { int count = getServerCount(); if (-1 < index && index < count) { setProperty(SERVER_TO_USE_KEY, Integer.toString(index + 1)); } else { throw new IndexOutOfBoundsException("Invalid index: " + index + ". Must be 0 <= index < " + count + "."); } } COM: <s> set which server to use </s>
funcom_train/3702287
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void sendReports(List listEmails, String strReport) { Iterator it = listEmails.iterator(); String strEmail; System.out.println(" - report:\n " + StringLib.indent(strReport, 9)); while (it.hasNext()) { strEmail = (String) it.next(); System.out.println(" - sending to: " + strEmail); } } // of method COM: <s> send the report out </s>
funcom_train/6475644
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String getColour(long id) { long colourValue1 = (id * 233 + 5 * id) % 255; long colourValue2 = (id * 421 / 5 + 69) % 255; long colourValue3 = (id + 32 * id) % 255; String colour = "rgb(" + colourValue1 + "," + colourValue2 + "," + colourValue3 + ")"; return colour; } COM: <s> calculate a colour in dependency of the id </s>
funcom_train/19066189
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void openPort() throws IOException, IMAPException { socket = new Socket(host, port); socket.setSoTimeout(RistrettoConfig.getInstance().getTimeout()); createStreams(); IMAPResponse response; try { response = in.readResponse(); } catch (IOException e) { state = NOT_CONNECTED; throw e; } // Answer can be OK, PRE-AUTH or BYE if (response.isBYE()) throw new IMAPException(response); if (response.isOK()) state = NON_AUTHENTICATED; else // must be a PRE-AUTH response -> we are already authenticated state = AUTHENTICATED; } COM: <s> opens a socket to the imap server </s>
funcom_train/13392441
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addPlatformCapability(PlatformCapability pCap) { if (!platformCapabilities.contains(pCap)) { if (logger.isLoggable(Level.FINEST)) { logger.finest("Have PlatformCapability : " + pCap.getClass().getName() + " " + "load any system resources"); } pCap.loadResources(); if (platformCapabilities.add(pCap)) { stateChange(); } } } COM: <s> add a code platform capability code object </s>
funcom_train/639311
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setRunFirstMenuOption(boolean enable) { mainButton.removeActionListener(mainButtonListener); mainRunsDefaultMenuOption = enable; setEnabled(mainRunsDefaultMenuOption == false || isEmpty() == false); if (mainRunsDefaultMenuOption) mainButton.addActionListener(mainButtonListener); } COM: <s> set the behavior of the main button </s>
funcom_train/668110
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Long saveFolderHeader(Folder folder) throws DAOException { System.out.println("Entering saveFolderHeader()"); Long newFolderId = null; Session sess = null; Transaction tx = null; try { sess = DAOHibernateUtils.getSession(); tx = sess.beginTransaction(); // Saving the Folder Instance newFolderId = (Long) sess.save(folder); tx.commit(); } catch (HibernateException e) { DAOHibernateUtils.reportException(e); throw new DAOException(); } finally { DAOHibernateUtils.closeSession(sess, tx); System.gc(); } return newFolderId; } COM: <s> this method saves a folder instance holding header information file </s>
funcom_train/34989823
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int getDisplayWidth(Object object) { assert object != null : "The given object cannot be null"; // TODO refactor this logic into utility class that looks for TextProvider. FontMetrics fontMetrics = comboBox.getFontMetrics(comboBox.getFont()); return fontMetrics.stringWidth(object.toString()); } COM: <s> calculates the display width in pixels of the given object </s>
funcom_train/19454281
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void actionPerformed(ActionEvent action) { if(action.getSource().equals(buttonPanel.getOkButton())) { if(panel.checkDataOk()) { okButtonPressed = true; setVisible(false); ActivityLog.log("CTMDialog: Closing, ok button"); } } else { okButtonPressed = false; setVisible(false); ActivityLog.log("CTMDialog: Closing, cancel button"); } } COM: <s> a button has been activated </s>
funcom_train/22564869
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String doRemoveFriend() { ThemeDisplay themeDisplay = PortletUtils.getThemeDisplay(); try { Group group = GroupLocalServiceUtil.getGroup(themeDisplay.getScopeGroupId()); User user = UserLocalServiceUtil.getUserById(group.getClassPK()); SocialRelationLocalServiceUtil.deleteRelation(themeDisplay.getUserId(), user.getUserId(), SocialRelationConstants.TYPE_BI_FRIEND); } catch (Exception e) { PortletUtils.handleError(LOG, e); } return null; } COM: <s> do remove friend </s>
funcom_train/19067135
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void aboutHelpMenuItemActionPerformed(ActionEvent e) { // TODO Auto-generated method stub String helpmessage = "Public Information\n"; helpmessage = helpmessage + "\n"; helpmessage = helpmessage + "SortImagesGUI by Falko Zurell\n"; helpmessage = helpmessage + "\n"; helpmessage = helpmessage + "Version: " + this.Version + "\n"; helpmessage = helpmessage + "License: GNU Public License\n"; helpmessage = helpmessage + "Homepage: http://sortimages.sourceforge.net\n"; JOptionPane.showConfirmDialog( this, helpmessage, "common help", JOptionPane.CLOSED_OPTION, JOptionPane.INFORMATION_MESSAGE); } COM: <s> this method displays public information about this application </s>
funcom_train/20035596
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setCenter(Widget widget) { center = widget; Layer layer = layout.attachChild(widget.getElement(), null, widget); LayoutData data = new LayoutData(Direction.CENTER, 0, layer); widget.setLayoutData(data); // Detach new child. widget.removeFromParent(); // Logical attach. getChildren().add(widget); // Adopt. adopt(widget); } COM: <s> sets the center widget </s>
funcom_train/3429007
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String toString() { int i; int max = size() - 1; StringBuffer buf = new StringBuffer(); Enumeration k = keys(); Enumeration e = elements(); buf.append("{"); for (i = 0; i <= max; i++) { String s1 = k.nextElement().toString(); String s2 = e.nextElement().toString(); buf.append(s1 + "=" + s2); if (i < max) buf.append(", "); } buf.append("}"); return buf.toString(); } COM: <s> returns a rather long string representation of this hashtable </s>
funcom_train/18938263
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected ExecutorResult catchOutput( Process process ) throws InterruptedException { /* create an instance of Executor result information class */ ExecutorResult result = new ExecutorResult(); OutputCatcher stdOutput = new OutputCatcher( process.getInputStream() ); OutputCatcher stdErr = new OutputCatcher( process.getErrorStream() ); result.setExitValue( process.waitFor() ); result.setStdout( stdOutput.getResult() ); result.setStderr( stdErr.getResult() ); return result; } COM: <s> creates and returns a instance of excecutor result that will contain the </s>
funcom_train/11042247
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setPayloadXML(Object payload) { SOAPBody body = mc.getEnvelope().getBody(); for (Iterator it = body.getChildren(); it.hasNext(); ) { it.next(); it.remove(); } body.addChild(convertor.fromScript(payload)); } COM: <s> set the soap body payload from xml </s>
funcom_train/9118328
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getTo(char delim) { StringBuffer line = new StringBuffer(); // load till end of stream or reach the delimiter boolean cut; while ( (cut = hasNext()) && (current != delim)) { line.append(current); advance(); } if (!cut) { return line.length() > 0 ? line.toString() : null; } return line.toString(); } COM: <s> return all chars in the stream till a delimiter </s>
funcom_train/1164558
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void searchAcync(Query query, WeiboListener listener) { getDispatcher().invokeLater(new AsyncTask(SEARCH, listener, new Object[]{query}) { public void invoke(WeiboListener listener, Object[] args) throws WeiboException { listener.searched(search((Query) args[0])); } }); } COM: <s> returns tweets that match a specified query </s>
funcom_train/9978139
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void compositeCleared() { boolean changed = !linkNameField.getText().equals(model.getLinkName()); if (changed) { if (MessageDialog.openQuestion(getShell(), "Link settings changed", "Currently edited link settings changed. Should we apply changes before clearing editor ?")) { actionPerformed(); } } } COM: <s> method called when root panel is about to be cleared </s>
funcom_train/34568004
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void shutDown() { if (listModule != null) { for (Module module: listModule) { try { shutdownModule(module); } catch (Throwable ex) { logger.error(new BaseException(ErrorCodes.CODE_100,ex.getMessage()),ex); module.setShutdown(true); } } } // shutdown rmi server try { RMIServer server = RMIServer.getInstance(); server.shutdown(); } catch (Exception ex) { logger.error(new BaseException(ErrorCodes.CODE_100,ex.getMessage()),ex); } ServerLogger.info("Shutdown completed. ",logger); } COM: <s> shutdown all module </s>
funcom_train/16357396
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean send(short appPort, ByteBuffer[] buffers, Action failAct) { synchronized (unackMsgs) { if (unackMsgs.size() > ConfValues.maxUdpConnQueueSize) return false; } UdpMsg msg = new UdpMsg(buffers, appPort, failAct, nextAck()); send(msg); l1.timer.schedule(new RetransTask(msg), getTimeout()); return true; } COM: <s> reliable message transmission </s>
funcom_train/44308787
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void relationsExtractionFinished(Throwable error,OIModelerViewable targetOIModelerViewable,OIModelerViewable hierarchyReuseOIModelerViewable,CorpusEditorViewable targetCorpusEditorViewable) { clearRelations(); relationsExtractionFinished(targetOIModelerViewable,hierarchyReuseOIModelerViewable,targetCorpusEditorViewable); m_module.getAppDriver().displayErrorNotification(error); } COM: <s> called when association relations process has finished with an error </s>
funcom_train/43235417
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int binary_search(int idx, char size, char key) { int left = 0, right, middle; ST_NODE node; right = (int) size - 1; while (left <= right) { middle = (left + right) / 2; node = this.nf[middle + idx].node; if (key > node.K) left = middle + 1; else if (key < node.K) right = middle - 1; else return (idx + middle); } return 0; } COM: <s> performs binary search </s>
funcom_train/25841157
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Session getSession(int i, Session repeatedSession) { Session tempSession = new Session(repeatedSession); //adds i times repeatInterval into Session.date //tempSession.setStartMillis(tempSession.getStartMillis() + repeatInterval * i); tempSession.setInterval(tempSession.getStartMillis() + repeatInterval * i, tempSession.getEndMillis() + repeatInterval * i); return tempSession; } COM: <s> returns the i th session of repeated session </s>
funcom_train/20774564
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void initializeProbabilityMatrix(double[] startProb, double[][] transitionProb, double[][] emissionProb){ if(startProb != null) setStartProbability(startProb); if(transitionProb != null) setTransitionProbability(transitionProb); if(emissionProb != null) setEmissionProbability(emissionProb); } COM: <s> initializes hmm with given probabilities </s>
funcom_train/19846530
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void considerDoubleClick(int button, int x, int y) { if (doubleClickTimeout == 0) { clickX = x; clickY = y; clickButton = button; doubleClickTimeout = System.currentTimeMillis() + doubleClickDelay; fireMouseClicked(button, x, y, 1); } else { if (clickButton == button) { if ((System.currentTimeMillis() < doubleClickTimeout)) { fireMouseClicked(button, x, y, 2); doubleClickTimeout = 0; } } } } COM: <s> notification that the mouse has been pressed and hence we should consider </s>
funcom_train/5574881
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Association createAssociation(Type type1, Type type2, String name) { Association association = createAssociation(type1, true, AggregationKind.NONE_LITERAL, "", 0, 1, type2, true, AggregationKind.NONE_LITERAL, "", 0, 1); association.setName(name); return association; } COM: <s> this method creates an association pendant to omega transition </s>
funcom_train/46378935
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected int findFirstAfter(List<PingData> data, long after) { int count = 0; synchronized (data) { for (PingData d : data) { if (d.getSampleDate() > after) { break; } count++; } } // check for not found if (count >= data.size()) { count = -1; } return count; } COM: <s> find the first data element after the given value </s>
funcom_train/37062904
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getWatt( SingleRunData srd, int offset ) { int actIndex = (int) Math.floor( (srd.getTime() + offset) / 60 ); if (actIndex < 0) { actIndex = 0; } if (actIndex >= wattData.length) { return -1; } return wattData[actIndex]; } COM: <s> returns the watt value of the program for the given single run data </s>
funcom_train/15922265
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean contains(Object o) { if (o instanceof Type) { Type type = (Type) o; Context context = ts.emptyContext(); for (Iterator<Type> i = v.iterator(); i.hasNext(); ) { Type t = (Type) i.next(); if (ts.isSubtype(type, t, context)) { return true; } } } return false; } COM: <s> check whether object code o code is in the set </s>
funcom_train/28403800
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Definition getDefinition(String name, Locale locale) { Definition definition = null; if (locale != null) { Map<String, Definition> localeSpecificMap = localeSpecificDefinitions.get(locale); if (localeSpecificMap != null) { definition = localeSpecificMap.get(name); } } if (definition == null) { definition = getDefinition(name); } return definition; } COM: <s> returns a definition object that matches the given name and locale </s>
funcom_train/40560377
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testInsertInvalidTable() { // create with null table. try { SQLInsert insert = new SQLInsert(conn, null); fail("Creating with nulls should have generated an " + "IllegalArgumentException"); } catch (IllegalArgumentException e) { assertTrue(true); } // create with null table. try { SQLInsert insert = new SQLInsert(conn, ""); fail("Creating with an empty table name should have generated an " + "IllegalArgumentException"); } catch (IllegalArgumentException e) { assertTrue(true); } } COM: <s> test creating a sqlinsert object with a null and empty table </s>
funcom_train/14016528
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected FlowExecutionKey getNextKey(FlowExecution execution) { if (alwaysGenerateNewNextKey) { CompositeFlowExecutionKey currentKey = (CompositeFlowExecutionKey) execution.getKey(); Integer currentSnapshotId = (Integer) currentKey.getSnapshotId(); return new CompositeFlowExecutionKey(currentKey.getExecutionId(), nextSnapshotId(currentSnapshotId)); } else { return execution.getKey(); } } COM: <s> gets the next key to assign to the flow execution </s>
funcom_train/12656241
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void loadInfo(AudioFileFormat aff) throws UnsupportedAudioFileException { type = aff.getType().toString(); AudioFormat format = aff.getFormat(); channels = format.getChannels(); samplerate = format.getSampleRate(); bitspersample = format.getSampleSizeInBits(); framesize = format.getFrameSize(); bitrate = Math.round(bitspersample * samplerate * channels / 1000); } COM: <s> load info from audio file format </s>
funcom_train/50956362
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void registerTags(ExtensibleSVGDOMImplementation di) { di.registerCustomElementFactory (CustomTagsConstants.MULTIMEDIA_EXT_NAMESPACE_URI , CustomTagsConstants.SVG_VIDEO_TAG, new CustomSVGVideoElementFactory()); di.registerCustomElementFactory (CustomTagsConstants.MULTIMEDIA_EXT_NAMESPACE_URI , CustomTagsConstants.SVG_AUDIO_TAG, new CustomSVGAudioElementFactory()); } COM: <s> this method should update the dom context with support </s>
funcom_train/22665083
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JList getLstRooms() { if (lstRooms == null) { lstRooms = new JList(); lstRooms.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); lstRooms.setBorder(BorderFactory.createLineBorder(Color.gray, 1)); lstRooms.setForeground(new Color(51, 51, 51)); lstRooms.setModel(mdlRooms); } return lstRooms; } COM: <s> this method initializes lst rooms </s>
funcom_train/4125874
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public UnitType getUnitTypeChange(ChangeType changeType, Player player) { for (UnitTypeChange change : typeChanges) { if (change.asResultOf(changeType) && change.appliesTo(player)) { UnitType result = change.getNewUnitType(); if (result.isAvailableTo(player)) { return result; } } } return null; } COM: <s> describe code get unit type change code method here </s>
funcom_train/17434496
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void InteractionStateAfterAction() { Widget w = new Widget(); w.setId("w"); manager.registerInteractionState(w, "state"); String result = manager.getLinkToPageSet("pageSetId", "linkObject", Arrays.asList(new String[] { }), "w", "delete"); assertEquals( "<a href=\"pageSetId?_ac=w&amp;_aa=delete&amp;w=state\">linkObject</a>", result); } COM: <s> create a link with an action and an interaction state </s>
funcom_train/35473302
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void notify_observers(String key) { if (this.subscriptions.containsKey(key)) { ArrayList observers = (ArrayList) this.subscriptions.get(key); for (int i=0; i<observers.size(); i++) ((PreferencesObserver) observers.get(i)).preference_changed(key); } } COM: <s> notifies all preferences observers which have subscribed to the </s>
funcom_train/4853104
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void stop () { if (state == CrawlEvent.STARTED || state == CrawlEvent.PAUSED) { synchronized (crawlQueue) { synchronized (fetchQueue) { state = CrawlEvent.STOPPED; fetchQueue.clear (); crawlQueue.clear (); numPagesLeft = 0; crawlQueue.notify (); } } sendCrawlEvent (state); } } COM: <s> stop the crawl in progress </s>
funcom_train/50335485
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean isOutputTurnoutIncluded(String turnoutName) { Turnout t1 = InstanceManager.turnoutManagerInstance().provideTurnout(turnoutName); for (int i=0; i<_outputTurnoutList.size(); i++) { if ( _outputTurnoutList.get(i).getTurnout() == t1 ) { // Found turnout return true; } } return false; } COM: <s> method to inquire if a turnout is included in this route </s>
funcom_train/2492689
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getErrorString() { StringBuffer sb = new StringBuffer(); for (Iterator it = errorInfo.keySet().iterator() ; it.hasNext() ; ) { Integer pos = (Integer) it.next(); Character c = (Character) errorInfo.get(pos); sb.append(c); sb.append(" ("); sb.append(pos); sb.append(")"); if (it.hasNext()) { sb.append(", "); } } return sb.toString(); } COM: <s> gets a string to present to user with information about invalid characters </s>
funcom_train/6439689
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void propertyChange(PropertyChangeEvent evt) { if (CMPrjSetting.TASK_LIST.equals(evt.getPropertyName())) { // DEBUG Logging.println("TSI: propertyChange: " + evt.getPropertyName()); processChanges(); } else if (evt.getNewValue() instanceof Locale) { setLocalizedStrings((Locale) evt.getNewValue()); } } COM: <s> react on property change updated task list or changed locale </s>
funcom_train/10656810
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testRemoveBack() throws BadLocationException { // Shift the gap so that it's in the middle obj.remove(8, 2); // Test obj.remove(0, 8); assertEquals("test string.", obj.getString(0, obj.length() - 1)); } COM: <s> removes a portion of content in the middle </s>
funcom_train/43865899
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void sendMessage(Object msg) { try { out.writeObject(msg); out.flush(); print("client>" + msg.toString()); } catch (IOException ioex) { Logger.getLogger(Server.class.getName()).log(Level.SEVERE, null, ioex); } } COM: <s> send the message </s>
funcom_train/45286417
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Result compile(String[] args) { Context context = new Context(); JavacFileManager.preRegister(context); // can't create it until Log has been set up Result result = compile(args, context); if (fileManager instanceof JavacFileManager) { // A fresh context was created above, so jfm must be a JavacFileManager ((JavacFileManager)fileManager).close(); } return result; } COM: <s> programmatic interface for main function </s>
funcom_train/35848964
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testGetPath() throws MalformedURLException { String path = "/org/argouml/language/x/profile/name.xmi"; ProfileReference profileReference = new ProfileReference( path, new URL("http://x.org/name.xmi")); assertEquals(path, profileReference.getPath()); } COM: <s> checks that the path handed to the constructor is correctly returned by </s>
funcom_train/45808042
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addRole(AssociationRoleIF assoc_role) { // Add association role to list of association roles if (roles.size() > 100 && roles instanceof CompactHashSet) { Set<AssociationRoleIF> new_roles = new edu.emory.mathcs.backport.java.util.TreeSet(rolecomp); new_roles.addAll(roles); roles = new_roles; } roles.add(assoc_role); } COM: <s> internal adds the association role to the set of association </s>
funcom_train/4855047
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setDataSource(DataSource dataSource) { if (dataSource instanceof TransactionAwareDataSourceProxy) { // If we got a TransactionAwareDataSourceProxy, we need to perform transactions // for its underlying target DataSource, else data access code won't see // properly exposed transactions (i.e. transactions for the target DataSource). this.dataSource = ((TransactionAwareDataSourceProxy) dataSource).getTargetDataSource(); } else { this.dataSource = dataSource; } } COM: <s> set the jdbc data source that this instance should manage transactions for </s>
funcom_train/4920856
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testGetResource() throws Exception { final String location = "LOCATION"; final InputStream resource = new ByteArrayInputStream(new byte[0]); // Record obtaining the resource this.recordReturn(this.resourceSource, this.resourceSource.sourceResource(location), resource); // Obtain the configuration item this.loadOfficeType(true, new Loader() { @Override public void sourceOffice(OfficeArchitect office, OfficeSourceContext context) throws Exception { assertSame("Incorrect resource", resource, context.getResource(location)); } }); } COM: <s> ensure able to obtain a resource </s>
funcom_train/13993427
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testBorders01() throws Exception { assertDefaultBorder(MockValueObjectSource.PROPERTY_A); assertDefaultBorder(MockValueObjectSource.PROPERTY_B); setErrorValue(); awtSleep(); assertErrorBorder(MockValueObjectSource.PROPERTY_A); assertDefaultBorder(MockValueObjectSource.PROPERTY_B); view.load(); awtSleep(); assertDefaultBorder(MockValueObjectSource.PROPERTY_A); assertDefaultBorder(MockValueObjectSource.PROPERTY_B); } COM: <s> tests that the exception borders and the validation messages are </s>
funcom_train/19380456
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void updateRomeo(String xmamePath) { // Retrieve the xmame version and show it in the status bar updateStatusField(xmamePath); // Enable the selection tree enableTree(); tree.setSelectionPath(null); // Check if catver.ini exists checkCatver(); // Highlight all games node highlightAllGamesNode(); // Update digital sound and mixer plugins supported by the // selected xmame setXmameSoundPlugins(xmamePath); } COM: <s> this method updates some components if the list of games has been loaded </s>
funcom_train/43423316
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getRepositoryServices() { StringBuffer sb = new StringBuffer(); for (String repositoryService: repositoryServices.keySet()) { if (sb.length() > 0) { sb.append(","); } sb.append(repositoryService); } return sb.toString(); } COM: <s> returns the list of repository services registered with the session </s>
funcom_train/27747240
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getText () { checkWidget(); /* * The GTK documentation explicitly states * that this address should not be freed. */ int address = OS.gtk_entry_get_text (entryHandle); int length = OS.strlen (address); byte [] buffer1 = new byte [length]; OS.memmove (buffer1, address, length); char [] buffer2 = Converter.mbcsToWcs (null, buffer1); return new String (buffer2, 0, buffer2.length); } COM: <s> returns a string containing a copy of the contents of the </s>
funcom_train/18900253
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testBackupApi1() throws Exception { // log that we're executing the test log.debug("Starting backup API test 1"); File file = new File(tmpDirectory, "backup1.rdf"); file.delete(); URI modelURI = new URI(testModel); // execute the backup remotely interpreter.backup(modelURI, file); this.assertTrue("Expected a backup file", file.exists()); } COM: <s> test the interpreter using a backup api remotely </s>
funcom_train/34587425
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void syncEnd(SyncSourceEvent event) { if (Logger.isLoggable(Logger.DEBUG)) { Logger.debug("SyncSourceEvent - Sync end - date: " + event.getDate () + " - sourceUri: " + event.getSourceUri () + " - sync mode: " + event.getSyncMode () ); } } COM: <s> notify a sync source end synchronization </s>
funcom_train/20874574
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int nrConflicts(Enrollment e1) { if (!e1.isCourseRequest()) return 0; int cnt = 0; for (Section s1 : e1.getSections()) { for (Section s2 : e1.getSections()) { if (s1.getId() < s2.getId() && inConflict(s1, s2)) cnt ++; } } return cnt; } COM: <s> return number of distance conflict of a course enrollment </s>
funcom_train/36077678
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void createContextMenu() { MenuManager menuManager = new MenuManager(); Menu menu = menuManager.createContextMenu(treeViewer.getTree()); // Set the MenuManager treeViewer.getTree().setMenu(menu); getSite().registerContextMenu(menuManager, treeViewer); // Make the selection available getSite().setSelectionProvider(treeViewer); } COM: <s> create the context menu </s>
funcom_train/9769228
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addConnection( RFBConnection connection ) throws RFBException { for( int i = 0; i<connections.length; i++ ) { if( connections[i] == null ) { connections[i] = connection; connection.addKeyListener(defaultKeyListener); connection.addMouseListener(defaultMouseListener); connection.addMediaEventListener(defaultMediaEventListener); return; } } throw new RFBException("Maximum number of users reached."); } COM: <s> add a connection to this framebuffer </s>
funcom_train/812724
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Edge newDummyEdge(Node targetNode, Node sourceNode) { boolean addedEdge; DummyEdgePart edgePart = new DummyEdgePart(); Edge edge = new Edge(edgePart, sourceNode, targetNode); edge.weight = 2; edgeList.add(edge); targetNode = sourceNode; addedEdge = true; return edge; } COM: <s> creates a new dummy edge to be used in the graph </s>
funcom_train/10787954
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected EntityManager begin() { try { lock.lock(); EntityManager em = getEntityManager(); if (isManaged) { em.joinTransaction(); } else { if (!em.getTransaction().isActive()) { em.getTransaction().begin(); } } return em; } finally { lock.unlock(); } } COM: <s> begins a transaction on the current thread </s>
funcom_train/32206116
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected boolean reloadPlugin ( String pluginName ) { boolean reloaded = false; // Try to unload the plugin if ( unloadPlugin( pluginName ) ) { // The plugin was unloaded successfully // Try to load the plugin if ( loadPlugin( pluginName ) ) { // The plugin was loaded successfully reloaded = true; } else { // Unable to load the plugin back } } else { // The plugin didn't unload or doesn't exists } return reloaded; } COM: <s> reloads a specified plugin </s>
funcom_train/50152820
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JButton selectAllButton() { if (selectAllButton == null) { selectAllButton = new JButton(); ResourceHelper.setText(selectAllButton, "select_all"); selectAllButton .addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent e) { Iterator<JCheckBox> it = cbs.iterator(); while (it.hasNext()) { // select all check boxes JCheckBox cb = it.next(); cb.setSelected(true); } } }); } return selectAllButton; } COM: <s> this method initializes select all button </s>
funcom_train/36426433
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected E get(final int index) { if (index >= this.capacity || index < 0) { throw new IndexOutOfBoundsException("Index: " + index + ", Capacity: " + this.capacity); } E result = this.elements[index]; if (result == null) { throw new NoSuchElementException(); } return result; } COM: <s> protected so the inner class has access </s>
funcom_train/4521151
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void delete(ListaCandidatosPostulante entity) { LogUtil.log("deleting ListaCandidatosPostulante instance", Level.INFO, null); try { entity = entityManager.getReference( ListaCandidatosPostulante.class, entity.getId()); entityManager.remove(entity); LogUtil.log("delete successful", Level.INFO, null); } catch (RuntimeException re) { LogUtil.log("delete failed", Level.SEVERE, re); throw re; } } COM: <s> delete a persistent lista candidatos postulante entity </s>
funcom_train/28749627
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setDatecompleted(java.util.Date newVal) { if ((newVal != null && this.datecompleted != null && (newVal.compareTo(this.datecompleted) == 0)) || (newVal == null && this.datecompleted == null && datecompleted_is_initialized)) { return; } this.datecompleted = newVal; datecompleted_is_modified = true; datecompleted_is_initialized = true; } COM: <s> setter method for datecompleted </s>
funcom_train/35748749
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Shape transform(Transform transform) { checkPoints(); Polygon resultPolygon = new Polygon(); float result[] = new float[points.length]; transform.transform(points, 0, result, 0, points.length / 2); resultPolygon.points = result; resultPolygon.findCenter(); resultPolygon.checkPoints(); return resultPolygon; } COM: <s> apply a transformation and return a new shape </s>
funcom_train/31078029
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public BeanDescriptor getBeanDescriptor() { BeanDescriptor bd = createBeanDescriptor(beanClass, new Object[] { "preferred", Boolean.TRUE, "isContainer", Boolean.FALSE, "shortDescription", "A shape3d component." }); //bd.setValue("hidden-state", Boolean.TRUE); bd.setValue("helpSetName", "net/jbeans/j3d/scenegraph/resources/Shape3D/jhelpset.hs"); return bd; } COM: <s> returns a bean descriptor for shape3 d bean </s>
funcom_train/41720754
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean sharesSideWith(Tile tile) { if (tile == null) return false; if (this.equals(tile)) return false; int diffX, diffY; diffX = (int) Math.abs(this.getX() - tile.getX()); diffY = (int) Math.abs(this.getY() - tile.getY()); if ((diffX == 0 && diffY == 1) || (diffX == 1 && diffY == 0)) return true; else return false; } COM: <s> returns true if tiles share a side false if both tiles are </s>
funcom_train/35048506
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void _initializeIR() throws JFTSFrameworkException { String indexPath = null; try { indexPath = config.getIndexerConfig().getIndexPath(); Directory dir = FSDirectory.getDirectory(indexPath); ir = IndexReader.open(dir); } catch (JFTSConfigException e) { throw new JFTSFrameworkException(e.getMessage()); } catch (IOException e) { throw new JFTSFrameworkException(e.getMessage()); } } COM: <s> initialize the index reader </s>
funcom_train/49790866
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testParentDiagramLabelIcon() throws Exception { Document gmfgraph = getGmfgraph(); for (String parent : getParentNameElements()) { // make sure the element is there Element label = xpathFirst(gmfgraph, "Canvas/labels[@name='" + parent + "ParentNameFigure']"); // element icon should be false assertEquals(label.getAttribute("elementIcon"), "false"); } } COM: <s> root diagram label nodes for parent names should have </s>
funcom_train/21847651
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int extendEnd(int endPos) throws BadLocationException { try { int markPos = endMark.getOffset(); endPos = Math.max(endPos, markPos); if (endPos != markPos) { doc.op.moveMark(endMark, endPos); } return endPos; } catch (InvalidMarkException e) { if (Boolean.getBoolean("netbeans.debug.exceptions")) { // NOI18N e.printStackTrace(); } return 0; } } COM: <s> possibly move end mark if its position is above the given number </s>
funcom_train/36984931
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: static public File getTempFolder() { try { File ignored = File.createTempFile("ignored", null); String tempPath = ignored.getParent(); ignored.delete(); return new File(tempPath); } catch (Exception e) { e.printStackTrace(); } return null; // TODO could we *really* ever reach this? } COM: <s> get the path to the platforms temporary folder by creating </s>
funcom_train/21116887
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testIsBosMu() { System.out.println("isBosMu"); Zaman instance = new Zaman(); boolean expResult = true; boolean result = instance.isBosMu(); 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 is bos mu method of class persistence </s>
funcom_train/46104446
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean addEdge(E edge, V source, V target, EdgeType edgeType) { CyNode s = nm.get(source); CyNode t = nm.get(target); CyEdge e = net.addEdge(s, t, (edgeType == EdgeType.DIRECTED)); em.put(edge, e); return true; } COM: <s> convenience method for multigraphs </s>
funcom_train/44304406
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public SchemaValue modifyInternationalSchemaValue(String internationalValue) throws MelbaException { // used by T_Modifier if (isPredefinedValue()) throw MelbaException.fromBug(this, "Method disabled, please check (isPredefinedValue() == false) before"); if (this.internationalValue.equals(internationalValue)) return this; return new SchemaValue(col, internationalValue, label); } COM: <s> create a new code schema value code with a new displayable value </s>
funcom_train/4396962
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String parseCommand( String inputString ) { int index = inputString.indexOf( " " ); if( index == -1 ) { String command = inputString.toUpperCase(); checkQuit( command ); return command; } else { String command = inputString.substring( 0, index ).toUpperCase(); checkQuit( command ); return command; } } COM: <s> parses the input stream for the command </s>
funcom_train/11404975
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected boolean isXmlBean(Class type) { boolean result = false; Class[] interfaces = {type}; if (!type.isInterface()) { interfaces = type.getInterfaces(); } for (Class i : interfaces) { Class[] superInterfaces = i.getInterfaces(); for (Class superI : superInterfaces) { if (superI.getName().equals("org.apache.xmlbeans.XmlObject")) { result = true; } } } return result; } COM: <s> check if a code class code is a valid xmlbeans data object </s>
funcom_train/23056878
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public JMenu createMenu(MenuType menu) { if ( logger.isDebugEnabled() ) { logger.debug("entering createMenu(MenuType)"); } JMenu jmenu = this.createMenu(menu, this.getDefaultMenuBarCustomizer()); if ( logger.isDebugEnabled() ) { logger.debug("exiting createMenu(MenuType)"); } return jmenu; } COM: <s> return a jmenu according to a given xml menu </s>
funcom_train/26067328
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setMiniMap(final OSMMapView aOsmvMinimap, final int aZoomDiff) { this.mMiniMapZoomDiff = aZoomDiff; this.mMiniMap = aOsmvMinimap; aOsmvMinimap.setMaxiMap(this); // Synchronize the Views. this.setMapCenter(this.mLatitudeE6, this.mLongitudeE6); this.setZoomLevel(this.getZoomLevel()); } COM: <s> this map view takes control of the </s>
funcom_train/23245051
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected String explainMisMatchTextual(Shadow shadow) { String pattern = patternAsString(); String part = getJoinPointPartName(); String joinpoint = getJoinPointName(shadow); String joinPointPartValue = getJoinPointPartValue(shadow); //[pattern] doesn't match the [part] of this [joinpoint] String txt = formatAndUpdateExplainMessage(ExplainMessage.MSG0, part, joinPointPartValue, pattern); return txt; } COM: <s> here we specify the first level of the explanation </s>
funcom_train/20646371
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: // private JPanel getInfoPanel(Tarification t,Component body) { // JPanel jp = new JPanel(new BorderLayout()); // // add the information // JLabel jb = new JLabel(t.getTitle()); // jb.setIcon(t.getHeader().getIcon()); // // // jp.add(jb,BorderLayout.NORTH); // jp.add(body,BorderLayout.CENTER); // return jp; // } COM: <s> create the left and right jpanels </s>
funcom_train/50326961
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected int intSpeed(float fSpeed) { if (fSpeed == 0.f) return 0; else if (fSpeed < 0.f) return 1; // estop // add the 0.5 to handle float to int round for positive numbers return (int)(fSpeed * 126.f + 0.5) + 1 ; } COM: <s> convert a float speed value to a loco net speed integer </s>
funcom_train/14083207
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String fixMux_Case() { String saux = ""; String saux2 = VerilogCode.mux_if.replace(SIZE, String.valueOf(pn.getSize() - 1));; int c, rc; for (c = pn.getSize() - 2, rc = 1; c >= 0; c--, rc++) { saux = VerilogCode.mux_else.replace(RCOUNT, String.valueOf(rc)); saux = saux.replaceAll(COUNT, String.valueOf(c)); saux2 += saux; } return saux2; } COM: <s> fix the verilog if then else stuff on the multiplexer </s>
funcom_train/9388988
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Validator getValidator() throws SAXException { InputStream xsdStream = SdkRepository.getXsdStream(); SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); if (factory == null) { return null; } // This may throw a SAX Exception if the schema itself is not a valid XSD Schema schema = factory.newSchema(new StreamSource(xsdStream)); Validator validator = schema == null ? null : schema.newValidator(); return validator; } COM: <s> helper method that returns a validator for our xsd </s>
funcom_train/25476008
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getPrintout () { StringBuffer sb = new StringBuffer(); sb.append("Position: "); sb.append(position); sb.append(" sample size: "); sb.append(sampleSize); if (highGap) { sb.append(" HG"); } if (lowSupport) { sb.append(" LS"); } sb.append("\nSAMPLE DIVERSITY\n"); sb.append(sampleDiversity.getPrintout()); sb.append("\nSYMBOL DIVERSITY\n"); sb.append(symbolDiversity.getPrintout()); return sb.toString(); } COM: <s> printable representation mostly for test output and debug </s>
funcom_train/21483103
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public CacheManagerEventListener createCacheManagerEventListener(Properties properties) { String type = PropertyUtil.extractAndLogProperty("type", properties); if (type.equals("null") || type.equals("null")) { return null; } else if (type.equals("counting")) { return new CountingCacheManagerEventListener(); } else { return null; } } COM: <s> create a code cache event listener code </s>
funcom_train/3416586
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int read(char cbuf[], int off, int len) throws IOException { synchronized (lock) { int n = super.read(cbuf, off, len); for (int i = off; i < off + n; i++) { int c = cbuf[i]; if (skipLF) { skipLF = false; if (c == '\n') continue; } switch (c) { case '\r': skipLF = true; case '\n': /* Fall through */ lineNumber++; break; } } return n; } } COM: <s> read characters into a portion of an array </s>
funcom_train/20785389
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected JComponent createControl() { // In this view, we're just going to use standard Swing to place a // few controls. JLabel lblMessage = getComponentFactory().createLabel("initialView.message"); lblMessage.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0)); JPanel panel = getComponentFactory().createPanel(new BorderLayout()); panel.add(lblMessage); return panel; } COM: <s> create the actual ui control for this view </s>
funcom_train/3367853
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void repaintTab(int index) { // If we're not valid that means we will shortly be validated and // painted, which means we don't have to do anything here. if (!isRunsDirty && index >= 0 && index < tabPane.getTabCount()) { tabPane.repaint(getTabBounds(tabPane, index)); } } COM: <s> repaints the specified tab </s>
funcom_train/10858120
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testNormalization() throws Exception { Reader reader = new StringReader("های"); Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false); PersianNormalizationFilterFactory factory = new PersianNormalizationFilterFactory(); TokenStream stream = factory.create(tokenizer); assertTokenStreamContents(stream, new String[] { "هاي" }); } COM: <s> ensure the filter actually normalizes persian text </s>
funcom_train/20802523
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void scrollToSelection() { if (getSelectedRow() != -1) { Rectangle rect = getVisibleRect(); Rectangle cRect = getCellRect(getSelectedRow(), 0, true); rect.y = cRect.y; rect.height = cRect.height; scrollRectToVisible(rect); } } COM: <s> sets the scroll to the selection </s>
funcom_train/33931910
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setFullScreen(DisplayMode displayMode, JFrame window) { window.setUndecorated(true); window.setResizable(false); device.setFullScreenWindow(window); if (displayMode != null && device.isDisplayChangeSupported()) { try { device.setDisplayMode(displayMode); } catch (IllegalArgumentException ex) { ex.printStackTrace(); // ignore - illegal mode for this device } } } COM: <s> enters full screen mode and changes the display mode </s>
funcom_train/22433047
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private boolean checkParents(boolean exclusive) { if (_path.equals("/")) { return true; } else { if (_owner == null) { // no owner, checking parents return _parent != null && _parent.checkParents(exclusive); } else { // there already is a owner return !(_exclusive || exclusive) && _parent.checkParents(exclusive); } } } COM: <s> helper of check locks </s>
funcom_train/26531605
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String parseFixTime(String value) { if (!hasValue(value)) return null; try { double time = numberFmt.parse(value).doubleValue(); if (HOURS.equals(fixTimeUnits)) time *= 60; return numberFmt.format(time); } catch (Exception e) { } return null; } COM: <s> interpret a string as a fix time apply the users choice of time </s>
funcom_train/38965150
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void run() { model.getLog().debug("Thread started"); int timeGone = 1; while(model.isRunning()) { try { if(timeGone > model.getSettings().getTimeInterval() + 1) { model.recalculate(); timeGone = 0; } else { sleep(1000); } model.setTimeLeft(model.getSettings().getTimeInterval()-timeGone); timeGone++; } catch(InterruptedException e) { model.getLog().warn(this, e); } } } COM: <s> triggers the recalculation of the prices in the given interval </s>
funcom_train/42382211
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testExtraction() throws Exception { try { String[] valid = getValidTestData(); for (int i = 0; i < valid.length; i += 2) { testOne(valid[i], valid[i + 1]); } } catch (Exception e) { e.printStackTrace(); // I hate maven. throw e; } } COM: <s> tests each text uri pair in the test data array </s>
funcom_train/37247272
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private TextCommand toCommand( String text ){ List<String> tokens = new ArrayList<String>(); text = text.trim(); StringTokenizer st = new StringTokenizer( text, " ", false ); String token; for(int i = 0; st.hasMoreTokens(); ){ token = st.nextToken().trim(); if( token.length() > 0 ){ //Ho trovato una parola if( i == 0 ) //Ho trovato la prima parola token = token.toLowerCase(); tokens.add( token ); ++i; } } return new TextCommand( tokens ); } COM: <s> traduce un comando testuale in text command </s>
funcom_train/46743450
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setParentId(Long parentId) { if (!(this.parentId.longValue() == parentId.longValue())) { Long oldparentId= 0L; oldparentId = this.parentId.longValue(); this.parentId = parentId.longValue(); setModified("parentId"); firePropertyChange(String.valueOf(APPLICATIONCONTROLLOGS_PARENTID), oldparentId, parentId); } } COM: <s> application control id of parent component e </s>
funcom_train/7901513
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void sortRows(List rows) throws Exception { if (rows == null || rows.size() == 0) { return; } /* * find a getter method - this is just a speed up, * under certain circumstances it will be necessary to find another one * while sorting. * @see #compare() */ Class clazz = rows.get(0).getClass(); try { sortByGetter = clazz.getMethod(getterName); } catch (Exception e) { sortByGetter = null; } Collections.sort(rows, this); } COM: <s> sorts the specified list </s>
funcom_train/35731507
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void update() { LineBreakpointTemplate template = (LineBreakpointTemplate) Viewers.getSingleSelectedObject( viewer.getSelection(), LineBreakpointTemplate.class); viewAction.setEnabled(template != null); deleteAction.setEnabled(template != null && template.isPersistable()); if (template != null) { viewAction.setText((template.isReadOnly()) ? ACTION_VIEW_TEXT : ACTION_EDIT_TEXT); } else { viewAction.setText(ACTION_VIEW_TEXT); } } COM: <s> updates the status of the actions to that of the viewer </s>