__key__ stringlengths 16 21 | __url__ stringclasses 1
value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/23779214 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void dispose() {
getSite().getPage().removePartListener(_partListener);
IWorkingSetManager workingSetManager = EslinkPlugin.getPlugin().getWorkbench().getWorkingSetManager();
workingSetManager.removePropertyChangeListener(_propertyChangeListener);
if (_actionGroup != null)
_actionGroup.dispose();
super.dispose();
}
COM: <s> method declared on iworkbench part </s>
|
funcom_train/8283707 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: synchronized public void save(AttachmentContainer ac) {
attachmentTable.save(ac.getValidationItems(), new Item[] { ac.getAssignedAttachmentID()}, DBSQLAccessor.AND);
if ("-1".equals(ac.getAssignedAttachmentID().toString())) {
attachmentTable.getLastID(ac.getAssignedAttachmentID());
}
}
COM: <s> saves an attachment </s>
|
funcom_train/35847251 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setTargetLine() {
Fig target = getPanelTarget();
Object c = lineField.getSelectedItem();
if (target == null || c == null) {
return;
}
if (c instanceof Color) {
target.setLineColor((Color) c);
}
target.setLineWidth((c instanceof Color) ? 1 : 0);
target.endTrans();
}
COM: <s> change the line </s>
|
funcom_train/23854086 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void selectNextView() {
List<View> views = getViews(state.getActiveViewPosition().getSplit());
if (views.size() == 0) return;
int i = state.getActiveViewPosition().getTab() + 1;
selectView(new ViewPosition(state.getActiveViewPosition().getSplit(), i % views.size()));
}
COM: <s> switches to the next view tab to the right </s>
|
funcom_train/27823586 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void assertURLIsOK() throws MalformedURLException {
// set url, p_url
// if p_rawurl is not null, it is usually a correct URL
if (p_rawurl != null) {
p_url = new URL(p_rawurl);
}
// this may really throw an exception
url = new URL(rawurl);
}
COM: <s> used for url p url initialization and exception throwing </s>
|
funcom_train/20079204 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void applyFilters() {
if (elements == null) return;
int count = elements.length;
for (int i = 0; i < count; i++) {
Widget w = findItem(elements[i]);
if (w != null) {
w.setVisible(!isFiltered(null, elements[i]));
}
}
}
COM: <s> applies the viewers filters </s>
|
funcom_train/13680210 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isInPosition(String category, int offset, ITextViewer viewer){
Position[] positions;
try {
positions = viewer.getDocument().getPositions(category);
} catch (BadPositionCategoryException e) {
return false;
}
if (positions.length == 0){
return false;
}
for (int i = 0; i < positions.length; i++){
if (positions[i].getOffset() <= offset && positions[i].getOffset()+positions[i].getLength() >= offset){
return true;
}
}
return false;
}
COM: <s> this method checks if cursor is inside this position category </s>
|
funcom_train/42146751 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString(){
String id = "id: "+ this.id +", ";
String countryName;
String type = "Type: " + this.type +", ";
if (this.country == null){
countryName = "";
} else { countryName = "Country: " + country;}
return id+type+countryName+"\n";
}
COM: <s> to string implememtation for the class card </s>
|
funcom_train/20243504 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getItemCommand() {
if (itemCommand == null) {//GEN-END:|291-getter|0|291-preInit
// write pre-init user code here
itemCommand = new Command("Item", Command.ITEM, 0);//GEN-LINE:|291-getter|1|291-postInit
// write post-init user code here
}//GEN-BEGIN:|291-getter|2|
return itemCommand;
}
COM: <s> returns an initiliazed instance of item command component </s>
|
funcom_train/3316806 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void execHandleResponse(String returnVersion, boolean shouldHandle) {
resetControls();
IRequestCycle cycle = newCycle();
WebRequest request = newRequest();
request.getHeader(PrototypeResponseContributorImpl.PROTOTYPE_VERSION_HEADER);
setReturnValue(request, returnVersion);
replayControls();
ResponseContributor rc = createResponseContributor();
boolean handles = rc.handlesResponse(cycle, request);
Assert.assertEquals(handles, shouldHandle);
verifyControls();
}
COM: <s> creates and trains webrequest to include given header and tests </s>
|
funcom_train/1303767 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean contains(String string) {
Node curNode = root;
for (StringUtil.StringIterator iter = new StringUtil.StringIterator(string); iter.hasNext(); ) {
final StringUtil.StringPointer pointer = iter.next();
curNode = curNode.get(pointer.codePoint);
if (curNode == null) return false;
}
return curNode.isComplete();
}
COM: <s> search for the given complete string in this trie </s>
|
funcom_train/8012974 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void showPopupMenu(JPopupMenu menu, JComponent comp, int x, int y) {
// hideWindow();
_curMenu = menu;
menu.setSelected(null);
menu.show(comp,x, y);
menu.setVisible(true);
}
COM: <s> displays a popup menu but hides any popup currently showing </s>
|
funcom_train/27673174 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void create(String ancestors, String element) throws CreateException {
logger.info("Act from "+getCallerPrincipal().getName()+" on "+element);
setPerson(getCallerPrincipal().getName());
setAnonymous(getPersonEjb().getAnonymous());
setElement(element);
//setAncestors(getElementEjb().getAncestors());
setAncestors(ancestors);
getPersonEjb().incrNbActions();
}
COM: <s> generic create method used by sub acts like propose choose delegate </s>
|
funcom_train/23182864 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void stopNetworkClientTask() {
logger.info("stopNetworkClientTask() - Entry");
if (this.networkClientTask != null) {
this.networkClientTask.cancel();
this.timer.purge();
this.networkClientActive = false;
this.networkClientTask = null;
this.updateCoreProfile();
logger.debug("stopNetworkClientTask() - stopped");
}
logger.info("stopNetworkClientTask() - Exit");
}
COM: <s> this method stops the freeais network connection to a server </s>
|
funcom_train/4091563 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private PaletteContainer createREAOperationalNodes2Group() {
PaletteDrawer paletteContainer = new PaletteDrawer(
Messages.REAOperationalNodes2Group_title);
paletteContainer
.setDescription(Messages.REAOperationalNodes2Group_desc);
paletteContainer.add(createEconomicResource1CreationTool());
paletteContainer.add(createIncrementEconomicEvent2CreationTool());
paletteContainer.add(createDecrementEconomicEvent3CreationTool());
paletteContainer.add(createEconomicAgent4CreationTool());
paletteContainer.add(createIncrementCommitment5CreationTool());
paletteContainer.add(createDecrementCommitment6CreationTool());
return paletteContainer;
}
COM: <s> creates rea operational nodes palette tool group </s>
|
funcom_train/17201137 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void reportBenefitRatio(int compiler1, int compiler2, double rate) {
if (Controller.options.LOGGING_LEVEL >= 1) {
synchronized (log) {
log.println(getTime() +
" Benefit Ratio from " +
CompilerDNA.getCompilerString(compiler1) +
" compiler to " +
CompilerDNA.getCompilerString(compiler2) +
" compiler: " +
rate);
}
}
}
COM: <s> this method reports the benefit ratio from one compiler to the other </s>
|
funcom_train/51537955 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void commandAction(Command c, Displayable d) {
Command[] inputCommands = inputMenu.getSubCommands();
String label = c.getLabel();
if (inputCommands != null && label != null) {
for (int i = 0; i < inputCommands.length; i++) {
if (label.equals(inputCommands[i].getLabel())) {
inputSession.setCurrentInputMode(inputModes[i]);
break;
}
}
}
}
COM: <s> this command listener is only for the selection of commands on </s>
|
funcom_train/19288238 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeTableModelListener(TableModelListener l, DataTableModel table) {
for (int i=0; i<listenerList.size(); i++) {
if (listenerList.get(i).item1==l && listenerList.get(i).item2==table) {
listenerList.remove(i);
i--;
}
}
}
COM: <s> removes a listener from the list thats notified each time a </s>
|
funcom_train/48621177 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Long insertAllItemsForContentType(ContentType contentType, IndexProcessingType processingType) {
Long numCreated = 0l;
Query q = hbCrudDAO.getSessionFactory().getCurrentSession().getNamedQuery("insertAllItemsForContentType");
q.setParameter("contentTypeId", contentType.getId());
q.setParameter("processingTypeId", processingType.getId());
numCreated += q.executeUpdate();
return numCreated;
}
COM: <s> set all items for re indexing for a given content type </s>
|
funcom_train/43753060 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public AxisPanel2 styleChilds(String styleProp, String styleValue) {
if (getTarget().axisChildsStyles == null) {
getTarget().axisChildsStyles = new LinkedHashMap<String, String>();
}
getTarget().axisChildsStyles.put(styleProp, styleValue);
return this;
}
COM: <s> style all children of the target panel to the given property and value </s>
|
funcom_train/48336356 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected AttributeNameValues interpretData(AttributeNameValues data) {
String buttonid = (String)data.getAttributeNameValue(IBUTTONID).getValue();
String name = (String)hash.get(buttonid);
if (name == null) {
return null;
}
AttributeNameValues atts = new AttributeNameValues();
atts.addAttributeNameValue(USERNAME,name);
return atts;
}
COM: <s> this method performs the actual interpretation of this component </s>
|
funcom_train/4377798 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public RJSONObject toJSONObject(RJSONArray names) throws RJSONException {
if (names == null || names.length() == 0 || length() == 0) {
return null;
}
RJSONObject jo = new RJSONObject();
for (int i = 0; i < names.length(); i += 1) {
jo.put(names.getString(i), this.opt(i));
}
return jo;
}
COM: <s> produce a jsonobject by combining a jsonarray of names with the values </s>
|
funcom_train/37004739 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int calculusAge() {
Calendar birth = new GregorianCalendar(0000, 00, 00);
DateFormat formatter = new SimpleDateFormat("dd.MM.yyyy");
try {
birth.setTime(formatter.parse(birthday));
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
int age = model.calculusAge(birth);
return age;
}
COM: <s> this method tests the calculus age method of the application </s>
|
funcom_train/21407011 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void showForm(boolean studyEditingMode,FormData formData, boolean allowDelete){
try{
setStudyEditingMode(studyEditingMode);
boolean displayForm = true;
displayForm = formEventListener.beforeFormDisplay(formData);
if(displayForm){
FireSkipRules(formData);
this.formViewer.showForm(formData,formEventListener,allowDelete);
saveCurrentView(formViewer);
}
}
catch(Exception e){
showErrorMessage("Exception:"+ e.getMessage(),e);
}
}
COM: <s> shows a form given its data </s>
|
funcom_train/3277970 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public BufferedImage getBufferedImage() {
Dimension d = digraphRenderer.getSize();
BufferedImage img = new BufferedImage(d.width,d.height,BufferedImage.TYPE_INT_RGB);
Graphics g = img.getGraphics();
digraphRenderer.paintComponent(g);
g.dispose();
return img;
}
COM: <s> gets the buffered image of a digraph view object </s>
|
funcom_train/36790053 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void paint(Graphics g) {
//draw the path
g.setColor(Color.black);
g.drawLine(0, lineOffsetY, pathLength, lineOffsetY);
//draw the sun
g.setColor(sunColor);
g.fillOval(pixelPosition, lineOffsetY/2, sunDiameter, sunDiameter);
}
COM: <s> overrides the default paint method for this panel </s>
|
funcom_train/18861594 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Servlet getActionServlet() {
Servlet servlet = null;
List servlets = webApp.getServlets();
for (Iterator iter = servlets.iterator(); iter.hasNext();) {
servlet = (Servlet) iter.next();
if (servlet.getWebType().isServletType()) {
JavaClass clazz = servlet.getServletClass();
if (isActionServletClass(clazz)) {
break;
} else {
servlet = null;
}
}
}
return servlet;
}
COM: <s> returns the action servlet of the web application </s>
|
funcom_train/32777994 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public TimeSpan averageWaitTime() {
double obs = getObservations(); // get and store number of observations
// return rounded average wait time
if (obs > 0) {
// calculate the resulting average wait time
TimeSpan avgWaitTime = TimeOperations.divide(_sumWaitTime, obs);
return avgWaitTime;
} else {
return TimeSpan.ZERO; // no observations -> zero TimeSpan value
}
}
COM: <s> returns the average waiting time of all objects who have exited the queue </s>
|
funcom_train/5032473 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected XelementImpl makeTheCloneIn(XchangeElement container, boolean substituteReferences, Map<XelementImpl, XelementImpl> clonesToPrototypes, Map<XelementImpl, XelementImpl> prototypesToClones) {
XelementImpl clone = ph.createElement(this.getClass(), container);
if (substituteReferences) {
prototypesToClones.put(this, clone);
clonesToPrototypes.put(clone, this);
}
return clone;
}
COM: <s> make the cloned element </s>
|
funcom_train/33398932 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JToggleButton getMuteButton() {
if (muteButton == null) {
muteButton = new JToggleButton();
muteButton.setIcon(new ImageIcon(getClass().getResource(
"/net/sf/fmj/ui/images/Volume24.gif")));
muteButton.setOpaque(false);
muteButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
setMute(muteButton.isSelected());
}
});
}
return muteButton;
}
COM: <s> this method initializes mute button </s>
|
funcom_train/17577081 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JMenuItem getExecuteMenuItem() {
if (executeMenuItem == null) {
executeMenuItem = new JMenuItem();
executeMenuItem.setText("Execute");
executeMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
javbotPanel.scriptPanel.insertExecute();
}
});
}
return executeMenuItem;
}
COM: <s> this method initializes execute menu item </s>
|
funcom_train/46884326 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void generateLegalMoves(final IntVector moves) {
IntVector tmpMoves = new IntVector();
generatePseudoLegalMoves(tmpMoves);
for (int i = 0; i < tmpMoves.size(); i++) {
int move = tmpMoves.get(i);
if (isLegalMove(move)) {
moves.add(move);
}
}
}
COM: <s> generate legal moves </s>
|
funcom_train/42129595 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void updateResults() {
if (pageNumber != -1) {
try {
query.setFirstResult(pageNumber * pageSize);
query.setMaxResults(pageSize);
this.results = query.list();
} catch (HibernateException e) {
throw SessionFactoryUtils.convertHibernateAccessException(e);
}
}
}
COM: <s> update the cached results for the current page </s>
|
funcom_train/38878670 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void onDestroy() {
super.onDestroy();
// notify of service stop
Toast.makeText(this, R.string.serviceStoppedMessage, Toast.LENGTH_SHORT).show();
releaseSensor();
releaseLock();
BenderService.started = false;
bl.destroy();
}
COM: <s> service closing procedures </s>
|
funcom_train/29607044 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void checkActionsCache() {
if (actionsCache == null) {
actionsCache = new HashMap<String, javax.swing.Action>();
javax.swing.Action[] actions = editor.getActions();
for (javax.swing.Action action : actions) {
String name =
(String) action.getValue(javax.swing.Action.NAME);
actionsCache.put(name, action);
}
}
}
COM: <s> checks if the actions cache has been set up and initializes it when </s>
|
funcom_train/8527691 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Node getNodeToInsertInto(Node heading) {
Node parent = heading.getParentNode();
boolean found = false;
while (!found) {
if (parent.getNodeName().equals("text:list")) {
if (!parent.getParentNode().getNodeName().equals(
"text:list-item")
&& !parent.getParentNode().getNodeName().equals(
"text:list-header"))
found = true;
else
parent = parent.getParentNode();
} else
parent = parent.getParentNode();
}
return parent.getNextSibling();
}
COM: <s> gets the node to insert into </s>
|
funcom_train/18183804 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: @Test public void testEqualsNullProperties() {
Object firstObject = createObjectWithPropertiesNull();
Object secondObject = createObjectWithPropertiesNull();
assertThat(firstObject.equals(secondObject), is(true));
assertThat(secondObject.equals(firstObject), is(true));
}
COM: <s> two different objects all null properties must be equal </s>
|
funcom_train/16082519 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void connecting(Messenger messenger, Identity identity) {
identity.setStatus(MessagingConstants.STATUS_CONNECTING);
if (log.isDebugEnabled()) {
log.debug("Connecting "
+ identity.getUsername() + "."
+ identity.getMessenger() + "."
+ identity.getSignin() + "...");
}
}
COM: <s> attempting to start a new messenger service session </s>
|
funcom_train/403500 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setLibs(final CUtil.StringArrayBuilder libs) throws BuildException {
if (isReference()) {
throw tooManyAttributes();
}
libnames = libs.getValue();
//
// earlier implementations would warn of suspicious library names
// (like libpthread for pthread or kernel.lib for kernel).
// visitLibraries now provides better feedback and ld type linkers
// should provide adequate feedback so the check here is not necessary.
}
COM: <s> comma separated list of library names without leading prefixes such as </s>
|
funcom_train/37904161 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ArrayList findValues(IndexQuery query) throws IOException, BTreeException {
if (!lock.hasLock())
LOG.warn("the file doesn't own a lock");
FindCallback cb = new FindCallback(FindCallback.VALUES);
try {
query(query, cb);
} catch (TerminatedException e) {
// Should never happen
LOG.warn("Method terminated");
}
return cb.getValues();
}
COM: <s> find matching nodes for the given query </s>
|
funcom_train/11757542 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int opNext(int prio) {
int n = 0;
alice.util.LinkedList l = opQueue.head;
while(!l.isEmptyList()) {
Operator o = (Operator)l.head; l = l.tail;
if(o.prio > n && o.prio < prio){
n = o.prio;
}
}
return(n);
}
COM: <s> gets the priority nearest lower to the priority of a defined operator </s>
|
funcom_train/11012838 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void test44536() {
// Used to blow up with an IllegalArgumentException
// when creating a FileSharingRecord
HSSFWorkbook wb = openSample("ReadOnlyRecommended.xls");
// Check read only advised
assertEquals(3, wb.getNumberOfSheets());
assertTrue(wb.isWriteProtected());
// But also check that another wb isn't
wb = openSample("SimpleWithChoose.xls");
assertFalse(wb.isWriteProtected());
}
COM: <s> files with read only recommended were giving </s>
|
funcom_train/30005322 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void itemStateChanged(ItemEvent e) {
if (e.getSource() == getPriorityComboBox()) {
setButtonsEnableState();
this.progress.setMax(ExecutionController.getInstance().getTestCaseCount(this.sequence,(Priority)
getPriorityComboBox().getSelectedItem()));
}
}
COM: <s> this is needed for the priority combo box </s>
|
funcom_train/3417063 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean startsWith(String prefix, int toffset) {
char ta[] = value;
int to = offset + toffset;
char pa[] = prefix.value;
int po = prefix.offset;
int pc = prefix.count;
// Note: toffset might be near -1>>>1.
if ((toffset < 0) || (toffset > count - pc)) {
return false;
}
while (--pc >= 0) {
if (ta[to++] != pa[po++]) {
return false;
}
}
return true;
}
COM: <s> tests if the substring of this string beginning at the </s>
|
funcom_train/3594068 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String applyFilter(NOMElement nel) {
if (nel==null || nel.getName()==null) { return (String)null; }
int ftype = getFilterType(nel.getName());
if (ftype==ATTRIBUTE) {
return (String)nel.getAttributeComparableValue(getFilterAttributeName(nel.getName()));
}
if (ftype==DELEGATE) {
return tttDelegate.getTextForTranscriptionElement(nel);
}
return nel.getText();
}
COM: <s> return the string to be displayed for the nom element </s>
|
funcom_train/47944659 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setValues(List<String> list) throws MotuInvalidDateException {
switch (list.size()) {
case 2:
setValues(list.get(0), list.get(1));
break;
case 1:
setValues(list.get(0), list.get(0));
break;
default:
break;
}
}
COM: <s> set criteria from a list that contains start date and end date values </s>
|
funcom_train/6412222 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Continuance open(Shell shell) {
CoreUtils.assertNotDisposed(this);
CoreUtils.assertNonNullArg(shell);
CoreUtils.assertValidState(_dialog == null, this,
"The dialog has already been opened. Must create a new instance.");
_dialog = newDialog(shell);
CoreUtils.assertNonNullState(_dialog, this,
"newDialog() returned null.");
_continuance = openDialog(_dialog);
CoreUtils.assertNonNullState(_continuance, this,
"openDialog() returned null.");
return _continuance;
}
COM: <s> build and opens the dialog as a child of the specified shell </s>
|
funcom_train/21847420 | /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 (this == o) {
return 0;
}
JCConstructor c = (JCConstructor) o;
int order = 0;
JCParameter[] mp = c.getParameters();
int commonCnt = Math.min(parameters.length, mp.length);
for (int i = 0; i < commonCnt; i++) {
order = parameters[i].compareTo(mp[i]);
if (order != 0) {
return order;
}
}
order = parameters.length - mp.length;
return order;
}
COM: <s> this implementation expects that only the constructors inside one class </s>
|
funcom_train/19401267 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void insert() {
/*
* insert terms.
*/
store.insertTerms(uris, numURIs, haveKeys, sorted);
store.insertTerms(literals, numLiterals, haveKeys, sorted);
store.insertTerms(bnodes, numBNodes, haveKeys, sorted);
/*
* insert statements.
*/
store.addStatements(stmts, numStmts);
}
COM: <s> batch insert buffered data terms and statements into the store </s>
|
funcom_train/23674825 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int hashCode() {
int sum = 0;
if (cells == null) {
if (levelDims != null) {
for (Dimension d: levelDims.keySet()) {
sum += d.hashCode();
sum += levelDims.get(d) * 17;
}
}
} else {
sum += 17;
for (Element [] coord: cells) {
sum += coord.hashCode();
}
}
return sum;
}
COM: <s> returns a hash code for this format range info object </s>
|
funcom_train/4779933 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel getPathPanel() {
if (pathPanel == null) {
pathLabel = new JLabel();
pathLabel.setText(ResourceUtil.getString(type + ".path"));
pathLabel.setPreferredSize(new Dimension(100, 15));
pathPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
pathPanel.add(pathLabel);
pathPanel.add(getPathTextField());
}
return pathPanel;
}
COM: <s> this method initializes path panel </s>
|
funcom_train/41299670 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel getBLeftButtons() {
if (bLeftButtons == null) {
bLeftButtons = new JPanel();
bLeftButtons.setLayout(null);
bLeftButtons.setPreferredSize(new Dimension(300, 26));
bLeftButtons.add(getJButton2(), null);
bLeftButtons.add(getDirB(), null);
bLeftButtons.add(getNoteB(), null);
bLeftButtons.add(getJButton22(), null);
}
return bLeftButtons;
}
COM: <s> this method initializes b left buttons </s>
|
funcom_train/9829480 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void dispose() {
// don't forget this call. It not only disposes of the frame, it
// also dispatches a WINDOW_CLOSED event to registered WindowListeners
super.dispose();
--_numFramesOpen;
if ( 0 == _numFramesOpen && systemExitWhenAllViewerInternalFramesClosed )
System.exit( 0 );
}
COM: <s> this method overridden to call system </s>
|
funcom_train/49604201 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void draw2D(Graphics g) {
Polygon pol;
Color color = Road.getDrawColor();
Color colorFill = Road.getFillColor();
boolean drawRoads = true;
boolean drawNodes = true;
if (drawRoads) {
for (Road r: roads) {
pol = r.getPolygon();
g.setColor(color);
g.drawPolygon(pol);
g.setColor(colorFill);
g.fillPolygon(pol);
}
}
if (drawNodes) {
for (RoadNode node : nodes) {
node.draw2D(g);
}
}
}
COM: <s> draws the entire road network using the specified graphics object </s>
|
funcom_train/23235353 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void checkQuantityImage(int quantity) {
if ((quantityImage == null) || (quantity != oldQuantity)) {
oldQuantity = quantity;
String quantityString;
if (quantity > 99999) {
// The client can't show more than 5 digits.
// This solution works for quantities up to 10 million - 1.
quantityString = (quantity / 1000) + "K";
} else {
quantityString = Integer.toString(quantity);
}
quantityImage = GameScreen.get().createString(quantityString, Color.white);
}
}
COM: <s> ensures that the quantity image is set </s>
|
funcom_train/9110722 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void sendActivationMailFull(User user) {
Map<String, String> params = new HashMap<String, String>(1);
params.put("id", user.getId());
String url = RequestUtils.toAbsolutePath(urlFor(
AccountActivation.class,
new PageParameters(UrlParameterCryptor.encrypt(params)))
.toString());
AccountHandlingUtils.sendAccountCreatedMail(user, url, generatedPassword);
}
COM: <s> send mail to user with encrypted user id as parameter id </s>
|
funcom_train/9919001 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void loadVertexShader(URL url) {
String shaderSource;
try {
shaderSource = PApplet.join(PApplet.loadStrings(url.openStream()), "\n");
attachVertexShader(shaderSource, url.getFile());
} catch (IOException e) {
System.err.println("Cannot load file " + url.getFile());
}
}
COM: <s> loads and compiles the vertex shader contained in the url </s>
|
funcom_train/20535184 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: /*private JButton getBoton10() {
if (boton10 == null) {
boton10 = new JButton();
boton10.setBounds(new Rectangle(211, 552, 180, 33));
boton10.setText("Archivo 10");
boton10.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
System.out.println("actionPerformed()"); // TODO Auto-generated Event stub actionPerformed()
}
});
}
return boton10;
}*/
COM: <s> this method initializes boton10 </s>
|
funcom_train/50433485 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double nextDouble(double a, double b) {
debug.assert(a < b, "a and b are a range of values from a to b");
double r = super.nextDouble();
r *= b - a;
r += a;
if (r > b) {
r = b;
}
return (r);
} // of nextDouble
COM: <s> get a random float x such that a x b inclusive </s>
|
funcom_train/1556421 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: final public String getAlgebraDescriptionRegrOut() {
if (strAlgebraDescriptionNeedsUpdate) {
if (isDefined()) {
strAlgebraDescription = toStringMinimal();
} else {
StringBuilder sbAlgebraDesc = new StringBuilder();
sbAlgebraDesc.append(app.getPlain("undefined"));
strAlgebraDescription = sbAlgebraDesc.toString();
}
strAlgebraDescriptionNeedsUpdate = false;
}
else {
strAlgebraDescription = toStringMinimal();
}
return strAlgebraDescription;
}
COM: <s> returns simplified algebraic representation of this geo element </s>
|
funcom_train/37230242 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public XCNElement getSubmitter() {
XCNElement xcn = null;
ROLSegment rol = getRole( "SUB", "Submitting Party" );
Iterator iP = rol.listRolePersons();
if( iP != null && iP.hasNext() ) {
xcn = (XCNElement)iP.next();
}
return xcn;
}
COM: <s> return the submitter rol xcn first occurance </s>
|
funcom_train/46123399 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void sortByEmail(String direction){
// This class will allow the method 'Collections.sortBy' to sort a list of 'userTD' by email
class CompareEmail implements Comparator<UserTD> {
private String direction;
CompareEmail(String direction){
this.direction = direction;
}
public int compare(UserTD userOne, UserTD userTwo){
int sortingIndice = userOne.email.compareTo(userTwo.email);
if(this.direction.equals("desc")){
return (sortingIndice * -1);
}else{
return sortingIndice;
}
}
}
Collections.sort(this.usersListTD, new CompareEmail(direction));
}
COM: <s> sort a list of user td by email </s>
|
funcom_train/3365813 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int convertModelToRow(int index) {
int size = list.getModel().getSize();
if ((index < 0) || (index >= size)) {
return -1;
}
if (layoutOrientation != JList.VERTICAL && columnCount > 1 &&
rowsPerColumn > 0) {
if (layoutOrientation == JList.VERTICAL_WRAP) {
return index % rowsPerColumn;
}
return index / columnCount;
}
return index;
}
COM: <s> returns the row that the model index code index code will be </s>
|
funcom_train/32635744 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testInitialListenerInform() {
// fist test update for new keys
MockModelListener listener = new MockModelListener();
model.addValue( SOURCE1 , GROUP1, STREAM1, 5d);
model.registerModelListener( listener);
assertEquals( SOURCE1, listener.lastAddedSource);
assertEquals( GROUP1, listener.lastAddedGroup);
assertEquals( STREAM1, listener.lastAddedStream);
}
COM: <s> test initial propagation of keys to listeners </s>
|
funcom_train/45499062 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getJButton3() {
if (jButton3 == null) {
jButton3 = new JButton();
jButton3.setBounds(new Rectangle(426, 370, 100, 25));
jButton3.setText("Demo 4");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
// TODO Auto-generated Event stub actionPerformed()
RunDemo(4);
}
});
}
return jButton3;
}
COM: <s> this method initializes j button3 </s>
|
funcom_train/25421280 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ServletContext extractServletContext() {
Object o = null;
ExternalContext ec = getExternalContext();
if (ec != null) o = ec.getContext();
if ((o != null) && (o instanceof ServletContext)) {
return (ServletContext)o;
} else {
return null;
}
}
COM: <s> extracts the servlet context from the faces context instance </s>
|
funcom_train/22497768 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void jbtnFindNext_actionPerformed(final ActionEvent e) {
operation = OP_FIND;
jbtnReplace.setEnabled(false);
if (mode == MODE_PROJECT && jcbProject.isSelected() && listeners.size() > 0 && !findInProgress) {
fireGetFirstDocument();
}
else {
initFind();
find();
}
}
COM: <s> perform a find when button find next is pressed </s>
|
funcom_train/8690788 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void resetBufferInfo() {
Thread current = Thread.currentThread();
BufferInfo bufferInfo = (BufferInfo) buffers.get(current);
try {
bufferInfo.buffer.close();
} catch (IOException e) {
// Shouldn't happen
}
bufferInfo.buffer = new ByteArrayOutputStream();
bufferInfo.crSeen = false;
}
COM: <s> resets the buffer for the current thread </s>
|
funcom_train/5870392 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setSatellite(boolean b) {
if (_satellite != b) {
if (!b && "satellite".equals(_mapType)) {
if (isNormal()) setMapType("normal");
else if (isHybrid()) setMapType("hybrid");
else if (isPhysical()) setMapType("physical");
else return; //cannot do it if no more maps!
}
_satellite = b;
smartUpdate("z.smap", b);
}
}
COM: <s> sets whether support satellite map default to true </s>
|
funcom_train/13327793 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Double getInformationContent(OWLObject obj) {
// caching is always on by default
if (cacheObjectIC.containsKey(obj)) {
return cacheObjectIC.get(obj);
}
Double ic = null;
if (getFrequency(obj) > 0) {
ic = -Math.log(((double) (getFrequency(obj)) / getCorpusSize())) / Math.log(2);
}
cacheObjectIC.put(obj, ic);
return ic;
}
COM: <s> the ic of an owlobject is </s>
|
funcom_train/49462514 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void fix19yearsAsVersion() {
final String ms_year_as_version[]={"1997","1998"};
if (version != null) {
for (int i=0; i<ms_year_as_version.length; ++i)
if (ms_year_as_version[i].compareTo(version) == 0) {
_logger.debug("Fixing up 19xx as version");
version = ms_year_as_version[i].substring(2);
vp.clear();
vp.add(version);
}
}
}
COM: <s> one more microsoft sillyness </s>
|
funcom_train/48502763 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void rollback() {
assertActive();
try {
if (isLocalTransaction()) {
rollbackLocalTransaction();
} else {
rollbackGlobalTransaction();
}
} catch (DeadlineExceededException e) {
if (lockMap.isEmpty()) {
return;
}
logger
.info("This rollback process will be executed asynchronously, because a DeadlineExceededException occurred.");
submitRollbackJob(globalTransactionKey);
}
}
COM: <s> rolls back this transaction </s>
|
funcom_train/51297554 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public TreeComboItem findTreeItemById(int id) {
for (int i = 0; i < getItemCount(); ++i) {
TreeComboItem item = getTreeItemAt(i);
if (item.getObject() instanceof NamedId
&& ((NamedId) item.getObject()).getId() == id)
return item;
}
return null;
}
COM: <s> returns tree element by id </s>
|
funcom_train/13490819 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Predicate poly(final String pred, final Predicate base) {
String key = pred + '+' + base.getName();
Predicate stored = (Predicate) poly_predicates.get(key);
if (stored != null)
return stored;
Class[] struc = base.getStructure();
SimplePredicate p = new SimplePredicate(pred, struc);
poly_predicates.put(key, p);
return p;
}
COM: <s> a polymorphic predicate that allows creating predicates dynamically </s>
|
funcom_train/8774286 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setBirthDay(Date newValue) throws SkypeException {
String newValueString;
if (newValue == null) {
newValueString = "0";
} else {
newValueString = new SimpleDateFormat("yyyyMMdd").format(newValue);
}
setProperty("BIRTHDAY", newValueString);
}
COM: <s> sets the birth day of the current user </s>
|
funcom_train/45770468 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int addFont(FontDescription f) {
boolean alreadyExists = false;
int i = 0;
for(Enumeration e = fonts.elements();e.hasMoreElements();) {
FontDescription fd = (FontDescription) e.nextElement();
if(fd.compareTo(f)) {
alreadyExists = true;
break;
} else {
i++;
}
}
if(!alreadyExists)
fonts.add(f);
return i;
}
COM: <s> adds a font recrod to the workbook </s>
|
funcom_train/17286833 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean checkAuth() {
if(this.comConf.hasDirective(DIR_NO_AUTH)) {
String[] v = this.comConf.getDirective(DIR_NO_AUTH);
for( String s: v ) {
if ("no".equalsIgnoreCase(s)
|| "off".equalsIgnoreCase(s)
|| "false".equalsIgnoreCase(s))
return true;
// Otherwise, fall through
}
}
return this.ses.userLoggedIn();
}
COM: <s> check to see if user is authenticated </s>
|
funcom_train/43059025 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: static protected String encloseBracket(String str, String bracket) {
String ret = "";
ret += bracket.charAt(0);
if(!isBracketEnclosed(str)) {
ret += str;
}else {
ret += str.substring(1, str.length() - 1);
}
ret += bracket.charAt(1);
return ret;
}
COM: <s> force to add bracket and eliminate redundant </s>
|
funcom_train/784729 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean equals(Object other) {
try {
Option theOther = (Option) other;
if(theOther.getKind() == kind && theOther.getName().equals(name))
return theOther.getChoices().equals(choices);
else
return false;
} catch(ClassCastException c) {
return false;
}
}
COM: <s> compares two option using all their field and sets </s>
|
funcom_train/3172731 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void start(Gedcom gedcom) {
String title = translate("fileheader",gedcom.getName());
// Get a list of the individuals
Entity[] indis = gedcom.getEntities(Gedcom.INDI, "INDI:NAME");
println(title);
println("");
// Step through all the Individuals we haven't seen yet
println(translate("indicount",indis.length)+"\n");
HashSet unvisited = new HashSet(Arrays.asList(indis));
start(indis,unvisited);
}
COM: <s> this method actually starts this report </s>
|
funcom_train/5323990 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void callToJavaScript(String function, String parameters) {
try {
JSObject win = JSObject.getWindow(this);
win.eval(function + "(" + parameters + ")");
}
catch (Exception npe) {
System.out.println("EXCEPTION-> " + npe.getMessage());
}
}
COM: <s> calls a javascript function given by the function name </s>
|
funcom_train/13274014 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void seekBackward() {
for (int i = 0; i < 10 && this.cameraPathIterator.hasPrevious(); i++) {
this.playbackTimer.getActionListeners() [0].actionPerformed(
new ActionEvent(this.playbackTimer, 0, "backward", System.currentTimeMillis(), 0));
}
}
COM: <s> moves quickly camera 10 steps backward </s>
|
funcom_train/33282389 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void jsxFunction_setEndBefore(final Node refNode) {
if (refNode == null) {
throw Context.reportRuntimeError("It is illegal to call Range.setEndBefore() with a null node.");
}
startContainer_ = refNode.getParent();
startOffset_ = getPositionInContainer(refNode);
}
COM: <s> sets the end of the range to be before the node </s>
|
funcom_train/12561206 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected int getInnerBounds(int dimension) {
// if there should be space left for highlight:
if (dimension == X || dimension == Y) {
return bounds[dimension] + ScreenSkin.PAD_FORM_ITEMS;
} else {
return bounds[dimension] -
ScreenSkin.PAD_FORM_ITEMS -
ScreenSkin.PAD_FORM_ITEMS;
}
}
COM: <s> used by child classes to get their location and size </s>
|
funcom_train/42086244 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void messageArrived(MessageCallback c) {
if (!c.getMessageTag().equals(RL_TAG)) {
doReplicateEvent(c, 0);
listenerTable.get(c.getMessageTag()).messageArrived(c);
}
else {
ReplicationMessage message = (ReplicationMessage) ReplicationMessage.createFromBytes(c.getMessageBytes());
message.applyTo(this);
}
}
COM: <s> as an overlay listener receives messages meant for the application and replicates them </s>
|
funcom_train/3168384 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Position chooseOne(XnRegion region) {
IntegerRegion integerRegion = (IntegerRegion) region;
return IntegerPos.make(integerRegion.start());
/*
udanax-top.st:30937:IntegerUpOrder methodsFor: 'accessing'!
{Position} chooseOne: region {XnRegion}
"Return the first position in the region according to my ordering."
^IntegerPos make: (region cast: IntegerRegion) start!
*/
}
COM: <s> return the first position in the region according to my ordering </s>
|
funcom_train/130135 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: synchronized public void renderObject(final Graphics2D g) {
if (fillBrush != null) {
fillBrush.useOn(g);
if (renderingDetail >= 2) {
g.fill(shape);
}
else if (renderingDetail == 1) {
Rectangle rect = shape.getBounds();
g.fillRect(rect.x, rect.y, rect.width, rect.height);
}
}
}
COM: <s> renders this object onto the supplied graphics context </s>
|
funcom_train/50345355 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addTypeName(String type){
// insert at start of list, sort later
if (_typeList.contains(type))
return;
_typeList.add(0,type);
log.debug("train "+getName()+" add car type "+type);
setDirtyAndFirePropertyChange (TYPES_CHANGED_PROPERTY, _typeList.size()-1, _typeList.size());
}
COM: <s> add a car or engine type name that this train will service </s>
|
funcom_train/31686082 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setProperty(String sPropName, String sValue) {
ArrayList aVals = new ArrayList(1);
aVals.add(sValue);
this.setProperty(sPropName, aVals);
ContextEvent ce = new ContextEvent(ContextType.CONTEXT_SYSTEM_PROP_CHANGED, sPropName);
ContextHandler.getInstance().fireContextEvent(ce);
}
COM: <s> sets a value for a given property </s>
|
funcom_train/8471223 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getFileSize(fileSizeUnit unit){
long _size = this.file.length();
if (unit == null){
return _size + " Bytes";
}
switch(unit){
case FILE_SIZE_BITS : return _size*8 + " Bits";
case FILE_SIZE_KIB : return _size/1024 + " KIB";
case FILE_SIZE_MIB : return _size/1048576 + " MIB";
case FILE_SIZE_GIB : return _size/1073741824 + " GIB";
default: return _size + " Bytes";
}
}
COM: <s> returns the file size in human readable units </s>
|
funcom_train/6201015 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getMinorMinor() {
try {
final String minorMinorBrut = getVersionPartAt(2, VERSION_DELIMITER_NUMBER);
return Integer.parseInt(minorMinorBrut.substring(0, minorMinorBrut.indexOf(VERSION_DELIMITER_BUILD)));
} catch (NumberFormatException e) {
return -1;
}
}
COM: <s> returns the code minor minor code value of the version string </s>
|
funcom_train/4920259 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testNullSupplierSourcePropertyName() {
final SupplierSourceProperty property = this
.createMock(SupplierSourceProperty.class);
// Record obtaining properties
this.recordReturn(this.specification,
this.specification.getProperties(),
new SupplierSourceProperty[] { property });
this.recordReturn(property, property.getName(), "");
this.record_issue("SupplierSourceProperty 0 provided blank name from SupplierSourceSpecification for "
+ MockSupplierSource.class.getName());
// Attempt to obtain specification
this.replayMockObjects();
this.loadSpecification(false);
this.verifyMockObjects();
}
COM: <s> ensures issue if code null code </s>
|
funcom_train/44011657 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testReadAllTrans() throws Exception {
System.out.println("readAllTrans");
TransactionDAO instance = new TransactionDAO();
ArrayList<TransactionBO> expResult = null;
ArrayList<TransactionBO> result = instance.readAllTrans();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
COM: <s> test of read all trans method of class edu </s>
|
funcom_train/22524223 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setFocus() {
if (debug) {
printDebugMessage("setFocus, editable=" + editable); //$NON-NLS-1$
}
if (editor != null) {
if (initialized) {
if (!editor.isFocusControl()) {
if (!Platform.getOS().equals("win32")) { //$NON-NLS-1$
// Workaround for Mozilla and Firefox rich text editor focus
// issue.
editor.setFocus();
}
executeCommand(RichTextCommand.SET_FOCUS);
}
hasFocus = true;
} else {
initializedWithFocus = true;
}
}
}
COM: <s> sets focus to this control </s>
|
funcom_train/21935240 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void performShootingBehaviour(){
if(state.getCanSee()){//Can see another player
state.setShooting(true);
startShooting();
} else{//Can't see another player
if(state.getShooting()){
state.setShooting(false);
stopShooting(); // stop shooting untill we can see again
}
}
}
COM: <s> this method performs the shooting </s>
|
funcom_train/20632422 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void actionPerformed(ActionEvent evt) {
String action = evt.getActionCommand();
if (action.equals("OK")) {
model.setAccepted(true);
dispose();
}
else if (action.equals("Cancel")){
dispose();
}
else {
Categories.ui().warn(action + " action is not supported.");
}
}
COM: <s> implements action listener </s>
|
funcom_train/38868265 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void intersect(DateInterval d) {
if (!d.isValid() || !isValid())
return;
dateFrom = new WDCDay(WDCDay.max(dateFrom, d.dateFrom));
dateTo = new WDCDay(WDCDay.min(dateTo, d.dateTo));
};
COM: <s> intersects the interval with another one </s>
|
funcom_train/21480844 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Money subtract(final Money money) {
if (null == money) {
return null;
}
if (!isCurrencyEqual(money)) {
throw new UnsupportedOperationException(ERROR_CURRENCIES_DONT_MATCH + currency.getCurrencyCode() + ", " //$NON-NLS-1$
+ money.getCurrency().getCurrencyCode());
}
return new Money(value.subtract(money.getValue()), currency);
}
COM: <s> subtracts specified money from this object </s>
|
funcom_train/46321935 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void set( float x, float y, float speed, int hitRange ) {
setTarget(x, y, 0);
if ( hitRange < 1 ) hitRange = 1;
((NumberProperty)properties().get("Speed")).set(speed);
((NumberProperty)properties().get("hitRange")).set(hitRange);
}
COM: <s> set function to change the target speed and hit range </s>
|
funcom_train/4837738 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addField(Map<String,String> fieldIds, String entityName, String fieldName, String permValue) {
String key = entityName + "." + fieldName;
if (fieldIds.containsKey(key)){
String permit = fieldIds.get(key);
if (Integer.valueOf(permit).intValue() > Integer.valueOf(permValue).intValue()) {
fieldIds.put(key, permValue);
}
} else {
fieldIds.put(key, permValue);
}
}
COM: <s> for get role permission field ids </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.