__key__
stringlengths
16
21
__url__
stringclasses
1 value
txt
stringlengths
183
1.2k
funcom_train/34759062
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected String quoteForSQL (String str) { StringBuffer result = new StringBuffer(); for (int i=0; i < str.length(); i++) { if (str.charAt(i)=='\'') { result.append("''"); } else { result.append(str.charAt(i)); } } return result.toString(); } COM: <s> quote given string for sql statements </s>
funcom_train/20688487
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ResponseAPDU delete(byte[] AID) throws CardException { byte[] data = new byte[2 + AID.length]; data[0] = 0x4F; data[1] = (byte) AID.length; System.arraycopy(AID, 0, data, 2, AID.length); return cardChannel.transmit(new CommandAPDU(0x80, INS_DELETE, 0x00, 0x00, data, 0x00)); } COM: <s> deletes an application or executable load file </s>
funcom_train/19142763
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private double parseDouble(String valueText) { // remove % sign if (valueText.endsWith("%")) { valueText = valueText.substring(0, valueText.length() - 1); final double centsPerWhole = 100; return Double.parseDouble(valueText) / centsPerWhole; } return Double.parseDouble(valueText); } COM: <s> parses a value text and returns its double value </s>
funcom_train/21380059
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void toastFirstOrLast() { if (mPosition == 0) { Toast.makeText(this, R.string.first_pic, Toast.LENGTH_SHORT).show(); } else if (mPosition == mSlideshowList.size() - 1) { Toast.makeText(this, R.string.last_pic, Toast.LENGTH_SHORT).show(); } } COM: <s> displays a message telling the user that he has reached the beginning or </s>
funcom_train/10509605
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void initChecksum() { if (checksum != null) { return; } if ("CRC".equals(algorithm)) { checksum = new CRC32(); } else if ("ADLER".equals(algorithm)) { checksum = new Adler32(); } else { throw new BuildException(new NoSuchAlgorithmException()); } } COM: <s> initialize the checksum interface </s>
funcom_train/14520429
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Integer ejbCreate(Integer id, String name, BaseUserDataSource userdatasource) throws CreateException { setId(id); setName(name); this.setUpdateCounter(0); if (userdatasource != null) { setUserDataSource(userdatasource); } log.debug("Created User Data Source " + name); return id; } COM: <s> entity bean holding data of a userdatasource </s>
funcom_train/10509372
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setType(String strType) { if (strType.equalsIgnoreCase("open")) { type = Arc2D.OPEN; } else if (strType.equalsIgnoreCase("pie")) { type = Arc2D.PIE; } else if (strType.equalsIgnoreCase("chord")) { type = Arc2D.CHORD; } } COM: <s> set the type of arc </s>
funcom_train/41162836
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void save(CoParagraphTeacher2 entity) { EntityManagerHelper.log("saving CoParagraphTeacher2 instance", Level.INFO, null); try { getEntityManager().persist(entity); EntityManagerHelper.log("save successful", Level.INFO, null); } catch (RuntimeException re) { EntityManagerHelper.log("save failed", Level.SEVERE, re); throw re; } } COM: <s> perform an initial save of a previously unsaved co paragraph teacher2 </s>
funcom_train/26530828
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected boolean shouldInvokeSnippet(SnippetInstanceTO snip) { switch (snip.getPageRegion()) { case PageContentTO.REGION_HEADER: return shouldInvokerHeaderSnippet(snip); case PageContentTO.REGION_CONTENT: return shouldInvokeContentSnippet(snip); case PageContentTO.REGION_FOOTER: return shouldInvokeFooterSnippet(snip); default: return true; } } COM: <s> return true if the snippet invoker should be run on the given snippet </s>
funcom_train/8065117
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: final public void firePropChange(String propName, Object oldV, Object newV) { Globals.firePropChange(this, propName, oldV, newV); if (group != null) { PropertyChangeEvent pce = new PropertyChangeEvent(this, propName, oldV, newV); group.propertyChange(pce); } } COM: <s> creates a property change event and calls all registered listeners </s>
funcom_train/10280248
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void updateApplicationBar(String pName) { if (mView != null) { // CB TODO, We might want to show the player, which corresponds to // the MIME type of a file. // This could be based on a selected file option. mView.mPlayerField.setText(" " + pName); } } COM: <s> update the status bar with the default player for </s>
funcom_train/19840132
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean selectItem(final int index) { boolean success = false; if (isOkToUse(fComboControl)) { fComboControl.select(index); success = fComboControl.getSelectionIndex() == index; } else { if (index >= 0 && index < fItems.length) { fText = fItems[index]; fSelectionIndex = index; success = true; } } if (success) { dialogFieldChanged(); } return success; } COM: <s> selects an item </s>
funcom_train/2878843
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void draw(Graphics2D g2d) { g2d.fillOval((int) (this.getPosition().getX() - (size.getWidth() / 2)), (int) (this.getPosition().getY() - (size.getHeight() / 2)), (int) size.getWidth(), (int) size.getHeight()); } COM: <s> draws the ball object </s>
funcom_train/8572211
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void openDetails(Anchor link, String line) { PostView pv = PostView.show(messages, constants, caller, line, elements); int left = link.getAbsoluteLeft() + 100; int top = link.getAbsoluteTop() + 10; pv.setPopupPosition(left, top); pv.show(); } COM: <s> opens up the detail window for a given line </s>
funcom_train/24079444
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public XCriteriaSet writeCoalitions(ICoalitions source) { checkNotNull(source); final XCriteriaSet xCriteriaSet = write(source.getWeights()); if (source.getMajorityThreshold() != null) { final XValue xValue = xCriteriaSet.addNewValue(); xValue.setReal(source.getMajorityThreshold().floatValue()); } return xCriteriaSet; } COM: <s> retrieves the xmcda equivalent of the given coalitions </s>
funcom_train/46492257
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private boolean isSelected(IJavaElement element) { if(selectedElements.contains(element)) return true; else { IJavaElement parent = JdtUtil.getNearestAncestor(element, new Class [] { IJavaProject.class, IPackageFragment.class, IType.class, IMethod.class}); return parent != null ? isSelected(parent) : false; } } COM: <s> returns true if the element or one of its valid parents is selected </s>
funcom_train/12528970
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public long freeMemory() { PerformanceCounter pc = new PerformanceCounter(); // Get number bytes currently allocated pc.set_CategoryName(NET_CLR_MEMORY); pc.set_CounterName(NUM_BYTES_IN_USE); pc.set_InstanceName(System.Diagnostics.Process.GetCurrentProcess().get_ProcessName()); float currentlyAllocated = pc.NextValue(); float totalAvailMemory = totalMemory(); return (long) (totalAvailMemory - currentlyAllocated); } COM: <s> answers the amount of free memory resources which are available to the </s>
funcom_train/34340664
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Command getItemCommandAgregar() { if (itemCommandAgregar == null) {//GEN-END:|28-getter|0|28-preInit // write pre-init user code here itemCommandAgregar = new Command("Agregar Producto", Command.ITEM, 0);//GEN-LINE:|28-getter|1|28-postInit // write post-init user code here }//GEN-BEGIN:|28-getter|2| return itemCommandAgregar; } COM: <s> returns an initiliazed instance of item command agregar component </s>
funcom_train/8487138
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testToString() { System.out.println("toString"); String expResult = "{ line : 0, column : 0, before : EMPTY, after : BLACK }"; String result = mainMod.toString(); assertEquals(expResult, result); } COM: <s> test of to string method of class modif </s>
funcom_train/5338484
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void deleteChar() { System.out.println("deleteChar "+cursorRow+" "+cursorCol); for (int i = cursorCol; i < NUMBER_OF_COLS - 1; i++) { lines[cursorRow][i] = lines[cursorRow][i + 1]; } lines[cursorRow][NUMBER_OF_COLS - 1] = ' '; escapeSequenceIndex = 0; } COM: <s> delete the character at the current cursor position </s>
funcom_train/4853302
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public StringItem getStringItemResultPoisson() { if (stringItemResultPoisson == null) {//GEN-END:|128-getter|0|128-preInit // write pre-init user code here stringItemResultPoisson = new StringItem("Resultado:", null);//GEN-LINE:|128-getter|1|128-postInit // write post-init user code here }//GEN-BEGIN:|128-getter|2| return stringItemResultPoisson; } COM: <s> returns an initiliazed instance of string item result poisson component </s>
funcom_train/14633500
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void sendRecipients() throws IOException { // Is "send to all" selected? if (client.isSendToAll()){ // Send an empty user list ostream.writeInt(0); } else{ // Write out how many ostream.writeInt(selectedUsers.length); // Loop for each for (int i=0; i < selectedUsers.length; i++){ // Find this user in our user list TaironaUser tmp = (TaironaUser)(allUsers.get(selectedUsers[i])); if (tmp != null) ostream.writeInt(tmp.getId()); } } } COM: <s> this method will construct a recipient list and send it </s>
funcom_train/13774556
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setColBnds(int colnum, int type, double lb, double ub) throws WrongLPX { ensureColumnExist(colnum); VarType vt = new VarType(type, lb, ub); native_set_col_bnds(id, colnum + 1, vt.getType(), vt.getLb(), vt.getUb()); } COM: <s> imposes new constraints on a basic variable specified by its number </s>
funcom_train/45391850
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean fixMinMax(MinMaxValue minMax) { if (this.label == null) { if (interval != null) { minMax.fixVal(interval.getStart()); minMax.fixVal(interval.getEnd()); return true; } else { if (!Double.isNaN(carrierVal1)) { minMax.fixVal(carrierVal1); return true; } if (carrierVal2 != null) { minMax.fixVal(carrierVal2.doubleValue()); } } } return false; } COM: <s> if label has non na n numeric values then adds its values </s>
funcom_train/26415535
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private StringBuffer getExtMacro(Device device) { StringBuffer exts = new StringBuffer(); exts.append('('); ArrayList al = device.getImgExtensions(); int sz = al.size(); for (int i = 0; i < sz; i++) { if (i > 0) { exts.append('|'); } exts.append(al.get(i)); } exts.append(')'); return exts; } COM: <s> returns the extensions macro from the given device </s>
funcom_train/35071234
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getLiteralsCount(int offset, int length) { int count = 0; for (; offset < (inputMask.length) && (length > 0); offset++) { if (getInputMaskChars().contains(new Character(inputMask[offset]))) { length--; } else { count++; } } return count; } COM: <s> returns the number of literals given the offset and length within the </s>
funcom_train/29962812
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setCurrentSource(SibType source) { if ( source == null ) { throw new IllegalArgumentException("null source"); } SibType old = this.getCurrentSource(); this.source = source; if ( this.source != old ) { /* insert the new source in the first place of the vector */ this.path.insertElementAt( source, 0 ); } } COM: <s> modify the source of the event </s>
funcom_train/21106344
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private MJButton getBtEditAccountAs() { if (btEditAccountAs == null) { btEditAccountAs = new MJButton(); btEditAccountAs.setPreferredSize(new java.awt.Dimension(85, 20)); btEditAccountAs.setText("aF4 Edit"); btEditAccountAs.setMnemonic(KeyEvent.VK_F4); } return btEditAccountAs; } COM: <s> this method initializes bt edit account as </s>
funcom_train/50090892
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public IRingSet getLargestRingSet(List ringSystems) { IRingSet largestRingSet = null; int atomNumber = 0; IAtomContainer container = null; for (int i = 0; i < ringSystems.size(); i++) { container = getAllInOneContainer((IRingSet) ringSystems.get(i)); if (atomNumber < container.getAtomCount()) { atomNumber = container.getAtomCount(); largestRingSet = (IRingSet) ringSystems.get(i); } } return largestRingSet; } COM: <s> returns the largest number of atoms ring set in a molecule </s>
funcom_train/32380410
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testAddResourceTypeForFailure() { System.out.println("testAddResourceTypeForFailure"); ResourceTypes resourceType = null; ResourceTypeManager resourceTypeManager = new ResourceTypeManager(); int expResult = IdentityMgmtConstants.ACTION_FAILED; int result = resourceTypeManager.addResourceType(resourceType); assertEquals(expResult, result); } COM: <s> test of add resource type method of class com </s>
funcom_train/3703577
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Subscription renewSubscription(int subscriptionID) { //// 1. Get the subscription. Subscription sub = getSubscription(subscriptionID); //// 2. Renew it. if (sub != null) { sub.setSubscriptionStartTime(System.currentTimeMillis()); fireSubscribeEvent(sub); } return (sub); } // of method COM: <s> renew a subscription </s>
funcom_train/40514276
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void initNews() { newsTableModel = new NewsTableModel(); newsTable.setModel(newsTableModel); List news = controller.getNews(); if (news != null) { for (int i = 0; i < news.size(); i++) { newsTableModel.addNew((New) news.get(i)); } } } COM: <s> method to init the news list </s>
funcom_train/7542342
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void createLaunchInBackgroundComponent(Composite parent) { fLaunchInBackgroundButton = createCheckButton(parent, LaunchConfigurationsMessages.CommonTab_10); GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); data.horizontalSpan = 2; fLaunchInBackgroundButton.setLayoutData(data); fLaunchInBackgroundButton.setFont(parent.getFont()); fLaunchInBackgroundButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { updateLaunchConfigurationDialog(); } }); } COM: <s> creates the controls needed to edit the launch in background attribute of </s>
funcom_train/18582217
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private EffectiveTime getTimeValue(Element time) { EffectiveTime tm = null; if (time != null) { Attribute val = time.getAttribute("value"); if (val != null) { tm = new EffectiveTime(); tm.setValue(val.getValue()); } } return tm; } COM: <s> returns the string value representing the specified time element </s>
funcom_train/34964978
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String createTrigger(Trigger t) throws PachubeException { HttpRequest hr = new HttpRequest("http://www.pachube.com/api/triggers"); hr.setMethod(HttpMethod.POST); hr.addHeaderItem("X-PachubeApiKey", this.API_KEY); hr.setBody(t.toString()); HttpResponse h = client.send(hr); if (h.getHeaderItem("Status").equals("HTTP/1.1 201 Created")) { return h.getHeaderItem("Location"); } else { throw new PachubeException(h.getHeaderItem("Status")); } } COM: <s> creates a trigger on pachube from the object provided </s>
funcom_train/14661736
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String toString() { String text = "{ "; for (int i = 0; i < entries.size(); i++) { text += entries.get(i); if (i != entries.size() - 1) text += " , "; } text += " }"; return text; } COM: <s> returns a code string code representing this code list code </s>
funcom_train/1491244
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void removeNubProviderAndResources(List<DataProviderDTO> providers, List<DataResourceDTO> resources) { if(nubDataProvider==null){ try { nubDataProvider = dataResourceManager.getNubDataProvider(); if(nubDataProvider!=null){ providers.remove(nubDataProvider); nubResources = dataResourceManager.getDataResourcesForProvider(nubDataProvider.getKey()); if(nubResources!=null) resources.removeAll(nubResources); } } catch (ServiceException e) { logger.error(e.getMessage(), e); } } } COM: <s> remove the nub provider resources from the datasets list </s>
funcom_train/19305420
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void setParentPD(final int progressionDimension) { if (shouldAdjustParentPD()) { final Area parent = ancestorArea(); /* The new value. */ int incrementAmount = progressionDimension; /* Subtract the old value. */ incrementAmount -= this.getProgressionDimension(); parent.incrementProgressionDimension(incrementAmount); } } COM: <s> sets the parents pd based on a change in thiss </s>
funcom_train/13980850
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final PlayerIdentificationObject other = (PlayerIdentificationObject) obj; if (login == null) { if (other.login != null) return false; } else if (!login.equals(other.login)) return false; if (password == null) { if (other.password != null) return false; } else if (!password.equals(other.password)) return false; return true; } COM: <s> returns true if passwords are equal each other as like as logins </s>
funcom_train/7674512
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean contentEquals(InsnList b) { if (b == null) return false; int sz = size(); if (sz != b.size()) return false; for (int i = 0; i < sz; i++) { if (!get(i).contentEquals(b.get(i))) { return false; } } return true; } COM: <s> compares the contents of this code insn list code with another </s>
funcom_train/2886232
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void assertStatisticsEqual(String text, Statistics s1, Statistics s2) { assertNotNull(text + ": empty statistics (first set) ", s1); assertNotNull(text + ": empty statistics (second set) ", s2); if (!s1.isEqual(s2)) { fail(text + ": not equal: [" + s1 + "] [" + s2 + "]"); } } COM: <s> assert that statistics entries are equal fail if not </s>
funcom_train/17700889
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void pr() { String srcFile; srcFile = classAttrs.getSrcFileName(); if (srcFile != null) { System.out.println("Compiled from " + srcFile + "\n"); classDecl.pr(); classFields.pr(); classMethods.pr(); System.out.println(" } // " + className + "\n"); } COM: <s> print the class file in a source format resembling </s>
funcom_train/31679588
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String toString() { String msg = super.toString(); if (_location != null) { msg += " (at line " + _location.getLineNumber() + ", column " + _location.getColumnNumber() + ")"; } if (_nested != null) { msg += " caused by " + _nested.toString(); } return msg; } COM: <s> returns the textual representation of this error </s>
funcom_train/24640829
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void enableEditButtons(boolean enable, boolean editableComponent) { cutItem.setEnabled(editableComponent); copyItem.setEnabled(enable); pasteItem.setEnabled(editableComponent); undoItem.setEnabled(editableComponent); redoItem.setEnabled(editableComponent); findItem.setEnabled(enable); findNextItem.setEnabled(enable); findAndReplaceItem.setEnabled(editableComponent); } COM: <s> en or disables the buttons in the edit menu </s>
funcom_train/31682694
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public WebDAVStatus execute() { try { if (!resource.exists()) { setStatusCode( WebDAVStatus.SC_NOT_FOUND ); return context.getStatusCode(); } // Submit the request entity to the requested resource and // allow it to process it in some resource-specific way. setResponseHeaders(); setStatusCode(WebDAVStatus.SC_OK); } catch (Exception exc) { m_logger.log(Level.WARNING, exc.getMessage(), exc); setStatusCode(WebDAVStatus.SC_INTERNAL_SERVER_ERROR); } return context.getStatusCode(); } COM: <s> execute the method </s>
funcom_train/48104569
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public FacebookMethod events_get(String uid) { Log.d(LOG, "Creating facebook.events.get method."); HashMap<String, String> parameters = new HashMap<String, String>(); parameters.put("uid", uid); return getMethodFactory().create("facebook.events.get", parameters, true); } COM: <s> create a method to get events of a particular user </s>
funcom_train/39001879
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Packet makePacket(int sizeOfPacket) { if (sizeOfPacket > maxPayloadLength()) { sizeOfPacket = maxPayloadLength(); } Packet p = new Packet(); p.usedLength = (byte) sizeOfPacket; p.data = new byte[sizeOfPacket]; p.destination = IRadio.AM_BROADCAST_ADDR; //p.source = nodeAddress(); return p; } COM: <s> make packet with the given size of payload </s>
funcom_train/11388033
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public JobQueueInfo getQueueInfo(String queueName) throws IOException { try { QueueInfo queueInfo = cluster.getQueue(queueName); if (queueInfo != null) { return new JobQueueInfo(queueInfo); } return null; } catch (InterruptedException ie) { throw new IOException(ie); } } COM: <s> gets the queue information associated to a particular job queue </s>
funcom_train/35647515
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void handleReadEvent(CrudEvent event) { BeanWrapper entity = new BeanWrapperImpl( event.getEntity() ); Object fieldValue = entity.getPropertyValue(fieldName); this.value = null; if (fieldValue != null) { BeanWrapper entityProp = new BeanWrapperImpl(fieldValue); this.value = (String) entityProp.getPropertyValue(propertyName); } } COM: <s> local helper method to perform wiring of the existing crud entity value </s>
funcom_train/20115979
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void writeCommand(String sessionId, String command) throws Exception { LOGGER.debug("write command " + command); ShellAdminContext ctx = getContext(sessionId); ctx.registerLastUserCommand(command); writeCommand(command, ctx.getOutputWriter()); // echo command to user writeCommand(command, ctx.getCommandWriter()); } COM: <s> send command to shelladmin </s>
funcom_train/22547951
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void stop(){ running = false; LOG.debug("Shutting down DHT Controller"); bootstrapper.stop(); dhtNodeAdder.stop(); if (dht != null) { dht.close(); } dhtEventDispatcher.dispatchEvent(new DHTEvent(this, EventType.STOPPED)); } COM: <s> shuts down the dht </s>
funcom_train/35095531
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void gestureStarted(long when, Location where, GestureManager<?> manager) { resetAll(); Point p = new Point((int) where.getX(), (int) where.getY()); convertPoint(p, manager); xPoints.add(p.x); yPoints.add(p.y); updateClipRegion(p.x, p.y); inGesture = true; } COM: <s> called when a gesture is started </s>
funcom_train/49623537
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object visit(Require node, St4ticScope scope, Object... objects) { /* * before begin: * notice to all reserved keywords has ignored ! * f0 : content a keyword we ignore it */ StringBuilder builder = new StringBuilder(); Enumeration element = node.f1.elements(); while( element.hasMoreElements() ) { builder.append( element.nextElement() ) ; if( element.hasMoreElements() ) { builder.append( "." ); } } return builder; } COM: <s> this method allow retrieving and transforming required packages </s>
funcom_train/25034308
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void remove(int index) { if (index > 0) { int n=getChildCount(); // not children.size(), to force population of children (from actual database) if not already done if (children != null && n > 0 && index < n) { MutableTreeNode child = (MutableTreeNode)(children.get(index)); if (child != null) { remove(child); } } } } COM: <s> p removes the child at index from this node </s>
funcom_train/9869155
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public List getBrowserList() { List browsers = new ArrayList(); // add Default if not present if (!unixBrowsers.containsKey(IBrowserLaunching.BROWSER_DEFAULT)) { browsers.add(IBrowserLaunching.BROWSER_DEFAULT); } browsers.addAll(unixBrowsers.keySet()); return browsers; } COM: <s> returns a list of browsers to be used for browser </s>
funcom_train/9081040
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean isMeasureValidForTheMetric(IMeasure measure) { if (validRanges != null && measure != null) { if (this.type.equals(MetricType.INTEGER) || this.type.equals(MetricType.REAL)) measure = (ContinueMeasure) measure; else measure = (DiscreteMeasure) measure; for (int i = 0; i < validRanges.size(); i++) { IRange range = validRanges.get(i); if (range.containsValue(measure)) return true; } } return false; } COM: <s> returns true if the </s>
funcom_train/18646515
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void sessionCompleted() { m_completed = true; // Removing any remaining child sessions, as they // are implicitly completed aswell synchronized(m_activeChildSessions) { java.util.Iterator<SessionImpl> iter=m_activeChildSessions.iterator(); while (iter.hasNext()) { SessionImpl child=iter.next(); child.sessionCompleted(); } m_activeChildSessions.clear(); m_childSessionsChanged = true; } } COM: <s> this method signifies that the behavioral description </s>
funcom_train/13447137
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void setModel(TreeModel model) { completeEditing(); if(treeModel != null && treeModelListener != null) treeModel.removeTreeModelListener(treeModelListener); treeModel = model; if(treeModel != null) { if(treeModelListener != null) treeModel.addTreeModelListener(treeModelListener); } if(treeState != null) { treeState.setModel(model); updateLayoutCacheExpandedNodes(); updateSize(); } } COM: <s> sets the tree model </s>
funcom_train/3928228
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void activateBehavior( BehaviorBean bb ) { int numberBehaviors = behaviors.size(); for ( int i = 0; i < numberBehaviors; i++ ) { HumanBeanBehavior hbb = (HumanBeanBehavior)behaviors.elementAt( i ); BehaviorBean test = hbb.getBehaviorBean(); if ( test == bb ) { hbb.activate(); return; } } behaviors.addElement( new HumanBeanBehavior( bb )); } COM: <s> activate a specific behavior add it if it isnt there to activate </s>
funcom_train/46601288
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void startNewGame() { //Reset all data elements guessManager.reset(); wordInput.reset(); letterDisplay.reset(); //clear all the edit controls word.setText(""); wordSoFar.setText(""); misses.setText(""); //Update the visible components in the GUI setScreenFields(true); } COM: <s> this method is used to start a new game of hang man </s>
funcom_train/17827683
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected int getMaxLineWidth(ColumnDescription column, String str) { LineIterator iter = new TruncatingLineIterator(str, -1); int maxWidth = 0; while (iter.hasNext()) { int len = iter.next().length(); if (len > maxWidth) { maxWidth = len; } } return maxWidth; } COM: <s> this is another helper method for renderers to blast through a </s>
funcom_train/31651698
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void storeResource(String collId, XMLResource resource)throws java.lang.Exception{ org.xmldb.api.base.Collection collection = getCollection( collId ); try{ collection.storeResource(resource); }catch(org.xmldb.api.base.XMLDBException ex){ SM.warning(ex);//not much else we can do here } } COM: <s> commit an xmlresource to the repository </s>
funcom_train/41446206
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String toString() { StringBuffer buf = new StringBuffer(); buf.append(locale); if (hasStrength) buf.append(":strength=").append(getStrengthString()); if (hasDecomposition) buf.append(":decomposition=").append(getDecompositionString()); return buf.toString(); } COM: <s> get a string representation for this query collator </s>
funcom_train/9275390
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void stopNetworkServer() { try { NetworkServerControlWrapper networkServer = new NetworkServerControlWrapper(); networkServer.shutdown(); if (serverOutput != null) { serverOutput.close(); } } catch(Exception e) { SQLException se = new SQLException("Error shutting down server"); se.initCause(e); } } COM: <s> stops the network server for this configuration </s>
funcom_train/29923847
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testCreateAuthorizationNullUser() { System.out.println("NullUser"); try { auth = authFact.createAuthorization(null, "Wibble"); fail(); } catch (Exception ex) { System.out.println("Exception thrown: " + ex); assertTrue("null user", true); } } COM: <s> this tests a null user </s>
funcom_train/13446267
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void calculateLongestLine() { Component c = getContainer(); font = c.getFont(); metrics = c.getFontMetrics(font); Document doc = getDocument(); Element lines = getElement(); int n = lines.getElementCount(); int maxWidth = -1; for (int i = 0; i < n; i++) { Element line = lines.getElement(i); int w = getLineWidth(line); if (w > maxWidth) { maxWidth = w; longLine = line; } } } COM: <s> iterate over the lines represented by the child elements </s>
funcom_train/48102164
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void registerLocationListener() throws Exception { // Location provider found, send a selection event. listener.adapterConnectedEvent(); // debug message debug.logDebug(this, "registerLocationListener()"); // register LocationListener provider.setLocationListener(this, -1, 0, 0); // set state isConnected = true; } COM: <s> register the location listener and read gps location data </s>
funcom_train/50220953
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void drawRectangle(TaggedGraphModelEvent e) { setDoubleBuffered(false); Graphics g = getGraphics(); Rectangle rect = (Rectangle) e.getSource(); Point org = modelToView(rect.getLocation()); Dimension extent = modelToView(rect.getSize()); g.setColor(Color.black); g.setXORMode(Color.yellow); g.drawRect(org.x, org.y, extent.width, extent.height); } COM: <s> draw or erase a rectangle on the screen </s>
funcom_train/49428569
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void setCharSequence(CharSequence text) { if(text == null) { throw new NullPointerException("text"); } this.text = text; this.cachedTextWidth = NOT_CACHED; this.numTextLines = TextUtil.countNumLines(text); this.cacheDirty = true; getAnimationState().resetAnimationTime(STATE_TEXT_CHANGED); } COM: <s> sets a new text to be displayed </s>
funcom_train/21087590
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addVersionPropertyDescriptor(Object object) { itemPropertyDescriptors.add(createItemPropertyDescriptor( ((ComposeableAdapterFactory) adapterFactory) .getRootAdapterFactory(), getResourceLocator(), getString("_UI_SNI_version_feature"), getString( "_UI_PropertyDescriptor_description", "_UI_SNI_version_feature", "_UI_SNI_type"), SNI_Package.Literals.SNI__VERSION, false, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the version feature </s>
funcom_train/25603719
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public EntityBase findById(Class<? extends EntityBase> type, String id) throws PersistenceException{ try{ log.info(String.format("Looking up entity with id %s of type %s", id, type)); return em.find(type, id); } catch (Throwable t){ throw new PersistenceException(String.format("Error looking up entity with id %s of type %s", id, type),t); } } COM: <s> find by id </s>
funcom_train/171583
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void replaceField(Field old, Field new_) { if(new_ == null) throw new ClassGenException("Replacement method must not be null"); int i = field_vec.indexOf(old); if(i < 0) field_vec.add(new_); else field_vec.set(i, new_); } COM: <s> replace given field with new one </s>
funcom_train/4916869
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testMissingManagedObject() { // Record null managed object configuration this.record_taskNameFactoryTeam(); this.recordReturn(this.configuration, this.configuration.getObjectConfiguration(), new TaskObjectConfiguration[] { null }); this.record_taskIssue("No object configuration at index 0"); this.record_NoAdministration(); this.record_NoGovernance(); // Attempt to construct task meta-data this.replayMockObjects(); this.constructRawTaskMetaData(true); this.verifyMockObjects(); } COM: <s> ensure can handle </s>
funcom_train/30005321
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void resetJTreeTable(TestSequenceLog sequence) { if (sequence != null) { this.remove(this.treeTable); this.treeTable = null; this.getTreeTable(sequence); this.setViewportView(this.getTreeTable()); } else { throw new NullPointerException("Argument 'sequence' is empty."); } } COM: <s> reset the table </s>
funcom_train/22661544
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void removeDuplicates() { List<A> tmp = new List<A>(); tmp.addAll(this); this.clear(); Iterator<A> i = tmp.iterator(); while (i.hasNext()) { A item = i.next(); if (!this.contains(item)) { this.add(item); } } } COM: <s> keeps the first occurance of an item in the list and removes </s>
funcom_train/22368277
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String getURL(final String artist, final String title) { String queryString = URL; // This provider waits for '_' instead of regular '+' for spaces in URL String formattedArtist = getStringForWikiURL(artist); String formattedTitle = getStringForWikiURL(title); queryString = queryString.replace(ARTIST_PATTERN, encodeString(formattedArtist)); queryString = queryString.replace(TITLE_PATTERN, encodeString(formattedTitle)); return queryString; } COM: <s> return the url of a audio file for lyric wiki </s>
funcom_train/31680036
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int indexOf(Object match, int start) { if (match == null) { for (int i = start; i < fEnd; i++) { if (fList.get(i) == null) { return i; } } } else { for (int i = start; i < fEnd; i++) { if (match.equals(fList.get(i))) { return i; } } } return -1; } COM: <s> returns the index of the first found object from the given start index </s>
funcom_train/72830
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void loadList(LineNumberReader lnr) throws IOException { position = -1; list = new ArrayList<String>(); String line = null; while ((line = lnr.readLine()) != null) { line = line.trim(); File file = new File(line); if (file.exists() && file.isFile()) list.add(line); } } COM: <s> loads a list from a line number reader </s>
funcom_train/20035898
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addNode(MyMenuItem item) { DefaultMutableTreeNode parent = (DefaultMutableTreeNode) this.currentTree .getSelectionPath().getLastPathComponent(); DefaultMutableTreeNode newNode = new DefaultMutableTreeNode(item .getSubmenu().get(item.getSubmenu().size() - 1)); parent.add(newNode); treeModel.reload(parent); currentTree.expandPath(new TreePath(newNode)); } COM: <s> add new children node to the node representing given item as parameter </s>
funcom_train/19745843
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addAnswerOption(AnswerOption answerOption) { if ( !answerOption.getAnswers().contains(this) ) { answerOption.getAnswers().add(this); } if ( !getAnswerOptions().contains(answerOption) ) { getAnswerOptions().add(answerOption); } } COM: <s> adds a connection between this answer option and a given option </s>
funcom_train/21619471
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setTransaction(TransactionBO transaction) throws ValidationException, PermissionException { // Make sure transaction is editable if(!this.isTransactionEditable()) { throw new PermissionException("This transaction cannot be edited."); } // Make sure it is not null if(transaction == null) { throw new ValidationException("Cannot set transaction to null."); } this.setIsDirty(true); this.transaction = transaction; } COM: <s> sets the transaction this transaction line belongs to </s>
funcom_train/2856361
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public EndPoint getFarEnd() { int nearPort = socket.getLocalPort(); if (nearPort <= 0) return null; // not yet bound int farPort = socket.getPort(); if (farPort <= 0) { return null; } else { return new EndPoint (transport, new IPAddress ( socket.getInetAddress(), farPort)); } } COM: <s> return the connections far remote end point </s>
funcom_train/40615171
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean isEvaluatable() { if (expression != null) { return expression.isEverything(ExpressionVisitor.EVALUATABLE_VISITOR); } if (expressionList != null) { for (Expression e : expressionList) { if (!e.isEverything(ExpressionVisitor.EVALUATABLE_VISITOR)) { return false; } } return true; } return expressionQuery.isEverything(ExpressionVisitor.EVALUATABLE_VISITOR); } COM: <s> check if the expression can be evaluated </s>
funcom_train/51348826
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void start() throws InterruptedException, ConfigurationException { try { innerStart(); } catch (Throwable t) { try { destroy(); } catch (Throwable t2) { log.error("Shutdown error: " + t2, t2); } // throw the startup error, not any possible shutdown error. throw new RuntimeException("Startup error: " + t, t); } } COM: <s> starts all services and connects the </s>
funcom_train/28874747
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setLabel(JLabel jLabel) { // copy the label this.jLabel[instrument]=jLabel; // test if never used before if (jIcon[instrument] != null) { // set the actual state jLabel.setIcon(jIcon[instrument]); jLabel.setToolTipText(jString[instrument]); } else { setRed(); } } COM: <s> set the label to use for semaphore </s>
funcom_train/40768809
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void saveLoginCookie() { if (cbRememberMe.isChecked()) { final long DURATION = 1000 * 60 * 60 * 24 * 14; //duration remembering login. 2 weeks in this example. Date expires = new Date(System.currentTimeMillis() + DURATION); //Cookies.setCookie("sid", getSessionID(), expires, null, "/", false); Cookies.setCookie("sid", getSessionID(), expires); } } COM: <s> save cookie if remember me is checked </s>
funcom_train/18486234
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected JPanel createButtonsPanel() { JPanel panel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); panel.add(findButton = buttonFactory.createJButton("FindButton")); panel.add(clearButton = buttonFactory.createJButton("ClearButton")); panel.add(closeButton = buttonFactory.createJButton("CloseButton")); return panel; } COM: <s> creates the buttons panel </s>
funcom_train/16651721
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void removeInstitute(Institute institute) { actionHelper.getPublicationEntity().getContributors().remove(institute); facesMessages.addFromResourceBundle(Severity.INFO, "wizard.scientist.contributors.statusmsg.remInstitute", institute.getAcronym(), StringConstants.COLON, institute.getName()); ((FindAction) Component.getInstance(FIND_ACTION, ScopeType.CONVERSATION)).find(); } COM: <s> removes an institute from the contributors list </s>
funcom_train/48097964
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void _handleRoot(PrintWriter out) { Map root = new HashMap(); root.put("card", "foo"); try { Template temp = this.ftlconfig.getTemplate("home.ftl"); try { temp.process(root, out); } catch (TemplateException e) { // TODO Auto-generated catch block e.printStackTrace(); } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } COM: <s> renders the home page template home </s>
funcom_train/51764027
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void initialise() throws MojoExecutionException { try { IPersistency persistable = getCurrentPersistency(); persistable.initializeMetricsDataBase(); } catch (ClassNotFoundException e) { throwPersistencyLoadingException(e); } catch (InstantiationException e) { throwPersistencyLoadingException(e); } catch (IllegalAccessException e) { throwPersistencyLoadingException(e); } catch (PersistencyException e) { throwPersistencyLoadingException(e); } } COM: <s> initializes the database and wraps all possibly occuring exceptions </s>
funcom_train/9577475
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public HashSet getHashSetTermsForAccession(String accession) { HashSet hs = (HashSet) AccessionToTerms.get(accession); if (hs == null || hs.size() == 0) { hs = (HashSet) (BackgroundAccessionToTerms.get(accession)); // see if in background annotation } if (hs == null) { return null; } else { return new HashSet(hs); } } COM: <s> gets the annotation for a specified accession </s>
funcom_train/46764972
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JMenu getFileMenu() { if (fileMenu == null) { fileMenu = new JMenu(); fileMenu.setText(Resources.getString("menu_file")); fileMenu.add(getGroupchatMenuItem()); fileMenu.add(getFileloadMenuItem()); fileMenu.addSeparator(); fileMenu.add(getAccountMenuItem()); fileMenu.add(getChangePasswordMenuItem()); fileMenu.add(getDeleteAccountMenuItem()); fileMenu.addSeparator(); fileMenu.add(getExitMenuItem()); } return fileMenu; } COM: <s> this method initializes j menu </s>
funcom_train/7315635
/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(); // check if servlet is defined twice if (getServletContext().getAttribute(CTX_PARAM_THIS) != null) { throw new ServletException("Only one repository startup servlet allowed per web-app."); } getServletContext().setAttribute(CTX_PARAM_THIS, this); startup(); } COM: <s> initializes the servlet </s>
funcom_train/19160005
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void recursiveAddChildren(IndexedNode root) { Enumeration enumeration = root.children(); while (enumeration.hasMoreElements()) { IndexedNode node = (IndexedNode)enumeration.nextElement(); this.recursiveAddChildren(node); } this.requirements.put(new Integer(((IndexedNode)root).getTreeIndex()), root); root.setModel(this); } COM: <s> helper method to allow recursively adding children of a node </s>
funcom_train/25066232
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addServiceErrorMessage(String entityLabel, String entityId) { MessageUtil.setServiceErrorMessage(sampleDataPanel.getSampleMetaDataTitleBox(), "Sample", entityLabel + entityId); MessageUtil.setServiceErrorMessage(siteDataPanel.getSiteMetaDataTitleBox(), "Site", entityLabel + entityId); mapPanel.setMapError(); } COM: <s> adds data retrieval error message to sample site and map panels </s>
funcom_train/17624268
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void saveToStream(OutputStream out) throws IOException { for (int i = 0; i < 4; i++) { out.write(scores >> (i * 8)); } out.write(level); out.write(difficulty); out.write(gameOver ? 1 : 0); out.write(gameType.toInt()); } COM: <s> method stores settings state to stream </s>
funcom_train/40144131
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean guess(String g) { if (!this.taken) { String guessingAt = g.toLowerCase(); this.taken = (guessingAt.equals(this.word) || this.associates .contains(g)); if(this.taken){ Edge e; Iterator<Edge> edgeIterator = neighbourList.iterator(); while(edgeIterator.hasNext()){ e = edgeIterator.next(); e.getLeftWord().guessMiddle(); e.getRightWord().guessMiddle(); } } return this.taken; } return false; } COM: <s> guess at this word </s>
funcom_train/29718726
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void copy(final WorkBreakdownElement _workBreakdownElement) { super.copy(_workBreakdownElement); this.isEvenDriven = _workBreakdownElement.getIsEvenDriven(); this.isOngoing = _workBreakdownElement.getIsOngoing(); this.isRepeatable = _workBreakdownElement.getIsRepeatable(); this.concreteWorkBreakdownElements = _workBreakdownElement .getConcreteWorkBreakdownElements(); this.predecessors.addAll(_workBreakdownElement.getPredecessors()); this.successors.addAll(_workBreakdownElement.getSuccessors()); } COM: <s> copy the values of the specified work breakdown element into the current </s>
funcom_train/17032977
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object getService(String serviceName) throws ServiceLocatorException { StringBuilder sbName = new StringBuilder("sipana/").append(serviceName); sbName.append("/local"); logger.debug("Looking for \"" + sbName + "\""); try { InitialContext context = new InitialContext(); return context.lookup(sbName.toString()); } catch (Exception e) { throw new ServiceLocatorException("Fail getting service " + serviceName, e); } } COM: <s> get a service reference based on service name </s>
funcom_train/18218184
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addGuidPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_QualityNode_guid_feature"), getString("_UI_PropertyDescriptor_description", "_UI_QualityNode_guid_feature", "_UI_QualityNode_type"), QualityModelPackage.Literals.QUALITY_NODE__GUID, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the guid feature </s>