__key__ stringlengths 16 21 | __url__ stringclasses 1
value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/50172042 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public QueryFeatureManager getQueryFeatureManager(User user) {
QueryFeatureManager userSpecificQueryFeatureManager
= new QueryFeatureManager(securityService,
user);
//get the master copy of the query feature tree
CannedQueryFeatureCategory rootCategory
= queryFeatureManager.getRootCategory();
CannedQueryFeatureCategory clonedRootCategory
= (CannedQueryFeatureCategory) rootCategory.clone();
userSpecificQueryFeatureManager.setRootCategory(clonedRootCategory);
return userSpecificQueryFeatureManager;
}
COM: <s> returns a query feature manager for a given user </s>
|
funcom_train/23332936 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Object getBackController() {
if (c != null) {
Object back = null;
try {
back = Class.forName(c.getCancelController().getName())
.newInstance();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
if (back != null) {
return back;
}
}
return null;
}
COM: <s> returns new instance of cancel controller from conversation </s>
|
funcom_train/43293414 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Color getColor(RGB rgb) {
// get the color from the table
Color color = (Color) m_ColorTable.get(rgb);
// color found?
if (color == null) {
// not found --> create
color = new Color(Display.getCurrent(), rgb);
m_ColorTable.put(rgb, color);
}
// return the color
return color;
}
COM: <s> provides the color for a specific rgb object </s>
|
funcom_train/2713221 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void doRun(InputParams in, OutputParams out) {
String menuId = (String) in.get("MENU_ID");
ProvidedTool tool = getContext().getConfiguration().getMenuConfig().
getProvidedTools().getProvidedToolById(menuId);
Function compile = new RunJavaApplication(tool);
compile.process(in, out);
}
COM: <s> runs the current java class </s>
|
funcom_train/8526464 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String removeAlias(final String alias) {
for (int i = aliases.size() - 1; i >= 0; i--) {
String[] entry = aliases.get(i);
if (alias.equals(entry[0])) {
aliases.remove(i);
return entry[1];
}
}
return null;
}
COM: <s> remove the alias for the table with the given alias </s>
|
funcom_train/37422315 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ToolType findToolTypeById(long pId) throws ClassNotFoundException, SQLException {
Vector tVect = findToolTypeByQuery("select * from tooltype where id_type = " + pId);
if (tVect.size() > 0)
return (ToolType) tVect.firstElement();
else
return null;
}
COM: <s> finds a tool type in the database using its id </s>
|
funcom_train/50140325 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getSubString(long pos, int length) throws SQLException {
char[] buf = new char[length];
try {
reader.reset();
reader.skip(pos);
reader.read(buf);
} catch (IOException ex) {
throw new SQLException(ex.toString());
}
return new String(buf);
}
COM: <s> get an substring </s>
|
funcom_train/10670956 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Result testGetPropertyChangeListeners01() {
PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(
"bean1");
propertyChangeSupport.addPropertyChangeListener(new SimpleListener());
assertEquals(propertyChangeSupport.getPropertyChangeListeners()[0]
.getClass(), SimpleListener.class);
return passed();
}
COM: <s> verify that get property change listeners method returns listener </s>
|
funcom_train/42461170 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getString(Property p) {
String str = null;
model.enterCriticalSection(Lock.READ);
try {
Statement s = resource.getProperty(p);
if (s != null && s.getObject().isLiteral())
str = s.getString();
} catch (Exception e) {
log.error("Failed to get members from foaf:Agent." + e);
} finally {
model.leaveCriticalSection();
}
return str;
}
COM: <s> get any string literal </s>
|
funcom_train/29040529 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void store(CompositeModel composite) throws Exception {
EtlModule module = new EtlModule();
module.parse(getFile("Tree2Tree.etl"));
composite.setName("Source");
module.getContext().getModelRepository().addModel(composite);
EmfModel merged = createModel("Target", "Merged.model", false, true);
module.getContext().getModelRepository().addModel(merged);
module.execute();
System.err.println(merged.store());
module.getContext().getModelRepository().dispose();
}
COM: <s> this method stores a composite model that consists of parts </s>
|
funcom_train/4748095 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testToString() {
System.out.println("toString");
SessionCookieKeys instance = SessionCookieKeys.LOGIN_USERNAME;
String expResult = "LOGIN_USERNAME";
String result = instance.toString();
System.out.println("result="+result);
assertEquals(expResult, result);
}
COM: <s> test of to string method of class session cookie keys </s>
|
funcom_train/34791322 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int findColumn(int targetx) {
//targetx -= insets.left;
int columnSize = elementSize.width + getSpacing();
if (targetx >= features*columnSize - getSpacing() + insets.left || targetx < insets.left) {
return -1;
}
// if(targetx < insets.left)
// return 0;
else
return ((targetx - insets.left)/columnSize);
}
COM: <s> finds column by specified x coordinate </s>
|
funcom_train/2309379 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void compile(String code) {
setStateCode(code);
Network memory = getPandora().memory().newMemory();
Vertex stateMachine = SelfCompiler.getCompiler().parseStateMachine(code, memory);
stateMachine.pinDescendants();
Vertex language = memory.createVertex(Language.class);
language.addRelationship(Primitive.STATE, stateMachine);
memory.save();
selectState(stateMachine.getId());
}
COM: <s> compile the self code into a new state machine </s>
|
funcom_train/14126520 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public IQuery getDocs(String docname, String prop, String order) throws XWikiException {
//if (prop==null) prop = "@fullName";
return xpath("/"+getXPathName(docname) + getPropertyXPath(prop) + getOrderXPath(order));
}
COM: <s> create query for docs </s>
|
funcom_train/3619201 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addCaptionPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_ImageData_caption_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_ImageData_caption_feature", "_UI_ImageData_type"),
EclipsesrsPackage.Literals.IMAGE_DATA__CAPTION,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the caption feature </s>
|
funcom_train/13997058 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Vector strToFields(String fn) throws XMLFormatException {
try {
//rid space before and at the end of the string
fn = fn.trim();
//fn = fn.replace('\n', ' ');
//StringBuffer sb = new StringBuffer(fn);
XMLTokenizer xtk = new XMLTokenizer(new StringReader(fn));
} catch (Exception e) {
System.err.println(e);
}
return null;
}
COM: <s> parse the given string and convert to a vector of fields </s>
|
funcom_train/10836160 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object get(String key) {
// handle properties as if they were map elements
// due to an inconsistency in the BeanUtils 1.5 through 1.7.0
// versions. Version 1.7.1 will fix this again, though ...
if (FIELD_PROPERTIES.equals(key)) {
return getProperties();
}
return super.get(key);
}
COM: <s> returns the value of the indexed property </s>
|
funcom_train/3100188 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int compare (Object variable1, Object variable2) {
Integer remainingDomainSize1 =
new Integer(valueDomains.getUnmarkedDomainSize((CycVariable) variable1));
Integer remainingDomainSize2 =
new Integer(valueDomains.getUnmarkedDomainSize((CycVariable) variable2));
// Ascending order.
return remainingDomainSize1.compareTo(remainingDomainSize2);
}
COM: <s> compares two variables by ascending size of their remaining domains </s>
|
funcom_train/20891699 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void parseXML(Element root) {
if (root != null) {
description = root.getChildText("description");
Element workersElement = root.getChild("workers");
if (workersElement != null) {
List<Element> workersList = workersElement.getChildren("worker");
for (Element currentWorkerElement : workersList) {
WorkerDefinition wd = new WorkerDefinition(currentWorkerElement);
LOGGER.debug("found worker " + wd.toString());
members.add(wd);
membersByLocation.put(wd.getLocation(), wd);
}
}
}
}
COM: <s> parses an xml element to restore the pool saved in this element </s>
|
funcom_train/4922935 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testNonDirectHttpFile() throws IOException {
this.createSourceHttpResourceFactory(null, null, false);
HttpResource resource = this.doCreateHttpResourceTest("index.html",
true);
HttpFile file = (HttpFile) resource;
ByteBuffer contents = file.getContents();
assertFalse("Should NOT be direct buffer", contents.isDirect());
assertTrue("Should however still be read-only", contents.isReadOnly());
assertHttpFileContents("Should be able to retrieve non-direct content",
"test", resource);
}
COM: <s> ensure using non direct </s>
|
funcom_train/28738934 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Collection getUserInfosByStatus(boolean active) throws SimsException {
String errMsg = clsName + ".getUserInfosByStatus(): ";
Collection infos = null;
try {
infos = session.getUserInfosByStatus(active);
}
catch (RemoteException rex) {
//Log msg for SimsWrappedException.
ExceptionUtil.logSimsWrappedInfo(errMsg, rex);
}
//Return info object.
return infos;
}
COM: <s> get user infos by active true activated users false pending users </s>
|
funcom_train/3535353 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void destroy() {
_stopped = true;
for (int i = 0; i < _allThreads.size(); i++) {
WorkerThread wt = (WorkerThread) _allThreads.get(i);
if (_debugging) {
System.err.println(Thread.currentThread().getName() + ".destroy: Killing " + wt.getName());
}
wt.kill();
}
}
COM: <s> interrupt all threads and clear the pool </s>
|
funcom_train/13398833 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void propertyChange(PropertyChangeEvent evt) {
if(evt.getPropertyName().equals("ActiveCharacterEvent")) {
ActiveCharacter ac =
(ActiveCharacter)evt.getNewValue();
SwingUtilities.invokeLater(new Invoker(ac));
} else {
firePropertyChange(evt.getPropertyName(),
evt.getOldValue(), evt.getNewValue());
}
}
COM: <s> active characters are handled here the rest is propagated </s>
|
funcom_train/27934763 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int length() {
int k = unit.length;
while (--k >= 0) {
if (unit[k] != 0) {
int highestBit = k * BITS_PER_UNIT;
long highestUnit = unit[k];
do {
highestUnit = highestUnit >>> 1;
highestBit++;
} while (highestUnit > 0);
return highestBit;
}
}
return 0;
}
COM: <s> returns the logical size of this code bit set code the index of </s>
|
funcom_train/20646546 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public interface Extended extends SimpleFileView {
/**
* return true if this file view accept to open this file
* (No test are done on the extension anymore). But you can
* use this piece of code to reproduce normal behaviour:
* <PRE><CODE>
* if (f.isDirectory()) {
* return true;
* }
* String extension = FileUtilities.getExtension(f);
* return SimpleFileBrowser.extensionMatches(this,extension);
* </CODE></PRE>
**/
public boolean accept(File f);
}
COM: <s> an extended interface of simple file view with some more methods </s>
|
funcom_train/50575468 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String savePrefsPane(Class st) {
try {
Method m = st.getMethod("setPrefsPane", null);
return (String) m.invoke(null, null);
} catch (InvocationTargetException e) {
return Tuneology.logException(e.getTargetException(), "setPrefsPane");
} catch (Exception e) {
String msg = "Caught exception in savePrefsPane: " + e;
return msg;
}
}
COM: <s> copies the config info from the gui into the program </s>
|
funcom_train/44870212 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private WCMDrawStringBean getWCMDrawStringBean() {
if (WCMDrawStringBean == null) {
WCMDrawStringBean = new WCMDrawStringBean();
WCMDrawStringBean.setString("f ' (#) = # \ng ' (#) = #");
WCMDrawStringBean.setValue2(getFSlope());
WCMDrawStringBean.setValue3(getXInput());
WCMDrawStringBean.setValue4(getGSlope());
WCMDrawStringBean.setValue1(getXInput());
}
return WCMDrawStringBean;
}
COM: <s> this method initializes wcmdraw string bean </s>
|
funcom_train/802873 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addPrecisionPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_DataType_precision_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_DataType_precision_feature", "_UI_DataType_type"),
MzdataPackage.Literals.DATA_TYPE__PRECISION,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the precision feature </s>
|
funcom_train/29950372 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean moveDown() {
int rows = m_model.getRowCount();
if ( m_currentRow < rows - 1 ) {
m_currentRow++;
if ( m_currentRow - m_firstRow == m_viewRows ) {
m_firstRow++;
}
show();
return true;
} else {
return false;
}
}
COM: <s> move current row down </s>
|
funcom_train/11014610 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public short getFormat(String format, boolean createIfNotFound) {
for (FormatRecord r : formats) {
if (r.getFormatString().equals(format)) {
return (short)r.getIndexCode();
}
}
if (createIfNotFound) {
return (short)createFormat(format);
}
return -1;
}
COM: <s> returns a format index that matches the passed in format </s>
|
funcom_train/40794540 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void destroyApp(boolean unconditional) {
try {
if (SMSservice.getMessageConnection() != null) {
SMSservice.getMessageConnection().setMessageListener(null);
SMSservice.getMessageConnection().close();
}
} catch (IOException ex) {
ex.printStackTrace();
}
}
COM: <s> called to signal the midlet to terminate </s>
|
funcom_train/21180602 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString() {
String S = "";
java.util.Iterator iter = topOrder();
while (iter.hasNext()) {
sandmark.util.graph.Node n = (sandmark.util.graph.Node) iter.next();
S += n.toString() + "\n";
}
return S;
}
COM: <s> print out the nodesof the graph in a topological order </s>
|
funcom_train/20350385 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void init() {
fileList = new ArrayList<File>();
nameList = new ArrayList<String>();
gen = null;
currentSize = 0;
latency = 0.00417; // 4.17 ms in seconds
avgSeekTime = 0.009; // 9 ms
maxTransferRate = 133; // in MB/sec
}
COM: <s> the initialization of the harddrive is done in this method </s>
|
funcom_train/20899887 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isSet(int xp, int yp, int zp) {
int x = xp + bounds.xmin;
int y = yp + bounds.ymin;
int z = zp + bounds.zmin;
if (xp < 0 || yp < 0 || zp < 0 || xp >= width || yp >= height
|| zp >= depth)
return false;
return volume.getVoxelUnchecked(x, y, z) == id;
}
COM: <s> used to evaluate if a given voxel is set or not </s>
|
funcom_train/24607573 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void _generateAGraduateCourse(int index) {
writer_.startSection(CS_C_GRADCOURSE, _getId(CS_C_GRADCOURSE, index));
writer_.addProperty(CS_P_NAME,
_getRelativeName(CS_C_GRADCOURSE, index), false);
writer_.endSection(CS_C_GRADCOURSE);
}
COM: <s> generates a graduate course instance </s>
|
funcom_train/30218041 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public InetAddress getInetAddress() {
if ( !isConnected() )
return null;
InetSocketAddress addr =
registry.getInetSocketAddress(requestAddress);
if ( addr == null ) { // returns the address 0.0.0.0
byte[] zeroaddr = {0,0,0,0};
InetAddress zeroinet = null;
try {
zeroinet = InetAddress.getByAddress(zeroaddr);
} catch (UnknownHostException e) { // if IP address is not 4 bytes
; // do nothing. should never happen
}
return zeroinet;
} else {
return addr.getAddress();
}
}
COM: <s> returns the inet address in the registry that corresponds to the </s>
|
funcom_train/26022297 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private StringBuffer combineLines(List<String> tokens, int start, int end) {
StringBuffer sb = new StringBuffer();
for (int k = start; k < end; k++) {
sb.append(tokens.get(k));
sb.append("\n");
}
sb.append(tokens.get(end));
return sb;
}
COM: <s> append tokens from start position until end inclusive </s>
|
funcom_train/50141527 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addRole(String uid, String role) throws NotFoundException {
Hashtable roles = (Hashtable) rolesTable.get(uid.toUpperCase());
if (roles == null) {
roles = new Hashtable();
rolesTable.put(uid.toUpperCase(), roles);
}
roles.put(role, role);
}
COM: <s> add a role to a user </s>
|
funcom_train/20303678 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void wObjStar() {
Iterator rs = listSubjects();
while (rs.hasNext()) {
Resource r = (Resource) rs.next();
increaseObjectCount(r);
// This forces us to not be anonymous unless
// we are never an object. See isGenuineAnon().
wObj(r, true);
}
closeAllResIterators();
}
COM: <s> all subjects get listed for top level use only </s>
|
funcom_train/35505071 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void initializeSingleToolbar(String toolbarSeq) {
Vector<String> vcToolPicks = new Vector<String>();
StringTokenizer stToolbars = new StringTokenizer(toolbarSeq
.toUpperCase(), "|");
while (stToolbars.hasMoreTokens()) {
String sKey = stToolbars.nextToken();
if (sKey.equals("*")) {
// ignore "next toolbar" symbols in single toolbar processing
} else {
vcToolPicks.add(sKey);
}
}
customizeToolBar(TOOLBAR_SINGLE, vcToolPicks, true);
}
COM: <s> convenience method for creating the single toolbar from a sequence string </s>
|
funcom_train/7284763 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void cancel(SelectionKey sk) {
sk.cancel();
SelectableChannel channel = sk.channel();
try {
channel.close();
} catch (IOException err) {
LOG.error("Channel.close()", err);
}
DaapConnection connection = (DaapConnection)sk.attachment();
if (connection != null) {
closeConnection(connection);
}
}
COM: <s> cancel selesction key close channel and free the attachment </s>
|
funcom_train/27842135 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void putAll(ResourceBundle inBundle) {
for (Enumeration i = inBundle.getKeys(); i.hasMoreElements();) {
String key = (String) i.nextElement();
Object value = inBundle.getObject(key);
properties.put(key, value);
}
}
COM: <s> put properties from the resource bundle </s>
|
funcom_train/47415214 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel getTimeOutPanel() {
if (TimeOutPanel == null) {
TimeOutLabel = new JLabel();
TimeOutLabel.setText("Impostazione del\n time-out(ms): ");
TimeOutPanel = new JPanel();
TimeOutPanel.setLayout(new GridBagLayout());
TimeOutPanel.add(TimeOutLabel, new GridBagConstraints());
TimeOutPanel.add(getTimeOut(), new GridBagConstraints());
}
return TimeOutPanel;
}
COM: <s> this method initializes time out panel </s>
|
funcom_train/31199980 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getSystemDisplayName(){
if(system==LOCAL || system==UTC) return "Coordinated Universal Time";
else if(system==TAI) return "International Atomic Time";
else if(system==UT1) return "Universal Time";
else if(system==TDT) return "Terrestial Dynamic Time";
else if(system==TDB) return "Barycentric Dynamic Time";
return "";
}
COM: <s> returns the complete english display name for the time system for instance </s>
|
funcom_train/15737688 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public File getOutputFile() {
if (outputFile == null) {
if (StringUtils.isEmpty(outputFileExtension)) {
outputFile = new File(getOutputDirectory(), outputFileName);
} else {
outputFile = new File(getOutputDirectory(), outputFileName + "." + outputFileExtension);
}
}
return outputFile;
}
COM: <s> convenient method to get linker output file </s>
|
funcom_train/40105001 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Chapter getChapter(String chapterPath) {
int slash = chapterPath.indexOf("/"); //$NON-NLS-1$
String chapterName = (slash == -1) ? chapterPath : chapterPath
.substring(0, slash);
for (Chapter chapter : children) {
if (chapter.getName().compareTo(chapterName) == 0) {
return (slash == -1) ? chapter : chapter.getChapter(chapterPath
.substring(slash + 1));
}
}
return null;
}
COM: <s> returns the chapter according to the chapter path </s>
|
funcom_train/457256 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getProjectForEmail( final String messageId ) throws OpsAuthenticationException, OpsProjectException {
log.debug( "getProjectForEmail()" );
try {
return OpsEmail.getProjectForEmail( messageId );
} catch ( final OpsProjectNotFoundException opnfe ) {
log.error( "IMAP Folder name is no project in LDAP!", opnfe );
throw new OpsProjectException( "IMAP Folder name is no project in LDAP!", opnfe );
}
}
COM: <s> returns a projectid for a given message id </s>
|
funcom_train/3361502 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void putAll(Map<? extends String, ? extends Object> toMerge) {
if (toMerge == null) {
throw new NullPointerException("toMerge map is null");
}
for (Map.Entry<? extends String, ? extends Object> entry : toMerge.entrySet()) {
String key = entry.getKey();
checkKey(key);
put(key, entry.getValue());
}
}
COM: <s> code put all code is implemented using code map </s>
|
funcom_train/2903511 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void showMenu(){
int x = getX() + pX;
int y = getY() + pY;
Dimension d = popup.getPreferredSize();
int w = (int)d.getWidth();
int h = (int)d.getHeight();
Point p = JXScreenManager.getPopupLocation(x, y, w, h, getWidth());
popup.setLocation((int)p.getX(), (int)p.getY());
popup.setVisible(true);
}
COM: <s> make popup menu visible on screen </s>
|
funcom_train/3273193 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void getPositionAtTime(Point3f timePosition, int ticksPassed){
// If the Ship is Moving at the specified time,
// then calculate the position that the Ship will
// reach at the end of the time specified.
// Otherwise, just use the ending point of the
// last Move Action
if(currentAction instanceof Move){
((Move) currentAction).getPositionAtTime(timePosition, ticksPassed);
}
else{
timePosition.set(orientation.latestKnownPosition());
}
}
COM: <s> get the postion of the ship at the specified </s>
|
funcom_train/51652507 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeAll () {
checkWidget ();
int count = getItemCount ();
if ((style & SWT.READ_ONLY) != 0) {
OS.DeleteMenuItems (menuHandle, (short)1, count);
OS.SetControl32BitValue (handle, 0);
} else {
if (count > 0) {
for (int i=count-1; i>=0; i--) {
OS.HIComboBoxRemoveItemAtIndex (handle, i);
}
}
}
}
COM: <s> removes all of the items from the receivers list and clear the </s>
|
funcom_train/9667304 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void copyFromLastWeekButtonActionPerformed(ActionEvent e) {
DateTime dt2 = dt.minus(Period.weeks(1));
YearMonthDay ymd = dt2.toYearMonthDay();
String lastMonday = ymd.toString();
rota.copyAllToNextWeek(lastMonday);
refreshTables();
}
COM: <s> calls the method that copies last weeks rota to this week </s>
|
funcom_train/30075648 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
dateFormat.setLenient(false);
binder.registerCustomEditor(java.util.Date.class, null, new CustomDateEditor(dateFormat, false));
}
COM: <s> method sets up a custom property editor for the applications date format </s>
|
funcom_train/42181169 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Float getLength() {
if (getValue() == null) {
return null;
} else if (this.preferences.getUnit() == UserPreferences.Unit.INCH) {
return UserPreferences.Unit.inchToCentimeter(((Number)getValue()).floatValue());
} else {
return ((Number)getValue()).floatValue();
}
}
COM: <s> returns the displayed value in centimeter </s>
|
funcom_train/38473012 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean setChildFocus(Composite control) {
Control[] children = control.getChildren();
for (int i = 0; i < children.length; i++) {
if (children[i].setFocus()) {
return true;
} else {
if (children[i] instanceof Composite && setChildFocus((Composite)children[i]))
return true;
}
}
return false;
}
COM: <s> method set child focus </s>
|
funcom_train/41164389 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void delete(CoParagraph2 entity) {
EntityManagerHelper.log("deleting CoParagraph2 instance", Level.INFO, null);
try {
entity = getEntityManager().getReference(CoParagraph2.class, entity.getParagraphId());
getEntityManager().remove(entity);
EntityManagerHelper.log("delete successful", Level.INFO, null);
} catch (RuntimeException re) {
EntityManagerHelper.log("delete failed", Level.SEVERE, re);
throw re;
}
}
COM: <s> delete a persistent co paragraph2 entity </s>
|
funcom_train/18750616 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean containsElement(Element elem) {
if (elem instanceof Node) {
return nodeSet().contains(elem);
} else if (elem instanceof RelationEdge) {
return nodeSet().containsAll(Arrays.asList(((RelationEdge) elem).ends()));
} else {
return edgeSet().contains(elem);
}
}
COM: <s> implements the method by distinguishing between nodes and edges and deferring the </s>
|
funcom_train/22046462 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int countPrimaryExpressions(Map<Integer, ReverseRExpression> uninterpretedExpressions) {
int r = 0;
ReverseRExpression currExpr;
for (Integer currKey : uninterpretedExpressions.keySet()) {
currExpr = uninterpretedExpressions.get(currKey);
if (ReverseRExpression.isPrimary(currExpr.getType())) {
r++;
}
}
return r;
}
COM: <s> method count primary expressions </s>
|
funcom_train/5341231 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int compareCount(TableLine a, TableLine b) {
int c1 = a.getLocationCount();
int c2 = b.getLocationCount();
if(a.getQuality() == QualityRenderer.MULTICAST_QUALITY)
c1 = Integer.MAX_VALUE;
if(b.getQuality() == QualityRenderer.MULTICAST_QUALITY)
c2 = Integer.MAX_VALUE;
return (c1 - c2) * _ascending;
}
COM: <s> compares the count between two rows </s>
|
funcom_train/32155216 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString() {
StringBuffer buf = new StringBuffer(" Domain : {");
int maxDisplay = 10;
int count = 0;
for (IntDomainIterator it = this.iterator() ; (it.hasNext() && count < maxDisplay) ;) {
int value = it.next();
count++;
if (count > 1) {
buf.append(", ");
}
buf.append(value);
}
if (this.size() > maxDisplay) {
buf.append("..., ");
buf.append(this.getSup());
}
buf.append("}");
return buf.toString();
}
COM: <s> returns a string representation of this domain </s>
|
funcom_train/16784806 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addNewDataTransferAnnotations(long dataTransferInternalID, List<Annotation> annotationList, Connection connection) throws SQLException, IngestException {
addAnnotations("exe_data_transfer_annotation", "transfer_id", dataTransferInternalID, annotationList, connection);
}
COM: <s> add new annotations for data transfer to db </s>
|
funcom_train/32778189 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void openTable(String s) {
if (tableOpen)
return; // table already opened
StringBuffer sb = new StringBuffer();
sb
.append("<DIV align=center><H3>" + s + "</H3></DIV>"
+ FileOutput.getEndOfLine());
sb.append("<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=3 ");
sb.append("WIDTH=\"100%\" >" + FileOutput.getEndOfLine());
out.write(sb.toString());
tableOpen = true;
rowOpen = false;
}
COM: <s> inserts the tags needed to build a html 3 </s>
|
funcom_train/10390080 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void push(String stackName, Object value) {
ArrayStack<Object> namedStack = stacksByName.get(stackName);
if (namedStack == null) {
namedStack = new ArrayStack<Object>();
stacksByName.put(stackName, namedStack);
}
namedStack.push(value);
}
COM: <s> pushes the given object onto the stack with the given name </s>
|
funcom_train/44154735 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String encrypt(String text) {
BigInteger[] biArr = padding(text);
StringBuffer cipher = new StringBuffer();
for (int i = 0; i < biArr.length; i++) {
BigInteger bi = biArr[i];
BigInteger c = bi.modPow(m_e, m_pubKey);
if (cipher.length() == 0) {
cipher.append(c.toString());
} else {
cipher.append(m_cipherDelimiter);
cipher.append(c.toString());
}
}
return cipher.toString();
}
COM: <s> encrypts a given text by using the public key of the cipher </s>
|
funcom_train/2801880 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void append(String pFieldName, Object pFieldData) throws IllegalArgumentException {
if (pFieldData instanceof IMessage) {
pFieldData = ((IMessage) pFieldData).getNativeMsg();
}
try {
mTibrvMsg.add(pFieldName, pFieldData);
} catch (TibrvException e) {
throw new IllegalArgumentException(RvUtils.convertTibrvException(e));
}
}
COM: <s> adds to this message a new field </s>
|
funcom_train/7277365 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean matches(String phrase) {
String canonical=phrase.toLowerCase(Locale.US);
for (int i=0; i<ban.size(); i++) {
String badWord = ban.get(i);
if (canonical.indexOf(badWord)!=-1)
return true;
}
return false;
}
COM: <s> returns true if phrase matches any of the entries in ban </s>
|
funcom_train/33969824 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isAdjacentTo(Position position) {
int differenceX = this.getX() - position.getX();
int differenceY = this.getY() - position.getY();
boolean horizontalAdjacency = (differenceX >= -1 && differenceX <= 1);
boolean verticalAdjacency = (differenceY >= -1 && differenceY <= 1);
return (horizontalAdjacency && verticalAdjacency && !this
.equals(position));
}
COM: <s> returns true if positions are inmediate neigbours can be reached in one </s>
|
funcom_train/6289578 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void showScreen(StartupModes startupMode) {
if (startupMode == StartupModes.IN_THE_SAME_THREAD) {
showScreen();
} else {
// start in the new thread
Thread t = new Thread() {
public void run() {
showScreen();
}
};
t.start();
}
}
COM: <s> shows screen of this user interface element </s>
|
funcom_train/28353914 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean initModel() {
try {
theModel = Scenario.newScenarioFor(controller.theDoc.theSeq);
}
catch (Exception ex) {
controller.dumpErr("can't create model for phase scaling");
return false;
}
theProbe = ProbeFactory.getParticleProbe("SCLMed", controller.theDoc.theSeq, tracker);
theModel.setSynchronizationMode(Scenario.SYNC_MODE_DESIGN);
//make sure that RF phase is calculated
theModel.setProbe(theProbe);
WInit = theProbe.getKineticEnergy();
return true;
}
COM: <s> initialize a model to run the entire scl with </s>
|
funcom_train/28125170 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int compareTo(Object o) {
TimeSpan ts = (TimeSpan) o;
int start = getStartDate().compareTo(ts.getStartDate());
if (start != 0) {
return start;
}
return getEndDate().compareTo(ts.getEndDate());
}
COM: <s> compares this time span to another one </s>
|
funcom_train/17945009 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Element locateElementInDocument(StyledDocument doc, String elementName) {
Element[] elements = doc.getRootElements();
for(int i = 0; i < elements.length; i++) {
if(elements[i].getName().equalsIgnoreCase(elementName)) {
return elements[i];
} else {
Element rtnElement = locateChildElementInDocument(elements[i], elementName);
if(rtnElement != null) {
return rtnElement;
}
}
}
return (Element)null;
}
COM: <s> method to locate a node element by name </s>
|
funcom_train/11403945 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public WebClient path(String path, Object... values) {
URI u = UriBuilder.fromUri(URI.create("http://tempuri")).path(path).buildFromEncoded(values);
getState().setTemplates(getTemplateParametersMap(new URITemplate(path), Arrays.asList(values)));
return path(u.getRawPath());
}
COM: <s> updates the current uri path with path segment which may contain template variables </s>
|
funcom_train/22429512 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getBtnURLDecode() {
if (btnURLDecode == null) {
btnURLDecode = new JButton();
btnURLDecode.setText("URL Decode");
btnURLDecode.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
txtEncode.setText("");
String result = getEncoder().getURLDecode(txtDecode.getText());
txtEncode.setText(result);
}
});
}
return btnURLDecode;
}
COM: <s> this method initializes btn urldecode </s>
|
funcom_train/13994744 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int hashCode() {
if (hashCode == 0) {
int tempCode = 15;
int multiplier = 19;
for (int i = 0; i < values.length; i++) {
tempCode *= multiplier;
tempCode += values[i].hashCode();
}
hashCode = tempCode;
}
return hashCode;
}
COM: <s> returns the hash code for this map key </s>
|
funcom_train/45257521 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void partClosed(IWorkbenchPart part) {
IWorkbenchPart activePart = part.getSite().getPage().getActivePart();
if (activePart != null) {
// We are going to get a part activated message so don't bother setting the
// action handler to null. This prevents enablement flash in the toolbar
return;
}
if (part == getActivePart()) {
setActionHandler(null);
}
super.partClosed(part);
}
COM: <s> a workbench part has been closed </s>
|
funcom_train/32831145 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetAllDifferences_notEqualsLeftNull() {
Difference result = reflectionComparator.getDifference(objectsNullValue, objectsA);
Difference difference = getInnerDifference("string2", result);
assertEquals(null, difference.getLeftValue());
assertEquals("test 2", difference.getRightValue());
}
COM: <s> test case for 2 objects with a left value null </s>
|
funcom_train/23348797 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean addCreditcard(){
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
session.beginTransaction();
Creditcard p = this.getNewProduct();
try{
session.save(p);
session.getTransaction().commit();
}catch(HibernateException e)
{
e.printStackTrace();
return false;
}
p.clear();
init();
return true;
}
COM: <s> listener para add creditcard button click action </s>
|
funcom_train/38288840 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean checkInEntity(final Shell shell, final Node node) {
if (DOMUtils.isInEntity(node)) {
MessageDialog
.openInformation(
shell,
Messages
.getString("ERROR"), //$NON-NLS-1$
Messages
.getString("CANNOT_MODIFY_ENTITY")); //$NON-NLS-1$
return true;
}
return false;
}
COM: <s> checks if given node is in entity </s>
|
funcom_train/19979747 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getBestOutput(double[] inputs) {
if(inputs.length != numInputNodes){
throw new IllegalStateException("Inputs: " + inputs.length + "\n" +
"Num Input Nodes: " + numInputNodes);
}
double[] distances = getDistanceVector(inputs);
int minIndex = 0;
for(int i = 1; i < numOutputNodes; i++){
if(distances[i] < distances[minIndex]){
minIndex = i;
}
}
return minIndex;
}
COM: <s> finds the lowest distance from </s>
|
funcom_train/9086707 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void delete(Roles entity) {
EntityManagerHelper.log("deleting Roles instance", Level.INFO, null);
try {
entity = getEntityManager().getReference(Roles.class,
entity.getId());
getEntityManager().remove(entity);
EntityManagerHelper.log("delete successful", Level.INFO, null);
} catch (RuntimeException re) {
EntityManagerHelper.log("delete failed", Level.SEVERE, re);
throw re;
}
}
COM: <s> delete a persistent roles entity </s>
|
funcom_train/42886675 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Bounds clone() {
try {
return new Bounds(factory, new LinkedHashMap<Relation, TupleSet>(lowers),
new LinkedHashMap<Relation, TupleSet>(uppers), intbounds.clone());
} catch (CloneNotSupportedException cnse) {
throw new InternalError(); // should not be reached
}
}
COM: <s> returns a deep copy of this bounds object </s>
|
funcom_train/933769 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void resolveInheritances() throws NoSuchDefinitionException {
// Walk through all definitions and resolve individual inheritance
Iterator i = definitions.values().iterator();
while (i.hasNext()) {
XmlDefinition definition = (XmlDefinition) i.next();
definition.resolveInheritance(this);
} // end loop
}
COM: <s> resolve extended instances </s>
|
funcom_train/45040595 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void submitCurrentTransaction() throws SubmissionException {
if (isActive()) {
Submitter submitter = null;
try {
submitter = AgentConfig.getInstance().getTransactionSubmitter();
}
catch (AgentConfigException e) {
throw new SubmissionException("Unable to submit transaction because of error loading agent config file [" + AgentConfig.XML_FILE_NAME + "]", e);
}
if (submitter != null) {
submitter.submitTransaction(getCurrentTransaction());
}
}
}
COM: <s> submits the current transaction to the configured code transaction </s>
|
funcom_train/46620869 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Button getCloseButton() {
if (iCloseButton == null) {
try {
iCloseButton = new Button();
iCloseButton.setName("CloseButton");
iCloseButton.setLabel("Close");
} catch (Throwable iExc) {
handleException(iExc);
}
}
return iCloseButton;
}
COM: <s> return the close button property value </s>
|
funcom_train/7670151 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object parseObject(String string) throws ParseException {
ParsePosition position = new ParsePosition(0);
Object result = parseObject(string, position);
if (position.getErrorIndex() != -1 || position.getIndex() == 0) {
throw new ParseException(null, position.getErrorIndex());
}
return result;
}
COM: <s> parses the specified string using the rules of this format </s>
|
funcom_train/29863029 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void fillPage(Composite page) {
page.setLayout(new GridLayout(2,false));
Composite topContainer = getToolkit().createComposite(page);
topContainer.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,false,2,1));
fillTopContainer(topContainer);
Composite content = getToolkit().createComposite(page);
content.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
fillContentContainer(content);
Composite rightContainer = getToolkit().createComposite(page);
rightContainer.setLayoutData(new GridData(SWT.RIGHT,SWT.TOP,false,true));
fillRightContainer(rightContainer);
}
COM: <s> fill the page container with the controls for the wizard page </s>
|
funcom_train/7803457 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private FixedGroup getNextFixedGroup(long time) {
long nextTime = -1L;
FixedGroup nfg = null;
Iterator ifg = fixedGroups.iterator();
while (ifg.hasNext()) {
FixedGroup fg = (FixedGroup) ifg.next();
long fgtime = fg.getFixedTime();
// if we havnt already past its latest start time count it
if (fgtime + fixedGroupPostStartLapseTime > time) {
if (fgtime > nextTime) {
nextTime = fgtime;
nfg = fg;
}
}
}
return nfg;
}
COM: <s> returns the time of the next executable fixed group after time </s>
|
funcom_train/37228020 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Message readDeleteMeetingMessage() throws IOException, XmlPullParserException {
// Create the message
DeleteMeetingMessage message = new DeleteMeetingMessage();
// Now read the MeetingId
message.setMeetingId(parser.getRequiredElementText(MSG_NS, "meeting-id"));
// Consume </message>
parser.nextEndTag(MSG_NS, "message");
return message;
}
COM: <s> reads a delete meeting message </s>
|
funcom_train/3365216 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void resetLayoutManager() {
if(orientation == JSplitPane.HORIZONTAL_SPLIT) {
layoutManager = new BasicHorizontalLayoutManager(0);
} else {
layoutManager = new BasicHorizontalLayoutManager(1);
}
splitPane.setLayout(layoutManager);
layoutManager.updateComponents();
splitPane.revalidate();
splitPane.repaint();
}
COM: <s> resets the layout manager based on orientation and messages it </s>
|
funcom_train/42281886 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void replaceColumn(Column oldColumn, Column newColumn) {
for (int i = 0; i < columns.length; i++) {
if(columns[i] == oldColumn) {
columns[i] = newColumn;
return;
}
}
throw new IllegalArgumentException(oldColumn.getName());
}
COM: <s> replace a column in this foreign key </s>
|
funcom_train/47105088 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JMenuItem getJMenuItemWeapon03() {
JMenuItem menuItem = new JMenuItem();
menuItem.setText(Weapon.W_03.getItemName());
menuItem.setEnabled(false);
menuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
setPlrReadiedWeapon(Weapon.W_03);
}
});
return menuItem;
}
COM: <s> creates the fourth choice for the weapon menu </s>
|
funcom_train/19035732 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private StoredPost getPostWatch(PID pid) {
if(pid != null) {
StoredPost temp;
for(int i = 0; i < this.postWatches.size(); i++) {
temp = (StoredPost)this.postWatches.elementAt(i);
if(temp.getPid().equals(pid)) {
return temp;
}
}
}
return null;
}
COM: <s> finds the specified stored post </s>
|
funcom_train/49752298 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getComandoOKDescarga() {
if (comandoOKDescarga == null) {//GEN-END:|58-getter|0|58-preInit
// write pre-init user code here
comandoOKDescarga = new Command("Ok", Command.OK, 0);//GEN-LINE:|58-getter|1|58-postInit
// write post-init user code here
}//GEN-BEGIN:|58-getter|2|
return comandoOKDescarga;
}
COM: <s> returns an initiliazed instance of comando okdescarga component </s>
|
funcom_train/41594769 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addAxisPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_StrucDocTd_axis_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_StrucDocTd_axis_feature", "_UI_StrucDocTd_type"),
V3Package.eINSTANCE.getStrucDocTd_Axis(),
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the axis feature </s>
|
funcom_train/3413017 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void mail() throws IOException {
checkAWTPermission();
checkExec();
checkActionSupport(Action.MAIL);
URI mailtoURI = null;
try{
mailtoURI = new URI("mailto:?");
peer.mail(mailtoURI);
} catch (URISyntaxException e){
// won't reach here.
}
}
COM: <s> launches the mail composing window of the user default mail </s>
|
funcom_train/3926625 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void replaceColorIndex( TokenPrinter tp, SpaceStructure ss, int startTokenOffset, int endTokenOffset ) {
for ( int i = 0; i < callCount; i++ ) {
replaceColors( tp, startTokenOffset, endTokenOffset, (i == 0 ), (i == (callCount-1)));
}
}
COM: <s> replace the color index values </s>
|
funcom_train/20333621 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString() {
return "HumiditySensor("
+ "devicestatus="+getDeviceStatus()
+ ", haslocation="+getHasLocation()
+ ", instancename="+getInstanceName()
+ ", sensorvalue="+getSensorValue()
+ ", timestamp="+getTimestamp()
+ ")";
}
COM: <s> get a string representation of this code humidity sensor code </s>
|
funcom_train/4758916 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testRandom() {
a = BigRational.RNRAND( 500 );
b = new BigRational( "" + a );
c = BigRational.RNDIF(b,a);
assertEquals("a-b = 0",c,BigRational.ZERO);
d = new BigRational( b.numerator(), b.denominator() );
assertEquals("sign(a-a) = 0", 0, b.compareTo(d) );
}
COM: <s> test random rationals </s>
|
funcom_train/21892383 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addGroundAtom(Object... arguments) {
int index = 0;
builder.clear();
for (Type type : predicate.getArgumentTypes()) {
builder.id(predicate.getColumnName(index)).constant(type.getNodType(), arguments[index++]);
}
builder.tupleForIds().relation(1);
interpreter.insert(relation, builder.getRelation());
}
COM: <s> adds a ground atom to this collection </s>
|
funcom_train/17094400 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean equals(Object other) {
boolean ret = false;
if (other instanceof Line) {
Line otherLine = (Line) other;
ret = (otherLine.getStart().isSameLocation(getStart()) &&
otherLine.getEnd().isSameLocation(getEnd()));
}
return ret;
}
COM: <s> returns true if the other object is a line and their start and </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.