__key__ stringlengths 16 21 | __url__ stringclasses 1 value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/8554774 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testCountSimilarity() {
System.out.println("countSimilarity");
float expResult = 0.0F;
float result = Relevances.countSimilarity();
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 count similarity method of class dirindex </s>
|
funcom_train/24376434 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public StringBuffer getIdListFromIds(List ids) {
StringBuffer idList = new StringBuffer();
Iterator iter = ids.iterator();
while (iter.hasNext()) {
String id = (String) iter.next();
idList.append("'" + id + "'");
if (iter.hasNext()) {
idList.append(",");
}
}
return idList;
}
COM: <s> get comma delimited list of quoted id from list of ids </s>
|
funcom_train/49200553 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addLinkedCategoryPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_ModuleCategoryLink_linkedCategory_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_ModuleCategoryLink_linkedCategory_feature", "_UI_ModuleCategoryLink_type"),
TransformedPackage.Literals.MODULE_CATEGORY_LINK__LINKED_CATEGORY,
true,
false,
true,
null,
null,
null));
}
COM: <s> this adds a property descriptor for the linked category feature </s>
|
funcom_train/36231080 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public IPoint3D getLocalOriginInMainRef() {
IPoint3D origine = null;
try {
origine = getTransformedPointInverse(Geometry.newPoint3D(0.0, 0.0, 0.0));
} catch (Exception e) {
System.out.println("Problem in transformeInverse ");
e.printStackTrace();
}
return origine;
}
COM: <s> please use this method to get the local origine in the general reference </s>
|
funcom_train/36519881 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void init() {
stack.clear();
trail.clear();
// pdl.init();
B0 = stack.top();
CPFTimeStamp = Long.MIN_VALUE;
// Creates an initial choice point frame.
Term[] noarg = {};
stack.create(noarg, null);
stack.setTR(trail.top());
stack.setTimeStamp(++CPFTimeStamp);
stack.setBP(new Failure(control));
stack.setB0(B0);
exceptionRaised = 0;
charConversion = "off";
debug = "off";
unknown = "error";
doubleQuotes = "codes";
printStackTrace = "off";
exception = SymbolTerm.makeSymbol("$no_ball");
startRuntime = System.currentTimeMillis();
previousRuntime = 0;
userOutput.flush();
userError.flush();
currentInput = userInput;
currentOutput = userOutput;
}
COM: <s> initializes this prolog engine </s>
|
funcom_train/10873839 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int putAll(K key, Collection<? extends V> vals) {
final Set<V> theSet;
if (theMap.containsKey(key)) {
theSet = theMap.get(key);
} else {
theSet = new HashSet<V>(23);
theMap.put(key, theSet);
}
theSet.addAll(vals);
return theSet.size();
}
COM: <s> adds multiple vals to the set associated with key in the map </s>
|
funcom_train/40413200 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void stopEditing() {
if (root != null) {
hideMenu();
hideIndicator(dropIndicator);
disposeEditorsEtc();
if (overlay.isAttached()) {
sync.stopListening();
RootPanel.get().remove(overlay);
}
status.hide();
previousRoot = root;
root = null;
}
}
COM: <s> stop editing our root container </s>
|
funcom_train/18105164 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void suspendCurrent() {
Display d;
synchronized (displays) {
if (foreground == noForeground || suspended != null ||
allSuspended || preempted != null) {
return;
}
d = foreground.getDisplay();
d.midletEventListener.pauseMIDlet(d.getMIDlet());
suspended = foreground;
deactivate(d.getMIDlet());
}
}
COM: <s> suspend the current foreground midlet and return to the </s>
|
funcom_train/44945926 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JMenuBar menuBar() {
final JMenuBar menuBar = new JMenuBar();
menuBar.setBorder(EMPHASISED_BORDER);
final JMenu menu = new JMenu("Instance Store");
menu.add(connectAction);
menu.add(connectAndLoadAction);
menu.add(loadAction);
menu.add(retrieveAllAction);
menu.add(individualsCountAction);
menu.add(reasonerClearAction);
menu.add(new InstanceStoreAction("Quit", QUIT));
menuBar.add(menu);
return menuBar;
}
COM: <s> the global menu bar </s>
|
funcom_train/40620991 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void onResize(int width, int height) {
// Center the line in the shell
int lineWidth = DOM.getElementPropertyInt(lineElement, "offsetWidth");
lineLeftOffset = (width / 2) - (lineWidth / 2);
DOM.setStyleAttribute(lineElement, "left", lineLeftOffset + "px");
// Draw the other components
drawLabels();
drawTicks();
drawKnob();
}
COM: <s> this method is called when the dimensions of the parent element change </s>
|
funcom_train/11650532 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeArgument(String argName) {
PropertyIterator iter = getArguments().iterator();
while (iter.hasNext()) {
LDAPArgument arg = (LDAPArgument) iter.next().getObjectValue();
if (arg.getName().equals(argName)) {
iter.remove();
}
}
}
COM: <s> remove the argument with the specified name </s>
|
funcom_train/50217486 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Text createJavaField(Composite parent, final JavaFieldType type) {
String labelText = (type == JavaFieldType.CLASS) ? "Class:" : "Method:";
Text textField = createLabelTextField(parent, labelText, true);
// Browse Button
Button browseButton = new Button(parent, SWT.NONE);
browseButton.setText("Browse...");
browseButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
browseButtonClicked(type);
}
});
return textField;
}
COM: <s> create java field with label text browse button </s>
|
funcom_train/42718992 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getType(String value,Scope scope) {
String primitiveType=TypeLibrary.getPrimitiveType(value,scope);
//if the value is a valid primitive type, return it
if(primitiveType!=null) return primitiveType;
else if(this.userCallableTypes.contains(value)) return "Type";
//TODO: check complex type (ie. objects)
return null;
}
COM: <s> gets the compiler type of value </s>
|
funcom_train/47184316 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String addCPTCode(ProcedureBean proc) throws FormValidationException {
validator.validate(proc);
try {
if (cptDAO.addCPTCode(proc)) {
return "Success: " + proc.getCPTCode() + " - " + proc.getDescription() + " added";
} else
return "The database has become corrupt. Please contact the system administrator for assistance.";
} catch (DBException e) {
e.printStackTrace();
return e.getMessage();
} catch (iTrustException e) {
return e.getMessage();
}
}
COM: <s> adds a new cpt code med procedure </s>
|
funcom_train/48561424 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getOkCommand8() {
if (okCommand8 == null) {//GEN-END:|457-getter|0|457-preInit
// write pre-init user code here
okCommand8 = new Command("OK", Command.OK, 0);//GEN-LINE:|457-getter|1|457-postInit
// write post-init user code here
}//GEN-BEGIN:|457-getter|2|
return okCommand8;
}
COM: <s> returns an initiliazed instance of ok command8 component </s>
|
funcom_train/7522988 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Address determineCoordinator() {
Address ret=null;
synchronized(members) {
if(members != null && members.size() > 1) {
for(int i=0; i < members.size(); i++)
if(!local_addr.equals(members.elementAt(i)))
return (Address)members.elementAt(i);
}
}
return ret;
}
COM: <s> return the first element of members which is not me </s>
|
funcom_train/7280476 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void runRequeryChecks(QueryRequest qr) {
assertEquals("unexpected query", "\\", qr.getQuery());
assertNull("xml should be empty", qr.getRichQuery());
assertTrue("should have URNs", qr.hasQueryUrns());
assertTrue("should be a requery", qr.isLimeRequery());
}
COM: <s> runs standard checks on requeries </s>
|
funcom_train/33080495 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void info() {
TableModel model = dataTable.getModel();
int rows = model.getRowCount();
int count = 0;
for (int i = 0; i < rows; i++) {
if (((Boolean) model.getValueAt(i, 0)).booleanValue())
count++;
}
statusBar.setStatusLine(String.valueOf(count));
} // info
COM: <s> list number of rows selected </s>
|
funcom_train/31834776 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean testComponent(final Object comp) {
return ((comp != null)
&& ((isValidForProcessing(comp, Frame.class)
&& checkIfIdentifierMatch(((Frame)comp).getTitle()))
|| (isValidForProcessing(comp, Dialog.class)
&& checkIfIdentifierMatch(((Dialog)comp).getTitle()))));
}
COM: <s> method that returns true if the given component matches the search </s>
|
funcom_train/3603438 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setVisible(Control child, boolean visible) {
boolean wasEmpty= isEmpty();
child.setVisible(visible);
child.setData(VISIBILITY, new Boolean(visible));
if (wasEmpty != isEmpty()) {
// recursively walk up
Composite parent= getParent();
if (parent instanceof Splitter) {
Splitter sp= (Splitter) parent;
sp.setVisible(this, visible);
sp.layout();
}
} else {
layout();
}
}
COM: <s> sets the visibility of the given child in this splitter </s>
|
funcom_train/2891270 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void handleStroke(Stroke stroke) {
slideWasChanged = true;
if (stroke.getDeletionTime() != null) {
if (Debug.mode) {
Debug.stream.println("getDeletionTime != null");
}
try {
stroke.setDeletionTime(null);
currentSlide.removeElement(stroke);
} catch (Exception e) {
if (Debug.mode) {
e.printStackTrace(Debug.stream);
}
}
repaint(stroke.getBounds());
} else {
if (currentSlide == null) {
currentSlide = new Slide();
}
currentSlide.addElement(stroke);
draw(stroke);
}
}
COM: <s> handles a stroke received by the inca access module </s>
|
funcom_train/10706567 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void test_Create_WithThrowRuntimeException() {
// Regression for Harmony-2434
InvocationObject invocationObject = new InvocationObject();
SampleListener listener = EventHandler.create(SampleListener.class,invocationObject, "throwRuntimeException");
try {
listener.fireSampleEvent(new SampleEvent("bean"));
fail("Expected RuntimeException thrown");
} catch (RuntimeException re) {
// Expected
}
}
COM: <s> file sample event scenario by throwing runtime exception </s>
|
funcom_train/43899058 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testAttributeObject() throws IllegalFilterException {
MockDataObject testFeature = new MockDataObject(10, "diez");
// Test integer attribute
org.opengis.filter.expression.Expression testAttribute = new AttributeExpressionImpl(
"intVal");
assertEquals(new Integer(10), testAttribute.evaluate(testFeature));
// Test string attribute
testAttribute = new AttributeExpressionImpl("stringVal");
assertEquals("diez", testAttribute.evaluate(testFeature));
}
COM: <s> tests the attribute expression over an object other than feature </s>
|
funcom_train/45354633 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JComboBox getCbSupplier() {
if (cbSupplier == null) {
cbSupplier = new JComboBox();
cbSupplier.setBounds(16, 31, 120, 18);
cbSupplier.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent e) {
UpdateList();
}
});
}
return cbSupplier;
}
COM: <s> this method initializes j combo box </s>
|
funcom_train/9057149 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testContainsCoursePositive() {
SelectedCourse sc;
CourseBase cb;
try {
cb = new CourseBase();
sc = new SelectedCourse(cb.findCourse("01005"), 1);
sp.add(sc);
} catch (Exception e) {
fail(e.toString());
return;
}
boolean test1 = sp.contains(sc);
boolean test2 = sp.contains(new Course("01005", " "));
assertTrue(test1 && test2);
}
COM: <s> a positive test to see if a study plan contains a specific course </s>
|
funcom_train/40851413 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getPercGiven() {
if(this.getNbGames()==null || this.getNbGames().intValue()==0) return "N/A";
double perc = ((double)this.getNbGiven().intValue()) / this.getNbGames().intValue();
return NumberUtils.getPrettyPrintForm(perc * 100) + "%";
}
COM: <s> return a pretty print form of the percentage of given games </s>
|
funcom_train/43317992 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void saveConfiguration(final File configurationStore) {
ObjectOutputStream out = null;
try {
out = new ObjectOutputStream(new BufferedOutputStream(
new FileOutputStream(configurationStore)));
out.writeObject(registeredAspects);
out.writeObject(versionsForAspects);
out.flush();
}
catch (final IOException e) {
Log.error("Problems during writing to configuration store!", e); //$NON-NLS-1$
}
finally {
if (out != null) {
try {
out.close();
}
catch (final IOException e) {
Log.error(
"Problems during writing to configuration store!", e); //$NON-NLS-1$
}
}
}
}
COM: <s> save the configuration of the aspect registry to the given file </s>
|
funcom_train/23173216 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String seconds2TimeString (int seconds) {
int secondPart = seconds % 60;
StringBuilder sBuilder = new StringBuilder ();
sBuilder.append (minutes2TimeString (seconds / 60));
sBuilder.append (":");
if (secondPart < 10) sBuilder.append ("0");
sBuilder.append (secondPart);
return sBuilder.toString ();
}
COM: <s> converts the specified seconds value to a time string hh mm ss </s>
|
funcom_train/51635778 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void installSemanticHighlighting() {
if (fSemanticManager == null) {
fSemanticManager= new SemanticHighlightingManager();
fSemanticManager.install(this, (JavaSourceViewer) getSourceViewer(), JavaPlugin.getDefault().getJavaTextTools().getColorManager(), getPreferenceStore());
}
}
COM: <s> install semantic highlighting </s>
|
funcom_train/27946974 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String parseLevelOfTheory(String line) {
StringTokenizer st1 = new StringTokenizer(line, "\\");
// Must contain at least 6 tokens
if (st1.countTokens() < 6) {
return null;
}
// Skip first four tokens
for (int i=0; i < 4; ++i) {
st1.nextToken();
}
return st1.nextToken() + "/" + st1.nextToken();
}
COM: <s> select the theory and basis set from the first archive line </s>
|
funcom_train/4542713 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void processAlterSequenceRename() throws HsqlException {
String name = tokenizer.getSimpleName();
tokenizer.getThis(Token.T_RENAME);
tokenizer.getThis(Token.T_TO);
String newName = tokenizer.getSimpleName();
boolean isQuoted = tokenizer.wasQuotedIdentifier();
database.schemaManager.renameSchema(name, newName, isQuoted);
}
COM: <s> handles alter sequence </s>
|
funcom_train/24121641 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void write(OutputStream out) throws IOException {
int size = this.getSize();
WMFConstants.writeLittleEndian(out, size);
WMFConstants.writeLittleEndian(out, WMFConstants.WMF_RECORD_MOVETO);
WMFConstants.writeLittleEndian(out, y);
WMFConstants.writeLittleEndian(out, x);
}
COM: <s> writes the moveto record to a stream </s>
|
funcom_train/23235650 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void draw(Graphics g, int destx, int desty, int x, int y, int w, int h) {
g.drawImage(image, destx, desty, destx + w, desty + h, x, y, x + w, y + h, null);
}
COM: <s> draws the image </s>
|
funcom_train/24516143 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void getFile(Long length, String filename){
try {
FileOutputStream fos=new FileOutputStream(filename, true);
InputStream in = connection.getInputStream();
for(int i=0;i<length;i++){
fos.write((byte)in.read());
}
} catch (IOException e) {
failed(address.toString());
}
}
COM: <s> downloads whole file </s>
|
funcom_train/16912240 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void commitChanges() {
for (TextNode node : selectionList) {
node.getTextObject().setFontName(textType);
node.getTextObject().setFontSize(textSize);
node.getTextObject().setItalic(italic);
node.getTextObject().setBold(bold);
node.update();
}
}
COM: <s> commit changes to underlying nodes </s>
|
funcom_train/10572637 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testChild1Optional() throws Throwable {
doc = AllEltDocument.Factory.newInstance();
AllT elt = doc.addNewAllElt();
elt.setChild2("doo");
elt.setChild3(BigInteger.ONE);
try {
assertTrue(doc.validate(validateOptions));
}
catch (Throwable t) {
showErrors();
throw t;
}
}
COM: <s> instance should be valid w child1 missing </s>
|
funcom_train/11730222 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getUnusedPrefix() throws RepositoryException {
Set prefixes = new HashSet();
prefixes.addAll(Arrays.asList(session.getNamespacePrefixes()));
String prefix = "myapp";
int count = 0;
while (prefixes.contains(prefix + count)) {
count++;
}
return prefix + count;
}
COM: <s> returns a namespace prefix that is not in use </s>
|
funcom_train/3082434 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getString(ClassLoader classLoader, Class componentClass, Class propertyClass, Object propertyValue) throws CssInvalidValueException {
CssPropertyPeer propertyPeer = getPropertyPeer(propertyClass);
if (propertyPeer == null) {
throw new CssInvalidValueException("Peer not found for property class: " + propertyClass, null, -1);
}
return propertyPeer.getStyleString(classLoader, componentClass, propertyValue);
}
COM: <s> retrieves a css property value string for a given java object </s>
|
funcom_train/12836433 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setConversationID(String convID) {
try {
attName = soapEnv.createName(CONVERSATION_ID, soapPrefix, soapNamespace);
rootElement.addChildElement(attName).addTextNode(convID);
} catch (SOAPException e) {
e.printStackTrace();
}
}
COM: <s> method to set the fipa conversation id parameter </s>
|
funcom_train/25334123 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetHighestEnsemblSchemaVersion() throws Exception {
DBRegistry instance = new DBRegistry();
assertTrue(instance.getHighestEnsemblSchemaVersion()==0);
instance.setConfiguration(DataSource.ENSEMBLDB);
assertTrue(instance.getHighestEnsemblSchemaVersion()==0);
instance = this.createInitializedMockRegistry();
assertTrue(instance.getHighestEnsemblSchemaVersion()!=0);
assertTrue(instance.getHighestEnsemblSchemaVersion()==60);
}
COM: <s> test of get highest ensembl schema version method of class dbregistry </s>
|
funcom_train/886706 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void handlePageCount(Element node, LaTeXDocumentPortion ldp, Context oc) {
// TODO: Obey attributes!
// Note: Actually LastPage refers to the page number of the last page, not the number of pages
if (config.useLastpage()) {
bUsesPageCount = true;
ldp.append("\\pageref{LastPage}");
}
else {
ldp.append("?");
}
}
COM: <s> p process a page count field text page count tag p </s>
|
funcom_train/9679170 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addChildDir(List result, File child) {
String childPackage = packageName;
if (childPackage.length() > 0) {
childPackage += '.';
}
childPackage += child.getName();
result.add(JDevSourceDir.getSource(child, childPackage));
}
COM: <s> properly makes a code jdev source dir code out of the given child </s>
|
funcom_train/4918071 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testFlagButNoCommand() throws Exception {
this.record_Factory("command", "option", "o", false);
try {
this.doTest("-o");
fail("Should not parse");
} catch (OfficeFloorNoCommandsException ex) {
assertEquals("Incorrect cause", "Must specify a command",
ex.getMessage());
}
}
COM: <s> must have command even if flags provided </s>
|
funcom_train/10345453 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void decode(Decoder dec) throws ASN1Exception, IOException {
clear();
super.decode(dec);
ASN1Sequence seq;
ASN1OpenType t;
Iterator i;
Object o;
for (i = tmp_.iterator(); i.hasNext();) {
seq = (ASN1Sequence) i.next();
t = (ASN1OpenType) seq.get(1);
o = t.getInnerType();
seq.set(1, o);
}
/*
* We don't need the temporary list anymore.
*/
tmp_ = null;
}
COM: <s> this method reads the der encoded asn </s>
|
funcom_train/16786146 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createTable() throws RQLException {
String sql = null;
try {
Statement stmt = connection.createStatement();
sql = "CREATE TABLE " + name + " (pageId varchar primary key, headline varchar, template varchar, createdBy varchar, createdOn varchar, pageGuid varchar)";
stmt.executeUpdate(sql);
} catch (SQLException ex) {
throw new RQLException("Error in sql " + sql, ex);
}
}
COM: <s> creates the table within the database </s>
|
funcom_train/25194188 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Attribute getAttributeFromPathName(Object objectToGetFrom, String attributePathName) {
GetAttributeVisitor visitor = new GetAttributeVisitor();
visitor.setAttributePathName(attributePathName);
visitor.setObject(objectToGetFrom);
this.visit(visitor);
return visitor.getAttribute();
}
COM: <s> this method gets an attribute with the desired attributepath name </s>
|
funcom_train/45116410 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void saveDefinitions(int sortSection, int sortHeader, ParametersOrder paramOrder, int activeTab, double[] headerRatio) {
this.sortSection = sortSection;
this.sortHeader = sortHeader;
this.paramOrder = paramOrder;
this.activeTab = activeTab;
this.headersRatio = new double[headerRatio.length];
System.arraycopy(headerRatio, 0, this.headersRatio, 0, headerRatio.length);
}
COM: <s> save the sorting definitions from the current parameters panel </s>
|
funcom_train/9233090 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setMapTypeControlVisible(boolean on) {
if (on) {
execute("map.mapTypeControl = new GMapTypeControl(); map.addControl(map.mapTypeControl);");
} else {
execute("if(map.mapTypeControl) {map.removeControl(map.mapTypeControl); delete map.mapTypeControl;}");
}
}
COM: <s> shows hieds the map type control </s>
|
funcom_train/48151456 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void reset() {
super.reset();
getRecordTable().append("\tY\tM\tL");
walkGraph.reset();
for (int i = 0; i < 3; i++)
walkRV[i].reset();
rvGraph.reset();
rvTable.reset();
}
COM: <s> this method resets the experiment including the random walk graph the </s>
|
funcom_train/4745043 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean checkDeleteImage(String imageID) {
DeleteImageAction deleteImgAction =
actionRegistry.getCoreAction(DeleteImageAction.class);
deleteImgAction.setProperties(authenticator.getUsername(),
authenticator.getHash(), imageID);
return actionRegistry.accessControl(deleteImgAction);
}
COM: <s> checks if it is possible to delete the given image </s>
|
funcom_train/8096312 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testMissingClass() {
int i;
for (i = FIRST_CLASSTYPE; i <= LAST_CLASSTYPE; i++) {
// does the scheme support this type of class at all?
if (!canPredict(i))
continue;
// 20% missing
checkMissingClass(i, 20, true);
// 100% missing
if (m_handleMissingClass[i])
checkMissingClass(i, 100, true);
}
}
COM: <s> tests whether the scheme can handle missing class values 20 and </s>
|
funcom_train/2505232 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void checkRouteRequests() {
int index = 0;
RouteRequest routeRequest;
while (index < requestCache.getSize()) {
routeRequest = requestCache.getRequest(index);
if ((routeRequest.getReceived() + Constants.ROUTING_TIMEOUT) < System.currentTimeMillis()) {
requestCache.removeRequest(index);
stm.removeMember(routeRequest.getDestination());
routeRequest = null;
} else
index++;
}
}
COM: <s> checks all open route requests for their timeout </s>
|
funcom_train/9079097 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeNeighbor(Peer neighbor) {
// We can't use the remove function of the arraylist because it will
// destroy the object (sets it to null) so we basically need to copy the
// whole arraylist into a new one avoiding the node to be removed
ArrayList<Peer> newNeighbors = new ArrayList<Peer>();
for (Iterator<Peer> it = neighbors.iterator(); it.hasNext();) {
Peer n = it.next();
if (!n.equals(neighbor))
newNeighbors.add(n);
}
neighbors = newNeighbors;
}
COM: <s> remove the given peer from the list of neighbors </s>
|
funcom_train/7617593 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Drawable findDrawableByLayerId(int id) {
final ChildDrawable[] layers = mLayerState.mChildren;
for (int i = mLayerState.mNum - 1; i >= 0; i--) {
if (layers[i].mId == id) {
return layers[i].mDrawable;
}
}
return null;
}
COM: <s> look for a layer with the given id and returns its </s>
|
funcom_train/4889464 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeUsersFromGroup(MuleGroup mg){
// get all users from db and remove this group from them!!!
for(int i = 0; i < mg.usersV.size(); i++){
MuleUser mu = getUserNoPassFromDB(((MuleGroupUser)mg.usersV.elementAt(i)).name);
if(mu != null){
mu.removeGroup(mg.name);
db.set(mu);
db.commit();
}
}
}
COM: <s> removes all users from the group </s>
|
funcom_train/4786268 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setSelection(int column, int row) {
int topRowDelta = computeTopRowDelta(row);
if (topRowDelta != 0) {
setTopRow(topRow + topRowDelta);
row += -1 * topRowDelta;
internalSetSelection(column, row, true);
} else {
if (row == currentRow)
internalSetSelection(column, row, false);
else {
if (fireRequestRowChangeEvent())
internalSetSelection(column, row, true);
}
}
}
COM: <s> method set selection </s>
|
funcom_train/48390133 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public HandlerRegistration addEventRemoveClickHandler(com.smartgwt.client.widgets.calendar.events.EventRemoveClickHandler handler) {
if(getHandlerCount(com.smartgwt.client.widgets.calendar.events.CalendarEventRemoveClick.getType()) == 0) setupEventRemoveClickEvent();
return doAddHandler(handler, com.smartgwt.client.widgets.calendar.events.CalendarEventRemoveClick.getType());
}
COM: <s> add a event remove click handler </s>
|
funcom_train/45715973 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setYtemDefName(String ytemDefName) {
String oldName = this.ytemDefName;
this.ytemDefName = ytemDefName;
changed = true;
OJ.getEventProcessor().fireYtemDefChangedEvent(oldName, ytemDefName, YtemDefChangedEventOJ.YTEMDEF_EDITED);//1.12.2008
}
COM: <s> change name of this ytem def </s>
|
funcom_train/16769564 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void pushMessage(IMessage message) throws IOException {
for (IConsumer consumer : consumers) {
try {
IPushableConsumer pcon = (IPushableConsumer) consumer;
pcon.pushMessage(this, message);
} catch (Throwable t) {
if (t instanceof IOException) {
// Pass this along
throw (IOException) t;
}
log.error("Exception when pushing message to consumer", t);
}
}
}
COM: <s> pushes a message out to all the pushable consumers </s>
|
funcom_train/35741776 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean send(Message msg) throws IOException {
if (closed) {
throw new IOException("broken connection");
}
if (Logging.SHOW_FINE && LOG.isLoggable(Level.FINE)) {
LOG.fine("Sending a Message");
}
msgr.sendMessageB(msg, null, null);
return true;
}
COM: <s> sends a message </s>
|
funcom_train/3290149 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public MMObjectNode addRawAudio(int id,int status,int format,int speed,int channels) {
RawAudios bul=(RawAudios)parent.Vwms.mmb.getMMObject("rawaudios");
MMObjectNode node=bul.getNewNode("system");
node.setValue("id",id);
node.setValue("status",status);
node.setValue("format",format);
node.setValue("speed",speed);
node.setValue("channels",channels);
bul.insert("system",node);
return node;
}
COM: <s> creates a raw audio node for an audiopart </s>
|
funcom_train/12640681 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void register(ProgressEntry te) {
int i;
boolean localChanged = false;
for (i = 0; i < streams.length; i++) {
synchronized (this) {
if (streams[i] == null) {
streams[i] = te;
te.what = NEW;
te.index = i;
localChanged = true;
break;
}
}
}
if (localChanged) {
setChanged();
/* only notify w/o holding lock */
notifyObservers(te);
}
}
COM: <s> call this routine to register a new url for the progress </s>
|
funcom_train/11373797 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void logUpdateMasterKey(DelegationKey key) throws IOException {
writeLock();
try {
if (isInSafeMode()) {
throw new SafeModeException(
"Cannot log master key update in safe mode", safeMode);
}
getEditLog().logUpdateMasterKey(key);
} finally {
writeUnlock();
}
getEditLog().logSync();
}
COM: <s> log the update master key operation to edit logs </s>
|
funcom_train/2357592 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString() {
StringBuffer buf = new StringBuffer();
for (int i=0;i<getCoordinates().length;i++) {
short[] location = getLocation(getCoordinates()[i]);
//location may be null if some coordinates are masked (see MaskedGrid)
if (location !=null){
buf.append(location[0]);
buf.append('-');
buf.append(location[1]);
buf.append(' ');
}
}
if(buf.length() > 0) buf.deleteCharAt(buf.length()-1);
return buf.toString();
}
COM: <s> gets a string representation of the grids contents in </s>
|
funcom_train/11686663 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isDynamicKey(String keyValue) {
boolean dynamicKey = false;
final char startExpression = '{';
final char endExpression = '}';
char firstChar = keyValue.charAt(0);
char lastChar = keyValue.charAt(keyValue.length() - 1);
if (startExpression == firstChar && endExpression == lastChar) {
dynamicKey = true;
}
return dynamicKey;
}
COM: <s> validate the given key to identify whether it is static or dynamic key </s>
|
funcom_train/31517074 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean performOk() {
// Get the preference store
IPreferenceStore preferenceStore = getPreferenceStore();
// Set the values from the fields
if (fieldMaxIncidents != null) {
preferenceStore.setValue(Globals.gPrefMaxIncidents, fieldMaxIncidents.getText());
Globals.gMaxIncidents = Integer.parseInt(fieldMaxIncidents.getText());
}
// Return true to allow dialog to close
return true;
}
COM: <s> provide a required method that if the user clicks on the ok </s>
|
funcom_train/4360048 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String findObjectName(String type) {
if (type.equals("org.apache.catalina.core.StandardContext")) {
return "StandardContext";
} else if (type.equals("org.apache.catalina.core.StandardEngine")) {
return "Engine";
} else if (type.equals("org.apache.catalina.core.StandardHost")) {
return "Host";
} else {
return null;
}
}
COM: <s> return the managed bean definition for the specified bean type </s>
|
funcom_train/48990613 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void assert_column(final String fieldName, final Object expectedValue) {
if (fieldName == null) { throw new IllegalArgumentException("FieldName: <" + fieldName + "> or expectedValue: <"
+ expectedValue + "> params cannot be null."); }
final Object actualValue = column_value(fieldName);
Assert.assertEquals(expectedValue, actualValue);
}
COM: <s> compares actual value in database field code field name code with given </s>
|
funcom_train/25197291 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void testNoAdd(String in) throws Exception {
p.push(new TString(in, null));
new AddPeriod("add.period$").execute(p, null, null);
assertEquals(in, p.popString(null).getValue());
}
COM: <s> run a test case where no period is added </s>
|
funcom_train/28651430 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Segment crossSegment (Ray r) {
if (r == null) return null;
double d2, d2min = Double.MAX_VALUE;
Segment crossSegment = null;;
Iterator i = segments.iterator ();
while (i.hasNext ()) {
Segment s = (Segment) i.next ();
if (r.cross (s)) {
d2 = distance2 (r, s);
if (d2 < d2min) {
crossSegment = s;
d2min = d2;
}
}
}
return crossSegment;
}
COM: <s> returns the first intersection with the ray r </s>
|
funcom_train/13996526 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void calculateHashCode() {
final int hashMultiplier = 59;
hashCode = 12;
hashCode *= hashMultiplier;
hashCode += id.hashCode();
hashCode *= hashMultiplier;
hashCode += type.hashCode();
hashCode *= hashMultiplier;
hashCode += (isPersistent()) ? 1 : 0;
}
COM: <s> calculates the hashcode </s>
|
funcom_train/41164067 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void save(CoMenuType entity) {
EntityManagerHelper.log("saving CoMenuType instance", Level.INFO, null);
try {
getEntityManager().persist(entity);
EntityManagerHelper.log("save successful", Level.INFO, null);
} catch (RuntimeException re) {
EntityManagerHelper.log("save failed", Level.SEVERE, re);
throw re;
}
}
COM: <s> perform an initial save of a previously unsaved co menu type entity </s>
|
funcom_train/12184143 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testEmbeddedSingleAndDoubleQuoting() throws Exception {
final String str = "some \"quotable\" and 'quoted' words";
final String expected =
StringUtils.SINGLE_QUOTE +
"some \"quotable\" and 'quoted' words" +
StringUtils.SINGLE_QUOTE;
assertTrue("String quoting failed",
doQuoteIfNeededTest(str, expected));
}
COM: <s> tests that a string which contains double and single quotes is </s>
|
funcom_train/3373260 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public AttributeSet copyAttributes() {
AttributeSet[] as = getAttributes();
MutableAttributeSet a = new SimpleAttributeSet();
int n = 0;
for (int i = as.length - 1; i >= 0; i--) {
a.addAttributes(as[i]);
}
return a;
}
COM: <s> copies a set of attributes </s>
|
funcom_train/1426658 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getPlayerApm( final int playerIndex ) {
if ( playerIds[ playerIndex ] >= playerIdActionsCounts.length )
return 0; // Computers
return getPlayerApmForActionsCount( playerIndex, playerIdActionsCounts[ playerIds[ playerIndex ] ] - playerIdActionsCountBefore2Mins[ playerIds[ playerIndex ] ] );
}
COM: <s> returns the apm of a player </s>
|
funcom_train/14654539 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void resumeRhythmSimulation() {
JMenuItem pause_simulation = M_Menu
.getJMenuItem(MainMenu.PAUSE_SIMULATION);
network.getEnvironment().getRhythm().requestResume();
if (loaders != null) {
int max = loaders.length;
for (int index = 0; index < max; index++) {
loaders[index].getActor().getRhythm().requestResume();
}
}
pause_simulation.setText(MainMenu.SUSPEND_ENVIRONMENT);
pause_simulation.setName(MainMenu.C_0);
}
COM: <s> resume rhythm all clients </s>
|
funcom_train/42035931 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void shrink(float width, float height) {
this.width -= width;
this.height -= height;
if(this.width < 0 || this.height < 0) {
Debug.warning("StaticObject.shrink", "Dimensions < 0");
if(this.width < 0) this.width = 0;
if(this.height < 0) this.height = 0;
}
}
COM: <s> shrinks the object by a given amount </s>
|
funcom_train/18110694 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JSplitPane getXmlContentsSplitPane() {
if (xmlContentsSplitPane == null) {
xmlContentsSplitPane = new JSplitPane();
xmlContentsSplitPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
xmlContentsSplitPane.setDividerLocation(130);
xmlContentsSplitPane.setBottomComponent(getJSplitPane1());
xmlContentsSplitPane.setTopComponent(getAttributeTablePanel());
}
return xmlContentsSplitPane;
}
COM: <s> this method initializes xml contents split pane </s>
|
funcom_train/19629111 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean nextFrame() {
synchronized (this) {
if (animationDone) {
return false;
}
animationDone = true;
for (Queue<Pair<Integer, Integer>> next : frames.values()) {
if (next.size() > 1) {
next.remove();
animationDone = false;
}
}
return !animationDone;
}
}
COM: <s> increase the frame number </s>
|
funcom_train/28329431 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean supports(final Throwable exception) {
// TODO Auto-generated method stub
return ((present && ExceptionUtils.indexOfThrowable(exception, mysqlExcepClass)>-1) //JDBC 3.0 (j2se 5.0)
|| (jdbc4Present && ExceptionUtils.indexOfThrowable(exception, mysqlJdbc4ExcepClass)>-1));//JDBC 4.0 (j2se 6.0)
}
COM: <s> p if my sql classes are present in wrapped exception p </s>
|
funcom_train/13392684 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private RemoteEventClientConsumer createRemotePMEventListener(long id) {
RemoteEventClientConsumer remoteEventManager = new RemoteEventClientConsumer();
remoteEventManager.setEventIdToCatch(id);
remoteEventManager.setEventService(eventService);
remoteEventManager.setDiscoveryManagement(discoManager);
return remoteEventManager;
}
COM: <s> this is a factory method for setting up a remote event listener </s>
|
funcom_train/25138827 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getRank() {
if (getParent().equals(_super._invalid)) {
return 0;
} else {
int rank = 0;
Field index = getParent().getFirstChild();
while (!index.equals(_super._invalid)) {
if (index.equals(this)) {
return rank;
}
++rank;
index = index.getNextSibling();
}
return -1;
}
}
COM: <s> return the rank of this field among its siblings </s>
|
funcom_train/22367704 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setLabel(JLabel label, Integer score) {
label.setText(null);
IIconFactory icon = score != null ? getIcon(score) : null;
// TODO: ICONOS Sacar a un renderer
label.setIcon(icon != null ? icon.getIcon(lookAndFeelManager.getCurrentLookAndFeel().getPaintForColorMutableIcon(label, false)) : null);
}
COM: <s> sets proper icon and text </s>
|
funcom_train/9276087 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testFile() throws IOException, SQLException {
setSystemProperty(FILE_PROP, getCanonicalPath(fileStreamFile));
bootDerby();
getTestConfiguration().shutdownEngine();
closeStreams();
assertNotEmpty(fileStreamFile);
assertIsEmpty(methodStreamFile);
assertIsEmpty(fieldStreamFile);
assertIsEmpty(errStreamFile);
}
COM: <s> test the derby </s>
|
funcom_train/44773410 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void processTransiton() {
//Calls the listeners through the transitionEvent
if(iTransitionListener!=null&&(iTransitionListener.size()>0)){
//make a copy of the listeners in case
//anyone adds/removes listeners
List listeners = null;
synchronized(this){
listeners = this.iTransitionListener;
}
TransitionEvent event = new TransitionEvent(this,this);
for(int i=0;i<listeners.size();i++){
((ITransitionListener)listeners.get(i)).processTransition(event);
}
}
}
COM: <s> calls the listeners by fireing the transition event </s>
|
funcom_train/46012308 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Vector buildConfigNodes(Node node) {
try {
console.logEntry();
Vector results = new Vector();
Node temp = null;
NodeList children = node.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
temp = children.item(i);
if (temp.getNodeType() == Node.ELEMENT_NODE) {
results.add(buildSingleConfigNode(temp));
}
}
return results;
} finally {
console.logExit();
}
}
COM: <s> adding properties to all config nodes </s>
|
funcom_train/29618359 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JScrollPane getJPlantProtectionScrollPane() {
if (jPlantProtectionScrollPane == null) {
jPlantProtectionScrollPane = new JScrollPane();
jPlantProtectionScrollPane.setBounds(315, 23, 250, 87);
jPlantProtectionScrollPane.setViewportView(getJPlantProtectionField());
}
return jPlantProtectionScrollPane;
}
COM: <s> this method initializes j plant protection scroll pane </s>
|
funcom_train/45050802 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetParameterNames() throws Exception {
PortletUnitPortletRequest request = new PortletUnitPortletRequest();
request.setParameter("p1", "p1value");
request.setParameter("p2", "p2value");
request.setParameter("p3", "p3value");
Enumeration parameterNames = request.getParameterNames();
List list = EnumerationUtils.toList(parameterNames);
assertEquals(3,list.size());
assertTrue(list.contains("p1"));
assertTrue(list.contains("p2"));
assertTrue(list.contains("p3"));
assertFalse(list.contains("bogus"));
}
COM: <s> make sure the get paramter names returns something expected </s>
|
funcom_train/20109054 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Bitmap get(final int key) {
Bitmap ret = memCache.get(key);
if (ret != null || diskCache == null)
return ret;
ret = diskCache.get(String.valueOf(key));
if (ret != null)
memCache.put(key, ret);
return ret;
}
COM: <s> retrieve an image from the cache </s>
|
funcom_train/13956639 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected NSArray _fetchNextBatch() {
if (hasNextBatch()) {
NSRange range = _rangeForOffset(currentObjectFetchCount);
NSArray nextBatch = batchWithRange(range);
currentObjectFetchCount += range.length();
return nextBatch;
} else {
throw new IllegalStateException("Iterator is exhausted");
}
}
COM: <s> fetches the next batch unconditionally </s>
|
funcom_train/19966040 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getBackCommand() {
if (backCommand == null) {//GEN-END:|121-getter|0|121-preInit
// write pre-init user code here
backCommand = new Command("Cancel", Command.BACK, 0);//GEN-LINE:|121-getter|1|121-postInit
// write post-init user code here
}//GEN-BEGIN:|121-getter|2|
return backCommand;
}
COM: <s> returns an initiliazed instance of back command component </s>
|
funcom_train/23689284 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Value lookupVarValue(String x) {
TypeChecker.print("lookupVarValue(..)");
for (ScopeEntry entry : scopes){
TypeChecker.print("#= ");
Value v = entry.getValue(x);
if (v != null) return v;
// Should not always search the lower scopes.
if(!entry.isFallThrough())
break;
}
//throw new TypeException("Unexpected error");
return null; // Should never happen
// throw new RuntimeException("Variable " + x + " is not initialized.");
}
COM: <s> lookup the value of variable x </s>
|
funcom_train/2626982 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void test02( ) {
assertEquals( m_ripper.monitor, null );
m_ripper.setMonitor( null );
assertEquals( m_ripper.monitor, null );
m_ripper.setMonitor( m_monitor1 );
assertSame( m_ripper.monitor, m_monitor1 );
m_ripper.setMonitor( m_monitor2 );
assertSame( m_ripper.monitor, m_monitor2 );
m_ripper.setMonitor( null );
assertEquals( m_ripper.monitor, null );
}
COM: <s> this function tests the ripper set monitor function </s>
|
funcom_train/37610733 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void save() throws DisplayMessageConsoleException, EditorException {
// The UI should never call save if there is no associated file,
// but check anyway.
if (m_file == null) {
throw new EditorException(
"Can't save a buffer that has no associated file");
}
save(m_file);
}
COM: <s> update the buffers file from the text source </s>
|
funcom_train/31930784 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton createButton(Icon icon, String toolTip) {
JButton b = new JButton(null, icon);
b.setToolTipText(toolTip);
b.setRolloverEnabled(true);
b.setBorderPainted(true);
b.setContentAreaFilled(true);
return b;
}
COM: <s> create a button with an code icon code and code tool tip code </s>
|
funcom_train/17200820 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void checkMemberAccess(int type) {
SecurityManager security = System.getSecurityManager();
if (security != null) {
security.checkMemberAccess(this, type);
String packageName = getPackageName();
if(packageName != "") {
security.checkPackageAccess(packageName);
}
}
}
COM: <s> utility for security checks </s>
|
funcom_train/10357178 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void writeTo(OutputStream out) throws IOException, MessagingException {
headers.writeTo(out, null);
// add the separater between the headers and the data portion.
out.write('\r');
out.write('\n');
// write this out without getting an encoding stream
getDataHandler().writeTo(out);
out.flush();
}
COM: <s> write the body part content to the stream without applying </s>
|
funcom_train/24050104 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void computeLabelling() {
for (Iterator nodeit = graph.getNodes().iterator(); nodeit.hasNext();) {
Node node = (Node) nodeit.next();
// if (node.getCoordinate().equals(new Coordinate(222, 100)) )
// Debug.addWatch(node.getEdges());
node.getEdges().computeLabelling(arg);
}
mergeSymLabels();
updateNodeLabelling();
}
COM: <s> compute initial labelling for all directed edges at each node </s>
|
funcom_train/20531401 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setSize(int newSize) {
if (newSize == 0) {
clear();
return;
}
if (newSize <= elementCount) {
for (int i = newSize; i < elementCount; i++) {
elementData[i] = null;
}
elementCount = newSize;
return;
}
for (; newSize > elementData.length; ) {
increaseCapacity();
}
elementCount = newSize;
}
COM: <s> increase or reduce the size setting discarded or added elements to null </s>
|
funcom_train/3925281 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean visitObject( Object a ) {
if ( a instanceof PROTObase ) {
savePROTO( (PROTObase)a );
} else if ( a instanceof PROTOInstance ) {
savePROTOinstance( (PROTOInstance)a );
} else if ( a instanceof DEFUSENode ) {
saveDEFUSENode( (DEFUSENode)a );
} else if ( a instanceof ROUTE ) {
saveROUTE( (ROUTE)a );
}
return( true );
}
COM: <s> visit an object in the scene save proto def use and route info </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.