__key__ stringlengths 16 21 | __url__ stringclasses 1
value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/31646164 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean match(Date value) {
switch (comparison) {
case LE:
return (value.getTime() <= date.getTime());
case LT:
return (value.getTime() < date.getTime());
case EQ:
return (value.getTime() == date.getTime());
case GT:
return (value.getTime() > date.getTime());
case GE:
return (value.getTime() >= date.getTime());
} // switch()
return false;
} // match()
COM: <s> date comparison match </s>
|
funcom_train/18733223 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ResolvedMember getDeclaredInterMethodBody(UnresolvedType aspectType, World w) {
if (declaredSignature != null) {
ResolvedMember rm = declaredSignature.parameterizedWith(null, signature.getDeclaringType().resolve(w), false,
getTypeVariableAliases());
return AjcMemberMaker.interMethodBody(rm, aspectType);
} else {
return AjcMemberMaker.interMethodBody(signature, aspectType);
}
}
COM: <s> if the munger has a declared signature </s>
|
funcom_train/11363918 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void ensureCapacity(int i) {
if((pos + i) >= bytes.length) {
byte[] tmp = bytes;
int newLength = bytes.length + bufferGrowthSize;
while(newLength < pos + i) {
newLength += bufferGrowthSize;
}
bytes = new byte[newLength];
System.arraycopy(tmp, 0, bytes, 0, (maxRead >= pos) ? maxRead + 1 : pos);
}
}
COM: <s> ensure our internal byte array can hold enough data </s>
|
funcom_train/49159732 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void closeDialog() {
// Remove dialog if needed
if (currentDialog != null) {
currentDialog.dispose();
currentDialog = null;
}
// After a dialog has been closed, update all data on the lower panel
if (panelControl != null && panelControl.getContent() != null) {
panelControl.getContent().updateData();
}
}
COM: <s> closes the current dialog </s>
|
funcom_train/8078990 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public PaceMatrix rbind( PaceMatrix b ){
if( n != b.n )
throw new IllegalArgumentException("unequal numbers of rows.");
PaceMatrix c = new PaceMatrix( m + b.m, n );
c.setMatrix( 0, m - 1, 0, n - 1, this );
c.setMatrix( m, m + b.m - 1, 0, n - 1, b );
return c;
}
COM: <s> returns a new matrix which binds two matrices together with rows </s>
|
funcom_train/8495677 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getTitlePublishedIn(String pubLsid){
try{
TermQuery query = new TermQuery(new Term("lsid", pubLsid));
TopDocs docs = anbgIdxSearcher.search(query, 1);
if(docs.totalHits>0){
return anbgIdxSearcher.doc(docs.scoreDocs[0].doc).get("titleid");
}
}
catch(Exception e){}
return null;
}
COM: <s> retrieves the bhl title id for the specified anbg publication lsid </s>
|
funcom_train/44890131 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Class getClass(String name){
for (Iterator iter = this.getNestedDefinitions().iterator(); iter.hasNext();) {
Definition each = (Definition) iter.next();
if (each.isClassDefinition() && each.getName().equals(name))
return (Class) each;
}
return null;
}
COM: <s> answer the top level class in the module with the given name </s>
|
funcom_train/16911372 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createAndShowGUI() {
/*
* Make sure we have nice window decorations.
* JFrame.setDefaultLookAndFeelDecorated(true);
* Create and set up the window.
*/
frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
/** Open a default workspace */
//openWorkspace(workspace.getCurrentFile());
/* Display the window. */
frame.setVisible(true);
}
COM: <s> create the gui and show it </s>
|
funcom_train/41024725 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void updateMarkerSize() {
final NapMarker sampleMarker = markers.iterator().next();
final int markerWidth = sampleMarker.getWidth();
final int markerHeight = sampleMarker.getHeight();
squareImage = new NyARColorPatt_Perspective_O2(markerWidth, markerHeight, 4, 25);
deviationData = new NyARMatchPattDeviationColorData(markerWidth, markerHeight);
}
COM: <s> update marker size and initialize workspaces for comparing a marker with images </s>
|
funcom_train/18891875 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void stop() throws MessageQueueException {
if (timerThread != null) {
logger.info("Stopping queue "+name);
timerThread.cancel();
timerThread = null;
processingTask = null;
}
else {
throw new MessageQueueException("Queue "+name+" not running.");
}
}
COM: <s> stops the queue </s>
|
funcom_train/28977814 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void writeRefrences() {
if (this.statistics == null) {
if (refrenceTypes != null) {
if (refrenceTypes.isEmpty() == false) {
Iterator it = refrenceTypes.keySet().iterator();
while (it.hasNext()) {
this.line = refrenceTypes.get(it.next());
writeLine();
}
}
}
} else {
logger.info("refrences are disabled because statistics will be generated!");
}
}
COM: <s> writes our refrences </s>
|
funcom_train/41874548 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void clearOutgoingEdges() {
List<GraphEdge> toRemove = new ArrayList<GraphEdge>();
Iterator<GraphEdge> i = outgoingEdges.iterator();
while (i.hasNext()) {
toRemove.add(i.next());
}
i = toRemove.iterator();
while (i.hasNext()) {
removeOutgoingEdge(i.next());
}
}
COM: <s> clear all the outgoing edges from the outgoing edge set of this node </s>
|
funcom_train/46471531 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Hashtable executeQuery(Query q) {
if (DatabaseConnection.verbose) {
System.out.println("DatabaseConnection: Executing " + q);
}
Hashtable result = new Hashtable();
Iterator itr = this.queryHandlers.iterator();
while (itr.hasNext()) {
Hashtable h = ((QueryHandler)itr.next()).executeQuery(q);
if (h != null) result.putAll(h);
}
return result;
}
COM: <s> executes a query and returns the result in the form of a hashtable </s>
|
funcom_train/51340541 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: final public int remove(final int index) {
assert index >= 0 && index < nkeys;
/*
* Copy down to cover up the hole.
*/
final int length = nkeys - index - 1;
if(length > 0) {
System.arraycopy(keys, index + 1, keys, index, length);
}
keys[--nkeys] = null;
return nkeys;
}
COM: <s> remove a key in the buffer at the specified index decrementing the of </s>
|
funcom_train/49427951 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setMaxSize(int width, int height) {
if(width < 0 || height < 0) {
throw new IllegalArgumentException("negative size");
}
maxWidth = (short)Math.min(width, Short.MAX_VALUE);
maxHeight = (short)Math.min(height, Short.MAX_VALUE);
}
COM: <s> sets the maximum size of the widget </s>
|
funcom_train/23381929 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void replace(final Object oldtype, final Object newtype) {
for (int i = 0; i < localSize; i++) {
if (oldtype.equals(local[i])) {
local[i] = newtype;
}
}
for (int i = 0; i < stackSize; i++) {
if (oldtype.equals(stack[i])) {
stack[i] = newtype;
}
}
}
COM: <s> replaces a type in the locals and on the stack </s>
|
funcom_train/21955259 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void stopMessageListener() {
mStopped = true;
try {
closeServerSocket();
} catch (Exception e) {
// ignore--we're stopping.
}
Iterator iter = mActiveHandlers.iterator();
while(iter.hasNext()) {
((PookaMessageHandler) iter.next()).stopHandler();
}
}
COM: <s> stops this message listener </s>
|
funcom_train/43235595 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void activateWorkflow() {
try {
workflow.activateWorkflow(multiThreadMode);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
buttonAnalysis.setEnabled(true);
buttonReset.setEnabled(true);
buttonActivate.setEnabled(false);
radioMultiThread.setEnabled(false);
radioSingleThread.setEnabled(false);
listPluginSupplement1.setEnabled(false);
listPluginSupplement2.setEnabled(false);
listPluginSupplement3.setEnabled(false);
listPluginMajor2.setEnabled(false);
listPluginMajor3.setEnabled(false);
activated = true;
}
COM: <s> activates the work flow </s>
|
funcom_train/124086 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setTablePopup(JPopupMenu newTablePopup) {
tablePopup = newTablePopup;
if (tablePopup == null)
coeff.removeMouseListener(triggerPopUp);
else {
triggerPopUp = new MouseAdapter() {
public void mouseReleased(MouseEvent e) {
tablePopup.processMouseEvent(e, null, null);
}
};
coeff.addMouseListener(triggerPopUp);
}
}
COM: <s> sets the popup menu for the underlying coefficients </s>
|
funcom_train/32791108 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String handleCollSum(String collection, Guide guide) {
assert(guide != null) : "sum(): guide may not be null";
guide.reset();
Template template = templateEngine.getTemplate("feature_call_sum");
template.setAttribute("source", guide.getFrom());
template.setAttribute("element", guide.getSelect());
template.setAttribute("collection", collection);
return template.toString();
}
COM: <s> generates a code fragment for a sum operation </s>
|
funcom_train/33362667 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object createObject(String className, String args[]) {
Class targetClass = null;
Object result = null;
try {
targetClass = Class.forName(className);
}
catch(ClassNotFoundException e) {
e.printStackTrace();
return null;
}
try {
result = targetClass.newInstance();
}
catch(InstantiationException e) {
e.printStackTrace();
}
catch(IllegalAccessException e) {
e.printStackTrace();
}
return result;
}
COM: <s> create new object </s>
|
funcom_train/44100746 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Plugin getPluginByTitle(String title) {
if (title == null) return null;
for (Iterator i = myPlugins.iterator(); i.hasNext();) {
Plugin p = (Plugin)i.next();
if (title.equals(p.getTitle())) return p;
}
return null;
}
COM: <s> returns a plugin by its title </s>
|
funcom_train/31131393 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createLCPTabs() {
tabbedPane.removeAll();
tabbedPane.addTab("Files", filesPanel);
tabbedPane.addTab("Settings", settingsPanel);
tabbedPane.addTab("Monitor", monitorPanel);
tabbedPane.addTab("Control", controlPanel);
tabbedPane.addTab("Miscellaneous", otherPanel);
}
COM: <s> create the tabs for lcp </s>
|
funcom_train/12152794 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setEventHandlerObject(Object obj) {
eventHandler = obj;
try {
pipelineEventMethod = eventHandler.getClass().getMethod("pipelineEvent",
new Class[] { GSPipeline.class });
} catch (Exception e) {
// no such method, or an error.. which is fine, just ignore
}
}
COM: <s> uses a generic object as handler of the pipeline </s>
|
funcom_train/18728055 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testContains() {
final Point handle = new Point(0, 0);
JaxoDefaultHandle instance = new JaxoDefaultHandle();
assertTrue(instance.contains(handle, new Point(0, 0)));
assertTrue(instance.contains(handle, new Point(4, -4)));
assertFalse(instance.contains(handle, new Point(5, -4)));
}
COM: <s> test of contains method of class jaxo default handle </s>
|
funcom_train/26391496 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void write(byte b[]) {
String s = new String(b);
/** Append if text area, otherwise print error. */
if (null != get_text_area()) {
my_text_area.append(s);
}
else {
System.err.println(no_text_area_message());
}
}
COM: <s> write a byte array to the output stream </s>
|
funcom_train/8987704 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public DmsRoot getDmsRootID(Integer ownerID, String recordStatus) throws ApplicationException{
DmsRootDAObject dmsRootDAO = new DmsRootDAObject(sessionContainer, conn);
DmsRoot dmsRoot = dmsRootDAO.getPersonalRootByOwnerIDAndType(ownerID,recordStatus);
dmsRootDAO = null;
return dmsRoot;
}
COM: <s> gets the personal root by owner id and record status </s>
|
funcom_train/43380997 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void freeResources() {
if (icons != null) {
for (Iterator<String> it = icons.keySet().iterator(); it.hasNext();) {
String key = it.next();
Image image = icons.get(key);
image.dispose();
}
icons.clear();
}
}
COM: <s> frees the resources </s>
|
funcom_train/39841819 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetSimpleString() {
try {
Object value = dynaForm.get("stringProperty");
assertNotNull("Got a value", value);
assertTrue("Got correct type", (value instanceof String));
assertEquals("Got correct value",
(String) value,
"This is a string");
} catch (Throwable t) {
fail("Exception: " + t);
}
}
COM: <s> test get simple property on a string property </s>
|
funcom_train/19704394 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Tag findNextTag() {
final Tag[] allTagsArray=source.allTagsArray;
if (allTagsArray!=null) {
final int nextAllTagsArrayIndex=allTagsArrayIndex+1;
if (allTagsArray.length==nextAllTagsArrayIndex) return null;
return allTagsArray[nextAllTagsArrayIndex];
} else {
return source.findNextTag(begin+1);
}
}
COM: <s> returns the next tag in the source document </s>
|
funcom_train/45044779 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getAudioCodecName(int id) throws Exception {
/* Transforms the id in a string... */
StringBuffer buffer = new StringBuffer("0x");
String value = Integer.toHexString(id);
int i = 4 - value.length();
while (i-- > 0) {
buffer.append('0');
}
buffer.append(value);
return findName(FileUtil.getResourceAsStream("/codecs/FOURCCaudio.txt"), buffer.toString());
}
COM: <s> gets the audio codec name from file based on the id </s>
|
funcom_train/36253169 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testReadFile() throws Exception {
Path file = new Path("/home/user/testfile-" + UUID.randomUUID().toString()
+ ".dat");
FSDataOutputStream os = sftpFs.create(file);
os.writeChar('x');
os.close();
FSDataInputStream is = sftpFs.open(file);
char c = is.readChar();
is.close();
assertEquals(c, 'x');
}
COM: <s> test writing to a file and reading its value </s>
|
funcom_train/6261082 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testRemoveExistBindingFromClass() {
listenerCls.colCopy = new ArrayList( cls.getSetRole() );
cls.getSetRole().remove( bindExist );
assert( compare2Collections( listenerCls.colCopy, cls.getSetRole() ) );
assertCorrectCollection( bindExist.getListRole(), null, "getListRole" );
}
COM: <s> tests undo redo operations removal participant1 from participant2 breaks association between participant1 and </s>
|
funcom_train/1535569 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void drawCursor(int type){
if (!PlotterCursor.isTypeAlready(type))
gl.glDisable(GLlocal.GL_LIGHTING);
initMatrix();
geometryManager.draw(geometryManager.cursor.getIndex(type));
resetMatrix();
if (!PlotterCursor.isTypeAlready(type))
gl.glEnable(GLlocal.GL_LIGHTING);
}
COM: <s> draws a 3 d cross cursor </s>
|
funcom_train/9877949 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void fireUseFileInputState() {
boolean enable = !this.fileInput.isSelected();
if(enable && this.multipleChr.isSelected()) {
this.chrLabel.setEnabled(true);
this.chrBox.setEnabled(true);
} else if(!enable) {
this.chrLabel.setEnabled(false);
this.chrBox.setEnabled(false);
}
this.startLabel.setEnabled(enable);
this.startBox.setEnabled(enable);
this.endLabel.setEnabled(enable);
this.endBox.setEnabled(enable);
}
COM: <s> updates the dialog for file input selection </s>
|
funcom_train/37005462 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public float distance(final Position c) {
if (coordinates.length != c.getDimensions()) {
throw new IllegalArgumentException();
}
float dist = 0f;
for (int i = 0; i < coordinates.length; i++) {
dist += Math.pow(coordinates[i] - c.getCoordinate(i), 2);
}
return (float) Math.sqrt(dist);
}
COM: <s> returns the distance to a position </s>
|
funcom_train/3740169 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isSystemAdmin (AllUser user) throws UserManagerException {
boolean ret=false;
try {
Session sess= HibernateUtil.currentSession();
if (user.getUser()==null) {
ret = user.getDeletedUser().isSystemAdmin();
} else {
ret = user.getUser().isSystemAdmin(); }
} catch (HibernateException e) {
throw new UserManagerException();
}
return ret;
}
COM: <s> return system admin field of the given user </s>
|
funcom_train/118987 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void refresh(boolean createDependentViews) {
super.refresh(createDependentViews);
// Sync Source- and Targetport
if (points != null) {
Object modelSource = getModel().getSource(cell);
Object modelTarget = getModel().getTarget(cell);
setSource(mapper.getMapping(modelSource, createDependentViews));
setTarget(mapper.getMapping(modelTarget, createDependentViews));
// Re-Route
Edge.Routing routing = GraphConstants.getRouting(allAttributes);
if (routing != null)
routing.route(this, points);
}
}
COM: <s> overrides the parent method to udpate the cached points </s>
|
funcom_train/32136455 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JCheckBox getJCheckBoxComputerNameBound() {
if (jCheckBoxComputerNameBound == null) {
jCheckBoxComputerNameBound = new JCheckBox();
jCheckBoxComputerNameBound.setText("Computer Name");
jCheckBoxComputerNameBound
.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
keyBoundChecked();
}
});
}
return jCheckBoxComputerNameBound;
}
COM: <s> this method initializes j check box computer name bound </s>
|
funcom_train/42877118 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void initSonglistHolder() {
logger.entering("de.axelwernicke.mypod.ipod.ITunesDB", "initSonglistHolder");
songlistHolder = new ITunesDBListHolder();
songlistHolder.setListType(ITunesDBListHolder.SONGLIST);
// revalidate size
this.recordSize += songlistHolder.getRecordSize();
logger.exiting("de.axelwernicke.mypod.ipod.ITunesDB", "initSonglistHolder");
}
COM: <s> initializes the songlist holder record of the database </s>
|
funcom_train/32612253 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isTripleSpaceService(AxisService service) {
boolean process = service.isEnableAllTransports();
if (process) {
return true;
} else {
List transports = service.getExposedTransports();
for (int i = 0; i < transports.size(); i++) {
if (Constants.transportName.equals(transports.get(i))) {
return true;
}
}
}
return false;
}
COM: <s> checks whether a service is exposed using the triplespace transport </s>
|
funcom_train/2295635 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void moveValue(boolean moveUp) {
Element e = getElement();
Element parent = e.getParent();
List siblings = parent.elements();
int idx = siblings.indexOf(e);
int newIdx = moveUp ? idx + 1 : idx - 1;
siblings.remove(idx);
siblings.add(newIdx, e);
}
COM: <s> moves this xml content element up or down in the xml document </s>
|
funcom_train/50556329 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String getFromParents(String s) {
if (!s.startsWith("this-")) {
Iterator it = myParents.iterator();
while (it.hasNext()) {
String parent = (String) it.next();
try {
Object o = getAttributes(parent).get(s);
if (o != null) {
return (String) o;
}
} catch (NullPointerException npe) {
System.err.println("NPE looking for " + parent);
}
}
}
return null;
}
COM: <s> tries to get a value from the parents to this object </s>
|
funcom_train/36003278 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String sendAMessage(final Serializable msg) throws JMSException {
QueueSender sender = _Session.createSender(_RequestQueue);
ObjectMessage tm = _Session.createObjectMessage(msg);
String correlationID = "ID:" + UUID.randomUUID().toString();
tm.setJMSCorrelationID(correlationID);
sender.send(tm);
sender.close();
return correlationID;
}
COM: <s> sends the jms message proper </s>
|
funcom_train/941746 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void shutDownISphere() throws ISphereException {
// Do the SOAP call
Object result = this.doSoapCall("shutDownISphere");
// Check that the result is a ProcessProxy
if (result != null) {
throw new ISphereException(this.getTarget() + ".shutDownISphere(): "
+ "Got a result, but wasn't expecting an"
+ "y.");
}
}
COM: <s> this function shutsdown the http server and isphere </s>
|
funcom_train/16912557 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int getWinningIndex() {
int winnerIndex = 0;
double max = Double.NEGATIVE_INFINITY;
for (int i = 0; i < getNeuronList().size(); i++) {
Neuron n = (Neuron) getNeuronList().get(i);
if (n.getWeightedInputs() > max) {
winnerIndex = i;
max = n.getWeightedInputs();
}
}
return winnerIndex;
}
COM: <s> returns the index of the input node with the greatest net input </s>
|
funcom_train/22093832 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void createDirs(String filename) throws IOException {
int pos = -1;
// look for the last directory separator in the filename
for (int i = filename.length() - 1; i >= 0; i--) {
if (filename.charAt(i) == File.separatorChar) {
pos = i;
i = -1;
}
}
File dir = new File(filename.substring(0, pos));
dir.mkdirs();
}
COM: <s> creates all directories that are needed to place the </s>
|
funcom_train/20400389 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object parse(String arg) throws ParseException {
BigInteger result = null;
try {
result = new BigInteger(arg);
} catch (NumberFormatException e) {
throw (
new ParseException(
"Unable to convert '" + arg + "' to a BigInteger.",
e));
}
return (result);
}
COM: <s> parses the specified argument into a big integer </s>
|
funcom_train/21288317 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int scoreBoardHelper(HashMap<Piece, Square> pieces) {
int score = 0;
boolean hasKing = false;
for(Piece piece:pieces.keySet()) {
if (piece.type == PieceType.KING) {
hasKing = true;
}
score += scorePiece(piece, pieces.get(piece));
}
if (!hasKing) {
return OPPONENT_WINS;
} else {
return score;
}
}
COM: <s> tallies up the score total for the pieces on the board </s>
|
funcom_train/943509 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeLabel() {
InstanceWorld iw = InstanceWorld.getCurrentInstanceWorld();
List quads = Util.toList(iw.getMatchingQuads(null, this.getURI(),
RdfsURI.LABEL, null, false));
for (Iterator it = quads.iterator(); it.hasNext();) {
Quad quad = (Quad) it.next();
iw.removeQuad(quad);
}
}
COM: <s> remove all labels attached to this there should only be one </s>
|
funcom_train/21633649 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void loadCookies(final URLConnection http) {
String str;
int n = 1;
do {
str = http.getHeaderFieldKey(n);
if ((str != null) && str.equalsIgnoreCase("Set-Cookie")) {
str = http.getHeaderField(n);
final StringTokenizer tok = new StringTokenizer(str, "=");
final String name = tok.nextToken();
final String value = tok.nextToken();
this.map.put(name, value);
}
n++;
} while (str != null);
}
COM: <s> load any cookies from the specified urlconnection object </s>
|
funcom_train/28993554 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void getContents(Vector contents, User user) {
ContentNode root = getPortalMediator().getPortal().getRootNode();
if (root != null) {
Vector workingCopy = new Vector();
workingCopy.add(root);
getContentsHelper(contents, workingCopy, user);
}
}
COM: <s> returns a per level sorted list of content nodes belonging to this portal </s>
|
funcom_train/51295098 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addListeners() {
cbSelLang.addActionListener(new ActionListener() {
/**
* ComboBox action
*/
public void actionPerformed(ActionEvent e) {
int choise = cbSelLang.getSelectedIndex();
switch (choise) {
case 0:
LanguageClass.setLocale("en", "US");
break;
case 1:
LanguageClass.setLocale("ru", "RU");
break;
default:
LanguageClass.setLocale("en", "US");
break;
}
lbLan.setText(LanguageClass
.getValue("settings.language.choose"));
}
});
}
COM: <s> add listeners for language selection combo box gotta call after </s>
|
funcom_train/3412870 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setDataElements(int x, int y, int w, int h, Object inData) {
sampleModel.setDataElements(x-sampleModelTranslateX,
y-sampleModelTranslateY,
w,h,inData,dataBuffer);
}
COM: <s> sets the data for a rectangle of pixels from a </s>
|
funcom_train/12813543 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isProductValid(Product product) {
/*
* The product validation should only concern the filename and the presence of
* requested keywords but not the mapping
* T
*/
// for( String comp: name_components) {
// if (comp.equals("FILENAME") == false && product.hasValuedKW(comp)) {
// Messenger.printMsg(Messenger.WARNING, "Attribute <" + comp + " requested to build the instance name has not been found");
// }
// }
return true;
}
COM: <s> this default method validates the mapping of the product in parameter </s>
|
funcom_train/22387256 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: static public String stringify(ZZCell inStream) {
ZZCell hd = inStream.h("d.nile");
Nile1View n1v = new Nile1View();
n1v.init__zob();
String s = "";
ZZCell tail = Nile2Iter.findStruct(hd, 1, false);
while(hd != null) {
FText ft = n1v.paragraph(hd, tail, null, null, null);
ft.capitalize();
s = s + FText.Part.join(ft.parts);
hd = tail;
if(hd != null) tail = Nile2Iter.findStruct(hd, 1, false);
s = s + "\n\n";
}
return s;
}
COM: <s> get a whole nile stream as a string properly capitalized </s>
|
funcom_train/4802637 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Cookie getCookie(String key) {
Cookie ret = null;
Cookie cookArr[] = getCurrentRequest().getCookies();
if (cookArr != null) {
for (int i = 0; i < cookArr.length; i++) {
if (cookArr[i].getName().equals(key)) {
ret = cookArr[i];
break;
}
}
}
return ret;
}
COM: <s> return the text of the request referer if available else null </s>
|
funcom_train/25141813 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testBug5032() throws Exception {
if (versionMeetsMinimum(4, 1)) {
createTable("testBug5032", "(field1 BIT)");
this.stmt.executeUpdate("INSERT INTO testBug5032 VALUES (1)");
this.pstmt = this.conn
.prepareStatement("SELECT field1 FROM testBug5032");
this.rs = this.pstmt.executeQuery();
assertTrue(this.rs.next());
assertTrue(this.rs.getObject(1) instanceof Boolean);
}
}
COM: <s> tests fix for bug 5032 result set </s>
|
funcom_train/15626942 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getTitle(@NotNull final MapFile<G, A, R> mapFile) {
final String name = mapFile.getFile().getName();
final MapControl<G, A, R> mapControl = mapFile.getPickmap();
final boolean modified = mapControl != null && mapControl.getMapModel().isModified();
return modified ? name + " *" : name;
}
COM: <s> returns the title of a pickmap to use as the tab name </s>
|
funcom_train/43282742 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public List getChildren() {
List children = super.getChildren();
int offSet = 0;
if (getKeyWrapper() != null) {
offSet = 1;
}
if (children.size() == offSet) {
// create entries for all languages
Iterator it = Language.VALUES.iterator();
while (it.hasNext()) {
Value value = newValue();
value.setLanguage((Language) it.next());
addValue(value);
}
}
return children;
}
COM: <s> get child model parts </s>
|
funcom_train/8569806 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void drawSomeLines (GL gl) {
gl.glBegin (GL.GL_LINES);
gl.glVertex2i (50, 200);
gl.glVertex2i (75, 250);
// same thing, but over ten pixels to the right
gl.glVertex2i (60, 200);
gl.glVertex2i (85, 250);
gl.glEnd();
}
COM: <s> an example of drawing lines </s>
|
funcom_train/42795397 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public PointF addCommands(PDFPage cmds, Matrix transform, int mode) {
if (shape != null) {
Path outline= new Path();
shape.transform(transform, outline);
cmds.addCommand(new PDFShapeCmd(outline, mode));
} else if (page != null) {
cmds.addCommands(page, transform);
}
return advance;
}
COM: <s> add commands for this glyph to a page </s>
|
funcom_train/35830015 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void clear(GL2 gl) {
gl.glClearColor(bgColor.r, bgColor.g, bgColor.b, bgColor.a); // clear with background
gl.glClearDepth(1);
gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
}
COM: <s> clear the color and depth buffer </s>
|
funcom_train/3790659 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Enumeration getPathEnumDestFirst() {
if( this.isComplete()) {
if( _pathVector.firstElement().equals(_dest))
return _pathVector.elements();
else {
return this.getPathEnumReversed();
}
} else {
Vector v = new Vector();
v.add(_dest);
return v.elements();
}
}
COM: <s> enumeration of path place objects with destination path place first </s>
|
funcom_train/46504506 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JTextPane getJTextPaneAbout() {
if (jTextPaneAbout == null) {
jTextPaneAbout = new JTextPane();
// jTextPaneAbout.setLineWrap(true);
// jTextPaneAbout.setWrapStyleWord(true);
jTextPaneAbout.setEditable(false);
jTextPaneAbout.setFont(new Font("Monospaced", Font.PLAIN,12));
}
return jTextPaneAbout;
}
COM: <s> this method initializes j text pane about </s>
|
funcom_train/37089431 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean renderSphereOk(int diameter, int x, int y, int z) {
switch (diameter) {
case 1: // just a pixel
plotPixelClipped(argbCurrent, x, y, z);
return false;
case 0: // no diameter - nothing
return false;
}
if (diameter <= (antialiasThisFrame ? Sphere3D.maxSphereDiameter2
: Sphere3D.maxSphereDiameter)) return true;
return false;
}
COM: <s> check if ok to render sphere </s>
|
funcom_train/7423198 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Document transformProcess(Pool pool, Output output) {
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
documentBuilderFactory.setNamespaceAware(true);
documentBuilderFactory.setValidating(false);
DocumentBuilder builder;
try {
builder = documentBuilderFactory.newDocumentBuilder();
Document process = builder.newDocument();
Element processElement = createProcessElement(process, pool, output);
process.appendChild(processElement);
return process;
} catch (ParserConfigurationException e) {
output.addError(e);
}
return null;
}
COM: <s> transforms the process contained in the given </s>
|
funcom_train/24531980 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isOnDemand() {
// We're currently only storing a lastQualifier if not onDemand. We only need it then. So we're using
// that as a flag to determine if onDemand. If in the future we need the lastQualifier even when onDemand,
// then we will need to add a boolean field for this.
return lastQualifier == null;
}
COM: <s> is this an on demand entry </s>
|
funcom_train/16269455 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void fullVoiceFrameRcvd(long stamp) {
_stampTopWord = stamp & 0xffff0000;
Log.debug("New timestamp top bits are " + _stampTopWord);
if ( (_audio != null) && (!_recvdFirstAudioFrame)) {
_recvdFirstAudioFrame = true;
_audio.stopRinging();
}
}
COM: <s> notifies us that a voice full frame has been received </s>
|
funcom_train/18345721 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Set getDuplicateFKConcepts() {
Set retval = new HashSet();
Set check = new HashSet();
Iterator iterator = getFKConceptRelSet().iterator();
while (iterator.hasNext()) {
ProtoConceptRel protoConceptRel =
(ProtoConceptRel) iterator.next();
ProtoConcept parent =
protoConceptRel.getParentConcept();
if (check.contains(parent)) {
retval.add(parent);
}
check.add(parent);
}
return retval;
}
COM: <s> return the set of fk concepts which are duplicates </s>
|
funcom_train/35832111 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object pop() throws EmptyContainerException{
if (isEmpty())
throw new EmptyContainerException("No more elements :-( ");
/*if (((top-1) == 2)||((top-1)*4 == capacity)){ //the capacity here is 10, and its not divisble by 4 so...
Object[] temp = new Object[capacity];
System.arraycopy(stack,0,temp,0,capacity);
capacity /= 2;
stack = new Object[capacity];
System.arraycopy(temp,0,stack,0,capacity);
}*/
Object temp = top();
top--;
stack[top] = null;
return temp;
}
COM: <s> removes the top object </s>
|
funcom_train/13514857 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean doRedo(byte[] page) throws ChaiDBException {
/* redo move a data function */
try {
System.arraycopy(data, 0, page, destOffset, dataSize);
} catch (Exception e) {
logger.debug(e);
throw new ChaiDBException(ErrorCode.LOG_REDO_FAILED, e.toString());
}
return true;
}
COM: <s> do redo function </s>
|
funcom_train/18744955 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void parse(String parameter) {
String extension = ExtensionFilter.SEPARATOR + parameter;
// first check if parameter is a valid format name
if (!getExporter().getExtensions().contains(extension)) {
throw new IllegalArgumentException("Unknown format: "
+ parameter);
}
setImageFormat(extension);
}
COM: <s> changes the current output format of the imager if the parameter is </s>
|
funcom_train/43432019 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isOrientationPossible(String orientationToTest) {
boolean isPossible = false;
ComponentOrientation originalOrientation = orientation;
setOrientationByString(orientationToTest);
Rectangle spaceRequired = getRequiredSpace();
if ((TrackLayout.detectOverlap(spaceRequired, this))
|| (TrackLayout.detectMarginIncursion(spaceRequired) != marginType.NONE)) {
isPossible = false;
} else {
isPossible = true;
}
orientation = originalOrientation;
return isPossible;
}
COM: <s> determines whether or not a given orientation will cause overlapping </s>
|
funcom_train/8037603 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void startTransaction(int idertifier){
//Get price
DrinksStore drinksStore =(DrinksStore)storeCtrl.getStore(Store.DRINK);
DrinksStoreItem drinksStoreItem = (DrinksStoreItem)drinksStore.getStoreItem(idertifier);
DrinksBrand drinksBrand = (DrinksBrand)drinksStoreItem.getContent();
this.price = drinksBrand.getPrice();
this.selection = idertifier;
changeGiver.resetChange();
dispenseCtrl.resetCan();
changeGiver.displayChangeStatus();
dispenseCtrl.allowSelection(false);
coinReceive.startReceive();
}
COM: <s> this operation will start the customer transaction </s>
|
funcom_train/14359626 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Object resolve(long val) {
Object result = null;
switch (outputFomrmat) {
case HEX_FORMAT:
result = "0x" + Long.toHexString(val);
break;
case OCTAL_FORMAT:
result = Long.toOctalString(val);
break;
case BINARY_FORMAT:
result = Long.toBinaryString(val);
break;
case DECIMAL_FORMAT:
switch (bytesize) {
case BYTE_SIZE:
result = new Short((short) val);
break;
case SHORT_SIZE:
result = new Integer((int) val);
break;
case INT_SIZE:
result = new Integer((int) val);
break;
case LONG_SIZE:
result = new Long(val);
break;
}
break;
}
return result;
}
COM: <s> resolves the value into an output format </s>
|
funcom_train/12301176 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ResultSet executeQuery(String sql) throws DatabaseException {
try {
log.debug("Execute query " + sql);
return getConnection().createStatement().executeQuery(sql);
} catch (SQLException e) {
throw new DatabaseException("Cannot execute query statement.", e);
}
}
COM: <s> execute sql query </s>
|
funcom_train/24285198 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void launchConfigPanel(boolean visible) {
if (configFrame == null) {
configFrame = new JFrame("Configuration");
configFrame.add(new ConfigPanel(this));
configFrame.pack();
Dimension dim = configFrame.getSize();
configFrame.setLocation(mouseX - dim.width, mouseY-dim.height);
}
configFrame.setVisible(visible);
};
COM: <s> launch a panel allowing the user to change </s>
|
funcom_train/22896131 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void setReturnValue(Object value) {
if (this.hasReturnValue()) {
this.returnValue = value;
returnValueAvailable = true;
} else {
throw IllegalStateException(__me + ".setReturnValue(): " +
"operand \"" + this.name + "\" (" + pos2str(this) +
") provides no return value, so none can be set!");
}
}
COM: <s> set the return object of this operand </s>
|
funcom_train/1600976 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setException(Exception e){
//build message
String dialog = e+"\n\n";
StackTraceElement[] trace = e.getStackTrace();
for(int i=0;i<trace.length;i++)
dialog += " " + trace[i] + "\n";
//dialog
setMessage("Internal error caught.", dialog);
}
COM: <s> set a new exception </s>
|
funcom_train/6439523 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int doEndTag() throws JspTagException {
try {
pageContext.getOut().write(URLBuilder.getControllerUrl(site, state, action, parameters));
} catch(Exception e) {
throw new JspTagException("Exception inside tag: " + e.getMessage());
}
return EVAL_PAGE;
}
COM: <s> constructs the url </s>
|
funcom_train/3176832 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeEdge(EditableEdge edge) {
if (!edges.remove(edge))
throw new IllegalArgumentException("remove on non-graph edge");
EditableVertex
start = edge.getStart(),
end = edge.getEnd();
start.removeEdge(edge);
end .removeEdge(edge);
edges.remove(edge);
}
COM: <s> remove an edge </s>
|
funcom_train/9877968 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void actionPerformed(java.awt.event.ActionEvent actionEvent) {
String command = actionEvent.getActionCommand();
if (command.equals("cancel-command")) {
System.out.println("abort execution");
stop = true;
if(algorithm!= null)
algorithm.abort();
logger.dispose();
}
}
COM: <s> handles algorithm events </s>
|
funcom_train/31093248 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testIsCommitted() throws Exception {
ServletRunner sr = new ServletRunner();
WebRequest request = new GetMethodWebRequest(
"http://localhost/servlet/" + CheckIsCommittedServlet.class.getName() );
WebResponse response = sr.getResponse( request );
assertTrue( "The response should be committed", CheckIsCommittedServlet.isCommitted );
}
COM: <s> test bug report 1534234 http servlet response </s>
|
funcom_train/13980425 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void close () {
this.interrupt();
System.out.println(this + " Interrupted. Closing...");
try {
if (serverSocket != null)
serverSocket.close();
System.out.println(this + " Listening has been stopped. ServerSocket is closed...");
} catch (IOException e) {
System.out.println(this + " Error at closing ServerSocket: " + e.getMessage());
}
System.out.println(this + " Closing done.");
}
COM: <s> closes this handler </s>
|
funcom_train/3176915 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean animate(double index) {
boolean done = true;
synchronized (graph) {
// loop moves
for (int m=0;m<motions.length;m++) {
Motion motion = motions[m];
// do the move
done &= motion.animate(index);
}
}
// done
return done;
}
COM: <s> performing one step in the animation </s>
|
funcom_train/45951960 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void remove(HttpServletRequest request, HttpServletResponse response, String id) {
// First, remove it from the session:
HttpSession session = request.getSession();
session.removeAttribute(id);
// Invalidate the cookie by setting a null expired cookie in its place
Cookie cookie = new Cookie(id, null);
cookie.setMaxAge(0);
cookie.setPath("/");
response.addCookie(cookie);
}
COM: <s> removes a user stored value </s>
|
funcom_train/815821 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void update(Collection valueObjectsCollection, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass) throws BusinessObjectException{
update( valueObjectsCollection, valueObjectKeyAttributeName, valueObjectValueAttributeName, mapValueClassAttributeToSetName, mapValueClass, Boolean.TRUE);
}
COM: <s> this method adds new entries to this map or update the existing ones </s>
|
funcom_train/23998232 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void spawn( Vec2dFloat pos, Vec2dFloat vel, float lifespan ) {
if ( sceneNode == null )
return;
dead = false;
lifeSpan = lifespan;
lifeTimer = 0.0f;
velocity = vel;
position = pos;
sceneNode.setPosition( ( int )position.x, ( int )position.y );
//Log.verbose( "spawn " + position.toString() );
parentNode.addChild( sceneNode );
}
COM: <s> spawn a new projectile </s>
|
funcom_train/49247119 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void init(String url, String user, String pass) {
error = null;
try {
Class.forName("org.postgresql.Driver");
this.con = DriverManager.getConnection(url, user, pass);
} catch (Exception err) {
error(err, err);
}
}
COM: <s> connects to the database </s>
|
funcom_train/18745427 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean addEdge(E edge) throws IllegalArgumentException {
E oldEdge = this.edgeStore.put(edge);
if (oldEdge != null && oldEdge != edge) {
throw new IllegalArgumentException(String.format(
"Duplicate edges %s", edge));
}
return oldEdge == null;
}
COM: <s> adds a given edge to the edges known to this store </s>
|
funcom_train/1539454 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isUnit() {
int i = 0;
for ( ArrayList<C> val : matrix ) {
int j = 0;
for ( C el : val ) {
if ( i == j ) {
if ( !el.isUnit() ) {
return false;
}
} else {
if ( !el.isZERO() ) {
return false;
}
}
j++;
}
i++;
}
return true;
}
COM: <s> test if this is a unit </s>
|
funcom_train/47434087 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public List preceding(EObject object) {
List result = new ArrayList();
List ancestors = ancestor(object);
ancestors.add(object);
// now return all preceding siblings and their respective children...
Iterator it = ancestors.iterator();
while (it.hasNext()) {
EObject parent = (EObject) it.next();
if (parent != object)
result.add(parent);
result.addAll(precedingSibling(parent));
Iterator it2 = precedingSibling(parent).iterator();
while (it2.hasNext()) {
result.addAll(descendant((EObject) it2.next()));
}
}
return result;
}
COM: <s> same meaning as the preceding axe in xpath selects everything in the </s>
|
funcom_train/17095958 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getMethodName(String signature) {
int index1 = signature.lastIndexOf((int)'.') + 1;
int index2 = signature.lastIndexOf((int)'(');
if (index1 >= 0) {
if (index2 >= 0) {
return signature.substring(index1, index2);
} else {
return signature.substring(index1);
}
}
throw new RuntimeException("Can't find a class name for [" + signature + "]");
}
COM: <s> especially to create a description of a call </s>
|
funcom_train/14157015 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void appendToElement(StructuredDocument doc, Element el) {
Element e, e2;
e = doc.createElement(ROOT_XML_TAG);
el.appendChild(e);
e2 = doc.createElement(peerIDTag, id);
e.appendChild(e2);
e2 = doc.createElement(valueTag, "" + value);
e.appendChild(e2);
}
COM: <s> append an xml representation of this clock element to another </s>
|
funcom_train/44869646 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private WCMDrawGeometricBean getMaxBox() {
if (maxBox == null) {
maxBox = new WCMDrawGeometricBean();
maxBox.setFillColor(new Color(120, 120, 120));
maxBox.setShape(WCMDrawGeometricBean.RECT_ABSOLUTE);
maxBox.setX1(getAInput());
maxBox.setY1(new Constant(0));
maxBox.setY2(getMaxF());
maxBox.setX2(getBInput());
}
return maxBox;
}
COM: <s> this method initializes max box </s>
|
funcom_train/41490311 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void saveTextToFile() throws Exception {
File root = Environment.getExternalStorageDirectory();
File file = new File(root, mEditTextSource.getText().toString());
file.createNewFile();
FileWriter fileWriter = new FileWriter(file);
BufferedWriter out = new BufferedWriter(fileWriter);
try {
out.write( mEditTextContent.getText().toString() );
}
finally {
out.close();
}
}
COM: <s> saves new text file to sd card </s>
|
funcom_train/7661318 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testTryAcquireNInSameThread_fair() {
Semaphore s = new Semaphore(2, true);
assertEquals(2, s.availablePermits());
assertTrue(s.tryAcquire(2));
assertEquals(0, s.availablePermits());
assertFalse(s.tryAcquire());
}
COM: <s> try acquire n succeeds when sufficient permits else fails </s>
|
funcom_train/18089033 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setupScreen() {
if (!screenSetup) {
screenSetup = true;
deleteAll();
setTitle("Server Configuration");
// Set the menu bar options.
setMenuText(UIManager.getTheme().getMenuTextForCancel(), "Ok");
tbHostname = new TextBox();
tbHostname.setLabel("Hostname");
append(tbHostname);
tbPort = new TextBox();
tbPort.setForNumericOnly();
tbPort.setLabel("Port");
append(tbPort);
tbFile = new TextBox();
tbFile.setLabel("URL");
append(tbFile);
getSettings();
invalidate();
}
}
COM: <s> setup all gui elements and populate the dialog with data </s>
|
funcom_train/40381813 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public PlaceRequest with( String name, String value ) {
// Note: Copying everything to a new PlaceRequest is slightly
// less efficient than modifying the current request, but
// it reduces unexpected side-effects. Moreover, it lets
// us instantiate the parameter map only when needed.
// (See the PlaceRequest constructors.)
return new PlaceRequest( this, name, value );
}
COM: <s> returns a new instance of the request with the specified parameter name </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.