__key__ stringlengths 16 21 | __url__ stringclasses 1 value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/25151769 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Snapshot beginSnapshot(OutputStream out) throws IOException {
if (!(mPageDb instanceof DurablePageDb)) {
throw new UnsupportedOperationException("Snapshot only allowed for durable databases");
}
DurablePageDb pageDb = (DurablePageDb) mPageDb;
int cluster = Math.max(1, 65536 / pageSize());
return pageDb.beginSnapshot(mTempFileManager, cluster, out);
}
COM: <s> support for capturing a snapshot hot backup of the database while </s>
|
funcom_train/51103130 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addFilesystemPath(String path) {
if (path != null) {
if (path.startsWith("/WEB-INF/")) {
this.additionalContextPaths.add(path);
}
else {
super.addFilesystemPath(path);
}
}
else {
throw new IllegalArgumentException("Path must not be null.");
}
}
COM: <s> override resource locator </s>
|
funcom_train/31156046 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void mouseReleased(MouseEvent e) {
super.mouseReleased(e);
if (SwingUtilities.isLeftMouseButton(e)) {
_releasedPoint = new ScaledPoint(releasedPixel.getX(),
releasedPixel.getY(), 1);
dbg.say(dbg.pairln("mouseReleased after scaled: ", ""
+ _releasedPoint.getX(), "" + _releasedPoint.getY()));
repaint();
}
}
COM: <s> implements a mouse event calls the mouse released of its parent class </s>
|
funcom_train/24635448 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object setSelectedItemByValue(Object item){
//Brute force search for now.
Iterator itr = itemIndex.iterator();
Object foundItem = null;
while(itr.hasNext() && foundItem == null){
Object o = itr.next();
if (o.equals(item)){
foundItem = o;
}
}
setSelectedItem(foundItem);
return foundItem;
}
COM: <s> selects the first item in the list where item in list </s>
|
funcom_train/44854941 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeSkin(ISkin inSkin) throws NamespaceException {
skins.remove(inSkin);
//if the active skin goes down, we have to register another available skin
if (!inSkin.isStopping()) return;
if (inSkin.getSkinID().equals(getActiveSkinName())) {
if (skins.isEmpty()) return;
changeSkin(((ConcurrentLinkedQueue<ISkin>)skins).peek().getSkinID());
}
}
COM: <s> remove the specified skin </s>
|
funcom_train/49408975 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void write(final OutputStream outputStream, final Object object) throws DIDLSerializationException{
if (outputStream == null || object == null) {
throw new IllegalArgumentException();
}
this.out = new PrintWriter(outputStream, true);
DIDLBaseType base = (DIDLBaseType) object;
base.accept(this);
}
COM: <s> writes didl using instantiated visitor type pattern </s>
|
funcom_train/33352715 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initialize() {
pack();
setLocationRelativeTo(null);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setSize(new Dimension(1000, 600));
this.setMinimumSize(new Dimension(500, 300));
this.setTitle("Stick Figure Viewer");
this.setContentPane(getContentPanel());
}
COM: <s> this method initializes this </s>
|
funcom_train/48704729 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addEntries(QuotedStringTokenizer tok, BibtexDatabase db) {
BibtexEntry[] entries;
while (tok.hasMoreTokens()) {
entries = db.getEntriesByKey(Util.unquote(tok.nextToken(),
QUOTE_CHAR));
for (int i = 0; i < entries.length; ++i)
m_entries.add(entries[i]);
}
}
COM: <s> called only when created from string </s>
|
funcom_train/3416023 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Node createGroup(boolean anonymous) {
int localIndex = localCount++;
int groupIndex = 0;
if (!anonymous)
groupIndex = capturingGroupCount++;
GroupHead head = new GroupHead(localIndex);
root = new GroupTail(localIndex, groupIndex);
if (!anonymous && groupIndex < 10)
groupNodes[groupIndex] = head;
return head;
}
COM: <s> create group head and tail nodes using double return </s>
|
funcom_train/1131622 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void eStop() {
if (instance != null && instance._isRunning()) {
// stop program
instance._killAll();
print("Program Stopped!\n");
}
// set pause
setPP(true);
// kill motors/servos
disableServos();
ao();
if (instance != null && instance.gc_mode != 0)
instance._create_disconnect();
// can't hurt
for (SimRobot bot : env.getRobots())
bot.setSpeeds(0, 0);
}
COM: <s> emergency stops the robot and program </s>
|
funcom_train/10908224 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean getFlag(int which) {
if (which == FIRST_IN_PART) {
return getGridUnit(0).getFlag(GridUnit.FIRST_IN_PART);
} else if (which == LAST_IN_PART) {
return getGridUnit(0).getFlag(GridUnit.LAST_IN_PART);
} else {
throw new IllegalArgumentException("Illegal flag queried: " + which);
}
}
COM: <s> returns a flag for this effective row </s>
|
funcom_train/48153215 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double getMoment(double a, int n){
double sum = 0;
if(parameter > n){
for(int k = 0; k <= n; k++) sum = sum + Functions.comb(n, k) * getMoment(k) * Math.pow(-a, n - k);
return sum;
}
else if (n == 2 * n / 2) return Double.POSITIVE_INFINITY;
else return Double.NaN;
}
COM: <s> this method computes the moment of a specified order about a specified point </s>
|
funcom_train/29000901 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setMenuMain(DataSet menu) {
mnuDS = menu;
mnuDS.putStringField(MenuItem.ACTION, MenuItem.GET_MENU);
mnuDS.putStringField("[MENU_SCRIPT/]", cntr.menuScript);
mnuDS = cntr.postServerRequestImed(mnuDS);
if (mnuDS != null) {
try {
setLookAndFeel();
buildColorButtons();
buildMainMenu(mnuDS);
setLookAndFeel();
} catch (Exception e) {
e.printStackTrace();
}
}
}
COM: <s> h2 code set menu main code h2 </s>
|
funcom_train/45354232 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JTextField getJtName() {
if (jtName == null) {
jtName = new JTextField();
jtName.setBounds(98, 48, 142, 23);
jtName.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent e) {
((JTextField) e.getSource()).selectAll();
}
});
}
return jtName;
}
COM: <s> this method initializes j text field1 </s>
|
funcom_train/44495625 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private TransactionImpl currentTransaction(TransactionID transactionID) throws TransactionNotActiveException {
TimeoutInformation timeoutInformation = (TimeoutInformation)transactions.get(transactionID);
if (timeoutInformation == null) {
throw new TransactionNotActiveException();
}
TransactionImpl retTransaction = (TransactionImpl)timeoutInformation.getValue();
if (retTransaction == null) {
throw new TransactionNotActiveException();
}
return retTransaction;
}
COM: <s> method current transaction </s>
|
funcom_train/38481609 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean boundaryCheck(int bcx, int bcy){
boolean check = false;
int x = 0, y = 0;
//DEBUG
//System.out.println("CHECKING");
for(int i = 0; i < (X.length - 1); i++){
x = (((Integer)X[i]).intValue());
y = (((Integer)Y[i]).intValue());
if(bcx == x && bcy <= y){
check = true;
break;
}
}
// DEBUG
//System.out.println(check);
return check;
}
COM: <s> method to check if a give coordinate is on or over a boundary </s>
|
funcom_train/965063 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Component buildMainPanel() {
JTabbedPane tabbedPane = new JTabbedPane(SwingConstants.TOP);
//tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
addTabs(tabbedPane);
tabbedPane.setBorder(new EmptyBorder(10, 10, 10, 10));
return tabbedPane;
}
COM: <s> builds and answers the tabbed pane </s>
|
funcom_train/27825255 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Set getProperties() throws KAONException {
synchronized (getLock()) {
Set set=new HashSet();
EntityID[] entityIDs=m_oimodelSource.getProperties();
for (int i=0;i<entityIDs.length;i++) {
Property property=getProperty(entityIDs[i]);
set.add(property);
}
return set;
}
}
COM: <s> returns all properties of this ontology </s>
|
funcom_train/17494198 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Image getImage(String aName) {
Image image = (Image) images.get(aName);
if(image==null) {
//workaround - need to have always full path
if(aName.length()<32) aName = imgPath+aName;
image = ImageLoader.getImage(aName);
if(image!=null) {
images.put(aName,image);
}
}
return image;
}
COM: <s> gets image object from image resources </s>
|
funcom_train/24632105 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Element retrievePhrase(Font font, Properties styleattributes) {
Phrase p = new Phrase("", font);
if (styleattributes == null)
return p;
String leading = styleattributes
.getProperty(MarkupTags.CSS_KEY_LINEHEIGHT);
if (leading != null) {
if (leading.endsWith("%")) {
p.setLeading(p.font().size() * (parseLength(leading) / 100f));
} else {
p.setLeading(parseLength(leading));
}
}
return p;
}
COM: <s> retrieves a phrase based on some style attributes </s>
|
funcom_train/45875038 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public CodeState setBranchEndState(Conditional cond, boolean withinExpansion, int offset) {
// implicit state change
CodeState newState = cond != null ? cond.fInitialState : CodeState.eActive;
changeState(newState, BranchKind.eEnd, withinExpansion, offset);
return newState;
}
COM: <s> the preprocessor has to inform the context about the state of if and </s>
|
funcom_train/32127499 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void parse(InputStream iStream, IContentHandler handler) throws MOFParserException, IOException {
OutputStream out = new ByteArrayOutputStream();
byte[] buf = new byte[1024];
int numRead=0;
while((numRead=iStream.read(buf)) != -1){
out.write(buf, 0, numRead);
}
parse(out.toString(), handler);
}
COM: <s> p parse a mof specification read from an input stream </s>
|
funcom_train/50396111 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public static class CancelledException extends IOException {
private static final long serialVersionUID = 1L;
public CancelledException() {
super();
}
public CancelledException(String message, Throwable cause) {
super(message + "; caused by: " + cause.toString());
}
public CancelledException(String message) {
super(message);
}
public CancelledException(Throwable cause) {
super("Caused by: " + cause.toString());
}
}
COM: <s> this exception is thrown by file transfer code when a cancel request </s>
|
funcom_train/14329377 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void test_appName() {
String fieldName = "appName";
String messageKey = Driver.APPNAME;
String expectedValue = DefaultProperties.APP_NAME;
assertDefaultPropertyByServerType(URL_SQLSERVER, messageKey, fieldName, expectedValue);
if (!isOnlySqlServerTests()) {
assertDefaultPropertyByServerType(URL_SYBASE, messageKey, fieldName, expectedValue);
}
}
COM: <s> test the code app name code property </s>
|
funcom_train/35715247 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Canvas createCanvas(Composite parent) {
return new Canvas(parent, SWT.NO_BACKGROUND | SWT.NO_FOCUS) {
/*
* @see org.eclipse.swt.widgets.Control#addMouseListener(org.eclipse.swt.events.MouseListener)
* @since 3.0
*/
public void addMouseListener(MouseListener listener) {
if (isPropagatingMouseListener() || listener == fMouseListener)
super.addMouseListener(listener);
}
};
}
COM: <s> creates a canvas with the given parent </s>
|
funcom_train/19268293 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String getPrompt(InputRequest request) {
StringBuffer prompt = new StringBuffer(super.getPrompt(request));
String defaul = request.getDefault();
if (defaul!=null) {
prompt.append("\nPress Ret to accept default:["+defaul+"]");
}
return prompt.toString();
}
COM: <s> constructs user prompt from a request </s>
|
funcom_train/2289268 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void increaseInvalidLoginCount() {
m_invalidLoginCount++;
if (m_invalidLoginCount >= m_maxBadAttempts) {
// threshold for bad login attempts has been reached for this user
if (m_disableTimeStart == 0) {
// only disable in case this user has not already been disabled
m_disableTimeStart = System.currentTimeMillis();
}
}
}
COM: <s> increases the bad attempt count disables the data in case the </s>
|
funcom_train/24527684 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String listResource(String key){
IContext context = getContext(key);
if ( context == null ) {
context = getResource(key); //lazy get.
if (context == null){
logWarn("Resource not found: "+key);
return "";
}
if ( context == null ) {
return "";
}
}
return listResource(context);
}
COM: <s> produces a listing showing the attributes of this cached resource </s>
|
funcom_train/51616580 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setSelectedIndex(int index) {
for( int i=0; i<size(); i++ ) {
getItem(i).setSelected( i==index );
}
//reflect the newly select menu
if( !inSetSelectedIndex ) {
inSetSelectedIndex = true;
updateSubcomponentBindings(); //update the subcomponents AND refresh the text of the menu
inSetSelectedIndex = false;
}
}
COM: <s> sets a single menu item as selected deselects any other menu items </s>
|
funcom_train/12635756 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void lSetConstraints() {
setConstraintsCommon(true);
// The layout might change if the constraints does not match
// the current text, causing the text to be set empty,
// or changed to "password", causing it to change width
// Request relayout to based on updated contentSize
if (item.owner == null) {
return; // because owner is null, we just return.
}
lRequestInvalidate(true, true);
}
COM: <s> notifies l amps f that constraints have to be changed </s>
|
funcom_train/3859419 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public List find(Iterator aTypeDescriptionIterator, Type aDeclaringType) {
List types = new ArrayList();
while (aTypeDescriptionIterator.hasNext()) {
ReferenceDescription typeDescription = (ReferenceDescription) aTypeDescriptionIterator.next();
types.add(find(typeDescription, aDeclaringType));
}
return types;
}
COM: <s> resolve the given references declared in the given type </s>
|
funcom_train/16392146 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getHeight() {
int maxHeight = 0, width;
width = this.getWidth();
if( width == 0 )
return 0;
else {
for( int i = 0; i < width; i++ ) {
List sampleYGrid = (List) this.grid.get( i );
maxHeight = Math.max( maxHeight, sampleYGrid.size());
}
return maxHeight;
}
}
COM: <s> returns the number of y grid lines </s>
|
funcom_train/12155341 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Integer getInstanceNumber() {
logger.debug("Entering getInstanceNumber().");
Integer instanceNumber = getValueAsInteger(GROUP_INSTANCE_INFO, ELEMENT_INSTANCE_NUMBER);
if (logger.isDebugEnabled()) {
logger.debug("Exiting getInstanceNumber(); RV = " + (instanceNumber != null ? "[" + instanceNumber + "]" : null) + ".");
}
return instanceNumber;
}
COM: <s> returns the instance number </s>
|
funcom_train/17465033 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getText(){
String s = null;
if (this.isFile() && this.canRead()){
try {
FileInputStream fis = new FileInputStream(this.getAbsolutePath());
FileChannel fc = fis.getChannel();
ByteBuffer b = ByteBuffer.allocate((int)fc.size());
fc.read(b);
if (b.hasArray()){
s = new String(b.array());
}
fis.close();
fc.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
return s;
}
COM: <s> gets the contents from the file as a string </s>
|
funcom_train/10509362 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public float getHeight() {
int percIndex = heightStr.indexOf('%');
if (percIndex > 0) {
float height = Float.parseFloat(heightStr.substring(0, percIndex));
yPercent = true;
return height / HUNDRED;
} else {
yPercent = false;
return Float.parseFloat(heightStr);
}
}
COM: <s> get the height </s>
|
funcom_train/11693179 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int valueOf(int attr, String token) {
Preconditions.checkArgument(!isNumerical(attr), "Only for CATEGORICAL attributes");
Preconditions.checkArgument(values != null, "Values not found");
return ArrayUtils.indexOf(values[attr], token);
}
COM: <s> converts a token to its corresponding int code for a given attribute </s>
|
funcom_train/44897958 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean add(Object o) {
if (o == null) {
throw new NullPointerException("ServerAddressSet does not allow null members");
} else if (!(o instanceof ServerAddress)) {
throw new ClassCastException("ServerAddressSet can hold only ServerAddress instances");
}
return super.add(o);
}
COM: <s> checks that the object is a server address before </s>
|
funcom_train/46473437 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void createUseCasesTreeView() throws InvalidXMLFileException {
ProjectReader pr = new ProjectReader(prjFileName);
String path = getProjectDirectory();
ViewModelGenerator ucTree = new UseCasesTreeViewCreator(pr.getUnifiedFile());
ucTree.generateModel();
ucTree.saveModel(path + "view.usecasestreeview");
//marks file for deletion when JVM terminates.
File f = new File(path + "view.usecasestreeview");
f.deleteOnExit();
}
COM: <s> this method creates a use cases tree view </s>
|
funcom_train/5551660 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double evaluate(final double[] values, final int begin, final int length) {
double sum = Double.NaN;
if (test(values, begin, length)) {
sum = 0.0;
for (int i = begin; i < begin + length; i++) {
sum += values[i];
}
}
return sum;
}
COM: <s> the sum of the entries in the specified portion of </s>
|
funcom_train/8977721 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void updateColorSetting() {
if (currentDrawing == null)
return;
else {
currentDrawing.setFilledColor(drawingSettings.getFilledColor());
currentDrawing.setFilled(drawingSettings.isFilled());
currentDrawing.setLineColor(drawingSettings.getLineColor());
currentDrawing.setStroke(drawingSettings.getStroke());
if (currentDrawing.getClass().equals(Eraser.class)) {
Eraser e = (Eraser) currentDrawing;
e.updateEraser();
}
}
}
COM: <s> update color setting </s>
|
funcom_train/21437115 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void haltInteractions() {
// display the wait cursor and block user input
if( halt_interactions.isFree() ) {
Component glassPane = getGlassPane();
glassPane.addMouseListener( new MouseAdapter() { } );
glassPane.setCursor( Cursor.getPredefinedCursor( Cursor.WAIT_CURSOR ) );
glassPane.setVisible( true );
}
halt_interactions.hold();
}
COM: <s> halt the user interaction and display a hourglass cursor </s>
|
funcom_train/48494606 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addMethods(ArrayList<InterfaceAnnotation> methods) {
addAnnotations(methods, "methods", true, null);
removeChildren(interfaceNode, "methods-panel");
if (methods.size() > 0) {
Node panel = doc.createElement("methods-panel");
addAttr(doc, panel, "location", "Methods");
interfaceNode.appendChild(panel);
}
}
COM: <s> adds methods to the document </s>
|
funcom_train/13188397 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Number getValue(Comparable key) {
Number result = null;
int keyIndex = getIndex(key);
if (this.extract == TableOrder.BY_ROW) {
result = this.source.getValue(this.index, keyIndex);
}
else if (this.extract == TableOrder.BY_COLUMN) {
result = this.source.getValue(keyIndex, this.index);
}
return result;
}
COM: <s> returns the value for a given key </s>
|
funcom_train/19053717 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int closeProject() {
if( projectOpen ) {
int result = confirmDialog( "Save changes?" , "Do you want to save the changes?" , JOptionPane.YES_NO_CANCEL_OPTION );
if( result == JOptionPane.CANCEL_OPTION ) return CANCEL;
if( result == JOptionPane.YES_OPTION ) {
int saveResult = saveProject();
if( saveResult == CANCEL ) return CANCEL;
actualCloseProject();
return CLOSE;
} else {
actualCloseProject();
return CLOSE;
}
} else {
return NO_OPEN_PROJECT;
}
}
COM: <s> this method handels the closing of a project </s>
|
funcom_train/23410968 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addPathFormulaPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Always_pathFormula_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Always_pathFormula_feature", "_UI_Always_type"),
OMPackage.Literals.ALWAYS__PATH_FORMULA,
true,
false,
true,
null,
null,
null));
}
COM: <s> this adds a property descriptor for the path formula feature </s>
|
funcom_train/21821076 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initDragAndDrop(Composite composite) {
int ops = DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK;
Transfer[] transfers = new Transfer[] {ResourceTransfer.getInstance(), PluginTransfer.getInstance()};
dropTarget = new DropTarget(composite, ops);
dropTarget.setTransfer(transfers);
dropAdapter = new DropAdapter(this, new GetCommitHistory());
dropTarget.addDropListener(dropAdapter);
}
COM: <s> adds drag and drop support to the history view </s>
|
funcom_train/7761610 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public SIFAck sendResponse(SIFObject sifObject, String requestMsgID, int packetNumber, boolean hasMorePackets) throws Exception {
SIFAck ack = null;
SIFResponse resp = new SIFResponse(requestMsgID, packetNumber, hasMorePackets);
resp.setObjectData(sifObject);
ack = this.sendMessage(resp).getAck();
return (ack);
}
COM: <s> sends a complete code sif response code message to the zis </s>
|
funcom_train/20308760 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected ExtendedIterator translateConceptSetResponse( Document response, TriplePattern query, boolean object, DIGAdapter da ) {
return translateNameSetResponse( response, query, object,
new String[] {DIGProfile.CONCEPT_SET, DIGProfile.SYNONYMS, DIGProfile.CATOM} )
.andThen( translateSpecialConcepts( response, da,
object ? query.getSubject() : query.getObject(),
query.getPredicate(), object ));
}
COM: <s> p translate a concept set document into an extended iterator </s>
|
funcom_train/29884155 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean endOfFile() {
try {
char[] cbuf= new char[1];
reader.mark(4);
if (reader.read(cbuf) == -1) {
return true;
} else {
reader.reset();
return false;
}
} catch (IOException ex) {
ex.printStackTrace();
return true;
}
}
COM: <s> returns whether we reached the end of the file in the reader </s>
|
funcom_train/4390648 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getItemName(int itemId) {
if (itemId == -1 || itemId >= maxListedItems) {
return new String("Unarmed");
}
if (itemLists[itemId] != null) {
return (itemLists[itemId].itemName);
}
return new String("null");
}
COM: <s> returns the name of item id </s>
|
funcom_train/8096370 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected CheckOptionHandler getOptionTester() {
CheckOptionHandler result;
result = new CheckOptionHandler();
if (getTokenizer() instanceof OptionHandler)
result.setOptionHandler((OptionHandler) getTokenizer());
else
result.setOptionHandler(null);
result.setUserOptions(new String[0]);
result.setSilent(true);
return result;
}
COM: <s> configures the check option handler uses for testing the option handling </s>
|
funcom_train/36185714 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JCheckBox getJCheckBoxReadAccess() {
if (jCheckBoxReadAccess == null) {
jCheckBoxReadAccess = new JCheckBox();
jCheckBoxReadAccess.setBounds(new Rectangle(31, 205, 21, 21));
}
return jCheckBoxReadAccess;
}
COM: <s> this method initializes j check box read access </s>
|
funcom_train/25060477 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JAXBContext createContextPackage() throws JAXBException {
String contextPackage = ObjectFactory.class.getPackage().toString();
int spacepos = contextPackage.indexOf(' ');
if (spacepos > -1)
contextPackage = contextPackage.substring(spacepos + 1);
return JAXBContext.newInstance(contextPackage);
}
COM: <s> this method creates a jaxb context package </s>
|
funcom_train/32631058 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isDateField(final int field) {
if (field == Calendar.ERA || field == Calendar.YEAR) {
return true;
}
if (field == Calendar.MONTH || field == Calendar.DATE) {
return true;
}
if (field == Calendar.WEEK_OF_MONTH || field == Calendar.WEEK_OF_YEAR) {
return true;
}
if (field == Calendar.MILLISECOND) {
return true;
}
return false;
}
COM: <s> checks if a given field number indicating a time field </s>
|
funcom_train/44734038 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected SearchDialog createSearchWindow() throws StellariumException {
SearchDialog searchWin = new SearchDialog(mainFrame, app);
searchWin.addWindowListener(new WindowAdapter() {
public void windowClosed(WindowEvent e) {
searchDialogHide();
}
});
searchWin.pack();
return searchWin;
}
COM: <s> create search window widgets </s>
|
funcom_train/18214017 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addModelFilePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Evaluation_modelFile_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Evaluation_modelFile_feature", "_UI_Evaluation_type"),
EvaluationmodelPackage.Literals.EVALUATION__MODEL_FILE,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the model file feature </s>
|
funcom_train/16246336 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void verifyDialog(){
if (getAxisY() == null) {
String[] colCaptionsY = makeCaptions();
jcb = new JComboBox(colCaptionsY);
jcb.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ev) {
selectionChanged(PlotOrientation.VERTICAL);
}
});
}else{
Column col = getDataSet().getColumn(getAxisY());
ArrayList subs = new ArrayList();
subs.add(col.getCaption());
setSubtitles(subs);
}
}
COM: <s> verify if a jcombo box should be added to the panel or not </s>
|
funcom_train/48190479 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void save(PosPolicyZdz entity) {
LogUtil.log("saving PosPolicyZdz instance", Level.INFO, null);
try {
entityManager.persist(entity);
LogUtil.log("save successful", Level.INFO, null);
} catch (RuntimeException re) {
LogUtil.log("save failed", Level.SEVERE, re);
throw re;
}
}
COM: <s> perform an initial save of a previously unsaved pos policy zdz entity </s>
|
funcom_train/20241521 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public TextField getTxtDescricao() {
if (txtDescricao == null) {//GEN-END:|240-getter|0|240-preInit
// write pre-init user code here
txtDescricao = new TextField("Descri\u00E7\u00E3o", null, 32, TextField.ANY);//GEN-LINE:|240-getter|1|240-postInit
// write post-init user code here
}//GEN-BEGIN:|240-getter|2|
return txtDescricao;
}
COM: <s> returns an initiliazed instance of txt descricao component </s>
|
funcom_train/20054469 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void xFillOval(Graphics g, int x, int y, int height_r, int width_r) {
g.fillOval(scale_x(x - width_r) + x_origin, scale_y(y - height_r) + y_origin,
scale_x(width_r * 2), scale_y(height_r * 2) );
}
COM: <s> draw a scaled translated and filled oval </s>
|
funcom_train/39166327 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testDoMatch_Object_AnnotationSet() throws Exception {
System.out.println("doMatch");
Object value = null;
AnnotationSet context = null;
ComparablePredicate instance = new ComparablePredicateImpl();
boolean expResult = false;
boolean result = instance.doMatch(value, context);
assertEquals(expResult, result);
}
COM: <s> test of do match method of class comparable predicate </s>
|
funcom_train/17002055 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Destinations destinationsReachedFromHop(Gateway gateway) {
if (destinationDirectory.containsKey(gateway)) {
return (Destinations) destinationDirectory.get(gateway);
}
/**
* gateway is not a valid hop, and thus contains no entry in the
* destinationDirectory
*/
System.out.println("RoutingCache: The gateway " + gateway
+ " is not a valid hop");
return null;
}
COM: <s> provides the destinations that can be reached from a hop </s>
|
funcom_train/11642515 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testCountriesByLanguage() {
assertCountriesByLanguage(null, new String[0]);
assertCountriesByLanguage("de", new String[]{"DE", "CH", "AT", "LU"});
assertCountriesByLanguage("zz", new String[0]);
assertCountriesByLanguage("it", new String[]{"IT", "CH"});
}
COM: <s> test countries by language method </s>
|
funcom_train/2585454 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void test788597() {
DefaultTableXYDataset dataset = new DefaultTableXYDataset();
dataset.addSeries(createSeries1());
assertEquals(4, dataset.getItemCount());
dataset.removeAllSeries();
assertEquals(0, dataset.getItemCount());
}
COM: <s> a test for bug report 788597 </s>
|
funcom_train/19271810 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public E getBest(int threshold) {
E best = null;
int bestRank = threshold - 1;
for (E element : this.map.keySet()) {
Ranking ranking = this.map.get(element);
if (ranking != null) {
if (ranking.rank > bestRank) {
best = element;
bestRank = ranking.rank;
}
}
}
return best;
}
COM: <s> this method gets the element that has currently the best highest </s>
|
funcom_train/47587484 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addUserPost(Post post) {
String tUserName = post.getOwner();
Set<Long> tPostsList = this._usersToPostsIndex.get(tUserName);
if (tPostsList == null) {
tPostsList = new HashSet<Long>();
this._usersToPostsIndex.put(tUserName, tPostsList);
}
tPostsList.add(post.getId());
}
COM: <s> adds the post id to the map which maps users to their posts </s>
|
funcom_train/9119188 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toText(String prefix) {
if (!Util.isEmpty(prefix))
prefix = prefix + " ";
StringBuffer text = new StringBuffer();
for (Attribute attribute : getAttributes()) {
text.append(Resource.buildTextLine(prefix + attribute.getNamespacePrefix() + ":"
+ attribute.getLocalName(), attribute.getValue(), false));
}
return (text.toString());
}
COM: <s> creates a text representation of these attributes </s>
|
funcom_train/47684030 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Date getValueAsDate(String p_path) {
Field target;
Date result = null;
if ((target = getField(p_path)) != null) {
result = target.getValueAsDate();
} else {
throw new IllegalArgumentException("The referenced field \"" + p_path + "\" does not exist.");
}
return result;
}
COM: <s> retrieves the value of the field instance as a date object </s>
|
funcom_train/9480822 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void entering(String sourceClass, String sourceMethod) {
if (!internalIsLoggable(Level.FINER)) {
return;
}
LogRecord record = new LogRecord(Level.FINER, "ENTRY"); //$NON-NLS-1$
record.setLoggerName(this.name);
record.setSourceClassName(sourceClass);
record.setSourceMethodName(sourceMethod);
setResourceBundle(record);
log(record);
}
COM: <s> logs a message indicating that a method has been entered </s>
|
funcom_train/11390772 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addFalsePositive(Key key) {
if (key == null) {
throw new NullPointerException("key can not be null");
}
int[] h = hash.hash(key);
hash.clear();
for (int i = 0; i < nbHash; i++) {
fpVector[h[i]].add(key);
}
}
COM: <s> adds a false positive information to i this i retouched bloom filter </s>
|
funcom_train/41445693 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setValue(Object value) throws IllegalArgumentException {
if (value == null) {
this.value = null;
return;
}
if (isAssignable(value.getClass(), type)) {
this.value = value;
}
else {
throw new IllegalArgumentException("Value is of type " + value.getClass().getName() + ", required type is " + type);
}
}
COM: <s> set a new value for the property </s>
|
funcom_train/14239168 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: @Test public void resolve() {
Object result = Replacer.resolve(SimpleReplacer.class, "quote Yields falsehood");
assertEquals("'Yields falsehood'", result);
result = Replacer.resolve(SimpleReplacer.class, "one");
assertEquals(1, result);
}
COM: <s> tests resolving against a </s>
|
funcom_train/7874485 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public User leave(String id) throws TwitterException {
assert (id != null);
requireCredentials();
String url = String.format(
"http://twitter.com/notifications/leave/%s.json", id);
String response = getTwitterHttpManager().post(url);
return User.newFromJsonString(response);
}
COM: <s> disables notifications for updates from the specified user to the </s>
|
funcom_train/30197017 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testEdit() throws Exception {
System.out.println("edit");
/*
ActionMapping mapping = null;
ActionForm form = null;
HttpServletRequest request = null;
HttpServletResponse response = null;
InserisciCVAction instance = new InserisciCVAction();
ActionForward expResult = null;
ActionForward result = instance.edit(mapping, form, request, response);
assertEquals(expResult, result);
*/
}
COM: <s> test of edit method of class com </s>
|
funcom_train/21848239 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public LookAndFeelInfo findByClass(String className, String theme) {
Iterator iter = m_lafs.values().iterator();
while (iter.hasNext()) {
LookAndFeelInfo info = (LookAndFeelInfo) iter.next();
if (theme == null || theme.length() == 0) {
if (className.equals(info.getLookAndFeelClassName()))
return info;
} else {
if (className.equals(info.getLookAndFeelClassName())
&& theme.equals(info.getTheme()))
return info;
}
}
return null;
}
COM: <s> locates a look and feel by the class name </s>
|
funcom_train/37774867 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testHashCode() {
// get the hashcode
int hashCode1 = f_listMap.hashCode();
// create a similar listMap & check its hashCode
ListMap listMap = new ListMap(f_listMap);
int hashCode2 = listMap.hashCode();
// the 2 hashcodes should be the same
if (hashCode1 != hashCode2)
fail("Failed to get a consistent hashCode");
}
COM: <s> test of hash code method of class org </s>
|
funcom_train/45451822 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void validateProductIndex(final ActionErrors errors) {
if (productIndex == null) {
errors.add("product", new ActionError("AdminForm.productRequired"));
return;
}
try {
getProductIndexValue();
} catch (NumberFormatException e) {
errors.add("product", new ActionError("AdminForm.productRequired"));
return;
}
}
COM: <s> validates the product by making it required and a number </s>
|
funcom_train/34960879 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void save(SchoolAddress entity) {
EntityManagerHelper.log("saving SchoolAddress instance", Level.INFO,
null);
try {
getEntityManager().persist(entity);
EntityManagerHelper.log("save successful", Level.INFO, null);
} catch (RuntimeException re) {
EntityManagerHelper.log("save failed", Level.SEVERE, re);
throw re;
}
}
COM: <s> perform an initial save of a previously unsaved school address entity </s>
|
funcom_train/14464773 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getTempDoml(){
// there should be a default DOML loaded
File fx = new File("resources/default.doml");
File fxt;
String fp = "";
try {
File dir = new File("WEB-INF/doml/");
dir.mkdirs();
fxt = File.createTempFile("sws-do-mapping-",".doml",dir);
com.extentech.toolkit.JFileWriter jiffy = new com.extentech.toolkit.JFileWriter();
jiffy.copyFile(fx,fxt.getAbsolutePath());
fp = fxt.getAbsolutePath();
} catch (IOException e) {
Logger.logErr("XMLEditorPanel could not create temp file.",e);
}
return fp;
}
COM: <s> creates a temp doml file from the default in resources </s>
|
funcom_train/45113527 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String winGetHandle(String title, String text) throws Exception {
Map<?, ?> result = null;
if (text != null) {
result = runRemoteScript(commandCreate("WinGetHandle", title, text));
} else {
result = runRemoteScript(commandCreate("WinGetHandle", title));
}
processResult("Wait for windows active, title: " + title, result);
return String.valueOf(result.get(STDOUT));
}
COM: <s> retrieves the internal handle of a window </s>
|
funcom_train/11657648 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean hasBorrowWaiters() {
for (K k : poolMap.keySet()) {
final ObjectDeque<T> deque = poolMap.get(k);
if (deque != null) {
final LinkedBlockingDeque<PooledObject<T>> pool =
deque.getIdleObjects();
if(pool.hasTakeWaiters()) {
return true;
}
}
}
return false;
}
COM: <s> returns true if there are threads parked waiting to borrow instances </s>
|
funcom_train/37558044 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void itemStateChanged(ItemEvent e) {
Object source = e.getItemSelectable();
if (source == excerciseCheckBox ||
source == foodCheckBox ||
source == hypoglucaemiaCheckBox ||
source == medicineCheckBox ||
source == otherCheckBox
// source == privateCheckBox ||
)
{
if (chart != null) {
saveSelection();
chart.update();
}
}
}
COM: <s> listener for changed selection </s>
|
funcom_train/10790962 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void determineRangeSyntax() {
// Let user override rangeSyntax.
if (rangeSyntax == null)
rangeSyntax =
(firebirdVersion == FB_VERSION_15) ? RANGE_SYNTAX_FIRST_SKIP
: RANGE_SYNTAX_ROWS;
if (RANGE_SYNTAX_FIRST_SKIP.equals(rangeSyntax))
rangePosition = RANGE_PRE_DISTINCT;
else
rangePosition = RANGE_POST_SELECT;
}
COM: <s> determine range syntax to be used depending on firebird version </s>
|
funcom_train/550206 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeEntityAt(int row) {
((EntityAdapter) adapters.get(row)).remove();
try
{
IEntity entity = getEntityAt(row);
if (deviceList != null)
{
deviceList.remove(entity.getDevice());
}
}
catch(Exception e)
{
// nothing to do
}
adapters.remove(row);
entities.remove(row);
fireTableRowsDeleted(row, row);
}
COM: <s> code remove entity at code removes the entity at the given row </s>
|
funcom_train/36248332 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void newLink(Listener linkListener, String linkText, Composite composite) {
Link link = new Link(composite, SWT.WRAP);
link.setText(linkText);
link.addListener(SWT.Selection, linkListener);
GridData data = new GridData(SWT.FILL, SWT.FILL, false, false);
data.horizontalSpan = LAYOUT_COLUMN_WIDTH;
data.widthHint = 500;
link.setLayoutData(data);
}
COM: <s> convenience method for creating a new link widget </s>
|
funcom_train/3081743 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setModel(CalendarSelectionModel newValue) {
CalendarSelectionModel oldValue = getModel();
if (newValue != oldValue) {
oldValue.removeListener(internalListener);
if (newValue != null) {
newValue.addListener(internalListener);
}
if (getDateChooser() != null) {
getDateChooser().setModel(newValue);
}
updateTextFromDate();
}
}
COM: <s> sets the calendar selection model to be used on the underlying date chooser </s>
|
funcom_train/28425692 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Iterator getKeys() {
ArrayList arr = new ArrayList();
for(Enumeration en = prop.keys(); en.hasMoreElements(); ) {
String key = (String)en.nextElement();
if(!key.startsWith(prefix)) {
continue;
}
key = key.substring(prefix.length());
arr.add(key);
}
return arr.iterator();
}
COM: <s> get configuration keys </s>
|
funcom_train/17724742 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getPostBackUrl() {
if (this.postBackUrl != null) {
return this.postBackUrl;
}
ValueBinding vb = getValueBinding("postBackUrl"); //NOI18N
if (vb != null) {
return (String) vb.getValue(getFacesContext());
}
return null;
}
COM: <s> returns the value of url to which pay pal posts information about the </s>
|
funcom_train/28750533 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setPinsvendor(String newVal) {
if ((newVal != null && this.pinsvendor != null && (newVal.compareTo(this.pinsvendor) == 0)) ||
(newVal == null && this.pinsvendor == null && pinsvendor_is_initialized)) {
return;
}
this.pinsvendor = newVal;
pinsvendor_is_modified = true;
pinsvendor_is_initialized = true;
}
COM: <s> setter method for pinsvendor </s>
|
funcom_train/16159150 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private PaletteContainer createLinks2Group() {
PaletteDrawer paletteContainer = new PaletteDrawer(
Messages.Links2Group_title);
paletteContainer.setId("createLinks2Group"); //$NON-NLS-1$
paletteContainer.setDescription(Messages.Links2Group_desc);
paletteContainer.add(createMandatoryRelation1CreationTool());
paletteContainer.add(createOptionalRelation2CreationTool());
paletteContainer.add(createCaseRelation3CreationTool());
paletteContainer.add(createRequireRelation4CreationTool());
paletteContainer.add(createExcludesRelation5CreationTool());
return paletteContainer;
}
COM: <s> creates links palette tool group </s>
|
funcom_train/4416951 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String join(String separator) throws JSONException {
int len = this.length();
StringBuffer sb = new StringBuffer();
for (int i = 0; i < len; i += 1) {
if (i > 0) {
sb.append(separator);
}
sb.append(JSONObject.valueToString(this.myArrayList.get(i)));
}
return sb.toString();
}
COM: <s> make a string from the contents of this jsonarray </s>
|
funcom_train/23168631 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ConstLong addLong (long l) {
hashConstants();
Long lo = new Long(l);
ConstLong cl = (ConstLong) longTable.get(lo);
if (cl == null) {
cl = new ConstLong(l);
internConstant(cl);
internConstant(null);
}
return cl;
}
COM: <s> find or create a long constant in the pool </s>
|
funcom_train/25492039 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void put(int id, T object) {
CacheItem<T> newCacheItem = new CacheItem<T>(object);
if (cacheMap.size() > size) {
throw new RuntimeException(
"Size of cacheMap must not be greater than maximum size.");
}
if (cacheMap.size() == size) {
executeReplacementAlgorithm();
}
// implicitly overwrites already existent object with same id
cacheMap.put(Integer.valueOf(id), newCacheItem);
}
COM: <s> puts an object into the cache </s>
|
funcom_train/21285639 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testUnescapedValueWithColon() {
try {
eval("foo: foo:bar");
fail("Illegal value \"foo:bar\" didn't throw an exception.");
}
catch(RuntimeException e) {
assertEquals("EOF expected, : line 1", e.getMessage());
}
}
COM: <s> tests whether or not the unquoted sequence code foo bar code throws </s>
|
funcom_train/50877663 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Node getNode() {
Node tempRoot = new Node("Universal_Transverse_Mercator_Projection");
tempRoot.addAttribute(ZONE_TAG, ""+getZone());
if (getNorthing() >= 10000000) tempRoot.addAttribute(HEMISPHERE_TAG, HEMISPHERE_SOUTH);
else tempRoot.addAttribute(HEMISPHERE_TAG, HEMISPHERE_NORTH);
return tempRoot;
}
COM: <s> return the configuration information for this projection </s>
|
funcom_train/16791351 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean isChecked() {
boolean result = false;
if (this.checked != null) {
try {
this.checked.setAccessible(true);
result = (Boolean) this.checked.invoke(this.target);
} catch (Exception ex) {
this.logger.error("Unable to invoke checked on " + this.id, ex);
result = false;
}
}
return result;
}
COM: <s> check this action to see if it should be checked </s>
|
funcom_train/22202538 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected AMNode assertAnEndnode(AMArc a, Class klass) throws Exception {
Iterator it = a.getEndNodes().iterator();
while (it.hasNext()) {
AMNode node = (AMNode) it.next();
Object rep = node.getRepresentedObject();
if ((rep != null) && rep.getClass().equals(klass)) {
return node;
}
}
fail("Node that represents object of class [" + klass
+ "] could not be found.");
return null;
}
COM: <s> tests wether the given arc contains at least one endnode that represents </s>
|
funcom_train/51707618 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeSrbManager(String param) {
if (this.srbManager.containsKey(param)) {
log.trace("removing " + param + " from cache");
SRBFileManagerThread man = srbManager.get(param);
try {
if (!man.isFinished()) {
man.stopDownload();
}
} finally {
}
this.srbManager.remove(param);
}
}
COM: <s> removes srb downloads if not finished it tries to stop the download </s>
|
funcom_train/47986697 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean executeAndUpdateState(Operation operation) {
if (executeNow(operation)) {
updateStateVector(operation.getClientId());
historyBuffer.add(operation);
operationcount++;
System.out.println("Executed operation! " + this.getName() +
" id=" + getClientId() + ":" + operation + " localstate: " + stateVector);
return true;
} else {
return false;
}
}
COM: <s> executes an operation updates the state vector and adds the operation to </s>
|
funcom_train/3369947 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addSelectionRows(int[] rows) {
TreeUI ui = getUI();
if(ui != null && rows != null) {
int numRows = rows.length;
TreePath[] paths = new TreePath[numRows];
for(int counter = 0; counter < numRows; counter++)
paths[counter] = ui.getPathForRow(this, rows[counter]);
addSelectionPaths(paths);
}
}
COM: <s> adds the paths at each of the specified rows to the current selection </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.