__key__
stringlengths 16
21
| __url__
stringclasses 1
value | txt
stringlengths 183
1.2k
|
---|---|---|
funcom_train/23356533 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected BufferedReader createReader() throws Exception {
// Path is an internet source. Read from inputstream.
if(this.path.indexOf("http://") != -1) {
URL url = new URL(path);
return new BufferedReader(new InputStreamReader(url.openStream()));
}
// Path is local file. Read from filereader.
return new BufferedReader(new FileReader(this.path));
}
COM: <s> creates a reader to the in constructor specified file </s>
|
funcom_train/181034 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void registerPropertyChangeListener(List objects, boolean register) throws ClassCastException {
Iterator iterator = objects.iterator();
while (iterator.hasNext()) {
if (register) {
((DbChangeableBean)iterator.next()).addPropertyChangeListener((java.beans.PropertyChangeListener)this);
} else {
((DbChangeableBean)iterator.next()).removePropertyChangeListener((java.beans.PropertyChangeListener)this);
}
}
}
COM: <s> helper method to register bean changes for this view </s>
|
funcom_train/7372189 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void registerSpillable(Spillable s) {
synchronized(spillables) {
// Cleaing the entire list is too expensive. Just trim off the front while
// we can.
WeakReference<Spillable> first = spillables.peek();
while (first != null && first.get() == null) {
spillables.remove();
first = spillables.peek();
}
spillables.add(new WeakReference<Spillable>(s));
}
}
COM: <s> register a spillable to be tracked </s>
|
funcom_train/4509881 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getUsersBaseDN(String username) {
try {
findUserDN(username, baseDN);
return baseDN;
}
catch (Exception e) {
try {
if (alternateBaseDN != null) {
findUserDN(username, alternateBaseDN);
return alternateBaseDN;
}
}
catch (Exception ex) {
Log.debug(ex);
}
}
return null;
}
COM: <s> returns the base dn for the given username </s>
|
funcom_train/35214071 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isSql(String text) {
if (org.apache.commons.lang.StringUtils.isBlank(text) || text.length() < 7)
return false;
if (text.trim().substring(0, 6).equalsIgnoreCase("update")
|| text.trim().substring(0, 6).equalsIgnoreCase("select")
|| text.trim().substring(0, 6).equalsIgnoreCase("delete")) {
return true;
} else {
return false;
}
}
COM: <s> check whether it is sql </s>
|
funcom_train/27711416 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getName(int i) {
if (i < 0 || i >= fAttributeListLength)
return null;
int chunk = (fAttributeListHandle + i) >> CHUNK_SHIFT;
int index = (fAttributeListHandle + i) & CHUNK_MASK;
return fStringPool.toString(fAttName[chunk][index]);
}
COM: <s> return the name of an attribute in this list by position </s>
|
funcom_train/13599123 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeLeavingTransition(Transition leavingTransition) {
if (leavingTransition == null) throw new IllegalArgumentException("can't remove a null leavingTransition from an node");
if (leavingTransitions != null) {
if (leavingTransitions.remove(leavingTransition)) {
leavingTransition.from = null;
leavingTransitionMap = null;
}
}
}
COM: <s> removes the bidirection relation between this node and the given leaving transition </s>
|
funcom_train/19657305 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testNullConstArgs() {
// test various permutations.
nullConstArgument(null, null, null);
nullConstArgument(new TextBox(), null, null);
nullConstArgument(null, "blah", null);
nullConstArgument(null, null, new TextBox());
nullConstArgument(new TextBox(), null, new PasswordTextBox());
}
COM: <s> test to insure that when we use null constructor arguments well get an </s>
|
funcom_train/22233862 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getReverbOrder() {
if (!this.getCapability(ALLOW_REVERB_ORDER_READ))
if (isLiveOrCompiled())
throw new CapabilityNotSetException(J3dI18N.getString("AuralAttributes9"));
return ((AuralAttributesRetained)this.retained).getReverbOrder();
}
COM: <s> retrieve reverberation order </s>
|
funcom_train/934180 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addServletMapping(String servletName, String urlPattern) {
if (log.isDebugEnabled()) {
log.debug("Process servletName=" + servletName +
", urlPattern=" + urlPattern);
}
if (servletName == null) {
return;
}
if (servletName.equals(this.servletName)) {
this.servletMapping = urlPattern;
}
}
COM: <s> remember a servlet mapping from our web application deployment </s>
|
funcom_train/38494001 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getLineNumber(Location start) {
LineNumberTableAttr table = mOldLineNumberTable;
if (table == null) {
table = mLineNumberTable;
}
if (table == null || start.getLocation() < 0) {
return -1;
} else {
return table.getLineNumber(start);
}
}
COM: <s> returns the line number in the source code from the given bytecode </s>
|
funcom_train/3155288 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private ParamProperties createInvalidPixelInfo() {
ParamProperties paramProps = _defaultFactory.createBoundFloatParamProperties();
paramProps.setLabel(SstConstants.INVALID_PIXEL_LABELTEXT);
paramProps.setDescription(SstConstants.INVALID_PIXEL_DESCRIPTION);
paramProps.setDefaultValue(SstConstants.DEFAULT_INVALID_PIXEL);
return paramProps;
}
COM: <s> creates the parameter information for the parameter invalid pixel </s>
|
funcom_train/16819108 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void runFormFunctionByName(String fName, Object[] params) {
IFormManager manager = app.getFormManager();
if (manager != null) {
IForm form = manager.getCurrentForm();
if (form != null) {
String formName = form.getName();
if (formName != null) {
try {
app.executeMethod(formName, fName, params, true);
} catch (Exception ex) {
Debug.error(ex);
}
}
}
}
}
COM: <s> generic callback to a form function </s>
|
funcom_train/18381797 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ForumMessage readMessage(Long msgId) throws DAOException {
ForumMessage msg = null;
try {
session = ForumHibernateUtil.currentSession();
msg = (ForumMessage) session.load(ForumMessage.class, msgId);
} catch (HibernateException e) {
logger.debug(" message cannot be read "+e.getMessage());
}
return msg;
}
COM: <s> retrieve the message </s>
|
funcom_train/14306467 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void moveUp(int row) {
Object a = elements.elementAt(row);
Object b = elements.elementAt(row - 1);
elements.setElementAt(a, row - 1);
elements.setElementAt(b, row);
fireTableRowsUpdated(row - 1, row);
pathElementTable.setRowSelectionInterval(row - 1, row - 1);
}
COM: <s> move an element up towards the front of the path </s>
|
funcom_train/5377246 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int matchProcessorOSNameFilter(String processor, String osname) {
if ((this.processor == null) || (this.osname == null)) {
return (0);
}
String otherProcessor = aliasMapper.aliasProcessor(processor);
String otherOSName = (String) aliasMapper.aliasOSName(osname);
if (this.processor.equals(otherProcessor) && this.osname.equals(otherOSName) && matchFilter()) {
return (1);
}
return (0);
}
COM: <s> return the match value for the given processor and os name </s>
|
funcom_train/46764828 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setConfigPanel(JComponent panel){
// remove old panel
JPanel oldpanel = null;
if (jPanel.getComponentCount()>0)
oldpanel = (JPanel) jPanel.getComponent(0);
if (oldpanel != null)
jPanel.remove(oldpanel);
// add panel or substitution text
if (panel != null)
jPanel.add(panel,BorderLayout.CENTER);
else{
JTextArea area = new JTextArea(Resources.getString("msg_no_config_available"));
jPanel.add(area);
}
validate();
pack();
}
COM: <s> changes the content of the copnfiguration panel </s>
|
funcom_train/14331010 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGenerateEntity() {
System.out.println("generateEntity");
JPEntityBuilder instance = new JPEntityBuilder();
String expResult = "";
String result = instance.generateEntity();
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 generate entity method of class org </s>
|
funcom_train/43540231 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testDifferentLengthFile() {
try {
IUIContext ui = getUI();
diffFiles(ui, "DiffLengthFile.txt"); //$NON-NLS-1$
fail("We expected an exception because the files are different lengths."); //$NON-NLS-1$
} catch (DifferenceException de) {
// Do nothing. We expected an exception
}
}
COM: <s> test different length file files of different lengths should throw an exception </s>
|
funcom_train/22553045 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testDownloading() throws Exception {
//replace the downloadManger with a stub
Object originalDM = RouterService.getDownloadManager();
_partial.setActivelyDownloading(true);
HeadPing ping = new HeadPing(_havePartial);
HeadPong pong = reparse (new HeadPong(ping));
assertTrue(pong.isDownloading());
_partial.setActivelyDownloading(false);
pong = reparse (new HeadPong(ping));
assertFalse(pong.isDownloading());
//restore the original download manager
PrivilegedAccessor.setValue(RouterService.class,"downloadManager",originalDM);
}
COM: <s> tests whether the downloading flag is set properly </s>
|
funcom_train/51811994 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void assertMapSetTest(SimpleTestService service) {
Map map = service.getMap();
assertNotNull("Map is null", map);
assertEquals("bar", map.get("foo"));
map = (Map) map.get("map");
assertEquals("Inner Map", "bar", map.get("foo"));
}
COM: <s> common asserts for map set tests </s>
|
funcom_train/50344088 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void deleteKernel(String name){
Kernel kernel = getKernelByName(name);
if (kernel != null){
kernel.dispose();
Integer oldSize = Integer.valueOf(_kernelHashTable.size());
_kernelHashTable.remove(name);
firePropertyChange(KERNELLISTLENGTH_CHANGED_PROPERTY, oldSize, Integer.valueOf(_kernelHashTable.size()));
}
}
COM: <s> delete a kernel by name </s>
|
funcom_train/47826562 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void notify(Task child) {
// Delete task and plan from lists
String planId = ((PlanExecutionTask) child).getPlanId();
plans.remove(planId);
tasks.remove(planId);
logger.debug("PlanCoordinationTask, plan " + planId + " completed");
}
COM: <s> a child task plan execution task notifies the finalization of the job </s>
|
funcom_train/25648856 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testNodeDescriptionAccessors() {
ModelDesignPerspectiveModel instance = new ModelDesignPerspectiveModel();
String expResult = "";
String result = instance.getNodeDescription();
assertEquals(expResult, result);
String desc = "description";
instance.setNodeDescription(desc, null);
assertEquals(desc, instance.getNodeDescription());
instance.setNodeDescription(null, null);
assertEquals("", instance.getNodeDescription());
}
COM: <s> test of get node description method of class com </s>
|
funcom_train/35166080 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Vector3f getRayIntersection(Tuple3f pos, Tuple3f dir) {
float t = getRayIntersectionT(pos, dir);
if (t < 0 || Float.isInfinite(t)) {
System.out.println("Plane.getRayIntersection("+pos+", " + dir + "). t is infinite or less than zero:" + t);
return null;
}
Vector3f tuple = new Vector3f();
tuple.scaleAdd(t, dir, pos);
return tuple;
}
COM: <s> returns the intersection point between this plane and the ray pos dir </s>
|
funcom_train/40451771 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addFailedBuild(String user) {
if (this.userToFailureMap.containsKey(user)) {
Integer count = this.userToFailureMap.get(user) + 1;
this.userToFailureMap.put(user, count);
}
else {
this.userToFailureMap.put(user, 1);
}
this.members.add(user);
}
COM: <s> adds a failed build for a user </s>
|
funcom_train/22233405 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setColor(Color3f color) {
if (isLiveOrCompiled())
if(!this.getCapability(ALLOW_COLOR_WRITE))
throw new CapabilityNotSetException(J3dI18N.getString("Background0"));
if (isLive())
((BackgroundRetained)this.retained).setColor(color);
else
((BackgroundRetained)this.retained).initColor(color);
}
COM: <s> sets the background color to the specified color </s>
|
funcom_train/14181041 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testReopenGame() {
Game game = new Game(mainuser, "labyrinth", "hackebeil", 6, true);
glist.add(game);
game.setStatus(Game.State.STARTED);
gm.reopenGame(game.getSession());
assertEquals("unexpected game state",
game.getStatus(), Game.State.OPEN);
}
COM: <s> tests the reopen game method </s>
|
funcom_train/8629908 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getSavepointName() throws SQLException {
try {
debugCodeCall("getSavepointName");
checkValid();
if (name == null) {
throw Message.getSQLException(ErrorCode.SAVEPOINT_IS_UNNAMED);
}
return name;
} catch (Exception e) {
throw logAndConvert(e);
}
}
COM: <s> get the name of this savepoint </s>
|
funcom_train/20924102 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void moveAll(Linkage<T> start, Linkage<T> end) {
if (start!=end) {
// "cut" the range
Linkage<T> last=end.mPrev;
end.mPrev=start.mPrev;
start.mPrev.mNext=end;
// "paste" it so that it precedes this linkage
last.mNext=this;
start.mPrev=mPrev;
mPrev.mNext=start;
mPrev=last;
}
}
COM: <s> moves a range start end of linkage elements out of </s>
|
funcom_train/10866979 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setMinShingleSize(int minShingleSize) {
if (minShingleSize < 2) {
throw new IllegalArgumentException("Min shingle size must be >= 2");
}
if (minShingleSize > maxShingleSize) {
throw new IllegalArgumentException
("Min shingle size must be <= max shingle size");
}
this.minShingleSize = minShingleSize;
gramSize = new CircularSequence();
}
COM: <s> p set the min shingle size default 2 </s>
|
funcom_train/45306575 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String saveFile ( ) {
String retFile = "";
JFileChooser fileChooser = new JFileChooser();
fileChooser.setDialogTitle("Save as..");
int retval = fileChooser.showSaveDialog(null);
if ( retval == 0 ) retFile=fileChooser.getSelectedFile().toString();
return retFile;
}
COM: <s> add a new textline to the text area </s>
|
funcom_train/34420831 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public List getAttributes() {
attributes = new ArrayList();
if (item != null) {
Iterator iter = item.entrySet().iterator();
while (iter.hasNext()) {
WorkItemAttribute da = new WorkItemAttribute();
Map.Entry mapEntry = (Map.Entry) iter.next();
da.setName(mapEntry.getKey().toString());
da.setValue(mapEntry.getValue().toString());
attributes.add(da);
}
}
return attributes;
}
COM: <s> returns a list of item objects related to the corresponding map entries </s>
|
funcom_train/15931415 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void mainLoop() {
while (!isShutdown()) {
ForkJoinTask<?> t = pollTask();
if (t != null || (t = pollSubmission()) != null)
t.quietlyExec();
else if (tryInactivate())
pool.sync(this);
}
}
COM: <s> execute tasks until shut down </s>
|
funcom_train/7875086 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Location getLocation(String locationID){
BaseDaoImpl dao = new BaseDaoImpl();
String sql = "from " + Location.class.getName() + " where locationID ='" + locationID + "'";
List lst = dao.load(sql, 0, 1);
if (lst == null || lst.size() == 0)
return new Location();
return (Location) lst.get(0);
}
COM: <s> location location id </s>
|
funcom_train/34396231 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ValueRange convertUOM(UOM targetUom, Measurement maxValue) {
Measurement start = getStart();
if (null != start) {
start = start.convert(targetUom, maxValue);
}
Measurement end = getEnd();
if (null != end) {
end = end.convert(targetUom, maxValue);
}
return new ValueRange(start, end, isInsideRangeMode());
}
COM: <s> convert values of this range to the specified target units </s>
|
funcom_train/43900276 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean addLayer(MapLayer layer) {
if (layerList.contains(layer)) {
return false;
}
layerList.add(layer);
// getLayerBounds();
layer.addMapLayerListener(layerListener);
bounds = null;
fireMapLayerListListenerLayerAdded(new MapLayerListEvent(this, layer, indexOf(layer)));
return true;
}
COM: <s> add a new layer and trigger a </s>
|
funcom_train/15893249 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private FilterSetting getDistinctFilterSetting(String startsWith, String filterName) {
// TODO use map or other kind of lookup
FilterSetting result = null;
Enumeration names = getProperties().propertyNames();
while (names.hasMoreElements()) {
String name = (String) names.nextElement();
if (name.startsWith(startsWith) && matchesFilterPropertyName(name, filterName))
if (result==null)
result = getDistinctFilterSetting(name);
else
throw new AmbiguousFilterReference(startsWith+".*"+filterName);
}
return result;
}
COM: <s> find a distinct property whose name starts with code starts with code </s>
|
funcom_train/22926535 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void initMaterial(){
// Initializes default colors
Color3f ambientColor = new Color3f(COLOR_AMBIENT_DEFAULT);
Color3f emissiveColor = new Color3f(COLOR_EMISSIVE_DEFAULT);
Color3f diffuseColor = new Color3f(COLOR_DIFFUSE_DEFAULT);
Color3f specularColor = new Color3f(COLOR_SPECULAR_DEFAULT);
// Add default colors and shininess to a material object
Material material = new Material(ambientColor, emissiveColor, diffuseColor, specularColor, MATERIAL_SHININESS);
// Applies the material to the appearance
appearance.setMaterial(material);
}
COM: <s> init material creates a material with default characteristics </s>
|
funcom_train/35669629 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addFragmentNamePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Fragment_fragmentName_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Fragment_fragmentName_feature", "_UI_Fragment_type"),
FragmentsPackage.Literals.FRAGMENT__FRAGMENT_NAME,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the fragment name feature </s>
|
funcom_train/3517938 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void cleanup(int x) {
int size = history.size();
if (x > size)
return;
List<HistoryItem> sublist = history.subList(size - x, size);
Vector<HistoryItem> tmp = new Vector<HistoryItem>();
for (HistoryItem item : sublist) {
tmp.add(item);
}
history = tmp;
}
COM: <s> deletes all entries code history item code up to the last </s>
|
funcom_train/4193369 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void onReceivedPacket(UdpProvider udp, UdpPacket packet)
{ Message msg=new Message(packet);
msg.setRemoteAddress(packet.getIpAddress().toString());
msg.setRemotePort(packet.getPort());
msg.setTransport(PROTO_UDP);
if (listener!=null) listener.onReceivedMessage(this,msg);
}
COM: <s> when a new udp datagram is received </s>
|
funcom_train/26256173 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void loadUserConfig() {
String configFiles = Utils.getSystemProperty(CONFIG_FILES_NAME);
if (configFiles != null) {
StringTokenizer tokens = new StringTokenizer(configFiles, ";");
while (tokens.hasMoreTokens()) {
String fileName = tokens.nextToken();
baseContext.importXMLConfig(fileName);
}
}
}
COM: <s> load the user configuration files defined in the system property </s>
|
funcom_train/4644784 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addTaskSummaryPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Task_taskSummary_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Task_taskSummary_feature", "_UI_Task_type"),
TassooPackage.Literals.TASK__TASK_SUMMARY,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the task summary feature </s>
|
funcom_train/20400941 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ModelAndView displaySysErr(HttpServletRequest request, HttpServletResponse response) throws Exception {
long taskRunId = getTaskRunId(request);
TaskRun taskRun = taskRunManager.get(taskRunId);
String message = taskRun.getSysErr();
return new ModelAndView("display_task_run_message", "message", message);
}
COM: <s> display a task runs system error output </s>
|
funcom_train/28417837 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setEncoding(String encoding) throws EncodingException {
for (int i=0; i < algorithms.size(); i++) {
((AbstractChecksum)algorithms.elementAt(i)).setEncoding(encoding);
}
this.encoding = ((AbstractChecksum)algorithms.elementAt(0)).getEncoding();
}
COM: <s> sets the encoding of the checksum </s>
|
funcom_train/21644121 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JMenuItem getEditFindMenuItem() {
if (editFindMenuItem == null) {
editFindMenuItem = new JMenuItem();
editFindMenuItem.setText("Find...");
editFindMenuItem.setMnemonic('F');
editFindMenuItem.setDisplayedMnemonicIndex(0);
editFindMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F, InputEvent.CTRL_MASK));
editFindMenuItem.addActionListener(eventHandler);
}
return editFindMenuItem;
}
COM: <s> return the edit find menu item </s>
|
funcom_train/4049094 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected int updatePosition(int offset, int max_offset) {
int i = getTargetOffset(); // Depending on old position value
position += offset; // Position may be shifted by preceding expansions
if(Math.abs(i) >= (32767 - max_offset)) { // to large for short (estimate)
tag = GOTO_W;
length = 5;
return 2; // 5 - 3
}
return 0;
}
COM: <s> called in pass 2 of instruction list </s>
|
funcom_train/35279123 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void onAnimCycleDone(AnimControl control, AnimChannel channel, String animName) {
if (animName.equals("Walk")) {
/** After "walk", reset to "stand". */
channel.setAnim("stand", 0.50f);
channel.setLoopMode(LoopMode.DontLoop);
channel.setSpeed(1f);
}
}
COM: <s> use this listener to trigger something after an animation is done </s>
|
funcom_train/46965965 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JMenuItem getJMenuItemRemoveSegment() {
if (jMenuItemRemoveSegment == null) {
jMenuItemRemoveSegment = new JMenuItem();
jMenuItemRemoveSegment.setActionCommand("removesegment");
jMenuItemRemoveSegment.setText("Remove a video segment");
jMenuItemRemoveSegment.addActionListener(vmVideoPanelController);
}
return jMenuItemRemoveSegment;
}
COM: <s> this method initializes j menu item remove segment </s>
|
funcom_train/31902047 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void mouseClicked(MouseEvent e) {
AthensPane editor = (AthensPane) e.getSource();
if (! editor.isEditable()) {
Point pt = new Point(e.getX(), e.getY());
int pos = editor.viewToModel(pt);
if (pos >= 0) {
activateLink(pos, editor, JUMP);
}
}
}
COM: <s> heres the mouse clicked event similar to the one in </s>
|
funcom_train/10862504 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void streamRecords(Reader r, Handler handler) {
try {
XMLStreamReader parser = factory.createXMLStreamReader(r);
rootNode.parse(parser, handler, new HashMap<String, Object>(),
new Stack<Set<String>>(), false);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
COM: <s> creates an xml stream reader on top of whatever reader has been </s>
|
funcom_train/1952185 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isCompletelyBinary() {
if ( isEmpty() ) {
return false;
}
for( final PhylogenyNodeIterator iter = iteratorPreorder(); iter.hasNext(); ) {
final PhylogenyNode node = iter.next();
if ( node.isInternal() && ( node.getNumberOfDescendants() != 2 ) ) {
return false;
}
}
return true;
}
COM: <s> returns whether this is a completely binary tree i </s>
|
funcom_train/12560827 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void lSetDate(java.util.Date date) {
if (Logging.REPORT_LEVEL <= Logging.INFORMATION) {
Logging.report(Logging.INFORMATION, LogChannels.LC_HIGHUI,
"(mdSetDate: id="+nativeId+")");
}
if (nativeId != DisplayableLFImpl.INVALID_NATIVE_ID) {
if (date != null) {
setDate0(nativeId, date.getTime());
} else {
setDate0(nativeId, 0l);
}
}
}
COM: <s> notifies l amp f of a date change in the corresponding </s>
|
funcom_train/22278821 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean keyDown(java.awt.Event evt, int key) {
// if (evt.target == this) {
// addEvent(new KeyEvent(evt.when, key, evt.modifiers, true));
// return true;
// } else {
return super.keyDown(evt, key);
// }
}
COM: <s> overridden to add a key event of type b key event </s>
|
funcom_train/18481580 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setCombineColorSource1(CombineColorSource combine_color_source1) {
if (combine_color_source1 != this.combine_color_source1) {
CombineColorSource old = this.combine_color_source1 ;
this.combine_color_source1 = combine_color_source1 ;
notifyChanged(COMBINECOLORSOURCE1,old,combine_color_source1) ;
}
}
COM: <s> sets the combinesource for the color component for source 1 </s>
|
funcom_train/7870659 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int compare( Object o1, Object o2 ) {
try {
Object value1 = PropertyUtils.getProperty( o1, property );
Object value2 = PropertyUtils.getProperty( o2, property );
return comparator.compare( value1, value2 );
}
catch ( Exception e ) {
throw new ClassCastException( e.toString() );
}
}
COM: <s> compare two java beans by their shared property </s>
|
funcom_train/44329023 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JPanel createContentPanel() {
JPanel panel = new JPanel(new BorderLayout());
editor = new JEditorPane();
editor.setEditable(false);
try {
URL url = new URL("file:" + HTML_PATH);
editor.setPage(url);
} catch (IOException e) {
e.printStackTrace();
}
panel.add(new JScrollPane(editor), BorderLayout.CENTER);
return panel;
}
COM: <s> creates and returns the content panel </s>
|
funcom_train/26047963 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setReaderTermsIndexDivisor(int divisor) {
ensureOpen();
if (divisor <= 0) {
throw new IllegalArgumentException("divisor must be >= 1 (got " + divisor + ")");
}
readerTermsIndexDivisor = divisor;
if (infoStream != null) {
message("setReaderTermsIndexDivisor " + readerTermsIndexDivisor);
}
}
COM: <s> sets the terms index divisor passed to any readers that </s>
|
funcom_train/47294157 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected RoleInfo bindObject() throws Exception {
RoleInfo role = null;
try {
role = roleReps.getById(model.getId(),true);
} catch (JSONException ex) {
System.err.println(ex);
}
if (role == null) {
role = model;
} else {
BeanUtil.copyProperties(model, role);
}
return role;
}
COM: <s> json pojo pojo </s>
|
funcom_train/32057179 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testWriteStringHashtableGPGraphGraphModel() {
TPGraphModelFileFormatSerial x = new TPGraphModelFileFormatSerial();
GraphModel myModel = null;
try {
x.write(new String(), new Hashtable(), new GPGraph(), myModel );
} catch (Exception e1) {
// TODO Auto-generated catch block
fail();
e1.printStackTrace();
}
}
COM: <s> this function tests write function of tpgraph model file format serial class </s>
|
funcom_train/48406446 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addVariabilityBasedOnElementPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_VariabilityElement_variabilityBasedOnElement_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_VariabilityElement_variabilityBasedOnElement_feature", "_UI_VariabilityElement_type"),
SpemxtcompletePackage.eINSTANCE.getVariabilityElement_VariabilityBasedOnElement(),
true,
false,
true,
null,
null,
null));
}
COM: <s> this adds a property descriptor for the variability based on element feature </s>
|
funcom_train/17855307 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void invokeX10C(Collection<IFile> sources) {
X10DTCorePlugin.getInstance().maybeWriteInfoMsg("Running X10C on source file set '" + fileSetToString(sources) + "'...");
clearMarkersOn(sources);
compileAllSources(sources);
X10DTCorePlugin.getInstance().maybeWriteInfoMsg("X10C completed on source file set.");
}
COM: <s> run the x10 compiler on the given collection of source ifiles </s>
|
funcom_train/45346329 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
this.viewer = (TableViewer) viewer;
if (this.manager != null) {
this.manager.removeListener(this);
}
// The FilterThroughCommandConsoleManager manages console content.
this.manager = (FilterThroughCommandConsoleManager) newInput;
if (this.manager != null) {
this.manager.addListener(this);
}
}
COM: <s> this method is executed when the input of the view is changed </s>
|
funcom_train/16181178 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int produce(){
int meals = 0;
int numberOfMachines = 0;
for (int i = 0; i < personnel.size(); i++) {
Person person = personnel.get(i);
int machines = person.produce();
numberOfMachines = numberOfMachines + machines;
}
if(numberOfMachines == 0) {
return 0;
}
for (int i = 0; i < equipments.size();i++){
meals = meals + equipments.get(i).produce();
if(i == numberOfMachines -1) {
return meals;
}
}
return meals;
}
COM: <s> calculates the number of meals produced by this department </s>
|
funcom_train/32081952 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setClipping (int x, int y, int width, int height) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (width < 0) {
x = x + width;
width = -width;
}
if (height < 0) {
y = y + height;
height = -height;
}
int rect = OS.gcnew_Rect(x, y, width, height);
int clip = OS.gcnew_RectangleGeometry(rect);
OS.GCHandle_Free(rect);
if (data.clip != 0) OS.GCHandle_Free(data.clip);
data.clip = clip;
data.state &= ~CLIPPING;
}
COM: <s> sets the area of the receiver which can be changed </s>
|
funcom_train/10910976 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public AbstractBorderElement merge(AbstractBorderElement e) {
AbstractBorderElement abe = this;
if (e instanceof SolidAndDoubleBorderElement) {
abe = mergeSolid((SolidAndDoubleBorderElement) e);
} else if (e instanceof DashedBorderElement) {
abe = mergeDashed((DashedBorderElement) e);
} else {
abe = e;
}
return abe;
}
COM: <s> merges with border element </s>
|
funcom_train/16524093 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setMap(Map map) {
if (this.map != null) {
this.map.removeMapChangeListener(listener);
}
if (map == null) {
removeAll();
} else {
recreateTabs(map.getTilesets());
map.addMapChangeListener(listener);
}
this.map = map;
}
COM: <s> sets the tiles panes to the the ones from this map </s>
|
funcom_train/1067307 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public CreationToolEntry getCombinedTemplateCreationToolEntry(String label, String tooltip, Class clazz, Enumerator kind){
String symbolicName=label+tooltip+clazz+kind;
CreationToolEntry result= creationToolEntryManager.get(symbolicName);
if(result==null){
creationToolEntryManager.put(symbolicName, createCombinedTemplateCreationEntry(label, tooltip, clazz, kind));
result= creationToolEntryManager.get(symbolicName);
}
return result;
}
COM: <s> to obtain the creation tool entry from the symbolic name </s>
|
funcom_train/38864237 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void getStn_YrMo(String stn) {
SubTitle1="Year by Month - Number of Days";
SubTitle2="Station="+stn;
// Create SQL statement
String sql = "SELECT yr,mo,Ndays";
sql += " FROM stnInv";
sql += " WHERE stn='" + stn + "' ORDER BY yr,mo";
getVarXMonth("yr",sql);
}
COM: <s> create the inventory for a given station </s>
|
funcom_train/38435714 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Element clusteringModel () throws Exception {
Element clusteringModelElement = new Element ("ClusteringModel");
clusteringModelElement.setAttribute("modelName", m_instances.relationName());
clusteringModelElement.setAttribute("modelClass", "centerBased");
clusteringModelElement.setAttribute("numberOfClusters", String.valueOf(m_NumClusters));
return clusteringModelElement;
}
COM: <s> creates the clustering model element </s>
|
funcom_train/37817430 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JSplitPane createSplitLeftRight() {
JSplitPane splitLeftRight = new JSplitPane();
splitLeftRight.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
splitLeftRight.setContinuousLayout(true);
splitLeftRight.setOneTouchExpandable(true);
splitLeftRight.setDividerLocation(300);
return splitLeftRight;
}
COM: <s> creates the vertical split pane used by pulsemem </s>
|
funcom_train/17017155 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getMinimumUserLimitPercent(String queue) {
int userLimit = rmConf.getInt(toFullPropertyName(queue,
"minimum-user-limit-percent"), defaultUlimitMinimum);
if(userLimit <= 0 || userLimit > 100) {
throw new IllegalArgumentException("Invalid user limit : "
+ userLimit + " for queue : " + queue);
}
return userLimit;
}
COM: <s> get the minimum limit of resources for any user submitting jobs in </s>
|
funcom_train/25648959 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetView() {
System.out.println("getView");
try {
Settings.load(MainApplication.FILE_PROPERTIES);
} catch (IOException ex) {
ex.printStackTrace();
}
MainApplicationModel ami = MainApplicationModel.getInstance();
TestDesignPerspective instance = new TestDesignPerspective(ami);
View result = instance.getView();
assertNotNull(result);
}
COM: <s> test of get view method of class com </s>
|
funcom_train/8077778 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean checkForAllFailedHosts() {
boolean allbad = true;
for (int i = 0; i < m_remoteHostsStatus.length; i++) {
if (m_remoteHostsStatus[i] != CONNECTION_FAILED) {
allbad = false;
break;
}
}
if (allbad) {
abortExperiment();
notifyListeners(false,true,true,"Experiment aborted! All connections "
+"to remote hosts failed.");
}
return allbad;
}
COM: <s> check to see if we have failed to connect to all hosts </s>
|
funcom_train/50916652 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public CMLAtomSet intersection(CMLAtomSet atomSet2) throws RuntimeException {
CMLAtomSet newAtomSet = new CMLAtomSet();
List<CMLAtom> atoms = this.getAtoms();
for (int i = 0; i < atoms.size(); i++) {
if (atomSet2.contains(atoms.get(i))) {
newAtomSet.addAtom(atoms.get(i));
}
}
return newAtomSet;
}
COM: <s> returns intersection of this atom set with another </s>
|
funcom_train/47706497 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: @Override protected void startup() {
//Check to see if the data directory exists in the user's home
//directory.
File dataDir = new File(System.getProperty("user.home") +
"/.ImageGnome");
if (dataDir.exists() == false) {
dataDir.mkdir();
}
show(new ImageGnomeView(this));
}
COM: <s> at startup create and show the main frame of the application </s>
|
funcom_train/22140751 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private FlashCardManagementService getFlashCardService() {
if(this.flashCardMgtService == null){
synchronized (FlashCardManagementService.class) {
// just to be ultra extra safe
if(this.flashCardMgtService == null){
this.flashCardMgtService =
(FlashCardManagementService) getBeanFactory().getBean(FLASHCARD_SERVICE_NAME);
}
}
}
return this.flashCardMgtService;
}
COM: <s> go get the flash card management service instantiate it if no instance </s>
|
funcom_train/7868555 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {
if ("organisation".equals(portName)) {
setorganisationEndpointAddress(address);
}
else
{ // Unknown Port Name
throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName);
}
}
COM: <s> set the endpoint address for the specified port name </s>
|
funcom_train/638457 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getVerticalDistance(SimpleInstance annotation1, SimpleInstance annotation2) {
Span span1 = manager.getSpanUtil().getFirstSpan(annotation1);
Span span2 = manager.getSpanUtil().getFirstSpan(annotation2);
if (span1 == null || span2 == null)
return Integer.MIN_VALUE;
try {
Rectangle span1Pos = textPane.modelToView(span1.getStart());
Rectangle span2Pos = textPane.modelToView(span2.getStart());
return span2Pos.y - span1Pos.y;
} catch (BadLocationException ble) {
ble.printStackTrace();
return Integer.MIN_VALUE;
}
}
COM: <s> calculates the verticle distance in pixels between annotation1 and </s>
|
funcom_train/45279344 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Square xyToCoordinates(int x, int y) {
try {
char file =
Square.intToFile(((x - LEFT_MARGIN + CELL_SIZE) / CELL_SIZE));
int rank = CELLS - (y / CELL_SIZE);
return new Square(file, rank);
} catch (IllegalArgumentException e) {
return null;
}
}
COM: <s> computes the code coordinate code of the chessboard from the </s>
|
funcom_train/8484722 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ATField meta_grabField(ATSymbol fieldName) throws InterpreterException {
try {
return new JavaField(wrappedObject_,
Symbiosis.getField(wrappedObject_.getClass(), Reflection.upSelector(fieldName), false));
} catch(XUndefinedSlot e) {
return super.meta_grabField(fieldName);
}
}
COM: <s> fields can be grabbed from a symbiotic java object </s>
|
funcom_train/22237360 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JMenuItem getJMenuItem() {
if (jMenuItem == null) {
jMenuItem = new JMenuItem();
jMenuItem.setText("Open");
jMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
openScene(chooseFile());
}
});
}
return jMenuItem;
}
COM: <s> this method initializes j menu item </s>
|
funcom_train/640727 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Point2D snap(Point2D p) {
if (gridEnabled && p != null) {
double sgs = gridSize /** getScale()*/;
p.setLocation(Math.round(Math.round(p.getX() / sgs) * sgs), Math
.round(Math.round(p.getY() / sgs) * sgs));
}
return p;
}
COM: <s> returns the given point applied to the grid </s>
|
funcom_train/47981574 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void logToFile(String str){
FileWriter fw;
File file = new File("xhunt.log");
try {
fw = new FileWriter(file, true);
BufferedWriter bw = new BufferedWriter(fw);
bw.write(str);
bw.newLine();
bw.close();
} catch (IOException e) {
System.err.println("ERROR while writing to logfile: " + file.getAbsolutePath());
e.printStackTrace();
}
}
COM: <s> log a string to file </s>
|
funcom_train/47563380 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void init(int number_of_objects_, int total_no_rounds_) {
if (unusedObjectList == null) {
unusedObjectList = new ArrayList<Integer>();
/** Adds object to unused list **/
/** From 2 because 1 is the object in treasure room **/
for (int i = 2; i <= number_of_objects_; i++) {
unusedObjectList.add(i);
}
totalRounds = total_no_rounds_;
// if(number_of_objects_ > 20){
// stepsToDrop = 4;
// }
}
}
COM: <s> init function initializes object set and the rest </s>
|
funcom_train/37422319 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ToolType findToolTypeByName(String pName) throws ClassNotFoundException, SQLException {
Vector tVect = findToolTypeByQuery("select * from tooltype where name = " + Utility.isNull(pName));
if (tVect.size() > 0)
return (ToolType) tVect.firstElement();
else
return null;
}
COM: <s> finds a tool type in the database using its name </s>
|
funcom_train/3030782 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void run() {
InputStream input = null;
try {
StringBuffer buf = new StringBuffer("message");
input = new FileInputStream("c:\\temp\\test.txt");
input.write(buf.toString().getBytes());
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
try {
if (input != null) {
input.close();
}
} catch (IOException ioe) {
System.out.println("Unable to close the file");
}
}
}
COM: <s> main processing method for the try test object </s>
|
funcom_train/26369871 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testIdAlbumArtistCreate(){
Album a = new Album( 12, "ALBUM", 25 );
assertTrue( a.getType() == MP3Config.ALBUM_TYPE );
assertTrue( a.getArtistId() == 25 );
assertTrue( a.toString().equals( "ALBUM" ));
assertTrue( a.getId() == 12 );
}
COM: <s> tests creation of album object </s>
|
funcom_train/42842903 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testLongitudeDecimalConstructor() {
Longitude longitude = new Longitude(46.17444);
assertEquals("checking the longitude value in sexagesimal",
46.17444, longitude.toSexagesimal(), 0.0000);
assertEquals("checking the longitude toString", "46 10'27.98399999998935'' E",
longitude.toString());
}
COM: <s> tests the decimal constructor of the longitude class </s>
|
funcom_train/37434574 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void initialise(XSObject theParent, SchemaContext theSchemaContext, InstanceContext theInstanceContext) throws XMLException {
parent = theParent;
schemaContext = theSchemaContext;
instanceContext = theInstanceContext;
startParticle(theParent);
recurse(theParent, theSchemaContext, theInstanceContext);
endParticle(theParent);
}
COM: <s> initialise xsview from instance and schema </s>
|
funcom_train/34627240 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addNode(OutlineNode node) {
// get list for this type
List<OutlineNode> typeList = typeLists.get(node.getType());
// if no list for this type exists yet, create one
if (typeList == null) {
typeList = new ArrayList<OutlineNode>();
typeLists.put(node.getType(), typeList);
}
// add node to type list
typeList.add(node);
}
COM: <s> adds node to specific type list </s>
|
funcom_train/38308933 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isAttributeDefined(AttributeDefinition attrDef) {
String name = attrDef.getName();
String attrValue = attributes.getValue(name);
if (attrValue != null) {
return true;
}
if (customAttributes != null) {
if (customAttributes.containsKey(name)) {
return true;
}
}
return false;
}
COM: <s> checks whether the given attribute is defined or not </s>
|
funcom_train/19289906 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void open(File f) throws IOException {
if (quicktimeUnavailable)
throw new IOException("Quicktime not available to open resource.");
if (!f.exists()) {
close();
throw new IOException("The file \""+f+"\" does not exist.");
}
try {
openData(cnDataRef_QTFile.newInstance(cnQTFile.newInstance(f)));
} catch (Exception e) {
close();
throw new IOException("The file \""+f+"\" is not a recognized Quicktime file.");
}
}
COM: <s> opens a quicktime movie file to preview </s>
|
funcom_train/49469230 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public RiskConsequenceId createConsequence(Consequence csq) throws Exception, RaciException{
Db db = dbRW();
try{
_logger.info("RiskAssessment : createConsequence "+csq);
db.begin();
int peopleId = getCurrentUser();
DbPerso.checkUserCanCreateConsequence(db, peopleId, csq.getImpactId());
RiskConsequenceId csqId = DbConsequence.createConsequence(db, csq, peopleId);
db.commit();
return csqId;
} catch (Exception e) { store(e); throw e; } finally { db.safeClose(); }
}
COM: <s> create a consequence for an impact </s>
|
funcom_train/21017025 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setElementAlignment(double alignmentX, double alignmentY) {
requireTrue((0 <= alignmentX) && (alignmentX <= 1),
"@require (0 <= alignmentX <= 1)");
requireTrue((0 <= alignmentY) && (alignmentY <= 1),
"@require (0 <= alignmentY <= 1)");
elementAlignment.setLocation(alignmentX, alignmentY);
}
COM: <s> sets the element alignment </s>
|
funcom_train/12808741 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private CMapAwareDocumentFont getFont(PRIndirectReference ind) {
Integer n = Integer.valueOf(ind.getNumber());
CMapAwareDocumentFont font = cachedFonts.get(n);
if (font == null) {
font = new CMapAwareDocumentFont(ind);
cachedFonts.put(n, font);
}
return font;
}
COM: <s> gets the font pointed to by the indirect reference </s>
|
funcom_train/20317051 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected int getYear() {
Pattern patternYear = Pattern.compile("<a href=\"/Sections/Years/\\d{4}\">(\\d{4})</a>");
Matcher matcherYear = patternYear.matcher(html);
if (matcherYear.find()) {
return Integer.parseInt(matcherYear.group(1));
}
return 0;
}
COM: <s> returns the movies production year if the open document is a movie page </s>
|
funcom_train/47204922 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void binarize(int threshold){
for(int i=0; i<this.getHeight();i++){
for(int j=0; j<this.getWidth();j++){
int newpixel;
if (color2gray(this.getPixel(j,i)) <= threshold) {newpixel = 0;}
else {newpixel = 255;}
int newp = (255 << 24) + (newpixel << 16) + (newpixel << 8) + newpixel;
this.setPixel(j, i, newp);
}
}
this.updateImage();
}
COM: <s> binarize picture with threshold </s>
|
funcom_train/13934725 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private double log_n_choose_x(int a, int b) {
// choose b among a elements
double c0, c1;
int i;
if (b == 0) { return 0; } // only 1 way to choose 0 things
c0 = 0;
for (i= a-b+1; i<=a; i++) {
c0 = c0 + Math.log(i);
}
c1 = 0;
for (i=1; i<=b; i++) {
c1 = c1 + Math.log(i);
}
return(c0 - c1);
}
COM: <s> used by the hypergeom test </s>
|