__key__ stringlengths 16 21 | __url__ stringclasses 1 value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/23467668 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addLanguagePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_ServiceImplemetation_language_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_ServiceImplemetation_language_feature", "_UI_ServiceImplemetation_type"),
ServicePackage.Literals.SERVICE_IMPLEMETATION__LANGUAGE,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the language feature </s>
|
funcom_train/4744873 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void runApplication(int appId) {
Application app;
RunningApplication runningApp;
Query q = session.createQuery(
"select app from Application as app where app.id = :id");
q.setParameter("id", appId);
List<Application> list = q.list();
if(!list.isEmpty()) {
app = list.get(0);
if(app.getQuota().getCp() > 0) {
runningApp = new RunningApplication();
runningApp.setAppID(app);
session.beginTransaction();
session.save(runningApp);
session.getTransaction().commit();
}
}
}
COM: <s> creates a running application for a given application </s>
|
funcom_train/25792428 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setVisible(boolean value, ArrayList<ProcessInstance> filteredInstances) {
if (m_item != null) {
m_item.setFilter(value);
filteredInstances.add(m_item.getProcessInstance());
} else if (getChildCount() > 0) {
for (int i = 0; i < getChildCount(); i++) {
ProcessTreeNode myChild = (ProcessTreeNode) getChildAt(i);
myChild.setVisible(value, filteredInstances);
}
}
}
COM: <s> sets wether or not the node is visible </s>
|
funcom_train/4615441 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void stop() {
try {
server.stop();
} catch (InterruptedException ex) {
throw new RuntimeException(ex);
} finally {
driver.stopAllBrowsers();
try {
if (shutDownHook != null) {
Runtime.getRuntime().removeShutdownHook(shutDownHook);
}
} catch (IllegalStateException e) {} // if we're shutting down, it's too late for that!
}
}
COM: <s> stops the jetty server </s>
|
funcom_train/8569677 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Activator newActivator(Chromosome ch) throws TranscriberException {
Activator result = null;
if (ANJI_TYPE.equals(type)) {
result = new AnjiActivator((AnjiNet) transcriber.transcribe(ch), recurrentCycles);
} else if (HYPERNEAT_TYPE.equals(type)) {
result = (GridNet) transcriber.transcribe(ch);
} else if (JOONE_TYPE.equals(type)) {
throw new TranscriberException("JOONE not implemented");
} else
throw new IllegalStateException("invalid type: " + type);
return result;
}
COM: <s> constructs code activator code phenotype from code chromosome code </s>
|
funcom_train/50370707 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initGraphics(Shell shell) {
shell.setBounds(0, 0, 600, 600);
shell.setLayout(new FillLayout(SWT.VERTICAL));
FigureCanvas canvas = new FigureCanvas(shell);
Figure root = new Figure();
panel = new Panel();
panel.setBackgroundColor(ColorConstants.darkGreen);
panel.setSize(600, 600);
canvas.setContents(root);
root.add(panel);
FlowLayout layout = new FlowLayout(true);
layout.setMinorSpacing(20);
layout.setMajorSpacing(10);
layout.setMinorAlignment(FlowLayout.ALIGN_CENTER);
layout.setMajorAlignment(FlowLayout.ALIGN_CENTER);
layout.setStretchMinorAxis(false);
panel.setLayoutManager(layout);
}
COM: <s> initialize the swt graphics </s>
|
funcom_train/24184823 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void close () {
// Attempt to close all input streams, which will kill the writer if it is currently writing
try {
for (PipedInputStream inStream : this.in.values())
inStream.close();
} catch (IOException e) { }
// Keep interrupting the writer until it's dead
while (this.writer.getState() != Thread.State.TERMINATED) {
this.writer.interrupt();
}
}
COM: <s> closes the stream </s>
|
funcom_train/45398781 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void writeAttribute (String qualifier, String name, String value) {
Tag current = this.getTag();
if (!current.open)
throw new IllegalStateException("Cannot write attributes after tag is closed: tag=" + current.name + "/attribute=" + name);
write(" " + name + "=\"" + escape(value) + "\"");
}
COM: <s> this can be called before the current tag is closed for attribute addition </s>
|
funcom_train/46261631 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED && canvas.control) {
canvas.setPenColor(itemToColor(e.getItem()));
canvas.com.sendMessage("color " + e.getItem().toString());
if (canvas.magicBox.active){
try{
((SelectTool)canvas.getCurrentTool()).selected.setmycolor(canvas.penColor);
canvas.repaint();
}catch(Exception x){
}
}
}
}
COM: <s> listens to color selection combo box </s>
|
funcom_train/27842406 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setAction(Action inAction) {
if (inAction != null && !(inAction instanceof SAction)) {
throw new IllegalArgumentException("Action must be an instance of SAction");
}
if (inAction != null) {
setControlID(((SAction) inAction).getControlID());
}
super.setAction(inAction);
}
COM: <s> sets the code action code for the button </s>
|
funcom_train/3150007 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void mousePressed(MouseEvent e) {
if (SwingUtilities.isRightMouseButton(e) && e.getClickCount() == 1) {
int row = manufacturersTable.rowAtPoint(e.getPoint());
int column = manufacturersTable.columnAtPoint(e.getPoint());
manufacturersTable.getSelectionModel().setSelectionInterval(row, row);
}
}
COM: <s> invoked when a mouse button has been pressed on a component </s>
|
funcom_train/12652859 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public PreparedStatement getPreparedStatement(String sql, int resultSetConcurrency) throws SQLException, SQLFeatureNotSupportedException {
if (connection == null)
throw new SQLException("Connection not available");
if (sql == null)
throw new SQLException("SQL statement not provided");
return connection.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, resultSetConcurrency);
}
COM: <s> returns a new prepared statement </s>
|
funcom_train/17587846 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void save(String dirName) {
if (bdd == null)
throw new RuntimeException("");
try {
File file = new File(dirName, name + ".bdd");
BufferedWriter out = new BufferedWriter(new FileWriter(file));
out.write('#');
for (BDDDomain d : domBdds)
out.write(" " + d + ":" + d.varNum());
out.write('\n');
for (BDDDomain d : domBdds) {
out.write('#');
for (int v : d.vars())
out.write(" " + v);
out.write('\n');
}
factory.save(out, bdd);
out.close();
} catch (IOException ex) {
throw new RuntimeException(ex);
}
close();
}
COM: <s> copies the relation from memory to disk and frees it from memory </s>
|
funcom_train/17510391 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ShowInfo getShowInfo(int showID) {
if (showID == 0) {
return new ShowInfo();
}
String tvrageURL = buildURL(API_SHOWINFO, Integer.toString(showID)).toString();
List<ShowInfo> showList = TVRageParser.getShowInfo(tvrageURL);
if (showList.isEmpty()) {
return new ShowInfo();
} else {
return showList.get(0);
}
}
COM: <s> search for the show using the show id </s>
|
funcom_train/44364723 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void fireTableRowsUpdated(int firstRow, int lastRow) {
TableModelEvent updateEvent = new TableModelEvent(this,firstRow,lastRow);
Iterator listenerIterator = listenerList.iterator();
while ( listenerIterator.hasNext() ) {
Object listenerObject = listenerIterator.next();
if ( listenerObject instanceof TableModelListener ) {
((TableModelListener)listenerObject).tableChanged(updateEvent);
}
}
}
COM: <s> fires an event when a table row has been edited </s>
|
funcom_train/8096351 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Instances generateData(int nominal, int numeric, int rows) {
Instances result;
TestInstances test;
test = new TestInstances();
test.setClassIndex(TestInstances.NO_CLASS);
test.setNumNominal(nominal);
test.setNumNumeric(numeric);
test.setNumInstances(rows);
try {
result = test.generate();
}
catch (Exception e) {
result = null;
}
return result;
}
COM: <s> generates data with the given amount of nominal and numeric attributes </s>
|
funcom_train/18503763 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void close() {
//Don't do anything if already closed
if (!active)
return;
//Send close command
try {
send(new CloseCommand());
} catch (IOException e1) {
e1.printStackTrace();
}
//TODO maybe wait for confirmation???
active = false;
//TODO maybe resend unconfirmed here?
//Interrupt the internal waiter
internalWaiter.interrupt();
try {
//close the input stream, this will interrupt the external waiter
objIn.close();
} catch (IOException e) {
e.printStackTrace();
}
try {
//Close the output stream
objOut.close();
} catch (IOException e) {
e.printStackTrace();
}
}
COM: <s> closes the data manager </s>
|
funcom_train/35461004 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String formatIndent(final String parentIndent, final int level) {
String indent = "";
if (level == 1) {
indent = LEVEL01_INDENT;
} else {
if (parentIndent.length() > 0) {
if (parentIndent.equals(LEVEL01_INDENT)) {
indent = LEVEL02_INDENT;
} else {
indent = parentIndent + INDENT;
}
} else {
indent = LEVEL02_INDENT;
}
}
return indent;
}
COM: <s> creates the indentation for a specific level relative to its parent </s>
|
funcom_train/33670974 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setWhisperingArrow(String name, int anchorX, int anchorY, Object action, int flags) {
BPoint p = getBApp().getSkin().getAnchor(name, getRect(), anchorX, anchorY);
BHighlight h = createHighlight(name, action, p.x, p.y, flags);
applyVisibility(h, flags, H_VIS_FOCUS);
set(h);
}
COM: <s> set a whispering arrow </s>
|
funcom_train/894655 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void invokeModify() {
this.insertMode = false;
this.pack();
setLocationRelativeTo(getOwner());
updateEditor();
ToolTipManager toolTipManager = ToolTipManager.sharedInstance();
toolTipManager.registerComponent(this.instructionCombo);
super.setVisible(true);
toolTipManager.unregisterComponent(this.instructionCombo);
}
COM: <s> invoke instruction editor with just the instruction </s>
|
funcom_train/3391019 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void readExceptions(DataInputStream in) throws IOException {
int attr_len=in.readInt(); // attr_length in prog
int num_exceptions = in.readUnsignedShort();
exc_index_table=new int[num_exceptions];
for (int l = 0; l < num_exceptions; l++) {
int exc=in.readShort();
exc_index_table[l]=exc;
}
}
COM: <s> read exception attribute info </s>
|
funcom_train/42887029 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void claBumpActivity(Constr confl) {
confl.incActivity(claInc);
if (confl.getActivity() > CLAUSE_RESCALE_BOUND)
claRescalActivity();
// for (int i = 0; i < confl.size(); i++) {
// varBumpActivity(confl.get(i));
// }
}
COM: <s> propagate activity to a constraint </s>
|
funcom_train/41073839 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void writeNews(String title, String feed) {
try {
writeInDB("INSERT INTO news (title, feed)" + "VALUES ('" + title
+ "', '" + feed + "')");
} catch (MySQLIntegrityConstraintViolationException e) {
System.err.println("Error to write, probabily entry was repeated.");
}
}
COM: <s> write news information headline of the news and the feed that it belongs </s>
|
funcom_train/26206348 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean getProperty(final String key, boolean defaultValue) {
final Object value = get(key);
if (value != null) {
if (value instanceof String) {
defaultValue = ((String) value).equals("true");
} else if (value instanceof Boolean) {
defaultValue = ((Boolean) value).booleanValue();
}
}
return defaultValue;
}
COM: <s> return the boolean value for the given code key code </s>
|
funcom_train/44161615 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ArrayList getDataSourceObjects() {
Collection col = null;
ArrayList dataSources = null;
try {
col = prepareCollection("datasources");
XMLResource document = (XMLResource)col.getResource("datasources");
Document doc = makeDocument(document);
dataSources = this.queryMethods.getDataSourceObjects(doc);
if (col != null) {
col.close();
}
} catch (Exception e) {
e.printStackTrace();
}
return dataSources;
}
COM: <s> get data source objects gets datasource objects </s>
|
funcom_train/3025291 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createFile(File diagramFile, PackageSummary summary) {
if (!diagramFile.exists()) {
try {
FileWriter output = new FileWriter(diagramFile);
output.write("V[1.1:" + summary.getName() + "]\n");
output.close();
}
catch (IOException ioe) {
}
}
}
COM: <s> creates a file if one does not yet exist </s>
|
funcom_train/22411444 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void displayConnectorAttributes(HashMap attributeMap) throws IOException {
Set entries = attributeMap.entrySet();
Iterator it = entries.iterator();
while (it.hasNext()) {
Map.Entry entry = (Map.Entry) it.next();
// log.info(entry.getKey() + " --> " + entry.getValue());
}
}
COM: <s> display connector attributes </s>
|
funcom_train/5461296 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private URI generateURIForContact(VCard contact, RDFContainer container, String contactHash) {
String contactIdentifier = null;
Property uid = contact.getProperty(Id.UID);
if (uid != null) {
contactIdentifier = uid.getValue();
} else {
contactIdentifier = contactHash;
}
return createChildUri(container.getDescribedUri(), contactIdentifier);
}
COM: <s> generates a uri for a contact </s>
|
funcom_train/50999423 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Boolean useRelations() {
String templateValue = (String) getTemplateSettings().get(JagGenerator.TEMPLATE_USE_RELATIONS);
if (templateValue == null || "false".equalsIgnoreCase(templateValue)) {
return new Boolean(false);
}
else {
return new Boolean(true);
}
}
COM: <s> check if the container managed relations checkbox was checked </s>
|
funcom_train/40212985 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JEditorPane getJQbEditorPane() {
if (jQbEditorPane == null) {
jQbEditorPane = new JEditorPane();
jQbEditorPane.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 12));
jQbEditorPane.addCaretListener(listener);
}
return jQbEditorPane;
}
COM: <s> this method initializes j qb editor pane </s>
|
funcom_train/28257447 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void trackModelUpdate(TrackModelEvent tme) {
TrackModel tm = tme.getTrackModel();
tracks = tm.getTrackList();
int index = tme.getIndex();
if (tme instanceof TrackModelDeassignEvent) {
uninstallPlayer(tm, index);
} else if (tme instanceof TrackModelAssignEvent) {
installPlayer(tm, index);
}
if (tm.getNumberOfAssignedTracks() > 0) {
mpc.update(tracks);
}
}
COM: <s> listen for changes to track model </s>
|
funcom_train/32258638 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected MJButton getBtClose() {
if (btClose == null) {
btClose = new MJButton();
btClose.setPreferredSize(new Dimension(100, 26));
btClose.setText("Close");
btClose.setActionCommand("");
btClose.setMnemonic(KeyEvent.VK_F4);
}
return btClose;
}
COM: <s> this method initializes bt cust rep execute report1 </s>
|
funcom_train/25966851 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getPatternForCurrencySpacing(int itemType, boolean beforeCurrency) {
if (itemType < CURRENCY_SPC_CURRENCY_MATCH ||
itemType > CURRENCY_SPC_INSERT ) {
return null; // invalid itemType.
}
if (beforeCurrency) {
return currencySpcBeforeSym[itemType];
} else {
return currencySpcAfterSym[itemType];
}
}
COM: <s> get pattern string for currency spacing that can be applied to </s>
|
funcom_train/4125899 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getPrice(List<AbstractUnit> units, boolean rebate) {
int price = 0;
for (AbstractUnit unit : units) {
int newPrice = getPrice(unit.getUnitType(), unit.getRole());
price += newPrice * unit.getNumber();
}
if (price > player.getGold() && rebate) {
return player.getGold();
} else {
return price;
}
}
COM: <s> returns the price for the given units </s>
|
funcom_train/4935642 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addInfrastructureObjectsInWM() {
final GUIKBAdapter guiKBAdapter = new GUIKBAdapter();
initTripleStore();
guiKBAdapter.setStorage( store);
workingMemory.insert( new Assignment( Triple.wrapAsURI( "javapr", "GUIKBAdapter" ), guiKBAdapter ) );
// workingMemory.insert( new Assignment( Triple.wrapAsURI( "eg", "STORAGE" ), storage ) );
}
COM: <s> add infrastructure objects in wm </s>
|
funcom_train/3290064 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int addRelatedNode(MMObjectNode node, int otypeWanted, int count, int offset, Vector result) {
if ((node != null) &&
(node.getIntValue("otype") == otypeWanted)) {
count+=1;
if (count>offset) {
result.add(node);
}
}
return count;
}
COM: <s> add a node to a result vector provided the type matches and the </s>
|
funcom_train/3291632 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean commitObjectTable(MMObjectNode node, DatabaseTransaction trans) throws StorageException {
String sqlupdate=updateSQL(getFullTableName("object"),
getOwnerString()+"='"+node.getStringValue("owner")+"'",
node.getNumber());
return trans.executeUpdate(sqlupdate);
}
COM: <s> commit this node to the object table </s>
|
funcom_train/41163459 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void delete(CoGroupFormat entity) {
EntityManagerHelper.log("deleting CoGroupFormat instance", Level.INFO, null);
try {
entity = getEntityManager().getReference(CoGroupFormat.class, entity.getGroupFormatId());
getEntityManager().remove(entity);
EntityManagerHelper.log("delete successful", Level.INFO, null);
} catch (RuntimeException re) {
EntityManagerHelper.log("delete failed", Level.SEVERE, re);
throw re;
}
}
COM: <s> delete a persistent co group format entity </s>
|
funcom_train/18569351 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ColoratorType getColorator(Entity entity) {
ColoratorType colorator = null;
try {
ImageType image = getImage(entity);
// find getColorator method
Method getColorator = image.getClass().getMethod("getColorator", null);
// get colorator name
colorator = (ColoratorType)getColorator.invoke(image, null);
} catch (Exception exc) {
Debug.stackTrace(exc);
}
return colorator;
}
COM: <s> method get colorator </s>
|
funcom_train/32790890 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setForeignKeys(Table t) {
String cols[] = t.getColumns();
for (int i=0; i<cols.length; i++) {
if (t.isForeignKeyColumn(cols[i])) {
constraintCount++;
theSQLBuilder.addFKConstraint(CONSTRAINT_NAME + constraintCount,
t.getTableName(),
cols[i],
t.getForeignTable(cols[i]),
t.getForeignColumn(cols[i]));
}
}
}
COM: <s> generates alter table statements to create foreign key references </s>
|
funcom_train/34519184 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public MethodDefOrRef getMethodDefOrRef(long token){
long type = (token>>24)&0xFFL;
long tokrow = token&0xFFFFFFL;
if (type==tc.Method){
return methods[(int)getMethod(tokrow)-1];
}else if (type==tc.MemberRef){
return (MethodDefOrRef)memberRefs[(int)tokrow-1];
}
return null;
}
COM: <s> returns the method or method ref corresponding to the given token </s>
|
funcom_train/2804824 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean evaluate(EngineInterface i) throws ExcptnRoot {
i.printlnDebugInfo("NotEquals");
i.setCallback(this,"_evaluateLeft","java.lang.Object");
// During the input phase left.evaluate() is never returned from.
left.evaluate(i);
return value.booleanValue();
}
COM: <s> compares two object and returns the inverse of the result of that comparison </s>
|
funcom_train/23867239 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Iso3166Country getCountry() {
final Object country = JsfComponentUtil.getAttribute(this, "country");
Iso3166Country result;
if (country instanceof String) {
result = Iso3166Country.valueOf((String)country);
} else if (country instanceof Iso3166Country) {
result = (Iso3166Country)country;
} else {
result = null;
}
return result;
}
COM: <s> gets the country of this zip code </s>
|
funcom_train/42068235 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addNumberOfSegmentsPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_ChunkPlayList_numberOfSegments_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_ChunkPlayList_numberOfSegments_feature", "_UI_ChunkPlayList_type"),
WavPackage.Literals.CHUNK_PLAY_LIST__NUMBER_OF_SEGMENTS,
false,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the number of segments feature </s>
|
funcom_train/10237819 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getJButtonClose() {
if (jButtonClose == null) {
jButtonClose = new JButton();
jButtonClose.setBounds(new Rectangle(421, 324, 137, 26));
jButtonClose.setText("Close");
jButtonClose.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
dispose();
}
});
}
return jButtonClose;
}
COM: <s> this method initializes j button close </s>
|
funcom_train/44161326 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ResultHash getResultHash(String id) {
ResultHash resultHash = null;
synchronized (container) {
Iterator it = container.values().iterator();
while (it.hasNext()) {
ResultHash rh = ((ResultHash) it.next()).getResultHash(id);
if (rh != null) {
resultHash = rh;
break;
}
}
}
return resultHash;
}
COM: <s> get result hash from container </s>
|
funcom_train/366464 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void readAbbrFile() {
abbrevT = new Hashtable();
try { // open directory data file
URL theURL = new URL(datadir, datafile);
BufferedReader d = new BufferedReader(new InputStreamReader(theURL.openStream()));
parseAbbrFile(d, abbrevT);
}
catch (Exception e) {
// No abbrev file found, but that's OK, we'll just go on without it -- jheer
}
} //
COM: <s> reads in the abbreviation file </s>
|
funcom_train/22639105 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean init() {
try {
clazz = (new ClassParser(classFilePath)).parse();
cpg = new ConstantPoolGen(clazz.getConstantPool());
visitor = new BcelVisitor();
return true;
} catch (IOException e) {
Log.error("Could not read: " + classFilePath);
}
return false;
}
COM: <s> prepares the parsing process </s>
|
funcom_train/46728406 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean openPatientChart() throws Exception {
if (hasSelectedMultipleAppointments()) {
selectAppoinment();
}
if (hasSelectedAppointment()) {
final AppointmentModel appt = SchedulingServer.getAppointmentForInstance(getSelectedAppointment().getAppointmentInstanceId());
long patientId = SchedulingServer.getPatientForAppointment(appt.getId()).getId();
PatientModel patient = PatientServer.getMostRecentVisit(patientId);
ServiceUtility.openPatientChart(patient);
}
throw new ISCancelActionException();
}
COM: <s> create a new appointment </s>
|
funcom_train/2868660 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void updateScreen() {
while (true) {
Result r = doCommand ("readbuffer ascii");
if (r.data.size() > 0) {
String firstLine = (String) r.data.get(0);
if (firstLine.startsWith("data: Keyboard locked")) {
continue;
}
}
screen.update(r.status, r.data);
break;
}
}
COM: <s> updates the screen object with s3270s buffer data </s>
|
funcom_train/31662470 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setPeakTable(Peak1D[] newPeakTable) {
if (newPeakTable != peakTable) {
peakTable = newPeakTable;
if (peakTable != null)
for (int i = 0; i < peakTable.length; i++)
peakTable[i].setSpectrum(this);
}
}
COM: <s> sets a new peak table </s>
|
funcom_train/3410454 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double getImageableY() {
double y;
switch (getOrientation()) {
case LANDSCAPE:
y = mPaper.getImageableX();
break;
case PORTRAIT:
y = mPaper.getImageableY();
break;
case REVERSE_LANDSCAPE:
y = mPaper.getWidth()
- (mPaper.getImageableX() + mPaper.getImageableWidth());
break;
default:
/* This should never happen since it signifies that the
* PageFormat is in an invalid orientation.
*/
throw new InternalError("unrecognized orientation");
}
return y;
}
COM: <s> returns the y coordinate of the upper left point of the </s>
|
funcom_train/26255855 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void printStackTrace(PrintWriter s) {
synchronized (s) {
s.println(this);
String[] trace = getStackLines(this);
for (int i=0; i < trace.length; i++)
s.println(trace[i]);
if (cause != null)
printStackTraceAsCause(cause, s, trace);
}
}
COM: <s> prints this throwable and its backtrace to the specified print writer </s>
|
funcom_train/37837468 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean execute(final String[] params, final String remainder) {
if ((params == null) || (params.length < getMinimumParameters())) {
return false;
}
final RPAction alter = new RPAction();
alter.put("type", "altercreature");
alter.put("target", params[0]);
alter.put("text", params[1]);
ClientSingletonRepository.getClientFramework().send(alter);
return true;
}
COM: <s> alters an entitys attributes </s>
|
funcom_train/20139330 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ListBox addListBox(final String theName, final int theX, final int theY, final int theW, final int theH) {
ListBox myController = new ListBox(controlP5, (Tab) controlP5.controlWindow.tabs().get(1), theName, theX, theY, theW, theH);
myController.registerProperty("listBoxItems").registerProperty("value");
controlP5.register(myController);
return myController;
}
COM: <s> adds a list box </s>
|
funcom_train/25333075 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetAndSetDbSpeciesName() throws Exception {
DBSingleSpeciesDatabase instance = new DBSingleSpeciesDatabase("bob_bill_core_4_5", EnsemblDBType.core, null);
assertEquals(instance.getDbSpeciesName(), "bob_bill");
instance.setDbSpeciesName("bob");
assertEquals(instance.getDbSpeciesName(), "bob");
}
COM: <s> test of get db species name method of class dbsingle species database </s>
|
funcom_train/33365844 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void letProperty(String propertyName, IOPVariable propertyValue) throws IOPException {
String s = IOPserver.sendAndBlock(CLIENTMESSAGE_LETPROPERTY + " " + this.instanceID + " " +
propertyName + " " + propertyValue.toString());
if (s.startsWith(IOPServer.SERVERMESSAGE_ERROR)) {
throw new IOPException(s);
}
}
COM: <s> sets a property on the remote object </s>
|
funcom_train/21482646 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean extractReplicateAsynchronously(Properties properties) {
boolean replicateAsynchronously;
String replicateAsynchronouslyString = PropertyUtil.extractAndLogProperty(REPLICATE_ASYNCHRONOUSLY, properties);
if (replicateAsynchronouslyString != null) {
replicateAsynchronously = PropertyUtil.parseBoolean(replicateAsynchronouslyString);
} else {
replicateAsynchronously = true;
}
return replicateAsynchronously;
}
COM: <s> extracts the value of replicate asynchronously from the properties </s>
|
funcom_train/14028672 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void insertInstructionsBefore(final ClassFile cf, final MethodInfo mi, final InstructionList il) {
boolean result;
// insert instructions
if (il.getIndex()==0) {
onMethodEntry(cf, mi, il);
}
else {
onMethodExit(cf, mi, il);
}
}
COM: <s> add instructions to call sync point buffer2 </s>
|
funcom_train/10353607 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Index useIndex(Index ndx) throws xBaseJException, IOException {
int i;
Index NDXes;
for (i = 1; i <= jNDXes.size(); i++) {
NDXes = (Index) jNDXes.elementAt(i - 1);
if (NDXes == ndx) {
jNDX = NDXes;
return NDXes;
}
}
throw new xBaseJException("Unknown Index " + ndx.getName());
}
COM: <s> used to indicate the primary index </s>
|
funcom_train/29372606 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JTextArea getJTextArea_Metar() {
if (jTextArea_Metar == null) {
jTextArea_Metar = new JTextArea();
jTextArea_Metar.setBounds(new Rectangle(15, 180, 601, 46));
jTextArea_Metar.setEditable(false);
}
jTextArea_Metar.setText(theController.getAtis().getMETAR());
return jTextArea_Metar;
}
COM: <s> this method initializes j text area metar </s>
|
funcom_train/8469612 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private V replaceValue(Node<V> node, V newValue) {
// Note: a node is terminal if it already has a value
if (node.isTerminal()) {
V old = node.value;
node.value = newValue;
return old;
}
// the node wasn't already a terminal node (i.e. this char sequence is a
// substring of an existing sequence), assign it a value
else {
node.value = newValue;
size++;
return null; // no old value
}
}
COM: <s> replaces the value of the provided </s>
|
funcom_train/32220612 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void exec(OperationContext context) {
AdlrActionObject aao = context.getAccessor().getAdlrActionById(actionId);
if (!validate(context,aao))
return;
// Insert to the ADL-R
TransactionResult result = null;
try {
result = context.getConnection().insert(
aao.getObjectID(),
aao.getUrls().get(0).getUrl(),
aao.getTimestamp(),
aao.getLom());
} catch (AdlmException e) {
}
checkStatusForChangeOperations(context, aao, result);
context.getAccessor().update(aao);
}
COM: <s> execute the insert operation </s>
|
funcom_train/33968033 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void onSubmissionComplete(FMDRequest request) {
if (mSubmissionNotifier == null) {
mSubmissionNotifier = new FMDSubmissionNotifier();
}
mSubmissionNotifier.setSubmissionType(mSubmissionType);
mSubmissionNotifier.setRequestType(request.requestType);
mSubmissionNotifier.setError(FMDError.NO_ERROR);
mAppController.getActivity().runOnUiThread(mSubmissionNotifier);
}
COM: <s> callback when the submission is completed </s>
|
funcom_train/40513818 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void printTruthTable(){
//variables
System.out.println("Variables:");
Iterator<String> iterator = this.varInputs.iterator();
while(iterator.hasNext()){
String element = iterator.next();
System.out.print(element + "\t");
}
System.out.println();
//printing truth table
System.out.println("Truth table");
for(int i = 0; i < this.truthTable.length; i++){
for(int j = 0; j < this.truthTable[i].length; j++){
System.out.print(this.truthTable[i][j] + "\t");
}
System.out.println();
}
}
COM: <s> prints truth table to the console </s>
|
funcom_train/27900221 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String defaultStorage(String mimeType) {
if ( mimeType == null ) {
return null;
}
if ( mimeType.equals("application/msword")
|| mimeType.startsWith("application/vnd.ms-") ) {
return "blob";
}
if ( mimeType.startsWith("text/") ) {
return "clob";
}
return "url";
}
COM: <s> calculates a default storage mode parameter </s>
|
funcom_train/23173009 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void displayExercise () {
// show filename in window title
this.setTitle (APPLICATION_NAME + " - " + document.getExerciseFilename ());
mainPanel.displayExercise ();
optionalPanel.displayExercise ();
lapPanel.displayExercise ();
samplePanel.displayExercise ();
diagramPanel.displayExercise ();
pack ();
}
COM: <s> displays the current exercise in all panels </s>
|
funcom_train/29802870 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void deleteUser(int uid){
try{
//MAKE STATEMENT
Statement deleteuid = con.createStatement();
// EXECUTE STATEMENT WITH SQL
deleteuid.executeUpdate("DELETE FROM user WHERE uid = '" + uid +"'");
}catch(Exception e){
System.out.println(e);
e.printStackTrace();
}
}
COM: <s> deletes a user of a specific uid </s>
|
funcom_train/37240861 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void clean() {
Enumeration enum = getPartList().elements();
while(enum.hasMoreElements()){
Part part = (Part) enum.nextElement();
// pass on the part to have phases cleaned
part.clean();
// check if part is empty
if (part.getPhraseList().size() == 0) {
this.removePart(part);
}
}
}
COM: <s> remove any empty parts or phrases from the score </s>
|
funcom_train/17210691 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void netShowAllCurrentAttribute(){
if (p.getAttribute() == "none") { //$NON-NLS-1$
ns.setView(ns.global.clone());}
else {
ns.setView(new Net(p));
for (Node n:ns.global.nNodes) {
if (n.hasAttribute(p.getAttribute())) {
ns.getView().addNode(n);
}
}
}
ns.getView().distances.clear();
clearFrames(ns.getView());
initNet();
}
COM: <s> generate view from whole network containing only active attributes </s>
|
funcom_train/31133234 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public AvnmpStateQueue getStates(long ts, long te) {
AvnmpStateQueue sq = new AvnmpStateQueue();
AvnmpState ap;
for(int i=0;i<size(); i++) {
ap = (AvnmpState) get(i);
if(ap.sqt >= ts && ap.sqt <= te)
sq.add(ap);
}
return sq;
}
COM: <s> retrieve a set of state values from a given start time to a </s>
|
funcom_train/38480460 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void copyAttributesFrom(BOInterface pBO) {
Map tSource = pBO.getAttributeMap();
Map tTarget = getAttributeMap();
Iterator tIter = tSource.values().iterator();
while (tIter.hasNext()) {
Attribute attribute = ((Attribute)tIter.next()).getCopy();
tTarget.put(attribute.getName(), attribute);
}
}
COM: <s> replaces values in code this code object but does not remove </s>
|
funcom_train/9766865 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setPolygonMode(int mode) {
if (mode != PolygonAttributes.POLYGON_FILL &&
mode != PolygonAttributes.POLYGON_LINE &&
mode != PolygonAttributes.POLYGON_POINT) {
System.err.println(this.getClass().getCanonicalName() +
": setPolygonMode: Wrong Transparency value: ignored...");
return;
}
polygonMode = mode;
}
COM: <s> sets the polygon rasterization mode </s>
|
funcom_train/44083432 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Map getDOMAttributesAsMap(Object node) {
Map map = new HashMap();
if (node instanceof DOMGraphVertex) {
DOMGraphVertex cell = (DOMGraphVertex) node;
Node nodeDOM = cell.getNode();
NamedNodeMap nmap = nodeDOM.getAttributes();
int l = nmap.getLength();
for (int i = 0; i < l; i++) {
Node n = nmap.item(i);
map.put(n.getNodeName(), n);
}
}
return map;
}
COM: <s> present dom attributes as jgraph node attributes currently unused </s>
|
funcom_train/1208084 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String requestPasswordKeySendToEmail(String username) {
try {
usersService.requestPasswordKeySendToEmail(username);
return "A key has been send to your email please use it to change your account password!";
} catch (ServiceRuntimeException se) {
log.error(se);
throw se;
} catch (Exception e) {
log.error(e);
throw new ServiceRuntimeException(ERROR_MESSAGE);
}
}
COM: <s> first step in forgot password </s>
|
funcom_train/7660495 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testTake() {
ExecutorService e = Executors.newCachedThreadPool();
ExecutorCompletionService ecs = new ExecutorCompletionService(e);
try {
Callable c = new StringTask();
ecs.submit(c);
Future f = ecs.take();
assert(f.isDone());
} catch (Exception ex) {
unexpectedException();
} finally {
joinPool(e);
}
}
COM: <s> a taken submitted task is completed </s>
|
funcom_train/23969951 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setWebRoot(String root) {
checkRunning(false);
root = (new File(root)).getAbsolutePath();
printWithThread("setWebRoot(" + root + ")");
if (serverProtocol != ServerConstants.SC_PROTOCOL_HTTP) {
return;
}
serverProperties.setProperty(ServerProperties.sc_key_web_root, root);
}
COM: <s> sets the path of the root directory from which web content is served </s>
|
funcom_train/12737215 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int parseQuery(String uri, int start) throws MalformedURIException {
int len = uri.length();
if (start >= len)
return start;
if (uri.charAt(start) != '?')
return start;
StringBuffer buffer = new StringBuffer(len-start-1);
int result = processURIPart(uri, start+1, "#", buffer);
query = buffer.toString();
return result;
}
COM: <s> initialize the query part for this uri from a uri string spec </s>
|
funcom_train/4424422 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void buildInputPattern(Actor actor) {
EList<Action> actions = actor.getActionsOutsideFsm();
for (Action action : actions) {
Pattern actionPattern = action.getInputPattern();
for (Port port : actionPattern.getPorts()) {
Integer numTokens = inputPattern.getNumTokens(port);
if (numTokens == null) {
numTokens = actionPattern.getNumTokens(port);
} else {
numTokens = Math.max(numTokens,
actionPattern.getNumTokens(port));
}
inputPattern.setNumTokens(port, numTokens);
}
}
}
COM: <s> builds the input pattern </s>
|
funcom_train/42188398 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JToggleButton getJGainsButton() {
if (jGainsButton == null) {
jGainsButton = new JToggleButton();
jGainsButton.setText("Ganancias");
jGainsButton.setSelected(true);
jGainsButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
selectedChart = gainsChart;
showGains(selectedHarvest, selectedChart);
}
});
}
return jGainsButton;
}
COM: <s> this method initializes j gains button </s>
|
funcom_train/40612304 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void delete(Object[] row) throws SQLException {
String query = getQuery(row);
try {
Term term = new Term(LUCENE_FIELD_QUERY, query);
/*## LUCENE2 ##
indexAccess.modifier.deleteDocuments(term);
//*/
//## LUCENE3 ##
indexAccess.writer.deleteDocuments(term);
//*/
} catch (IOException e) {
throw convertException(e);
}
}
COM: <s> delete a row from the index </s>
|
funcom_train/25761930 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JTextField getTxtHost() {
if (txtHost == null) {
txtHost = new JTextField();
txtHost.setBounds(new Rectangle(138, 16, 140, 34));
txtHost.setText(StateSaver.getInstance().getDatabaseSettings().getHost());
}
return txtHost;
}
COM: <s> this method initializes txt host </s>
|
funcom_train/21295891 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setFirst() {
for( Map.Entry<String, Vertex> m : vertexTable.entrySet() ) {
Vertex vertex = m.getValue();
if( vertex.isFirst() ) {
vertex.setShortest( 0 );
if( Config.debug )
System.out.println( "Set first for " + m.getKey() );
return;
}
}
}
COM: <s> sets the shortest value to 0 for start vertexes </s>
|
funcom_train/1240723 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void invoke(MessageContext msgContext) throws AxisFault {
if (log.isDebugEnabled()) {
log.debug("Enter: SimpleChain::invoke");
}
invoked = true;
doVisiting(msgContext, iVisitor);
if (log.isDebugEnabled()) {
log.debug("Exit: SimpleChain::invoke");
}
}
COM: <s> iterate over the chain invoking each handler </s>
|
funcom_train/5437210 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addWindowSize(PacketInputStream input, PacketAnalysisDescriptor root, HashMap map) {
try {
int offset = input.getOffset();
int size = input.readShort();
addNode("Window Size: " + size, offset, offset + 1, root);
map.put(TCP_WIN_SIZE, new Integer(size));
} catch (IOException e) {
// Drop it.
}
}
COM: <s> adds the tcp headers window size field to the analysis descriptor </s>
|
funcom_train/42201799 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean late() {
if (!user.canScore()) return false;
String newTime = JOptionPane.showInputDialog(this, "How many minutes late is FIRST?",
"Running Late?", JOptionPane.WARNING_MESSAGE);
if (newTime == null) return false;
requestFocus();
try {
load();
data.runLate(Integer.parseInt(newTime));
return true;
} catch (Exception e) {
AppLib.printWarn(status.getWindow(), "Invalid offset: must be an integer.");
return false;
}
}
COM: <s> bumps all matches forward or back </s>
|
funcom_train/31017007 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setFocusedCell(Object cell) {
if (this.focusedCell == cell) {
return;
}
// If either the old or new cell is null, repaintCells will ignore it
Object[] cells = new Object[] { this.focusedCell, cell };
this.focusedCell = cell;
repaintCells(cells);
firePropertyChange("focusedCell", cells[0], cells[1]);
}
COM: <s> sets the currently focused cell </s>
|
funcom_train/49092226 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void insertEntry(String s, int p) {
super.insertEntry(s, p);
char t = getTypeOf(s);
types.insert(p, t);
if (t != 'x') {
version++;
idx.insert(1, p);
} else {
idx.insert(0, p);
}
for (Iterator it = listeners.iterator(); it.hasNext();) {
((HtmlStringListener) it.next()).onEntryInsert(this, p, s);
}
}
COM: <s> inserts an entry at p </s>
|
funcom_train/12853489 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JTextArea getJTextArea() {
if (jTextArea == null) {
jTextArea = new JTextArea();
jTextArea.setEditable(false);
// Messages.addListener(new MessagesListener() {
// public void messagesReloaded() {
// jTextArea.setText(Messages.getAllWords());
// }
// });
jTextArea.setText(Messages.getAllWords());
}
return jTextArea;
}
COM: <s> this method initializes j text area </s>
|
funcom_train/3081053 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addAttributeableSupport(Component component, Element element) {
if (component instanceof Attributeable) {
Attributeable attributeable = (Attributeable) component;
String attributeNames[] = attributeable.getAttributeNames();
for (int i = 0; i < attributeNames.length; i++) {
String attributeName = attributeNames[i];
Object attributeValue = attributeable.getAttribute(attributeName);
element.setAttribute(attributeName, String.valueOf(attributeValue));
}
}
}
COM: <s> this will add custom attributes to an element from the </s>
|
funcom_train/46621431 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Label getProjectText() {
if (iProjectText == null) {
try {
iProjectText = new Label();
iProjectText.setName("ProjectText");
iProjectText.setText(" ");
} catch (Throwable iExc) {
handleException(iExc);
}
}
return iProjectText;
}
COM: <s> return the project text property value </s>
|
funcom_train/9529183 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void clone(ISampler templateSampler) {
setAvailableNamedModels(templateSampler.getAvailableNamedModels());
setDataColumns(templateSampler.getDataColumns());
//setLabelDataColumn(templateSampler.getLabelDataColumn());
//setResultDataTable(templateSampler.getResultDataTable());
setSelectedNamedModels(templateSampler.getSelectedNamedModels());
//setSubjectDataColumn(templateSampler.getSubjectDataColumn());
setProperties(templateSampler.getProperties());
setName(templateSampler.getName());
}
COM: <s> add all field values from the provided template sampler to this sampler </s>
|
funcom_train/2344425 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createTableInput(){
for(int i = 0; i < modL.getLabelSize(); i++)
{
featureValues[i].setText(0, modL.getLabel(i));
featureValues[i].setText(1, ((Integer)i).toString());
System.out.println("Adding label: " + modL.getLabel(i));
}
TableSectionSaver();
}
COM: <s> reads the feature port labels and adds them to the table </s>
|
funcom_train/46457633 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void refreshTable() {
Runnable refresh = new Runnable() {
public synchronized void run() {
tableChanged(new TableModelEvent(propsModel, TableModelEvent.HEADER_ROW));
refreshCellWidths();
}
};
if(SwingUtilities.isEventDispatchThread()) {
refresh.run();
} else {
SwingUtilities.invokeLater(refresh);
}
}
COM: <s> refresh the data display in this table </s>
|
funcom_train/4675034 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean hasVoted(String username, int siteId){
String sql = "SELECT username from Votes WHERE username='"+username+"' AND "+"siteId='"+siteId+"'";
try {
Connection conn = this.getConnection();
Statement statement = conn.createStatement();
ResultSet results = statement.executeQuery(sql);
if (results.next()){
return true;
} else {
return false;
}
} catch (SQLException e) {
e.printStackTrace();
}
return false;
}
COM: <s> check if a user has voted on a site </s>
|
funcom_train/18237735 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setUpEmptyQueryLockId(String where, String lockedBy, String task, int id){
MockResultSet resultgetLockIdQuery = preparedStatementHandler.createResultSet(getQueryLockIdQuery());
preparedStatementHandler.prepareResultSet(getQueryLockIdQuery(), resultgetLockIdQuery,new Object[]{where,lockedBy, task} );
}
COM: <s> this will set up an empty result set for the specified </s>
|
funcom_train/624623 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSum() {
Collection intCol = new Vector();
int n = 100;
for (int i = 1; i <= n; i++) {
intCol.add(new IntegerInstance(i));
}
OclCollection c = new CollectionInstance(Type.AnInteger, intCol);
OclInteger result = (OclInteger) c.sum();
assertTrue(result.equals(new IntegerInstance(n * (n + 1) / 2)));
}
COM: <s> tests the ocl sum operation on collections </s>
|
funcom_train/18748313 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JMenu createOptionsMenu() {
JMenu optionsMenu = new JMenu(Options.OPTIONS_MENU_NAME);
optionsMenu.add(options.getItem(Options.PREVIEW_ON_CLOSE_OPTION));
optionsMenu.add(options.getItem(Options.SHOW_VALUE_NODES_OPTION));
return optionsMenu;
}
COM: <s> creates and returns an options menu for the menu bar </s>
|
funcom_train/50878241 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Layer getLayer(String inLayerName){
if (inLayerName == null) return null;
if (myLayers == null) return null;
for (int i=0; i<myLayers.size(); i++){
Layer tempLayer = (Layer) myLayers.elementAt(i);
if (tempLayer.getLayerName().equals(inLayerName)){
return tempLayer;
}
}
return null;
}
COM: <s> retrieve a layer by name </s>
|
funcom_train/31678347 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void evaluateSymbolic() {
String text = theInputField.getText();
Writer buf = new StringWriter();
try {
IEvaluationProvider ep = ProviderFactory.getActiveEvaluationProvider();
if (ep!=null) {
ep.eval(buf, text);
}
theOutputField.setText(buf.toString());
theConsoleField.setText("done.");
} catch (Exception e) {
theConsoleField.setText(e.getMessage());
}
}
COM: <s> executes a symbolic calculation of the contents of the input field </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.