__key__
stringlengths
16
21
__url__
stringclasses
1 value
txt
stringlengths
183
1.2k
funcom_train/31873530
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ReferenceTable fieldTable() { ReferenceTable result; if (this.extendsLink == null) result = this.fieldTable.append(new ReferenceTable(null, null, null)); else result = this.fieldTable.append(this.extendsLink.fieldTable()); return result; } COM: <s> return a list of fields from this class and its </s>
funcom_train/32711759
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public double meanSquaredError(double[] output) { double soma = 0; for (int x = 0; x < output.length; x++) soma += (output[x] - getLayer(this.layers.size() - 1).getNeuron(x).output) * (output[x] - getLayer(this.layers.size() - 1) .getNeuron(x).output); return soma / 2; } COM: <s> returns the mse mean squared error </s>
funcom_train/44819920
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected List getDataListByService() throws ApplicationException { Object service = getService(); if (service == null ) { return null; } if (service instanceof IDataListProvider) { return ((IDataListProvider) service).getDataList(); } if (Environment.getEntityManager() == null) { return null; } List dataList = Environment.getEntityManager().findAll(service); return dataList; } COM: <s> get data list by service </s>
funcom_train/46744516
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setUserRef(DisplayModel userRef) { if (Converter.isDifferent(this.userRef, userRef)) { DisplayModel olduserRef= new DisplayModel(this); olduserRef.copyAllFrom(this.userRef); this.userRef.copyAllFrom(userRef); setModified("userRef"); firePropertyChange(String.valueOf(VISITUSERS_USERREFID), olduserRef, userRef); } } COM: <s> provider for this visit </s>
funcom_train/24523525
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void loadSettings() { try { FileInputStream fileInputStream = new FileInputStream(file.getAbsolutePath()); configFile.load(fileInputStream); } catch (IOException e) { System.err.println("ERROR: Unable to read config file!"); System.err.println("The file " + file.getAbsolutePath() + " couldn't be read!"); System.err.println("PoA will shutdown!"); System.err.println("STACK TRACE:"); e.printStackTrace(); System.exit(0); } } COM: <s> loads the settings from poa </s>
funcom_train/42660275
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected boolean fireOnBeforeClearEvent() { if (this.onBeforeClearEvent != null) { ActionEventBefore_1x0<Table<R,C,V>> actionBefore = new ActionEventBefore_1x0<Table<R,C,V>>(this, 0, CM_BEFORE_CLEAR, this); this.onBeforeClearEvent.fire(actionBefore); return actionBefore.isCanceled(); } return false; } COM: <s> fires on before clear event </s>
funcom_train/31906986
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void fireManagerResumedEvent() { Object[] dll = listeners.toArray(); if (dll.length > 0) { UpdateManagerEvent ev = new UpdateManagerEvent(this, null, null); for (int i = 0; i < dll.length; i++) { ((UpdateManagerListener)dll[i]).managerResumed(ev); } } } COM: <s> fires a update manager event to notify that the manager was resumed </s>
funcom_train/24920298
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void compile() throws MIKEYException { log.trace(""); if (compiled) throw new MIKEYExceptionMessageContent("BUG: trying to compile already compiled message."); rawData = new byte[rawMessageLength()]; int pos = 0; for (Iterator<MIKEYPayload> iter = payloads.iterator(); iter.hasNext();) { MIKEYPayload mp = iter.next(); int len = mp.length(); mp.writeData(rawData, pos, len); pos += len; } } COM: <s> compiles the assembled payloads br </s>
funcom_train/12159331
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testInlineStyleMatcherFails() { MatcherContextMock matcherContextMock = new MatcherContextMock( "MatcherContext", expectations); matcherContextMock.expects.getElementId().returns(1); InlineStyleMatcher matcher = new InlineStyleMatcher(10); MatcherResult matcherResult = matcher.matchesWithinContext(matcherContextMock); assertEquals("MatcherResult should be FAILED", MatcherResult.FAILED, matcherResult); } COM: <s> test the inline style matcher fails to match on elements with different </s>
funcom_train/43096823
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean contains(Object elem) { if (objects.contains(elem)) { return true; } if (elem instanceof Collection) { Iterator it = ((Collection) elem).iterator(); while (it.hasNext()) { if (!objects.contains(it.next())) { return false; } } return true; } return false; } COM: <s> returns true if some object elem is contained by the list of choices </s>
funcom_train/34479216
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected int pTestByIndex(int index) throws SdaiException { // synchronized (syncObject) { int value = getCurrentSelectionNrByIndex(index); if (value < 0) { String base = SdaiSession.line_separator + "Failed to get select path number"; throw new SdaiException(SdaiException.SY_ERR, base); } return value; // } // syncObject } COM: <s> returns select path number for the aggregate element specified by the index </s>
funcom_train/3026990
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object visit(ASTInterfaceBody node, Object data) { // Convert the data into the correct form SummaryLoaderState state = (SummaryLoaderState) data; if (state.getCode() == SummaryLoaderState.IGNORE) { return super.visit(node, data); } int start = getLineCount() + 1; int oldCode = state.getCode(); state.setCode(SummaryLoaderState.LOAD_CLASSBODY); super.visit(node, data); state.setCode(oldCode); return data; } COM: <s> visit the body of an interface </s>
funcom_train/22402166
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void sendIndexList( OutputStream output) { PrintWriter out = new PrintWriter( output); String [] indexations = indexator.listIndex(); if( indexations != null) { for( int i=0; i<indexations.length;++i) { out.println( indexations[i]); } } out.close(); } COM: <s> sends the list of indexation through the output stream </s>
funcom_train/29864397
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void analyze(File file) throws BuildException { if(file.getName().endsWith(".class")) { analyzeClass(file); } else if(file.getName().endsWith(".java")) { analyzeJava(file); } else { // Just ignore all other files } } COM: <s> analyze a file by checking its suffix and delegate to </s>
funcom_train/11745013
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ClassLoader getClassLoader() { ClassLoader loader = this.classLoader; if (loader == null) { loader = Thread.currentThread().getContextClassLoader(); } if (loader == null) { loader = getClass().getClassLoader(); } if (loader == null) { loader = ClassLoader.getSystemClassLoader(); } return loader; } COM: <s> returns the class loader associated with this resource locator </s>
funcom_train/45692226
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addNumberOfSampleFramesPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Sample_numberOfSampleFrames_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Sample_numberOfSampleFrames_feature", "_UI_Sample_type"), EsxPackage.Literals.SAMPLE__NUMBER_OF_SAMPLE_FRAMES, false, false, false, ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the number of sample frames feature </s>
funcom_train/46492793
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void returnException(Exception e, QueryData ignoreMe) { boolean needToRespond = false; synchronized (lock) { if (!answered) { answered = true; needToRespond = true; } } if (needToRespond) { // Stop the timer! cancelTimer(); returnException(listener, responseQueue, e, id); } } COM: <s> throw an exception to the listener </s>
funcom_train/7851053
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void pushKey(Key key) { if (key == null) { System.out.println("push null key"); return; } int i; for (i = keyTop; i > 0; i--) { if (key.rank > keyStack[i-1].rank) keyStack[i] = keyStack[i-1]; else break; } keyStack[i] = key; keyTop++; } COM: <s> push a key in the stack </s>
funcom_train/4194720
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void onDlgSubscribe(NotifierDialog dialog, NameAddress target, NameAddress subscriber, String event, String id, Message msg) { printLog("onDlgSubscribe()",LogLevel.MEDIUM); notifier_dialog.pending(); listener.onPaSubscriptionRequest(this,target,subscriber); } COM: <s> when an incoming subscribe is received </s>
funcom_train/50485816
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean userExists(String userName) throws SQLException { // Get the user info from the database Connection conn = dataSource.getConnection(); Row userRow = null; try { userRow = getUserPropertiesFromEmail(userName, conn); } finally { try { conn.close(); } catch (SQLException e) { } // Ignore } return (userRow != null); } COM: <s> returns true if the user was found in the database false </s>
funcom_train/3524209
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testSetupBoundaryNull() throws Exception { TestHttpServletRequest request = new TestHttpServletRequest(); request.setContentType(null); HttpMultiPartServletRequest parser = new HttpMultiPartServletRequest(request); try { parser.setupBoundary(); fail("Expected Servlet Exception"); } catch (MultiPartRequestContentException ex) { assertEquals("Unknown Content Type", ex.getMessage()); } } COM: <s> test for boundary detection and setup with null content type or boundary </s>
funcom_train/571541
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void sort( int column, boolean ascending ) { ts.sortByColumn( column, ascending ); buildTable( ts ); StringBuffer sb = new StringBuffer( ); for ( int i = 0; i < getTableSorterIndexes( ).length; i++ ) { sb.append( " " + getTableSorterIndexes( )[ i ] ); } System.out.println( "indexes" + sb.toString( ) ); } COM: <s> this method was created in visual age </s>
funcom_train/48498235
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int selectIssue_idByCreateTimestamp (Date timestamp) { int id = -1; SelectIssueQuery issueQuery = new SelectIssueQuery (super.getDataSource(), selectIssueByCreateSql, 1); List result = issueQuery.execute (new Object[] {timestamp}); if (result != null && result.size() == 1) { IssueDetailDTO issue = (IssueDetailDTO)result.get(0); id = issue.getIssue_id(); } return id; } COM: <s> given the create timestamp of an issue whats its id </s>
funcom_train/38385193
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void expungeMatchesOutsideSelection() { int selFrom = fEditor.getSelectionStart(); int selTo = fEditor.getSelectionEnd(); int from, to; Entry e; Iterator iter = fMatches.iterator(); while (iter.hasNext()) { e = (Entry) iter.next(); from = getRealPosition(e.fLine, e.fDetails.getStart(0)); to = getRealPosition(e.fLine, e.fDetails.getEnd(0)); if (from < selFrom || to > selTo) { iter.remove(); } } } COM: <s> expunges all entries in f matches which are not within the current selection </s>
funcom_train/15832386
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void copyFrom(Object obj) { SampleModule sm = (SampleModule) obj; setBar(sm.getBar()); List foos = new ArrayList(sm.getFoos()); // this is enough for the copy because the list elements are inmutable (Strings) setFoos(foos); setDate((Date)sm.getDate().clone()); } COM: <s> copies all the properties of the given bean into this one </s>
funcom_train/26292053
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String createContact(String contactName, String contactDescription) { try { if (contactHome == null) contactHome = (ContactLH) loadLocalHome(ContactEJB.LocalREF); ContactLO contact = contactHome.create(contactName, contactDescription); return contact.getId(); } catch (Exception ex) { throw new EJBException(ex.getMessage()); } } COM: <s> contact business methods </s>
funcom_train/7982357
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getText() { StringBuffer textBuffer = new StringBuffer(""); // if the document is null if (doc == null) { return null; } //recursively traverse the DOM tree to find the text traverseText(doc, textBuffer, 0); return textBuffer.toString().trim(); } COM: <s> get text from the given xml html </s>
funcom_train/34341411
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public TextField getCodigoVendedor() { if (CodigoVendedor == null) {//GEN-END:|22-getter|0|22-preInit // write pre-init user code here CodigoVendedor = new TextField("CodigoVendedor", null, 5, TextField.NUMERIC);//GEN-LINE:|22-getter|1|22-postInit // write post-init user code here }//GEN-BEGIN:|22-getter|2| return CodigoVendedor; } COM: <s> returns an initiliazed instance of codigo vendedor component </s>
funcom_train/9886580
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void runScript(ScriptDocument scriptDoc) { Script script = getScriptObjectForDocument(scriptDoc); if(script == null) return; ScriptRunner runner = new ScriptRunner(script, actionManager, framework); runner.setOutputMode(ScriptConstants.SCRIPT_OUTPUT_MODE_INTERNAL_OUTPUT); runner.execute(); } COM: <s> runs the script contained in the script document </s>
funcom_train/12115211
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setStateKeeper(CWGridStateKeeper stateKeeper){ this.stateKeeper = stateKeeper; for(List<Cell> list:cells){ for(Cell c:list){ c.setStateKeeper(stateKeeper); } } for(Slot s:hSlots){ s.setStateKeeper(stateKeeper); } for(Slot s:vSlots){ s.setStateKeeper(stateKeeper); } } COM: <s> subscribes state keeper to the cells in this greed </s>
funcom_train/3370982
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel) { if (this.autoCreateColumnsFromModel != autoCreateColumnsFromModel) { boolean old = this.autoCreateColumnsFromModel; this.autoCreateColumnsFromModel = autoCreateColumnsFromModel; if (autoCreateColumnsFromModel) { createDefaultColumnsFromModel(); } firePropertyChange("autoCreateColumnsFromModel", old, autoCreateColumnsFromModel); } } COM: <s> sets this tables code auto create columns from model code flag </s>
funcom_train/13994417
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void initContentPane(HelpContent content) { JTextPane textPane = content.getTextPane(); JScrollPane scrollpane = new JScrollPane(textPane); textPane.setPreferredSize(new Dimension(200, 400)); textPane.setEditable(false); scrollpane.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, SystemColor.controlShadow)); setComponent(scrollpane); } COM: <s> initializes the content pane </s>
funcom_train/10212554
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void parse(String[] args) { try { this.parser.parseArgument(args); } catch (CmdLineException e) { System.err.println(e.getMessage()); System.out.println("Required Parameters: "); System.out.println(this.parser.printExample(ExampleMode.REQUIRED)); System.out.println(); this.printHelpAndExit(); } } COM: <s> invoking this method will parse the given string array for command line </s>
funcom_train/24121931
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void pushState(final Object stateId) { logger.log(Level.FINER, "push state " + stateId); //$NON-NLS-1$ // pause current state if (!states.empty()) { states.peek().pause(); } // store and init the new state State state = registeredStates.get(stateId); states.push(state); state.enter(); } COM: <s> push the given state onto the stack </s>
funcom_train/12528298
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int read(byte[] buffer, int offset, int count) throws IOException { // have to have four comparisions to not miss integer overflow cases if (count > buffer.length - offset || count < 0 || offset < 0) { throw new IndexOutOfBoundsException(); } if (0 == count) { return 0; } openCheck(); synchronized (repositionLock) { return fd.readBytes(buffer, offset, count); } } COM: <s> reads at most </s>
funcom_train/25702249
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void createWorldEntityX3DNode (Entity worldEntity) { Transform transform = (Transform)mainScene.createNode("Transform"); MFNode children = (MFNode) transform.getField("children"); generateX3D(worldEntity.getEntityID(), children, mainScene); mainScene.addRootNode(transform); worldEntityX3DNode = transform; } COM: <s> find the x3 dnode corresponding to the world entity </s>
funcom_train/3721468
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Group getGroup(String namePattern, int rep) throws HL7Exception { Structure s = getStructure(namePattern, rep); if (!Group.class.isAssignableFrom(s.getClass())) { throw new HL7Exception(s.getName() + " is not a group", HL7Exception.APPLICATION_INTERNAL_ERROR); } return (Group) s; } COM: <s> as get segment but will only return a group </s>
funcom_train/37008440
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected IDBID allocateID(String opname) throws RDFRDBException { try { ResultSetIterator it = m_sql.runSQLQuery(opname, new Object[] {}); if (it.hasNext()) { return wrapDBID(it.getSingleton()); } else { throw new RDFRDBException("Failed to allocate ID"); } } catch (SQLException e) { throw new RDFRDBException("Internal sql error", e); } } COM: <s> general id allocate stub </s>
funcom_train/39886827
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int codePointCount(int beginIndex, int endIndex) { if (beginIndex < 0 || endIndex > count || beginIndex > endIndex) { throw new StringIndexOutOfBoundsException(); } return Character.codePointCount(value, offset + beginIndex, endIndex - beginIndex); } COM: <s> calculates the number of unicode code points between </s>
funcom_train/27805241
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void delete(String sessionId, IPaperBid bid) { if(sec.getUserKind(sessionId) == UserKind.PCMember){ try { ConnectSQL.update("DELETE from paper_bids WHERE id_paper = "+bid.getPaperId()+" AND id_login = "+bid.getExpertId()+";"); } catch (Exception e) { System.err.println("Error - Delete from conflicts"); } } } COM: <s> removes the desired paper bid from the db </s>
funcom_train/48991005
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void countdown() { if(count>0) { this.currentRequest.setAttribute(origName, flashValue); } else if(count==0) {// DeadLine! // 如果专门为FlashScope创建了Session,销毁它 if(createSession) { session.invalidate(); } else {// 已存在的Session session.removeAttribute(origName);// 删除session中的value session.removeAttribute(idInSession);// 然后删除自己 } } count--; } COM: <s> flash scope value 2 request session flash </s>
funcom_train/10588448
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected Application getApplication(final String appName) { final Application app = (Application) WebAppContextUtils.getCurrentWebApplicationContext().getBean(Application.class.getName() + '/' + appName); if ( !this.applications.containsKey(appName) ) { this.applications.put(appName, app); } return app; } COM: <s> return the application with the name </s>
funcom_train/4015166
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private TreeItem addImageItem(TreeItem root, String title,ImageResource imageProto, Object userObj,String helpText) { TreeItem item = new CompositeTreeItem(new TreeItemWidget(imageProto, title,popup,this)); item.setUserObject(userObj); item.setTitle(helpText); if(root != null) root.addItem(item); else tree.addItem(item); return item; } COM: <s> a helper method to simplify adding tree items that have attached images </s>
funcom_train/38828180
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void writeObject( java.io.ObjectOutputStream out ) throws java.io.IOException { // Call the default write object method. out.defaultWriteObject(); // Write out the matrix values. for (int i=0; i < 4; ++i) for (int j=0; j < 4; ++j) out.writeDouble(_data.get(i,j).doubleValue()); } COM: <s> during serialization this will write out the float64 matrix as a </s>
funcom_train/7997871
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testInvalidUrl() { WebSpiderExample webSpider = new WebSpiderExample("http://hello"); try { webSpider.getNumLinks(); fail("Illegal URL did not generate exception."); } catch (Exception e) { // shouldn't get here. System.out.println("testInvalidUrl caught the following exception: " + e); } } COM: <s> tests get num links method with an invalid url </s>
funcom_train/12687244
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void buildEmptyKeystore(String name, char[] storePassword, char[] keyPassword) throws Exception { this.startPasswordEncryption(storePassword, keyPassword); keyStore = KeyStore.getInstance(keyStoreType); this.keyStoreName = name; keyStore.load(null, storePassword); rehashKeystoreEntries(); } COM: <s> generate an empty keystore </s>
funcom_train/12279556
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public MenuItem getChild(String id) { if (children != null) { for (Iterator i = children.iterator(); i.hasNext();) { MenuItem it = (MenuItem) i.next(); if (it.getId().equals(id)) { return it; } } } return null; } COM: <s> get a child menu item given its name </s>
funcom_train/8358082
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public float getAdaptiveRatio() { final int copy[] = new int[adaptiveMemorySize]; System.arraycopy(adaptiveResults, 0, copy, 0, adaptiveMemorySize); int positives = 0; for (final int element : copy) { if (element == 1) { positives++; } } // log.info("Positives: " + positives + "; Total: " + // adaptiveMemorySize); return new Float(positives).floatValue() / new Float(adaptiveMemorySize).floatValue(); } COM: <s> calculates the adaptive hit rate for this cache </s>
funcom_train/14271626
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void fldCRONSchedule_validate(FacesContext context, UIComponent component, Object value) { if (value == null) { return; } if (value instanceof String) { try { CronExpression c = new CronExpression((String)value); } catch (ParseException pe) { throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, WRONG_MESSAGE_ID, pe.getMessage()), pe); } } } COM: <s> validator that checks the validity of the given cron expression </s>
funcom_train/41016335
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void invalidateShortname(final int[] addressIds) { TransactionBody tb = new TransactionBody() { public void trx() throws SQLException { for (int i = 0; i < addressIds.length; i++) { dbUtil.updateAndBringBack("update address set shortname=null where id=?", addressIds[i]); } } }; transaction(tb); } COM: <s> update the short access fields in table message for the specified address </s>
funcom_train/28662082
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setUp() throws Exception { xml = Utils.parse(new File(XMLSecurityToolsCoreTestPlugin.getTestFileLocation("resources/FirstSteps.xml"))); idXml = Utils.parse(new File(XMLSecurityToolsCoreTestPlugin.getTestFileLocation("resources/ids.xml"))); } COM: <s> set up method </s>
funcom_train/8022162
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testGetCategory() { System.out.println("getCategory"); int category_id = 0; Category expResult = null; Category result = CategoryManager.getCategory(category_id); assertEquals(expResult, result); // TODO review the generated test code and remove the default call to fail. //fail("The test case is a prototype."); } COM: <s> test of get category method of class vgrabber </s>
funcom_train/38827653
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public KnotVector reverse() { FastTable<Float64> values = FastTable.newInstance(); for (int i=length()-1; i >= 0; --i) values.add(Float64.ONE.minus(get(i))); // values.add(1.0 - getValue(i)); KnotVector kv = KnotVector.newInstance(getDegree(), Float64Vector.valueOf(values)); FastTable.recycle(values); return kv; } COM: <s> return a copy of this knot vector with the parameterization reversed </s>
funcom_train/23998597
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int checkIncreaseDexterity() { PlayerProfile prof = Storage.get().getActiveProfile(); int dexterity = prof.getDexterity(); int needhoney = 0; switch ( dexterity ) { case 0: needhoney = 50; break; case 1: needhoney = 100; break; case 2: needhoney = 150; break; case 3: needhoney = 250; break; case 4: needhoney = 350; break; default: needhoney = -1; } return needhoney; } COM: <s> get amount of needed honey to increase dexterity attribute </s>
funcom_train/5345252
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void toStringR(final StringBuffer buffer, Node h, long bitIndex) { if (h.bitIndex <= bitIndex) { buffer.append(" ").append(h).append("\n"); return; } toStringR(buffer, h.left, h.bitIndex); toStringR(buffer, h.right, h.bitIndex); } COM: <s> the actual implementation of to string </s>
funcom_train/1560150
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void updateTraceGeoList(){ GeoElement selectedGeo = (GeoElement) traceGeoList.getSelectedValue(); traceGeoList.removeListSelectionListener(this); traceGeoListModel.clear(); for(GeoElement geo: traceManager.getTraceGeoList()){ traceGeoListModel.addElement(geo); } if(selectedGeo != null && traceGeoListModel.contains(selectedGeo)) traceGeoList.setSelectedValue(selectedGeo, true); traceGeoList.addListSelectionListener(this); } COM: <s> update the trace geo list with current trace geos </s>
funcom_train/50909649
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testAddingItem() { try { assertTrue("Character already has items.", character.getItems().size()==0); character.addItem(item); assertTrue("No item added.", character.getItems().size()==1); } catch (Exception e) { fail("Exception thrown"); } } COM: <s> test adding item to players inventory </s>
funcom_train/37083866
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void commitChanges(CurationSet curation, boolean wantTabular) { logger.debug("Committing data now to " + getInput()); File out = new File (getInput()); if (wantTabular) saveTabular(curation, out); else GenbankReport.save(curation, out); } COM: <s> write gen bank report in tabular or human readable format as requested </s>
funcom_train/43902905
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void rollback() throws IOException { try { // TODO: does conneciton rollback clear warnings? connection.rollback(); } catch (SQLException e) { // TODO: between a rock and a rock // I am not sure how a rollback can fail, but we managed it // since the correct response is to rollback the Transaciton // we will continue on throw new DataSourceException("Transaction rollback", e); } } COM: <s> rollback state of transacstion </s>
funcom_train/5733347
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void processSingleDescriptor(ElementInfo info, Element descriptor) { String name = descriptor.getName(); if (name.equals(CHOICE_TAG)) { validateChoice(info, descriptor); } else if (name.equals(ATTR_TAG)) { validateAttribute(info, descriptor); } else { logger.logError(MessageManager.invalidAttributeTag, name); } } COM: <s> using the descriptor the processing is passed to either the validate attribute </s>
funcom_train/31877875
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Vector getSuccessfulReplies() { Vector ret = new Vector(); Enumeration e = replies.elements(); while (e.hasMoreElements()) { RPCCommand com = (RPCCommand)e.nextElement(); try { if (com.getMetaInformation().getReturnStatus()==MetaInformation.STATUS_OK) { MList result = (MList)com.getParameters()[0]; if (result.getSymbol(0).equals("OK")) ret.addElement(com); } } catch (Exception ee) { ee.printStackTrace(); } } return ret; } COM: <s> return the replies that have been successful </s>
funcom_train/29949599
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public MergeWithPrevious (IDOMText textElement) { this.textElement = textElement; for (IDOMNode i = textElement; null != i; i = (IDOMNode) i.getParentNode ()) { if (null != DOM.getPreviousSignificantSibling (i)) { this.mergeParent = i; break; } } if (null != this.mergeParent) { this.destinationNode = DOM.getPreviousSignificantSibling (this.mergeParent); } } COM: <s> attempts to discover the merge parent </s>
funcom_train/9937849
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public long skip(long n) throws IOException { if (n <= 0) { return (0); } if (n > Integer.MAX_VALUE) { n = Integer.MAX_VALUE; } int total = 0; while (total < n) { int len = (int) n - total; if (len > skipBuffer.length) { len = skipBuffer.length; } len = read(skipBuffer, 0, len); if (len == -1) { break; } else { crc.update(skipBuffer, 0, len); } total += len; } entryCount -= total; return (total); } COM: <s> returns 0 after eof has reached for the input stream otherwise always </s>
funcom_train/15884767
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void loadClassBytes(String className) throws IOException { PrintMessageLoadedClass("loadClassBytes : " + className); PrintMessageLoadedClass("Reading data of class " + className.replace('.', System.getProperty("file.separator") .charAt(0)) + ".class"); byte[] result = ClassBytesLoader.loadClassBytes(className); addClassBytes(className, result); } COM: <s> retrieve the byte code for a class from the local file system </s>
funcom_train/47516386
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected boolean validateExistence(CurveGroup group){ String generalFileName = group.getFilename(); boolean error = false; errorString = null; //reset error string. // Check file existence. for(String number : group.getParsedNumbers()){ String fileName = generalFileName.replace("$",number); File checkFile = new File(fileName); if(fileName.endsWith("NPAIRSJresult.mat")){ //Check that validation did not fail. if(!validateMatFile(group, checkFile)){ error = true; } } else{ if(!validateCCPPFile(group,fileName)){ error = true; } } } return !error; } COM: <s> validate that the necessary files for this curve exist </s>
funcom_train/50909623
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void attackWithWeapon(BaseCharacter target, IWeapon weapon) { try { Combat.attack(model.getPlayerCharacter(), target, weapon); model.actionCompleted(); } catch (Exception e) { logger.severe("Attacking with weapon failed. Message: " + e.getMessage()); //todo: error handling } } COM: <s> attacks target using currently wielded weapon </s>
funcom_train/7421734
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String getBindSenderTo(Activity receivingActivity) { // get associations from receiving activity to // participant reference data object List<Association> associations = this.diagram.getAssociationsWithSource( receivingActivity.getId(), Association.DIRECTION_FROM, ParticipantReferenceDataObject.class); if (!associations.isEmpty()) { return ((ParticipantReferenceDataObject)associations.get(0) .getTarget()).getName(); } return null; } COM: <s> determines the name of a participant reference the sender of the message </s>
funcom_train/10865688
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testOneWordQuery() throws Exception { final String input = "monster"; MockTokenizer wt = new MockTokenizer(new StringReader(input), MockTokenizer.WHITESPACE, false); CommonGramsFilter cgf = new CommonGramsFilter(TEST_VERSION_CURRENT, wt, commonWords); TokenFilter nsf = new CommonGramsQueryFilter(cgf); assertTokenStreamContents(nsf, new String[] { "monster" }); } COM: <s> test common grams query filter in the case of a single word query </s>
funcom_train/49996050
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String convertUriToEmail(String member) { if (member.startsWith("http:")) { int lastSlash = member.lastIndexOf('/'); if (lastSlash < 0) { throw new IllegalArgumentException("Could not convert owner to URI"); } return member.substring(lastSlash + 1); } // Otherwise owner is already the email. return member; } COM: <s> converts a project member string to an email address </s>
funcom_train/41344938
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void startMapGeneratorThread() { this.mapGenerator = new CanvasRenderer(); ((DatabaseMapGenerator) this.mapGenerator) .setDatabase(this.mapDatabase); if (this.attachedToWindow) { this.mapGenerator.onAttachedToWindow(); } this.mapGenerator.setTileCaches(this.tileRAMCache, this.tileMemoryCardCache); this.mapGenerator.setMapView(this); this.mapGenerator.start(); } COM: <s> creates and starts the map generator thread </s>
funcom_train/42130462
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void checkWriteXmlDeclaration() { checkNotFinished(); if (!canWriteXmlDeclaration) { throw new IllegalStateException( "An XML declaration must be the first item in a document"); } if (xmlDeclarationWritten) { throw new IllegalStateException( "A document can only have one XML declaration"); } } COM: <s> check that it is valid to write an xml declaration </s>
funcom_train/19654418
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Component initTable() { Object[][] values = {}; table = new JTable(values, columnNames); //table.setPreferredScrollableViewportSize(new Dimension(600, 70)); table.setFillsViewportHeight(true); changeColumnLengths(); JScrollPane scrollPane = new JScrollPane(table); return scrollPane; } COM: <s> initialization of table is called during startup of gui program </s>
funcom_train/39967384
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public float square() { int ns = getSampleCount(); int nc = getChannelCount(); float sumOfSquares = 0f; float[] samples; for ( int c = 0; c < nc; c++ ) { samples = getChannel(c); for ( int s = 0; s < ns; s++ ) { float sample = samples[s]; sumOfSquares += sample * sample; } } return sumOfSquares / (nc * ns); } COM: <s> the square of the buffer the first part of rms calculations </s>
funcom_train/14025775
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setSortable(boolean s) { if (s) { // Add only if the _sortListener isn't already installed. if (!isSortable()) getTableHeader().addMouseListener(_sortListener); } else { getTableHeader().removeMouseListener(_sortListener); } } COM: <s> determines whether the tables headers respond to clicking for sorts </s>
funcom_train/18053681
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JMenu getSvWindowMenu() { if (svWindowMenu == null) { svWindowMenu = new JMenu(); svWindowMenu.setText("Window"); svWindowMenu.setFont(new Font("Tahoma", Font.PLAIN, 11)); svWindowMenu.add(getSvWindowNewMenuItem()); svWindowMenu.add(getSvWindowCloseMenuItem()); svWindowMenu.addSeparator(); svWindowMenu.add(getSvWindowMinimizeMenuItem()); svWindowMenu.add(getSvWindowZoomMenuItem()); } return svWindowMenu; } COM: <s> this method initializes svwindow menu </s>
funcom_train/13955107
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int numberOfBatches(int productCount, int sizeOfOneBatch) { if (sizeOfOneBatch == 0) { return productCount; } // this part is needed since the calculation below would return 1 if (productCount == 0) { return productCount; } int numberOfBatches = productCount / sizeOfOneBatch; if (productCount % sizeOfOneBatch != 0) { numberOfBatches++; } return numberOfBatches; } COM: <s> returns the number of batches the first batch has value 1 </s>
funcom_train/12811164
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void loadValue(BufferedWriter colwriter, BufferedWriter buswriter, BufferedWriter loadedfilewriter) throws Exception { super.loadValue(colwriter, buswriter, loadedfilewriter); if( load_vignette ) { try { this.createVignette(); } catch( Exception e ) { Messenger.printMsg(Messenger.WARNING, "Can't create image vignette"); } } else { Messenger.printMsg(Messenger.TRACE, "Make no vignette"); } } COM: <s> this method builds a saada instance and stores it into the ascii files </s>
funcom_train/7669698
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Throwable initCause(Throwable throwable) { // BEGIN android-note // removed synchronized modifier // END android-note if (cause == this) { if (throwable != this) { cause = throwable; return this; } throw new IllegalArgumentException("Cause cannot be the receiver"); } throw new IllegalStateException("Cause already initialized"); } COM: <s> initializes the cause of this </s>
funcom_train/24442043
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void initialize() throws ImporterException{ try { // Clear out the hash maps entities = new HashMap<String, Entity>(); attributes = new HashMap<String, Attribute>(); subtypes = new HashMap<String, Subtype>(); schemaElements = new ArrayList<SchemaElement>(); // Connect to the Excel workbook InputStream excelStream; excelStream = uri.toURL().openStream(); workbook = new HSSFWorkbook(excelStream); excelStream.close(); } catch (IOException e) { throw new ImporterException(ImporterExceptionType.PARSE_FAILURE, e.getMessage()); } } COM: <s> initializes the excel importer </s>
funcom_train/5419682
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void delete(JGroup group, Configuration configuration , Session s) { try { String filePath = group.getGroupFilesPath(configuration) + fileId; java.io.File file = new java.io.File(filePath); file.delete(); } catch( Exception e ) { Log.print(e); } try { s.delete(this); } catch( Exception e ) { Log.print(e); } } COM: <s> deletes the file </s>
funcom_train/5377455
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String simpleClassName(Object o) { java.util.StringTokenizer t = new java.util.StringTokenizer(o.getClass().getName(), "."); //$NON-NLS-1$ int ct = t.countTokens(); for (int i = 1; i < ct; i++) { t.nextToken(); } return t.nextToken(); } COM: <s> returns the simple class name of an object </s>
funcom_train/40007391
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testAdd() { System.out.println("add"); Instructor newInstance = null; InstructorServiceImpl instance = new InstructorServiceImpl(); instance.add(newInstance); // TODO review the generated test code and remove the default call to fail. fail("The test case is a prototype."); } COM: <s> test of add method of class instructor service impl </s>
funcom_train/9555850
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private CharacterArray getRightWord(int x, int y) { String word = ""; //NOI18N for (int i = x; i < board.Width && board.getLetter(i, y) != ' '; i++) { word += String.valueOf(board.getLetter(i, y)); } return new CharacterArray(word); } COM: <s> this method gets a word formed to the right of the given location </s>
funcom_train/12933655
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void update(Graphics g, JComponent c) { if (c.isOpaque()) { g.setColor(new ColorUIResource(251, 248, 241)); g.fillRect(0, 0, c.getWidth(), c.getHeight()); g.setColor(new ColorUIResource(251, 248, 241)); g.fillRect(0, ROUND_HEIGHT, c.getWidth(), c.getHeight() - ROUND_HEIGHT); } paint(g, c); } COM: <s> overriden to paint the background of the component but keeping the </s>
funcom_train/29830169
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void openChatWindow() { DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent(); if (node == null) return; if (node instanceof BSNickNode) { BSNickNode resNode = (BSNickNode) node; JID jid = resNode.getJID(); winMan.openChatWindow(jid, true, true); } else return; } COM: <s> opens private chat window with selected node </s>
funcom_train/45250776
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ImageDescriptor getImageDescriptor() { if (imageDescriptor == null) { String iconName = configurationElement.getAttribute(IWorkbenchRegistryConstants.ATT_ICON); if (iconName == null) { return null; } imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin( configurationElement.getNamespace(), iconName); } return imageDescriptor; } COM: <s> answer the icon of this element </s>
funcom_train/2883597
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testCaseCTN6() throws Throwable { if (failedSolver()) return; Context cxt = parseToContext("ctn6.sf"); Context foo1c = resolveCD(cxt, "foo1"); Context fooc = resolveCD(foo1c, "foo"); assertContextResolves(fooc, "bar", "32"); assertContextResolves(fooc, "bar2", "48"); assertContextResolves(fooc, "bar3", "51"); } COM: <s> test case ctn6 </s>
funcom_train/12835001
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String getEnvelope(String msg) { try { String env = ""; if (msg.indexOf("</envelope>") > 0) { env = msg.substring(0, msg.indexOf("</envelope>")+11); } System.out.println("Here is the envelope we get: "+env); return env; } catch (Exception ex) { System.out.println("Envelope: " + ex.toString()); return ""; } } COM: <s> return the envelope from the given fipa message </s>
funcom_train/25648713
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JMenuItem createPasteMenuItem() { String pasteTxt = KendoResources.getString("menu.edit.paste"); JMenuItem paste = new JMenuItem(pasteTxt); paste.setActionCommand(PASTE); paste.addActionListener(this); paste.setEnabled(KendoClipboard.getObjectsFromClip().size() > 0); return paste; } COM: <s> creates a menu item for nodes pasting </s>
funcom_train/1653498
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testPut_StringBoolean() { SimpleFieldSet methodSFS = new SimpleFieldSet(true); int length = 15; for(int i = 0; i < length; i++) methodSFS.put(Integer.toString(i),true); for (int i = 0; i < length; i++) assertEquals(methodSFS.getBoolean(Integer.toString(i),false),true); assertTrue(checkSimpleFieldSetSize(methodSFS,length)); } COM: <s> tests put string boolean and get boolean string boolean </s>
funcom_train/3178811
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void init() throws IOException { int poolSize = ServerConfig.getServerInstance().getReadWriteThreads(); this.dataProcessingPool = new DefaultExecutor("UberMQ Worker Thread", poolSize, poolSize); this.rwtt = new ReadWriteTransformThread(dataProcessingPool, poolSize, poolSize); rwtt.start(); } COM: <s> initializes the server </s>
funcom_train/7421565
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Transition getEntry() { if (this.sourceObject.getPredecessor() == null) { // multiple predecessors for source object (loop) List<Transition> transitions = this.sourceObject.getTargetFor(); for (Iterator<Transition> it = transitions.iterator(); it.hasNext();) { Transition trans = it.next(); if (!getTransitions().contains(trans)) { return trans; } } } else { return this.sourceObject.getTransitionFrom( this.sourceObject.getPredecessor()); } return null; } COM: <s> returns the entry transition of the component </s>
funcom_train/7508273
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testVerifySignature() throws EncryptionException { System.out.println("testVerifySignature()"); Encryptor instance = ESAPI.encryptor(); String plaintext = ESAPI.randomizer().getRandomString( 32, DefaultEncoder.CHAR_ALPHANUMERICS ); String signature = instance.sign(plaintext); assertTrue( instance.verifySignature( signature, plaintext ) ); } COM: <s> test of verify signature method of class org </s>
funcom_train/9938081
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected IGisDataRenderer getRendererForLayer(IMapLayer layer) throws RendererNotFoundException { IGisDataRenderer result; MapDataType mapDataType = layer.getMapDataType(); switch( mapDataType ) {//find the matching renderer case VECTOR: result = new VectorDataRender(); break; default: throw new RendererNotFoundException("Could not find matching renderer for map data of type: " + layer.getMapDataType()); } return result; } COM: <s> returns the renderer able to draw the data contained in the </s>
funcom_train/26461312
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void init(Configuration configuration) throws ConfigurationException { PackageConfig defaultPackageConfig = new PackageConfig(); List interceptors = new ArrayList(); interceptors.add(new InvocationSessionStoreTestInterceptor()); ActionConfig testActionConfig = new ActionConfig(null, TestAction.class, null, null, interceptors); defaultPackageConfig.addActionConfig(ACTION_NAME, testActionConfig); configuration.addPackageConfig("defaultPackage", defaultPackageConfig); } COM: <s> initializes the configuration object </s>
funcom_train/3176281
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setColumnDirections(int[] set) { SortableTableModel model = (SortableTableModel)table.getModel(); for (int i = 0; i<set.length && i<model.getColumnCount(); i++) { model.setSortingStatus(i, set[i]); } } COM: <s> set sorted columns </s>
funcom_train/38328407
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ReturnVector executeFunction(Rete engine, Parameter[] params) { DefaultReturnVector rv = new DefaultReturnVector(); if (params != null && params.length == 1) { if (params[0] instanceof BoundParam) { BoundParam bp = (BoundParam)params[0]; Message msg = (Message)bp.getObjectRef(); msg.setMessageStatus(Message.RETURNED); System.out.println("Message returned, user does not exist"); } } return rv; } COM: <s> the method is not implemented </s>
funcom_train/12803338
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void generateCopyrightComments(CodeBuffer buffer) { if (copyrightComment != null) { if (copyrightComment.startsWith(GeneratorConstants.START_JAVADOC) || copyrightComment.startsWith(GeneratorConstants.SINGLE_COMMENT)) { buffer.appendLines(copyrightComment); } else { buffer.appendMultiLineComment(copyrightComment); } buffer.appendBlankLine(); } } COM: <s> write the copyright comments to the given </s>
funcom_train/269209
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void paint(Graphics g) { g.drawImage(this.image, 0, 0, this); // Notify method splash that the window // has been painted. // Note: To improve performance we do not enter // the synchronized block unless we have to. if (! this.paintCalled) { this.paintCalled = true; synchronized (this) { notifyAll(); } } } COM: <s> paints the image on the window </s>
funcom_train/3344269
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected int findFreeEntry(FSEntry entry) { int size = entryNames.size(); int freeIndex = -1; for (int i = 0; i < size; i++) { String n = entryNames.get(i); if (n == null) { freeIndex = i; } } if (freeIndex < 0) { freeIndex = addEntry(null); } return freeIndex; } COM: <s> find the index of free entry </s>