__key__
stringlengths
16
21
__url__
stringclasses
1 value
txt
stringlengths
183
1.2k
funcom_train/7660969
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testGetThreadFactory() { ThreadFactory tf = new SimpleThreadFactory(); ThreadPoolExecutor p = new ThreadPoolExecutor(1,2,LONG_DELAY_MS, TimeUnit.MILLISECONDS, new ArrayBlockingQueue<Runnable>(10), tf, new NoOpREHandler()); assertSame(tf, p.getThreadFactory()); joinPool(p); } COM: <s> get thread factory returns factory in constructor if not set </s>
funcom_train/8639057
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void mapRole(PdfName used, PdfName standard) { PdfDictionary rm = (PdfDictionary)get(PdfName.ROLEMAP); if (rm == null) { rm = new PdfDictionary(); put(PdfName.ROLEMAP, rm); } rm.put(used, standard); } COM: <s> maps the user tags to the standard tags </s>
funcom_train/3172754
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getPropertyName(String tag, boolean plural) { if (currentLocale != null) { if (plural) { String name = resources.getString(tag+".s.name", false); if (name!=null) return name; } String name = resources.getString(tag+".name", false); if (name!=null) return name; } return Gedcom.getName(tag, plural); } COM: <s> returns the readable name for the given tag </s>
funcom_train/5570497
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JTextField getJPortTextField() { if (jPortTextField == null) { jPortTextField = new JTextField(); jPortTextField.setEditable(false); // Generated jPortTextField.setText("default"); // Generated jPortTextField.setText(""); // Generated } return jPortTextField; } COM: <s> this method initializes j port text field </s>
funcom_train/26525464
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int countFiles( File root ) { int answer = 1; File[] fileList = null; if( root == null ) return 0; if( root.isDirectory() ) { fileList = root.listFiles(); for( int i = 0; i < fileList.length; i++ ) { answer += countFiles( fileList[i] ); } } return answer; } COM: <s> recursively counts the number of files under the current file </s>
funcom_train/22579484
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean setUpTime(ManagedDevice dev) { String sqlString = null; sqlString = new String ("UPDATE "+M_TBL_NAME + " SET upTime='"+dev.getSysUpTime()+"'" + " WHERE deviceID="+dev.getDeviceID()); System.out.println("\nDbManagedDevice.setUpTime:\n sqlString = "+sqlString); return executeUpdate(sqlString); } COM: <s> update a managed device records up time </s>
funcom_train/31156719
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Town findTown(String name) { Town town = null; boolean found = false; Iterator it = towns.iterator(); while (!found && it.hasNext()) { Town t = (Town)it.next(); if (t.getName().equals(name)) { town = t; found = true; } } return town; } COM: <s> find town based upon a name </s>
funcom_train/7471192
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void fetchNews(String topic) throws Exception { topic = topic.toLowerCase(); if(getCachedSources(topic)) { this.hasNews = true; return; } // Do nothing if cached xml was found else { // If not cached, retrieve original sources getLatestSources(topic); if(this.hasNews) { buildXMLDoc(); updateCache(topic); } } } COM: <s> drives the main flow of events for actually retrieving the news </s>
funcom_train/47675885
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public MMTree getSourceTree() { if (this.sourceTree == null) { try { this.sourceTree = new MMTree(MMTree.SOURCE_TYPE, this); } catch (ParserConfigurationException p_ex) { Exceptions.printStackTrace(p_ex); } } return this.sourceTree; } COM: <s> get the source message structure </s>
funcom_train/29836419
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected Rectangle2D addThickBounds(GeneralPath path, EdgeGraphicAttribute edgeAttr) { double thickness = getFrameThickness() / 2; AffineTransform at = new AffineTransform(); at.setToTranslation(thickness, thickness); Shape shape = path.createTransformedShape(at); realBounds.add(shape.getBounds2D()); at.setToTranslation(-thickness, -thickness); shape = path.createTransformedShape(at); realBounds.add(shape.getBounds2D()); return realBounds; } COM: <s> set and get bounds taking line width into account </s>
funcom_train/32055363
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Component getRendererComponent(JGraph jgraph, CellView cellview, boolean flag, boolean flag1, boolean flag2) { if((cellview instanceof PortView) && jgraph != null) { graph = jgraph; view = (PortView)cellview; //this.hasFocus = hasFocus; selected = flag; preview = flag2; return this; } else { return null; } } COM: <s> configure and return the renderer based on the passed in </s>
funcom_train/1174216
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean isValidCard(final String Restrictions[], final Player sourceController, final Card source) { if (getName().equals("Mana Pool") || isImmutable()) return false; for (int i = 0; i < Restrictions.length; i++) { if (isValid(Restrictions[i], sourceController, source)) return true; } return false; }//isValidCard COM: <s> p is valid card </s>
funcom_train/18589425
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void characters(char ch[], int start, int length) throws SAXException { if (sourceIsXML()) { // start anew if we haven't yet read any characters for this element if (in_chars == false) { chars.setLength(0); in_chars = true; } chars.append(ch, start, length); } else { super.characters(ch, start, length); } } COM: <s> receive notification of character data </s>
funcom_train/46732147
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setLocationRef(DisplayModel locationRef) { if (Converter.isDifferent(this.locationRef, locationRef)) { DisplayModel oldlocationRef= new DisplayModel(this); oldlocationRef.copyAllFrom(this.locationRef); this.locationRef.copyAllFrom(locationRef); setModified("locationRef"); firePropertyChange(String.valueOf(INTERFACETRANSACTIONS_LOCATIONREFID), oldlocationRef, locationRef); } } COM: <s> location associated with transaction </s>
funcom_train/34069764
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String getFullServerReply() throws IOException { String reply; do { reply = inputStream.readLine(); debugPrint(reply); } while (!(Character.isDigit(reply.charAt(0)) && Character.isDigit(reply.charAt(1)) && Character.isDigit(reply.charAt(2)) && reply.charAt(3) == ' ')); return reply; } COM: <s> gets server reply string from the control port after an ftp command has </s>
funcom_train/14371042
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public FactoryInstance createFactoryInstance(String id, ConfigMap properties) { LOGGER.debug("SpringFactory.createFactoryInstance"); SpringFactoryLookup lookup = new SpringFactoryLookup(this, id, properties); lookup.setSource(properties.getPropertyAsString(SOURCE, lookup.getId())); return lookup; } // end method createFactoryInstance() COM: <s> this method is called when we initialize the definition of an instance </s>
funcom_train/12775558
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void eagerConstruction() { if (DEBUG_LAZY) { Assertions.UNREACHABLE(); } // Assertions.UNREACHABLE(); if (!eagerComputed) { eagerComputed = true; computeAllPDGs(); for (PDG pdg : pdgMap.values()) { addPDGStatementNodes(pdg.getCallGraphNode()); } } } COM: <s> force eager construction of the entire sdg </s>
funcom_train/18195582
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int compareTo(ReadableUser o) { int result; if (this.surname.equals(o.getSurname())) { result = this.forename.compareTo(o.getForename()); } else { result = this.surname.compareTo(o.getSurname()); } return result; } COM: <s> compare lexicographically by surename </s>
funcom_train/27678547
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean getNextBoolean() { if (checkbox==null) return false; Checkbox cb = (Checkbox)(checkbox.elementAt(cbIndex)); if (Recorder.record) recordCheckboxOption(cb); boolean state = cb.getState(); if (macro) { String label = (String)labels.get((Object)cb); String key = Macro.trimKey(label); state = macroOptions.indexOf(key+" ")>=0; //IJ.write("getNextBoolean: "+label+" "+state); } cbIndex++; return state; } COM: <s> returns the state of the next checkbox </s>
funcom_train/44118387
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getLastChar() { Iterator i = _characterSets.values().iterator(); if (i.hasNext()) { CharacterSet csm = (CharacterSet) i.next(); return csm.getLastChar(); } else { String msg = "getLastChar() - No character set found for font:" + _name + " weight:" + _weight + " style:" + _style; LOGGER.error(msg); throw new FontRuntimeException(msg); } } COM: <s> get the last character in this font </s>
funcom_train/40519967
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean removeWSDLFile(String filename) throws RemoteException { //WSDLHandler handler = (WSDLHandler) ServerConfiguration.getDefaultAPI (WSDLHandler.class); RemoveWSDLFile message = new RemoveWSDLFile(filename); message.accept(handler); if (message.errorThrown()) { throw new RemoteException("removeWSDLFile failed on server side", new RegistryException(message.getErrors())); } return ((Boolean) message.getResult()).booleanValue(); } COM: <s> remove a wsdl file from the repository </s>
funcom_train/45018344
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addAddressPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_NXuser_address_feature"), getString("_UI_PropertyDescriptor_description", "_UI_NXuser_address_feature", "_UI_NXuser_type"), NexusPackageImpl.Literals.NXUSER__ADDRESS, true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the address feature </s>
funcom_train/42253407
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected InputStream render(String contextPath, CacheEntry cacheEntry) throws IOException, ServletException { InputStream xsltInputStream = findXsltInputStream(cacheEntry.context); if (xsltInputStream == null) { return renderHtml(contextPath, cacheEntry); } else { return renderXml(contextPath, cacheEntry, xsltInputStream); } } COM: <s> decide which way to render </s>
funcom_train/20080374
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void sort(int index, int direction) { if (isRendered()) { BaseEvent be = new BaseEvent(); be.index = index; be.size = direction; if (fireEvent(Events.SortChange, be)) { getTableHeader().sort(index, direction); getView().sort(index, direction); } } } COM: <s> sorts the table using the specified column index </s>
funcom_train/43244844
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testReleaseLock() throws Exception { System.out.println("releaseLock"); String lockId = ""; EOServerStatusImpl instance = new EOServerStatusImpl(); boolean expResult = true; boolean result = instance.releaseLock(lockId); 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 release lock method of class org </s>
funcom_train/802656
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addIdPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_SupDataType_id_feature"), getString("_UI_PropertyDescriptor_description", "_UI_SupDataType_id_feature", "_UI_SupDataType_type"), MzdataPackage.Literals.SUP_DATA_TYPE__ID, true, false, false, ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the id feature </s>
funcom_train/16786514
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setFooter(String responsibleId, String displayName, ReddotDate updated) throws RQLException { Page page = getPage(); page.startSetElementValues(); page.addSetStandardFieldTextValue(getParameter("respIdTmpltElemName"), responsibleId); page.addSetStandardFieldTextValue(getParameter("respNameTmpltElemName"), displayName); page.addSetStandardFieldDateValue(getParameter("pageUpdatedTmpltElemName"), updated); page.endSetElementValues(); } COM: <s> sets the responsible information for given domain option list value </s>
funcom_train/33776044
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: /*protected void center(Component parent, Component comp) { Dimension cSize = comp.getSize(); // .getPreferredSize(); Dimension fSize = parent.getSize(); Point loc = parent.getLocation(); comp.setLocation((fSize.width - cSize.width) / 2 + loc.x, (fSize.height - cSize.height) / 2 + loc.y); }*/ COM: <s> not needed see method java </s>
funcom_train/17054025
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public TextField getTxtMyId() { if (txtMyId == null) { // write pre-init user code here txtMyId = new TextField("Entre com seu numero de telefone:", null, 32, TextField.PHONENUMBER); // write post-init user code here } return txtMyId; } COM: <s> returns an initiliazed instance of txt my id component </s>
funcom_train/32034943
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private SourceCode setPackage(String p) { if (pkg != null) throw new IllegalStateException(_loc.get("pkg-set", pkg.name, p) .toString()); if (isEmpty(p)) return this; if (!isValidPackageName(p)) throw new IllegalArgumentException(_loc.get("invalid-pkg", p) .toString()); this.pkg = new Package(p); return this; } COM: <s> set a package statement </s>
funcom_train/13427546
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testInvalidGraph(){ IGraph goodGraph = DirectedGraphTestData.createGoodGraph(); boolean exceptionCaught = false; try { this.fixture = new NearestNeighborHeuristic( goodGraph ); this.fixture.verifyAndInitialiseAlgo(); this.fixture.execute(); System.out.println( this.fixture ); } catch (AlgorithmException e) { exceptionCaught = true; //e.printStackTrace(); } catch (GraphVerifierrException e) { exceptionCaught = true; //e.printStackTrace(); } assertTrue( exceptionCaught ); } COM: <s> tests a graph that is not complete </s>
funcom_train/20308534
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addDescription( Model configSpec, Resource base ) { if (m_configuration != null) { StmtIterator i = m_configuration.listProperties(); while (i.hasNext()) { Statement st = i.nextStatement(); configSpec.add(base, st.getPredicate(), st.getObject()); } } } COM: <s> p add this reasoners description to the given configuration model </s>
funcom_train/37401081
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Displayable getDisplayable(Element element) { DisplayableClass c = (DisplayableClass) classes.get(element.getTagName()); if (c == null) { System.err.println("No DisplayableClass found for '"+element.getTagName()+"'."); return null; } return c.getDisplayable(element); } COM: <s> creates a displayable for a given element </s>
funcom_train/37434726
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public List getAttributeValueList(String attributeName) { final String value = getAttributeValueString(attributeName); final StringTokenizer tokenizer = new StringTokenizer(value, LIST_SEPARATOR); final List list = new Vector(tokenizer.countTokens()); while (tokenizer.hasMoreTokens()) { list.add(tokenizer.nextToken()); } return list; } COM: <s> returns the attribute value which must be a space seperated list as a </s>
funcom_train/45253996
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getName() { if (isRestored() && getInput() != null) { return getInput().getName(); } else if (memento != null) { String name = memento.getString(IWorkbenchConstants.TAG_NAME); if (name != null) { return name; } } return ""; //$NON-NLS-1$ } COM: <s> returns the name of this item either from the input if restored </s>
funcom_train/7428183
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void fillRect(final double x, final double y, final double width, final double height) { TEMP_RECT.setRect(x, y, width, height); SWTShapeManager.transform(TEMP_RECT, transform); SWTShapeManager.awtToSWT(TEMP_RECT, SWT_RECT); gc.fillRectangle(SWT_RECT); } COM: <s> fills the specified rectangle </s>
funcom_train/37139225
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public long countPackets() throws IOException { PacketIterator<? extends CapturePacket> i = getPacketIterator(); long count = 0; long old = 0; while (i.hasNext()) { old = i.getPosition(); i.skip(); if (old == i.getPosition()) { throw new IOException("0 length record at [" + old + "]. Unable to advance to the next record."); } count++; } return count; } COM: <s> counts all packets very fast using record channel reader parser </s>
funcom_train/7659622
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean offer(E o) { if (o == null) throw new NullPointerException(); final ReentrantLock lock = this.lock; lock.lock(); try { if (count == items.length) return false; else { insert(o); return true; } } finally { lock.unlock(); } } COM: <s> inserts the specified element at the tail of this queue if possible </s>
funcom_train/29985633
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void readCRLF () throws IOException { int cr = read (); int lf = read (); if (cr != 13 && lf != 10) // well could check for '\r' and '\n' but the spec say it should be 13 and 10!. throw new IOException ("Could not read CRLF correctly: " + cr + ", " + lf); } COM: <s> read of an cr lf combination </s>
funcom_train/7745792
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void updateNextKey(long newMaxId) { PreparedStatement stmt = null; try { stmt = conn.prepareStatement(updateNextKeyStatement()); stmt.setLong(1, newMaxId); stmt.executeUpdate(); conn.commit(); maxId = newMaxId; } catch (SQLException e) { throw new ApplicationException("Filed preparing statement: " + stmt); } finally { try { stmt.close(); }catch (SQLException e) { throw new ApplicationException("Failed cleanning up statement."); } } } COM: <s> update the next key with the new max id available </s>
funcom_train/10907118
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void writeTf(String fontName, double fontSize) { checkInTextObject(); write("/" + fontName + " " + PDFNumber.doubleOut(fontSize) + " Tf\n"); this.startText = useMultiByte ? "<" : "("; this.endText = useMultiByte ? ">" : ")"; } COM: <s> writes a tf command setting a new current font </s>
funcom_train/43101633
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setNamespace(Object handle, Object ns) { if (handle instanceof MModelElement && (ns == null || ns instanceof MNamespace)) { ((MModelElement) handle).setNamespace((MNamespace) ns); return; } throw new IllegalArgumentException("handle: " + handle + " or ns: " + ns); } COM: <s> sets a namespace of some modelelement </s>
funcom_train/12075719
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void doLayout() { if (layout!=null) { layout.layoutPanel(this); } else { for(int i = 0; i < components.size(); i++) { Component component = (Component)components.elementAt(i); if (component instanceof Panel) { ((Panel)component).doLayout(); } } } } COM: <s> redo the layout </s>
funcom_train/3338191
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected Alias getAlias(String alias) throws NoSuchAliasException { final Alias a = (Alias) aliases.get(alias); if (a != null) { return a; } else if (parent != null) { return parent.getAlias(alias); } else { throw new NoSuchAliasException(alias); } } COM: <s> gets the alias with the given name </s>
funcom_train/4512301
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void updateTreasure(ActorAddress actorAddress){ for(Treasures ta:this.getTreasures()){ if(ta.getActorAddress() == null){ int index = this.getTreasures().indexOf(ta); ta.setActorAddress(actorAddress); this.getTreasures().set(index, ta); // replace the old ta with new one at the same index break; } } } COM: <s> updating the treasure with actor address when it is initialized </s>
funcom_train/22277978
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: //- protected void drawAllDirtyViews() { //- int i, count; //- RootView rView; //- //- count = rootViews.count(); //- for (i = 0; i < count; i++) { //- rView = (RootView)rootViews.elementAt(i); //- rView.drawDirtyViews(); //- rView._updateCursorAndMoveView(); //- } //- } COM: <s> this method is called by internal window and external window </s>
funcom_train/7982190
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void ensureMinIdle() throws Exception { // this method isn't synchronized so the // calculateDeficit is done at the beginning // as a loop limit and a second time inside the loop // to stop when another thread already returned the // needed objects int objectDeficit = calculateDeficit(); for ( int j = 0 ; j < objectDeficit && calculateDeficit() > 0 ; j++ ) { addObject(); } } COM: <s> check to see if we are below our minimum number of objects </s>
funcom_train/12563817
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int timeToFrame(long mediaTime) { int frame = 0; long elapsedTime = 0; for (int i = 0; i < frameTimes.size(); i++) { long interval = ((Long)frameTimes.elementAt(i)).longValue(); elapsedTime += interval; if (elapsedTime <= mediaTime) frame++; else break; } return frame; } COM: <s> maps media time to the corresponding frame </s>
funcom_train/40334522
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int send(String username, String password){ assert invariant(); this.username = username; this.password = password; int answer = 0; try{ answer = rs.authenticate(username, password); } catch(RemoteException e){ ErrorMessage em = new ErrorMessage("Error while trying to log on.", "Transmission error", "Sender"); client.reportError(em); e.printStackTrace(); } assert invariant(); return answer; } COM: <s> send an authentication request to the server </s>
funcom_train/44626190
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean mkdirs() { if (exists()) { return false; } if (mkdir()) { return true; } File canonFile = null; try { canonFile = getCanonicalFile(); } catch (IOException e) { return false; } String parent = canonFile.getParent(); return (parent != null) && (new File(parent, fs.prefixLength(parent)).mkdirs() && canonFile.mkdir()); } COM: <s> creates the directory named by this abstract pathname including any </s>
funcom_train/44871620
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JMenuItem createNewMenuItem() { JMenuItem newMenuItem = new JMenuItem(); Action newAction = new NewAction(); newMenuItem.setAction(newAction); gfIm.put(KeyStroke.getKeyStroke(KeyEvent.VK_N, MENU_MASK), "new"); gfAm.put("new", newAction); return newMenuItem; } COM: <s> this method initializes new menu item </s>
funcom_train/2929468
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int skipInitialWhitespace() throws IOException { int count = 0; mark(1); int readByte = read(); while ((readByte != -1) && Character.isWhitespace((char) readByte)) { count++; mark(1); readByte = read(); } // go back to marked position; the last read char was no whitespace reset(); return count; } COM: <s> skips leading whitespaces from the inner input stream </s>
funcom_train/3581922
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void fillRoundRect (int x, int y, int width, int height, int arcWidth, int arcHeight) { emitThis ("%fillRoundRect"); doRoundRect (x,y,width,height,arcWidth,arcHeight, true); } COM: <s> draws a rounded rectangle filled in with the current color </s>
funcom_train/31079190
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Class getType() { Object value = getValue(); if (value == null) return null; Class type = value.getClass(); if (type == Integer.class) return int.class; if (type == Float.class) return float.class; if (type == Double.class) return double.class; if (type == Long.class) return long.class; return String.class; } COM: <s> return the type of constant this attribute represents string </s>
funcom_train/11651685
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void saveConnectionCookies(HttpMethod method, URL u, CookieManager cookieManager) { if (cookieManager != null) { Header hdr[] = method.getResponseHeaders(HEADER_SET_COOKIE); for (int i = 0; i < hdr.length; i++) { cookieManager.addCookieFromHeader(hdr[i].getValue(),u); } } } COM: <s> from the code http method code store all the set cookie key pair </s>
funcom_train/18024836
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (isDataFlavorSupported(flavor)) { if (flavor.equals(DataFlavor.stringFlavor)) { throw new UnsupportedFlavorException(flavor); } else { return component; } } else { throw new UnsupportedFlavorException(flavor); } } COM: <s> returns an object which represents the data to be transferred </s>
funcom_train/42069751
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void updateData(String data) { if (data.equals("")) { data = "No data available."; } else if (data.indexOf("data:images/jpeg") != -1) { insertImage(data); } tabPanel.remove(1); tabPanel.add(new HTML("<p>" + data + "</p>"), "Data"); tabPanel.selectTab(1); } COM: <s> updates the data tab </s>
funcom_train/14421777
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void select(final int[] indices) { assertEnabled(); assertMultiSelect(); if (log.isDebugEnabled()) log.debug(new StringBuffer("Selecting rows ").append(StringUtils.join(indices, ", ")).append(" in table ").append(widget)); unselect(); for (int i = 0; i < indices.length; i++) additionalSelectAndNotify(indices[i]); } COM: <s> selects the given index items </s>
funcom_train/38414824
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void waitForConnection(long timeout) { long t0 = System.currentTimeMillis(); synchronized( connectionLock ) { do{ long now = System.currentTimeMillis(); if( connection==null && timeout>(now-t0) ) try{ connectionLock.wait(timeout-(now-t0)); }catch(Exception e ) {} else return; } while( true ); } } COM: <s> to wait timeout max for the connection to be established </s>
funcom_train/4613703
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void takeReading() { synchronized (acc) { try { accel[0] = acc.getAccelX(); accel[1] = acc.getAccelY(); accel[2] = acc.getAccelZ(); time = System.currentTimeMillis(); } catch (IOException ex) { ex.printStackTrace(); } } } COM: <s> creates a new instance of shake reading </s>
funcom_train/1151279
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void runAdaptiveSD(Vector<DataPoint> xvec, int i1, int i2, double eps, double gradEps) { if (!(this instanceof TruncatedGradient)) throw new UnsupportedOperationException("Only TG can emulate SD"); createMissingBlocks(); for(LearnerBlock block: blocks) { block.dis.ensureCommitted(); block.validateExamples(xvec, i1,i2); (( TruncatedGradient.TruncatedGradientLearnerBlock)block).runAdaptiveSD(xvec, i1, i2, eps, gradEps); } } COM: <s> runs steepest descent a batch method with adaptive </s>
funcom_train/29830110
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void sortNodes() { root.removeAllChildren(); TreeMap tmpMap = (TreeMap) items.clone(); while (!tmpMap.isEmpty()) { Object o = tmpMap.firstKey(); root.add((BSNickNode)items.get(o)); tmpMap.remove(o); } } COM: <s> sorts nodes in tree </s>
funcom_train/941721
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean isIndexed(final int sri) throws IndexException { boolean result = false; try { if (IndexReader.indexExists(directory)) { IndexReader reader = IndexReader.open(directory); // Check whether the index contains an entry for the SRI result = reader.docFreq(new Term(SRI_FIELD, "" + sri)) > 0; reader.close(); } } catch (IOException ex) { logger.debug("Failed to open index.", ex); throw new IndexException("Unable to read index.", ex); } return result; } COM: <s> checks whether the metadata object for the specified simple repository </s>
funcom_train/41730405
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String toString() { StringBuffer sb = new StringBuffer(); sb.append("(list->monomial "); for (int i=0; i<values.length; i++) { if (i!=0) { sb.append(' '); } sb.append(values[i]); } sb.append(')'); return sb.toString(); } COM: <s> creates a string representation vector format of the monomial </s>
funcom_train/45247479
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public JNumberFloatField getJNumberFloatFieldRelacaoGTR() { if (jNumberFloatFieldRelacaoGTR == null) { jNumberFloatFieldRelacaoGTR = new JNumberFloatField(); jNumberFloatFieldRelacaoGTR.setLocation(new Point(345, 90)); jNumberFloatFieldRelacaoGTR.setFont(new Font("Arial", Font.PLAIN, 12)); jNumberFloatFieldRelacaoGTR.setSize(new Dimension(65, 20)); } return jNumberFloatFieldRelacaoGTR; } COM: <s> this method initializes j number float field relacao gtr </s>
funcom_train/20334116
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean equals(Object obj) { if (obj instanceof Robot) { Robot cmp=(Robot)obj; if (getHasLocation()!=cmp.getHasLocation() && (getHasLocation()==null || !getHasLocation().equals(cmp.getHasLocation())) ) return false; if (getInstanceName()!=cmp.getInstanceName() && (getInstanceName()==null || !getInstanceName().equals(cmp.getInstanceName())) ) return false; return true; } return false; } COM: <s> test the equality of this code robot code </s>
funcom_train/13889973
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected String strip(String str, char skip_begin, char skip_end) { StringBuffer sb = new StringBuffer(); char[] ca = str.toCharArray(); boolean skip = false; for (int i=0;i<ca.length;i++) { if (ca[i] == skip_begin) { skip = true; } if (!skip) { sb.append(ca[i]); } if (ca[i] == skip_end) { skip = false; } } return sb.toString(); } COM: <s> traverses a string and removes characters within </s>
funcom_train/48455693
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addMapMarker(AgentViewable av, int zindex) { String loc = av.get(Agent.LOCATION); if (loc.isEmpty()) { return; } LocationProperty lp = new LocationProperty("", loc); if (lp.isNull()) { return; } addMapMarker(lp.getLatitude(), lp.getLongitude(), av.get(Agent.LABEL), av.getMapMarkerImage(), av.getID(), zindex, av.get(Agent.TYPE)); } COM: <s> adds javascript which adds a marker for a certain agent to the map </s>
funcom_train/26313505
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getChoice() { int retval = -1; // Did the player make any selection? int[] choices = super.getChoices(); if (null != choices && choices.length > 0) { // Which checkbox was selected? retval = choices[0]; } return retval; } // End public int getChoice() COM: <s> which choice did the user select </s>
funcom_train/16519759
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addConstraint(String opId, SDFAbstractVertex vertex) { Set<ConstraintGroup> cgSet = getOpConstraintGroups(opId); if (cgSet.isEmpty()) { ConstraintGroup cg = new ConstraintGroup(); cg.addOperatorId(opId); cg.addVertexPath(vertex.getInfo()); constraintgroups.add(cg); } else { ((ConstraintGroup) cgSet.toArray()[0]).addVertexPath(vertex .getInfo()); } } COM: <s> adding a simple constraint on one vertex and one operator </s>
funcom_train/28749558
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setTypeid(String newVal) { if ((newVal != null && this.typeid != null && (newVal.compareTo(this.typeid) == 0)) || (newVal == null && this.typeid == null && typeid_is_initialized)) { return; } this.typeid = newVal; typeid_is_modified = true; typeid_is_initialized = true; } COM: <s> setter method for typeid </s>
funcom_train/51104338
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected ServerSession createServerSession() { HttpSession httpSession = getSession(true); DataChannel channel = createChannel(); RemoteSession remoteSession = createRemoteSession( httpSession.getId(), null, false); ServerSession serverSession = new ServerSession(remoteSession, channel); httpSession.setAttribute(SESSION_ATTRIBUTE, serverSession); return serverSession; } COM: <s> creates a new server session with a dedicated data channel </s>
funcom_train/4874624
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public JcvMat sub(JcvMat mat) throws MatrixOutOfBoundsException { JcvMat ret = new JcvMat(numRows, numCols, numChannels); for (int i=0; i<data.length; ++i) { ret.data[i] = data[i] - mat.data[i]; } return ret; } COM: <s> matrix matrix subtraction </s>
funcom_train/8073339
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected boolean add(CharSequence s, int start) { if (s.length() == start) { if (isWord) return (false); isWord = true; return (true); } Character c = s.charAt(start); if (children.get(c) == null) children.put(c, new Trie(this)); return (children.get(c).add(s, start + 1)); } COM: <s> adds a sequence starting from start position </s>
funcom_train/37615660
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void reportInteractions() { System.out.println("Schedule for projects"); Iterator iter; for(iter = interactionList.iterator(); iter.hasNext();) { System.out.print(((InteractionRecord) iter.next()).toString()); } } // writeSchedule COM: <s> writes out interaction list created earlier by </s>
funcom_train/12587646
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ItemLabel buildItemLabel(LabelType labelType, LabelProperty labelName) { ItemLabel itemLabel = new ItemLabel(); itemLabel.setIdentity(labelType.getIdentity()); itemLabel.setLabelProperty(labelName); QCodeType role = labelType.getRole(); if (role != null) { itemLabel.setRole(role); } itemLabel.setLang(labelType.getLang()); itemLabel.setDir(labelType.getDir()); itemLabel.setValue(labelType.getValue()); return itemLabel; } COM: <s> build item label object from nar label type object </s>
funcom_train/43036351
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void destruct() { stream = null; try { socket.input.close(); socket.output.close(); socket.socket.close(); } catch (Exception e) { } socket.input = null; socket.output = null; socket.socket = null; socket = null; absX = absY = mapRegionX = mapRegionY = -1; } COM: <s> prepare player for removal </s>
funcom_train/20508356
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private boolean iAmWritingOnMyPage(HttpServletRequest request) throws ServletRequestBindingException { String myname = AuthHelper.getUsername(); //subsitiute '_' for ' ' because of the wiki username convention (a hack) myname = StringUtils.replace(myname, " ", "_"); String theirname = getUsername(request); if (null == myname) { return false; } else { return myname.equals(theirname); } } COM: <s> determine whether i am writing on my own page </s>
funcom_train/21356583
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Collection getInstitutions() { Collection toReturn; try { toReturn = InstitutionsSingleton.getInstance().getInstitutions(); } catch (Exception e) { logger.error("An Exception has been thrown by the RegistrationForm.getInstitutions() method:", e); throw new IllegalStateException(); } if (toReturn == null) { toReturn = Collections.EMPTY_LIST; } return toReturn; } COM: <s> returns a complete list of the institutions currently in the database </s>
funcom_train/3987385
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void cursor() { // maybe should always set here? seems dangerous, since // it's likely that java will set the cursor to something // else on its own, and the applet will be stuck b/c bagel // thinks that the cursor is set to one particular thing if (!cursorVisible) { cursorVisible = true; setCursor(Cursor.getPredefinedCursor(cursorType)); } } COM: <s> show the cursor after no cursor was called </s>
funcom_train/130150
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setPosition (int xP, int yP, int zP) { setPosition (xP, yP, zP, this.pitch, this.roll, this.yaw, this.xSpeed, this.ySpeed, this.zSpeed, this.pitchSpeed, this.rollSpeed, this.yawSpeed, (byte)1, (byte)1); } COM: <s> send position commands </s>
funcom_train/39167692
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private boolean hasOriginalContentFeatures() { FeatureMap features = getFeatures(); boolean result = false; result = (features .get(GateConstants.ORIGINAL_DOCUMENT_CONTENT_FEATURE_NAME) != null) && (features .get(GateConstants.DOCUMENT_REPOSITIONING_INFO_FEATURE_NAME) != null); return result; } // hasOriginalContentFeatures COM: <s> return true only if the document has features for original content and </s>
funcom_train/31824605
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Rectangle getClientArea () { checkWidget (); forceResize (); RECT rect = new RECT (); int scrolledHandle = scrolledHandle (); OS.GetClientRect (scrolledHandle, rect); int x = rect.left, y = rect.top; int width = rect.right - rect.left; int height = rect.bottom - rect.top; if (scrolledHandle != handle) { OS.GetClientRect (handle, rect); OS.MapWindowPoints(handle, scrolledHandle, rect, 2); x = -rect.left; y = -rect.top; } return new Rectangle (x, y, width, height); } COM: <s> returns a rectangle which describes the area of the </s>
funcom_train/36764446
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int offsetCorrection2(String hex_code, String start_of_program_offset, int correction){ return new LoadMap().correctionInt(hex_code)-Integer.parseInt(start_of_program_offset,16)+correction; //return Integer.parseInt(hex_code,16)-Integer.parseInt(start_of_program_offset,16)+correction; } COM: <s> this function is used to correct offset for type c </s>
funcom_train/12385062
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int writeTrailer( OutputStream os, int pos ) throws IOException { final StringBuilder sb = new StringBuilder(200); sb.append("trailer\r"); sb.append("<<\r"); sb.append("/Size " + this.objects.size() + "\r"); sb.append("/Root 1 0 R\r"); sb.append(">>\r"); sb.append("startxref\r"); sb.append(pos); sb.append("\r"); sb.append("%%EOF\r"); final byte[] bytes = sb.toString().getBytes(); os.write( bytes ); return pos; } COM: <s> writes pdf trailer to the stream </s>
funcom_train/2023771
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void addTargets() { int i; // nothing selected? if (listAvailableTargets.getSelectedIndex() == -1) return; for (i = 0; i < listAvailableTargets.getSelectedValues().length; i++) getListModel(listChosenTargets).addElement( listAvailableTargets.getSelectedValues()[i]); } COM: <s> adds the selected targets to the chosen list </s>
funcom_train/22009600
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getImageFromDB(int id) throws Exception { SpyDB db=new SpyDB(conf); PreparedStatement pst=db.prepareStatement( "select data from image_store where id = ?\n" + " order by line"); pst.setInt(1, id); ResultSet rs=pst.executeQuery(); StringBuffer sb=new StringBuffer(); while(rs.next()) { sb.append(rs.getString("data")); } rs.close(); db.close(); return(sb.toString()); } COM: <s> get an image from db </s>
funcom_train/32360364
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void select(int index) { comboQuestion.select(index); Message currentMessage = null; if (inButton.getSelection()) currentMessage = inputMessage; else currentMessage = outputMessage; if (currentMessage != null) { String[] partDescription = currentMessage.getPartDescription(getSelComboItem().split(" ")[0]); if (partDescription[1] != null) getTextDesc().setText(partDescription[1]); else getTextDesc().setText(""); } } COM: <s> selects an item of the comboquestion an refreshes the description </s>
funcom_train/2951155
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void validateView(java.util.List items) { if (items == null) { return; } for (int i = 0; i < items.size(); i++) { TableItem item = (TableItem) items.get(i); if (item instanceof ExpandableTableItem && ((ExpandableTableItem) item).isExpanded()) { java.util.List view = ((ExpandableTableItem) item).getView(); items.addAll(i + 1, view); i += view.size(); } } } COM: <s> equal to group table item </s>
funcom_train/9344669
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int findBMU(double inputVector[]) { int bmu = 0; double minDist = 1 << 28; double dist; for (int i = 0; i < lattice.length; i++) { for (int j = 0; j < lattice[i].length; j++) { dist = lattice[i][j].dist(inputVector); if (minDist > dist) { minDist = dist; bmu = i * lattice.length + j; } } } return bmu; } COM: <s> retrieves bmu position in the kohonen layer </s>
funcom_train/4224527
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void characters(char[] ch, int start, int len) throws SAXException { String elementValue = new String(ch, start, len); if (elementValue.equalsIgnoreCase("") || elementValue.equalsIgnoreCase("\n")) { return; } currentElement.setElementValue(elementValue); } COM: <s> getting the value for xml element </s>
funcom_train/37447512
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public GraphData getGraphData(Integer id, IntactUserI user) { GraphData graphData = (GraphData) cache.getObject(id); // no data available for the given id if (graphData == null) { GraphBuildData data = new GraphBuildData(user, id); //logger.warn("cache has " + cache.size()); // the id is pushed into the incoming stack incoming.push(data); // because its no data available yet null is returned return null; } // the graphdata for the given id is returned return graphData; } COM: <s> called by the client to retrieve a graphdata object for the given id </s>
funcom_train/37818436
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void removeLastTableEntry(int position) { view.getTablePanel().getTableModel().removeLastRow(); if (drawAddon) { showRange(); view.getTablePanel().setStep( "Latest step: " + (position + 1) + " "); fireUpdateEvent(new UpdateEvent<Integer>(currentMc .getProgramCounter().get())); showDescription(currentMc.getProgramCounter().get()); } } COM: <s> removes the last line in the table </s>
funcom_train/26379940
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String toFileString() { if (_type == 'G' || _type == 'R') { return _type + " " + _extra + " " + _args[0] + " " + _args[1] ; } else { return _type + " " + _extra + " " + _args[0] + " " + _args[1] + " " + _args[2]; } } COM: <s> gets the reset as a string in mud format </s>
funcom_train/3473731
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addAccelerators() { EnhancedHashtable<String, String> keyStrokesMap = customization.getMap( "KeyStrokes", new EnhancedHashtable<String, String>()); for (String keyStroke : keyStrokesMap.keySet()) { cleverPHL.getMainFrame().getCleverPHLMenuBar() .setAccelerator(keyStrokesMap.get(keyStroke), KeyStroke.getKeyStroke(keyStroke)); } } COM: <s> adds the accelerator keys to the menu </s>
funcom_train/26086058
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void createColumns(final Table table, final DataSet dataset, TableColumnLayout layout) { int i = 0; List<String> headings = dataset.getHeadings(); for (String text : headings) { TableColumn column = new TableColumn(table, SWT.NONE); column.setMoveable(true); column.setText(text); column.pack(); // computes the weight for each column based on the total number of // columns and sets the columndata in the layout accordingly int weight = Math.round((100 / headings.size())); layout.setColumnData(column, new ColumnWeightData(weight)); i++; } } COM: <s> creates all columns in this table </s>
funcom_train/5445164
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getNameAndType_Name(int Index) { if ((Index < 1) || (Index >= ItemType.length) || (ItemType[Index] != CONSTANT_NAME_AND_TYPE)) throw new ClassFormatError("Constant pool item does not exist"); return getUtf8(((Integer)ItemValue1[Index]).intValue()); } COM: <s> get the name from a name and type constant </s>
funcom_train/27823275
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void visit(AddPropertyInstance event) throws KAONException { PropertyInstance propertyInstance=event.getPropertyInstance(); loadEntity(propertyInstance.getProperty()); loadEntity(propertyInstance.getSourceInstance()); if (propertyInstance.getTargetValue() instanceof Instance) loadEntity((Instance)propertyInstance.getTargetValue()); } COM: <s> visits an event for adding a property instance </s>
funcom_train/14378384
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setFloor(float height, Texture texture, Rectangle3D texBounds) { if (texture != null && texBounds == null) { texBounds = new Rectangle3D(new Vector3D(0, height, 0), new Vector3D(1, 0, 0), new Vector3D(0, 0, -1), texture.getWidth(), texture.getHeight()); } floor = new HorizontalAreaDef(height, texture, texBounds); } COM: <s> sets the floor height floor texture and floor texture bounds of this </s>
funcom_train/46732468
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setLocationRef(DisplayModel locationRef) { if (Converter.isDifferent(this.locationRef, locationRef)) { DisplayModel oldlocationRef= new DisplayModel(this); oldlocationRef.copyAllFrom(this.locationRef); this.locationRef.copyAllFrom(locationRef); setModified("locationRef"); firePropertyChange(String.valueOf(INTERFACEMESSAGES_LOCATIONREFID), oldlocationRef, locationRef); } } COM: <s> location associated with message </s>