__key__ stringlengths 16 21 | __url__ stringclasses 1
value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/49654437 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int compare(Object obj1, Object obj2) {
EventScore a = (EventScore) obj1;
EventScore b = (EventScore) obj2;
int compare = a.getTeam().getName().compareTo(b.getTeam().getName());
if (!ascending) {
compare *= -1;
}
return compare;
}
COM: <s> override compare so that event scores can be sorted by team </s>
|
funcom_train/12806356 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setSimpleColumn(final Phrase phrase, final float llx, final float lly, final float urx, final float ury, final float leading, final int alignment) {
addText(phrase);
setSimpleColumn(llx, lly, urx, ury, leading, alignment);
}
COM: <s> simplified method for rectangular columns </s>
|
funcom_train/36785695 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Note (String strNote) throws IllegalArgumentException {
super(strNote);
int letter = parseNote(strNote);
if (strNote.length() > 1)
strNote = strNote.substring(1);
int acc = parseAccidental(strNote);
int octave = parseOctave(strNote);
int test = (octave + 1) * 12 + letter + acc;
if (test < LOW_MIDI_ABSOLUTE_NUMBER || test > HIGH_MIDI_ABSOLUTE_NUMBER)
throw new IllegalArgumentException("The note was parsed but was out of range.");
midi = test;
}
COM: <s> constructs a code note code from a code string code </s>
|
funcom_train/47891251 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void precacheDiffs() {
Stack<Thread> threads = new Stack<Thread>();
for(int i = 0; i < revisions.size() -2; i++) {
final int j = i;
Thread t = new Thread() {
public void run() {
SVNDiff.doDiff(path, revisions.get(j), revisions.get(j+1));
}
};
t.start();
threads.push(t);
}
while(threads.size() > 0) {
try {
threads.pop().join();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
COM: <s> pre caches the diffs that will be required to fetch line ids from </s>
|
funcom_train/12127559 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void writeObject(ObjectOutputStream out) throws IOException {
out.defaultWriteObject();
int count = getCameraCount();
for (int i = 0; i < count; i++) {
((PObjectOutputStream) out).writeConditionalObject(cameras.get(i));
}
out.writeObject(Boolean.FALSE);
}
COM: <s> write this layer and all its children out to the given stream </s>
|
funcom_train/8491930 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean setTile(int x, int y, Tile tile) {
if (x < 0 || x >= numX) {
Utility.error("x out of bounds",
"TileManager.setTile(int,int,Tile)");
return false;
}
if (y < 0 || y >= numY) {
Utility.error("y out of bounds",
"TileManager.setTile(int,int,Tile)");
return false;
}
grid[x][y] = tile;
return true;
}
COM: <s> sets a tile on the coordinates x y </s>
|
funcom_train/10267440 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void startTransactionalSession() throws YPersistenceException {
try {
session = getFactory().openSession();
transaction = session.beginTransaction();
} catch (HibernateException e) {
logger.fatal("Failure to start transactional session", e);
throw new YPersistenceException("Failure to start transactional session", e);
}
}
COM: <s> start a new hibernate session </s>
|
funcom_train/4717567 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testVolPureData() {
SynMessage msg = new SYN(SYN.PUREDATA).synth(1).volume(100);
assertEquals("Fi", msg.getTypetag());
assertEquals((SynMessage.MAX_24BIT), msg.getArguments()[1]);
assertEquals("/SYN/ID1/VOL", msg.getAddress());
}
COM: <s> test volume of synth for pure data </s>
|
funcom_train/27784810 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void add(Graph graph, Symbol symbol, EODQuoteBundle quoteBundle, int level) {
// Make sure it has at least one value
assert graph.getXRange().size() > 0;
// Add graph to chart
chart.add(graph, level);
// Add menu for this quote
EODQuoteChartMenu menu = new EODQuoteChartMenu(this, quoteBundle, symbol,
graph,indexChart);
addMenu(menu);
}
COM: <s> add a new graph to the specified level </s>
|
funcom_train/8420170 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void ensureIndexCreation(Book book) throws BookException {
log.debug("ensureIndexCreation");
// ensure this isn't just the user re-clicking the Index button
if (!book.getIndexStatus().equals(IndexStatus.CREATING) && !book.getIndexStatus().equals(IndexStatus.SCHEDULED)) {
PdaLuceneIndexManager lim = new PdaLuceneIndexManager();
lim.scheduleIndexCreation(book);
}
}
COM: <s> this custom index creation has been optimised for slow low memory devices </s>
|
funcom_train/27936862 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public A lastKey() throws NoSuchElementException {
Entry<A,B> last = (mReverse) ? mMostRecent : mLeastRecent;
if (last != null) {
return last.mKey;
}
else if (mRecentMap.size() == 0) {
throw new NoSuchElementException();
}
else {
return null;
}
}
COM: <s> returns the last key in the map the least recently used </s>
|
funcom_train/46282432 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public FieldDoc fillFields (final FieldDoc doc) {
final int n = comparators.length;
final Comparable[] fields = new Comparable[n];
for (int i=0; i<n; ++i)
fields[i] = comparators[i].sortValue(doc);
doc.fields = fields;
//if (maxscore > 1.0f) doc.score /= maxscore; // normalize scores
return doc;
}
COM: <s> given a field doc object stores the values used </s>
|
funcom_train/3410438 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setMinimum(int newMinimum) {
// No checks are necessary in this method since minimum is
// the first variable checked in the setValues function.
// Use setValues so that a consistent policy relating
// minimum, maximum, visible amount, and value is enforced.
setValues(value, visibleAmount, newMinimum, maximum);
}
COM: <s> sets the minimum value of this scroll bar </s>
|
funcom_train/550185 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void storePreferences() {
for (int i = 0; i < columnNames.size(); i++) {
String name = (String) columnNames.get(i);
int index = -1;
try {
index = columnModel.getColumnIndex(name);
}
catch (IllegalArgumentException e) {
// column name not in columnmodel,
;
}
putIndex(name, index);
}
}
COM: <s> code store preferences code stores the preferences </s>
|
funcom_train/4757068 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void rotateCCW() {
final T tmpElt = element;
element = right.element;
right.element = tmpElt;
final Node tmpNode = right;
right = tmpNode.right;
tmpNode.right = tmpNode.left;
tmpNode.left = left;
left = tmpNode;
if (right != null) {
right.parent = this;
}
if (left.left != null) {
left.left.parent = left;
}
}
COM: <s> perform a counter clockwise rotation rooted at the instance </s>
|
funcom_train/10794144 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public SchemaGroup getSchemaGroup() {
if (_schema == null) {
SchemaGenerator gen = new SchemaGenerator(_conf);
try {
gen.generateSchemas();
} catch (SQLException se) {
throw SQLExceptions.getStore(se,
_conf.getDBDictionaryInstance());
}
_schema = gen.getSchemaGroup();
}
return _schema;
}
COM: <s> return the schema group to reverse map </s>
|
funcom_train/26627279 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object getValueAt(int rowIndex, int columnIndex) {
List l = (List) entries.get(rowIndex);
NTriple t = new NTriple(l);
switch (columnIndex) {
case 0: return t.getSubject();
case 1: return t.getPredicate();
case 2: return t.getObject();
}
return null;
}
COM: <s> returns the value for the cell at code column index code and </s>
|
funcom_train/10298847 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getVisibleChildCount(){
int count = 0;
if( item == null)
return 0;
for(Enumeration en = item.getChildren().elements(); en.hasMoreElements();){
FavoritesItem nItem =(FavoritesItem)en.nextElement();
if(nItem.isVisible())
count++;
}
return count;
}
COM: <s> returns the number of visible children </s>
|
funcom_train/50864174 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addRelationshipModifier(double time) {
RelationshipManager manager = Simulation.instance()
.getRelationshipManager();
double currentOpinion = manager.getOpinionOfPerson(student, person);
double newOpinion = currentOpinion
+ (BASE_RELATIONSHIP_MODIFIER * time);
Relationship relationship = manager.getRelationship(student, person);
if (relationship != null)
relationship.setPersonOpinion(student, newOpinion);
}
COM: <s> adds a relationship modifier for the students opinion of the teacher </s>
|
funcom_train/22034721 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void requestRefresh() {
if (out != null) {
try {
out.writeInt(id);
out.writeInt(REFRESH);
}
catch (SocketException exc) {
// problem communicating with the server; it has probably disconnected
disconnect();
}
catch (IOException exc) {
// problem communicating with server; it has probably disconnected
disconnect();
}
}
}
COM: <s> requests a refresh from the server </s>
|
funcom_train/25924112 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setAirDistance(GeoPoint myLocation) {
double[] thisCoor = EarthToXYZConvertor.calculateXYZ(getPoint());
double[] myLocationCoor = EarthToXYZConvertor.calculateXYZ(myLocation);
double dx = thisCoor[0] - myLocationCoor[0];
double dy = thisCoor[1] - myLocationCoor[1];
double dz = thisCoor[2] - myLocationCoor[2];
airDistance = Math.sqrt(dx * dx + dy * dy + dz * dz);
}
COM: <s> sets the distance of this item from the specified location </s>
|
funcom_train/28353938 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean doFit() {
cosineFit.fitParameter(Cosine.SLOPE, false);
cosineFit.fitParameter(Cosine.TUNE, false);
cosineFit.fitParameter(Cosine.PHASE, true);
cosineFit.fitParameter(Cosine.AMP, true);
cosineFit.fitParameter(Cosine.OFFSET, true);
cosineFit.setParameter(Cosine.SLOPE, 0.);
cosineFit.setParameter(Cosine.TUNE, 1.);
return cosineFit.fit(4);
}
COM: <s> do the fit </s>
|
funcom_train/31486387 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void pushBack(byte[] bytes) {
byte[] temp = new byte[buffersize + bytes.length];
System.arraycopy(buffer, 0, temp, 0, buffersize);
System.arraycopy(bytes, 0, temp, buffersize, bytes.length);
}
COM: <s> pushes back some bytes </s>
|
funcom_train/19415725 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void set(String key, String val) {
try {
hash.put(key,val);
Field f = getClass().getDeclaredField(key);
f.set(this, val);
} catch (NoSuchFieldException e) { // not a problem really.
//e.printStackTrace(System.err);
} catch (IllegalArgumentException e) { // neither is this.
//e.printStackTrace(System.err);
} catch (IllegalAccessException e) { // do not use security manager.
//e.printStackTrace(System.err);
}
}
COM: <s> sets the value of the specified attribute to the given value </s>
|
funcom_train/7874436 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public User destroyFriendship(String id) throws TwitterException {
assert (id != null);
requireCredentials();
String url = String.format(
"http://twitter.com/friendships/destroy/%s.json", id);
String response = getTwitterHttpManager().post(url);
return User.newFromJsonString(response);
}
COM: <s> discontinues friendship with the user specified in the id parameter as the </s>
|
funcom_train/31667958 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void saveConfig(String filename) {
File f1 = new File(mappingfile);
if (f1.exists()) {
Mapping mapping = new Mapping();
try {
mapping.loadMapping(mappingfile);
Writer writer = new FileWriter(filename);
Marshaller marshaller = new Marshaller(writer);
marshaller.setMapping(mapping);
marshaller.marshal(this);
writer.close();
log.info("written to XML");
} catch (Exception e) {
log.error(e.getMessage());
e.printStackTrace();
}
} else {
log.error("mapping and/or configfile not found");
}
}
COM: <s> write the settings to an xml file </s>
|
funcom_train/32956461 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getGrowthChartHeight() throws IOException {
JFreeChart chart = createChart(1);
String filename = ServletUtilities.saveChartAsPNG(chart, 1000, 700, null);
graphURL = "my.graph?filename=" + URLEncoder.encode(filename, "UTF-8");
TolvenLogger.info("Graph URL: " + graphURL, MenuAction.class);
return graphURL;
}
COM: <s> this function will return height chart </s>
|
funcom_train/17260260 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testDeleteProducte() throws Exception {
IProducteController producteController = ProducteController.getInstance();
//Recuperem el client amb el nif que volem i li canviem alguns valors
String numSerie = "12345R";
Producte producte = producteController.getProducteByNumSerie(numSerie);
try {
producteController.deleteProducte(producte);
} catch (ProducteNoExisteixException e) {
fail("ProducteNoExisteixException: " + e.getMessage());
}
}
COM: <s> test of delete producte method of class producte controller </s>
|
funcom_train/46725894 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void clear() {
discourseRepresentation.clear();
nlpList.clear();
methodArgumentList.clear();
removedArgumentList.clear();
methodBom = null;
method = null;
errors = new ArrayList<CompileError>();
lineNumber = 0;
currentInstance = null;
lastVariable = (int)'a';
mainScript = new CodeBlock();
setCode("");
lastSubject = null;
lastVerb = null;
lastDirectObject = null;
changeHistory.clear();
interimChanges.clear();
sentenceHistory.clear();
processedPids.clear();
lastStatementLocation = null;
previousStatementLocation = null;
classifierValues.clear();
if (previousClassifierValues != null) {
previousClassifierValues.clear();
}
classifierTree = null;
previousClassifierTree = null;
stmStack.clear();
}
COM: <s> this method can be overloaded by subclasses </s>
|
funcom_train/7856429 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addPressed() {
setPresentsDefaultValue(false);
final Property input = getNewInputObject();
if (input != null) {
table.setItemCount(table.getItemCount() + 1);
table.getItem(table.getItemCount() - 1).setText(
new String[] { input.getKey(), input.getValue() });
selectionChanged();
}
}
COM: <s> notifies that the add button has been pressed </s>
|
funcom_train/20305716 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean remove( Triple t )
{
Object o = getIndexField( t );
TripleBunch s = bunchMap.get( o );
if (s == null || !s.contains( t ))
return false;
else
{
s.remove( t );
size -= 1;
if (s.size() == 0) bunchMap.remove( o );
return true;
}
}
COM: <s> remove code t code from this ntm </s>
|
funcom_train/44224271 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private float distanceSquared(int dimension, float point) {
float distanceSquared = 0;
float tempDistance = point - max[dimension];
for (int i = 0; i < 2; i++) {
if (tempDistance > 0) {
distanceSquared = (tempDistance * tempDistance);
break;
}
tempDistance = min[dimension] - point;
}
return distanceSquared;
}
COM: <s> return the squared distance from this rectangle to the passed point </s>
|
funcom_train/8774151 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void fireStatusChanged(final Status status) {
VoiceMailStatusChangedListener[] listeners = this.listeners.toArray(new VoiceMailStatusChangedListener[0]);
if (status == oldStatus) {
return;
}
oldStatus = status;
for (VoiceMailStatusChangedListener listener : listeners) {
try {
listener.statusChanged(status);
} catch (Throwable e) {
Utils.handleUncaughtException(e, exceptionHandler);
}
}
}
COM: <s> notifies the status changed event of all listeners </s>
|
funcom_train/28346202 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String absoluteUrlSpec( final String urlSpec ) {
URL mainUrl = mainUrl();
URL absoluteUrl = null;
try {
absoluteUrl = new URL( mainUrl, urlSpec );
}
catch( MalformedURLException excpt ) {
System.err.println( excpt );
excpt.printStackTrace();
}
return absoluteUrl.toString();
}
COM: <s> get absolute url specifications given a url spec relative to the main url </s>
|
funcom_train/19308079 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testNamespace001() throws FOrayException {
final FoDocumentReader reader = FoDocumentReader.getInstance();
try {
reader.buildFoTree("fo/invalid-ns-001.fo");
fail("Expected FOrayException indicating an unregistered "
+ "namespace.");
} catch (final FOrayException e) {
/* Do nothing. This is the expected case. */
}
}
COM: <s> test of fo invalid ns 001 </s>
|
funcom_train/39543648 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public GraphicsNode createGraphicsNode(BridgeContext ctx, Element e) {
// 'requiredFeatures', 'requiredExtensions' and 'systemLanguage'
if (!SVGUtilities.matchUserAgent(e, ctx.getUserAgent()))
return null;
CompositeGraphicsNode gn = buildCompositeGraphicsNode(ctx, e, null);
return gn;
}
COM: <s> creates a tt graphics node tt according to the specified parameters </s>
|
funcom_train/21611129 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testPrint() throws InterpreterException {
Value v = interpreter.process( " Print('This','is', 'an'), Print('Hello', 'World', '!!' ); ");
assertEquals("unespected result.", "HelloWorld!!", v.asString().getNativeValue() );
}
COM: <s> tests the print function </s>
|
funcom_train/50428146 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void multiply(BBNCPF cpt) {
for (Enumeration e = cpf.keys(); e.hasMoreElements(); ) {
Hashtable q = (Hashtable) e.nextElement();
BBNPDF pdf = (BBNPDF) cpf.get(q);
pdf.multiply(new BBNConstant(cpt.get(q)));
}
}
COM: <s> multiplication with another cpt </s>
|
funcom_train/11344303 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public MethodMetadata getMethodByName(String name) {
for (int i = 0; i < m_methods.size(); i++) {
MethodMetadata met = (MethodMetadata) m_methods.get(i);
if (met.getMethod().getName().equals(name)) { return met; }
}
return null;
}
COM: <s> get a method by its name </s>
|
funcom_train/47805502 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Coordinate getCoordinate ( Coordinate from, Direction dir ) {
Coordinate to = Coordinate.fromOffset(dir);
to.x += from.x;
to.y += from.y;
to.x = (to.x + getWidth()) % getWidth(); // horizontal is always >= 0 and modulo width
// vertical is not modulo!
if (validCoordinate(to)) return to;
return null;
}
COM: <s> returns the coordinate of the cell reached when starting in </s>
|
funcom_train/46523752 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public SEAComponent getChildAt(int x, int y) {
Iterator itr = children.iterator();
while (itr.hasNext()) {
SEAComponent component = (SEAComponent)itr.next();
if (component.posX < x && component.posX + component.width > x &&
component.posY < y && component.posY + component.height > y) {
return component;
}
}
return null;
}
COM: <s> finds the child at a given location on the current component </s>
|
funcom_train/8076296 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Instances getInstances() {
if (m_theData == null && m_data != null) {
try {
m_theData = new Instances(new StringReader(m_data));
} catch(Exception e) {
System.out.println("Error : " + e);
}
m_data = null;
}
return m_theData;
}
COM: <s> this will return the instances object related to this node </s>
|
funcom_train/2878158 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Context serializableContext(Context params){
Context newCxt = new ContextImpl();
if (params != null) {
for (Enumeration e = params.keys(); e.hasMoreElements();) {
Object key = e.nextElement();
newCxt.put(key.toString(), params.get(key).toString());
}
}
return newCxt;
}
COM: <s> converts a given context into a serializable one </s>
|
funcom_train/37749250 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Font getSystemFont(int type) throws FontException {
PropertyConsts pconsts = PropertyConsts.getPropertyConsts();
try {
// Validate the type
String sysfont = pconsts.getEnumText(PropNames.FONT, type);
} catch (PropertyException e) {
throw new FontException(e);
}
// TODO implement this
throw new FontException("getSystemFont not supported");
}
COM: <s> gets a font corresponding to one of the css2 xsl fo system fonts </s>
|
funcom_train/22284358 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void positionRichTextBox() {
if (rtbw != null && group != null) {
Rectangle bounds = getRichTextBoxBounds();
rtbw.setBounds(bounds.x, bounds.y, bounds.width, bounds.height);
// check for greyed out label
if (rtbwDisabled != null) {
rtbwDisabled.setBounds(bounds.x+1, bounds.y+1, bounds.width, bounds.height);
}
}
}
COM: <s> position the rich text box correctly taking into account </s>
|
funcom_train/37589911 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void resetToCurrent() {
for (int i = 0; i < _components.size(); i++) {
_components.get(i).resetToCurrent();
if (_components.get(i) instanceof VectorOptionComponent<?>)
((VectorOptionComponent<?>)_components.get(i)).resizeTable();
}
}
COM: <s> tells each component to reset its display field to the current value </s>
|
funcom_train/12759808 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void reloadEventRoutings() {
try {
for (int i = 0; i < eventMap.length; i++) {
EventServerMap map = eventMap[i];
Publisher publisher = (Publisher) publishers.get(map
.getDestinationTopicName());
if (publisher != null) {
try {
log("Closing publisher: " + publisher.getTopicName());
publisher.close();
} catch (Exception ewe) {
ewe.printStackTrace();
}
}
}
publishers = new HashMap();
loadApplicationDefinitions();
loadEventRoutings();
createPublishers();
} catch (EnyWareException ewe) {
ewe.printStackTrace();
}
}
COM: <s> reload the event routings but ensure nothing is being currently </s>
|
funcom_train/5028108 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void updateTransient(Xtask task) {
Xtask transientTask = (Xtask) task.createTransient();
baseTransientTasks.remove(task.getUuid());
localTransientTasks.remove(task.getUuid());
baseTransientTasks.put(transientTask.getUuid(), transientTask);
localTransientTasks.put(transientTask.getUuid(), transientTask);
}
COM: <s> update the base and local transient for the xtask </s>
|
funcom_train/870184 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void parse(URI uri) throws XBRLException, SAXException, IOException {
InputSource inputSource = this.getEntityResolver().resolveEntity("", uri.toString());
ContentHandler contentHandler = new ContentHandlerImpl(this, uri);
parse(uri, inputSource, contentHandler);
}
COM: <s> parse an xml document supplied as a uri </s>
|
funcom_train/49330052 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isDescendant (TreePath path1, TreePath path2) {
Object obj1[] = path1.getPath();
Object obj2[] = path2.getPath();
for (int i = 0; i < obj2.length; i++) {
if (i < obj1.length) {
if (obj1[i] != obj2[i]) {
return false;
}
}
else {
return false;
}
}
return true;
}
COM: <s> determines if path1 is a descendant of path2 </s>
|
funcom_train/1710464 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createThumbnails() {
//thumbnails.
currentGUI.initThumbnails(itemSelectedCount,pageUsed);
thumbnails.generateOtherThumbnails(imagesStored.get(),thumbnailsStored);
//add the listeners
Object[] buttons=thumbnails.getButtons();
for(int i=0;i<itemSelectedCount-1;i++){
JButton eachThumb=(JButton)buttons[i];
eachThumb.addActionListener(new ButtonPopup(i));
}
}
COM: <s> if setup put up a list onscreen of thumbnails to click on </s>
|
funcom_train/1786354 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void startScheduler() {
if (monitorThread != null) {
if (!monitorThread.isAlive()) {
startMonitorThread();
} else {
log.error("The monitorThread is already running");
}
} else {
log.info("The monitorThread is starting..");
startMonitorThread();
}
}
COM: <s> starts the scheduler once and only once </s>
|
funcom_train/26226955 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addPhiReturn(BasicBlock bb, SubRoutine s) {
if (phis[bb.getIndex()] != null) return;
//the type is not used, the rigth type of all operands,
// will be defined when passing operands to SSA form.
QVar variable = new QVar(var, Constants.TYP_REFERENCE);
phis[bb.getIndex()] = new QPhiReturn(variable, s);
}
COM: <s> add a phi return for a given basic block </s>
|
funcom_train/31782107 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void incomingMSNPMessage( IncomingMessage incomingMessage ) {
switch( incomingMessage.getType() ) {
case Message.VER: receivedVER( incomingMessage ); break;
// Not needed in MSNP8
//case Message.INF: receivedINF (incomingMessage); break;
case Message.XFR: receivedXFR( incomingMessage ); break;
case Message.CVR: receivedCVR( incomingMessage ); break;
}
}
COM: <s> when an msnp packet arrives from the socket we are notified and </s>
|
funcom_train/48337701 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void ensureSpace() {
if (length < symbols.length) {
return;
} else {
Symbol[] s = new Symbol[symbols.length + SIZE_INCR];
Object[] v = new Object[symbols.length + SIZE_INCR];
System.arraycopy(symbols, 0, s, 0, length);
System.arraycopy(values, 0, v, 0, length);
symbols = s;
values = v;
}
}
COM: <s> ensure that there is enough space in the internal data structures </s>
|
funcom_train/14245538 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void mySingleClick(int row, TreePath path) {
_clicksInToDoPane++;
if (getSelectedObject() == null) return;
//needs-more-work: should fire its own event and ProjectBrowser
//should register a listener
//System.out.println("1: " + getSelectedObject().toString());
}
COM: <s> called when the user clicks once on an item in the tree </s>
|
funcom_train/48150369 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double getCDF(double x) {
double u = degrees / (degrees + x * x);
if (x > 0) return 1 - 0.5 * betaCDF(u, 0.5 * degrees, 0.5);
else return 0.5 * betaCDF(u, 0.5 * degrees, 0.5);
}
COM: <s> this method computes the cumulative distribution function in terms of the </s>
|
funcom_train/46857719 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean hit(Point p, AffineTransform tx) {
Point2D t = tx.transform(location, null);
// Be a little flexible, check a bit around the handle as well
Rectangle2D.Double e = new Rectangle2D.Double();
e.setFrameFromCenter(t.getX(), t.getY(), t.getX() + 5, t.getY() + 5);
if (e.contains(p)) {
return true;
} else {
return false;
}
}
COM: <s> checks to see if the specified point lies within the handle </s>
|
funcom_train/46055905 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean mediaFileExists(String imageName) {
List mediaFiles = getMediaFileList();
if (mediaFiles.size() == 0) return false;
for (Iterator iter = mediaFiles.iterator(); iter.hasNext();) {
VFSLeaf leaf = (VFSLeaf) iter.next();
if (leaf.getName().equals(Utilities.encodeForURL(imageName))) return true;
}
return false;
}
COM: <s> fixme make more performant </s>
|
funcom_train/40614451 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String createTempFile() {
try {
boolean inTempDir = readOnly;
String name = databaseName;
if (!persistent) {
name = FileSystemMemory.PREFIX + name;
}
return IOUtils.createTempFile(name, Constants.SUFFIX_TEMP_FILE, true, inTempDir);
} catch (IOException e) {
throw DbException.convertIOException(e, databaseName);
}
}
COM: <s> create a temporary file in the database folder </s>
|
funcom_train/16683023 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public File save(final String filename, final Serializer serializer) {
File file = serializer.save(this, filename);
if (log != null) //noinspection ConstantConditions
log.info("Reflections successfully saved in " + file.getAbsolutePath() + " using " + serializer.getClass().getSimpleName());
return file;
}
COM: <s> serialize to a given directory and filename using given serializer </s>
|
funcom_train/9758366 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean findNext(String findString, boolean forwardSearch, boolean caseSensitive, boolean wrapSearch, boolean wholeWord, boolean regExSearch) {
Point r= fTarget.getSelection();
int findReplacePosition= r.x;
if (forwardSearch)
findReplacePosition += r.y;
int index= findIndex(findString, findReplacePosition, forwardSearch, caseSensitive, wrapSearch, wholeWord, regExSearch);
if (index != -1)
return true;
return false;
}
COM: <s> returns whether the specified search string can be found using the given options </s>
|
funcom_train/50302008 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public CmsUser addUser(String name, String password, String group, String description, Hashtable additionalInfos, int flags) throws CmsException {
return (m_rb.addUser(this, m_context.currentUser(), m_context.currentProject(), name, password, group, description, additionalInfos, flags));
}
COM: <s> adds a user to the cms </s>
|
funcom_train/13393938 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: static public boolean deleteDirectory(File path) {
if (path.exists()) {
File[] files = path.listFiles();
for (File file : files) {
if (file.isDirectory()) {
deleteDirectory(file);
} else {
file.delete();
}
}
}
return (path.delete());
}
COM: <s> delete the directory and all files and directories contained within </s>
|
funcom_train/47814368 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void loadVendorNames() {
lbVendorName.clear();
vendorhandling.getVendorList(new OrderBy("vendor.name", SortOrder.ASC),
new OkCallback<List<Vendor>>() {
public void onSuccess(final List<Vendor> vendors) {
lbVendorName.addItem("");
for (int i = 0; i < vendors.size(); i++) {
lbVendorName.addItem(vendors.get(i).getName());
}
};
});
}
COM: <s> this method loads the names from the vendors </s>
|
funcom_train/25422197 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private SearchController readController() {
FacesContextBroker broker = new FacesContextBroker();
@SuppressWarnings("unused")
FacesContext fc = broker.getFacesContext();
// intentionally not used
SearchController controller =
(SearchController) broker.resolveManagedBean(JSFBEAN_SEARCH_CONTROLLER);
controller.setSearchCriteria(this.getCriteria());
return controller;
}
COM: <s> read controller from the request </s>
|
funcom_train/48193425 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void load(final String fileName) throws Exception {
if (!isConfigLoaded) {
LOG.debug("Loading application configuration from file " + fileName);
ClassLoader loader = SocialAuthConfig.class.getClassLoader();
try {
InputStream in = loader.getResourceAsStream(fileName);
load(in);
} catch (NullPointerException ne) {
throw new FileNotFoundException(fileName
+ " file is not found in your class path");
}
}
}
COM: <s> loads the application configuration from the given file </s>
|
funcom_train/28760479 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setCssheadcolor(String newVal) {
if ((newVal != null && this.cssheadcolor != null && (newVal.compareTo(this.cssheadcolor) == 0)) ||
(newVal == null && this.cssheadcolor == null && cssheadcolor_is_initialized)) {
return;
}
this.cssheadcolor = newVal;
cssheadcolor_is_modified = true;
cssheadcolor_is_initialized = true;
}
COM: <s> setter method for cssheadcolor </s>
|
funcom_train/21014560 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void printMatrix() {
int[][] matrix = getAdjacencyMatrix();
int N = getNonGhostNodesNumber(); // use getNodesNumber if ghosts are
// used
for (int j = 0; j < N; j++) {
for (int i = 0; i < N; i++) {
System.out.print(Integer.toString(matrix[i][j]) + " ");
}
System.out.println();
}
}
COM: <s> print adjacency matrix onto the standard output </s>
|
funcom_train/18730508 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Surface project(Surface surface) {
List edges = new ArrayList();
Iterator iter = surface.getEdges().iterator();
while (iter.hasNext()) {
Edge current = (Edge) iter.next();
edges.add(project(current));
}
Surface projected = new Surface();
projected.setEdges(edges);
return projected;
}
COM: <s> projects the surface to screen coordinates </s>
|
funcom_train/16605115 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public CurvePoint viewToWorld(CurvePoint view) {
float sx = (viewportMaxX - viewportMinX) / (worldMaxX - worldMinX);
float sy = (viewportMaxY - viewportMinY) / (worldMaxY - worldMinY);
float cx = -sx * worldMinX + viewportMinX;
float cy = -sy * worldMinY + viewportMinY;
return new CurvePoint((view.x - cx) / sx, (view.y - cy) / sy);
}
COM: <s> convert the given point in view space into world space </s>
|
funcom_train/25313013 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void resize() {
HashSet<FSMState> finalStates = new HashSet<FSMState>();
HashSet<FSMState> states = new HashSet<FSMState>();
int id = 0;
for (FSMState s : this.allStates) {
s.id = id++;
}
finalStates.addAll(this.finalStates);
states.addAll(this.allStates);
this.finalStates = finalStates;
this.allStates = states;
}
COM: <s> it resizes the finite state machine </s>
|
funcom_train/3078431 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void confirmDeleteBuilder(IRequestCycle cycle) {
ensureCurrentTab(); // in case user go back to this page through browser's back button and click on this
if (getBuilderIndexToDelete() == -1) { // avoid re-submit
return;
}
getProjectPage().getProject().getBuilderList().remove(getBuilderIndexToDelete());
getProjectPage().saveProject();
setBuilderIndexToDelete(-1);
Luntbuild.getSchedService().rescheduleBuilds();
setAction(null);
}
COM: <s> actually delete the builders </s>
|
funcom_train/1238849 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public QName getServiceName() {
if (serviceName != null) return serviceName;
if (wsdlService == null) return (null);
QName qn = wsdlService.getQName();
return (new QName(qn.getNamespaceURI(), qn.getLocalPart()));
}
COM: <s> returns the qualified name of the service if one is set </s>
|
funcom_train/25779035 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addValueTypePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Value_valueType_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Value_valueType_feature", "_UI_Value_type"),
TestpackagePackage.Literals.VALUE__VALUE_TYPE,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the value type feature </s>
|
funcom_train/25920946 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void mouseIn() throws GUIException {
currentImage = selectedButton;
try {
updateListener.putRegionToUpdate(new WidgetUpdate(this, new SDLRect(getX(),getY(),getWidth(), getHeight())));
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
COM: <s> mouse listener interface implementation sets the selected button image </s>
|
funcom_train/1477904 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString() {
/*
return "EXTENT OBJECT: "+
"\n . minx = "+minx+
"\n . miny = "+miny+
"\n . maxx = "+maxx+
"\n . maxy = "+maxy+"\n";
*/
return "" + minx + " " + miny + " " + maxx + " " + maxy;
}
COM: <s> returns a string representation of the extent object </s>
|
funcom_train/37036335 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addInstanceListener(String listener) {
synchronized (instanceListeners) {
String results[] =new String[instanceListeners.length + 1];
for (int i = 0; i < instanceListeners.length; i++)
results[i] = instanceListeners[i];
results[instanceListeners.length] = listener;
instanceListeners = results;
}
}
COM: <s> add the classname of an instance listener to be added to each </s>
|
funcom_train/3523238 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: final public void yyreset(java.io.Reader reader) throws java.io.IOException {
yyclose();
yy_reader = reader;
yy_atBOL = true;
yy_atEOF = false;
yy_endRead = yy_startRead = 0;
yy_currentPos = yy_markedPos = yy_pushbackPos = 0;
yyline = yychar = yycolumn = 0;
yy_lexical_state = YYINITIAL;
}
COM: <s> closes the current stream and resets the </s>
|
funcom_train/20613705 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void updateState(IEditorInput input) {
IDocumentProvider provider= getDocumentProvider();
try {
// boolean wasReadOnly= isEditorInputReadOnly();
provider.updateStateCache(input);
if (getDiagramEditPart() != null) {
if(isEditable())
getDiagramEditPart().enableEditMode();
else
getDiagramEditPart().disableEditMode();
}
} catch (CoreException x) {
Bundle bundle= Platform.getBundle(PlatformUI.PLUGIN_ID);
ILog log= Platform.getLog(bundle);
log.log(x.getStatus());
}
}
COM: <s> updates the state of the given editor input such as read only flag </s>
|
funcom_train/47365172 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int hashCode() {
long bits = 1L;
bits = 31L * bits + Double.doubleToLongBits(x);
bits = 31L * bits + Double.doubleToLongBits(y);
bits = 31L * bits + Double.doubleToLongBits(z);
return (int) (bits ^ (bits >> 32));
}
COM: <s> returns a hash code value based on the data values in this </s>
|
funcom_train/29626393 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int getTaskbarSize(){
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice gd = ge.getScreenDevices()[0];
GraphicsConfiguration gc = gd.getDefaultConfiguration();
Insets ins = Toolkit.getDefaultToolkit().getScreenInsets(gc);
return ins.bottom;
}
COM: <s> returns the height of the taskbar in pixels </s>
|
funcom_train/38281857 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Connection getConnection(String key) {
ThreadData threadData = threadLocalData.get();
if (threadData != null && threadData.getCurrentEnv() != null) {
return threadData.getConnection(key);
} else {
throw new EtlToolsException("Env not set. Thread: "
+ Thread.currentThread().getId());
}
}
COM: <s> get a connection for the specific thread </s>
|
funcom_train/43245552 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetRegisteringEmpoyeeDUZNumber() {
System.out.println("getRegisteringEmpoyeeDUZNumber");
ApplicationObject instance = new ApplicationObject();
String expResult = "";
String result = instance.getRegisteringEmpoyeeDUZNumber();
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 get registering empoyee duznumber method of class org </s>
|
funcom_train/25711598 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void updateTofTree(final AbstractNode board) {
if( board == null ) {
return;
}
// fire update for node
tofTreeModel.nodeChanged(board);
// also update all parents
TreeNode parentFolder = board.getParent();
while (parentFolder != null) {
tofTreeModel.nodeChanged(parentFolder);
parentFolder = parentFolder.getParent();
}
}
COM: <s> fires a node changed redraw for this board and updates buttons </s>
|
funcom_train/20219253 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testHandleProperty() throws Exception{
PropertyHandler propertyHandler = new DateDayHandler();
Calendar calendar = Calendar.getInstance();
Date dt = new Date();
calendar.setTime(dt);
for(int i = 1; i <= 12; i++) {
calendar.set(Calendar.DAY_OF_MONTH, i);
assertEquals(new Integer(i), propertyHandler.doProperty(calendar.getTime()));
}
}
COM: <s> date day handler </s>
|
funcom_train/3464835 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void processWindowEvent(WindowEvent e) {
if(e.getID() == WindowEvent.WINDOW_CLOSING) {
JMenu filemenu = (JMenu)menus.get(FILE);
if(null != filemenu) {
((FileMenu)filemenu).onExit();
return;
}
}
super.processWindowEvent(e);
}
COM: <s> overridden so we can exit on system close </s>
|
funcom_train/45863965 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void reset(Vector2D whereTo, int posA, int path, int posn) {
warp(whereTo);
this.posA = posA;
this.path = path;
this.posn = posn;
next = -1;
bump = 0;
pseg = -1;
flag = false;
laps = 0;
dist = 0;
done = -1;
trfx = 0;
bang = 0;
pick = 0;
speed = 0;
revt = 0;
oppo = false;
puType = 0;
puTime = 0;
puProp = 0;
pufx = 0;
}
COM: <s> reset the kart to the specified world position </s>
|
funcom_train/36480939 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getScreenFullWidth() {
int width;
//#if tmp.fullScreen && polish.Bugs.requiresHardcodedCanvasDimensionsInFullScreenMode && polish.FullCanvasWidth:defined
//#= width = ${polish.FullCanvasWidth};
//#elif tmp.useMasterCanvas
width = MasterCanvas.getScreenWidth();
if (width == 0) {
width = getWidth();
}
//#else
//# width = getWidth();
//#endif
return width;
}
COM: <s> retrieves the width that the complete screen uses including scrollbar etc </s>
|
funcom_train/22399491 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void nextRndBytes(Random rnd, byte[] bytes) {
int numRequested = bytes.length;
int numGot = 0, r = 0;
{
for (;;) {
for (int i = 0; i < BYTES_PER_INT; i++) {
if (numGot == numRequested) {
return;
}
r = (i == 0 ? rnd.nextInt() : r >> BITS_PER_BYTE);
bytes[numGot++] = (byte) r;
}
}
}
}
COM: <s> strictly speaking this is a little dodgey from a compliance point of view </s>
|
funcom_train/1733678 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void getConnection() throws DatabaseException{
if(aConn==null){
try{
aConn=DriverManager.getConnection("jdbc:hsqldb:file:"+location+this.dbName, "sa", "");
// String q=" SET PROPERTY \"hsqldb.applog\" 1";
// PreparedStatement ps=aConn.prepareStatement(q);
// ps.execute();
}catch(SQLException e){
e.printStackTrace(System.out);
throw new DatabaseException("Error in connection database. "+e.toString());
}
}
return;
}
COM: <s> function to get the connection </s>
|
funcom_train/39177650 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setMapVisible(boolean mapvis) {
if(mapvis){
mapVisible = true;
if(keyboardMap == null) keyboardMap = new KeyboardMap(this,
currentHandler,
currentState);
keyboardMap.addJob("SHOW");
}else{
mapVisible = false;
if(keyboardMap != null) keyboardMap.addJob("HIDE");
}
}// setMapVisible(boolean mapvis)
COM: <s> should the virtual keyboard map be visible </s>
|
funcom_train/5442552 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void usePlayURL(URL url) throws PrivilegeViolationException, ResourceUnavailableException, MethodNotSupportedException {
try{
InputStream s = url.openStream();
m_playURL = url;
m_bPlayURL = true;
}catch(Exception e){
throw new ResourceUnavailableException(
javax.telephony.ResourceUnavailableException.UNKNOWN);
}
}
COM: <s> instructs the terminal connection to use a file for playing to </s>
|
funcom_train/41195126 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setSelectionRange(SelectionRange newRange) {
// @TODO:Pratik change all these setSelection() methods so that they don't affect
// any other selection. So, setting selectionRange to null would not clear the
// selected editparts.
SelectionModel newModel = null;
if (newRange != null)
newModel = createSelectionModel(null, newRange,
selectionModel == null ? null : selectionModel.getSelectedEditParts(),
null);
setSelectionModel(newModel);
}
COM: <s> sets the selection range to the given value </s>
|
funcom_train/17728977 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getNextCommand() {
String cmd = null;
try {
getPrintStream().print(getPrompt());
cmd = lnr.readLine();
}
catch (IOException io) {
System.err.println(io);
io.printStackTrace();
}
history.add(cmd);
return cmd;
}
COM: <s> retrieves the next command from the input stream </s>
|
funcom_train/48960706 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected URL buildHudsonURL(HudsonConfiguration configuration) throws MalformedURLException {
StringBuilder url = new StringBuilder(configuration.getConnectionDetails().getUrl());
url.append("/job/").append(configuration.getJobName()).append("/api/xml");
return new URL(url.toString());
}
COM: <s> constructs a valid hudson remote api url for a job </s>
|
funcom_train/5692547 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public XSDElementRef getNamedElementRef(String name) {
String tname = nsPrefixName(name);
for (Iterator it = getElementRefs(); it.hasNext();) {
XSDElementRef ref = (XSDElementRef)it.next();
if (ref.getName().equals(tname)) {
return ref;
}
}
return null;
}
COM: <s> gets a named element reference </s>
|
funcom_train/17206103 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean willNotMoveInCurrentCollection(ObjectReference object) {
if (Space.isInSpace(GenCopy.toSpaceDesc(), object)) {
return true;
}
if (Space.isInSpace(GenCopy.fromSpaceDesc(), object)) {
return false;
}
return super.willNotMoveInCurrentCollection(object);
}
COM: <s> return true if this object is guaranteed not to move during this </s>
|
funcom_train/40873419 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isCyclic(UMLClass parent) {
// If parent is null, the inheritance is not cyclic at this point
if (parent == null)
return false;
// The inheritance is cyclic
if (parent == child())
return true;
// At this point, the inheritance isn't cyclic. Check the parent of parent
return parent.parent() != null && isCyclic(parent.parent().parent());
}
COM: <s> recursive method who check if the inheritance is cyclic </s>
|
funcom_train/5703759 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString() {
StringBuffer result = new StringBuffer();
result.append(JavaFile.getModifiersText(modifiers));
result.append(type);
result.append(' ');
result.append(name);
if (initializer != null) {
result.append(" = ");
result.append(initializer);
}
result.append(';');
return result.toString();
}
COM: <s> returns the java source code for this field </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.