__key__ stringlengths 16 21 | __url__ stringclasses 1
value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/4125801 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isConnected() {
Map map = getGame().getMap();
Tile tile = getTile();
for (Direction direction : Direction.values()) {
Tile t = map.getNeighbourOrNull(direction, tile);
if (t != null && t.getType().isWater() && t.isConnected()) {
return true;
}
}
return false;
}
COM: <s> returns whether this colony is connected by water to europe </s>
|
funcom_train/4912933 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void assertSeedings(Seeding expected, Seeding actual) {
assertEquals(expected.getLeft(), actual.getLeft());
assertEquals(expected.getDownloaded(), actual.getDownloaded());
assertEquals(expected.getPeerId(), actual.getPeerId());
assertEquals(expected.isSeeder(), actual.isSeeder());
}
COM: <s> asserts two user torrent entities </s>
|
funcom_train/50327535 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void requestThrottleSetup(LocoAddress address, boolean control) {
// The PR2 has only one slot, hence
// doesn't require an interaction with the command
// station to allocate slot, so immediately trigger the callback.
activeAddress = (DccLocoAddress) address;
log.debug("new Pr2Throttle for "+activeAddress);
notifyThrottleKnown(new Pr2Throttle((LocoNetSystemConnectionMemo)adapterMemo, activeAddress), activeAddress);
}
COM: <s> get a new throttle object </s>
|
funcom_train/31749971 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setAccount(Account account) {
if (account == null)
throw new IllegalArgumentException("account must not be null!");
if (!ACCOUNT_TYPE_ID_CASH_BOX_PRIMARY.equals(JDOHelper.getObjectId(account.getAccountType())))
throw new IllegalArgumentException("account.accountType is invalid! expected " + ACCOUNT_TYPE_ID_CASH_BOX_PRIMARY + " but found " + account.getAccountType());
this.account = account;
}
COM: <s> set the primary account of this code cash box tray account pair code </s>
|
funcom_train/48739257 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int doEndTag() throws JspException {
// Perform the requested redirect
HttpServletResponse response =
(HttpServletResponse) pageContext.getResponse();
try {
response.sendRedirect(response.encodeRedirectURL(href));
} catch (IOException e) {
throw new JspException
(messages.getMessage("common.io", e.toString()));
}
// Skip the remainder of the current page
return (SKIP_PAGE);
}
COM: <s> render a redirect to the specified hyperlink and skip the </s>
|
funcom_train/36430375 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void configure(long newcheckInterval) {
long newInterval = (newcheckInterval/10)*10;
if (checkInterval.get() != newInterval) {
checkInterval.set(newInterval);
if (newInterval <= 0) {
stop();
// No more active monitoring
lastTime.set(System.currentTimeMillis());
} else {
// Start if necessary
start();
}
}
}
COM: <s> change check interval between </s>
|
funcom_train/35071518 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getErrorMessage() {
StringBuffer invalidBuffer = new StringBuffer(100);
ValidationResult[] results = toArray();
for (ValidationResult result : results) {
if (result.isError()) {
if (invalidBuffer.length() > 0) {
invalidBuffer.append("\n");
}
invalidBuffer.append(result.getMessage());
}
}
return invalidBuffer.toString();
}
COM: <s> returns a string of all errors concatinated with a carriage return line feed </s>
|
funcom_train/39319756 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT:
public void AddActionPerformed(java.awt.event.ActionEvent evt) {/*_I*/System.out.println("TerpPaint.AddActionPerformed("+"evt="+evt+")");/*I_*/
alllayers.addActionPerformed(evt);
// ming 4.26
// center.setBufferedImage(center.getBufferedImage());
// ming 4.26 end
}
COM: <s> this function adds a new layer </s>
|
funcom_train/2524899 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int doStartTag() throws JspException {
messageInfo = (MessageInfo)pageContext.getAttribute(getMessageinfo());
attachmentinfo = new AttachmentInfo();
try {
multipart = (Multipart)messageInfo.getMessage().getContent();
numParts = multipart.getCount();
} catch (Exception ex) {
throw new JspException(ex.getMessage());
}
getPart();
return BodyTag.EVAL_BODY_TAG;
}
COM: <s> method for processing the start of the tag </s>
|
funcom_train/3170112 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Position key() {
return position();
/*
udanax-top.st:55301:TableStepper methodsFor: 'smalltalk: operations'!
{Position} key
"A TableStepper actually enumerates the associations of a table. Through the normal Stepper protocol, it makes available the range element of the current association. Through this additional protocol, it make accessible the key of the current association. This message returns the same object as TwoStepper::other, the only difference being the static knowledge that it's a Position."
^ self position!
*/
}
COM: <s> a table stepper actually enumerates the associations of a table </s>
|
funcom_train/15452710 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Poll getPoll(String question) {
Poll pollDb = null;
//Defines the HQL Query
Query query = session
.createQuery("from poll in class org.cesar.resc.pollManagement.api.Poll where poll.title = :title");
query.setString("title", question);
List list = query.list();
//Verify results
if (list.size() > 0) {
pollDb = (Poll) query.list().get(0);
}
return pollDb;
}
COM: <s> this method retrieves the poll with respective title </s>
|
funcom_train/22536457 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Image getRoleImage(){
if(imageFilename != null){
File imageFile = new File(imageFilename);
// Load the image depending on whether it is declared relevant to the plugin
// directory or in an absolute path
if(imageFile.isAbsolute()){
imageFilename = imageFilename.replace('\\','/');
if(roleImage != null){
roleImage.dispose();
}
roleImage = new Image(PlatformUI.getWorkbench().getDisplay(), imageFilename);
}
else{
roleImage = Activator.getImageDescriptor(imageFilename).createImage();
}
}
return roleImage;
}
COM: <s> retrieve the role image </s>
|
funcom_train/9646500 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Label createLabel(Composite parent) {
Label label = new Label(parent, SWT.BORDER | SWT.CENTER);
label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
label.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
label.setForeground(display.getSystemColor(SWT.COLOR_YELLOW));
label.setFont(font);
return label;
}
COM: <s> creates a label with font color </s>
|
funcom_train/119864 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addProperNameProvider(ProperNameProvider provider){
properNameProvider.add(provider);
Enumeration keys = provider.getKeys();
while (keys.hasMoreElements()){
String key = (String)keys.nextElement();
String value = provider.getString(key);
if (key != null && value != null){
defaultNames.put(key, value);
}
}
}
COM: <s> adds the propernameprovider and asks him for </s>
|
funcom_train/37230036 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public OPU_R25_RESULTLoop addResult() {
OPU_R25_RESULTLoop loop = new OPU_R25_RESULTLoop( this );
if( findSegment("OBR") == null ) {
getOBR(); // force creation of required order request segment
}
vSegments.add(loop);
return loop;
}
COM: <s> add a result loop </s>
|
funcom_train/32987484 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Integer getOtherAtomOfBond(IQueryAtomContainer container, int whichAtom, int whichOne) {
IAtom atom = container.getAtom(whichAtom);
IBond bond = (IBond)container.getConnectedBondsList(atom).get(whichOne);
return container.getAtomNumber(bond.getConnectedAtom(atom));
}
COM: <s> get the atom attached to the specified atom by the specified bond </s>
|
funcom_train/2615369 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void run() {
try {
init();
int gameStatus = 0;
while (gameStatus < 5 || gameStatus == 100) {
switch (gameStatus) {
case 0:
gameStatus = gameMenu(screen);
break;
case 1:
gameStatus = gameLoop();
break;
case 2:
gameControls(screen);
gameStatus = 0;
break;
case 3:
gameOptions(screen);
gameStatus = 0;
break;
case 4:
gameDiploma(screen);
gameStatus = 0;
break;
case 100:
gameHiddenTest(screen);
gameStatus = 0;
break;
}
}
}
finally {
screen.restoreScreen();
}
}
COM: <s> calls init and game loop </s>
|
funcom_train/5598430 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setRangeAdjustable(final boolean b) {
ensureSliderCreated();
if (horizontal) {
slider.setAdjustable(SwingConstants.EAST, b);
slider.setAdjustable(SwingConstants.WEST, b);
} else {
slider.setAdjustable(SwingConstants.NORTH, b);
slider.setAdjustable(SwingConstants.SOUTH, b);
}
}
COM: <s> specify if the user is allowed to edit or drag the sliders dimension </s>
|
funcom_train/21324678 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Population breedPopulation(EvolutionState state) {
for (int x = 0; x < state.population.subpops.length; x++)
for (int y = 0; y < state.population.subpops[x].individuals.length; y++)
((VectorIndividualCGP) state.population.subpops[x].individuals[y]).expression = null;
return super.breedPopulation(state);
}
COM: <s> reset the expressions that were computed and stored in the previous </s>
|
funcom_train/25351851 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void actionPerformed(ActionEvent evt) {
progressBar.setIndeterminate(true);
startButton.setEnabled(false);
//Instances of javax.swing.SwingWorker are not reusuable, so
//we create new instances as needed.
task = new Task();
task.addPropertyChangeListener(this);
task.execute();
}
COM: <s> invoked when the user presses the start button </s>
|
funcom_train/43581355 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void doAfterCompose(Component comp) throws Exception {
try {
// to setup context component i.e. component to which this composer is applied
ZkCDIIntegrationContext.setContextComponent(comp);
ZkCDIIntegrationContext.setSelfContextComponent(comp);
// to trigger zk component injection
accessFields();
// to setup this composer as CDI event publisher
setupControllerAsEventPublisher(comp, this);
// forward all child events to this composer
addForwards(comp, this);
} finally {
ZkCDIIntegrationContext.clearContextComponent();
}
}
COM: <s> auto inject zk compoents referenced as composer fields </s>
|
funcom_train/16327019 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void actionPerformed(ActionEvent ae) {
try {
JFileChooser outputFileChooser = new JFileChooser();
outputFileChooser.showSaveDialog(new JPanel());
if (outputFileChooser.getSelectedFile() != null) {
String outputFilename = outputFileChooser.getSelectedFile()
.getAbsolutePath();
controller.exportToFile(outputFilename);
}
} catch (Exception e) {
e.printStackTrace();
showErrorMessage(DIALOG_TITLE, "Error while exporting to file");
}
}
COM: <s> export to a file </s>
|
funcom_train/2289881 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public List getGroupsOfUser(CmsDbContext dbc, String username, boolean readRoles) throws CmsException {
return getGroupsOfUser(dbc, username, "", true, readRoles, false, dbc.getRequestContext().getRemoteAddress());
}
COM: <s> returns the groups of an user filtered by the specified ip address </s>
|
funcom_train/36996202 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public XObject execute( XPathContext xctxt ) throws javax.xml.transform.TransformerException {
int context = getArg0AsNode(xctxt);
Node node = null;
if( context != DTM.NULL ) {
DTM dtm = xctxt.getDTM(context);
node = dtm.getNode(context);
}
if( node != null ) return serialize(node, Method.XML, 0);
return null;
}
COM: <s> execute the function </s>
|
funcom_train/3730380 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setExcluded(String s) {
excluded.clear();
if (s != null) {
String [] newExc = s.split(",");
for (int i = 0; i < newExc.length; i++) {
excluded.add ( newExc[i] );
}
}
}
COM: <s> sets the list of classes to be excluded from instrumentation </s>
|
funcom_train/8399879 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double optDouble(int index, double defaultValue) {
Object o = opt(index);
if (o != null) {
if (o instanceof Number) {
return ((Number) o).doubleValue();
}
try {
return Double.valueOf((String) o).doubleValue();
}
catch (Exception e) {
return defaultValue;
}
}
return defaultValue;
}
COM: <s> get the optional double value associated with an index </s>
|
funcom_train/45077404 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public long getNextSeq(Class clazz, String fieldName) {
// return sequenceManager.getUniqueId(clazz, fieldName);
try {
// return broker.getUniqueId(clazz, fieldName);
return uniq++;
} catch (Exception e) {
cat.error("Can't get ID from broker; " + e);
// System.exit(1);
return 0;
}
}
COM: <s> return next number in a persistent sequence </s>
|
funcom_train/26365480 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getDescriptionAsXML() {
StringBuffer stbResult = new StringBuffer();
stbResult.append("<Description>");
stbResult.append("<Short>");
stbResult.append(getShortDescription());
stbResult.append("</Short>");
stbResult.append("</Description>");
return stbResult.toString();
}
COM: <s> get the description of the department as an xml element </s>
|
funcom_train/32040833 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addIdentifierrefPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_ItemType_identifierref_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_ItemType_identifierref_feature", "_UI_ItemType_type"),
ImsldPackage.eINSTANCE.getItemType_Identifierref(),
true,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the identifierref feature </s>
|
funcom_train/49789666 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testLabelsCreated() throws Exception {
Frame home = assertHasFrame(root, "Home");
InputForm form = assertHasInputForm(home, "view news");
Label t1 = assertHasLabel(form, "title");
Label t2 = assertHasLabel(form, "content");
assertGenerated(t1);
assertGenerated(t2);
// no text fields
assertHasNoInputTextField(form, "title");
assertHasNoInputTextField(form, "content");
}
COM: <s> the form is populated with labels </s>
|
funcom_train/6439792 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setDefaultShell() {
if (isUnix) {
shell = "sh";
}
else if (isWindows) {
if ((osName.indexOf("NT") != -1) ||
(osName.indexOf("2000") != 1)) {
shell = "cmd /c";
}
else {
shell = "command /c";
}
}
}
COM: <s> helper function for the constructors to make a reasonable choice for a </s>
|
funcom_train/4465896 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setScale(double scalex, double scaley, Point2D from) {
if (from == null) {
Dimension d = getSize();
from = new Point2D.Float(d.width / 2.f, d.height / 2.f);
}
inverse = null;
transform.setToIdentity();
transform.translate(from.getX(), from.getY());
transform.scale(scalex, scaley);
transform.translate(-from.getX(), -from.getY());
fireStateChanged();
repaint();
}
COM: <s> setter for the scale fires a property change event with the </s>
|
funcom_train/9536800 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Element elementAtCaretPosition(JEditorPane ed)
{
if(ed == null)
return null;
HTMLDocument doc = (HTMLDocument)ed.getDocument();
int caret = ed.getCaretPosition();
Element elem = doc.getParagraphElement(caret);
HTMLDocument.BlockElement blockElem = (HTMLDocument.BlockElement)elem;
return blockElem.positionToElement(caret);
}
COM: <s> computes the inline or block element at the focused editors caret position </s>
|
funcom_train/26324867 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetChildCountCardPart() throws Exception {
loadStack(SIMPLE_PROJECT);
FCObject card = _store.getFCObjectByID(FCValue.ONE);
FCValue count = _store.getChildCount(FCRuntime.PART_TYPE, card);
assertEquals(count.getAsInt(), 2);
}
COM: <s> tests retrieving the number of parts in a card </s>
|
funcom_train/3905009 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetAbsoluteURL_WebLink() throws Exception {
loadContentPackage1();
Element element = cpCore.getElementByIdentifier(cpCore.getRootManifestElement(),
CP_Package1.ITEM3_ID);
String url = cpCore.getAbsoluteURL(element);
assertEquals("Absolute URL not correct", "http://" + CP_Package1.ITEM3_HREF, url);
}
COM: <s> ensure absolute url gets http prepended </s>
|
funcom_train/25306658 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Resource wrap() {
Resource resource = new Resource();
resource.setId(this.getId());
resource.setName(this.getName());
resource.setDescription(this.getDescription());
resource.setType("JDBCDataSource");
resource.setUrl(this.getSitoolsAttachementForUsers());
return resource;
}
COM: <s> utility to wrap the jdbcdata source to a generic resource </s>
|
funcom_train/24918257 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public XMLElement remove(int no) {
if (isReadOnly) {
throw new RuntimeException("Can't remove element from read only structure!");
}
if (no < 0 || no >= size())
throw new RuntimeException("There is no element at position " + no + "!");
return removeElement(no);
}
COM: <s> removes element at given position from the collection </s>
|
funcom_train/16269886 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getParameter(String key, String def) {
String ret = null;
if (isStandalone) {
ret = System.getProperty(key, def);
}
else {
if (getParameter(key) != null) {
ret = getParameter(key);
}
else {
ret = def;
}
}
return ret;
}
COM: <s> returns the value of parameter key </s>
|
funcom_train/20307137 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initLP(Graph schema) {
if (schema != null && schema instanceof FBRuleInfGraph) {
LPRuleStore newStore = new LPRuleStore();
newStore.addAll(((FBRuleInfGraph)schema).bEngine.getRuleStore());
bEngine = new LPBRuleEngine(this, newStore);
} else {
bEngine = new LPBRuleEngine(this);
}
}
COM: <s> initialize the lp engine based on an optional schema graph </s>
|
funcom_train/17544560 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void componentOpened() {
refreshTimer = new Timer();
refreshTimer.scheduleAtFixedRate(new TimerTask() {
public void run() {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
update();
}
});
}
}, 0, REFRESH_DELAY);
}
COM: <s> called when a component is opened </s>
|
funcom_train/3373619 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void handleEndTag(HTML.Tag t, int pos) {
if (receivedEndHTML || (midInsert && !inBody)) {
return;
}
if (t == HTML.Tag.HTML) {
receivedEndHTML = true;
}
if (t == HTML.Tag.BODY) {
inBody = false;
if (midInsert) {
inBlock--;
}
}
TagAction action = (TagAction) tagMap.get(t);
if (action != null) {
action.end(t);
}
}
COM: <s> callback from the parser </s>
|
funcom_train/44137291 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createBackGround() {
m_BackGround = new OSMBackGroundComponent(this, Color.BLUE);
// m_BackGround.setBounds(10, 10, m_Width - 20, m_Height - 20);
this.add(m_BackGround);
this.moveToBack(m_BackGround);
}
COM: <s> to create slide background </s>
|
funcom_train/45692217 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addProgramChangeEnabledPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_GlobalParameters_programChangeEnabled_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_GlobalParameters_programChangeEnabled_feature", "_UI_GlobalParameters_type"),
EsxPackage.Literals.GLOBAL_PARAMETERS__PROGRAM_CHANGE_ENABLED,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the program change enabled feature </s>
|
funcom_train/50774956 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setMetaProviderName(String metaProvider) {
MetaObjectProvider[] metaProviders = backend.getMetaProvidersArray();
for (int i = 0; i < metaProviders.length; i++)
if (metaProviders[i].getName().equals(metaProvider)) {
if (this.metaProvider != metaProviders[i]) {
this.metaProvider = metaProviders[i];
this.metaModel = this.metaProvider.createModel();
}
break;
}
}
COM: <s> sets the meta provider by name </s>
|
funcom_train/23011769 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void contextKilled() {
/** @todo Bad code: finalize method should be called */
// See jdk help:
// The finalize method is never invoked more than once by a Java virtual
// machine for any given object.
try {
finalize();
} catch(Throwable e) {
Utils.log(e);
}
}
COM: <s> called when the web application context is being destroyed </s>
|
funcom_train/39535002 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void loadTagEventsTagHandler() {
Document doc=null;
try{
doc=RtdaResources.getXMLDocument("rtdaAnimationsAndActionsOnEvents.xml");
}catch (Exception ex){ex.printStackTrace();}
if(doc!=null) {
tagEventsTagHandler=new RtdaTagHandler(doc);
}
}
COM: <s> loads the tag events tag handler </s>
|
funcom_train/26392165 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void event_load(java.awt.event.ActionEvent evt) {
String file_name = doLoadFijiDialog();
if (null != file_name) {
load_source_file(file_name);
}
else {
StockDialog.showWarningDialog(my_panel.get_frame(), "You chose no file, so no FIJI source was loaded.", "No source loaded");
}
}
COM: <s> handle the load source menu event </s>
|
funcom_train/16883115 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Dimension getPreferredSize() {
int resultX = 0;
int resultY = 0;
for (VertexPresentation vp : vertices) {
resultX = Math.max(resultX, vp.getCenter().x + VertexPresentation.RADIX + 1);
resultY = Math.max(resultY, vp.getCenter().y + VertexPresentation.RADIX + 1);
}
return new Dimension(resultX, resultY);
}
COM: <s> returns preferred graph view size </s>
|
funcom_train/47023160 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ChoiceGroup getChDicts() {
if (chDicts == null) {//GEN-END:|255-getter|0|255-preInit
// write pre-init user code here
chDicts = new ChoiceGroup(getLocalizedString("Dicts"), Choice.POPUP);//GEN-LINE:|255-getter|1|255-postInit
// write post-init user code here
}//GEN-BEGIN:|255-getter|2|
return chDicts;
}
COM: <s> returns an initiliazed instance of ch dicts component </s>
|
funcom_train/50911072 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean contains(Real2 point, double eps, boolean allowExtension) {
boolean contains = false;
if (point != null) {
double dist = Math.abs(this.getDistanceFromPoint(point));
if (dist < eps) {
double length = this.getLength() + eps;
contains = allowExtension ||
(point.getDistance(from) < length &&
point.getDistance(to) < length);
}
}
return contains;
}
COM: <s> does a line contain a point </s>
|
funcom_train/11103054 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setup() {
if (getId() != 0) {
this.subscription = getLogic().findSubscriptionById(getId());
} else {
this.subscription = new Subscription();
this.subscription.setUser(getState().getUser());
this.subscription.setProtocol((Protocol) getDomains().getProtocols()[0].getValue());
}
}
COM: <s> p set up the code subscription code instance we are creating and editing </s>
|
funcom_train/21607301 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void bindNamespaceUri(String prefix, String namespaceUri) {
Assert.notNull(prefix, "No prefix given");
Assert.notNull(namespaceUri, "No namespaceUri given");
if (XMLConstants.DEFAULT_NS_PREFIX.equals(prefix)) {
defaultNamespaceUri = namespaceUri;
}
else {
prefixToNamespaceUri.put(prefix, namespaceUri);
getPrefixesInternal(namespaceUri).add(prefix);
}
}
COM: <s> binds the given prefix to the given namespace </s>
|
funcom_train/9368517 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void closeSuggestionsAdapter() {
// remove the adapter from the autocomplete first, to avoid any updates
// when we drop the cursor
mSearchAutoComplete.setAdapter((SuggestionsAdapter)null);
// close any leftover cursor
if (mSuggestionsAdapter != null) {
mSuggestionsAdapter.close();
}
mSuggestionsAdapter = null;
}
COM: <s> closes and gets rid of the suggestions adapter </s>
|
funcom_train/44869633 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private WCMDrawGeometricBean getMinBox() {
if (minBox == null) {
minBox = new WCMDrawGeometricBean();
minBox.setShape(WCMDrawGeometricBean.RECT_ABSOLUTE);
minBox.setFillColor(new Color(191, 191, 191, 200));
minBox.setX1(getAInput());
minBox.setY1(new Constant(0));
minBox.setY2(getMinF());
minBox.setX2(getBInput());
}
return minBox;
}
COM: <s> this method initializes min box </s>
|
funcom_train/18193718 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void characters(char[] ch, int start, int length) throws SAXException {
String lineRaw = new String(ch, start, length);
/*
String line = lineRaw.trim();
if (text.length() == 0 && line.length() == 0) {
return;
}
*/
/*
int currentLineNumber = locator.getLineNumber();
if (currentLineNumber == (lastLineNumber + 1)) {
text.append(LINE_SEPARATOR);
}
lastLineNumber = currentLineNumber;
*/
text.append(lineRaw);
}
COM: <s> called by the sax parser to handle non whitespaces characters </s>
|
funcom_train/44977901 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void treeInitVolume(TreeItem item, FileThing volume) {
item.setText(getRootDisplayPath(volume));
item.setImage(iconCache.stockImages[iconCache.iconClosedDrive]);
item.setData(TREEITEMDATA_FILE, volume);
item.setData(TREEITEMDATA_IMAGEEXPANDED,
iconCache.stockImages[iconCache.iconOpenDrive]);
item.setData(TREEITEMDATA_IMAGECOLLAPSED,
iconCache.stockImages[iconCache.iconClosedDrive]);
}
COM: <s> initializes a volume item </s>
|
funcom_train/25331956 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetAndSetType() {
DAHomologyRelationship instance = new DAHomologyRelationship();
assertNull(instance.getType());
HomologyType expResult = HomologyType.APPARENT_ORTHOLOG_ONE2ONE;
instance.setType(expResult);
HomologyType result = instance.getType();
assertEquals(expResult, result);
}
COM: <s> test of get type method of class dahomology relationship </s>
|
funcom_train/37503754 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeMob(Mob mob) {
int index = getIndex(mob);
if (index != -1) {
try {
setMob(-1, mob);
} catch (EntryDeniedException ex) {
ex.printStackTrace();
throw new RuntimeException("setMob protocol violation");
}
}
}
COM: <s> remove mob from map </s>
|
funcom_train/38310313 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected ExpressionType getTypeByName(String name) throws ExpressionException {
if (name == null) {
throw new ExpressionException("No handler declared for null type!");
}
ExpressionType handler = (ExpressionType) typeNameMap.get(name);
if (handler != null) {
return handler;
}
throw new ExpressionException("No handler declared for type '" + name + "'!");
}
COM: <s> gets the handler for the objects type by its name </s>
|
funcom_train/40411775 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int createCustomer(CustomerInfo customer) throws CustomerException {
try {
Customer c = new Customer(customer);
em.persist(c);
customer.setId(c.getId());
return customer.getId();
} catch (Exception e) {
e.printStackTrace();
throw new CustomerException("Could not store new Customer", e);
}
}
COM: <s> create a customer </s>
|
funcom_train/118974 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void mousePressed(MouseEvent e) {
if (!e.isConsumed()) {
if (!(e.getSource() instanceof JGraph))
throw new IllegalArgumentException(
"MarqueeHandler cannot handle event from unknown source: "
+ e);
JGraph graph = (JGraph) e.getSource();
startPoint = e.getPoint();
marqueeBounds = new Rectangle(startPoint);
previousCursor = graph.getCursor();
graph.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
e.consume();
}
}
COM: <s> start the marquee at the specified start point </s>
|
funcom_train/4879633 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JMenu getFileMenu() {
if (fileMenu == null) {
fileMenu = new JMenu();
fileMenu.setText("File");
fileMenu.setMnemonic(java.awt.event.KeyEvent.VK_F);
fileMenu.add(getDefaultMenuItem());
fileMenu.add(getOpenMenuItem());
fileMenu.add(getSaveMenuItem());
fileMenu.add(getExitMenuItem());
}
return fileMenu;
}
COM: <s> this method initializes file menu </s>
|
funcom_train/29774022 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void handle(Object... params){
try {
// get the vimevent
VimEvent ve = (VimEvent) params[0];
// derive the things we wanna work with
AbstractVimEditor veditor = ve.getEditor();
ICompilationUnit cu = (ICompilationUnit) veditor.getIJavaElement();
int position = new Integer(ve.getArgument(1));
// do the codecomplete (for now just sysout it.
cu.codeComplete(position + 2, new VimCompletion());
} catch (Exception e) {
//TODO: Exception handling
e.printStackTrace();
}
}
COM: <s> gets the current compilation unit and calls codecomplete at the current </s>
|
funcom_train/12643256 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public OutputStream openOutputStream() throws IOException {
OutputStream o;
ensureOpen();
/* Fix for CR 6246819: Comment out MIDP code that limits streams so
that multiple streams are supported for CDC */
/*if (maxOStreams == 0) {
throw new IOException("no more output streams available");
}*/
o = new BaseOutputStream(this);
//maxOStreams--;
oStreams++;
return o;
}
COM: <s> returns an output stream </s>
|
funcom_train/4640136 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isValidDrop(Piece piece, Point destination) {
if (this.getVirtualBoard().getCurrentState(piece).isAlive() ||
!this.getVirtualBoard().contains(destination) ||
this.isStuck(piece, destination) ||
!this.getVirtualBoard().isEmpty(destination)) {
return false;
}
else {
return true;
}
}
COM: <s> check if the piece can be dropped in the destination </s>
|
funcom_train/29656424 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int compareTo(Object o) {
if (o instanceof HasInternalParameterable){
if (this instanceof HasInternalParameterable){
return this.name.compareTo(((Parameter) o).getName());
}else{
return -1;
}
}else{
if (this instanceof HasInternalParameterable){
return 1;
}else{
return this.name.compareTo(((Parameter) o).getName());
}
}
}
COM: <s> compares using object name </s>
|
funcom_train/50344754 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getExpectedArrivalTime(RouteLocation routeLocation){
int minutes = getExpectedTravelTimeInMinutes(routeLocation);
if (minutes == -1)
return "-1";
log.debug("Calculate arrival time for train (" +getName()+ ") at ("+routeLocation.getName()+"), minutes from departure: "+minutes);
// TODO use fast clock to get current time vs departure time
// for now use relative
return parseTime(minutes);
}
COM: <s> gets the expected time when this train will arrive at </s>
|
funcom_train/26273886 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setField(String fieldName, Object obj) throws BadCompositeException {
int result = type_.getFieldIndex(fieldName);
if (result == -1) {
throw new BadCompositeException("No such field: " + fieldName);
}
assertObject(type_.getType(), obj);
fields_[result] = obj;
}
COM: <s> overwrites the object at the named field </s>
|
funcom_train/17462960 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected CacheEntry purgeEntry() throws IOException {
CacheEntry entry = _first;
if(entry == null)
return new CacheEntry(-1,null,null,false);
if(entry._isDirty)
_recman.update( entry._recid, entry._obj, entry._serializer );
removeEntry(entry);
_hash.remove(entry._recid);
entry._obj = null;
entry._serializer = null;
entry._isDirty = false;
return entry;
}
COM: <s> purge least recently used object from the cache </s>
|
funcom_train/29290327 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ArrayList getFiveCompetitionExpire() throws Exception{
SurveySession surveySession = SessionBeanFactory.getSurveySessionRemoteObject();
Integer survey_type_id = 2;
Integer survey_status_id = 3;
return surveySession.getAllSurveyExpire(survey_type_id, survey_status_id);
//return surveySession.getFiveSurveyExpire(survey_type_id, survey_status_id);
}
COM: <s> return five competition expire </s>
|
funcom_train/23789191 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String replaceFields(String in) {
String out = new String(in);
Map<String,String> fields = getFields();
for(Map.Entry<String,String> entry: fields.entrySet()) {
String field = entry.getKey();
String value = entry.getValue();
out = out.replaceAll("%"+field+"%", value);
}
return out;
}
COM: <s> replace all the fields package xml variables in the </s>
|
funcom_train/18039994 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void add(String symbol, Type t, boolean isGlobal) throws TypeCheckException {
if (table.containsKey(symbol)) {
throw new TypeCheckException("Duplicate definition of " + symbol);
}
table.put(symbol, new SymTabEntry(t, isGlobal));
}
COM: <s> add the given entry to the table if the symbol is already </s>
|
funcom_train/34665193 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void dialogChanged() {
String fileName = getElementName();
String containerName = getContainerName();
if (containerName.length() == 0) {
updateStatus("Container must be specified");
return;
}
if (fileName.length() == 0) {
updateStatus("Name must be specified");
return;
}
if (fileName.replace('\\', '/').indexOf('/', 1) > 0) {
updateStatus("Invalid name");
return;
}
updateStatus(null);
}
COM: <s> ensures that both text fields are set </s>
|
funcom_train/21737692 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public OldSunipotent reflection( final int i){
try {
return OldSunipotent.create(Group.getGroup(a.length).simpleReflection(i, a),
r.times(Group.getGroup(a.length).reflectionSign(i, a)));
} catch (NotARootException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
COM: <s> image of the old sunipotent which calls it under the specified simple reflection </s>
|
funcom_train/3774393 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean validatePassword(String inputPassword, String expectedPassword) {
if( inputPassword == null || expectedPassword == null )
return false;
boolean valid = false;
if( ignorePasswordCase == true )
valid = inputPassword.equalsIgnoreCase(expectedPassword);
else
valid = inputPassword.equals(expectedPassword);
return valid;
}
COM: <s> a hook that allows subclasses to change the validation of the input </s>
|
funcom_train/1440644 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void notestIsServerSuspended() throws RemoteException {
System.out.println("isServerSuspended");
try {
ServerSideFacadeImpl instance = new ServerSideFacadeImpl(config);
boolean expResult = false;
boolean result = instance.isServerSuspended();
assertEquals(expResult, result);
} catch (Exception e) {
fail("Exception");
}
}
COM: <s> test of is server suspended method of class server side facade impl </s>
|
funcom_train/18726570 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JaxoTab getTabWithSaveFileName(final String name) {
for (int i = getTabCount() - 1; i >= 0; --i) {
if (getTabAt(i).getTabGraph().getSaveFileName().equals(name)) {
return getTabAt(i);
}
}
return null;
}
COM: <s> an arbitrary tab with the given save file name or null if </s>
|
funcom_train/18438760 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getRandom(int min, int max) {
// assert max > min : "The maximum was not greater than minimum";
// get a random number between 1 and max - min
int rv = random.nextInt((max + 1) - min);
// add min + 1 to it
return (rv + min);
}
COM: <s> gets a random number between the minimum and maximum values </s>
|
funcom_train/34069043 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private SystemFile getSystemFile(String fileName, String fileOwner){
for (int i = 0; i < this.systemFiles.size(); i++) {
SystemFile sf = this.systemFiles.get(i);
if(sf.getName().equals(fileName) && sf.getOwner().equals(fileOwner)){
return sf;
}
}
return null;
}
COM: <s> get the system file with the given filename and the given file owner </s>
|
funcom_train/50872941 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testLastElement() {
OMApplication application = new OMApplication();
OMInteger integer = new OMInteger("1");
OMSymbol symbol = new OMSymbol("a","b");
application.addElement(integer);
application.addElement(symbol);
assertTrue(application.lastElement() == symbol);
}
COM: <s> test of last element method of class omapplication </s>
|
funcom_train/648542 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JFileChooser getFchLogFile() {
if (fchLogFile == null) {
fchLogFile = new JFileChooser();
fchLogFile.setDialogTitle("Save Log File As");
fchLogFile.setFileFilter(new FileFilter() {
public boolean accept(File f) {
return (f.getName().endsWith("txt") || f.isDirectory());
}
public String getDescription() {
return "Text files (*.txt)";
}
});
}
return fchLogFile;
}
COM: <s> this method initializes j file chooser </s>
|
funcom_train/41024170 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel getStrokePlayerPanel() {
if (strokePlayerPanel == null) {
strokePlayerPanel = new ImageProviderPanel(imageProvider) {
private static final long serialVersionUID = 1L;
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2 = (Graphics2D)g;
g2.translate(getOffsetX(), getOffsetY());
paintStatus(g2);
}
};
strokePlayerPanel.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
saveImage();
}
});
}
return strokePlayerPanel;
}
COM: <s> this method initializes stroke player panel </s>
|
funcom_train/40312308 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetScale_InvalidColumn2() {
try
{
ResultSetMetaData resMetaData = new DefaultResultSetMetaData(metaDataEntry);
resMetaData.getScale(0);
fail("SQLException is expected.");
}
catch(SQLException e)
{
//ensure the SQLException is thrown by getScale method.
assertEquals("The sqlstate mismatches", "22003", e.getSQLState());
}
}
COM: <s> tests get scale with column index equals to 0 </s>
|
funcom_train/40659906 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString(){
Calendar c = new GregorianCalendar(TimeZone.getDefault());
c.setTime(getReceived());
return "(" +
c.get(Calendar.HOUR) + ":" +
c.get(Calendar.MINUTE) + ":" +
c.get(Calendar.SECOND) + ")" +
getType() + ":" +
getMessage() ;
}
COM: <s> string in format for message windows </s>
|
funcom_train/26589801 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public _Iterator execute(Object session) throws DException {
_Iterator fullTextIterator = fullTextPredicate.execute(session);
_Iterator tableIterator = GeneralPurposeStaticClass.getIndexedFilteredIterator(((_IndexTable)session).getDefaultIterator(),condition);
return new ContainsIterator(fullTextIterator,tableIterator);
}
COM: <s> it is required for plan execution </s>
|
funcom_train/2676128 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void init() throws IOException {
IStreamableFileFactory factory = (IStreamableFileFactory) ScopeUtils
.getScopeService(scope, IStreamableFileFactory.class,
StreamableFileFactory.class);
IStreamableFileService service = factory.getService(file);
if (service == null) {
log.error("No service found for " + file.getAbsolutePath());
return;
}
IStreamableFile streamFile = service.getStreamableFile(file);
reader = streamFile.getReader();
if (start > 0) {
seek(start);
}
}
COM: <s> initializes file provider </s>
|
funcom_train/21476828 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int deleteFileFromStorage(String fileName) {
Storage tempStorage = null;
File tempFile = null;
int msg = DataGridTags.FILE_DELETE_ERROR;
for (int i = 0; i < storageList.size(); i++) {
tempStorage = (Storage) storageList.get(i);
tempFile = tempStorage.getFile(fileName);
tempStorage.deleteFile(fileName, tempFile);
msg = DataGridTags.FILE_DELETE_SUCCESSFUL;
} // end for
return msg;
}
COM: <s> deletes the file from the storage </s>
|
funcom_train/2641628 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void ensureCapacity(int capacity) {
if (capacity > _data.length) {
int newCap = Math.max(_data.length << 1, capacity);
double[] tmp = new double[newCap];
System.arraycopy(_data, 0, tmp, 0, _data.length);
_data = tmp;
}
}
COM: <s> grow the internal array as needed to accommodate the specified </s>
|
funcom_train/9490179 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setMouseLoc(int x, int y, int pickingMode){
mouseX = x;
mouseY = y;
this.pickingMode = pickingMode;
// on next rending, a picking will be done : see doPick()
waitForPick = true;
//thread = new Thread(picking);
//thread.setPriority(Thread.MIN_PRIORITY);
//thread.start();
//return thread;
}
COM: <s> sets the mouse locations to x y and asks for picking </s>
|
funcom_train/31452531 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void treeWillExpand(TreeExpansionEvent e) throws ExpandVetoException {
SessionNode node = (SessionNode) e.getPath().getLastPathComponent();
if (node.getUserObject() instanceof Session) {
if (!setChildrenOfSessionNode(node)) {
throw new ExpandVetoException(e, "Unable to expand the node. Containers or maps could not be loaded.");
}
}
}
COM: <s> adds maps to a session node before it collapses </s>
|
funcom_train/14433452 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void init() {
BorderLayout borderLayout = new BorderLayout();
borderLayout.setHgap(2);
borderLayout.setVgap(2);
this.setLayout(borderLayout);
this.setSize(400, 400);
this.add(getFunctionsPanel(), BorderLayout.NORTH);
this.add(getRealmPanel(), BorderLayout.CENTER);
}
COM: <s> this method initializes this </s>
|
funcom_train/33848406 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int getAdjustedLeakCount(State state, int obligationId) {
final Obligation obligation = database.getFactory().getObligationById(obligationId);
Path path = state.getPath();
PostProcessingPathVisitor visitor = new PostProcessingPathVisitor(obligation, state);
path.acceptVisitor(cfg, visitor);
if (visitor.couldNotAnalyze()) {
return 0;
} else {
return visitor.getAdjustedLeakCount();
}
}
COM: <s> get the adjusted leak count for the given state and obligation type </s>
|
funcom_train/29917911 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void setInitialContext() throws NamingException {
Properties contextProps = new Properties();
contextProps.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
contextProps.put("java.naming.provider.url", "127.0.0.1:1099");
contextProps.put("java.naming.factory.url.pkgs", "org.jboss.naming");
initialContext = new InitialContext(contextProps);
}
COM: <s> help method that sets up the rmi initial context </s>
|
funcom_train/42817504 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setData(RssFeedSettings feedSettings, String unreadMessages) {
TextView name = (TextView)findViewById(R.id.feed_name);
TextView count = (TextView)findViewById(R.id.feed_unreadcount);
ProgressBar loading = (ProgressBar)findViewById(R.id.feed_loading);
name.setText(feedSettings.getName());
if (unreadMessages.equals("?")) {
loading.setVisibility(VISIBLE);
count.setVisibility(GONE);
} else {
loading.setVisibility(GONE);
count.setText(unreadMessages);
count.setVisibility(VISIBLE);
}
}
COM: <s> sets the actual texts and images to the visible widgets fields </s>
|
funcom_train/17670506 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean openDb(String name) {
String realName = addSuffix(name);
if (!dbExists(name)) {
return false;
}
try {
new Open(realName).execute(ctx);
} catch (BaseXException ex) {
log.error("Could not open the db.\n" + ex.getMessage());
return false;
}
activeDbName = realName;
activeDbNameShort = name;
return true;
}
COM: <s> open a base x database </s>
|
funcom_train/50976014 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getPassword() {
if((mNBPass==null) || (mNBPass.length()==0)) {
mNBPass = mApplet.getParameter("nb_pass");
if (mNBPass == null) {
System.err.println("Could not find nb_pass applet parameter!");
}
}
return mNBPass;
}
COM: <s> decodes the password and returns it </s>
|
funcom_train/39216183 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addCell(Cell cell) {
super.add(cell);
Component cellChild = cell.getChild();
if (cellChild.getParent() != null)
throw new IllegalStateException("Component " + cellChild + " already has a parent: " + cellChild.getParent());
cellChild.setParent(this);
this.needsResort = true;
}
COM: <s> a fundamental method for adding cells </s>
|
funcom_train/964852 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JComponent createSeparator(String textWithMnemonic, int alignment) {
if (textWithMnemonic == null || textWithMnemonic.length() == 0) {
return new JSeparator();
}
JLabel title = createTitle(textWithMnemonic);
title.setHorizontalAlignment(alignment);
return createSeparator(title);
}
COM: <s> creates and returns a labeled separator </s>
|
funcom_train/47282666 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testCallonUsingRegex() throws Exception {
testInput = new MungeStepOutput<String>("test", String.class);
testInput.setData("aabfooaabfooabfoob");
step.connectInput(0, testInput);
step.setRegex(true);
step.setFrom("a*b");
step.setTo("-");
step.open(logger);
step.call();
List<MungeStepOutput> results = step.getMungeStepOutputs();
MungeStepOutput output = results.get(0);
String result = (String)output.getData();
assertEquals("-foo-foo-foo-", result);
}
COM: <s> this tests the case where the regular expression option is enabled </s>
|
funcom_train/8901554 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void run() {
int counter = 0;
int instancesIDsTmp[] = new int[numInstances];
for (int inst = 0; inst < numInstances; inst++) {
if (instances[inst].data[classIndex] == interestingClass) {
instancesIDsTmp[counter] = inst;
++counter;
}
}
int instancesIDs[] = new int[counter];
for (int i = 0; i < counter; i++) {
instancesIDs[i] = instancesIDsTmp[i];
}
run(instancesIDs);
}
COM: <s> smote oversamples a specified class of a dataset </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.