__key__
stringlengths 16
21
| __url__
stringclasses 1
value | txt
stringlengths 183
1.2k
|
---|---|---|
funcom_train/45623637 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addOptionStrictPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_VbcType_optionStrict_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_VbcType_optionStrict_feature", "_UI_VbcType_type"),
MSBPackage.eINSTANCE.getVbcType_OptionStrict(),
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the option strict feature </s>
|
funcom_train/29414553 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString() {
String output;
output = "W@("+getX()+","+getY()+"), V@("+getXvel()+","+getYvel()+"), S:"+getStrategy()+", IP:"+getInport();
return(output);
}
COM: <s> print a textual representation of this whirli </s>
|
funcom_train/50074952 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void initializeJarPackage() {
// source
jarPackage.setElements(getSelectedElements());
jarPackage.setExportClassFiles(true);
jarPackage.setExportOutputFolders(false);
jarPackage.setExportJavaFiles(false);
// options
jarPackage.setCompress(true);
jarPackage.setOverwrite(false);
}
COM: <s> initializes the jar package from last used wizard page values </s>
|
funcom_train/44451352 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void generateTileSet(int nTiles) {
WangTile wt;
if (nTiles > getMaximumNumberOfTiles()) {
nTiles = getMaximumNumberOfTiles();
}
tileSet.clear();
for (int i = 0; i < nTiles;) {
wt = new WangTile(horizontalColoring, verticalColoring);
wt.makeRandom();
if (!isInSet(wt)) {
tileSet.add(wt);
i++;
}
}
}
COM: <s> generates a tile set </s>
|
funcom_train/3101040 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String safeToString () {
if (name != null)
return name;
StringBuffer result = new StringBuffer("[CycVariable ");
if (hlVariableId != null)
result.append(" id: " + hlVariableId);
result.append("]");
return result.toString();
}
COM: <s> returns a string representation without causing additional api calls to determine </s>
|
funcom_train/45485626 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getJButton6Add() {
if (jButton6Add == null) {
jButton6Add = new JButton();
jButton6Add.setBounds(new Rectangle(5, 144, 64, 26));
Font font = new Font("Serif", Font.BOLD, 16);
jButton6Add.setFont(font);
jButton6Add.setForeground(Color.green);
jButton6Add.setText("6");
}
return jButton6Add;
}
COM: <s> this method initializes j button6 add </s>
|
funcom_train/18899845 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initiateDescriptorModel() throws DescriptorException {
String descriptorModelString = getModelURIString();
try {
descriptorModelURI = new URI(descriptorModelString);
if (log.isDebugEnabled()) {
log.debug("Using descriptor Model URI is : " + descriptorModelURI);
}
}
catch (URISyntaxException use) {
throw new DescriptorException("Descriptor Model URI: " +
descriptorModelString +
" is not a valid URI", use);
}
}
COM: <s> get our setting from the kowari store </s>
|
funcom_train/37610751 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Type getType() {
if (m_file != null) {
final String name = m_file.getName();
final int lastDot = name.lastIndexOf('.');
if (lastDot >= 0) {
final String extension = name.substring(lastDot + 1);
final Type type = s_extensionMap.get(extension);
if (type != null) {
return type;
}
}
}
return UNKNOWN_BUFFER;
}
COM: <s> get the type of the buffer </s>
|
funcom_train/11514916 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean remove(Object object, int nCopies) {
MutableInteger mut = map.get(object);
if (mut == null) {
return false;
}
if (nCopies <= 0) {
return false;
}
modCount++;
if (nCopies < mut.value) {
mut.value -= nCopies;
size -= nCopies;
} else {
map.remove(object);
size -= mut.value;
}
return true;
}
COM: <s> removes a specified number of copies of an object from the bag </s>
|
funcom_train/47674351 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public BeanWrapperElement getInboundEndpoint() {
if (inboundEndpoint == null) {
//create a new VM endpoint
inboundEndpoint = getCurrentWorkflow().getWrapperFromPalette(PaletteEnum.INBOUND_ENDPOINT, "Vm");
//add the component so that it has a content
inboundEndpoint.initialize();
inboundEndpoint.setName(getName());
}
return inboundEndpoint;
}
COM: <s> get the inbound endpoint for this internal endpoint element </s>
|
funcom_train/10654781 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testInsertString01() throws Exception {
doc.insertString(0, "one", null);
assertEquals(1, getEdits(insertEvent).size());
assertEquals(1, specs.length);
assertSpec(specs[0], ElementSpec.ContentType, ElementSpec.JoinPreviousDirection, 0, 3);
}
COM: <s> no attributes text one doc is empty </s>
|
funcom_train/2584916 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testLegendEvents() {
DefaultPieDataset dataset = new DefaultPieDataset();
JFreeChart chart = ChartFactory.createPieChart("title", dataset, true,
false, false);
chart.addChangeListener(this);
this.lastChartChangeEvent = null;
LegendTitle legend = chart.getLegend();
legend.setPosition(RectangleEdge.TOP);
assertNotNull(this.lastChartChangeEvent);
}
COM: <s> some checks for the default legend firing change events </s>
|
funcom_train/45082123 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void next() {
for (pos.next(); isValid(); pos.next()) {
Element elem = pos.current();
if (elem.getName().equals(tag.toString())) {
break;
}
AttributeSet a = pos.current().getAttributes();
if (a.isDefined(tag)) {
// we found the next one
break;
}
}
}
COM: <s> move the iterator forward to the next occurence </s>
|
funcom_train/45281411 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void doTranslateFiles() {
try{
String res = runTest(new AbstractAsyncTypeTest(testFolder) {
@Override
protected Frontend getFrontend() {
return getCompilerFactory().makeTranslator();
}
});
checkDoTranslateFiles(res);
}catch(IOException ioe){
fail(ioe.getMessage());
}
}
COM: <s> run the test the a frontend that produces translated code </s>
|
funcom_train/7518237 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ControleVistos update(ControleVistos entity) {
EntityManagerHelper.log("updating ControleVistos instance", Level.INFO,
null);
try {
ControleVistos result = getEntityManager().merge(entity);
EntityManagerHelper.log("update successful", Level.INFO, null);
return result;
} catch (RuntimeException re) {
EntityManagerHelper.log("update failed", Level.SEVERE, re);
throw re;
}
}
COM: <s> persist a previously saved controle vistos entity and return it or a copy </s>
|
funcom_train/19973608 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void onStatusChanged(String provider, int status, Bundle extras) {
try {
Log.i(TAG, "Provider status: " + provider + "=" + status);
synchronized (this) {
String msg = null;
if (status == LocationProvider.OUT_OF_SERVICE)
msg = msgOffline;
if (provider.equals(LocationManager.NETWORK_PROVIDER))
netElement.setStatus(msg);
else if (provider.equals(LocationManager.GPS_PROVIDER)) {
gpsElement.setStatus(msg);
}
}
} catch (Exception e) {
appContext.reportException(e);
}
}
COM: <s> called when the provider status changes </s>
|
funcom_train/28652267 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean moveAllInOrder(int[] indices, int dx, int dy) {
boolean res = true, movedVertex = false;
for(int i=0; i<indices.length; i++) {
try {
movedVertex = moveVertex (new Integer(indices[i]), dx, dy);
} catch (Exception ex) {
throw new InternalError (ex.getMessage ());
}
res = (res && movedVertex);
}
return res;
}
COM: <s> moves the rectangles all vertices according to the established order </s>
|
funcom_train/14003771 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Object processOnDemandAction(RDFNode action, Object[] arguments) throws AcuityException {
if (action != null) {
if (action.canAs(Individual.class)) {
return processAction((Individual)action.as(Individual.class), arguments);
}
else {
throw new AcuityException("Action '" + action.toString() + "' is not an Individual.");
}
}
return null;
}
COM: <s> process on demand action </s>
|
funcom_train/5725702 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void deleteBookmarksOfDepartment(final Long departmentId) {
logger.debug("----------> BEGIN method deleteBookmarksOfDepartment <----------");
Validate.notNull(departmentId, "The departmentId cannot be null.");
try {
desktopService2.unlinkAllFromDepartment(departmentId);
} catch (DesktopException de) {
logger.error(de.getMessage());
}
logger.debug("----------> End method deleteBookmarksOfDepartment <----------");
}
COM: <s> delete bookmarks of the given department from all users </s>
|
funcom_train/18049327 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Category getCategory(String cat) {
// EFFECTS: Returns a category with the same name as cat, i.e. rv_post.name().equals(cat) is true
// if no category with the exact name exists, returns null
Category c;
Iterator<Category> i = svEngine.categories(cat);
while (i.hasNext()) {
c = i.next();
if (c.name().equals(cat))
return c;
}
return null;
}
COM: <s> retrieves category from category name </s>
|
funcom_train/21953496 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void sortByColumn(int column, boolean ascending) {
if (ascending)
java.util.Collections.sort(data, new RowComparator(column));
else
java.util.Collections.sort(data, new ReverseRowComparator(column));
this.fireTableChanged(new javax.swing.event.TableModelEvent(this));
currentSortColumn = column;
currentAscending = ascending;
}
COM: <s> this sorts the data list by the value of the given column </s>
|
funcom_train/4154610 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void alignDialog() {
final Rectangle referenceWindowBounds = referenceWindow.getBounds();
switch ( getLocatingPolicy() ) {
case LOCATING_POLICY_ON_RIGHT_SIDE :
setLocation( referenceWindowBounds.x + referenceWindowBounds.width, referenceWindowBounds.y );
break;
case LOCATING_POLICY_UNDER :
setLocation( referenceWindowBounds.x, referenceWindowBounds.y + referenceWindowBounds.height );
break;
}
}
COM: <s> alings this dialog to the reference window </s>
|
funcom_train/21437447 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setMinRepetitions(String min) {
if( !isEndRepetition() )
return;
String new_name = "#endrep";
new_name += "_" + (TextUtils.isPositiveInteger(min) ?min :"?");
new_name += "_" + getMaxRepetitions();
name = new_name;
}
COM: <s> set the lower bound of a repeat block range applies only to </s>
|
funcom_train/35714528 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Point getLocation() {
StyledText text= fViewer.getTextWidget();
Point selection= text.getSelection();
Point p= text.getLocationAtOffset(selection.x);
p.x -= fProposalShell.getBorderWidth();
if (p.x < 0) p.x= 0;
if (p.y < 0) p.y= 0;
p= new Point(p.x, p.y + text.getLineHeight(selection.x));
p= text.toDisplay(p);
return p;
}
COM: <s> returns the graphical location at which this popup should be made visible </s>
|
funcom_train/22013049 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private DataSource (String dir) {
directory = new File(dir);
userDir = new File(dir, "user");
studentDir = new File(dir, "student");
disciplineDir = new File(dir, "discipline");
oldDir = new File(dir, "old");
disciplineDir.mkdir();
userDir.mkdir();
studentDir.mkdir();
oldDir.mkdir();
try {
mp = new Mapping(this.getClass().getClassLoader());
mp.loadMapping(System.getProperty(MAPPING));
ums = new Unmarshaller(mp);
} catch (Exception e) {
e.printStackTrace();
}
}
COM: <s> constructs a new datasource using </s>
|
funcom_train/28262400 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void keyPressed(KeyEvent keyEvent) {
// Pass keyPress on to keyboard to generate scancode from it
logger.log(Level.INFO, displayInfo(keyEvent, "KEY PRESSED: "));
if (emu != null) {
emu.notifyKeyboard(keyEvent, KEY_PRESSED);
}
}
COM: <s> implement the key listener method key pressed handles key press events </s>
|
funcom_train/37486050 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public IPath getOutputLocation() {
IPath outputLocationPath= new Path(getProjectName()).makeAbsolute();
if (fLayoutGroup.isSrcBin()) {
IPath binPath= new Path(PreferenceConstants.getPreferenceStore().getString(PreferenceConstants.SRCBIN_BINNAME));
if (binPath.segmentCount() > 0) {
outputLocationPath= outputLocationPath.append(binPath);
}
}
return outputLocationPath;
}
COM: <s> returns the source class path entries to be added on new projects </s>
|
funcom_train/36186199 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public DeviceProfile add(DeviceProfile addon) {
DeviceProfile sum;
double[] capabilities = this.toArray().clone();
double[] addonCapabilities = addon.toArray();
if (addon != null) {
for (int i = 0; i < capabilities.length; i++) {
capabilities[i] += addonCapabilities[i];
}
}
sum = new DeviceProfile(capabilities, peripherals.clone());
return sum;
}
COM: <s> combine the capabilities or requirements whatever these instances are </s>
|
funcom_train/13508950 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public WizardPage getWizardPage(String key){
for(int i=0;i<this.wizardPages.size();i++){
if (((WizardPage) this.wizardPages.get(i)).getKey().equals(key)){
return (WizardPage) this.wizardPages.get(i);
}
}
return null;
}
COM: <s> find wizard page by its key </s>
|
funcom_train/41161443 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void analyze() {
for (JarArchive jar : jars) {
//find which classes loaded by this classloader came from a given jar.
Collection<String> usedClasses = CollectionUtils.intersection(classLoaderClasses, jar.getAllClassNames());
jar.setNamesOfLoadedClasses(new HashSet<String>(usedClasses));
}
}
COM: <s> perform main project analysis determining the relationship between available jars </s>
|
funcom_train/28664494 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void decryptSETUP() {
// Try to decipher; if it doesn't work, leave the result blank.
try {
setSavedDeciphered1(klepto.functions.decrypt(getSavedCipherBytes1(), getD1(), getN1()));
}
catch(ArithmeticException e) {
setSavedDeciphered1(""); //$NON-NLS-1$
}
try {
setSavedDeciphered2(klepto.functions.decrypt(getSavedCipherBytes1(), getD2(), getN1()));
}
catch(ArithmeticException e) {
setSavedDeciphered2(""); //$NON-NLS-1$
}
}
COM: <s> used in setup attack only </s>
|
funcom_train/14433444 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object getInstance(String className) throws RuntimeException {
Object instance = null;
try
{
Class classObject = Class.forName(className);
instance = classObject.newInstance();
}
catch (ClassNotFoundException e)
{
e.printStackTrace();
}
catch (InstantiationException e)
{
e.printStackTrace();
}
catch (IllegalAccessException e)
{
e.printStackTrace();
}
return instance;
}
COM: <s> p get instance of class with code class name code </s>
|
funcom_train/16605776 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void parse(BufferedReader reader, Element target) throws ParserException, IOException {
StringWriter sw = new StringWriter();
StreamForwarder.forward(reader, sw);
String file = sw.toString().replace("\r\n", "\n").replace('\r', '\n');
if (!file.endsWith("\n"))
file += "\n";
parse(file, target);
}
COM: <s> parse a buffered reader and add the resulting xml to a dom </s>
|
funcom_train/15637796 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Document parseXml(String xmlfile) throws WebAppException,IOException{
Document doc = null;
try {
SAXBuilder builder = new SAXBuilder();
File file = new File(xmlfile);
doc = builder.build(file);
return doc;
}
catch (JDOMException je) {
Util.error(je);
throw new WebAppException(WebAppException.CONFIG_ERROR, "Parse error on "+xmlfile);
}
}
COM: <s> parse xml config file </s>
|
funcom_train/22891341 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void _saveFile(String filename) {
if ((filename == null) || (filename.length() == 0))
return;
File file = new File(filename);
try {
FileOutputStream stream = new FileOutputStream(file.getPath());
try {
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(stream, "UTF-8"));
out.write(getAmatext().getText());
out.close();
} catch (IOException e) {
e.printStackTrace();
return;
}
} catch (FileNotFoundException e) {
e.printStackTrace();
return;
}
}
COM: <s> saves the output file in utf 8 encoding </s>
|
funcom_train/38532133 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String get(int s, int e) {
if ( s > length ) {
return "";
}
if ( e > length ) {
return parser.getText(start + s, start + length).trim();
}
return parser.getText(start + s, start + e).trim();
}
COM: <s> gets part of the line that the id represents </s>
|
funcom_train/20077783 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void changeLines(double[][] coefficients, int line1, int line2, int collumn) {
int numCoeficientes = coefficients[0].length - 1; //nro de coeficientes da matriz (nao usa o indice 0)
double aux;
for (int i = collumn; i <= numCoeficientes; i++) {
aux = coefficients[line1][i];
coefficients[line1][i] = coefficients[line2][i];
coefficients[line2][i] = aux;
}
}
COM: <s> swap two lines from the given matrix </s>
|
funcom_train/44157316 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private double executeTestMethodGetArea(Calculator calc) {
long start = System.currentTimeMillis();
for (int i = 0; i < TEST_REPETITION_COUNT; i++) {
double result = calc.getArea(AREA_SIDE_A, AREA_SIDE_B);
if (result - RESULT_METHOD_GET_AREA
> RESULT_METHOD_GET_AREA_FAULT_TOLERANCE) {
throw new BaseRTException("Benchmark is corrupted!");
}
}
long stop = System.currentTimeMillis();
return (stop - start) / (double) TEST_REPETITION_COUNT;
}
COM: <s> this method executes the test for method get area test repetition count </s>
|
funcom_train/1383645 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel getPnlRiga2() {
if (pnlRiga2 == null) {
FlowLayout flowLayout2 = new FlowLayout();
flowLayout2.setAlignment(FlowLayout.LEFT);
pnlRiga2 = new JPanel();
pnlRiga2.setLayout(flowLayout2);
pnlRiga2.add(lblGiorni, null);
pnlRiga2.add(getTxtGiorni(), null);
pnlRiga2.add(lblPartenza, null);
pnlRiga2.add(getTxtPartenza(), null);
}
return pnlRiga2;
}
COM: <s> this method initializes pnl riga2 </s>
|
funcom_train/37823274 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void nextAlgoStep() {
AlgoTab tab;
if(algo instanceof BFS) tab = bfsTab;
else tab = dfsTab;
tab.getNodeStackView().stopAnimation();
algo.step();
tab.getNodeStackView().startAnimation();
resetAction.setEnabled(true);
stepBackAction.setEnabled(true);
if(algo instanceof BFS) {
bfsReset = true;
bfsStepBack = true;
}
else {
dfsReset = true;
dfsStepBack = true;
}
}
COM: <s> executes the next step in the algorithm </s>
|
funcom_train/41257607 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean messageExists(String code) {
try {
XMLProperty language = this.container.getProperty( this.language );
if ( language == null ) return false;
XMLProperty messages = language.getChild( "messages" );
if ( messages == null ) return false;
XMLProperty message = messages.getChild( code );
if ( message == null ) return false;
if ( message.getValue() == null ) return false;
return true;
} catch (Exception e) {
return false;
}
}
COM: <s> this method uses a simple algorithm with better performance </s>
|
funcom_train/32057260 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testActionPerformed() {
System.out.println("testActionPerformed");
GPGraphpad graphpad = new GPGraphpad();
FileRecent2 file2 = new FileRecent2(graphpad);
ActionEvent action = new ActionEvent(new Object(),ActionEvent.ACTION_PERFORMED,"command");
file2.actionPerformed(action);
}
COM: <s> tests action performed method of class file recent2 </s>
|
funcom_train/47708496 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void cullBackups() {
File[] backups = new File(minePath).listFiles(new BackupFilter());
Arrays.sort(backups, new Comparator<File>(){
@Override
public int compare(File arg0, File arg1) {
// TODO Auto-generated method stub
return ((Long)arg1.lastModified()).compareTo((Long)arg0.lastModified());
}
});
for(int i = numSaves; i >= 0 && i < backups.length; i++){
backups[i].delete();
}
}
COM: <s> delete any backups exceeding the number we wish to retain </s>
|
funcom_train/50235622 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void actionPerformed(ActionEvent ae) {
for (int f = 0; f < checkboxes.length; f++) {
OyoahaCheckBox ocb = (OyoahaCheckBox) ae.getSource();
if (ocb != checkboxes[f]) {
checkboxes[f].setSelected(false);
} else {
config.oyoahaConfigFile = ocb.fileName;
configManager.notifyUpdated(this);
}
}
}
COM: <s> method action performed </s>
|
funcom_train/3393395 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int compile(String[] args) {
Context context = new Context();
JavacFileManager.preRegister(context); // can't create it until Log has been set up
int result = compile(args, context);
if (fileManager instanceof JavacFileManager) {
// A fresh context was created above, so jfm must be a JavacFileManager
((JavacFileManager)fileManager).close();
}
return result;
}
COM: <s> programmatic interface for main function </s>
|
funcom_train/48562067 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object get(String name, ObjectFactory factory) {
Object result = null;
Map<String, Object> hBeans = ThreadScopeContextHolder.currentThreadScopeAttributes().getBeanMap();
if (!hBeans.containsKey(name)) {
result = factory.getObject();
hBeans.put(name, result);
} else {
result = hBeans.get(name);
}
return result;
}
COM: <s> gets bean from org </s>
|
funcom_train/28549447 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void actionPerformed(ActionEvent e) {
AddEntitySentenceEditorModelBuilder edModelBuilder = modelFactory
.createModelBuilder(AddEntitySentenceEditorModelBuilder.class);
final AddInstanceSentenceEditorModel edModel =
edModelBuilder.createAddInstanceEditorModel(protegeModelManager.getActiveOntology());
final AddInstanceSentenceEditorController edController = //
controllerFactory
.createController(AddInstanceSentenceEditorController.class);
edController.setModel(edModel);
edController.showDialog();
}
COM: <s> shows a rabbit sentence editor with a model for adding new sentences </s>
|
funcom_train/19071759 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void createMenus(JMenuBar mb) {
mb.add(createFileMenu());
mb.add(createEditMenu());
mb.add(createAlignmentMenu());
mb.add(createAttributesMenu());
mb.add(createToolsMenu());
mb.add(createWindowMenu());
mb.add(createHelpMenu());
}
COM: <s> create the menues for a given menu bar </s>
|
funcom_train/41722479 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void activateFilter(int type, boolean activateFilter) {
if (activateFilter && !activatedFilters.contains(type)) {
String filterName = filterNameTable.get(type);
RhythmFilter filter = createFilter(filterName);
if (filter != null) {
filterTable.put(type, filter);
activatedFilters.add(type);
}
} else if (!activateFilter && activatedFilters.contains(type)) {
activatedFilters.remove(type);
filterTable.put(type, null);
}
}
COM: <s> activates or deactivates one specific filter </s>
|
funcom_train/44717274 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean testEmailPattern(String pattern) throws Exception {
WebRequest request = loginForm.getRequest();
// try to input this pattern into email parameter
request.setParameter(FORM_EMAIL, pattern);
WebResponse response = submit(request);
return (response.getText().indexOf("valid email") != -1);
}
COM: <s> helper for test valid email param </s>
|
funcom_train/16398076 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetType() {
System.out.println("testGetType");
TinyPuzzle puzzle = (TinyPuzzle) TinyPuzzle.create();
assertNotNull("No puzzle", puzzle);
assertEquals("Wrong puzzle type", PuzzleTypeEnum.TINY, puzzle.getType());
}
COM: <s> test of get type method of class net </s>
|
funcom_train/18297419 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void doRunDrill() {
try {
d = new RunDrillDialog(f, ds, scDrill);
}
catch (Error err) {
Object errorText = err.getMessage();
String errorTitle = "Error";
int messageType1 = JOptionPane.ERROR_MESSAGE;
// display error dialog
JOptionPane.showMessageDialog(f, errorText, errorTitle, messageType1);
// log error
logger.severe(err.getMessage());
logger.severe(getStackTrace(err));
// set status
bRunDrillCancelled = true;
}
}
COM: <s> runs the drill </s>
|
funcom_train/16818396 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Stream dispatch(RemoteCall call) {
Stream returnValue = null;
try {
if(!comesFromValidStub((RmeRemoteCall)call)) {
IncompatibleStubException ise = new IncompatibleStubException();
if(returnValue == null)
returnValue = OrbAccessor.getStream();
returnValue.write((Exception)ise);
} else {
try {
returnValue = this.skeleton.dispatch(call);
} catch (Exception e) {
if(returnValue == null)
returnValue = OrbAccessor.getStream();
returnValue.write(e);
}
}
} catch (MarshalException me) {
me.printStackTrace();
}
return returnValue;
}
COM: <s> this dispatcher takes the folowing actions </s>
|
funcom_train/18593607 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isGetterMethod(Method method, boolean isTester) {
Class[] types = method.getParameterTypes();
int argc = types.length;
return ((isTester && argc == 1
&& Component.class.isAssignableFrom(types[0]))
|| (!isTester && argc == 0))
&& PropertyCall.isPropertyMethod(method);
}
COM: <s> method to check if the method specified on the class </s>
|
funcom_train/43230783 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createSystem(final String name, final AbstractSystem parent) {
try {
this.beginTransaction();
final Command<?> command;
if (parent == null) {
command = new SystemCreateCommand(name, this.getContext().getModel());
} else {
command = new SystemCreateCommand(name, parent);
}
this.doCommand(command);
this.commitTransaction();
} catch (final IPScrumGeneralException e) {
this.rollbackTransaction();
this.toastMessage(e.getMessage());
}
}
COM: <s> this method is needed for creating new systems </s>
|
funcom_train/15680169 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void append(Selector item) {
if (length == list.length) {
Selector[] tmp = list;
list = new Selector[list.length * 3 / 2];
for (int i = 0; i < tmp.length; i++) {
list[i] = tmp[i];
}
}
list[length++] = item;
}
COM: <s> appends an item to the list </s>
|
funcom_train/3176333 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void fireSelectionChanged(TagPath path, boolean on) {
// Go through listeners
Listener[] ls = (Listener[])listeners.toArray(new Listener[listeners.size()]);
for (int l=0;l<ls.length;l++)
ls[l].handleSelection(path,on);
// done
}
COM: <s> signals a change in a node to the listeners </s>
|
funcom_train/15605008 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getValueForOption(String targetOption) {
for (Iterator it = optionToDisplayNameMap.keySet().iterator(); it.hasNext(); ) {
String tmpKey = (String)it.next();
String tmpValue = (String)optionToDisplayNameMap.get(tmpKey);
if (tmpValue.equals(targetOption)) return tmpKey;
}
return "";
}
COM: <s> yields the actual value for the display name selected </s>
|
funcom_train/24318674 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeGroup(String groupName) throws Exception {
if (caseInsensitiveOutput) {
groupName = MiscUtilities.getCaseInsensitive(groupName, true);
}
GroupQuery qry = new GroupQuery();
qry.setQueryGroupid(groupName);
qry.requireUniqueInstance();
qry.getNextDO().delete();
}
COM: <s> removes user group </s>
|
funcom_train/29606993 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void notifyViewConfigurationChange() {
for (Iterator i = listeners.iterator(); i.hasNext();) {
ViewConfigurationListener l = (ViewConfigurationListener) i.next();
if (l != null) {
ViewConfigurationEvent ev = new ViewConfigurationEvent(this);
l.viewConfigurationChanged(ev);
}
}
} //
COM: <s> notifies interested listeners of a change in the view configuration </s>
|
funcom_train/49406770 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ModelExtract read(final InputStream in) throws IOException, OntologyIOException {
RDFParser parser = new RDFXMLParserFactory().getParser();
try {
RdfReadHandler handler = new RdfReadHandler();
parser.setRDFHandler(handler);
parser.parse(in, "void");
return handler.getExtract();
} catch (RDFParseException e) {
throw new OntologyIOException("error while reading RDF", e);
} catch (RDFHandlerException e) {
throw new OntologyIOException("error while reading RDF", e);
}
}
COM: <s> reads a model extract from an rds input stream </s>
|
funcom_train/29019471 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setSelection (int start) {
checkWidget ();
if (!OS.IsUnicode && OS.IsDBLocale) start = wcsToMbcsPos (start);
OS.SendMessage (handle, OS.EM_SETSEL, start, start);
OS.SendMessage (handle, OS.EM_SCROLLCARET, 0, 0);
}
COM: <s> sets the selection </s>
|
funcom_train/10929081 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void startFeed(boolean isRoot) throws XMLStreamException {
getWriter().writeStartElement(Constants.NAMESPACE_ATOM, "feed");
if (isRoot) {
writeNamespace(Constants.NAMESPACE_ATOM);
writeNamespace(Constants.NAMESPACE_CMIS);
writeNamespace(Constants.NAMESPACE_RESTATOM);
writeNamespace(Constants.NAMESPACE_APP);
}
}
COM: <s> opens the feed tag </s>
|
funcom_train/18884593 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void run(String arg) {
IJ.register(MRI_Analysis_Calc.class);
if (arg.equals("about"))
{showAbout(); return;}
int m = displayUIOne();
try {
if (m == T1_CALC) {
runT1Mode();
} else if (m == T2_CALC) {
runT2Mode();
} else if (m == PERF_CALC) {
runPerfMode();
} else if (m == DIFF_CALC) {
runDiffMode();
}
} catch (Exception e) {
e.printStackTrace();
IJ.showMessage(e.getMessage());
run("");
}
}
COM: <s> called by image j on plugin invocation </s>
|
funcom_train/18760226 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Node getNodeByTypeStep( String strArg ) {
if ( strArg.equals( getTypeStep() ) )
return this;
Node oOut = null;
for ( int iX = 0; vChild != null && iX < vChild.size() && oOut == null; iX++ )
oOut = vChild.get( iX ).getNodeByTypeStep( strArg );
return oOut;
}
COM: <s> get descendant node by type step id i </s>
|
funcom_train/32634425 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Type createRangeType(ReferenceType bottom) {
/*
* tArray(y), tArray(x) -> tArray( y.intersection(x) )
* obj , tArray(x) -> <obj, tArray(x)>
* iff tArray extends and implements obj
*/
if (bottom instanceof ArrayType)
return tArray(elementType.intersection
(((ArrayType)bottom).elementType));
return super.createRangeType(bottom);
}
COM: <s> create the type corresponding to the range from bottom type to this </s>
|
funcom_train/45231263 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toHTML() throws JSONException {
StringBuffer sb = new StringBuffer();
Iterator it = keys();
while (it.hasNext()) {
String key = it.next().toString();
sb.append("<b>" + key + ":</b> " + get(key).toString());
}
return sb.toString();
}
COM: <s> returns the contents of the object as html with no enclosing markup </s>
|
funcom_train/22290771 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Point absoluteMousePoint() {
if (dragView != null) {
Point point = new Point(dragView._lastX, dragView._lastY);
dragView.superview().convertPointToView(null, point, point);
return point;
} else {
return new Point(0, 0);
}
}
COM: <s> returns the mouses location in the drag sessions root views </s>
|
funcom_train/8073876 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString() {
StringBuffer text = new StringBuffer();
if (m_attScores == null) {
text.append("\tSVM feature evaluator has not been built yet");
} else {
text.append("\tSVM feature evaluator");
}
text.append("\n");
return text.toString();
}
COM: <s> return a description of the evaluator </s>
|
funcom_train/15726163 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private float noise(int x, int y) {
int n = x + y * 17;
n = (n << 13) ^ n;
float rand = (float) (1.000 - ((n * (n * n * 15731 + 789221) +
1376312589) & 0x7FFFFFFF) / 1073741824.0);
return rand;
}
COM: <s> returns 1 up to 1 </s>
|
funcom_train/16830655 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void swap(Entry<E> entryA, Entry<E> entryB) {
int indexA = entryA.index;
int indexB = entryB.index;
entryA.index = indexB;
entryB.index = indexA;
indexToEntry.set(indexA, entryB);
indexToEntry.set(indexB, entryA);
}
COM: <s> structural swap of two entries </s>
|
funcom_train/10258543 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ContactModel getContactFromId(String id) throws JajahException {
for (int i = 0; i < jajahContacts.size(); i++) {
if (jajahContacts.get(i).getId().equals(id)) {
return jajahContacts.get(i);
}
}
throw new JajahException("Jajah - getSyncItemFromId error. item id:" + id + " not found.");
}
COM: <s> get a contact from jajah with the given id </s>
|
funcom_train/13803374 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void update(Coordinates c, NodeSize nodeSize) {
update(c.getX() + nodeSize.getWidth() / 2.0, c.getY() + nodeSize.getHeight() / 2.0);
update(c.getX() - nodeSize.getWidth() / 2.0, c.getY() - nodeSize.getHeight() / 2.0);
}
COM: <s> stretch the box to include the given coordinates </s>
|
funcom_train/11319424 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getTabSheetNumber(String fieldName) {
for (int i = 0; i < getTabSheets().size(); i++) {
FieldSet fieldSet = (FieldSet) getTabSheets().get(i);
if (fieldSet.getFields().containsKey(fieldName)) {
return i + 1;
}
}
return 1;
}
COM: <s> return the tab sheet number for the given field name indexed from 1 </s>
|
funcom_train/45120574 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testIncreaseValue() throws Exception {
for (int i = 0; i < 50; i++) {
report.step("Increase value in summary.property file to be : " + (i+1));
Object value = Summary.getInstance().getProperty("Number");
int counter = value == null ? 1 : Integer.parseInt(value.toString()) + 1;
Summary.getInstance().setProperty("Number", "" + counter);
sleep(1000);
}
}
COM: <s> increase the value in summary </s>
|
funcom_train/18805350 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setSpacer(Spacer spacer) {
if (spacer == null) {
throw new NullPointerException("AbstractTitle.setSpacer(): null not permitted.");
}
if (!this.spacer.equals(spacer)) {
this.spacer = spacer;
notifyListeners(new TitleChangeEvent(this));
}
}
COM: <s> sets the spacer for the title and sends a </s>
|
funcom_train/43098678 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeFeature(Object cls, Object feature) {
if (cls instanceof MClassifier && feature instanceof MFeature) {
if (LOG.isInfoEnabled()) {
LOG.info("Removing the feature " + feature);
}
((MClassifier) cls).removeFeature((MFeature) feature);
}
}
COM: <s> this method removes a feature from a classifier </s>
|
funcom_train/12188903 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testThreeArguments() throws ExpressionException {
final Function function = new SubstringFunction();
Value result = function.invoke(expressionContextMock,
new Value[]{factory.createStringValue("123456"),
factory.createIntValue(3), factory.createIntValue(2)});
assertTrue(result instanceof StringValue);
assertEquals("34", ((StringValue) result).asJavaString());
}
COM: <s> tests if function works with three arguments </s>
|
funcom_train/32370159 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected EOAttribute attributeForPrototype(EOEntity entity, String proto) {
EOAttribute result = null;
for(EOAttribute attr: entity.attributes()) {
NSDictionary<String,Object> userInfo = attr.userInfo();
if(userInfo != null) {
Object val = userInfo.objectForKey(PROTOTYPE_KEY);
if(proto.equals(val)) {
result = attr;
break;
}
}
}
return result;
}
COM: <s> searches entity for the er prototype named proto </s>
|
funcom_train/41341122 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {
if ("ndfdXMLPort".equals(portName)) {
setndfdXMLPortEndpointAddress(address);
}
else
{ // Unknown Port Name
throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName);
}
}
COM: <s> set the endpoint address for the specified port name </s>
|
funcom_train/12587748 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void updateAnyItem(AnyItemType itemType){
int currentversion = itemType.getItemVersion() ;
itemType.setItemVersion(currentversion + 1);
Calendar now = Calendar.getInstance();
ItemMetadataComponent itemMetadata = itemType.getItemMetadata();
Calendar firstCreated = itemMetadata.getFirstCreated();
if(firstCreated == null){
if(currentversion == 1)
firstCreated = itemMetadata.getVersionCreated();
}
itemMetadata.setFirstCreated(firstCreated);
itemMetadata.setVersionCreated(now);
}
COM: <s> use this method for all update </s>
|
funcom_train/7636849 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void bindButtons() {
mShowApplications = findViewById(R.id.show_all_apps);
mShowApplications.setOnClickListener(new ShowApplications());
mShowApplicationsCheck = (CheckBox) findViewById(R.id.show_all_apps_check);
mGrid.setOnItemClickListener(new ApplicationLauncher());
}
COM: <s> binds actions to the various buttons </s>
|
funcom_train/14099062 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int setDegree (int degree) {
// the maximum order in the polynomial surface
if (degree >= 0) {
order = degree;
} else {
order = 0;
}
// the number of terms for a #order'd polynomial
orderTerms = ((order+1)*(order+1)+order+1)/2; // "always" an even number (when it matters)
return order;
}
COM: <s> initializes the local order information for the least squares fit </s>
|
funcom_train/1653441 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testHexToBytes_StringByteInt_WithLongOffset() {
try {
String methodString = "0";
byte[] methodByteArray = new byte[1];
HexUtil.hexToBytes(methodString,methodByteArray,methodByteArray.length);
fail("Expected Exception Error Not Thrown!"); }
catch (ArrayIndexOutOfBoundsException anException) {
assertNotNull(anException); }
}
COM: <s> test hex to bytes string byte int method </s>
|
funcom_train/39276088 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void putValue(Comparable key, int index, Object value) {
Object[] values = (Object[]) valuesGroups.get(key);
if (values == null) {
keys.add(key);
values = new Object[valuesNames.length];
valuesGroups.put(key, values);
}
values[index] = value;
}
COM: <s> set the value associated to the specified key </s>
|
funcom_train/24075933 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String getVariableMapping(Class<?> c) {
if (c.equals(Double.class)) {
return "DOUBLE";
}
else if (c.equals(String.class)) {
return "VARCHAR(100)";
}
else if (c.equals(Integer.class)) {
return "INT";
}
return "unknown_type:" + c.getCanonicalName();
}
COM: <s> convert a java type to a database type </s>
|
funcom_train/35897403 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Date getPeriodDate(String periodKey){
String[] splitKey = periodKey.split(":");
if (splitKey.length == 4){
int year = Integer.parseInt(splitKey[1]);
int month = Integer.parseInt(splitKey[2]);
int day = Integer.parseInt(splitKey[3]);
return getBudgetPeriodType().getStartOfBudgetPeriod(DateFunctions.getDate(year, month, day));
}
throw new DataModelProblemException("Cannot parse date from key " + periodKey);
}
COM: <s> parses a period key to get the date </s>
|
funcom_train/1840280 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void pause(boolean pause) {
if (mContext.mGameplay != null) {
mContext.mGameplay.pauseThread(pause);
}
if (mContext.mRenderThread != null) {
mContext.mRenderThread.pauseThread(pause);
}
if (pause == true) {
// make sure they got time to pause
try {
Thread.sleep(100 /* ms */);
} catch (InterruptedException e) {
Log.e(TAG, "Thread.sleep interrupted", e);
}
}
}
COM: <s> toggles pause on off on the rendering and gameplay threads </s>
|
funcom_train/37611539 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void copy(InputStream in, OutputStream out) throws IOException {
try {
while (true) {
final int bytesRead = in.read(m_buffer, 0, m_buffer.length);
if (bytesRead == -1) {
break;
}
out.write(m_buffer, 0, bytesRead);
out.flush();
}
}
finally {
if (m_closeStreams) {
Closer.close(out);
Closer.close(in);
}
}
}
COM: <s> copies from the input stream to the output stream until the input </s>
|
funcom_train/28993897 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void purgeContentItem(ContentNode cn) {
Transactionable tx = null;
if (cn != null) {
try {
// tx = transactionBegin();
// Delete all children and version of ContentNode cn
cn.delete();
setDomain(null);
// transactionCommit(tx);
} catch (Exception e) {
transactionRollback(tx, e,
"Exception occured while attempting to delete a ContentItem with id of ["
+ cn.getId() + "].");
}
}
}
COM: <s> purge a content node from the system </s>
|
funcom_train/18167243 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setApplicationProperties(Properties props) {
ourProperties = new Properties();
// nothing
if (props == null || props.size() == 0) {
return;
}
for (Iterator<Object> it = props.keySet().iterator(); it.hasNext(); ) {
String propKey = (String) it.next();
String propValue = props.getProperty(propKey);
ourProperties.setProperty(propKey, propValue);
}
}
COM: <s> must keep application level properties </s>
|
funcom_train/42337598 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void drawPolyline(int[] pointArray) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (pointArray == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
float[] points = new float[pointArray.length];
for (int i=0; i<points.length; i++) {
points[i] = pointArray[i];
}
OS.CGContextBeginPath(handle);
OS.CGContextAddLines(handle, points, points.length / 2);
OS.CGContextStrokePath(handle);
}
COM: <s> draws the polyline which is defined by the specified array </s>
|
funcom_train/21172052 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void enableTypes (Notation.AnnotationType[] types, boolean disableOthers) {
List<Notation.AnnotationType> toEnable = java.util.Arrays.asList(types);
if (disableOthers) {
HashSet<Notation.AnnotationType> allTypes = new HashSet<Notation.AnnotationType> (java.util.Arrays.asList(Notation.AnnotationType.values()));
allTypes.removeAll (toEnable);
enabledTypes.removeAll (allTypes);
}
enabledTypes.addAll(toEnable);
}
COM: <s> enables the specified array of annotation type objects so that popups are shown </s>
|
funcom_train/45228566 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void displayCreateGradeBookDialog(boolean firstRun, String projectName, String graderDirectory, String submissionDirectory) {
CreateGradeBookDialog dialog = new CreateGradeBookDialog(MainFrame.this, dataManager,
projectName, graderDirectory, submissionDirectory, firstRun);
UiUtils.centerContainerOnFrame(dialog, MainFrame.this);
dialog.setVisible(true);
}
COM: <s> forces the create gradebook dialog to be displayed prepopulated with the given </s>
|