__key__
stringlengths
16
21
__url__
stringclasses
1 value
txt
stringlengths
183
1.2k
funcom_train/18548200
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void remove(TransferObject to, Connection c) throws DataAccessException { PreparedStatement pstmt = null; try { CustomerTO cto = (CustomerTO)to; pstmt = c.prepareStatement("delete from customer where id=? and project_id=?"); pstmt.setString(1, cto.getId()); pstmt.setString(2, cto.getProject().getId()); pstmt.executeUpdate(); } catch (SQLException e) { throw new DataAccessException(e); }finally{ super.closeStatement(null, pstmt); } } COM: <s> remove a customer from data base related with project id </s>
funcom_train/19305675
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Area ancestorBlockAreaNotALineArea() { final AreaNode parent = getParent(); if (parent == null) { return null; } if (parent instanceof Area) { final Area parentArea = (Area) parent; if (parentArea.isBlockArea() && ! (parentArea instanceof LineArea)) { return parentArea; } } return parent.ancestorBlockAreaNotALineArea(); } COM: <s> returns the ancestor block area that is not a line area </s>
funcom_train/18657712
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void update(LinkedList serverListUrls) { LogUtil.entering( log ); int i = 1; Iterator it = serverListUrls.iterator(); while (it.hasNext()) { URL url = (URL) it.next(); File newServerMet = new File("server" + i + ".met"); try { getFromUrl(url, newServerMet); addAll(importServerMet(newServerMet)); i++; } catch (Exception e) { log.warning("Updating server list failed: " + e.toString()); } } } COM: <s> imports all servers from the given server list urls </s>
funcom_train/11730469
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected SessionItemStateManager createSessionItemStateManager() { SessionItemStateManager mgr = new SessionItemStateManager( context.getRootNodeId(), context.getWorkspace().getItemStateManager()); context.getWorkspace().getItemStateManager().addListener(mgr); return mgr; } COM: <s> create the session item state manager </s>
funcom_train/22960329
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public double getOutputValue() { if (myNet.inPassiveMode()) { activeMode = false; outValue = layer[layers].n[0].getOutputValue(); activeMode = true; } else outValue = layer[layers].n[0].getOutputValue(); return outValue; } COM: <s> when passive mode returns just the value stored in the output neuron </s>
funcom_train/1382318
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JTabbedPane getTabbedPlanning() { if (tabbedPlanning == null) { try { tabbedPlanning = new JTabbedPane(); tabbedPlanning.addTab("Planning giornaliero", null, getPnlPlanningGiornaliero1(), ""); // Generated tabbedPlanning.addTab("Planning Annuale", null, getJPanel(), null); // Generated } catch (java.lang.Throwable e) { // TODO: Something } } return tabbedPlanning; } COM: <s> this method initializes tabbed planning </s>
funcom_train/19434731
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void position(long position) throws IOException { // int writerpos = (int) chan.position() + buf.position(); // TODO don't always have to flush // if (position < chan.position() || position > writerpos) { flush(); chan.position(position); // } else { // buf.position(position - chan.position()); // } } COM: <s> move to a location in the file </s>
funcom_train/21882880
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void initLogger() { logger = Logger.getLogger(namespace); logger.setUseParentHandlers(false); //removeAllLogHandlers(); logger.setLevel(Level.ALL); // default log handler is a ConsoleHandler final ConsoleHandler console = new ConsoleHandler(); console.setLevel(Level.ALL); console.setFormatter(new PlainFormatter()); logger.addHandler(console); } COM: <s> initializes the logger </s>
funcom_train/43213320
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void deserialize(InputStream in) throws IOException { setVersion(RemoteUtil.readInt(in)); if (getVersion() == VERSION_ONE) { deserializeVersionOne(in); } else if (getVersion() == VERSION_TWO) { deserializeVersionTwo(in); } else { throw new IOException("Unrecognized version: " + getVersion()); } setVersion(VERSION_LATEST); } COM: <s> p sets the values of the row based on the given serialized row </s>
funcom_train/173556
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void createUIJob(){ uiJob = new WorkbenchJob(Messages.getString("MarkerView.refreshProgress")) { //$NON-NLS-1$ public IStatus runInUIThread(IProgressMonitor monitor) { updateStatusMessage(); updateTitle(); return Status.OK_STATUS; } }; uiJob.setPriority(Job.INTERACTIVE); uiJob.setSystem(true); } COM: <s> create the uijob used in the receiver for updates </s>
funcom_train/13596822
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JButton getBtnImport() { if (btnImport == null) { btnImport = new JButton(Messages .getString("GeneralUI.ButtonImport")); //$NON-NLS-1$ btnImport.setName("btnImport"); //$NON-NLS-1$ btnImport.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { importButtonActionPerformed(); } }); } return btnImport; } COM: <s> this method initializes j button2 </s>
funcom_train/33008711
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String toString() { StringBuilder sb = new StringBuilder(1000); sb.append("EventSystem :: {"); sb.append("isRunning="); sb.append(isRunning); sb.append(",\neventListeners="); synchronized (eventListeners) { sb.append(eventListeners); } sb.append(",\neventPublishers="); synchronized (eventPublishers) { sb.append(eventPublishers); } sb.append('}'); return sb.toString(); } COM: <s> returns a string representation of the object </s>
funcom_train/1627302
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void saveActionsForState(State state, List<Action> actionList, String eventType) { if (eventType.equals(EVENT_TYPE.ENTER)) { for (Action action : actionList) { state.addOnEnterAction(action); } } else if (eventType.equals(EVENT_TYPE.EXIT)) { //TODO: this event type will be only in Unimod 2. } } COM: <s> registers actions for specified state </s>
funcom_train/7891780
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Element toXml(Document document) { Element optionsResponse = DomUtil.createElement(document, XML_OPTIONS_RESPONSE, NAMESPACE); Iterator<Entry> it = entries.values().iterator(); while (it.hasNext()) { Entry entry = it.next(); Element elem = DomUtil.addChildElement(optionsResponse, entry.localName, entry.namespace); for (String href : entry.hrefs) { elem.appendChild(DomUtil.hrefToXml(href, document)); } } return optionsResponse; } COM: <s> return the xml representation </s>
funcom_train/28741542
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Integer createSampleInfo(AnimageSampleInfo info) throws SimsException { String errMsg = clsName + ".createNewSample(): "; Integer id = null; try { //Create AnimageSample and return local object. local = this.createNewSampleLocal(info); id = local.getId(); } catch (RuntimeException e) { ctx.setRollbackOnly(); //Propagate. throw e; } return id; } COM: <s> this method create a new animage sample object </s>
funcom_train/28295738
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setStateID(String iStateID) { if (_Debug) { System.out.println(" :: SeqActivity --> BEGIN - setStateID"); System.out.println(" ::--> State ID : " + iStateID); } mStateID = iStateID; if (_Debug) { System.out.println(" :: SeqActivity --> END - setStateID"); } } COM: <s> sets the id of the activitys associated persisent state </s>
funcom_train/8641250
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void showTextKerned(String text) { if (state.fontDetails == null) throw new NullPointerException("Font and size must be set before writing any text"); BaseFont bf = state.fontDetails.getBaseFont(); if (bf.hasKernPairs()) showText(getKernArray(text, bf)); else showText(text); } COM: <s> shows the code text code kerned </s>
funcom_train/3907608
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void buildChildren(VocabularyTreeNode node) { Iterator children = node.getElement().getChildren().iterator(); while(children.hasNext()) { Element child = (Element)children.next(); if(doShowNode(child)) { VocabularyTreeNode newNode = new VocabularyTreeNode(child); node.add(newNode); buildChildren(newNode); } } } COM: <s> build up child nodes </s>
funcom_train/26276824
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void updateStatusLine() { Runnable updateGuiRunnable = new Runnable() { public void run() { _setUserInteractionEnabled(_textFileEditor.shouldEditingBeEnabled()); statusTextLabel.setText(_textFileEditor.getStatusString()); } }; SwingUtilities.invokeLater(updateGuiRunnable); } COM: <s> updates the status line only </s>
funcom_train/42824491
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void handleMouseQuestionPressed(int x, int y) { int buttonIndex = (x - TBSGraphics.questionButtonsStart) / TBSGraphics.questionButtonsWidth; if (buttonIndex > 0) return; questionClicked = OpenQuestionButtonType.values()[buttonIndex]; System.out.println(questionClicked.toString()); model.viewPrompt(questionClicked); model.setSelectedElement(null); view.setAppletCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); } COM: <s> calls up a dialog box for the question selected by the user </s>
funcom_train/21982102
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void associationDidBeginEditing ( EOAssociation anAssociation ) { // System.out.println( "EODisplayGroup.associationDidBeginEditing: " + anAssociation ); if ( dataSource != null ) { if ( dataSource.editingContext() != null ) { dataSource.editingContext().setMessageHandler( this ); } } editingAssociation = anAssociation; } COM: <s> called by an association when it begins editing </s>
funcom_train/17199506
/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(); long millis = this.time; if (millis < 0) { sb.append("-"); millis = -millis; } long day = millis / this.DAYS; if (day != 0) { sb.append(day); sb.append("d."); millis = millis % this.DAYS; } sb.append(millis / this.HOURS); millis = millis % this.HOURS; sb.append("h:"); sb.append(millis / this.MINUTES); millis = millis % this.MINUTES; sb.append("m:"); sb.append(millis / this.SECONDS); sb.append("s"); millis = millis % this.SECONDS; if (millis != 0) { sb.append("."); sb.append(millis); sb.append("ms"); } return sb.toString(); } COM: <s> returns a string representation of the object in the format </s>
funcom_train/513682
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean login(String username, String password) { boolean login = false; ResultSet rs = sql("SELECT `ID` FROM `users` WHERE `username` = '" + username + "' AND `password` = '" + password + "';"); try { while (rs.next()) { login = true; } } catch (SQLException e) { System.out.println(e); } return login; } COM: <s> checks if a user can login with the specified password </s>
funcom_train/39877990
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Boolean getAsBoolean(String key) { Object value = mValues.get(key); try { return (Boolean) value; } catch (ClassCastException e) { if (value instanceof CharSequence) { return Boolean.valueOf(value.toString()); } else { Log.e(TAG, "Cannot cast value for " + key + " to a Boolean: " + value, e); return null; } } } COM: <s> gets a value and converts it to a boolean </s>
funcom_train/46753951
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addTable(int contextRefId, IPopulateList populateChildRows) { LinkedListModel link = new LinkedListModel(); link.setContextRefId(contextRefId); link.setPopulateList(populateChildRows); // link to parent list if (tables.size() > 0) { tables.get(tables.size()-1).setChildContextRefId(contextRefId); } tables.add(link); } COM: <s> add a table to the list with specified context </s>
funcom_train/1528618
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: final public void rotate(NumberValue phiValue, GeoPoint Q) { if (!initTransformPoints()) return; // calculate the new corner points for (int i=0; i < corners.length; i++) { tempPoints[i].rotate(phiValue, Q); corners[i] = tempPoints[i]; } } COM: <s> rotate this image by angle phi around q </s>
funcom_train/4136058
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addHeightPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_BoundingBox_height_feature"), getString("_UI_PropertyDescriptor_description", "_UI_BoundingBox_height_feature", "_UI_BoundingBox_type"), UtilsPackage.Literals.BOUNDING_BOX__HEIGHT, true, false, false, ItemPropertyDescriptor.REAL_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the height feature </s>
funcom_train/14093501
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testProcessElement() throws XMLException { Element save = m_fixture.newElement("save", new String[] { "file", "save.xml" }); IXMLTestCase tc = m_fixture.getTestCase(); m_tagHandler = new SaveTagHandler(save, tc); m_tagHandler.processElement(); } COM: <s> test the save </s>
funcom_train/3424806
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void ensureCapacity(int newsize) { if (data == null) { data = new int[newsize + 15]; } else if (newsize > data.length) { int newdata[] = new int[newsize + 15]; System.arraycopy(data, 0, newdata, 0, data.length); data = newdata; } } // ensureCapacity(int) COM: <s> makes sure that there is enough storage </s>
funcom_train/25049418
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private boolean hasAccepted(Collection<? extends ResourceTender> tenders, User excludedUser) { if(tenders != null) { for(ResourceTender tender: tenders) { if(excludedUser != null && excludedUser.equals(tender.getUser())) { continue; } if(tender.getAcceptDate() != null) { //Accepted tender already present => limit is exceeded return true; } } } return false; } COM: <s> returns true if the collection contains at least one accepted tender </s>
funcom_train/45692306
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addStereoCurrentPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Sample_stereoCurrent_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Sample_stereoCurrent_feature", "_UI_Sample_type"), EsxPackage.Literals.SAMPLE__STEREO_CURRENT, false, false, false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the stereo current feature </s>
funcom_train/22579438
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean setUnremoved(Attribute attrib) { String sqlString = null; sqlString = new String ("UPDATE "+A_TBL_NAME + " SET removed='false'" + " WHERE deviceID="+attrib.getDeviceID() + " AND ifIndex="+attrib.getIfIndex() + " AND oid="+attrib.getOid()); System.out.println("\nDbAttribute.setUnremoved:\n sqlString = "+sqlString); return executeUpdate(sqlString); } COM: <s> set a device interfaces specific attribute unremoved </s>
funcom_train/43098526
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addInstance(Object classifierRole, Object instance) { if (classifierRole instanceof MClassifierRole && instance instanceof MInstance) { MClassifierRole clr = (MClassifierRole) classifierRole; clr.addInstance((MInstance) instance); return; } throw new IllegalArgumentException( "classifierRole: " + classifierRole + " or instance: " + instance); } COM: <s> adds an instance to a classifier role </s>
funcom_train/26035307
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: @Override public boolean remove( Triple t ) { Object o = getIndexField( t ); TripleBunch s = bunchMap.get( o ); if (s == null || !s.contains( t )) return false; else { s.remove( t ); size -= 1; if (s.size() == 0) bunchMap.remove( o ); return true; } } COM: <s> remove code t code from this ntm </s>
funcom_train/3387741
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void releaseReadLock() { assert ! SwingUtilities.isEventDispatchThread(); Document document = textComponentToPrint.getDocument(); if (document instanceof AbstractDocument) { try { ((AbstractDocument) document).readUnlock(); needReadLock = true; } catch (Error ignore) { // readUnlock() might throw StateInvariantError } } } COM: <s> tries to release documents readlock </s>
funcom_train/3377577
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int getLenFieldSize(int len) { int retVal = 1; if (len < 128) { retVal=1; } else if (len < (1 << 8)) { retVal=2; } else if (len < (1 << 16)) { retVal=3; } else if (len < (1 << 24)) { retVal=4; } else { retVal=5; // See getMaxMechTokenSize } return retVal; } COM: <s> used to determine the number of bytes that will be need to encode </s>
funcom_train/31503626
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void save(OutputStream stream) { try { OutputStreamWriter out = new OutputStreamWriter(stream); beginToSave(out); out.close(); } catch (IOException e) { System.out.println("Error in saving the csv file"); } catch (Exception e) { System.out.println(e); e.printStackTrace(); } } COM: <s> save the project as csv on a stream </s>
funcom_train/39245339
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String asBinary(String str) { byte[] bytes = str.getBytes(); StringBuilder buf = new StringBuilder(bytes.length * 2); for (int i = 0; i < bytes.length; ++i) { buf.append(String.format("%02X", bytes[i])); } return buf.toString(); } COM: <s> turns a string into its hex equivalent </s>
funcom_train/10589111
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private boolean isIdentityInUpdatedRows(Set identitySet, List identity) { Iterator iter = identitySet.iterator(); while (iter.hasNext()) { List identityFromSet = (List)iter.next(); if (ListUtils.isEqualList(identityFromSet, identity)) { return true; } } return false; } COM: <s> tests if an identity is already contained in a set of identities </s>
funcom_train/11677118
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addEntry(String key, Entry entry) { if (entry.getType() == Entry.URL_SRC && entry.getValue() == null) { try { entry.setValue(SynapseConfigUtils.getOMElementFromURL(entry.getSrc() .toString())); localRegistry.put(key, entry); } catch (IOException e) { handleException("Can not read from source URL : " + entry.getSrc()); } } else { localRegistry.put(key, entry); } } COM: <s> define a resource to the local registry </s>
funcom_train/45130007
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public InputStream getFileInputStream(String name) { try { Object obj = paramMap.get(name); if (obj instanceof FileItem) return ((FileItem) obj).getInputStream(); else throw new WebException("Parameter is not a file type:"+name); } catch (IOException e) { throw new WebException(e); } } COM: <s> get the input stream to access an uploaded file </s>
funcom_train/22547961
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void setMojitoDHT(MojitoDHT dht) { assert (this.dht == null); dht.setMessageDispatcher(LimeMessageDispatcherImpl.class); dht.getDHTExecutorService().setThreadFactory(new ThreadFactory() { public Thread newThread(Runnable runnable) { return new ManagedThread(runnable); } }); dht.setHostFilter(new DHTFilterDelegate()); this.dht = dht; } COM: <s> sets the mojito dht instance </s>
funcom_train/9978175
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected RefactoringStatus performActionInit(RefactoringStatus retStatus, AnyChange act) { if (act != null) { if (act.init()) { changes.add(act); } else { if (act.getWarning() != null) { if (retStatus == null) retStatus = RefactoringStatus.createWarningStatus(act.getWarning()); else retStatus.addWarning(act.getWarning()); } } } return retStatus; } COM: <s> performs an action initialization </s>
funcom_train/20273165
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean canPropertyBeDefined(JSType type, String propertyName) { if (typesIndexedByProperty.containsKey(propertyName)) { for (JSType alt : typesIndexedByProperty.get(propertyName).getAlternates()) { if (!alt.getGreatestSubtype(type).isEmptyType()) { return true; } } } return false; } COM: <s> returns whether the given property can possibly be set on the given type </s>
funcom_train/7790470
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void changeFriendStatus(UserData friend, String status) { /* * It's possible that not all protocols allow us to update statuses. * Also, Twitter is "special" in that it can only be 140 characters in * length. We need to implement this checking later. */ friend.setStatus(status); super.setChanged(); super.notifyObservers(UpdatedType.BUDDY); return; } COM: <s> updates a friends status and notifies the buddy portion of the view on </s>
funcom_train/13500261
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setContext(String context) { if ( context.startsWith("/") ) { // strip leading slash context = context.substring(1); } if ( context.endsWith("/") ) { // strip trailing slash context = context.substring(0, context.length()-1); } fcrepo_context = context; } COM: <s> changes context part of the repository url </s>
funcom_train/31309306
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Vector getPreferences(String compName) { Vector prefs = new Vector(); Enumeration e = getPreferencesNames(compName).elements(); while(e.hasMoreElements()) { String name = (String)e.nextElement(); if(comps.getProperty(compName+"_"+name)!=null && comps.getProperty(compName+"_"+name).equals("1")) prefs.addElement(name); } return prefs; } COM: <s> returns the preferences for one component </s>
funcom_train/27825468
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected Iterator getNestedLoopIterator(Object[] buildTuple) throws DatalogException { for (int i=m_buildJoinIndices.length-1;i>=0;--i) m_selectionValues[i]=buildTuple[m_buildJoinIndices[i]]; return m_predicateExtension.selectTuples(m_selectionValues,m_selectionPositions); } COM: <s> returns an nested loop iterator for the given outer tuple </s>
funcom_train/12151719
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public NamedRecord getRecord(String propertyName) throws RecordStoreException, InvalidRecordIDException { int recordId = getRecordId(propertyName); if (recordId != NamedRecord.RECORD_ID_NULL) { return new NamedRecord(propertyName, recordId, _store.getRecord(recordId)); } return null; } COM: <s> finds the record matching the supplied name or returns code null code </s>
funcom_train/39181099
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void removeSession(){ if(COOKIE.containsKey("rvn_session_id")){ RVN_engine.removeSession(COOKIE.get("rvn_session_id"),RVN_host.getPrimaryHostName()); removeCookie("rvn_session_id"); SESSION=null; } } COM: <s> removes any session currently active </s>
funcom_train/22899944
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void prepWriteBuffer(String message) { try { writeBuffer.clear(); writeBuffer.put(message.getBytes()); writeBuffer.flip(); } catch (BufferOverflowException ex) { gt.printMessage("ERROR: You cant send more than 1024 characters!\r\n", IOUtils.red); } } COM: <s> prepares the buffer for the sending of the message </s>
funcom_train/39277499
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void process(int step) { switch(step) { case SPLIT_GROUPS: splitGroups(); case SPLIT_SEPARATORS: splitSeparators(); case SPLIT_COMMAS: splitCommas(); case EXTRACT_NEGATIVE: extractNegative(); case SPLIT_MULTIPLICATIONS: splitMultiplications(); case SPLIT_ADDITIONS: splitAdditions(); case PRUNE: prune(); } } COM: <s> run the process </s>
funcom_train/17640951
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void updateTitles() { String caption; if (currentFile == null) { // synthesize the "Untitled" name if no name yet. caption = "Untitled"; }else{ caption = currentFile.getName(); } // add a "*" in the caption if the file is dirty. if (archive.isDirty()) { caption += " *"; } this.setTitle("Jed - " + caption); } COM: <s> update the journal name to indicate the journal </s>
funcom_train/17711648
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JPanel getPanel_Output() { if (panel_Output == null) { GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); gridBagConstraints1.fill = GridBagConstraints.BOTH; gridBagConstraints1.gridy = 0; gridBagConstraints1.weightx = 1.0; gridBagConstraints1.weighty = 1.0; gridBagConstraints1.gridx = 0; panel_Output = new JPanel(); panel_Output.setLayout(new GridBagLayout()); panel_Output.add(getJScrollPane2(), gridBagConstraints1); } return panel_Output; } COM: <s> this method initializes panel output </s>
funcom_train/50446980
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void processData(long remainingTime) throws IOException { log.debug("Processing data for <= " + remainingTime + "ms"); int charsRead = getDataToProcess(remoteReader, endOfDataScanner, remoteInBuffer, 0, BUFSIZE, remainingTime); if (charsRead > 0) { data(remoteInBuffer, 0, charsRead); localWriter.write(remoteInBuffer, 0, charsRead); if (endOfDataScanner.foundMatch()) { endContext(); setState(STATE_RESPONSE); } } } COM: <s> reads and processes message data from the remote mta </s>
funcom_train/19064792
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setTrustManager(TrustManager tm) { try { SSLContext sslContext = SSLContext.getInstance("TLS"); sslContext.init(null, new TrustManager[] { tm }, new java.security.SecureRandom()); socketFactory = sslContext.getSocketFactory(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(System.out); } catch (KeyManagementException e) { e.printStackTrace(System.out); } } COM: <s> set the trust manager of the used sslcontext </s>
funcom_train/8526411
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getParameterizedStatement() { try { final StringWriter writer = new StringWriter(); final SQLStringGenerator sqlGen = new SQLStringGenerator(toString(), writer, getParameters()); sqlGen.parse(); return writer.toString(); } catch (Exception ex) { throw new RuntimeException(ex.toString()); } } COM: <s> return the statement including parameter values instead of </s>
funcom_train/28973787
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void saveAssignmentToDatabase() throws Exception { for (Map<String, Object> o : this.getAssigned()) { int spectraId = Integer.parseInt(o.get("spectra_id").toString()); getDiagnosticsService().diagnosticActionSuccess( spectraId, this.getClass(), "assigning matched bins", "assigning the stored spectra to the database", new Object[] { getResultHandler().getClass() .getSimpleName() }); this.getResultHandler().assignBin(o); } } COM: <s> saves the assignd peaks to the database </s>
funcom_train/18597633
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void expandTree(MetadataSchema schema, Element md) throws Exception { expandElement(schema, md); List list = md.getChildren(); for (Object aList : list) { Element child = (Element) aList; if (!Edit.NS_PREFIX.equals(child.getNamespacePrefix())) { expandTree(schema, child); } } } COM: <s> given a metadata does a recursive scan adding information for editing </s>
funcom_train/5232224
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected boolean fireCloseTab(int tabIndexToClose) { boolean closeit = true; // Guaranteed to return a non-null array Object[] listeners = listenerList.getListenerList(); for (int j = 0; j < listeners.length; j++) { Object i = listeners[j]; if (i instanceof CloseableTabbedPaneListener) { if (!((CloseableTabbedPaneListener) i).closeTab(tabIndexToClose)) { closeit = false; break; } } } return closeit; } COM: <s> notifies all listeners that have registered interest for notification on </s>
funcom_train/51668956
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException { if ("EmailVerificationSoap".equals(portName)) { setEmailVerificationSoapEndpointAddress(address); } else { // Unknown Port Name throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName); } } COM: <s> set the endpoint address for the specified port name </s>
funcom_train/17675905
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int getSubClassCount(ClassMetaData cmd) { if (cmd.pcSubclasses == null) return 0; int count = cmd.pcSubclasses.length; for (int i = 0; i < cmd.pcSubclasses.length; i++) { count += getSubClassCount(cmd.pcSubclasses[i]); } return count; } COM: <s> recursive method to calculate the total subclass count </s>
funcom_train/10757594
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testChannelLoggingoFf() throws Exception, AMQException { getConfigXml().setProperty("status-updates", "oFf"); startBrokerNow(); sendTestLogMessage(_amqpActor); List<Object> logs = _rawLogger.getLogMessages(); assertEquals("Message log size not as expected.", 0, logs.size()); } COM: <s> test that if logging is configured to be off in the configuration that </s>
funcom_train/48338252
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void validate() throws TupleException { super.validate(); if (null == ident ) { throw new InvalidTupleException("Null ident for load request (" + this + ")"); } if (null == init) { throw new InvalidTupleException("Null initializer for load request (" + this + ")"); } } COM: <s> validate this load request </s>
funcom_train/20774095
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setGroupTag(int groupTag) { // If groupTag is a negative value, give a new group tag if (groupTag < 0) { if (this.groupTag < 0) { this.groupTag = numOfGroup; numOfGroup++; } } else { this.groupTag = groupTag; } } COM: <s> sets the group tag </s>
funcom_train/14352676
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int compareTo(IEntry arg0) { if (arg0 instanceof IEntry) { IEntry e = (IEntry)arg0; int answer = getDate().compareTo(e.getDate()); if (answer!=0) return answer; answer = getTitle().compareTo(e.getTitle()); if (answer!=0) return answer; return this.hashCode()-arg0.hashCode(); } else { return this.hashCode()-arg0.hashCode(); } } COM: <s> compare notes to each other for the purpose of ordering </s>
funcom_train/45717076
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void start() { if (_model.getNumCharacters() == 0) { _model.setState(ModelState.DIED); _nextState = new GameOverState(_view, _model); setComplete(); return; } _nextState = null; _model.setState(ModelState.SCENE); _model.setCoordinates(_coordinate); _imageNum = 0; _view.setView("Main"); _model.sendMessage("You are currently in " + _localeName + "!"); _view.showImage(_images.get(_imageNum)); initialize(); } COM: <s> when the game moves into a new state start is called </s>
funcom_train/27727086
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void print(String title) { System.out.println(title + " GPS Time"); System.out.println(" GPS Week: "+this.GPS_Week); System.out.println(" GPS SOW: "+this.GPS_SOW); System.out.println(" MJD: "+this.mjd()); } COM: <s> print out the gps time </s>
funcom_train/21708569
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setKnownDeleted(int index) { /* * The target is cleared to save memory, since a known deleted entry * will never be fetched. The migrate flag is also cleared since * migration is never needed for known deleted entries either. */ super.setKnownDeleted(index); updateMemorySize(getTarget(index), null); setMigrate(index, false); super.setTarget(index, null); setDirty(true); } COM: <s> mark this entry as deleted using the delete flag </s>
funcom_train/43014748
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getLevel() { if (Section_Type.featOkTst && ((Section_Type) jcasType).casFeat_level == null) { jcasType.jcas.throwFeatMissing("level", "org.apache.uima.mediawiki.types.Section"); } return jcasType.ll_cas.ll_getIntValue(addr, ((Section_Type) jcasType).casFeatCode_level); } COM: <s> getter for level gets the level of the section the higher the deeper </s>
funcom_train/45468408
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void supportsSqlType(final int sqlType) throws MappingException { if ((sqlType != Types.INTEGER) && (sqlType != Types.NUMERIC) && (sqlType != Types.DECIMAL) && (sqlType != Types.BIGINT)) { throw new MappingException(Messages.format( "mapping.keyGenSQLType", getClass().getName(), new Integer(sqlType))); } } COM: <s> determine if the key generator supports a given sql type </s>
funcom_train/6457222
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void init() { Point middle = new Point(this.getLocation().x + this.getWidth() / 2, this.getLocation().y + this.getHeight() / 2); LoadingMessageWindow lm = new LoadingMessageWindow(mAppletLocale.getLoadingText(), middle); setupGUI(); wireEvents(); lm.dispose(); } COM: <s> init the applet </s>
funcom_train/3672018
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public OpInput createCopy() { return new OpInputCharacter(getName(), getDescription(), defaultValue, (Character)range.getMinValue(), range.isMinIncluded(), (Character)range.getMaxValue(), range.isMaxIncluded()); } COM: <s> creates a copy of this op input </s>
funcom_train/48455576
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Agent fromXML(String xml, boolean recordHistory) { xml = XMLTool.removeRootTag(xml); KeyDataVector propertiesXML = XMLTool.XMLToProperties(xml); HashMap<String, Property> properties = new HashMap<String, Property>(); for (KeyData k : propertiesXML) { Property p = Property.fromXML(k.getValue()); properties.put(p.getName(), p); } Agent agent = createAgent(properties); if (recordHistory) { agent.recordHistory(); } agent.putProperties(properties); return agent; } COM: <s> converts the xml representation of an agent to an agent instance </s>
funcom_train/1522352
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void setupSessionsTab() { final TabHost host = getTabHost(); final Uri sessionsUri = Sessions.buildSearchUri(mQuery); final Intent intent = new Intent(Intent.ACTION_VIEW, sessionsUri); intent.addCategory(Intent.CATEGORY_TAB); // Sessions content comes from reused activity host.addTab(host.newTabSpec(TAG_SESSIONS) .setIndicator(buildIndicator(R.string.search_sessions)) .setContent(intent)); } COM: <s> build and add sessions tab </s>
funcom_train/10276046
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public AbstractStringBuilder append(char str[], int offset, int len) { int newCount = count + len; if (newCount > value.length) expandCapacity(newCount); System.arraycopy(str, offset, value, count, len); Arrays.fill(taint, count, newCount, String.CLEAN); // char[] does not come with any taint. count = newCount; return this; } COM: <s> appends the string representation of a subarray of the </s>
funcom_train/36470011
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void updateValues() { myLogFileName=this.inpTrackFile.getText(); myMapDir=this.inpMapDir.getText(); if(myApp.writeOptionsFile()) return; MessageBox mbErr=new MessageBox("Error","Error writing options file :"+ myApp.OPTIONSFILENAME,MessageBox.MBOK); mbErr.execute(); return; } COM: <s> updates the applications settings from the current options values </s>
funcom_train/15726347
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void load(File file) throws FileSystemError { if (getFreeMemory() < file.getStorageRequirement()) throw FileSystemError.storageFull(file, this); if (getFiles().contains(file)) throw FileSystemError.fileExists(file); getFiles().add(file); } COM: <s> loads file into the hardware if it has </s>
funcom_train/25205358
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public PlWriter addChar(short c) { return (!octChars && ('0' <= c && c <= '9' || 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z')) ? out(" C ").out((char) c) : addOct(c); } COM: <s> prints symbolic representation of character code </s>
funcom_train/13850565
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void run() { logger.log(Level.INFO, "ClassServer started [{0}, port {1}]", new Object[]{Arrays.asList(dirs), Integer.toString(getPort())}); try { while (true) { new Task(server.accept()).start(); } } catch (IOException e) { synchronized (this) { if (verbose) { e.printStackTrace(); } if (!server.isClosed()) logger.log(Level.SEVERE, "accepting connection", e); terminate(); } } } COM: <s> just keep looping spawning a new thread for each incoming request </s>
funcom_train/11671576
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void printQuotedString(String s) { if (s == null) { fOut.print("null"); return; } fOut.print('"'); int length = s.length(); for (int i = 0; i < length; i++) { char c = s.charAt(i); normalizeAndPrint(c); } fOut.print('"'); } // printQuotedString(String) COM: <s> print quoted string </s>
funcom_train/50305978
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setQuery (String namespace, String className, Object queryObject) { debug("JabIq adding ("+namespace+", "+className+", "+ queryObject.getClass().getName()+")"); queries.add(new GenericQueryItem(namespace,className,queryObject)); } COM: <s> adds the information from a code lt query gt code tag to the </s>
funcom_train/20671782
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object getPlugin(Class className) { try{ String classValue = _pluginMap.getProperty(className.getName()); Object o = Class.forName(classValue).newInstance(); return o; }catch(Exception e){ throw new IllegalArgumentException("Unable to load plugin ["+className+"]", e); } } COM: <s> return the real plugin implementation give the plugin type </s>
funcom_train/4460294
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JTree getJTree() { if (jTree == null) { // "virtualis" gyoker letrahozasa, ez csak a JTree miatt kell m_rootNode = new DefaultMutableTreeNode("gyoker"); m_activeNode = m_rootNode; // ide fogunk beszurni treeModel = new DefaultTreeModel(m_rootNode); jTree = new JTree(treeModel); // virtualis gyokeret elrejtjuk jTree.setRootVisible(false); } return jTree; } COM: <s> this method initializes j tree </s>
funcom_train/26039528
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Literal createTypedLiteral(String lex, String typeURI) { RDFDatatype dt = TypeMapper.getInstance().getSafeTypeByName(typeURI); LiteralLabel ll = LiteralLabelFactory.createLiteralLabel( lex, "", dt ); return new LiteralImpl( Node.createLiteral(ll), this ); } COM: <s> build a typed literal from its lexical form </s>
funcom_train/35164892
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addTriangle(JOTriangle newTriangle, int groupNum, int triangleNum) { // set IDs into the triangle newTriangle.ID = triangleData.size(); newTriangle.groupID = groupNum; // store the triangle triangleData.add(newTriangle); groupFaces[groupNum][triangleNum] = newTriangle; } COM: <s> add triangle to given group </s>
funcom_train/21467351
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean login() { final String userJID = assist.getMeta(PARAM_JID, false); final String password = assist.getMeta(PARAM_PASSWORD, false); if (userJID != null) { Log.debug("Loging in..."); if ("anonymous".equals(userJID.toLowerCase())) { session.login(Session.ANONYMOUS, null); } else { final XmppURI jid = uri(userJID); session.login(jid, password); } } return userJID != null; } COM: <s> try to login with the meta parameters of the html page </s>
funcom_train/21821330
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void saveInRegistry(String path, boolean isFile) { if (!registryError) { boolean storeInReg = getBooleanValue(BeyondComparePreferencePage.STORE_REGIGSTRY_KEY); if (storeInReg) { try { BeyondCompareUtil.setStoredFileInRegistry(path, isFile); } catch (Exception e) { error("bc.error.execution.title", "bc.error.store.registry", e); registryError = true; } } } } COM: <s> saves into the registry </s>
funcom_train/4844973
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean parseFile(String INPUT_FILE_STRING) { TRAINING_FILE = new File(INPUT_FILE_STRING); if ( TRAINING_FILE.exists() ) { XVals.clear(); YVals.clear(); return attemptParse(TRAINING_FILE); } else { System.out.println("Unable to Parse file:" + INPUT_FILE_STRING); return false; } } COM: <s> parse a new file </s>
funcom_train/38299882
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void dump(PrintStream ps) { try { StringBuilder sb = new StringBuilder(); sb.append("Ontology "+name+"\n"); dump(getConceptNames(), "concept", sb); dump(getPredicateNames(), "predicate", sb); dump(getActionNames(), "action", sb); ps.println(sb.toString()); } catch(Exception e) { e.printStackTrace(); } } COM: <s> dump ontology to specified print stream </s>
funcom_train/12779969
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private MethodReference createGetterReference(CMPAttribute attr, String methodName) { String ret = StringStuff.deployment2CanonicalDescriptorTypeString(attr.getType().getJavaName()); Descriptor D = Descriptor.findOrCreateUTF8("()" + ret); Atom name = Atom.findOrCreateUnicodeAtom(methodName); MethodReference m = MethodReference.findOrCreate(klass, name, D); return m; } COM: <s> create a method reference from a container managed field attribute </s>
funcom_train/41262840
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void incrementSchoolPopularity(final Room room) { getHibernateTemplate().execute(new HibernateCallback() { public Object doInHibernate(Session session) throws HibernateException, SQLException { String hql = "update Room set popularityCounter = popularityCounter + 1 where id = :id"; int updated = session.createQuery(hql).setLong("id", room.getId()).executeUpdate(); return updated; } }); } COM: <s> batch update in hql </s>
funcom_train/26095901
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addModalFormulaPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Network_modalFormula_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Network_modalFormula_feature", "_UI_Network_type"), ArnePackage.Literals.NETWORK__MODAL_FORMULA, true, true, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, MODEL_CHECKING_GROUP, null)); } COM: <s> this adds a property descriptor for the modal formula feature </s>
funcom_train/31292530
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setTagStrategies(final Map<String, TagStrategy> values) { strategies = values; if (LOGGER.isDebugEnabled()) { for (String name : values.keySet()) { final TagStrategy strategy = values.get(name); LOGGER.debug("added tag strategy '" + strategy.getClass() + "' for tag '" + name + "'"); } } } COM: <s> adds the given tag strategies </s>
funcom_train/51294552
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Date getDate() { Integer i = (Integer) panel.model.getValueAt(panel.tableDays .getSelectedRow(), panel.tableDays.getSelectedColumn()); if (i != null) { panel.gregorianCalendar.set(Calendar.DATE, i.intValue()); return panel.gregorianCalendar.getTime(); } return null; } COM: <s> date set in the calendar </s>
funcom_train/38993265
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean isOnGrid(GridWorld gridWorld) { if (this.getX() < 0 || this.getY() < 0 || this.getX() > gridWorld.getXDimension() - 1 || this.getY() > gridWorld.getYDimension() - 1) { return false; } return true; } COM: <s> checks if this </s>
funcom_train/16140940
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void saveFile() throws IOException{ saveFile(iTunesGenreIndex); saved = true; if(System.getProperty("os.name").indexOf("Mac")!=-1) getRootPane().putClientProperty("Window.documentModified", Boolean.FALSE); } COM: <s> saves the currently opened genre list file </s>
funcom_train/19968094
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void ExportData() { try { (new File(System.getProperty("user.dir") + "\\gui")).mkdir(); String filename = System.getProperty("user.dir") + "\\gui\\GUI_slaveData.bin"; m_GUIdata = new GUIdata(this); ObjectOutputStream outStream = new ObjectOutputStream(new FileOutputStream(filename)); outStream.writeObject(m_GUIdata); outStream.flush(); outStream.close(); } catch(Exception e) {} } COM: <s> exports last used user data to gui slave data </s>
funcom_train/48581841
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Command getCmdAddExpense1() { if (cmdAddExpense1 == null) {//GEN-END:|555-getter|0|555-preInit // write pre-init user code here cmdAddExpense1 = new Command("Add Expense", Command.ITEM, 0);//GEN-LINE:|555-getter|1|555-postInit // write post-init user code here }//GEN-BEGIN:|555-getter|2| return cmdAddExpense1; } COM: <s> returns an initiliazed instance of cmd add expense1 component </s>
funcom_train/36991353
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public double variance() { double s_squared = 0; double mn = mean(); for (int row = 0; row < xSize; row++) for (int col = 0; col < ySize; col++) { double temp = m[at(row, col)] - mn; s_squared += (temp * temp); } return s_squared / (xSize * ySize); } COM: <s> compute the sample variance value of the values stored in the grid </s>