__key__ stringlengths 16 21 | __url__ stringclasses 1 value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/16912121 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Color getColor() {
JColorChooser colorChooser = new JColorChooser();
Color theColor = JColorChooser.showDialog(this, "Choose Color",
colorIndicator.getBackground());
colorChooser.setLocation(200, 200); // Set location of color chooser
return theColor;
}
COM: <s> show the color pallette and get a color </s>
|
funcom_train/10446105 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setPattern(String pattern) {
if (pattern == null)
this.pattern = "";
else if (pattern.equals(Constants.AccessLog.COMMON_ALIAS))
this.pattern = Constants.AccessLog.COMMON_PATTERN;
else if (pattern.equals(Constants.AccessLog.COMBINED_ALIAS))
this.pattern = Constants.AccessLog.COMBINED_PATTERN;
else
this.pattern = pattern;
logElements = createLogElements();
}
COM: <s> set the format pattern first translating any recognized alias </s>
|
funcom_train/36473988 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createTextBox() {
String currentText = this.isPassword ? this.passwordText : this.text;
this.midpTextBox = new javax.microedition.lcdui.TextBox( this.title, currentText, this.maxSize, this.constraints );
this.midpTextBox.addCommand(StyleSheet.OK_CMD);
if (!this.isUneditable) {
this.midpTextBox.addCommand(StyleSheet.CANCEL_CMD);
}
this.midpTextBox.setCommandListener( this );
}
COM: <s> creates the text box used for the actual input mode </s>
|
funcom_train/19100894 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JSplitPane getSplitPane() {
if (splitPane == null) {
try {
splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
splitPane.add(getDrawingScroll(), "left");
splitPane.add(getStatesPanel(), "right");
splitPane.setDividerLocation(0.66);
splitPane.setResizeWeight(1.0);
} catch (Throwable ivjExc) {
handleException(ivjExc);
}
}
return splitPane;
}
COM: <s> return the split pane property value </s>
|
funcom_train/18256501 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Font getFont(float fontSize) {
Float f = new Float((float) java.lang.Math.round(fontSize));
Font font = (Font) fontMap.get(f);
if (font == null) {
font = baseFont.deriveFont(f.floatValue());
fontMap.put(f, font);
}
return font;
}
COM: <s> obtain a derived font creating one if need be </s>
|
funcom_train/4008832 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String login() throws Exception {
beginTransaction() ;
String key ;
try {
if (bean.login(login,password))
key = "login.accepted" ;
else{
key = "feedback" ;
setFeedback("Badlogin") ;
}
}
catch (Exception e) {
rollbackTransaction() ;
setFeedback("Badlogin") ;
return "feedback" ;
}
commitTransaction() ;
return key ;
}
COM: <s> this method is invoked when the user try to log in </s>
|
funcom_train/8073345 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int containedLength(CharSequence s, int startPos) {
if (isWord)
return (0);
if(s.length()<=startPos) return(-1);
Character c = s.charAt(startPos);
if (children.get(c) == null)
return (-1);
int subtreelength = children.get(c).containedLength(s, startPos + 1);
if (subtreelength == -1)
return (-1);
return (subtreelength + 1);
}
COM: <s> returns the length of the longest contained subsequence starting from </s>
|
funcom_train/4530399 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void disconnect(FTPClient client) throws IOException {
if (client != null) {
if (!client.isConnected()) {
throw new FTPException("Client not connected");
}
boolean logoutSuccess = client.logout();
client.disconnect();
if (!logoutSuccess) {
LOG.warn("Logout failed while disconnecting, error code - "
+ client.getReplyCode());
}
}
}
COM: <s> logout and disconnect the given ftpclient </s>
|
funcom_train/45934319 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String absoluteHomepageURL() {
String v = (String)this.valueForKey("url");
if (v == null) return null;
v = v.trim();
// TBD: improve
String p = UString.getURLProtocol(v);
if (p != null) return v;
return "http://" + v;
}
COM: <s> returns the url field of the contact but adds http if required </s>
|
funcom_train/3382855 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void notifyThreadBusy(final Thread thread) {
synchronized (activationLock) {
synchronized (mainLock) {
if (blockerThread == null) {
activateBlockerThread();
} else if (isReadyToShutdown()) {
mainLock.notifyAll();
timeoutPassed = false;
}
busyThreadSet.add(thread);
}
}
}
COM: <s> add a specified thread to the set of busy event dispatch threads </s>
|
funcom_train/1241688 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void writeFault(PrintWriter writer, AxisFault axisFault) {
String localizedMessage = XMLUtils.xmlEncodeString(axisFault.
getLocalizedMessage());
writer.println("<pre>Fault - " + localizedMessage + "<br>");
writer.println(axisFault.dumpToString());
writer.println("</pre>");
}
COM: <s> this method writes a fault out to an html stream </s>
|
funcom_train/5549343 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getFieldName(int fieldNum) {
int realFieldNum = fieldNum;
int modelIndex = 0;
while (realFieldNum>rlist[modelIndex].getFieldCount()) {
realFieldNum-=rlist[modelIndex].getFieldCount();
modelIndex++;
}
return rlist[modelIndex].getFieldName(realFieldNum);
}
COM: <s> returns the name of the column </s>
|
funcom_train/23841271 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public TreeObject addObject(Object child) {
TreeObject parentNode = null;
TreePath parentPath = theTree.getSelectionPath();
if (parentPath == null) {
parentNode = rootNode;
} else {
parentNode = (TreeObject)
(parentPath.getLastPathComponent());
}
return addObject(parentNode, child, true);
}
COM: <s> add child to the currently selected node </s>
|
funcom_train/37823280 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void replaceUntouched(List<Integer> replacement) {
// remove untouched nodes
List<Node> nodesToRemove = new LinkedList<Node>();
for (Node node: nodes)
for (int targetNode: getUntouched())
if (node.index == targetNode)
nodesToRemove.add(node);
List<Integer> oldUntouched = getUntouched();
nodes.removeAll(nodesToRemove);
// add replacement
addNodesSilently(replacement);
// notify observers
for (QueueObserver o: observers)
o.onUntouchedReplaced(oldUntouched, replacement);
}
COM: <s> deletes all untouched nodes and adds the specified nodes to the queue </s>
|
funcom_train/51344992 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void writeHtml(Writer w) throws IOException {
w.write("<html ");
if(doctype.isXML()) {
w.write(" xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\"");
}
w.write(" lang=\"en\"");
w.write("\n>");
}
COM: <s> the start code html code tag </s>
|
funcom_train/28352796 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void exportParameters( final java.io.Writer writer, final Map valueMap ) throws java.io.IOException {
QuadAgent.exportParameterHeader( writer );
exportParameters( writer, getNodeAgentsOfType( Quadrupole.s_strType ), valueMap );
RFCavityAgent.exportParameterHeader( writer );
exportParameters( writer, getNodeAgentsOfType( RfCavity.s_strType ), valueMap );
}
COM: <s> write the parameter values to the specified writer </s>
|
funcom_train/3004300 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void sendMessageToAllUsers(Message p_message) throws SendingException {
try {
p_message.setStringProperty(PROPERTY_NAME_USER, PROPERTY_VALUE_ALL_USERS);
_publisher.publish(p_message);
} catch (JMSException ex) {
logFatal("MessagingService.sendMessageToAllUsers : " + ex.toString());
throw new SendingException(ex.getLocalizedMessage());
}
}
COM: <s> sends the message to all users </s>
|
funcom_train/20898097 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Reference (String division){
this.division = division;
// Now, get the RegexPatterns Object for this division
patterns = (RegexPatterns) (RegexPatterns.patternHash.get(this.division));
if (patterns == null) {
patterns = new RegexPatterns();
patterns.compile();
}
compiler = patterns.getCompiler();
matcher = new Perl5Matcher();
this.category = RefType.REF_NOT_SET;
}
COM: <s> creates a new code reference code instance </s>
|
funcom_train/18640929 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setFullExpressionValue(String fullExpression, Object value) {
// 0. Get the context and the expression
String ctxName = getContextInFullExpression(fullExpression);
String expression = getExpressionInFullExpression(fullExpression);
// 2. If there's an expression, try to set its value
if (expression != null) {
setExpressionValue(getContext(ctxName), expression, value);
}
}
COM: <s> sets the new value of a given full expression </s>
|
funcom_train/43245019 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSetCity() {
System.out.println("setCity");
String city = "";
ZipCodeObject instance = new ZipCodeObject();
instance.setCity(city);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
COM: <s> test of set city method of class org </s>
|
funcom_train/43393482 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void error(String title, String message) {
printParams();
logger.log(Level.SEVERE, title + ": " + message);
//JOptionPane.showMessageDialog(this, message, title, JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(this, message.split(":")[1], title, JOptionPane.ERROR_MESSAGE);
}
COM: <s> prints a log message and display an error in a popup window </s>
|
funcom_train/2039862 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private TextView createChoosePanelLabel() {
TextView choosePanelInfo = new TextView(this);
choosePanelInfo.setPadding(10, 5, 0, 5);
choosePanelInfo.setText("Choose Panel Identity:");
choosePanelInfo.setBackgroundColor(Color.DKGRAY);
return choosePanelInfo;
}
COM: <s> creates the choose panel identity text </s>
|
funcom_train/42478299 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ByteBuffer getSyncMessage() {
throw new NotSynchronizedException("sorry, autosync not implemented yet");
/*
// Perform local synchronization, because this HeaderHandler is the sync source.
// This will build the internal data structures.
synchronize(null);
// Build packet
byte bPacket[] = {syncID};
// TODO add information to indicate the java type used to store message types
// TODO add information about the registered types
return ByteBuffer.wrap(bPacket);
*/
}
COM: <s> constructs a synchronization message ready to be sent over wire </s>
|
funcom_train/4805277 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean trigger(String namespace, String name, String parent) {
// iterate triggers
Iterator i = triggers.iterator();
while (i.hasNext()) {
Trigger t = (Trigger)i.next();
if ((t.namespace.equals(namespace) && t.elementNames.contains(name) && !t.elementNames.contains(parent))) {
return true;
}
}
return false;
}
COM: <s> checks if a trigger matches </s>
|
funcom_train/43244990 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testValidateConnectionInfo() throws Exception {
System.out.println("validateConnectionInfo");
ConnectionManager instance = new ConnectionManager();
instance.validateConnectionInfo();
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
COM: <s> test of validate connection info method of class org </s>
|
funcom_train/46459233 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public XMLControl getChildControl(String name) {
XMLControl[] children = getChildControls();
for(int i = 0;i<children.length;i++) {
if(children[i].getPropertyName().equals(name)) {
return children[i];
}
}
return null;
}
COM: <s> gets the named xmlcontrol child of this property </s>
|
funcom_train/46523764 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void drawRectangleOutline(int x, int y, int w, int h, Color color, int width) {
Shape s = new Rectangle2D.Float((float)x,(float)y,(float)w,(float)h);
drawShape(s, color, width);
}
COM: <s> draw outline of a rectangle with a color </s>
|
funcom_train/40722799 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void registerFieldInfo(FieldInfo<?> field) {
String name = field.getName();
List<FieldInfo<?>> fields = getFieldInfo(name);
if (fields == null) {
fields = new ArrayList<FieldInfo<?>>();
fFieldInfoMap.put(name, fields);
}
fields.add(field);
}
COM: <s> adds the given field info object to the internal map </s>
|
funcom_train/43245734 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSetInsuredDateOfBirth() {
System.out.println("setInsuredDateOfBirth");
Calendar insuredDateOfBirth = null;
InsuranceDG1Object instance = new InsuranceDG1Object();
instance.setInsuredDateOfBirth(insuredDateOfBirth);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
COM: <s> test of set insured date of birth method of class org </s>
|
funcom_train/46321279 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public float getSlope() {
// Calculate the value of this neuron if it needs updating.
if ( needsUpdating == true ) {
calcValue();
updateGradient = true;
needsUpdating = false;
}
// Update the gradient if needed.
if ( updateGradient == true ) {
// Calculate the gradient of this neuron's acitvation function.
gradient = value * (1F - value);
updateGradient = false;
}
// Return the gradient dr/dq of this neuron.
return gradient;
}
COM: <s> returns the gradient of this node or neurons activation </s>
|
funcom_train/20904725 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JTextArea getTxtDesc() {
if (txtDesc == null) {
txtDesc = new JTextArea(appDesc);
txtDesc.setWrapStyleWord(true);
txtDesc.setLineWrap(true);
txtDesc.setEditable(false);
txtDesc.setRows(4);
txtDesc.setFont(new Font("Courier New", Font.PLAIN, 12));
txtDesc.setBackground(new JLabel().getBackground());
}
return txtDesc;
}
COM: <s> this method initializes txt desc </s>
|
funcom_train/18473496 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void swapAxes() {
QueryAxis[] queryAxes = parsedQuery.getAxes();
if (queryAxes.length >= 2) {
Exp exp = queryAxes[0].getExp();
queryAxes[0].setExp(queryAxes[1].getExp());
queryAxes[1].setExp(exp);
}
}
COM: <s> swap axes in parsed query </s>
|
funcom_train/28878362 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void connectionChanged() {
try {
ph.setInputStream(new GenericInputStream(this.getApplication(),this.getSocket().getInputStream()));
ph.setOutputStream(new GenericOutputStream(this.getApplication(),this.getSocket().getOutputStream()));
} catch (IOException e) {
e.printStackTrace();
}
}
COM: <s> called when the connection to socke has been changed </s>
|
funcom_train/51413355 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void refreshWFBox() {
Object selItem = cbWorkflows.getSelectedItem();
cbWorkflows.removeAllItems();
Row[] wfRows = TableCompiereWorkflow.getTable().getAllRows();
for(int i=0; i<wfRows.length; i++) {
cbWorkflows.addItem(wfRows[i]);
}
if(selItem != null)
cbWorkflows.setSelectedItem(selItem);
else if(cbWorkflows.getItemCount() > 0)
cbWorkflows.setSelectedIndex(0);
}
COM: <s> refreshes the box of available workflows </s>
|
funcom_train/8362959 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void releaseDBConnections() {
Iterator iterator = dbPool.values().iterator();
while (iterator.hasNext()) {
Connection conn = (Connection) iterator.next();
if (conn != null) {
try {
conn.close();
} catch (SQLException e) {
throw new DatabaseException(e);
}
}
}
}
COM: <s> releases all db connections from the pool </s>
|
funcom_train/4230839 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void weightedMedian(int iteration, JGraphHierarchyModel model) {
// Reverse sweep direction each time through this method
boolean downwardSweep = (iteration % 2 == 0);
if (downwardSweep) {
for (int j = model.maxRank - 1; j >= 0; j--) {
medianRank(j, downwardSweep);
}
} else {
for (int j = 1; j < model.maxRank; j++) {
medianRank(j, downwardSweep);
}
}
}
COM: <s> sweeps up or down the layout attempting to minimise the median placement </s>
|
funcom_train/50688502 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void sendErrorXml() throws IOException {
LOGGER.log(Level.INFO, "Errors Status Code: " + this.tempStatusCode);
this.response.setStatus(this.tempStatusCode);
Writer writer = this.response.getWriter();
writer.write("<error>\n");
writer.write(" <statusCode>");
writer.write(String.valueOf(this.tempStatusCode));
writer.write("</statusCode>\n");
writer.write(" <message>\n");
writer.write(" ");
writer.write(this.tempErrorMessage);
writer.write("\n");
writer.write(" </message>\n");
writer.write("</error>");
writer.flush();
}
COM: <s> called by the commit method </s>
|
funcom_train/19977145 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean equalTo(User n) {
if ((n).__getCName().equals(this.__getCName()) && (n).__getIDS().intValue() == this.__getIDS().intValue()) {
return true;
} else {
return false;
}
}
COM: <s> if the usernames ids match return true </s>
|
funcom_train/10204892 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addUpperBoundPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_MTypedElement_upperBound_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_MTypedElement_upperBound_feature", "_UI_MTypedElement_type"),
ClassDiagramPackage.Literals.MTYPED_ELEMENT__UPPER_BOUND,
true,
false,
false,
ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the upper bound feature </s>
|
funcom_train/5669419 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void _print() {
PrinterJob job = PrinterJob.getPrinterJob();
job.setPrintable(plot);
if (job.printDialog()) {
try {
job.print();
} catch (Exception ex) {
JOptionPane.showMessageDialog(this,
"Printing failed:\n" + ex.toString(),
"Print Error", JOptionPane.WARNING_MESSAGE);
}
}
}
COM: <s> print the plot </s>
|
funcom_train/13874396 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addReferredVariablePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_VariableExp_referredVariable_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_VariableExp_referredVariable_feature", "_UI_VariableExp_type"),
EssentialoclPackage.Literals.VARIABLE_EXP__REFERRED_VARIABLE,
true,
false,
true,
null,
null,
null));
}
COM: <s> this adds a property descriptor for the referred variable feature </s>
|
funcom_train/15407647 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private SqlUpdate deleteById(Object id) {
DefaultSqlUpdate sqlDelete = new DefaultSqlUpdate(deleteByIdSql);
Object[] bindValues = idBinder.getBindValues(id);
for (int i = 0; i < bindValues.length; i++) {
sqlDelete.addParameter(bindValues[i]);
}
return sqlDelete;
}
COM: <s> return sql that can be used to delete by id without any optimistic </s>
|
funcom_train/1849115 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getVersionAsString(String url, String version, Request request) {
GoGoDebug.get("fine").println("Get version as string for {0}", url);
Request riap = new InternalRequest(request, Method.GET, "riap://host/admin/revisions" + url + "/" + version,
null);
Response resp = getContext().getClientDispatcher().handle(riap);
try {
return resp.getEntity().getText();
} catch (Exception e) {
return null;
}
}
COM: <s> gets a string representation of a version of a file </s>
|
funcom_train/49788947 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean notExtendingGeneratedPrimaryKey(DomainAttribute attr) {
if (attr.isPrimaryKey() && attr.isIsGenerated()) {
return false;
}
for (ExtendsEdge w : attr.getOutExtendsEdges()) {
if (w.getTo() instanceof DomainAttribute) {
if (!notExtendingGeneratedPrimaryKey((DomainAttribute) w.getTo())) {
// we are extending a generated primary key
return false;
}
}
}
return true;
}
COM: <s> for a domain attribute this returns true if it eventually </s>
|
funcom_train/1653709 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testAddChild_StringStringString() {
HTMLNode methodHTMLNode = new HTMLNode(SAMPLE_OKAY_NODE_NAME);
methodHTMLNode.addChild(SAMPLE_OKAY_NODE_NAME,
SAMPLE_OKAY_ATTRIBUTE_NAME, SAMPLE_ATTRIBUTE_VALUE);
List<HTMLNode> childrenList = methodHTMLNode.children;
assertEquals(1,childrenList.size());
assertEquals(generateNoContentNodeOutput(SAMPLE_OKAY_NODE_NAME,
SAMPLE_OKAY_ATTRIBUTE_NAME,SAMPLE_ATTRIBUTE_VALUE),
childrenList.get(0).generate());
}
COM: <s> tests add children string string string method </s>
|
funcom_train/3391448 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void writeMemberSummaryHeader(ClassDoc classDoc) {
printedSummaryHeader = true;
writer.println();
writer.println("<!-- ========== METHOD SUMMARY =========== -->");
writer.println();
writer.printSummaryHeader(this, classDoc);
}
COM: <s> write the methods summary header for the given class </s>
|
funcom_train/35949814 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void registerChannel(Channel aChannel) {
if (aChannel.isSystemChannel()) {
mSystemChannels.put(aChannel.getId(), aChannel);
} else if (aChannel.isPrivateChannel()) {
mPrivateChannels.put(aChannel.getId(), aChannel);
} else {
mPublicChannels.put(aChannel.getId(), aChannel);
}
if (usePersistentStore) {
mChannelStore.storeChannel(aChannel);
}
}
COM: <s> register the given channel to the list of channels maintained by the </s>
|
funcom_train/51246036 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setSql(SqlTabData sql) {
final String sqlString = sql.getTabText();
editor.setSql(sqlString.trim());
if (editor instanceof PreparedStatementEditor) {
PreparedStatementEditor pe = (PreparedStatementEditor) editor;
pe.setParameters(sql.getParameters());
}
}
COM: <s> sets the data for this tab </s>
|
funcom_train/22606904 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public CacheEntry establishEntry(Descriptor des) {
if (des.getInformation() == null) {
throw new CacheException("unable to define descriptor in cache");
}
FileCacheEntry entry = establishEntry(des.getInformation().getDefaultVendor(), des.getInformation().getDefaultTitle());
if (entry != null) {
entry.setDescriptor(des);
}
return entry;
}
COM: <s> this returns a cache entry instance for the supplied descriptor </s>
|
funcom_train/5800672 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int exec(String command) throws IOException, InterruptedException {
StringWriter swOut = new StringWriter();
PrintWriter pwOut = new PrintWriter(swOut, true);
StringWriter swErr = new StringWriter();
PrintWriter pwErr = new PrintWriter(swErr, true);
int rc = exec(command, pwOut, pwErr);
out = swOut.toString();
err = swErr.toString();
return rc;
}
COM: <s> the b exec string b method runs a process inside of a watched </s>
|
funcom_train/31729362 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String formatDate(Date d) {
if(date_template==null) return d.toString();
else {
Object[] args = {d};
ArrayList text = date_template.getText(args);
if(text==null) return "";
String date = (String)text.get(0);
int start = 0;
while(!Character.isLetterOrDigit(date.charAt(start))) start++;
return date.substring(start);
}
}
COM: <s> create a string representation of a date </s>
|
funcom_train/10278397 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public StandaloneComponent getPage() {
Component parent = getParent();
if (parent == null) {
if (!(this instanceof StandaloneComponent))
return AbstractEngine.getCurrentServer().getpage();
return (StandaloneComponent)this;
}
while (parent.getParent() != null) {
parent = parent.getParent();
}
return (StandaloneComponent) parent;
}
COM: <s> returns the surrounding page where this component lives </s>
|
funcom_train/32635999 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void save() {
Session hibernateSession = HibernateController.instance().createSession();
Transaction tx = null;
try {
tx = hibernateSession.beginTransaction();
hibernateSession.save(this);
tx.commit();
// Clean up the session.
hibernateSession.close();
} catch (HibernateException e) {
//e.printStackTrace();
try {
tx.rollback();
} catch (Exception e2) {
// Silent failure.
} finally {
try {
if (hibernateSession != null)
hibernateSession.close();
} catch (Exception e3) {
// Silent failure.
}
}
}
}
COM: <s> saves this volunteer to the database </s>
|
funcom_train/29391486 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean process(String aUnit) {
//LOG.debug("Processing unit = " + aUnit);
try {
xpp.setInput( new StringReader (aUnit) );
this.processDocument();
return true;
} catch (XmlPullParserException ex) {
LOG.fatal("Xml pull parsing exception.");
LOG.fatal(ex);
} catch (IOException ex) {
LOG.fatal("I/O Error exception.");
LOG.fatal(ex);
} catch (SQLException ex) {
LOG.fatal("Error in writting to database.");
LOG.fatal(ex);
}
return false;
}
COM: <s> assume it is a very big line </s>
|
funcom_train/44771481 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean internalHasPropertyState(PropertyId id) {
try {
// get parent state
NodeState parent = (NodeState) getItemState(new NodeId(id.getParentUUID()));
// handle some default prop states
if (parent instanceof VirtualNodeState) {
return parent.hasPropertyName(id.getName());
}
} catch (ItemStateException e) {
// ignore
}
return false;
}
COM: <s> checks if this provider has the property state of the given id </s>
|
funcom_train/5864816 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getVisibleItemCount() {
int count = getItemCount();
int visibleCount = 0;
if (getNextSibling() instanceof Listitem) {
Listitem item = (Listitem) getNextSibling();
while (count-- > 0) {
if (item.isVisible())
visibleCount++;
if (!(item.getNextSibling() instanceof Listitem)) break;
item = (Listitem) item.getNextSibling();
}
}
return visibleCount;
}
COM: <s> returns the number of visible descendant </s>
|
funcom_train/44137323 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createSlideBody() {
m_Body = new OSMSlideBody(this, 100, 10, 300, 300, null);
OSMDocument doc = OSMApplication.TreeEditor.getDocument();
m_Body.setModel((OSMPageModel)doc.getPresentation().getTheme().getBaseModel());
this.add(m_Body);
}
COM: <s> to create the body component </s>
|
funcom_train/30224189 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetDeserializersForXmlName() {
AdaptiveMapDTO adaptiveMapDTO = this.populateAdaptiveMapDTO();
QName qname = this.getQName("Name");
List<StrategyDTO> list = SOAContextUtil.getDeserializersForXmlName(
adaptiveMapDTO, qname);
assertEquals("Vaules of XMLName in the Strategy DTO, and Qname differ",
qname, list.iterator().next().getXmlName());
}
COM: <s> tests the get deserializers for xml name </s>
|
funcom_train/28137852 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void toggleNature(IProject project) {
try {
IProjectDescription description = project.getDescription();
String[] natures = description.getNatureIds();
// Add the nature
String[] newNatures = new String[natures.length + 1];
System.arraycopy(natures, 0, newNatures, 0, natures.length);
newNatures[natures.length] = RebeccaAIMLNature.NATURE_ID;
description.setNatureIds(newNatures);
project.setDescription(description, null);
} catch (CoreException e) {
}
}
COM: <s> toggles our nature on our project </s>
|
funcom_train/42899201 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void releaseAddress(String publicIp) throws EC2Exception {
Map<String, String> params = new HashMap<String, String>();
params.put("PublicIp", publicIp);
HttpGet method = new HttpGet();
ReleaseAddressResponse response =
makeRequestInt(method, "ReleaseAddress", params, ReleaseAddressResponse.class);
if (!response.isReturn()) {
throw new EC2Exception("Could not release address (no reason given).");
}
}
COM: <s> releases an address </s>
|
funcom_train/16604492 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean onPath(Shape path, float x, float y) {
for (int i=0;i<path.getPointCount()+1;i++) {
int n = rationalPoint(path, i+1);
Line line = getLine(path, rationalPoint(path, i), n);
if (line.distance(new Vector2f(x,y)) < EPSILON*100) {
return true;
}
}
return false;
}
COM: <s> check if the given point is on the path </s>
|
funcom_train/20648652 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JLabel getGameTypeBtn() {
if (gameTypeBtn == null) {
gameTypeBtn = new JLabel();
gameTypeBtn.setText("");
gameTypeBtn.setForeground(Color.blue);
gameTypeBtn.setBackground(Color.white);
gameTypeBtn.setFont(new Font("Dialog", Font.BOLD, 12));
//gameTypeBtn.setBorderPainted(false);
gameTypeBtn.setOpaque(false);
gameTypeBtn.setHorizontalAlignment(SwingConstants.CENTER);
}
return gameTypeBtn;
}
COM: <s> this method initializes game type btn </s>
|
funcom_train/37036039 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getParameter(String name) {
synchronized (parameters) {
Object value = parameters.get(name);
if (value == null)
return (null);
else if (value instanceof String[])
return (((String[]) value)[0]);
else if (value instanceof String)
return ((String) value);
else
return (value.toString());
}
}
COM: <s> override the code get parameter code method of the wrapped request </s>
|
funcom_train/44850854 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void remove(int inPosition) {
if ((inPosition < 0) || (inPosition >= sortedArr.length)) {
throw new ArrayIndexOutOfBoundsException();
}
Object[][] lSortedArr = new Object[sortedArr.length - 1][2];
copyArr(sortedArr, lSortedArr, 0, inPosition - 1);
copyArrDownShifted(sortedArr, lSortedArr, inPosition+1, sortedArr.length);
sortedArr = lSortedArr;
}
COM: <s> removes the element at the specified position from the sorted array </s>
|
funcom_train/2582045 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public TimeSeries getSeries(Comparable key) {
TimeSeries result = null;
Iterator iterator = this.data.iterator();
while (iterator.hasNext()) {
TimeSeries series = (TimeSeries) iterator.next();
Comparable k = series.getKey();
if (k != null && k.equals(key)) {
result = series;
}
}
return result;
}
COM: <s> returns the series with the specified key or code null code if </s>
|
funcom_train/5802455 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public long getDownTime(long currentTime, long rollingWindow) {
long outageTime = 0;
if (m_services != null && m_services.size() > 0) {
for (Service service : m_services) {
long down = service.getDownTime(currentTime, rollingWindow);
if (down > 0) {
outageTime += down;
}
}
}
return outageTime;
}
COM: <s> returns the down time for this interface </s>
|
funcom_train/17183851 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Integer getPeptideMinSize() {
if (minPepLengthTxt.getText().trim() != null && !minPepLengthTxt.getText().trim().equals("")) {
String txt = minPepLengthTxt.getText().trim();
return new Integer(minPepLengthTxt.getText().trim());
} else {
return null;
}
}
COM: <s> this method returns the minimal peptide size allowed </s>
|
funcom_train/45399295 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Script getInstance () {
if (lastCompile < source.getLastModified()) {
try {
this.scriptClass = ClassCache.getFor( gcl.parseClass(new VirtualFileCodeSource(source)) );
this.lastCompile = System.currentTimeMillis();
} catch (CompilationFailedException e) {
throw ThrowableManagerRegistry.caught(e);
} catch (IOException e) {
throw ThrowableManagerRegistry.caught(e);
}
}
return scriptClass.newInstance();
}
COM: <s> this will recompile on modification </s>
|
funcom_train/10274601 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setEmptyMode(Object mode) {
if(mode != XmlWriter.EMPTY_MODE &&
mode != XmlWriter.IGNORE_EMPTY_MODE &&
mode != XmlWriter.NULL_EMPTY_MODE
)
{
throw new IllegalArgumentException("Illegal mode: "+mode);
}
this.emptyMode = mode;
}
COM: <s> the emptiness strategy to use </s>
|
funcom_train/7275839 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void readHeader(AudioHeader header) {
audioData.setVBR(header.isVariableBitRate());
audioData.setSampleRate(header.getSampleRateAsNumber());
audioData.setBitrate((int)header.getBitRateAsNumber());
audioData.setLength(header.getTrackLength());
}
COM: <s> reads header information about the file </s>
|
funcom_train/11746461 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Node getRootNode(boolean forceSyntheticRoot) {
if (document == null) {
return null;
}
// if synthetic root has a single child, use child as a root
Node root = document.getDocumentElement();
if (!forceSyntheticRoot && root.getChildNodes().getLength() == 1) {
root = root.getFirstChild();
}
return root;
}
COM: <s> returns a root dom node of the encoder </s>
|
funcom_train/19973201 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JComponent makeMainPanel() {
// Make the panel with a grid layout. Set up the column weights.
GridPanel panel = new GridPanel();
panel.colWeights(new int[] { 0, 1 });
panel.newRow();
panel.rowWeight(1);
panel.add(makeControls());
panel.add(new EditPanel(this), 1, true, true);
return panel;
}
COM: <s> make the main gui panel </s>
|
funcom_train/46746991 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setInsertDt(DateTimeModel insertDt) {
if (Converter.isDifferent(this.insertDt, insertDt)) {
DateTimeModel oldinsertDt= DateTimeModel.getNow();
oldinsertDt.copyAllFrom(this.insertDt);
this.insertDt.copyAllFrom(insertDt);
setModified("insertDt");
firePropertyChange(String.valueOf(REMINDERS_INSERTDT), oldinsertDt, insertDt);
}
}
COM: <s> date the reminder was created </s>
|
funcom_train/27927663 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean gotBitField(Peer peer, BitField bitfield) {
listener.peerChange(this, peer, CoordinatorListener.BITFIELD, bitfield);
synchronized(wantedPieces) {
Iterator it = wantedPieces.iterator();
while (it.hasNext()) {
int i = ((Integer)it.next()).intValue();
if (bitfield.get(i))
return true;
}
}
return false;
}
COM: <s> returns true if the given bitfield contains at least one piece we </s>
|
funcom_train/23183635 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setCell(double[][] value) {
int row = value.length;
if (row <= 0) {
setSize(0, 0);
return;
}
int column = value[0].length;
setSize(row, column);
for (row = 0; row < _row; row++) {
for (column = 0; column < _column; column++) {
_cell[row][column] = value[row][column];
}
}
}
COM: <s> set all the cell value with specified two dimensional array value </s>
|
funcom_train/32206066 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Iterator iterator() {
Set players = new HashSet();
// Iterate through the content of the set
for ( Iterator iter = this.targets.iterator() ; iter.hasNext() ; ) {
ActionTarget target = (ActionTarget)iter.next();
// Iterate through the target content to get the ActionTargetPlayer object
for ( Iterator iterTarget = target.iterator() ; iterTarget.hasNext() ; ) {
players.add( iterTarget.next() );
}
}
return players.iterator();
}
COM: <s> returns an iterator on the elements of the group </s>
|
funcom_train/9586399 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testRateAverage() {
RateClassMonitorImpl monitor = createRateClassMonitor(5000);
for (int rate : Arrays.asList(5000, 4020, 3216, 2572)) {
assertEquals(rate, monitor.getLastRateAvg());
monitor.updateRate(time);
}
}
COM: <s> tests that the rate average is computed correctly </s>
|
funcom_train/40426869 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void saveLoginBackToURL(HttpServletRequest request, HttpSession session, boolean overrideSavedResource) {
String referer = request.getHeader("referer");
if ((getSavedRequestURL(session) == null || overrideSavedResource) && referer != null && !referer.equals("")) {
session.setAttribute(WebAccessControlUtil.KEY_JOSSO_SAVED_REQUEST_URI, referer);
}
}
COM: <s> save referer uri into our session for later use </s>
|
funcom_train/4971646 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void valueChanged(ListSelectionEvent e) {
if (e.getValueIsAdjusting() == false) {
if (plugList.getSelectedIndex() == -1) {
//No selection, show information
labDesc.setText("Wybierz wtyczke...");
} else {
//Selection, show description of plugin
labDesc.setText(descriptions[plugList.getSelectedIndex()+2]);
}
}
}
COM: <s> this method is required by list selection listener </s>
|
funcom_train/51347141 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private StatementEnum type() {
// get just the 0 and 1 bits
// final byte b = Bits.mask(flags, 0, 1);
byte b = 0;
b |= (0x1 << TYPE_BIT);
b |= (0x1 << (TYPE_BIT+1));
b &= flags;
switch (b) {
case 0: return null;
case 1: return StatementEnum.Explicit;
case 2: return StatementEnum.Axiom;
case 3: return StatementEnum.Inferred;
}
throw new IllegalStateException();
}
COM: <s> statement type is hiding in the 0 and 1 bits of the flags </s>
|
funcom_train/25020058 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getDateTimeSql(String type, String dateValue) {
// This MUST exist and the MUST have a %s to apply the date field name.
String sql = DatabaseProperties.getCurrent().getDatabaseProperty(type,null);
if( sql == null ) {
throw new IllegalStateException("DateTimeSql is not defined for type="+type);
}
return String.format(sql, dateValue);
}
COM: <s> get the vendor specific sql for a date time value </s>
|
funcom_train/40327093 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public DynamicArea (Config config, KernelState ks) {
super(ks);
runFinalizer = config.getBoolean("vm.finalize", true);
// beware - we store 'this' in a static field, which (a) makes it
// effectively a singleton, (b) means the assignment should be the very last
// insn to avoid handing out a ref to a partially initialized object (no
// subclassing!)
heap = this;
}
COM: <s> creates a new empty dynamic area </s>
|
funcom_train/12541320 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void initialize(StatusTextEditor textEditor) {
fTextEditor= textEditor;
fPropertyChangeListener= new Preferences.IPropertyChangeListener() {
public void propertyChange(Preferences.PropertyChangeEvent e) {
if (ResourcesPlugin.PREF_ENCODING.equals(e.getProperty()))
setEncoding(null, false); // null means: use default
}
};
Preferences p= ResourcesPlugin.getPlugin().getPluginPreferences();
p.addPropertyChangeListener(fPropertyChangeListener);
}
COM: <s> associates this encoding support to the given text editor and initializes this encoding </s>
|
funcom_train/27823052 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setAttribute(String key,String value) throws KAONException {
try {
m_kaonConnection.getEngineeringServer().setAttribute(m_modelID,key,value);
}
catch (RemoteException e) {
throw new KAONException("Error in remote call",e);
}
}
COM: <s> sets the attribute of the oi model </s>
|
funcom_train/2879743 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setTabSize(JEditTextArea textArea, int tabSize) {
//int auxTabSize =((Integer) textArea .getDocument().getProperty(PlainDocument.tabSizeAttribute)).intValue();
//auxTabSize = tabSize;
textArea.getDocument().putProperty(PlainDocument.tabSizeAttribute, new Integer(tabSize));
}
COM: <s> sets the tab size attribute of the main frame object </s>
|
funcom_train/17193053 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void paintComponent(Graphics g) {
if (null == imageStoredMap) {
paintStoredMap();
}
if (null == imageGame) {
createGameBuffer();
}
// Erase buffer with map
bufferGame.drawImage(imageStoredMap, 0, 0, this);
_drawTowers(bufferGame);
_enemyWave.drawEnemies(bufferGame);
_drawTowerBullets(bufferGame);
_drawMouseCursor(bufferGame);
g.drawImage(imageGame, 0, 0, this);
}
COM: <s> draw the game buffer onto the panel buffer </s>
|
funcom_train/42452710 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void completeDTO(IPersistenceObject persistenceObject, BasicDTO dto) throws BasicException {
EidObject eidObject = (EidObject)dto;
if (StringUtils.isEmpty(eidObject.getGuid())) {
eidObject.setGuid(EidObject.generateGUID());
}
for (EidClass eidClass : eidObject.getEidClasses()) {
eidClass.setEidObject(eidObject);
}
}
COM: <s> prepare the eid objects entity to save </s>
|
funcom_train/29632288 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void putFingerprintCA1(byte[] iFpr) throws OpenPGPCardException{
if(iFpr.length != 20)
throw new IllegalArgumentException("Fingerprint must be exactly 20 bytes long");
putGenericData(TLV_FPR_CA1[0],TLV_FPR_CA1[1],iFpr,20);
}
COM: <s> stores the ca1 fingerprint 20 bytes on the card for ultimately trusted keys </s>
|
funcom_train/19272778 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected long toLong(Object value) throws WrongValueTypeException {
try {
return ((Number) value).longValue();
} catch (ClassCastException e) {
try {
return Long.parseLong(value.toString());
} catch (NumberFormatException e1) {
throw new WrongValueTypeException(this, Long.class);
}
}
}
COM: <s> this method gets the given value object as long </s>
|
funcom_train/13286744 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getJButton23() {
if (jButton23 == null) {
jButton23 = new JButton();
jButton23.setBounds(new Rectangle(59, 372, 400, 25));
jButton23.setText("Abbrechen & Neue DVD erstellen");
jButton23.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
reset();
}
});
}
return jButton23;
}
COM: <s> this method initializes j button23 </s>
|
funcom_train/29018615 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getFocusIndex () {
checkWidget ();
int result = (int)/*64*/OS.SendMessage (handle, OS.LB_GETCARETINDEX, 0, 0);
if (result == 0) {
int count = (int)/*64*/OS.SendMessage (handle, OS.LB_GETCOUNT, 0, 0);
if (count == 0) return -1;
}
return result;
}
COM: <s> returns the zero relative index of the item which currently </s>
|
funcom_train/20589655 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private ServletHandlerMethodResolver getMethodResolver(Object handler) {
Class handlerClass = ClassUtils.getUserClass(handler);
synchronized (this.methodResolverCache) {
ServletHandlerMethodResolver resolver = this.methodResolverCache.get(handlerClass);
if (resolver == null) {
resolver = new ServletHandlerMethodResolver(handlerClass);
this.methodResolverCache.put(handlerClass, resolver);
}
return resolver;
}
}
COM: <s> build a handler method resolver for the given handler type </s>
|
funcom_train/8439364 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public StringItem getWeeklyBudget() {
if (weeklyBudget == null) {//GEN-END:|197-getter|0|197-preInit
// write pre-init user code here
weeklyBudget = new StringItem("\u0411\u044E\u0434\u0436\u0435\u0442 \u043D\u0430 \u043D\u0435\u0434\u0435\u043B\u044E:", null);//GEN-LINE:|197-getter|1|197-postInit
// write post-init user code here
}//GEN-BEGIN:|197-getter|2|
return weeklyBudget;
}
COM: <s> returns an initiliazed instance of weekly budget component </s>
|
funcom_train/34088438 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected int compNum(String a, String b) {
if (a == null) {
return b == null ? 0 : -1;
}
if (b == null) {
return +1;
}
double da = Double.parseDouble(a);
double db = Double.parseDouble(b);
return da < db ? -1 : da > db ? +1 : 0;
}
COM: <s> compare strings that represent doubles </s>
|
funcom_train/3813783 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Token getBestActiveParitalMatchingToken(String text) {
List<Token> matchingList = findPartialMatchingTokens(text);
Token bestToken = null;
for (Token token : matchingList) {
if (bestToken == null || token.getScore() > bestToken.getScore()) {
bestToken = token;
}
}
return bestToken;
}
COM: <s> returns the best scoring token that matches the beginning of the given text </s>
|
funcom_train/35721288 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void fireInputDocumentChanged(IDocument oldInput, IDocument newInput) {
List listener= fTextInputListeners;
if (listener != null) {
for (int i= 0; i < listener.size(); i++) {
ITextInputListener l= (ITextInputListener) listener.get(i);
l.inputDocumentChanged(oldInput, newInput);
}
}
}
COM: <s> informs all registered text input listeners about the successful input change </s>
|
funcom_train/42991702 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setName(String name) {
// int index = name.indexOf(".");
// if(index != -1) {
// name = name.substring(0,index);
// }
//removing slashes, we assume it could be /home/file --> file
// if(name.contains("/")) {
// int index2 = name.lastIndexOf("/");
// name = name.substring(index2+1, name.length());
// }
this.name = name;
}
COM: <s> sets the name of the program according to the source filename </s>
|
funcom_train/25295189 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getSoftwarePackageFormat(String imageID) throws IOException {
try {
return softwareArchive.getSoftwareFormat(imageID);
}
catch (IOException e) {
processIOException(e, "software archive");
}
catch (WebServiceException wse) {
processWebServiceException(wse, "Software archive");
}
return null;
}
COM: <s> returns the software package file format </s>
|
funcom_train/16748367 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private SourceCodePosition getSourceFileForThisPosition (int offset, int length, LinkedList<SourceCodePosition> sourceCodePositions) {
SourceCodePosition pos = null;
/* iterate over all source code positions to find the
* ones that are relevant.
*/
for (SourceCodePosition scp : sourceCodePositions) {
Position position = scp;
/* check if source code position overlaps with
* the position of the problem
*/
if (position.overlapsWith(offset, length)) {
pos = scp;
break;
}
}
return pos;
}
COM: <s> this method checks if there are source files for </s>
|
funcom_train/21733531 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void runTestSuites(List<TestSuite> testSuiteCollection) {
logger.info("Running test cases");
int numTests = 0;
// Execute tests
for (TestSuite suite : testSuiteCollection) {
numTests += suite.getTests().size();
ReturnValue suiteReturnValue = execute(suite.getTests());
suite.setReturnValue(suiteReturnValue);
}
logger.info("Finished running " + testSuiteCollection.size() + " test suites with totally " + numTests + " test cases");
}
COM: <s> run all test cases in the test collection </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.