__key__ stringlengths 16 21 | __url__ stringclasses 1 value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/8087533 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public MyHeapElement get() throws Exception {
if(m_heap[0].index==0)
throw new Exception("No elements present in the heap");
MyHeapElement r = m_heap[1];
m_heap[1] = m_heap[m_heap[0].index];
m_heap[0].index--;
downheap();
return r;
}
COM: <s> returns the first element and removes it from the heap </s>
|
funcom_train/26509232 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Iterator iterator() {
return new Iterator() {
protected int i=0;
public boolean hasNext() {return i<elements.length;}
public Object next() throws NoSuchElementException {
if (i<elements.length) {
return elements[i++];
} else {
throw new NoSuchElementException();
}
}
public void remove() {throw new UnsupportedOperationException();}
};
}
COM: <s> returns an code iterator code of the elements of this set </s>
|
funcom_train/41187614 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean addComponent(String component) {
if ((component != null) && (component.length() > 0)) {
try {
File f = new File(component);
if (f.exists()) {
File key = f.getCanonicalFile();
if (!_elements.contains(key)) {
_elements.add(key);
return true;
}
}
} catch (IOException e) {
}
}
return false;
}
COM: <s> implementation routine add component </s>
|
funcom_train/12160870 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected DefaultHistoryManager getManager(String key) {
QualifiedName qualifiedId =
new QualifiedName(QUALIFIER, SESSION_PROPERTY_PREFIX + key);
return new DefaultHistoryManager(qualifiedId) {
// we override this so that we can use the mock resource instead of
// the Eclipse resource
public IResource getResource() {
return mockResource;
}
};
}
COM: <s> gets a default history manager object which overrrides the get resource </s>
|
funcom_train/50757283 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void calculatePreferredSize() {
Track track;
if (race != null) track = race.getTrack(); else track = this.track;
if (track != null) {
setPreferredSize(new Dimension((int)((track.getWidth() + BORDERWIDTH*2) * zoom),
(int)((track.getHeight() + BORDERWIDTH*2)* zoom)));
revalidate();
}
}
COM: <s> calculates the preferred size </s>
|
funcom_train/18739296 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void removeNodeSet(DeltaTarget target, Collection<HostNode> nodeSet) {
if (target instanceof HostGraph) {
((HostGraph) target).removeNodeSetWithoutCheck(nodeSet);
} else {
// apparently the target wasn't an InternalGraph
// so we can't do efficient edge removal
for (HostNode node : nodeSet) {
target.removeNode(node);
}
}
}
COM: <s> removes a set of nodes from a delta target </s>
|
funcom_train/13671826 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSameCoonectionWithRemoteConnection() throws Exception {
int port = PORT + 6;
deleteBase(NAME);
// Creates a server
ODBServer server = openServer(port);
server.setAutomaticallyCreateDatabase(true);
server.startServer(true);
ODB odb = server.openClient(ODBTest.DIRECTORY + NAME);
odb.store(new Function("ff11"));
odb.close();
odb = openClient(getHOST(), port, NAME);
Objects<Function> objects = odb.getObjects(Function.class);
assertEquals(1, objects.size());
odb.close();
server.close();
}
COM: <s> tests same vm connection and and a remote connection </s>
|
funcom_train/24418691 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void showProgrammes() {
// this only save the state of the calculator
calc.close(this.getPreferences(Activity.MODE_PRIVATE).edit());
reInitializeCalculator = true;
//calc = null;
Utils.logD("Calculator closed and registers saved", _logging);
// close the calculator to store its state
Utils.logD("Opening program list", _logging);
//Intent intent = new Intent(this, Programmes.class);
//intent.notify();
startActivity(new Intent(this, Programmes.class));
}
COM: <s> show the program list </s>
|
funcom_train/39952612 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object construct(WireContext wireContext) {
ClassLoader classLoader = wireContext.getClassLoader();
try {
return ReflectUtil.loadClass(classLoader, text);
} catch (PvmException e) {
Throwable cause = e.getCause();
throw new WireException("couldn't load class '"+text+"': "+cause.getMessage(), cause);
}
}
COM: <s> loads the class from the class loader of the specified wire context </s>
|
funcom_train/37072106 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean equals(Object other) {
if (other instanceof Cons) {
Cons x = this;
Cons y = (Cons) other;
while (x != null && y != null) {
if (! (x.first.equals(y.first))) {
return false;
}
x = x.rest;
y = y.rest;
}
return (x == null && y == null);
} else {
return false;
}
}
COM: <s> tests to see if one cons is equal to another </s>
|
funcom_train/43539998 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Bundle getBundleForPluginID(String pluginID) {
TestCase.assertNotNull(pluginID);
Bundle bundle = Platform.getBundle(pluginID);
TestCase.assertNotNull("THE PLUGIN FOR ID <" + pluginID + "> COULD NOT BE FOUND", //$NON-NLS-1$ //$NON-NLS-2$
bundle);
return bundle;
}
COM: <s> get the bundle for a plugin id or fail the test </s>
|
funcom_train/37658286 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private InputSource tdfInputSource(InputStream is) throws Exception {
InputSource inputSource;
TemplateEngine templateEngine = ConfigurationManager.getInstance().getTemplateEngine();
if (templateEngine == null) {
inputSource = new InputSource(is);
} else {
StringWriter output = new StringWriter();
templateEngine.evaluate(new XmlStreamReader(is), output, System.getProperties());
inputSource = new InputSource(new StringReader(output.toString()));
}
return inputSource;
}
COM: <s> construct sax input source for tdf </s>
|
funcom_train/45622980 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addResponseFilesPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_CscType_responseFiles_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_CscType_responseFiles_feature", "_UI_CscType_type"),
MSBPackage.eINSTANCE.getCscType_ResponseFiles(),
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the response files feature </s>
|
funcom_train/20514401 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void save(Odontopediatrica entity) {
LogUtil.log("saving Odontopediatrica instance", Level.INFO, null);
try {
entityManager.persist(entity);
LogUtil.log("save successful", Level.INFO, null);
} catch (RuntimeException re) {
LogUtil.log("save failed", Level.SEVERE, re);
throw re;
}
}
COM: <s> perform an initial save of a previously unsaved odontopediatrica entity </s>
|
funcom_train/20478637 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void updateDist() {
for(int i=vector.size()-1; i > 0; i--) {
TourStep prevStep = (TourStep) vector.elementAt(i-1);
TourStep curStep = (TourStep) vector.elementAt(i);
curStep.setDist(prevStep);
}
TourStep firstStep = (TourStep) vector.elementAt(0);
firstStep.setDist(0.0);
}
COM: <s> updates the inter step distances regardless of which row was moved </s>
|
funcom_train/28425686 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double getDouble(String param) throws FtpException {
String val = prop.getProperty(prefix + param);
if(val == null) {
throw new FtpException("Not found : " + param);
}
try {
return Double.parseDouble(val);
}
catch(Exception ex) {
throw new FtpException("PropertiesConfiguration.getDouble()", ex);
}
}
COM: <s> get double if not found throws ftp exception </s>
|
funcom_train/43258340 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void saveValue(String name, String value){
try{
// Set the preference into the project preference store and make sure this object remembers it to (setValue call)
m_project.setPersistentProperty(new QualifiedName(m_pageID, name), value);
super.setValue(name,value);
}catch(CoreException e){
System.out.println("Cannot set persistent property, failure or doesn't exist");
}
}
COM: <s> stores the preference in the resource preference store persists across sessions </s>
|
funcom_train/37588170 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void _interactionIsOver() {
Utilities.invokeLater(new Runnable() {
public void run() {
_document.addToHistory(_toAddToHistory);
_document.setInProgress(false);
_document.insertPrompt();
_notifyInteractionEnded();
}
});
scrollToCaret();
}
COM: <s> performs the common behavior when an interaction ends </s>
|
funcom_train/27780294 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void store(DataOutputStream os) throws IOException {
os.writeInt(blocks.length);
os.writeInt(sets);
for (int i = 0; i < blocks.length; i++) {
if (blocks[i] != null) {
os.writeInt(i);
blocks[i].store(os);
}
}
os.writeInt(-1);
}
COM: <s> write this object to the given output stream </s>
|
funcom_train/8901497 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double falseNegativeRate(int negativeClass) {
double incorrect = 0, total = 0;
for (int i = 0; i < numClasses; i++) {
if (i == negativeClass) {
for (int j = 0; j < numClasses; j++) {
if (j != negativeClass) {
incorrect += confusionMatrix[i][j];
}
total += confusionMatrix[i][j];
}
}
}
if (total == 0) {
return 0;
}
return incorrect / total;
}
COM: <s> calculate the false negative rate with respect to a particular class </s>
|
funcom_train/42646254 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ViewerPreferences getViewerPreferences() {
if (!viewerPrefInited) {
viewerPrefInited = true;
Object o = library.getObject(entries, "ViewerPreferences");
if (o != null) {
viewerPref = new ViewerPreferences(library, (Hashtable) o);
viewerPref.init();
}
}
return viewerPref;
}
COM: <s> gets a dictionary of keys and corresponding viewer preferences </s>
|
funcom_train/16771792 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Query getQuery(int ctx) throws RemoteException {
//logger.entering(CLASS_NAME, "getQuery", new Object[] { ctx });
ScanContext scanCtx;
scanCtx = (ScanContext)ContextManager.getContext(ctx);
Query qry = scanCtx.getQuery();
//logger.exiting(CLASS_NAME, "getQuery", qry);
return qry;
}
COM: <s> get a lucene query without ldi extension syntax for example without </s>
|
funcom_train/3830119 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public GM_CurveSegment getCurveSegmentAt( int index ) throws GM_Exception {
if ( ( index < 0 ) || ( index > getNumberOfCurveSegments() - 1 ) ) {
throw new GM_Exception( "invalid index/position to get a segment!" );
}
return (GM_CurveSegment)segments.get( index );
}
COM: <s> returns the curve segment at the submitted index </s>
|
funcom_train/35094361 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String unescapeSQL(String input){
String output = "";
boolean escape = false;
try {
for (int i = 0; i < input.length(); ++i){
if (input.charAt(i)== '\\' && !escape) {
escape = true;
} else {
escape = false;
output += input.charAt(i);
}
}
} catch (Exception e) {}
return output;
}
COM: <s> unescapes strings from the db to their original form </s>
|
funcom_train/50428167 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void divide(BBNCPF cpt) {
for (Enumeration e = cpf.keys(); e.hasMoreElements(); ) {
Hashtable q = (Hashtable) e.nextElement();
BBNPDF pdf = (BBNPDF) cpf.get(q);
double p = cpt.get(q);
if (p > 0)
pdf.divide(new BBNConstant(p));
}
}
COM: <s> division with another cpt </s>
|
funcom_train/34858185 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testConcurrentAccess() {
System.out.println("testConcurrentAccess started");
Task task = new TaskInsertSequence("A", 500);
PooledWorker x = new PooledWorker("X", login, task);
PooledWorker y = new PooledWorker("Y", login, task);
x.start();
y.start();
try {
x.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
try {
y.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println("testConcurrentAccess finished");
}
COM: <s> just to make sure we can access the database with 2 workers concurrently </s>
|
funcom_train/20219023 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testDoEvaluate() throws Exception{
assertEvaluation(this,
"org.commontemplate.standard.operator.object.InstanceofOperatorHandlerTester",
Boolean.TRUE);
assertEvaluation(new Integer(2),
"org.commontemplate.standard.operator.object.InstanceofOperatorHandlerTester",
Boolean.FALSE);
assertEvaluation(new Integer(2),
"java.lang.Integer",
Boolean.TRUE);
// 父类是false
assertEvaluation(this,
"junit.framework.TestCase",
Boolean.FALSE);
}
COM: <s> 2 instanceof br </s>
|
funcom_train/33160303 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void initChart() throws JspException {
if (collection != null) {
DefaultPieDataset dataset = getDataSet();
chart = null;
if(threeD) {
chart = ChartFactory.createPieChart3D(
title,
dataset,
createLegend, // legend?
createTooltip, // tooltips?
createUrl // URLs?
);
} else {
chart = ChartFactory.createPieChart(
title,
dataset,
createLegend, // legend?
createTooltip, // tooltips?
createUrl // URLs?
);
}
setPlotAttribute();
}
}
COM: <s> overrides the init chart method of base chart tag </s>
|
funcom_train/22942625 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void generatePopulation() {
minCost = Double.POSITIVE_INFINITY;
maxCost = Double.NEGATIVE_INFINITY;
for (int i = 0; i < populationSize; i++) {
for (int j = 0; j < totalBits; j++)
genes[i][j] = (generator.nextDouble() < probabilityVector[j]);
evaluate(i);
}
}
COM: <s> generates new population from the probability vector </s>
|
funcom_train/41400135 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String removeJCRPrefix(String jcrPath) {
// sometimes client code is using the string with a source resolver
// as well, where it must provide the scheme prefix; so we offer it
// to work with both variants for simplicity of the client code
if (jcrPath.startsWith("jcr://")) {
jcrPath = jcrPath.substring("jcr://".length());
}
return jcrPath;
}
COM: <s> removes the code jcr code prefix if present </s>
|
funcom_train/32047191 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public PatientEntityData getValueObject() {
PatientEntityData lData = new PatientEntityData();
lData.setPerson_ID( getPerson_ID() );
lData.setMRN( getMRN() );
lData.setPhysician_ID( getPhysician_ID() );
lData.setReferring_Physician_ID( getReferring_Physician_ID() );
lData.setReferralSourcesID( getReferralSourcesID() );
return lData;
}
COM: <s> create and return a patient entity data object populated with the data from </s>
|
funcom_train/36107059 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getExitCommand() {
if (exitCommand == null) {//GEN-END:|103-getter|0|103-preInit
// write pre-init user code here
exitCommand = new Command("Esci", Command.EXIT, 0);//GEN-LINE:|103-getter|1|103-postInit
// write post-init user code here
}//GEN-BEGIN:|103-getter|2|
return exitCommand;
}
COM: <s> returns an initiliazed instance of exit command component </s>
|
funcom_train/12178760 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Element selectImgElement(Document dom) {
final ElementSelectingVisitor visitor = new ElementSelectingVisitor() {
// Javadoc inherited.
public void visit(Element element) {
if ("img".equals(element.getName()) && foundElement == null) {
this.foundElement = element;
}
}
};
final DOMWalker walker = new DOMWalker(visitor);
walker.walk(dom);
return visitor.foundElement;
}
COM: <s> selects the first lt img gt element from the specified document </s>
|
funcom_train/41157502 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void speak(String s) {
if (engineAvailable && speechEnabled) try {
recognizer.suspend();
synthesizer.speak(s, null);
synthesizer.waitEngineState(Synthesizer.QUEUE_EMPTY);
recognizer.commitChanges();
} catch (Exception e) {
e.printStackTrace();
} catch (EngineStateError e) {
e.printStackTrace();
}
}
COM: <s> transforms text to speech </s>
|
funcom_train/38864073 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void print() {
if(!found) {
System.out.println("\n*** Rstn frequency info not found");
return;
}
System.out.println("\n *** Rstn frequency info ***");
System.out.println("Station=" + stn+" Frequency: "+frequency);
System.out.println("Start Time: "+bgtm+" End Time: "+endtm);
}
COM: <s> print the rstn frequency information </s>
|
funcom_train/7617055 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Graphics getGraphics() {
toolkit.lockAWT();
try {
if (!isDisplayable()) {
return null;
}
Graphics g = behaviour.getGraphics(0, 0, w, h);
g.setColor(foreColor);
g.setFont(font);
return g;
} finally {
toolkit.unlockAWT();
}
}
COM: <s> gets the graphics of the component or null if this component is not </s>
|
funcom_train/13753210 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JMenu getJMenuFile() {
if (jMenuFile == null) {
jMenuFile = new JMenu();
jMenuFile.setText("File");
jMenuFile.add(getJMenuItemNew());
jMenuFile.add(getJMenuItemOpen());
jMenuFile.add(getJMenuItemClose());
jMenuFile.add(getJMenuItemSave());
jMenuFile.add(getJMenuItemExit());
}
return jMenuFile;
}
COM: <s> this method initializes j menu file </s>
|
funcom_train/18502199 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void processDOMTree(Document document) {
NodeList nodeList;
Node node;
node = document.getChildNodes().item(0); // <LocalSimilarities>
nodeList = node.getChildNodes();
for (int i = 0; i < nodeList.getLength(); i++) {
// Read <LocalSim>.
node = nodeList.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE)
processDOMLocalSim(node);
}
}
COM: <s> process a dom tree and adds the similarity functions </s>
|
funcom_train/10283599 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setPlaylistDelay(TagContent delay) throws TagFormatException {
// check format
if (delay.getTextContent() == null
|| !checkNumeric(delay.getTextContent())) {
throw new TagFormatException();
}
(new TextFrameEncoding(id3v2, "TDLY", delay, use_compression)).write();
}
COM: <s> set playlist delay read from text content </s>
|
funcom_train/3493064 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double length() {
// Stores running sum of squares
double sum = 0;
Iterator mapEntries = iterator();
while (mapEntries.hasNext()) {
Map.Entry entry = (Map.Entry)mapEntries.next();
// An entry in the HashMap maps a token to a Weight
double weight = ((Weight)entry.getValue()).getValue();
sum += weight * weight;
}
return Math.sqrt(sum);
}
COM: <s> compute euclidian length sqrt of sum of squares of vector </s>
|
funcom_train/31125453 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void paintTarget(Graphics2D g2d) {
Waypoint target = model.getTarget();
if (target == null) return;
g2d.setColor(colors[TARGET_COLOR_INDEX]);
Ellipse2D c = new Ellipse2D.Float(getX((float) (target.getX() - TARGET_SIZE/2)), getY((float) ((target.getY() + TARGET_SIZE/2))), getDistance(TARGET_SIZE), getDistance(TARGET_SIZE));
g2d.fill(c);
}
COM: <s> paint the target </s>
|
funcom_train/17206634 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isReachable(ObjectReference object) {
if (Plan.SCAN_BOOT_IMAGE && this == Plan.vmSpace)
return true; // ignore boot image "reachabilty" if we're not tracing it
else
return (VM.objectModel.readAvailableBitsWord(object).and(GC_MARK_BIT_MASK).EQ(markState));
}
COM: <s> returns if the object in question is currently thought to be reachable </s>
|
funcom_train/14274881 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setVFSVolumeLabel(VolumeReference volRef, String newLabel) throws ConduitHandlerException, NotConnectedException {
try {
jHotSync.setVFSVolumeLabel(volRef, newLabel);
} catch (DLPFunctionCallException e) {
throw new ConduitHandlerException(e.toString(), e);
}
} // end-method
COM: <s> sets the volume label for the specified vfs volume </s>
|
funcom_train/5472450 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public AbstractModel constructModel() throws IOException {
String[] outcomeLabels = getOutcomes();
int[][] outcomePatterns = getOutcomePatterns();
String[] predLabels = getPredicates();
Context[] params = getParameters(outcomePatterns);
return new PerceptronModel(params,
predLabels,
outcomeLabels);
}
COM: <s> retrieve a model from disk </s>
|
funcom_train/49026728 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JRadioButton getRidottaRB() {
if (ridottaRB == null) {
ridottaRB = new JRadioButton();
ridottaRB.setText("Vista ridotta");
ridottaRB.setFont(new Font("Dialog", Font.BOLD, 12));
ridottaRB.setSelected(true);
ridottaRB.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent e) {
aggiornaVista();
}
});
}
return ridottaRB;
}
COM: <s> this method initializes ridotta rb </s>
|
funcom_train/31309304 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Vector getPreferencesNames(String componentName) {
PropertyDescriptor[] pd = getPropertyDescriptors(componentName);
Vector names = new Vector();
for(int i = 0; i<pd.length; i++) {
names.addElement(pd[i].getShortDescription());
isSelectedPreference(componentName, pd[i].getShortDescription());
}
return names;
}
COM: <s> returns all preferencenames for one component with the specific name </s>
|
funcom_train/4953913 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getFnTrend(long trendInterval) {
TestSuite matchingTs = getTrendTestRun(trendInterval);
if (null != matchingTs) {
TestSuite tsAtEnd = spread.get(highestRunIdx);
if (null != tsAtEnd) {
int diff = spread.get(highestRunIdx).getNoNonPassing()
- matchingTs.getNoNonPassing();
String ret = Integer.toString(diff);
if (0 < diff) {
ret = "+" + ret;
}
return ret;
}
}
return "NA";
}
COM: <s> gets the test case fail difference between two test runs indicated by the </s>
|
funcom_train/43098340 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removed(MElementEvent e) {
if (e.getAddedValue() != null
|| e.getRemovedValue() != null
|| (e.getNewValue() != null
&& !e.getNewValue().equals(e.getOldValue()))) {
//firePropertyChanged("modelElementRemoved", e.getRemovedValue());
;
}
}
COM: <s> this is called whenever a model element is removed from the repository </s>
|
funcom_train/25805097 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public IAcmeComponent findComponentByPort(IAcmePort port) {
if (port == null)
throw new IllegalArgumentException("port is null");
IAcmeComponent parent = (IAcmeComponent) port.getParent(); // in acme,
// the
// parent of
// port is
// connector
return parent; // maybe throw ClassCastException, but it's not my
// responsibility
}
COM: <s> get the acme component which the given acme port is attached </s>
|
funcom_train/7733955 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getActions() {
StringBuffer sb = new StringBuffer();
appendAction(sb, READ_FLAG, READ);
appendAction(sb, RESET_FLAG, RESET);
appendAction(sb, PUBLISH_FLAG, PUBLISH);
appendAction(sb, STARTJOB_FLAG, STARTJOB);
appendAction(sb, SWITCHEVENTS_FLAG, SWITCHEVENTS);
return sb.toString();
}
COM: <s> get the action string associated with this permission </s>
|
funcom_train/29919303 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void init(Integer port) {
try {
logger.debug("Initializing server ...");
serverSocket = new ServerSocket(port.intValue());
serverSocket.setSoTimeout(0);
} catch (IOException e) {
logger.debug("Error initializing server:" + e.getMessage());
}
}
COM: <s> initialize the server </s>
|
funcom_train/4515056 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int showConfirmDialog() {
JPanel calPanel = new JPanel();
FlowLayout layout = new FlowLayout();
layout.setAlignment(FlowLayout.LEFT);
layout.setHgap(0);
layout.setVgap(0);
calPanel.setLayout(layout);
calPanel.add(_calendarBox);
Object[] msg = { _message, calPanel };
int result = JOptionPane.showConfirmDialog(_parentComponent, msg, _title, _optionType, _messageType);
return result;
}
COM: <s> creates the dialog and returns the result </s>
|
funcom_train/5395851 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testReadUnsignedByte() throws Exception {
System.out.println("readUnsignedByte");
BlockDataInputStream instance = null;
int expResult = 0;
int result = instance.readUnsignedByte();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
COM: <s> test of read unsigned byte method of class org </s>
|
funcom_train/42130932 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setValue(final String name, final Object value) {
try {
int index = metaData.getAttributeIndex(name);
setValue(index, value);
} catch (NullPointerException e) {
LOG.warn("Attribute " + metaData.getName() + "." + name
+ " does not exist");
}
}
COM: <s> set the value of the attribute with the specified name </s>
|
funcom_train/21868719 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public MessageEndpointDescriptor getMessageEndpointInfo(Object managedBean, String beanKey) {
int index=0;
if( (index=beanKey.indexOf(":"))!=-1 ) {
String destinationType=beanKey.substring(0,index);
String destinationName=beanKey.substring(index+1);
MessageEndpointDescriptor descriptor=new MessageEndpointDescriptor();
descriptor.setDestinationName(destinationName);
descriptor.setDestinationType(destinationType);
return descriptor;
}
return null;
}
COM: <s> this method returns the informations of the message listener </s>
|
funcom_train/8373537 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void terminateFault(int faultType) {
// switch (faultType) {
// case FAULT_TYPE_CHANGE:
// this.dispenseController.allowSelection(false);
// this.coinReceiver.storeCash();
// break;
// case FAULT_TYPE_STORE_COIN:
// this.dispenseController.allowSelection(false);
// break;
// case FAULT_TYPE_DISPENSE:
// this.dispenseController.allowSelection(false);
// this.coinReceiver.refundCash();
// break;
// }
strategy = TerminateFaultStrategyFactory.create(faultType);
strategy.terminateFault(this);
}
COM: <s> if the transaction controller is informed that a fault was discovered </s>
|
funcom_train/49410422 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getXML() throws LANLDIDLException, DIDLSerializationException {
DIDLType didl = create();
ByteArrayOutputStream stream = new ByteArrayOutputStream();
DIDLSerializerType serializer = env.getDIDLSerializer();
serializer.setProperty("xsi:schemaLocation", didlSchema);
DII.DII_SCHEMA_LOCATION = diiSchema;
serializer.write(stream, didl);
return stream.toString();
}
COM: <s> gets an xml serialized representation of current adore didl </s>
|
funcom_train/22742136 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void showShortCuts() {
int[] actions = Store.getStore().getActions();
String[] menu = new String[12];
for (int i = 0; i < menu.length; i++) {
menu[i] = KEY_CHARS[i] + " : " + MENU_SHORTCUTS[actions[i]];
}
list.setList(menu, null, "Shortcuts");
}
COM: <s> show the shortcut configuration menu </s>
|
funcom_train/1824960 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String formatScaleLossily(double x) {
if (1 <= x && x <= 1E6) {
return new DecimalFormat("#").format(x);
}
if (1E-6 <= x && x <= 1) {
return new DecimalFormat("0.000000").format(x);
}
return new DecimalFormat("0.#E0").format(x);
}
COM: <s> nicer formatting but the expense of possibly losing precision </s>
|
funcom_train/17852753 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createGui(boolean icon, boolean name) {
putValue(Action.SHORT_DESCRIPTION, mLocalizer.msg("showList", "Show List"));
if (name) {
putValue(Action.NAME, mLocalizer.msg("showList", "Show List"));
}
if (icon) {
putValue(Action.SMALL_ICON, TVBrowserIcons.search(TVBrowserIcons.SIZE_SMALL));
}
}
COM: <s> creates the gui </s>
|
funcom_train/16218141 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Vector2D normalize(Vector2D target) {
if (target == null) {
target = new Vector2D();
}
double m = length();
if (m > 0) {
target.set(this.x / m, this.y / m);
} else {
target.set(this.x, this.y);
}
return target;
}
COM: <s> normalize this vector storing the result in another vector </s>
|
funcom_train/20321810 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getOkCommand1() {
if (okCommand1 == null) {//GEN-END:|60-getter|0|60-preInit
// write pre-init user code here
okCommand1 = new Command("Ok", Command.OK, 0);//GEN-LINE:|60-getter|1|60-postInit
// write post-init user code here
}//GEN-BEGIN:|60-getter|2|
return okCommand1;
}
COM: <s> returns an initiliazed instance of ok command1 component </s>
|
funcom_train/50067831 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void visitConditional(Conditional tree) {
Tree cond = tree.cond = translate(tree.cond);
if (cond.type.isTrue()) {
result = convert(translate(tree.truepart), tree.type);
} else if (cond.type.isFalse()) {
result = convert(translate(tree.falsepart), tree.type);
} else {
tree.truepart = translate(tree.truepart);
tree.falsepart = translate(tree.falsepart);
result = tree;
}
}
COM: <s> visitor method for conditional expressions </s>
|
funcom_train/1653443 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSimpleFieldSetPutAndGet_NoMultiLevel(){
String[][] methodPairsArray = {
{"A","a"},{"B","b"},{"C","c"},{"D","d"},{"E","e"},{"F","f"} };
assertTrue(checkPutAndGetPairs(methodPairsArray));
}
COM: <s> tests put and get methods </s>
|
funcom_train/48045261 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public PeriodField plus(PeriodField period) {
PeriodFields.checkNotNull(period, "PeriodField must not be null");
if (period.getUnit().equals(unit) == false) {
throw new IllegalArgumentException("Cannot add '" + period + "' to '" + this + "' as the units differ");
}
return plus(period.getAmount());
}
COM: <s> returns a copy of this period with the specified period added </s>
|
funcom_train/40729901 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setSecurityPrincipalPattern(String securityPrincipalPattern) {
if (LOGGER.isLoggable(Level.CONFIG))
LOGGER.config("SECURITY PRINCIPAL PATTERN: " + securityPrincipalPattern);
// Test the format string.
MessageFormat.format(securityPrincipalPattern, new Object[] { "foo" });
this.securityPrincipalPattern = securityPrincipalPattern;
}
COM: <s> the ldap security principal string for </s>
|
funcom_train/1458565 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String getLilypondOctaveString() {
// In lilypond, octave 3 is treated as the central octave with no
// special mark.
int adjustedOct = this.octave - 3;
return createCharCopyString(adjustedOct, LILYPOND_NEGATIVE_OCTAVE_CHAR, LILYPOND_POSITIVE_OCTAVE_CHAR);
}
COM: <s> gets a string representing the octave in lilypond notation </s>
|
funcom_train/51146083 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addNode( String path, String name ) {
XModel model = (XModel)( path.length() > 0 ? rootModel.get( path ) : rootModel );
XModel newNode = (XModel)model.append( name );
newNode.setTagName( "data" );
currentProject.setModified( true );
}
COM: <s> add a new node to the model </s>
|
funcom_train/35176563 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void deletePerson(Person p) throws Exception {
try {
Session s = HibernateUtil.beginTransaction();
s.delete(p);
HibernateUtil.commitTransaction();
} catch (Exception e) {
log.log(Level.SEVERE, "The DAO could not delete the Contact", e);
HibernateUtil.rollbackTransaction();
throw new DataNotFound("The DAO could not delete the Contact", e);
}
}
COM: <s> deletes a contact person </s>
|
funcom_train/28116529 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void checkEmpty(MapMessage message) throws Exception {
Enumeration enum = message.getMapNames();
int count = 0;
while (enum.hasMoreElements()) {
count++;
}
if (count != 0) {
fail("Expected getMapNames to return no elements for an empty "
+ "MapMessage, but returned=" + count + " names");
}
}
COM: <s> verifies that a get map names returns an empty enumeration for an </s>
|
funcom_train/496679 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int updateTaskResults(long taskId, String results, boolean isFinal, boolean secondSubmition) {
if (secondSubmition) return -1;
SAXParserFactory factory = SAXParserFactory.newInstance();
Connection cn=null;
try {
SAXParser saxParser = factory.newSAXParser();
cn = createDbConnection();
saxParser.parse( new InputSource(new StringReader(results)), new ResultsManager(cn));
return 0;
} catch (Exception e) {
log.error("Error while parsing xml", e);
return -1;
}
finally {
closeConnection(cn);
}
}
COM: <s> processes task results inserts them into datase </s>
|
funcom_train/33256092 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void setScores() {
int[] counted = space.counted;
score = 0;
realScore = 0;
for (int i=0; i<counted.length; i++) {
switch (counted[i]) {
case FillerModel.MINE:
score++;
realScore++;
break;
case FillerModel.REACHABLE:
realScore++;
break;
default:
break;
}
}
}
COM: <s> figure out the score given the current counting in space </s>
|
funcom_train/26481118 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void paintNoCache(Graphics2D g, int width, int height, boolean highQuality) {
if (highQuality) {
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
}
doPaint(g, width, height);
}
COM: <s> paint without caching the resulting image </s>
|
funcom_train/4867198 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Item getPreviousItem() {
this.currentItem--;
if ( this.currentItem < 0 ) {
this.currentItem = this.inventory.size() - 1;
}
Item nextItem = null;
if ( ! this.inventory.isEmpty() ) {
if ( ! this.inventory.get(this.currentItem).items.isEmpty() ) {
nextItem = this.inventory.get(this.currentItem).items.get(0);
}
}
return nextItem;
}
COM: <s> get the previous </s>
|
funcom_train/43580321 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getDessertButton() {
if (dessertButton == null) {
dessertButton = new JButton();
dessertButton.setText("Apply");
dessertButton.setSize(new Dimension(80, 20));
dessertButton.setLocation(new Point(356, 333));
dessertButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
setskin(5);
SkinContainer.setLookAndFeel(getskin());
f.repaint();
}
});
}
return dessertButton;
}
COM: <s> this method initializes dessert button </s>
|
funcom_train/7300540 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public CellConstraints getConstraints(Component component) {
if (component == null)
throw new NullPointerException("The component must not be null.");
CellConstraints constraints = (CellConstraints) constraintMap.get(component);
if (constraints == null)
throw new NullPointerException("The component has not been added to the container.");
return (CellConstraints) constraints.clone();
}
COM: <s> looks up and returns the constraints for the specified component </s>
|
funcom_train/12899507 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void selectionChanged(ISelection selection) {
boolean enable = false;
IStructuredSelection selected = (IStructuredSelection) getSelection();
if (!selected.isEmpty()) {
IDescriptorPropertySheetEntry entry = (IDescriptorPropertySheetEntry) selected.getFirstElement();
// Can't have nulls if the editor is not active or if the descriptor says no nulls.
enable = !entry.areNullsInvalid();
}
setEnabled(enable);
}
COM: <s> call when selection has been changed </s>
|
funcom_train/27863439 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void orderFrameBufferUpdate(int window, boolean isroot, byte[] img,int x, int y, int w, int h,int encoding) {
send(new FBUMsg(window, isroot, img, x, y, w, h, encoding));
}
COM: <s> sends a frame buffer update to the zvtm client </s>
|
funcom_train/22598722 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getJButton2() {
if (jButton2 == null) {
jButton2 = new JButton();
jButton2.setText("step");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
((ISimulation)getNetwork()).update(sleepTime);
System.out.println("StepChange");
getBrowser().onNetworkChange();
}
});
}
return jButton2;
}
COM: <s> this method initializes j button2 </s>
|
funcom_train/39108789 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public InputSource resolveEntity (String publicId, String systemId) {
InputSource returnValue = null;
if (LMLDocumentHandler.XMLDEBUG) {
LusidUtils.writeLogMessage("Resolve entity: "+
" publicId=\"" + publicId + '"' +
" systemId=\"" + systemId + '"');
}
returnValue = new InputSource(systemId);
return returnValue;
}
COM: <s> display requests for entity resolution </s>
|
funcom_train/12930313 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected CButton createButtonAction(String action, KeyStroke accelerator) {
AppsAction act = new AppsAction(action, accelerator, false);
act.setDelegate(this);
CButton button = (CButton)act.getButton();
button.setPreferredSize(new Dimension(WIDTH, HEIGHT));
button.setMinimumSize(getPreferredSize());
button.setMaximumSize(getPreferredSize());
button.setFocusable(false);
return button;
} // getButtonAction
COM: <s> create action button </s>
|
funcom_train/42451108 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void write() throws IllegalArgumentException, MalformedURLException, IOException, SchemaException{
analyzeAdj();
MakeAdjPrime();
for(int i=0; i<used.size(); i++){
String filename = prefix+used.elementAt(i);
ShapefileEdgeWriter sfew = new ShapefileEdgeWriter(filename, X, Y, adjPrime.elementAt(i));
sfew.write();
}
}
COM: <s> writes the shapefiles </s>
|
funcom_train/31301722 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Date moveForwardFrom(Date startPoint) {
Calendar c = Calendar.getInstance();
c.setTime(startPoint);
if (afterStartHour(c) && beforeEndHour(c)) {
return startPoint;
}
// Need to move it
c.set(Calendar.MINUTE, _startTime.getMinute());
return c.getTime();
}
COM: <s> move this time forward so that it is within the </s>
|
funcom_train/795286 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getJButton3() {
if (jButton3 == null) {
jButton3 = new JButton();
jButton3.setText("Resetta");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
jShowFore.setBackground( null );
resetFore = true;
}
});
}
return jButton3;
}
COM: <s> this method initializes j button3 </s>
|
funcom_train/46190191 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSecurityRolesForBlogData() {
request.setParameter("type", FileMetaData.BLOG_DATA);
String roles[] = action.getRoles(request);
assertEquals(2, roles.length);
assertEquals(Constants.BLOG_ADMIN_ROLE, roles[0]);
assertEquals(Constants.BLOG_OWNER_ROLE, roles[1]);
}
COM: <s> tests that only blog owners can manage blog data </s>
|
funcom_train/21610789 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testUnificationWithEmptyList() {
// Data.
JsonArray jsonArray = new ListValue();
// Model.
JsonArrayModel jsonArrayModel = new JsonArrayModel();
// Unification.
UnificationResult unificationResult = unifier.unify(jsonArrayModel, new JsonValue(jsonArray) );
System.out.println(unificationResult);
assertFalse("Unification failed.", unificationResult.isFailed());
}
COM: <s> tests empty list unification </s>
|
funcom_train/50846845 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetTime() throws Exception {
testGetXXX("getTime");
ResultSet rs = this.newFOROJdbcResultSet();
rs.next();
rs.close();
try {
rs.getTime(1);
fail("Allowed getTime after close()");
} catch (SQLException ex) {
assertEquals(
"error code",
ex.getErrorCode(),
-ErrorCode.X_24501);
}
}
COM: <s> test of get time method of interface java </s>
|
funcom_train/17734553 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected int cellWidth(int numDataSets, FontMetrics fm) {
int maxStringWidth = 0;
for (int i = 0; i < numDataSets; i++) {
int wid = fm.stringWidth(datasets[i].setName);
if (wid > maxStringWidth)
maxStringWidth = wid;
}
return maxStringWidth
+ (int) ((double) globals.maxX * (iconWidth + iconGap * 2));
}
COM: <s> internal method to calculate one dataset entry size </s>
|
funcom_train/36247993 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected AmazonEC2 getEc2Client() {
String clusterEndpoint = clusterConfiguration.getEc2RegionEndpoint();
if (clusterEndpoint != null && clusterEndpoint.length() > 0) {
return clientFactory.getAwsClientByEndpoint(clusterEndpoint);
}
// We should always have a region/endpoint configured in the cluster,
// but just in case we don't, we'll still return something.
return clientFactory.getAwsClient();
}
COM: <s> returns the amazon ec2 client to use when working with this cluster </s>
|
funcom_train/20846692 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean equals(AbstractService service2) {
boolean isEqual = false;
AbstractService service1 = this;
if (service1 != null && service2 != null && service1.buildUniqueName().equals(service2.buildUniqueName()) && service1.getPortTypes().equals(service2.getPortTypes())) {
isEqual = true;
}
return isEqual;
}
COM: <s> this method compares two abstract services if they are equal or not </s>
|
funcom_train/47708315 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean enquire(final String title, final String message) {
Runnable popup = new Runnable () {
public void run () {
MessageBox box = new MessageBox(shell, SWT.ICON_WARNING | SWT.YES
| SWT.NO);
box.setText(title);
box.setMessage(message);
if (box.open() == SWT.YES) {
answer = true;
} else {
answer = false;
}
}};
display.syncExec (popup);
return answer;
}
COM: <s> ask a question by popping up a yes no dialog </s>
|
funcom_train/33745166 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void add(float x, float y) {
// Form the Point that we will insert into our main data backing
Point2D.Float p = new Point2D.Float(x,y);
// Add the x and y to their independent data sets for hawt statistics action
mXData.add(x);
mYData.add(y);
// Decide if we should sort it or not. It is a petty decision, but a decision nonetheless.
if(!mSort) {
mData.add(p);
}
else {
insertionSort(p);
}
// Do math!!
calculateStatistics();
}
COM: <s> add a value pair to this data set </s>
|
funcom_train/3475014 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addComponent (Component component, ComponentPropertiesRecordable properties) {
boolean isAlreadyContained = componentToProperties.containsKey (component);
componentToProperties.put (component, (ComponentPropertiesRecordable) properties.clone ());
if (! isAlreadyContained) {
component.addPropertyChangeListener (this);
component.addComponentListener (this);
}
}
COM: <s> adds a component with a given enabled state to be watched </s>
|
funcom_train/31164042 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void remoteChanged(MSETMessage msg) throws Exception {
/*test*/Util.debugln("\n\nREMOTE CHANGE");
// doc.changedUpdate(new TextEdit(offset, length, msg.getAttributeSet())); // do the Document deletion
// /*test*/Util.debugln("VIEW_DOC.changed(offset="+offset+", length="+
// length+")");
}
COM: <s> process remote update and apply it to the view </s>
|
funcom_train/25648081 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setViewMenuItemsVisible(boolean isVisible) {
this.jSeparator4.setVisible(isVisible);
this.showImagesItem.setVisible(isVisible);
this.resizeToCellItem.setVisible(isVisible);
this.resizeToImageItem.setVisible(isVisible);
this.organizeItem.setVisible(isVisible);
}
COM: <s> show or hide image viewing menu items in the view menu </s>
|
funcom_train/36469949 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void movePointAt(int idx, Point p, GeoGraphable gG) {
if ((idx < 0) || (idx >= myTrack.vPoints.size())) {
return;
}
TrackPoint gT = (TrackPoint) myTrack.vPoints.elementAt(idx);
gG.getPointFromMap(p.x, p.y, gT);
updateDistancesFromIndex(idx);
}
COM: <s> move a point to a new position </s>
|
funcom_train/37229051 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setType( String sType ) {
this.sType = sType;
if( vComponents != null ) {
Iterator i = vComponents.iterator();
int iElementNo = 1;
while( i.hasNext() ) {
HL7Element e = (HL7Element)i.next();
e.setType( sType );
e.setName( sType + "." + iElementNo++ );
}
}
}
COM: <s> set the hl7 data type of this element </s>
|
funcom_train/41074505 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Folder copy() {
Folder clone;
try {
clone = (Folder) super.clone();
}
catch (CloneNotSupportedException e) {
throw new IllegalStateException();
}
if (hasFolders()) {
clone.folders = new ArrayList<Folder>(folders.size());
for (Folder subFolder : folders) {
clone.add(subFolder.copy());
}
}
return clone;
}
COM: <s> returns a clone of this folder and its subtree </s>
|
funcom_train/47308462 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void fireEvent(long timestamp, String receivedContent, int modifier) {
if (actionListener != null) {
if (!receivedContent.endsWith("\n")) receivedContent = receivedContent + "\r\n";
ActionEvent e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, receivedContent, timestamp, modifier);
actionListener.actionPerformed(e);
}
}
COM: <s> fires off an event to all registered listeners </s>
|
funcom_train/23659577 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void renameAttributeFieldElement(IAttributeDataWrapper element, String name) {
((AttributeDataWrapper) element).setName(name);
if (element.isDirty()) {
final IAttributeFieldWrapper adw = element.getAttributeFieldWrapper();
final IAttributeCubeWrapper attrCube = adw.getAttributeCube();
fireAttributeFieldElementRenamed(attrCube, adw, element);
}
}
COM: <s> rename the given attribute data wrapper element </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.