__key__ stringlengths 16 21 | __url__ stringclasses 1 value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/22782939 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setImage(Image img) {
// if there is no change, do nothing
if (img == image) {
return;
}
// unregister from old
if (image != null) {
image.removeListener(myImageListener);
}
// exchange
image = img;
// register to new one
if (image != null) {
image.addListener(myImageListener);
}
// update list
updateList();
}
COM: <s> to exchange image this list is based on </s>
|
funcom_train/49200407 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addBackgroundImagePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_VSpaceMap_backgroundImage_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_VSpaceMap_backgroundImage_feature", "_UI_VSpaceMap_type"),
TransformedPackage.Literals.VSPACE_MAP__BACKGROUND_IMAGE,
true,
false,
true,
null,
null,
null));
}
COM: <s> this adds a property descriptor for the background image feature </s>
|
funcom_train/21610910 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testRealRSSItems() throws IOException, DigesterException {
String[] items = digester.findMatches("item", INPUT_RSS);
printList("items", items);
assertEquals("Unespected number of items.", 11, items.length);
}
COM: <s> tests the digester with a real rss feed reading all the items </s>
|
funcom_train/47209845 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void interact(Planet p) {
//do the gravity calculations
//get the distance
Vector2 R = p.getPos().subVector(pos);
double dist = R.getLength()-p.getRadius();
R = R.getNormalized();
Vector2 v;
double radius = p.getRadius();
double G=240;
if (dist > radius) {
v = R.scale(p.getMass()/(dist*dist)*G);
} else {
v = R.scale(p.getMass() * dist/(radius*radius*radius)*G);
}
accel = accel.addVector(v);
}
COM: <s> interacts the spaceship with the list of planets that the main game loop </s>
|
funcom_train/49248723 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void execute () {
int countDegree = 0,
n = g.getN();
// Counts the number of edges linked to the node
for (int i=0 ; i<n ; i++) {
if (g.e(node,i))
countDegree++;
}
// Shows a reply message with the label and degree of the node
OutputSender.showMessageDialog(
"The degree of node "+
((Label)g.getNodeProperty(node,"Label")).getValue() +
" is: " +
countDegree,
"Node degree",
OutputSender.INFORMATION_MESSAGE
);
}
COM: <s> runs the degree calculation counting how many edges are linked to </s>
|
funcom_train/3703768 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void handleRightClickOnEntity(TreePath selPath, int x, int y) {
DefaultMutableTreeNode node;
NodeEntity entity;
Rectangle bds = tree.getPathBounds(selPath);
node = (DefaultMutableTreeNode) selPath.getLastPathComponent();
entity = (NodeEntity) node.getUserObject();
// xxx
System.out.println("display context menu entity " + entity.getName());
} // of method
COM: <s> handle a right click on an entity </s>
|
funcom_train/9984980 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void isIrreflexive(KBEntry entry) {
for (int i = 0; i < testArray.length; i++) {
// if there is a tuple (x,x) then leave this test
if (testArray[i][0] == testArray[i][1])
// failed -> exit here
return;
}
// we survived ? so it is irreflexive
entry.put("isIrreflexive", Boolean.TRUE);
}
COM: <s> this method tests if the relation is irreflexive </s>
|
funcom_train/21081937 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public List find(Long[] ids) throws DaoException {
if (ids==null) {
return Collections.EMPTY_LIST;
}
List objects = new ArrayList(ids.length);
for (int i = 0; i < ids.length; i++) {
Object foundObject = find(ids[i]);
if (foundObject!=null) {
objects.add(foundObject);
}
}
return objects;
}
COM: <s> retrieve the objects whose ids corresponds to the given ids </s>
|
funcom_train/27719357 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void actionPerformed(ActionEvent e) {
try {
fMethod.invoke(fTarget, new Object[]{e});
} catch (InvocationTargetException ex1) {
// should I throw an unchecked exception?
ex1.printStackTrace();
} catch (IllegalAccessException ex2) {
// should I throw an unchecked exception?
// cannot happen here!?
ex2.printStackTrace();
}
}
COM: <s> invoked when an action occurs </s>
|
funcom_train/34595303 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean immobilises(Pokemon poke) {
if (--m_turns <= 0) {
poke.removeStatus(this);
poke.getField().showMessage(poke.getName() + " woke up!");
return false;
}
poke.getField().showMessage(poke.getName() + " is fast asleep!");
return true;
}
COM: <s> sleep immolilises the pokemon </s>
|
funcom_train/4787563 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setTodayDate(Date today) {
checkWidget();
if ( today == null ) SWT.error(SWT.ERROR_NULL_ARGUMENT);
if ( todayCal == null ) {
todayCal = Calendar.getInstance(locale);
todayCal.setFirstDayOfWeek(firstDayOfWeek);
todayCal.setMinimalDaysInFirstWeek(minimalDaysInFirstWeek);
}
todayCal.setTime(today);
trunc(todayCal);
todayLabel.setText(resources.getString("DateChooser.today")
+ " " + df2.format(todayCal.getTime()));
refreshDisplay();
}
COM: <s> sets the today date </s>
|
funcom_train/3379310 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void encode(OutputStream out) throws IOException {
DerOutputStream tmp = new DerOutputStream();
if (extensionValue == null) {
this.extensionId = PKIXExtensions.BasicConstraints_Id;
if (ca) {
critical = true;
} else {
critical = false;
}
encodeThis();
}
super.encode(tmp);
out.write(tmp.toByteArray());
}
COM: <s> encode this extension value to the output stream </s>
|
funcom_train/46764299 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public RoleModel getRole(final long roleId, final IChainStore chain, final ServiceCall call) throws Exception {
IBeanMethod method = new IBeanMethod() { public Object execute() throws Exception {
return SecurityData.getRole(roleId, chain, call);
}}; return (RoleModel) call(method, call);
}
COM: <s> same transaction return the single role model for the primary key </s>
|
funcom_train/9872409 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel createBtnsPanel(ActionListener listener) {
JPanel panel = new JPanel(new BorderLayout());
JButton cancelButton = new JButton("Cancel");
cancelButton.setActionCommand("cancel-command");
cancelButton.addActionListener(listener);
panel.add(cancelButton, BorderLayout.EAST);
getRootPane().setDefaultButton(cancelButton);
return panel;
}
COM: <s> creates a panel with cancel button </s>
|
funcom_train/50090715 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void initializeGrid(double value) {
for (int i = 0; i < grid.length; i++) {
for (int j = 0; j < grid[0].length; j++) {
for (int k = 0; k < grid[0][0].length; k++) {
grid[k][j][i] = value;
}
}
}
}
COM: <s> method initialise the given grid points with a value </s>
|
funcom_train/38306777 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addTest(String tagId, AbstractTagTest test) {
List<AbstractTagTest> tagTests = testMap.get(tagId);
if (tagTests == null) {
tagTests = new ArrayList<AbstractTagTest>();
testMap.put(tagId, tagTests);
}
tagTests.add(test);
}
COM: <s> adds a test to the given </s>
|
funcom_train/47299117 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {
if ("ImagesOprHttpSoap11Endpoint".equals(portName)) {
setImagesOprHttpSoap11EndpointEndpointAddress(address);
}
else
{ // Unknown Port Name
throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName);
}
}
COM: <s> set the endpoint address for the specified port name </s>
|
funcom_train/50248103 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected int searchForOpeningPeer(int offset, int openingPeer, int closingPeer, IDocument document) throws IOException {
fReader.configureBackwardReader(document, offset, true, true);
int stack= 1;
int c= fReader.read();
while (c != PythonCodeReader.EOF) {
if (c == closingPeer && c != openingPeer)
stack++;
else if (c == openingPeer)
stack--;
if (stack == 0)
return fReader.getOffset();
c= fReader.read();
}
return -1;
}
COM: <s> searches for the opening peer relative to the starting offset </s>
|
funcom_train/31012502 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Collection getAllResponses(long questionid) {
PollManager pollMan = null;
try {
pollMan = ((PollManagerHome)EJBHomeFactory.getInstance().lookup(POLL_MANAGER_JNDI,PollManagerHome.class)).create();
return pollMan.getAllResponses(questionid);
} catch (Exception e) {
e.printStackTrace();
return null;
}
finally {
EJBUtils.remove(pollMan);
}
}
COM: <s> get all responses from the database of a question </s>
|
funcom_train/8231847 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getBackCommand3() {
if (backCommand3 == null) {//GEN-END:|75-getter|0|75-preInit
// write pre-init user code here
backCommand3 = new Command("Salir", Command.OK, 0);//GEN-LINE:|75-getter|1|75-postInit
// write post-init user code here
}//GEN-BEGIN:|75-getter|2|
return backCommand3;
}
COM: <s> returns an initiliazed instance of back command3 component </s>
|
funcom_train/51489829 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double sample(){
double val;
double p=hyp(N_, k_, n_, 0), f=p;
val = unif.sample();
int i =0;
while(val>f){
p=hyp(N_, k_, n_, i+1);
f=f+p;
i=i+1;
}
return i;
}
COM: <s> returns a number hypergeometrically distributed </s>
|
funcom_train/888191 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void showImage (Image image) {
//Turn painting off until operations are complete, to prevent screen glitches.
this.setPainting(false);
this.background.setPainting(false);
this.foreground.setPainting(false);
try {
//Set the foreground image to the given image.
this.foreground.setResource(
createImage(image),
RSRC_IMAGE_BESTFIT
);
}
finally {
//Turn painting back on, even if there were problems.
this.setPainting(true);
this.background.setPainting(true);
this.foreground.setPainting(true);
}
}
COM: <s> fade old image out and new one in simultaneously </s>
|
funcom_train/39184021 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void clearAll(){
booComboBox.setSelectedIndex(0);
clearValue();
clearColumnValue1();
clearColumnValue2();
clearComment();
clearGeneAlias();
clearGeneName();
clearMolecularFunction();
clearStdDev();
clearChromosome();
clearBioProcess();
clearCellComment();
}
COM: <s> clears all the settings </s>
|
funcom_train/19290434 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setHorizontal(boolean isHorizontal) {
dragHorizontally = isHorizontal;
if (originalObjectToReorder != null) {
Maintenance.debugOutputError("WARNING: ReorderableDragNDropHandler.setHorizontal(" + isHorizontal
+ ") has been called in the middle of a drag -- this could cause a lot of trouble! Be forewarned that this isn't a good idea. Object being dragged:"+ originalObjectToReorder);
}
}
COM: <s> warning you should not call this in the middle of a drag </s>
|
funcom_train/5234321 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void logoutFromGuest() throws VMWareRuntimeException {
int jobHandle = Vix.newHandle();
try {
VixLibrary.checkHandle(handle);
jobHandle = vLibraryInterfaceInstance.VixVM_LogoutFromGuest(handle,
null, null);
int err = vLibraryInterfaceInstance.VixJob_Wait(jobHandle,
Vix.Property.NONE);
VixLibrary.checkError(err);
} catch (VMWareRuntimeException e) {
logger.error(e.getMessage());
throw e;
} finally {
VixLibrary.releaseHandle(jobHandle);
}
loggedIn = false;
}
COM: <s> logout from the previous login for this vm </s>
|
funcom_train/8075175 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String getKDTreeSpec() {
KDTree c = getKDTree();
if (c instanceof OptionHandler) {
return c.getClass().getName() + " "
+ Utils.joinOptions(((OptionHandler)c).getOptions());
}
return c.getClass().getName();
}
COM: <s> gets the kdtree specification string which contains the class name of </s>
|
funcom_train/6254663 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void logThrow(Remote impl, Throwable t) {
LogRecord lr = new LogRecord(Levels.FAILED,
logger.isLoggable(Level.FINEST) ?
"{0} locally throws\nclient {1}" :
"{0} locally throws");
lr.setLoggerName(logger.getName());
lr.setSourceClassName(this.getClass().getName());
lr.setSourceMethodName("dispatch");
lr.setParameters(new Object[]{impl, getClientSubject()});
lr.setThrown(t);
logger.log(lr);
}
COM: <s> log the local throw of an inbound call </s>
|
funcom_train/41596081 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean add(Knowledge knowledge) {
if (content.size() < maxSize) {
content.add(knowledge);
for (ContentChangeListener listener : listeners) {
listener.contentChange(new ContentChangeEvent(knowledge, ContentChangeEvent.Type.ADD));
}
return true;
} else {
return false;
}
}
COM: <s> add a knowledge in the basket </s>
|
funcom_train/40359639 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testAuthenticateRuntimeException() throws Exception {
instantiator.addConnector(connectorName, new MockConnector(null,
new ExceptionalAuthenticationManager(null), null, null));
AuthenticationResponse response = manager.authenticate(
connectorName, identity);
assertNotNull(response);
assertFalse(response.isValid());
assertNull(response.getData());
assertNull(response.getGroups());
}
COM: <s> test authenticate throws runtime exception </s>
|
funcom_train/14025462 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void openURL() {
try {
PlatformNativeOpener.openNatively(_urlField.getText());
} catch(IOException ioexc) {
ModalDialog.showErrorDialog("Problem Opening URL", "Sorry, but the operating system was unable to open the URL [" + _urlField.getText() + "].\nPlease make sure that it is a valid URL.");
}
}
COM: <s> opens the typed in url using the host operating systems web browser </s>
|
funcom_train/49756594 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public UPBDeviceI getDeviceNamed(String deviceName) {
if ((deviceName == null) || (deviceName.length() == 0)) return null;
for (UPBDeviceI theDevice: networkDevices) {
if (theDevice == null) continue;
if (theDevice.getDeviceName().equals(deviceName)) return theDevice;
}
return null;
}
COM: <s> given the name of a device find the first instance of a device </s>
|
funcom_train/7282408 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testExtractHeaderValue() {
String value = "value";
String[] headers = {
HTTPHeaderName.CONTENT_RANGE+":" +value,
HTTPHeaderName.CONTENT_RANGE+": " +value,
HTTPHeaderName.CONTENT_LENGTH+": "+value,
HTTPHeaderName.CONTENT_TYPE+": " +value
};
for(int i=0; i<headers.length; i++) {
String curValue = HttpTestUtils.extractHeaderValue(headers[i]);
assertEquals("values should be equal", value, curValue);
}
}
COM: <s> tests the method to extract a header value from an http header </s>
|
funcom_train/3075193 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public IToc getTocForHref(String href, String locale) {
if (href == null || href.equals(""))
return null;
IToc[] tocs = getTocs(locale);
for (int i = 0; i < tocs.length; i++) {
if (tocs[i].getHref().equals(href))
return tocs[i];
}
return null;
}
COM: <s> returns the navigation model for specified toc </s>
|
funcom_train/10299578 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setTextFontStyle(String style) {
boolean isItalic=false;
if (style.compareTo("italic") == 0) {
isItalic = true;
} else {
isItalic = false;
}
textAttribs.removeAttribute(StyleConstants.Italic);
textAttribs.addAttribute(StyleConstants.Italic, new Boolean(isItalic));
setFont(getAttributeSetFont(textAttribs));
Font font = getFont();
}
COM: <s> sets the text font style for the activator text </s>
|
funcom_train/26273809 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean containsService(String contextName, String serviceName) {
checkFactory();
ContextConfig contextConfig = assembly.getContextConfig( contextName );
if ( contextConfig != null ) {
ServiceConfig serviceConfig =
contextConfig.getServicesConfig().getServiceById( serviceName );
if ( serviceConfig != null )
return true;
else
return false;
}
else
return false;
}
COM: <s> implements overrides contains context </s>
|
funcom_train/26533044 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setAxisLabelFont(Font font) {
// check arguments...
if (font==null) {
throw new IllegalArgumentException
("RadarPlot.setAxisLabelFont(...): "
+"null font not allowed.");
}
// make the change...
if (!this.axisLabelFont.equals(font)) {
this.axisLabelFont = font;
notifyListeners(new PlotChangeEvent(this));
}
}
COM: <s> sets the axis label font </s>
|
funcom_train/41724372 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: // private void checkConstructors() {
// Constructor<?>[] constructors = getClass().getDeclaredConstructors();
// for (Constructor<?> constructor : constructors) {
// int modifiers = constructor.getModifiers();
// if (!Modifier.isPrivate(modifiers) && !Modifier.isProtected(modifiers))
// throw new RuntimeException("Subclasses of StaticInstanceObject can only have private constructors");
// }
// }
COM: <s> checks that all constructors are private or protected </s>
|
funcom_train/31930377 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void appendInstruction(OPT_Instruction s) {
currentBBLE.block.appendInstruction(s);
s.position = gc.inlineSequence;
s.bcIndex = instrIndex;
lastInstr = s;
if (DBG_INSTR || DBG_SELECTED) db("-> " + s.bcIndex + ":\t" + s);
}
COM: <s> append an instruction to the current basic block </s>
|
funcom_train/46727370 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object getValue(int modelRefId) {
switch (modelRefId) {
case LOGINMODEL_USERNAME: return getUsername();
case LOGINMODEL_PASSWORD: return getPassword();
case LOGINMODEL_LOCATION: return getLocationRef();
case LOGINMODEL_LANGUAGE: return getLanguageRef();
case LOGINMODEL_CONNECTTO: return getConnectTo();
case LOGINMODEL_CONFIRMPASSWORD: return getConfirmPassword();
case DEFAULT: return null;
default: Log.error(modelRefId);return null;
}
}
COM: <s> get the value for the reference id </s>
|
funcom_train/34424347 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void sendTopicChange(Client client, String newTopic) {
String msg = "NEWTOPIC " + client.getNick() + ": " + newTopic;
Client[] cArray;
synchronized (clients) {
cArray = clients.toArray(new Client[0]);
}
for (Client c : cArray) {
c.send(msg);
}
}
COM: <s> notify all clients that the topic has changed </s>
|
funcom_train/4753816 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean checkCondition() {
if (fPatternCondition != null) {
final EvalEngine engine = EvalEngine.get();
boolean traceMode = false;
try {
traceMode = engine.isTraceMode();
engine.setTraceMode(false);
final IExpr substConditon = fPatternMap
.substitutePatternSymbols(fPatternCondition);
if (engine.evalTrue(substConditon)) {
return checkRHSCondition(engine);
}
return false;
} finally {
engine.setTraceMode(traceMode);
}
}
return true;
}
COM: <s> check if the condition for this pattern matcher evaluates to </s>
|
funcom_train/25049861 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeAndAdd(String toRemove, String toAdd) {
FileList fileList = getFileListInternal();
boolean doneAdd = fileList.getFiles().add(toAdd);
boolean doneRemove = fileList.getFiles().remove(toRemove);
if (doneAdd || doneRemove) {
fileListClient.put(fileListKey.toStore(), fileList.toStore());
}
}
COM: <s> optimized implementation to perform both a remove and an add </s>
|
funcom_train/44223123 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void onRemovePoint(MouseEvent me) {
Point2D p = (Point2D) me.getPoint();
SplineStack stack = basePanel.get_atlasMapper().get_splineStack();
int lvl = getAtlasInternalFrame().get_level();
SplineCurve curve = stack.getCurve(lvl);
activeSP = curve.getPoint(p);
if (activeSP != null) {
curve.removePoint(p);
activeSP = null;
this.repaint();
}
}
COM: <s> remove a spline point on the location where the given </s>
|
funcom_train/22359254 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setOutOfMemory(boolean outOfMemory) {
this.outOfMemory = outOfMemory;
if (isOutOfMemory() && !outOfMemory) {
addError(ProblemFactory.createProblem(Severity.WARNING,
GameDataInspector.GameDataProblemTypes.OUTOFMEMORY.type, null, null, null, null, null,
GameDataInspector.GameDataProblemTypes.OUTOFMEMORY.type.getMessage(), -1));
}
}
COM: <s> sets the value of out of memory </s>
|
funcom_train/47499603 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void visit(Exp n) {
String old_stmt = curr_stmt;
curr_stmt = "";
n.f0.accept(this);
String exp = curr_stmt;
curr_stmt = old_stmt;
if(n.f0.which != 4){
String exp_temp = "TEMP " + temp_num++;
System.out.println("MOVE " + exp_temp + " " + exp);
exp = exp_temp;
}
curr_stmt += exp + " ";
}
COM: <s> f0 stmt exp </s>
|
funcom_train/48877564 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Product create() throws DataException {
String id = null;
try {
id = GUID.generate();
} catch(GUIDException guide) {
throw new DataException("Could not generate a GUID", guide);
}
ConceptualProduct cp = new ConceptualProduct();
cp.setID(id);
Cache cache = Cache.getInstance();
cache.put(id, cp);
return cp;
} //create
COM: <s> creates a new conceptual product business object </s>
|
funcom_train/9550642 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JTextField getJTextFieldCopyright() {
if (jTextFieldCopyright == null) {
jTextFieldCopyright = new JTextField();
jTextFieldCopyright.setLocation(new java.awt.Point(424,102));
jTextFieldCopyright.setFont(new java.awt.Font("SansSerif", java.awt.Font.PLAIN, 10));
jTextFieldCopyright.setSize(new java.awt.Dimension(183,17));
}
return jTextFieldCopyright;
}
COM: <s> this method initializes j text field copyright </s>
|
funcom_train/48877716 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Transaction create() throws DataException {
String id = null;
try {
id = GUID.generate();
} catch(GUIDException guide) {
throw new DataException("Could not generate a GUID", guide);
}
Transaction transaction = new Transaction();
transaction.setID(id);
Cache cache = Cache.getInstance();
cache.put(id, transaction);
return transaction;
} //create
COM: <s> creates a new transaction business object </s>
|
funcom_train/28418680 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isPingAnswered(Controller client, String token) {
String storedToken = tokens.get(clients.indexOf(client));
tokens.remove(clients.indexOf(client));
clients.remove(client);
System.out.println("Checking stored token " + storedToken + " against " + token);
if (storedToken.equals(token)) {
return true;
}
return false;
}
COM: <s> handles a pong </s>
|
funcom_train/15717872 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void put(T1 key, T2 value) {
if (key == null) {
// Do nothing
return;
}
Set<T2> set = map.get(key);
if (set == null) {
set = new HashSet<T2>();
map.put(key, set);
}
set.add(value);
} // end of method
COM: <s> adds the given mapping </s>
|
funcom_train/23852472 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean equalsDb(DbObject obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
@SuppressWarnings("cast")
DbObject other = (DbObject) obj;
if (id != other.id)
return false;
return true;
}
COM: <s> compares to db object for equality on database layer </s>
|
funcom_train/16596066 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void clearSelection() {
for (int i = efs.getAllFFrames().length - 1; i >= 0; i--) {
IFFrame fframe = efs.getFFrame(i);
if (fframe.getSelected() != IFFrame.NOSELECT) {
fframe.setSelected(false);
}
}
}
COM: <s> clear the selection of fframes </s>
|
funcom_train/10618282 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void modifyStyle(int styleBits, boolean value) {
int style = factory.getWindowStyle(hwnd);
int newStyle = style;
if (value) {
newStyle |= styleBits;
} else {
newStyle &= ~styleBits;
}
if (style != newStyle) {
factory.setWindowStyle(hwnd, newStyle);
}
}
COM: <s> modify window style </s>
|
funcom_train/11674440 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String getLangAlt(String lang, String propName) {
XMPProperty prop = meta.getProperty(getQName(propName));
XMPArray array;
if (prop == null) {
return null;
} else {
array = prop.getArrayValue();
if (array != null) {
return array.getLangValue(lang);
} else {
return prop.getValue().toString();
}
}
}
COM: <s> returns a language dependent value </s>
|
funcom_train/10874097 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean flipAndGet(int index) {
assert index >= 0 && index < numBits;
int wordNum = index >> 6; // div 64
int bit = index & 0x3f; // mod 64
long bitmask = 1L << bit;
bits[wordNum] ^= bitmask;
return (bits[wordNum] & bitmask) != 0;
}
COM: <s> flips a bit and returns the resulting bit value </s>
|
funcom_train/19867174 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private State getState() {
if (isSelected() && !isArmed()) {
// normal black tick
return State.SELECTED;
} else if (isSelected() && isArmed()) {
// don't care grey tick
return State.OTHER;
} else {
// normal deselected
return State.NOT_SELECTED;
}
}
COM: <s> the current state is embedded in the selection armed </s>
|
funcom_train/37516317 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean hasSameSignature(CMethod other, CClassType[] substitution) {
if (parameters.length != other.parameters.length) {
return false;
} else {
for (int i = 0; i < parameters.length; i++) {
if (!parameters[i].equals(other.parameters[i], substitution)) {
return false;
}
}
return true;
}
}
COM: <s> has this method the same signature as the one given as argument </s>
|
funcom_train/50221720 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public AbstractTag getTagFromSignature(TagSignature signature) {
for (Iterator e = tags.iterator() ; e.hasNext() ;) {
AbstractTag tag = (AbstractTag) e.next();
if (signature.equals(getGraphWrapper().getSignatureFromTag(tag)))
return tag;
}
MosesAssert.error("Did not find a tag with the required signature: " + signature);
return null;
}
COM: <s> given a signature find the tag that has the same signature </s>
|
funcom_train/20212270 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void enterModal() throws InterruptedException {
_mode = MODAL;
smartUpdate("mode", modeToString(_mode));
boolean hadVM = false;
if ( VM.currentVM().hasVM() )
{
hadVM = true;
VM.currentVM().unlockVM();
}
// no need to synchronized (_mutex) because no racing is possible
Executions.wait( _mutex );
if ( hadVM )
VM.currentVM().lockVM();
}
COM: <s> set mode to modal and suspend this thread </s>
|
funcom_train/41332591 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected CommonControlState getButtonType(Which state) {
switch (state) {
case BACKGROUND_SELECTED:
case BACKGROUND_SELECTED_FOCUSED:
return CommonControlState.DEFAULT;
case BACKGROUND_DISABLED:
return CommonControlState.DISABLED;
case BACKGROUND_ENABLED:
return CommonControlState.ENABLED;
case BACKGROUND_PRESSED:
case BACKGROUND_PRESSED_SELECTED:
case BACKGROUND_PRESSED_SELECTED_FOCUSED:
return CommonControlState.PRESSED;
case BACKGROUND_DISABLED_SELECTED:
return CommonControlState.DISABLED_SELECTED;
}
return null;
}
COM: <s> get the button colors for the state </s>
|
funcom_train/36062026 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public DefinitionMatchResultSet scan(HttpResponseData httpResponse, Date scanStartDate) throws ScriptException, NoDatabaseConnectionException, SQLException, NoSuchMethodException, InvalidDefinitionException{
return scan(httpResponse, null, -1, -1, scanStartDate);
}
COM: <s> perform a scan against the given http response </s>
|
funcom_train/48190230 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void save(PosBlooeyCode entity) {
LogUtil.log("saving PosBlooeyCode instance", Level.INFO, null);
try {
entityManager.persist(entity);
LogUtil.log("save successful", Level.INFO, null);
} catch (RuntimeException re) {
LogUtil.log("save failed", Level.SEVERE, re);
throw re;
}
}
COM: <s> perform an initial save of a previously unsaved pos blooey code entity </s>
|
funcom_train/46678280 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeGap(int col){
String tli = transcription.getBody().getCommonTimeline().getTimelineItemAt(col).getID();
transcription.getBody().removeGap(tli);
fireDataReset();
fireSelectionChanged(0,col,false);
}
COM: <s> removes the gap at the specified position </s>
|
funcom_train/51341945 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void add(final DLN<K, V> entry) {
if (threadLocalBuffers) {
/*
* Per-thread buffers.
*/
getTLB().add(entry);
} else {
/*
* Striped locks.
*/
TLB<DLN<K, V>> t = null;
try {
t = acquire();
t.add(entry);
} catch (InterruptedException ex) {
throw new RuntimeException(ex);
} finally {
if (t != null)
release(t);
}
}
}
COM: <s> buffer an access policy update on a </s>
|
funcom_train/43667225 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JMenuItem getUndoItem() {
if (undoItem == null) {
undoItem = new JMenuItem("Undo");
undoItem.setFont(new Font(Constants.FONT, Constants.FONT_STYLE_TOOL, 12));
undoItem.setAccelerator(KeyStroke.getKeyStroke(
KeyEvent.VK_Z, ActionEvent.CTRL_MASK));
}
undoItem.setEnabled(false);
return undoItem;
}
COM: <s> this method initializes undo item </s>
|
funcom_train/26570154 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void draw(Graphics target) {
animation.animate();
// At this point the state of the sprite may
// have changed due to events generated in
// the animation method.
if (isVisible() && animation.hasStopped() == false) {
draw(target, animation.getCurrentFrameNumber());
}
}
COM: <s> draws the sprite to the given graphics context </s>
|
funcom_train/38329022 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void init() {
ruleDirectory = new File(this.baseDirectory + rule);
if (!ruleDirectory.exists()) {
ruleDirectory.mkdirs();
}
ruleArchive = new File(this.baseDirectory + rule + archive);
if (!ruleArchive.exists()) {
ruleArchive.mkdirs();
}
rulesetDirectory = new File(this.baseDirectory + ruleset);
if (!rulesetDirectory.exists()) {
rulesetDirectory.mkdirs();
}
rulesetArchive = new File(this.baseDirectory + ruleset + archive);
if (!rulesetArchive.exists()) {
rulesetArchive.mkdirs();
}
}
COM: <s> method will create the necessary folders for saving rules and rulesets </s>
|
funcom_train/1723586 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean delete(FileRef fileToDelete) throws Exception {
File delFile = new File(fileToDelete.getAbsolutePath());
if(delFile.exists()) {
delFile.delete();
if(listeners.size() > 0) {
fireContentChanged(
new FileSystemEvent(this, FileSystemEvent.ACTION_DELETE,
FileSystemEvent.PROCESS_END, new FileRef[] {fileToDelete}));
}
}
return true;
}
COM: <s> delete a single file </s>
|
funcom_train/46791366 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected COSObject swapIn() {
try {
COSObject loadedObject = stGetDoc().load(this);
if (loadedObject == null) {
loadedObject = COSNull.create();
}
return loadedObject;
} catch (IOException e) {
throw new COSSwapException("io error reading object " + getKey(), e); //$NON-NLS-1$
} catch (COSLoadException e) {
throw new COSSwapException(
"parse error reading object " + getKey(), e); //$NON-NLS-1$
}
}
COM: <s> swap in the data for the indirect object </s>
|
funcom_train/45251165 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getAggregateIdForSets(IWorkingSet[] typedResult) {
StringBuffer buffer = new StringBuffer();
buffer.append("Aggregate:"); //$NON-NLS-1$
for (int i = 0; i < typedResult.length; i++) {
buffer.append(typedResult[i].getName()).append(':');
}
return buffer.toString();
}
COM: <s> create a string that represents the name of the aggregate set composed of </s>
|
funcom_train/48206718 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Sound loadSound(String id, String path) throws SpartanException{
if(path == null || path.length() == 0)
throw new SpartanException("Sound resource [" + id + "] has invalid path");
Sound sound = null;
try {
sound = new Sound(path);
} catch (SlickException e) {
throw new SpartanException("Could not load sound", e);
}
if(soundMap.containsKey(id)){
throw new SpartanException("Id already exists");
}
this.soundMap.put(id, sound);
return sound;
}
COM: <s> load a sound into the resource manager identifying it with the id </s>
|
funcom_train/20839070 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void processRevision(final String line) {
if (line.startsWith("revision")) {
revision = line.substring(9);
status = GET_DATE;
} else if (line.startsWith("======")) {
//There were no revisions in this changelog
//entry so lets move onto next file
status = GET_FILE;
}
}
COM: <s> process a line while in revision state </s>
|
funcom_train/23285495 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getZonePlayerIcon(ZonePlayer zp) throws MalformedURLException {
List<?> icons = zp.getMediaRendererDevice().getUPNPDevice().getDeviceIcons();
if (icons == null || icons.isEmpty()) {
LOG.error("No icon for zone with ID '"+zp.getId()+"' found.");
return thishost + "/images/default-sonos-icon.png";
}
DeviceIcon icon = (DeviceIcon)icons.get(0);
return icon.getUrl().toExternalForm();
}
COM: <s> convenience method for getting a zone players icon </s>
|
funcom_train/38315635 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int doEndTag() throws JspTagException {
String val = null;
JLCPUser user = (JLCPUser) pageContext.getAttribute("currentBuddy");
if (user == null)
return SKIP_PAGE;
val = user.getFirstName();
JspWriter out = pageContext.getOut();
try {
out.write(val);
} catch (IOException e) {
throw new JspTagException("Error writing to page");
}
return EVAL_PAGE;
}
COM: <s> get the user from the parent tag and print out the users id </s>
|
funcom_train/44790240 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void marshall(OutputStream stream) {
try {
JAXBContext context = JAXBContext.newInstance(StyleLibrary.class,
NamedStyle.class);
Marshaller m = context.createMarshaller();
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
m.marshal(this, stream);
} catch (JAXBException e) {
e.printStackTrace();
}
}
COM: <s> save the library using the given stream </s>
|
funcom_train/5689343 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void wrapAndSend(byte [] data, int length) {
m_log.debug("IrOBEXReceiver", "entered wrapAndSend");
byte [] message = _tinyTP.wrap(data, 0, length);
try {
_irlmp.send(_conn.getRemoteLsap(), _conn.getLocalLsap(),
message, 0, message.length);
} catch ( Exception e ) {
m_log.error("IrOBEXReceiver",
"IrLMP.send threw an exception: " + e.toString());
}
}
COM: <s> wrap a message in tiny tp headers and send it via ir lmp </s>
|
funcom_train/3462565 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addChild(EntityInterface child) {
if (child.getParent()!=null) child.getParent().removeChild(child);
child.setParent(this);
getChildList().add(child);
if (child.needsPreUpdate()) getPreUpdateList().add(child);
if (child.needsDoUpdate()) getDoUpdateList().add(child);
if (listeners!=null) listeners.childAdded(this,child);
}
COM: <s> sets the specified entity as a children of this object </s>
|
funcom_train/37503410 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addEnemy(CombatController other) {
int oldValue;
if (enemies == null) {
enemies = new java.util.HashSet();
oldValue = 0;
} else {
oldValue = enemies.size();
}
enemies.add(other);
int newValue = enemies.size();
if (oldValue != newValue) {
propertyChangeSupport
.firePropertyChange(PROPERTY_ENEMIES, oldValue, newValue);
}
}
COM: <s> explicitly add an enemy to the known enemies </s>
|
funcom_train/18644603 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean equals(Object obj) {
boolean ret=false;
if (obj instanceof SessionId) {
SessionId other=(SessionId)obj;
if (other.getServiceInstanceId().equals(getServiceInstanceId()) &&
other.getSessionId().equals(getSessionId()) &&
other.getServiceDescriptionName().equals(
getServiceDescriptionName())) {
ret = true;
}
}
return(ret);
}
COM: <s> this method checks whether the supplied object is the same </s>
|
funcom_train/47867417 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected MNPLinkTransferPacket createLT(InputStream data, int length) throws IOException {
if (data == null)
return null;
MNPLinkTransferPacket packet = createLTSend();
length = Math.min(length, MNPLinkTransferPacket.MAX_DATA_LENGTH);
if (length > 0) {
byte[] buf = new byte[length];
int count = 0;
int offset = 0;
do {
count = data.read(buf, offset, length);
if (count == -1)
break;
offset += count;
length -= count;
} while (length > 0);
packet.setData(buf, 0, offset);
}
return packet;
}
COM: <s> create a link transfer packet </s>
|
funcom_train/18896836 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public long getNumberOfTriples() {
//ensure the graph is not closed
if (this.closed) {
throw new JRDFClientException("Graph has been closed.");
}
try {
return answer.getRowCount();
}
catch (TuplesException tuplesException) {
//rethrow
throw new JRDFClientException("Could not determine number of Triples.",
tuplesException);
}
}
COM: <s> returns the number of rows in the answer </s>
|
funcom_train/8089155 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setStdDev(int col, int row, double value) {
if ( (col >= 0) && (col < getColCount())
&& (row >= 0) && (row < getRowCount()) )
m_StdDev[row][col] = value;
}
COM: <s> sets the std deviation at the given position if the position is valid </s>
|
funcom_train/24112930 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createSelectionListener(final TableColumn tableColumn, final ColumnSortInfo sortInfo) {
tableColumn.addSelectionListener(new SelectionAdapter() {
/**
* {@inheritDoc}
* @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
*/
@Override
public void widgetSelected(final SelectionEvent e) {
sortUsing(sortInfo);
}
});
}
COM: <s> adds a selection listener to the given column in order to </s>
|
funcom_train/45640830 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Document transformToDocument(Map<String, DataModel> dataModels) {
Element rootElement = transformToSummaryElement(dataModels, rootNode);
Document document = org.dom4j.DocumentFactory.getInstance().createDocument(encoding);
document.setRootElement(rootElement);
return document;
}
COM: <s> main entry point for transforming data </s>
|
funcom_train/48144217 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Integer3Vector multiply(final Integer3Vector v) {
return new Integer3Vector(
vector[1]*v.vector[2]-v.vector[1]*vector[2],
vector[2]*v.vector[0]-v.vector[2]*vector[0],
vector[0]*v.vector[1]-v.vector[0]*vector[1]
);
}
COM: <s> returns the vector product of this vector and another </s>
|
funcom_train/802652 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addURIPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_SupDataType_uRI_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_SupDataType_uRI_feature", "_UI_SupDataType_type"),
MzdataPackage.Literals.SUP_DATA_TYPE__URI,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the uri feature </s>
|
funcom_train/3150238 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Query customizeQuery(Object anObject, PersistenceBroker aBroker, CollectionDescriptor aCod, QueryByCriteria aQuery) {;
Criteria crit = new Criteria();
crit.addEqualTo("productsOptionsValuesId", String.valueOf(((ProductsAttributes) anObject).getOptionsValuesId()));
return new QueryByCriteria(ProductsOptionsValues.class, crit);
}
COM: <s> return a new query based on the original query the originator object and </s>
|
funcom_train/12118347 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void connEtoC61(java.util.EventObject arg1) {
try {
// user code begin {1}
// user code end
this.vediRivaluta_OkJButtonAction_actionPerformed(arg1);
// user code begin {2}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {3}
// user code end
handleException(ivjExc);
}
}
COM: <s> conn eto c61 vedi rivaluta </s>
|
funcom_train/17210524 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean loadNetworkHttp(String url, boolean tab) {
String dl;
dl = fileIO.getPage(url);
boolean success = ns.edgeListParse(dl, url, tab);
if (success) {
String dlNodes = fileIO.getPage(url+".n");
ns.nodeListParse(dlNodes, tab);
p.loadMethod = 1;
p.setFilename(url);
}
return success;
}
COM: <s> load a new network from net </s>
|
funcom_train/15723986 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void goForewards() {
URL currentAddress = getPage();
if (forward.size() > 0) {
URL nextAddress = (URL) forward.remove(forward.size() - 1);
if (setDocument(nextAddress) && currentAddress != null) {
backward.add(currentAddress);
}
}
}
COM: <s> this is called when the foreward button is pressed </s>
|
funcom_train/47358824 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public FractionalPermissions learnTemporaryStateInfo(String new_state, boolean forFrame) {
if(isBottom())
return this;
if(forFrame) {
List<FractionalPermission> new_permissions =
PermissionSet.learnStateInfo(framePermissions, new_state);
return createPermissions(permissions, new_permissions, constraints);
}
else {
List<FractionalPermission> new_permissions =
PermissionSet.learnStateInfo(permissions, new_state);
return createPermissions(new_permissions, framePermissions, constraints);
}
}
COM: <s> for each permission this method returns a new fractional permissions </s>
|
funcom_train/29648201 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Item getItemByName(String name) {
//1 character (or 0?) isn't much to go off of...
if (name.length() < 2)
return null;
name = name.toLowerCase();
for (Item item : inv) {
if (item.getName().toLowerCase().indexOf(name) != -1) {
return item;
}
}
//Couldn't find anything.
return null;
}
COM: <s> a useful method that returns an via a partial or full name </s>
|
funcom_train/43437661 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addTransmitter(RedstoneEtherNode tx) {
try {
txLock.writeLock();
LoggerRedstoneWireless.getInstance("RedstoneEtherFrequency").write("addTransmitter("+tx.toString()+")", LoggerRedstoneWireless.LogLevel.DEBUG);
txs.put(tx,tx);
txLock.writeUnlock();
} catch (InterruptedException e) {
LoggerRedstoneWireless.getInstance("WirelessRedstone: "+this.getClass().toString()).writeStackTrace(e);
}
}
COM: <s> add transmitter node to the register </s>
|
funcom_train/2882296 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void signalResult(ServiceURL sURL) {
try {
System.out.println(sfCompleteName() + " Found " + sURL);
} catch (Exception ex) {ex.printStackTrace();}
storeResult(sURL);
this.sendEvent(sURL.getServiceType().toString());
}
COM: <s> signal the arrival of a new result </s>
|
funcom_train/5475180 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JButton getBt_1() {
if (bt_1 == null) {
bt_1 = new JButton();
bt_1.setMnemonic(java.awt.event.KeyEvent.VK_C);
bt_1.setToolTipText("Cancelar Operacao");
bt_1.setIcon(new ImageIcon(getClass().getResource("/org/compiere/com/uniinfo/components/images/End24.gif")));
bt_1.setText("Cancelar");
}
return bt_1;
}
COM: <s> this method initializes bt 1 </s>
|
funcom_train/32070284 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean addCustomerCustomfield(CustomerCustomfield customerCustomfield) {
boolean addOk = getCustomerCustomfields().add(customerCustomfield);
if (addOk) {
customerCustomfield.setCustomfieldType((CustomfieldType)this);
} else {
if (logger.isWarnEnabled()) {
logger.warn("add returned false");
}
}
return addOk;
}
COM: <s> add the passed customer customfield to the customfield type collection </s>
|
funcom_train/19536079 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void installInitToolGameSettings(InitToolGameSettings settings, File cacheDir) {
installPropertySettings(settings, cacheDir);
settings.setCombatantLookupAvailable(loadCombatantLookupTable(settings.getDatabaseName()) != null);
Utilities.incrementProgressModel(1);
loadInitToolGameSettings(settings, cacheDir);
}
COM: <s> install init tool game settings into the a given instance and database </s>
|
funcom_train/50345442 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String convertToXmlComment(String comment){
StringBuffer buf = new StringBuffer();
for (int k = 0; k < comment.length(); k++) {
if (comment.startsWith("\n", k)) {
buf.append("<?p?>");
}
else {
buf.append(comment.substring(k, k + 1));
}
}
return buf.toString();
}
COM: <s> convert standard string to xml string one character at a time expect when </s>
|
funcom_train/49760844 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JCheckBox getJCheckBoxArchitecture() {
if (jCheckBoxArchitecture == null) {
jCheckBoxArchitecture = new JCheckBox();
jCheckBoxArchitecture.setBounds(new Rectangle(5, 200, 126, 24));
jCheckBoxArchitecture.setText("Architecture");
jCheckBoxArchitecture.addItemListener(myListener);
}
return jCheckBoxArchitecture;
}
COM: <s> this method initializes j check box architecture </s>
|
funcom_train/12192595 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testMaxCountSetInvalid() throws Exception {
CacheBuilder builder = new CacheBuilderImpl();
try {
builder.setMaxCount(-1);
fail("Did not detect maxCount was not set.");
} catch (IllegalArgumentException expected) {
assertEquals("maxCount must be > 0 but is -1", expected.getMessage());
}
}
COM: <s> ensure that max count cannot be set to an invalid value </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.