__key__
stringlengths
16
21
__url__
stringclasses
1 value
txt
stringlengths
183
1.2k
funcom_train/39788969
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean postMessage(String userName, String authToken, String remoteHost, String messageContent) { if (userManager.authenticate(userName, authToken)) { messageStore.post(userName, messageContent); Log.log(Log.ACTION_POST, remoteHost, userName, messageContent); return true; } else { return false; } } COM: <s> posts a message </s>
funcom_train/31902456
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void eMenu(String label, CharacterSetID charset) { rbMenuItem = new MozillaRadioButtonMenuItem(label); rbMenuItem.addActionListener(encodingListener); encodingGroup.add(rbMenuItem); encodingMenu.add(rbMenuItem); encodingMap.put(StringResources.getString(label), charset); } COM: <s> a handy function to lessen the amount of code to create all </s>
funcom_train/25828720
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void unsetCoreAgentController() { if(AgentSubject.this.coreAgentController != null) { AgentSubject.this.coreAgentController = null; AgentSubject.this.simulator.setAgentIsControlled(false); AgentControlBroker.getInstance().registerAgentControlInitializer( agentControlInitializer); AgentSubject.this.reactionRules.removeAll(this.agentControlInitializer. getAgentControlRules()); } } COM: <s> removes the subjects core agent controller </s>
funcom_train/32097396
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void close() { /* close */ if(reportFile!=null) { /* flush and kill the output channel */ cvt.fio.writeStringToFile(reportFile, textReport); } /* just exit */ this.setVisible(false); this.showStatusFlag= false; this.dispose(); closeGuiFlag= true; } /* close */ COM: <s> close close this popup and reset flags if needed </s>
funcom_train/26350382
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Packet createEntityPacket(int entityId, Vector<UnitLocation> movePath) { final Entity entity = game.getEntity(entityId); final Object[] data = new Object[3]; data[0] = new Integer(entityId); data[1] = entity; data[2] = movePath; return new Packet(Packet.COMMAND_ENTITY_UPDATE, data); } COM: <s> creates a packet containing a single entity for update </s>
funcom_train/46428047
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void inputTask(Task task) { if (task != null) { if (task.aboveThreshold()) { // set a threshold? report(task.getSentence(), true); // report input newTasks.add(task); // wait to be processed in the next cycle } } } COM: <s> input task from some source </s>
funcom_train/21154140
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public long getMask(String aName){ String [] _pair = aName.split(":"); if(_pair.length!=2) throw new UnknownLayoutElement("Malformed expression ["+aName+"]"); return getContext(_pair[0])|getState(_pair[1]); } COM: <s> gets bit mask of element and result pair </s>
funcom_train/6282727
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean accept(File pathname) { // if( pathname.isDirectory() ) // System.err.println("Accepting "+pathname); if(pathname.isHidden() && !target.isShowHidden()) return false; if(pathname.isDirectory()) return true; else { String fileName = pathname.getName().toLowerCase(); if(fileName.endsWith(".zip")) { return true; } else if(fileName.endsWith("gz")) { return true; } else { return false; } } } COM: <s> tests whether or not the specified abstract pathname should be </s>
funcom_train/27823014
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void applyChanges(Collection statementInfoList) throws RemoteException,CreateException,RemoveException,FinderException { Iterator iterator=statementInfoList.iterator(); while (iterator.hasNext()) { StatementInfo statementInfo=(StatementInfo)iterator.next(); switch (statementInfo.getStatementAction()) { case 1: add(statementInfo); break; case 2: remove(statementInfo); break; } } } COM: <s> applies the list of changes to the model </s>
funcom_train/17700362
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void saveChanges() { try { Connection conn = getConnection(); try { rs.acceptChanges(conn); } finally { conn.close(); } } catch (SQLException e) { JOptionPane.showMessageDialog(this, e); } catch (IOException e) { JOptionPane.showMessageDialog(this, e); } } COM: <s> saves all changes </s>
funcom_train/36951588
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private boolean hasProjectNature(IRubyElement element, String ntype) { try { if(element != null) { IResource resource = element.getResource(); if(resource != null) { IProject proj = resource.getProject(); return proj.isAccessible() && proj.hasNature(ntype); } } return false; } catch (CoreException e) {return false;} } COM: <s> determines if the project selected has the specified nature </s>
funcom_train/40222704
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void setMoves(ks.common.model.MutableInteger miMoves) { if (miMoves == null) { throw new IllegalArgumentException ("Spider::setMoves() received null parameter."); } // add to our model as a moves object miMoves.setName("moves"); if (model.addElement (miMoves) == false) { // we already have moves, so transfer value. This will generate a stateChange event. moves.setValue(miMoves.getValue()); } else { moves = miMoves; } } COM: <s> used by spider exclusively to set up moves for the game </s>
funcom_train/29532665
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void marshalArray(OutputStream os) throws StoreException { try { SecureArray collectionEl = new SecureArray( (SecureArrayType)this.collection); SecureCollectionManager.jaxbContext .createMarshaller().marshal(collectionEl, os); } catch (JAXBException e) { throw new StoreException( "Unable to marshal secure collection: " + e.toString()); } } COM: <s> marshal array to the output stream </s>
funcom_train/44822454
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void updateUI() { ComboBoxUI cui = (ComboBoxUI) UIManager.getUI(this); if (cui instanceof MetalComboBoxUI) { cui = new MetalDateComboBoxUI(); } else if (cui instanceof MotifComboBoxUI) { cui = new MotifDateComboBoxUI(); } else if (cui instanceof WindowsComboBoxUI) { cui = new WindowsDateComboBoxUI(); } setUI(cui); } COM: <s> update the ui to a different window style </s>
funcom_train/24002453
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void println(long x,final AsyncCallback<Boolean> callback) { synchronized (lock) { print(x,new AsyncCallback<Boolean>() { public void onSuccess(Boolean b) { println(callback); } public void onFailure(Throwable t) { callback.onFailure(t); } }); } } COM: <s> prints a long integer and then terminates the line </s>
funcom_train/51207941
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void commandAction(Command cmd, Displayable arg1) { Dazio.startCountdown(); String text = cmd.getLabel(); if (text.equals(RS.OK)) { Dazio.dm.setPassword(getString()); } DazioView.displ = new ListView(); Dazio.d.setCurrent(DazioView.displ); } COM: <s> generic command handler </s>
funcom_train/375146
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testJHeaderIsFragmented() { JPacket packet = TestUtils.getPcapPacket(TestUtils.REASEMBLY, 1 - 1); Ethernet eth = new Ethernet(); if (packet.hasHeader(eth)) { assertFalse(eth.isFragmented()); } Ip4 ip = new Ip4(); if (packet.hasHeader(ip)) { assertTrue(ip.isFragmented()); } Icmp icmp = new Icmp(); if (packet.hasHeader(icmp)) { assertTrue(ip.isFragmented()); } } COM: <s> test j header is fragmented </s>
funcom_train/37822148
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void derive() { if (current.next == null) { Set<Entry<State,Action>> entries = current.successors.get(current.current).getKey(). computeSuccessors().entrySet(); if (!entries.isEmpty()) { Level tail = new Level(); tail.next = null; tail.prev = current; tail.current = 0; tail.successors = new LinkedList<Entry<State,Action>>(entries); current.next = tail; notifyAll(NotifyStepAvail.getInstance()); } } } COM: <s> if not already done reduce the current state </s>
funcom_train/22401293
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void delete() { owner.remove(this); start.removeEdge(this); end.removeEdge(this); if(view != null) { view.delete(); view = null; } if(layout != null) { layout.delete(); layout = null; } recalculateMultiEdgeOffsets(); } COM: <s> delete all references to this edge </s>
funcom_train/12155777
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getListOfPatientExamsSize() { logger.debug("Entering getListOfPatientExamsSize()."); int listOfPatientSize = listOfPatientExams != null ? listOfPatientExams.size() : 0; if (logger.isDebugEnabled()) { logger.debug("Exiting getListOfPatientExamsSize(); RV = [" + listOfPatientSize + "]."); } return listOfPatientSize; } COM: <s> gets the number of patient exams for that patient </s>
funcom_train/12797899
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void componentResized(ComponentEvent event) { Component component = (Component) event.getSource(); Dimension newSize = component.getSize(); if (newSize.height < aMinimumSize.height) { newSize.height = aMinimumSize.height; } if (newSize.width < aMinimumSize.width) { newSize.width = aMinimumSize.width; } component.setSize(newSize); } COM: <s> invoked when the components size changes </s>
funcom_train/7979699
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void processingCleanup() { this.httpRecorder = null; this.fetchStatus = S_UNATTEMPTED; this.setPrerequisite(false); this.contentSize = UNCALCULATED; this.contentLength = UNCALCULATED; // Clear 'links extracted' flag. this.linkExtractorFinished = false; // Clean the alist of all but registered permanent members. setAList(getPersistentAList()); } COM: <s> clean up after a run through the processing chain </s>
funcom_train/51056275
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public PixelFormat withMaxSwapInterval(final int maxSwapInterval) { if ( maxSwapInterval < getAttrib(MIN_SWAP_INTERVAL) ) throw new IllegalArgumentException("Invalid EGL_MAX_SWAP_INTERVAL specified: " + maxSwapInterval); final PixelFormat pf = new PixelFormat(this); pf.setAttrib(MAX_SWAP_INTERVAL, maxSwapInterval); return pf; } COM: <s> returns a new pixel format with the specified egl max swap interval </s>
funcom_train/26412302
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void reset(ActionMapping mapping, HttpServletRequest request) { action = null; sByte = null; sShort = null; sInteger = null; sLong = null; sFloat = null; sFloatRange = null; sDouble = null; sDate = null; sCreditCard = null; setDetail("validator/type.html"); } COM: <s> reset all properties to their default values </s>
funcom_train/1116591
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JList getNextlist() { if (nextlist == null) { nextlist = new JList(); nextlist.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { if (e.getButton() == java.awt.event.MouseEvent.BUTTON3) { getNextstatemenu() .show(e.getComponent(), e.getX(), e.getY()); } } }); } return nextlist; } COM: <s> this method initializes nextlist </s>
funcom_train/49608800
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public RollState updateRollState(String username,EntityManager em,RollState vo) throws Throwable { try { return (RollState)JPAMethods.merge(em, username, DefaultFieldsCallabacks.getInstance(), vo); } catch (Throwable ex) { Logger.error(null, ex.getMessage(), ex); throw ex; } finally { em.flush(); } } COM: <s> update a roll state </s>
funcom_train/536854
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void assertSameSize(Track[] array, Iterable<Track> iterable) { int iterableCount = 0; Iterator<Track> iterator = iterable.iterator(); while (iterator.hasNext()) { iterator.next(); iterableCount++; } assertEquals(iterableCount, array.length); } COM: <s> fail assertion if the array and the iterable have different number of elements </s>
funcom_train/22361931
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void postProcessMessages(Collection messages) { if(messages == null) { return; } Map ht = CollectionFactory.createOrderedHashtable(); for(Iterator iter = messages.iterator(); iter.hasNext();) { Message msg = (Message) iter.next(); if(ht.put(msg, msg) != null) { if(1==2) { log.warn("Duplicate message \"" + msg.getText() + "\" found, removing it."); } } } messages.clear(); messages.addAll(ht.values()); } COM: <s> postprocess a given list of messages </s>
funcom_train/3913502
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ClassProperty getClasses(Uol uol, Run run, User user, String propId) throws PropertyException { String key = getKey(uol, run, user, propId); ClassProperty property = (ClassProperty) fetchFromCache(key); if (property == null) { property = new ClassProperty(uol, run, user, propId); addToCache(key, property); } return property; } COM: <s> returns the component containg the class visibilities </s>
funcom_train/51359210
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Spring createPermRoad(final double start, final double bottom, final double length) { //Add before "road" Particle left = new Particle(); Particle right = new Particle(); left.simulate = false; right.simulate = false; left.pos.set(start, bottom); right.pos.set(start + length, bottom); Spring leftRight = new Spring(left, right, 10); leftRight.repel = true; world.addNode(left); world.addNode(right); world.addNode(leftRight); return leftRight; } COM: <s> creates a permanet road a spring connected to two unmovable particles </s>
funcom_train/51616003
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getElementType() throws ReadError { try { Attribute class_attribute = directory.getAttributes("").get("objectClass"); return class_attribute == null ? null : class_attribute.get().toString(); } catch (NamingException exp) { throw new ReadError(exp.toString()); } } COM: <s> get element type from directory </s>
funcom_train/3090550
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void analyzeMatrix() { minValue = matrix.get(0,0); maxValue = minValue; double current; for (int i=0; i < matrix.getNumberOfRows(); i++) { for (int j=0; j < matrix.getNumberOfColumns(); j++) { current = matrix.get(i,j); if (current > maxValue) maxValue = current; if (current < minValue) minValue = current; } } } COM: <s> analyzes the matrix to find the min and max values </s>
funcom_train/34451255
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addTracePropertyDescriptor(Object object) { itemPropertyDescriptors.add(createItemPropertyDescriptor( ((ComposeableAdapterFactory) adapterFactory) .getRootAdapterFactory(), getResourceLocator(), getString("_UI_MThread_trace_feature"), getString( "_UI_PropertyDescriptor_description", "_UI_MThread_trace_feature", "_UI_MThread_type"), RuntimePackage.Literals.MTHREAD__TRACE, true, false, true, null, null, null)); } COM: <s> this adds a property descriptor for the trace feature </s>
funcom_train/2389501
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JMenuItem getEquationMenuItem() { if (equationMenuItem == null) { equationMenuItem = new JMenuItem(); equationMenuItem.setText("Gleichung"); equationMenuItem.setIcon(new ImageIcon(getClass().getResource("/images/icons/calculator_add.png"))); equationMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { btnActionPerformedEquation(); } }); } return equationMenuItem; } COM: <s> this method initializes equation menu item </s>
funcom_train/39554445
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int removeUnusedObjects() { boolean hits[] = new boolean[xrefObj.size()]; removeUnusedNode(trailer, hits); int total = 0; for (int k = 1; k < hits.length; ++k) { if (!hits[k] && xrefObj.get(k) != null) { xrefObj.set(k, null); ++total; } } return total; } COM: <s> removes all the unreachable objects </s>
funcom_train/15724238
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void sortChildren(Comparator nodeComparator) { if (children != null && nodeComparator != null) { Collections.sort(children, nodeComparator); for (int i = 0; i < children.size(); i++) { Object child = children.get(i); if (child instanceof SortableNode) { ((SortableNode) child).sortChildren(nodeComparator); } } } } COM: <s> recursively sorts the children of this node according to the order </s>
funcom_train/2441670
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean isWizardType() { switch (this) { case SalesforceQuery: case SalesforceUpsert: case SalesforceCreate: case SalesforceUpdate: case SalesforceBulkLoad: case SalesforceDelete: case DatabaseToDatabaseConnect: case DatabaseToTextConnect: case DatabaseToXmlConnect: case TextToDatabaseConnect: case XmlToDatabaseConnect: return true; default: return false; } } COM: <s> checks if this code entity type code represents a so called wizard item </s>
funcom_train/45317081
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void run() { // Start cycling try { do { // TODO: Priority 2 - Update statistics in database Thread.sleep(MainClass.getRealtimestatsRefreshtime()); } while (true); } catch (Exception ex) { Logger.getLogger(Logger.GLOBAL_LOGGER_NAME).log(Level.SEVERE, null, ex); } } COM: <s> where the intelligence lies </s>
funcom_train/44707445
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void generateXML(PageState state, Element parent) { if ( isVisible(state) ) { Element content = parent.newChildElement("cms:contentPanel", CMS.CMS_XML_NS); exportAttributes(content); // Take advantage of caching in the CMS Dispatcher. XMLGenerator xmlGenerator = getXMLGenerator(state); xmlGenerator.generateXML(state, content, null); } } COM: <s> generates xml that represents a content item </s>
funcom_train/48873520
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JMenuItem getOpenMenuItem() { if (openMenuItem == null) { openMenuItem = new JMenuItem(openProjectAction); openMenuItem.setMnemonic(KeyEvent.VK_O); openMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, Event.CTRL_MASK, true)); } return openMenuItem; } COM: <s> this method initializes open menu item </s>
funcom_train/22371354
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void addActions() { options.add(newPlayListAction); options.add(renamePlayListAction); options.add(closePlayListAction); options.add(closeOtherPlayListsAction); options.addSeparator(); options.add(arrangePlayListColumnsAction); options.addSeparator(); options.add(copyPlayListToDeviceAction); options.add(syncDeviceWithPlayListAction); } COM: <s> add actions to popup </s>
funcom_train/39101131
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void removeChildren() { // FIX this function does not reset the childrens parent field and listener list getChildren().removeAllElements(); if (this instanceof ArrayModel) { fireValueChange(this, new DataModelEvent(this, DataModelEvent.VALUE_CHANGE, DataModelEvent.SUBTYPE_CLEAR, -1, null)); ((ArrayModel<T>) this).setHighlightedItem(-1); } else { fireStructureChange(); } } COM: <s> get rid of all the children at once </s>
funcom_train/1285043
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setYear(int year) { calendar.set(Calendar.YEAR, year); for(int i = 7; i< 49; i++) { try { ActionListener[] listeners = days[i].getActionListeners(); for ( int j = 0; j < listeners.length; j++) { days[i].removeActionListener(listeners[j]); } days[i].addActionListener(this); } catch(IndexOutOfBoundsException e) { //System.out.println(""); } } drawDays(); } COM: <s> sets a specific year </s>
funcom_train/12628297
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void install(String[] args) throws LauncherException { executeAntTarget(new String[] {"install"}); try { installProjects(); generateScripts(); //registerXFreeDesktopExtensions(); System.out.println("Scriptlandia core installed."); } catch (Exception e) { e.printStackTrace(); throw new LauncherException(e.getMessage()); } } COM: <s> performs installation of initial components projects </s>
funcom_train/7380838
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public MoneyBag add(final Money amount) { FunctionMap<Currency, Money> newTotals = new FunctionMap<Currency, Money>(ADD_MAP_FUNCTION); newTotals.putAll(totals); newTotals.put(amount.currency(), amount); return new MoneyBag(newTotals); } COM: <s> add money to the money bag </s>
funcom_train/7524571
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object up(Event evt) { if(corr != null) { if(!corr.receive(evt)) { return handleUpEvent(evt); } } else { if(log.isErrorEnabled()) { //Something is seriously wrong, correlator should not be null since latch is not locked! log.error("correlator is null, event will be ignored (evt=" + evt + ")"); } } return null; } COM: <s> called by channel we registered before when event is received </s>
funcom_train/34353343
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void init() throws ServletException { super.init(); // Set a system property for the DiscoveryServerProxy to use // for the discovery URL try { WorkerProxy.initialize(getProperty("WORKER_URL")); } catch (IOException e) { throw new ServletException(e); } poller = new KBPoller(5000); (new Thread(poller, "KB Poller")).start(); } COM: <s> contains any code that needs to be run when the servlet container </s>
funcom_train/48104552
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String authorizationParameters(String authToken) { HashMap<String, String> parameters = new HashMap<String, String>(); parameters.put("api_key", mApiKey); parameters.put("auth_token", authToken); parameters.put("popup", "1"); parameters.put("v", "1.0"); return FacebookMethod.urlParameters(parameters); } COM: <s> generate a url to load in the browser for a user to see </s>
funcom_train/48906840
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void adaptGlobalWeightsOnGame(Watten aGame) { Deck aDeck = aGame.getDeck(); getGoodCard(aGame).increaseWeightBy(80); for(Card aCard : aDeck.getCardsByColor(aGame.getAnnouncedColor())) { aCard.increaseWeightBy(20); } for(Card aCard : aDeck.getCardsBySchlag(aGame.getAnnouncedSchlag())) { aCard.increaseWeightBy(40); } } COM: <s> adapt global weights on game </s>
funcom_train/3529153
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setRawFragment(char[] escapedFragment) throws URIException { if (escapedFragment == null || escapedFragment.length == 0) { _fragment = escapedFragment; return; } if (!validate(escapedFragment, fragment)) throw new URIException(URIException.ESCAPING, "escaped fragment not valid"); _fragment = escapedFragment; setURI(); } COM: <s> set the raw escaped fragment </s>
funcom_train/28639189
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public double getStdDev() { double weightedStdDev=0; double totalHits=0; for (int i=0;i<numRows;i++) { double hits=monitors[i].getHits(); weightedStdDev=hits*monitors[i].getStdDev(); totalHits+=hits; } if (totalHits==0) return 0; else return weightedStdDev/totalHits; } COM: <s> this is not a true standard deviation but a average weighted std deviation </s>
funcom_train/19062637
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void exportFolder(TreeView treeView, IMailbox folder) { MailFolderCommandReference commandRef = new MailFolderCommandReference( folder); IMailFolder destFolder = (IMailFolder) treeView.getDropTargetFolder(); if (folder.equals(destFolder)) return; commandRef.setDestinationFolder(destFolder); treeView.resetDropTargetFolder(); CommandProcessor.getInstance().addOp(new MoveFolderCommand(commandRef)); } COM: <s> export the folder </s>
funcom_train/42722457
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void doType(int[] keyCodes, int offset, int length) throws Exception { if (length == 0) { return; } try { robot.keyPress(keyCodes[offset]); doType(keyCodes, offset + 1, length - 1); robot.keyRelease(keyCodes[offset]); } catch (Exception e) { robot.keyRelease(keyCodes[offset]); throw e; } } COM: <s> type a character in case of shift key event </s>
funcom_train/43134094
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void raiseWarning(String msgKey) { ResourceBundle bundle = ResourceBundle.getBundle("label"); String message = bundle.getString("javaspeaker.message." + msgKey); String title = bundle.getString("javaspeaker.warn"); JOptionPane.showMessageDialog(this, message, title, JOptionPane.WARNING_MESSAGE); } COM: <s> display a warning message </s>
funcom_train/5424774
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected IllegalArgumentException badUsage(String msg) { String s; if(msg != null) s = "Error: "+msg+"\nUsage: java " + getClass().getName() + " " + usage(); else s = "Usage: java " + getClass().getName() + " " + usage(); throw new IllegalArgumentException(s); } COM: <s> returns an exception for bad arguments along with </s>
funcom_train/37426837
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setLength(double newLength) { if (newLength != length) { final double oldLength = length; length = Math.max(0.0, newLength); fireTaskEvent(new DefaultTaskEvent(this) { public double getOldLength() { return oldLength; } public double getNewLength() { return length; } }); } } COM: <s> update method to the length of the task </s>
funcom_train/48407015
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addLinkKindPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_WorkSequence_linkKind_feature"), getString("_UI_PropertyDescriptor_description", "_UI_WorkSequence_linkKind_feature", "_UI_WorkSequence_type"), SpemxtcompletePackage.eINSTANCE.getWorkSequence_LinkKind(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the link kind feature </s>
funcom_train/41776230
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testOriginal() { for (int i = 0; i < 3; i++) { xl = al[i]; xr = ar[i]; for (int j = 0; j < 3; j++) { yl = al[j]; yr = ar[j]; zl = (xr ^ yr) & (!((!xl) & yr)); zr = xl & (!yr); System.out.print((zl ? 1 : 0) + "" + (zr ? 1 : 0) + "\t"); } System.out.println(); } } COM: <s> 0 00 01 1 11 get the truth table for original expression </s>
funcom_train/28130469
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public T poll() { if (size == 0) return null; int s = --size; T result = (T) queue[0]; T x = (T) queue[s]; queue[s] = null; if (s != 0) siftDown(0, x); result.setHeapIndex(-1); // Mark it as not in heap return result; } COM: <s> get the top element from the heap removing it from the heap </s>
funcom_train/44107786
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean isClosed() { if (dbtype.equals("file")) return false; boolean ret = true; try { ret = conn.isClosed(); return ret; } catch (SQLException e) { ServerConsoleServlet.printSystemLog(e.toString() + " " + e.getMessage(), ServerConsoleServlet.LOG_ERROR); return true; } } COM: <s> return true if database connection is closed </s>
funcom_train/1583109
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addEdge(final T a, final T b) { if (a == null) throw new NullPointerException("First node may not be null."); Set<T> neighbors = edges.get(a); if (neighbors == null) edges.put(a, neighbors = new HashSet<T>()); neighbors.add(b); } COM: <s> add an adjacency mapping from node a to b creating the neighbor </s>
funcom_train/37444572
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setPageElements(final Integer pageElements) { if (pageElements.intValue() < 1) { LOGGER.warn(getBeanTag().getJSPBean().getStringID() + "setPageElements(" + pageElements + "):Changed to 10"); this.pageElements = Integer.valueOf(10); } else { this.pageElements = pageElements; } } COM: <s> accepts the maximum number of elements per pages </s>
funcom_train/9057275
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getIsInPeriod(int start, int finish) throws IllegalArgumentException { if(finish < start || start < 1 || finish > 41) { throw new IllegalArgumentException(); } int courseStart = this.getStartingPeriod(); int courseEnd = this.getFinishingPeriod(); if(courseStart > finish) { return 1; } if(courseEnd < start) { return -1; } return 0; } COM: <s> check if the course is within a given period </s>
funcom_train/4821693
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setPeriod(String period) { try { this.period = Period.valueOf(period) ; } catch (IllegalArgumentException e) { LogLog.warn("No period with name [" + period + "]", e) ; } LogLog.debug("Set roll period to [" + this.period + "]") ; } COM: <s> period for rolling </s>
funcom_train/49079053
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public double calcSubTotal(Transaction transaction){ double output = 0; for(int i = 0; i<transaction.getTransactionLineList().size();i++ ){ TransactionLine txl = transaction.getTransactionLineList().get(i); output += txl.getRevenueSource().getPrice() - txl.getCoupon().getAmount(); } return output; } COM: <s> calculates subtotal of transaction by adding up total of all transactionlines </s>
funcom_train/42710902
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void modify( GISGrid gridMaps[], int mapA, int mapB, int row, int col) { GISLattice[] maps = (GISLattice[]) gridMaps; double valueA = maps[ mapA].getCellValue( row, col); double valueB = maps[ mapB].getCellValue( row, col); modifyMap( maps[ mapA], row, col, valueB); modifyMap( maps[ mapB], row, col, valueA); } COM: <s> this method should be used when modifying correlogram within a lattice sdum </s>
funcom_train/13391386
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void close() throws IOException { try { // Using write lock because we want an exclusive lock mutatorLock.writeLock(); updateCount = 0; // Don't need to sync on this because // mutatorLock.writeLock() gives us an exclusive lock log.close(); } finally { // Using write lock because we want an exclusive lock mutatorLock.writeUnlock(); } } COM: <s> close this persistent store without destroying its contents </s>
funcom_train/34340068
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Command getCargar_pedido() { if (cargar_pedido == null) {//GEN-END:|24-getter|0|24-preInit // write pre-init user code here cargar_pedido = new Command("CARGAR ", Command.OK, 0);//GEN-LINE:|24-getter|1|24-postInit // write post-init user code here }//GEN-BEGIN:|24-getter|2| return cargar_pedido; } COM: <s> returns an initiliazed instance of cargar pedido component </s>
funcom_train/23791999
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void minibeeMap(int nodeId, int minibeeId) { if(isRegistered) { Object[] arg = {incoming_port, name, nodeId, minibeeId}; OSCMessage msg = new OSCMessage("/map/minibee/output", arg); out.send(msg); } else { if(verbo > 2) System.err.println("\nSenseWorldDataNetwork warning: the client is not yet registered. Cannot map MiniBees."); } } COM: <s> handles the mapping to a mini bees outputs </s>
funcom_train/9867981
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Attributes _topicRef(final Topic topic) { if (topic == null) { _reportInvalid("The topic reference is null"); return XMLC14NWriter.EMPTY_ATTRS; } _attrs.clear(); _attrs.addAttribute("", "topicref", "", "CDATA", Integer.toString(_indexOf(topic))); return _attrs; } COM: <s> returns attributes which contains a reference to the provided topic </s>
funcom_train/45116746
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Properties getPropertiesInAntCanonicalFormat() { filterProperties(properties); Properties toReturn = new Properties(); Enumeration<Object> enum1 = properties.keys(); String keyPrefix = getFullTestId() + "/"; while (enum1.hasMoreElements()) { String key = (String) enum1.nextElement(); toReturn.put(keyPrefix + key, properties.get(key)); } String key = keyPrefix + RunningProperties.IS_DISABLED; toReturn.put(key, Boolean.toString(isDisable())); return toReturn; } COM: <s> returns a code property code instance with all tests parameters in </s>
funcom_train/5395873
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testGetStartTag() { System.out.println("getStartTag"); TableElement instance = null; short expResult = 0; short result = instance.getStartTag(); 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 get start tag method of class org </s>
funcom_train/1538619
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ModLong gcd(ModLong S) { if (S.isZERO()) { return this; } if (isZERO()) { return S; } if (isUnit() || S.isUnit()) { return ring.getONE(); } return new ModLong(ring, gcd(val, S.val)); } COM: <s> mod integer greatest common divisor </s>
funcom_train/30075692
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected ModelAndView onSubmit(Object command) throws ServletException { Model model = (Model) command; // delegate the insert to the Business layer getGpir().storeModel(model); return new ModelAndView(getSuccessView(), "modelId", Integer.toString(model.getId())); } COM: <s> method inserts a new code model code </s>
funcom_train/24161777
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void delete(TransportUnit transportUnit) throws RemovalNotAllowedException { if (LOGGER.isDebugEnabled() && onRemovalListener == null) { LOGGER.debug("No listener onRemove defined, just try to delete it"); } if (null == onRemovalListener || onRemovalListener.preRemove(transportUnit)) { dao.remove(transportUnit); } } COM: <s> try to remove when there is no listener defined or a defined listener </s>
funcom_train/4193110
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected int indexOfFirstSemi() { Parser par=new Parser(value); par.goToSkippingQuoted('>'); if (par.getPos()==value.length()) par.setPos(0); par.goToSkippingQuoted(';'); if (par.getPos()<value.length()) return par.getPos(); else return -1; } COM: <s> returns the index of the first semicolon before the first parameter </s>
funcom_train/34526341
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void saveDocuments(List<Document> documents) { // split the documents by type Map<String, List<Document>> map = new HashMap<String, List<Document>>(); for (Document document : documents) { String type = document.getType(); List<Document> typeDocs = map.get(type); if (typeDocs == null) { map.put(type, typeDocs = new LinkedList<Document>()); } typeDocs.add(document); } saveDocuments(map); } COM: <s> saves the specified list of </s>
funcom_train/18475665
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void httpGet(URL url, File destFile) throws BuildException { Get getTask = new Get(); boolean returnCd = false; //set the OPTIONAL ANT parms getTask.setSrc(url); getTask.setDest(destFile); getTask.setUseTimestamp(true); log("Getting URL from Internet/URL - " + url); log("Getting URL from Internet/Dest File - " + destFile); //execute the get task getTask.execute(); } COM: <s> call ant get to pull the file from the internet </s>
funcom_train/16641740
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void clear(boolean hidden) { if (hidden) { parameters.clear(); parametersMap.clear(); return; } for (Iterator<Parameter> i = iterator(); i.hasNext(); ) { Parameter parameter = i.next(); if (!parameter.isHidden()) { i.remove(); } } } COM: <s> clears the collection </s>
funcom_train/15798535
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String toXML() { ByteArrayOutputStream baos = (ByteArrayOutputStream) super.toXML(this); String xmlString; try { //Try UTF-8 first. xmlString = baos.toString("UTF-8"); } catch (UnsupportedEncodingException e) { //If error, use default system encoding. xmlString = baos.toString(); } return xmlString; } COM: <s> writes urlthought object to xml string </s>
funcom_train/18955795
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void deleteClassificationItem(String ID) { Session session = getSession(); delete(session, "from MCRCLASS where id = '" + ID + "'"); delete(session, "from MCRCLASSLABEL where ID = '" + ID + "'"); delete(session, "from MCRCATEG where clid = '" + ID + "'"); delete(session, "from MCRCATEGLABEL where CLID = '" + ID + "'"); } COM: <s> the method remove a mcrclassification item from the datastore </s>
funcom_train/3085662
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setHeight(int newHeight) throws OutOfBoundsException { if (newHeight < 1) throw new IllegalArgumentException("New height is < 1"); for (Iterator it = cells.iterator(); it.hasNext();) { CellConstraints cell = (CellConstraints) it.next(); if (cell.getRow2() >= newHeight) throw new OutOfBoundsException("New height " + newHeight + " is smaller than current contraints", cell); } height = newHeight; } COM: <s> sets the height of the grid layout manager </s>
funcom_train/46457485
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void mouseClicked(MouseEvent e) { TreePath path = tree.getPathForLocation(e.getX(), e.getY()); if (path == null) return; if (e.getX() > tree.getPathBounds(path).x + hotspot) return; boolean selected = selectionModel.isPathOrAncestorSelected(path); try { ignoreEvents = true; if (selected) { selectionModel.removeSelectionPath(path); } else { selectionModel.addSelectionPath(path); } } finally { ignoreEvents = false; tree.treeDidChange(); } } COM: <s> handles mouse click events </s>
funcom_train/45856633
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void validateStandplaats(nl.vrom.www.bag.stuf._0120.Standplaats_type0[] param){ if ((param != null) && (param.length > 4)){ throw new java.lang.RuntimeException(); } if ((param != null) && (param.length < 1)){ throw new java.lang.RuntimeException(); } } COM: <s> validate the array for standplaats </s>
funcom_train/19433998
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void selectItem( Unit selectedUnit ) { for ( int i = 0; i < listOptionLabels.length; i++ ) { if( listOptionLabels[i].getId().equals( selectedUnit ) ) { listOptionLabels[i].setSelected( true ); } else { listOptionLabels[i].setSelected( false ); } } } COM: <s> flags the speficied unit as selected in the units list </s>
funcom_train/32068313
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean addEmailMessages(Collection<EmailMessage> emailMessages) { boolean addOk = getEmailMessages().addAll(emailMessages); if (addOk) { for(EmailMessage emailMessage : emailMessages) { emailMessage.setEmailMessageStatus((EmailMessageStatus)this); } } else { if (logger.isWarnEnabled()) { logger.warn("add returned false"); } } return addOk; } COM: <s> add the passed email messages collection to the email message status collection </s>
funcom_train/3380993
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean drain (long l) throws IOException { int bufSize = 2048; byte[] db = new byte [bufSize]; while (l > 0) { long len = readImpl (db, 0, bufSize); if (len == -1) { eof = true; return true; } else { l = l - len; } } return false; } COM: <s> read and discard up to l bytes or eof occurs </s>
funcom_train/37229819
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public MSASegment getMSA() { MSASegment msa = (MSASegment)findSegment( "MSA" ); if( msa == null ) { msa = new MSASegment( this ); msa.initialize(); if( vSegments == null ) vSegments = new Vector(); int iLoc = (findSegment("MSH") != null) ? 1 : 0; vSegments.add(iLoc, msa); } return msa; } COM: <s> get the msa segment that should be contained within this loop </s>
funcom_train/37865925
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getPageInfo() { return "page: " + pageNum + "; file = " + getFile().getName() + "; address = " + Long.toHexString(offset) + "; page header = " + fileHeader.getPageHeaderSize() + "; data start = " + Long.toHexString(offset + fileHeader.getPageHeaderSize()); } COM: <s> gets the page info attribute of the page object </s>
funcom_train/12784495
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean equals(Object other) { if (other == null) return false; if (!getClass().equals(other.getClass())) { return false; } BaseFactoid otherObjectStateTuple = (BaseFactoid) other; return (state.equals(otherObjectStateTuple.state) && instance.equals(otherObjectStateTuple.instance)); } COM: <s> is this tuple equal to another object </s>
funcom_train/14070230
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String getErrorMessage(InputStream ins) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(ins)); String line = null; StringBuilder sb = new StringBuilder(); while((line = br.readLine()) != null) { sb.append(line); } return sb.toString(); } COM: <s> extract error message from http response </s>
funcom_train/31084616
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String readFOURCC () throws IOException { byte[] fourcc = new byte[4]; // readBYTE() decrements bytesRemaining. fourcc[0] = (byte)readBYTE(); fourcc[1] = (byte)readBYTE(); fourcc[2] = (byte)readBYTE(); fourcc[3] = (byte)readBYTE(); return new String (fourcc); } COM: <s> read four bytes from input and return as a string </s>
funcom_train/42707893
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setValueFromString(String s) throws BadValueException { if (s == null) { value = null; return; } //make adjustments to make it exactly 4 characters if (s.length() > 4) { s = s.substring(0, 4); } while (s.length() < 4) { s = s + " "; } if (!testCandidate(s)) { throw new BadValueException(s); } this.value = s; } COM: <s> set the value for this object from the specified string </s>
funcom_train/4205155
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void refreshViewer() { if (myTableViewer.getComparator() != null) { /* * Have to wait with the update as we otherwise end up adding the same element to the viewer twice.. */ myTable.getDisplay().asyncExec(new Runnable() { public void run() { if (!myTableViewer.getTable().isDisposed()) { myTableViewer.refresh(); } } }); } } COM: <s> refreshes the viewer if needed </s>
funcom_train/18322970
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addNamePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_MethodCall_name_feature"), getString("_UI_PropertyDescriptor_description", "_UI_MethodCall_name_feature", "_UI_MethodCall_type"), MetalangPackage.Literals.METHOD_CALL__NAME, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the name feature </s>
funcom_train/21407528
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: /*public SmsAssemblerData getSmsAssemblerData(){ Storage store = StorageFactory.getStorage(IDENTIFIER_SMS_DATA_STORAGE,null); Vector vect = store.read(new SmsAssemblerData().getClass()); if(vect != null && vect.size() > 0) return (SmsAssemblerData)vect.elementAt(0); //There can only be one record for the sms data object. return null; } COM: <s> gets previously stored sms assembler data if any </s>
funcom_train/14214920
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Writer render(String templatePath) throws SurveyWrapperException { URL templateUrl = UtilURL.fromResource(templatePath); if (templateUrl == null) { String errMsg = "Problem getting the template for Survey from URL: " + templatePath; Debug.logError(errMsg, module); throw new IllegalArgumentException(errMsg); } Writer writer = new StringWriter(); this.render(templateUrl, writer); return writer; } COM: <s> renders the survey </s>
funcom_train/12547999
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void changePolygonHue(double change) { float[] hsbvals = Color.RGBtoHSB(polygonColor.getRed(), polygonColor .getGreen(), polygonColor.getBlue(), null); hsbvals[0] += ((float) change) / 360f; setPolygonColor(Color.getHSBColor(hsbvals[0], hsbvals[1], hsbvals[2])); } COM: <s> changes the current polygon colors hue angle by the given hue angle </s>
funcom_train/40002276
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void checkGameInput() { float velocityX = 0; if (moveLeft.isPressed()) { velocityX-=Player.SPEED; } if (moveRight.isPressed()) { velocityX+=Player.SPEED; } player.setVelocityX(velocityX); if (jump.isPressed() && player.getState() != Player.STATE_JUMPING) { player.jump(); } } COM: <s> checks input from game actions that can be pressed </s>
funcom_train/1526718
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private User authenticate(String user, String pass) { logger.debug("Authenticating user for credentials: {}/{}", user, pass); User u = null; try { // Load the user object from Hibernate u = service.getUser(user, pass); } catch (ServiceException e) { log.error("Could not load user for credentials: {}/{}", user, pass); } return u; } COM: <s> simple utility method used to authenticate the </s>