__key__ stringlengths 16 21 | __url__ stringclasses 1
value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/25342558 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void savePlaylistAs(Playlist playlist, String name) throws IOException {
if (!name.endsWith(".lfm")) {
name += ".lfm";
}
playlist.commit();
PlaylistBackupExporter exporter = new PlaylistBackupExporter();
String dir = playlist.getType() == PlaylistType.ONLINE ? this.dir : this.dirArchive;
exporter.toFile(playlist, new File(dir + name));
}
COM: <s> saves a playlist to disk using the given name </s>
|
funcom_train/31569688 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object clone() {
SaxonXMLGregorianCalendar s = new SaxonXMLGregorianCalendar();
s.setYear(year);
s.setMonth(month);
s.setDay(day);
s.setHour(hour);
s.setMinute(minute);
s.setSecond(second);
s.setMillisecond(microsecond/1000);
s.setTimezone(tzOffset);
return s;
}
COM: <s> p creates and returns a copy of this object </s>
|
funcom_train/1492336 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addContent(ContentView cc, HttpServletRequest request, HttpServletResponse response) {
try {
int totalOccurrenceRecords = occurrenceManager.getTotalOccurrenceRecordCount();
cc.addObject("totalOccurrenceRecords", totalOccurrenceRecords);
} catch (ServiceException e) {
// flag in the logs
log.error("Occurrence count cannot be found, setting to 0", e);
cc.addObject("totalOccurrenceRecords", 0);
}
}
COM: <s> adds the occurrence count to the request </s>
|
funcom_train/39097824 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getDefault() throws SQLException {
Connection con = getConnection();
try {
PreparedStatement ps = con.prepareStatement(GET_DEFAULT);
ResultSet rs = ps.executeQuery();
if (rs.next())
return rs.getString(1);
rs.close();
ps.close();
} finally {
con.close();
}
return null;
}
COM: <s> gets the default language abbrev </s>
|
funcom_train/49626077 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JSONObject toJSON() {
JSONObject json = new JSONObject();
json.put("clazz", getClass().getCanonicalName());
// id : if available, [n.a.] otherwise
if (getId() != null) {
json.put("id", getId());
} else {
json.put("id", "[n.a.]");
}
return json;
}
COM: <s> serializes the state of the </s>
|
funcom_train/34899323 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public SampleInformation importSampleInformation(SRMFile file) {
String fullPath = file.mapLocal(); // get the local path for this file
log.debug("Importing sample information file: "+fullPath);
if (FileType.TSV.fileMatches(fullPath)){
return importSampleInformation(fullPath);
}
else {
log.error("Invalid sample information file: "+fullPath);
return null;
}
}
COM: <s> import sample information </s>
|
funcom_train/26319398 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void save2(OutputStream os) {
try {
ObjectOutputStream oos = new ObjectOutputStream(os);
oos.writeObject(this);
oos.flush();
} catch (IOException ex) {
System.err.println("i/o error writing board");
System.err.println(ex);
}
}
COM: <s> writes data for the board as serialization to the output stream </s>
|
funcom_train/2611961 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addDictionaryHelper(BufferedReader in) throws IOException {
String line = "";
while (line != null) {
line = in.readLine();
if (line != null && line.length() > 0) {
line = new String(line.toCharArray());
putWordUnique(line);
}
}
}
COM: <s> adds to the existing dictionary from a word list file </s>
|
funcom_train/43245172 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSetEmpStatus() {
System.out.println("setEmpStatus");
String empStatus = "";
EmploymentDataDG1Object instance = new EmploymentDataDG1Object();
instance.setEmpStatus(empStatus);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
COM: <s> test of set emp status method of class org </s>
|
funcom_train/23823523 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void appendString(final String string, final String charsetName) {
if ((string != null) && (string.length() > 0)) {
try {
byte[] stringBuf = string.getBytes(charsetName);
appendBytes(stringBuf, stringBuf.length);
} catch (UnsupportedEncodingException e) {
// omit it
}
}
}
COM: <s> append string using charset name </s>
|
funcom_train/48181239 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void paintComponent(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
super.paintComponent(g2d);
if (parent==null || parent.presented == null) {
return;
}
Rectangle bounds = this.getBounds();
DDGUI.debugln("paintCompo: panel' bounds(x="+bounds.x+",y="+bounds.y+
"; w=" + bounds.width +", h=" + bounds.height+")");
parent.presented.paintFrontier(g2d, new Dimension( bounds.width,bounds.height),
true);
}
COM: <s> paints the component to the screen </s>
|
funcom_train/33756430 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void loadprops() {
try {
ClassLoader loader = SpatialAttributeLookup.class.getClassLoader();
InputStream inputStream = loader
.getResourceAsStream("BioGeomancer.properties");
props = new Properties();
props.load(inputStream);
} catch (Exception e) {
log.error("could not read properties file: " + e.toString());
}
}
COM: <s> loads the properties file </s>
|
funcom_train/3446887 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double getWidthAt(int row) {
if (sizeColumn != null
|| vl == null
|| defaultSize != 0) {
return getSizeAt(row);
}
String label = vl.getLabelAt(row);
if (label == null) {
return getSizeAt(row);
}
return vl.getWidth(label)+2;
}
COM: <s> returns the width of the specified item </s>
|
funcom_train/45050236 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Connection createConnection() throws Exception {
if (driverClass == null) {
throw new Exception("No driver class specified.");
}
if (dbUrl == null) {
throw new Exception("No database URL specified.");
}
Class.forName(driverClass);
return DriverManager.getConnection(dbUrl , user, password);
}
COM: <s> creates a connection </s>
|
funcom_train/31649349 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void actionPerformed(ActionEvent e) {
if (e.getSource() == okay) {
returnValue = ACCEPT_OPTION;
if (dialog != null)
dialog.setVisible(false);
acceptSelection();
}
if (e.getSource() == cancel) {
returnValue = CANCEL_OPTION;
if (dialog != null)
dialog.setVisible(false);
cancelSelection();
}
if (e.getSource() == currentSize) {
fontSizes.setSelectedValue(currentSize.getText(), true);
}
}
COM: <s> processes action events from the okay and cancel buttons </s>
|
funcom_train/3883204 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addSemanticdensityPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_DocumentRoot_semanticdensity_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_DocumentRoot_semanticdensity_feature", "_UI_DocumentRoot_type"),
ImsMdRootv1p1Package.Literals.DOCUMENT_ROOT__SEMANTICDENSITY,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the semanticdensity feature </s>
|
funcom_train/42281869 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void fireTableSelected(Object origin, Table table) {
if(selectedTable != table) {
selectedTable = table;
if(selectedColumn != null && selectedTable != selectedColumn.getTable()) {
selectedColumn = null;
}
Schema schema = selectedTable != null ? selectedTable.getSchema() : null;
fireEvent(Types.TABLE_SELECTED, new Event(origin, schema, null, selectedTable));
}
}
COM: <s> fire an event about a table selection </s>
|
funcom_train/11320596 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public MockContainer setParameter(String fieldName, File file, String contentType) {
if (!started) {
throw new IllegalStateException("Container has not been started yet. Call start() first.");
}
getRequest().setUseMultiPartContentType(true);
getRequest().addFile(fieldName, file, contentType);
return this;
}
COM: <s> convenience method for setting files to be uploaded </s>
|
funcom_train/2712748 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void updateCaretWidth(int caretWidth) {
TypingMode mode = getDocument().getProperty("TypingMode") == null
? TypingMode.INSERT
: (TypingMode) getDocument().getProperty("TypingMode");
if (mode == TypingMode.INSERT) {
this.putClientProperty("caretWidth", caretWidth);
} else {
this.originalCaretWidth = caretWidth;
}
}
COM: <s> updates caret width </s>
|
funcom_train/24050044 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void copyNodesAndLabels(GeometryGraph geomGraph, int argIndex) {
for (Iterator nodeIt = geomGraph.getNodeIterator(); nodeIt.hasNext();) {
Node graphNode = (Node) nodeIt.next();
Node newNode = nodes.addNode(graphNode.getCoordinate());
newNode.setLabel(argIndex,
graphNode.getLabel().getLocation(argIndex));
// node.print(System.out);
}
}
COM: <s> copy all nodes from an arg geometry into this graph </s>
|
funcom_train/19378160 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String getTranslationFragment(String fragmentName) {
String methodName = "getTranslatedFragment";
ExceptionUtils.checkEmpty(methodName, "fragmentName", fragmentName);
String fragmentString = null;
if (this.libraryTranslation!= null) {
fragmentString = this.libraryTranslation.getTranslationFragment(
fragmentName, this.getExpression().getKind());
}
return fragmentString;
}
COM: <s> finds the fragment with the specified code fragment name code </s>
|
funcom_train/47492215 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getStartPollCommand() {
if (startPollCommand == null) {//GEN-END:|95-getter|0|95-preInit
// write pre-init user code here
startPollCommand = new Command("Iniciar", Command.OK, 0);//GEN-LINE:|95-getter|1|95-postInit
// write post-init user code here
}//GEN-BEGIN:|95-getter|2|
return startPollCommand;
}
COM: <s> returns an initiliazed instance of start poll command component </s>
|
funcom_train/50612688 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void validateField(FieldModel model) {
cat.debug("Validating FieldModel node.");
if (model.getClassType() == null) {
errors.add(new ValidationError(model, 8));
return;
}
if (model.getClassType().getParent() != model.getParent().getParent()) {
errors.add(new ValidationError(model, 7));
}
validateNameable(model);
}
COM: <s> validates a field model </s>
|
funcom_train/38828321 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void setOldValue() {
try {
if ( _theParam.isDefined() ) {
_oldValue = _theParam.getValue();
// Round off the value to the current display format.
if (_nf != null) {
String text = _nf.format(_oldValue);
_oldValue = _nf.parse(text).doubleValue();
}
} else
_oldValue = Double.NaN;
} catch( ParseException err ) {
// Shouldn't be possible.
err.printStackTrace();
}
}
COM: <s> set the old value of the parameter associated with this </s>
|
funcom_train/7646668 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean delete() {
SecurityManager security = System.getSecurityManager();
if (security != null) {
security.checkDelete(path);
}
byte[] propPath = properPath(true);
if ((path.length() != 0) && isDirectoryImpl(propPath)) {
return deleteDirImpl(propPath);
}
return deleteFileImpl(propPath);
}
COM: <s> deletes this file </s>
|
funcom_train/22172287 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void saveCurrentAndQuit(boolean forceIfNoLesson) {
String lesson = getModel().getCurrentLesson();
if (lesson != null) {
_importExportController.saveLessonAndQuit(lesson);
} else {
if (forceIfNoLesson) {
quit();
} else {
showConfirmQuit();
}
}
}
COM: <s> save the current lesson if any and quit </s>
|
funcom_train/40403352 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testCreateBinding() {
Person personA = new Person();
TextBox textBox = new TextBox();
personA.setFullname("Person A");
BindingBuilder builder = new BindingBuilder();
Binding<Person, String, TextBox, String> binding = builder
.createBinding(personA, "fullname", String.class, textBox,
"text", String.class, new TextBoxAdapterProvider());
// if all goes well we should pass
Assert.assertTrue(binding.isBound());
}
COM: <s> tests the normal course of building a binding using </s>
|
funcom_train/1095313 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setDate(Date aDate)
{
if (aDate != null)
{
mDateLabel = new AeTextLabel( formatDate(aDate) );
mDateLabel.setForeground(TEXT_COLOR);
mDateLabel.setFont(AeUiPrefs.getDefaultPrefs().getFont());
}
}
COM: <s> sets the current time stamp </s>
|
funcom_train/42012745 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JTextField getJTFTotal() {
if (jTFTotal == null) {
jTFTotal = new JTextField();
jTFTotal.setBounds(new Rectangle(142, 354, 211, 20));
jTFTotal.setHorizontalAlignment(JTextField.TRAILING);
jTFTotal.setEditable(false);
jTFTotal.setText("0 €");
}
return jTFTotal;
}
COM: <s> this method initializes j tftotal </s>
|
funcom_train/19035835 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void serverInitialized() {
if(isConnected()) {
try {
synchronized(this) {
this.getOutputStream().writeInt(ServerMessageCode.SERVERINITIALIZED.getIndex());
this.getOutputStream().flush();
}
} catch (IOException e) {
this.messageFailed(e);
}
}
}
COM: <s> tells the client the server has been initialized </s>
|
funcom_train/10681519 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ReplyPacket setThreadStart() {
// Prepare corresponding event
byte eventKind = JDWPConstants.EventKind.THREAD_START;
byte suspendPolicy = JDWPConstants.SuspendPolicy.ALL;
EventMod[] mods = new EventMod[0];
Event event = new Event(eventKind, suspendPolicy, mods);
return setEvent(event);
}
COM: <s> sets thread start event request </s>
|
funcom_train/11348874 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Element getElement() {
ensureValidity();
Element instance = new Element("instance", "");
instance.addAttribute(new Attribute("component", m_type));
for (int i = 0; i < m_conf.size(); i++) {
Element elem = (Element) m_conf.get(i);
instance.addElement(elem);
}
return instance;
}
COM: <s> gets the instance description in the element attribute form </s>
|
funcom_train/50168057 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addChildren(ArrayList recordObjects) {
RecordModel containingRecord = getContainingRecord();
int numberOfRecords = recordObjects.size();
for ( int i = 0; i < numberOfRecords; i++) {
Object currentRecordObject
= recordObjects.get(i);
addChildToField(currentRecordObject);
} // end for ()
ChangeObject changeObject
= new ChangeObject(containingRecord,
ChangeObject.CHILDREN_CREATED);
changeObject.setChildren(recordObjects);
containingRecord.fireChangeEvent(changeObject);
}
COM: <s> for adding multiple items to a list </s>
|
funcom_train/7622912 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void invalidateDrawable(Drawable drawable) {
if (verifyDrawable(drawable)) {
final Rect dirty = drawable.getBounds();
final int scrollX = mScrollX;
final int scrollY = mScrollY;
invalidate(dirty.left + scrollX, dirty.top + scrollY,
dirty.right + scrollX, dirty.bottom + scrollY);
}
}
COM: <s> invalidates the specified drawable </s>
|
funcom_train/41399325 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public float getZ(double xa, double ya) {
Integer ix = MathUtilities.nearInclusive(x, xa);
Integer iy = null;
float za = Float.NaN;
if (ix != null) {
iy = MathUtilities.nearInclusive(y, ya);
if (iy != null) {
za = z[iy][ix];
}
}
return za;
}
COM: <s> retrieve the elevation at the given x and y coordinate </s>
|
funcom_train/23969959 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public OrderedHashSet visibleGrantees() {
OrderedHashSet grantees = new OrderedHashSet();
GranteeManager gm = granteeManager;
if (isAdmin()) {
grantees.addAll(gm.getGrantees());
} else {
grantees.add(this);
Iterator it = getAllRoles().iterator();
while (it.hasNext()) {
grantees.add(it.next());
}
}
return grantees;
}
COM: <s> iteration of all visible grantees including self </s>
|
funcom_train/13874725 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addIsDeferredPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_ResolveExp_isDeferred_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_ResolveExp_isDeferred_feature", "_UI_ResolveExp_type"),
QvtoperationalPackage.Literals.RESOLVE_EXP__IS_DEFERRED,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the is deferred feature </s>
|
funcom_train/19072246 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void saveDrawing(StorageFormat storeFormat, String file) {
try {
setDrawingTitle(storeFormat.store(file, drawing()));
((JooneStandardDrawingView)view()).setModified(false);
}
catch (IOException e) {
showStatus(e.toString());
}
}
COM: <s> save a drawing in a file </s>
|
funcom_train/31904981 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void append(Rule r) {
if (size == rules.length) {
Rule[] t = new Rule[size * 2];
for (int i = 0; i < size; i++) {
t[i] = rules[i];
}
rules = t;
}
rules[size++] = r;
}
COM: <s> appends a rule to the stylesheet </s>
|
funcom_train/12643672 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void drawRoundRect(int x, int y, int w, int h, int arcWidth, int arcHeight) {
pDrawRoundRect(psd, x + originX, y + originY, w, h, arcWidth, arcHeight);
}
COM: <s> draws a rounded rectangle </s>
|
funcom_train/17686601 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean hasSerialVersionUID(){
Field [] fields = classGen.getFields();
for(int i = 0; i < fields.length; i++) {
Field f = fields[i];
if (f.getName().equals("serialVersionUID")){
return true;
}
}
return false;
}
COM: <s> check if current class has a serial version uid </s>
|
funcom_train/21015941 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createOptionsArea(final Composite workArea) {
Composite optionsGroup = new Composite(workArea, SWT.NONE);
GridLayout layout = new GridLayout();
layout.marginWidth = 0;
optionsGroup.setLayout(layout);
optionsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
optionsGroup.setEnabled(true);
}
COM: <s> create the area with the extra options </s>
|
funcom_train/36012507 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void updateFilterEnabled(String filterName, boolean isEnabled) {
String phaseName = this.phaseCombo.getText();
FilterPhase filterPhase = this.phaseNameFilterPhaseMap.get(phaseName);
if (filterName != null) {
FilterEntry entry = filterPhase.getFilterEntry(filterName);
entry.setEnabled(isEnabled);
}
else {
filterPhase.setEnabled(isEnabled);
}
}
COM: <s> updates the filter enable status </s>
|
funcom_train/3598112 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testDominanceMultiLevel() {
try {
List results = engine.search(nom, "($w word)($s s):$s^$w");
results.remove(0); // remove list of vars
Collections.sort(results, new SearchResultIDComparator());
assertTrue(results.size()==8);
NOMElement r1 = (NOMElement)((List)results.get(7)).get(0);
NOMElement r2 = (NOMElement)((List)results.get(7)).get(1);
assertTrue(r1.getID().equals("w_8"));
assertTrue(r2.getID().equals("s_1"));
} catch (Throwable ex) {
ex.printStackTrace();
fail("Dominance through multiple levels failed!");
}
}
COM: <s> check dominance through multiple layers of a hieraarchy is ok </s>
|
funcom_train/42398092 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getProperty(final String name) throws GeneratorException {
try {
final TreeLogger logger = this.getLogger().getTreeLogger();
return this.getPropertyOracle().getPropertyValue(logger, name);
} catch (final BadPropertyValueException caught) {
throw new GeneratorException("Unable to get property value for \"" + name + "\", message: " + caught.getMessage(), caught);
}
}
COM: <s> retrieves the value for a given property name </s>
|
funcom_train/50083350 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Element getAsXMLElement() {
Element dbConnetion = new Element(DBCONNECTION_POSTGRES);
dbConnetion.addContent(new Element(DBURL).addContent(this.dbURL));
dbConnetion.addContent(new Element(DBUSER_NAME).addContent(this.userName));
dbConnetion.addContent(new Element(DBUSER_PASSWORD).addContent(this.userPassword));
dbConnetion.addContent(new Element(SQLQUERY).addContent(this.sqlStatement));
return dbConnetion;
}
COM: <s> get an xml element of this object </s>
|
funcom_train/50849133 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testUpdateNCharacterStream() throws Exception {
if (!isTestUpdates()) {
return;
}
try {
ResultSet rs = this.newUpdateableJdbcResultSet();
rs.next();
String value = "NChars";
rs.updateNCharacterStream("clob_column", new StringReader(value));
rs.updateNCharacterStream("clob_column", new StringReader(value),value.length());
} catch (Exception e) {
fail(e.toString());
}
}
COM: <s> test of update ncharacter stream method of interface java </s>
|
funcom_train/8651636 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected int determineAdjustedIncrementSize(String optimizationStrategy, int incrementSize) {
if ( OptimizerFactory.NONE.equals( optimizationStrategy ) && incrementSize > 1 ) {
log.warn( "config specified explicit optimizer of [" + OptimizerFactory.NONE + "], but [" + INCREMENT_PARAM + "=" + incrementSize + "; honoring optimizer setting" );
incrementSize = 1;
}
return incrementSize;
}
COM: <s> in certain cases we need to adjust the increment size based on the </s>
|
funcom_train/31300631 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String object2Date(Object o) {
String result = null;
if (o instanceof Date) {
result = date2DateString((Date) o);
} else if (o instanceof Long) {
result = long2DateString((Long) o);
} else if (o instanceof Integer) {
result = int2DateString((Integer) o);
} else if (o instanceof String) {
result = string2DateString((String) o);
} else {
throw new IllegalArgumentException("only date, long, integer or string allowed: " + o.getClass());
}
return result;
}
COM: <s> determine the date according to an input object </s>
|
funcom_train/13955400 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addDelegateAtStart(Object delegate) {
synchronized (delegates) {
if (hasDelegate(delegate)) {
throw new IllegalArgumentException("Delegate is already included");
}
_NSDelegate delegateObject = new _NSDelegate(getClass(), delegate);
delegates.insertObjectAtIndex(delegateObject, 0);
}
}
COM: <s> adds code delegate code at the start of the chain </s>
|
funcom_train/32156089 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JSpinner getDuration() {
if (duration == null) {
duration = new JSpinner(new SpinnerNumberModel(1, 1, 8, 1));
duration.setBounds(new Rectangle(490, 25, 60, 24));
durationLabel = new JLabel();
durationLabel.setBounds(new Rectangle(330, 25, 150, 22));
durationLabel.setText(DurationOfMeetings);
durationLabel.setHorizontalAlignment(JLabel.RIGHT);
}
return duration;
}
COM: <s> this method initializes duration </s>
|
funcom_train/38322040 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private List getExistingPolls(Project project) {
List list = null;
try {
list = HibernateUtil.find("FROM " + VoteData.class.getName() + " as vote "
+ "WHERE vote.projectId = ? " + "ORDER BY vote.id",
project.getId(), Hibernate.LONG);
} catch (Throwable t) {
System.out.println("Hibernate session throws " + t);
}
return list;
}
COM: <s> get all polss for this project </s>
|
funcom_train/10182442 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void clientConnectionClosed(XAClientConnection clientCon) {
synchronized (clientConnections) {
clientConnections.remove(clientCon);
}
if (clientConnections.size() > 0)
return; // Only take action if the last connection referring to this
// is closed
Vector local = (Vector) listeners.clone();
for (int i = local.size() - 1; i >= 0; i--)
((ConnectionEventListener) local.elementAt(i))
.connectionClosed(new ConnectionEvent(this));
// if(!trans)
// transactionFinished();
}
COM: <s> indicates that the connection given to the client has been closed </s>
|
funcom_train/12810268 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void cellLayout(PdfPCell cell, Rectangle position, PdfContentByte[] canvases) {
writer.addAnnotation(new PdfAnnotation(writer,
position.getLeft(), position.getBottom(), position.getRight(), position.getTop(),
action));
}
COM: <s> implementation of the cell layout method </s>
|
funcom_train/3888778 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void putValue(String key, String value) {
if(_doc != null) {
// Ensure we have a root element
Element root = _doc.getRootElement();
if(root == null) {
root = new Element(getElementRootName());
_doc.setRootElement(root);
}
// Do we have it already?
Element element = root.getChild(key);
if(element != null) {
element.setText(value);
}
// New one
else {
element = new Element(key);
element.setText(value);
root.addContent(element);
}
}
}
COM: <s> put a key and value </s>
|
funcom_train/16678391 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initListeners() {
CommunicationManager.addConnectionListener(new ConnectionListener( ) {
@Override
public void connectionEstablished(@SuppressWarnings("unused")
ConnectionEvent event) {
// not used
}
@Override
public void disconnected(ConnectionEvent event) {
if (event.getRobotName( ).equals(robot.getName( ))) {
sendQueue.clear( );
receiveQueue.clear( );
data.clear( );
}
}
});
}
COM: <s> initializes all robot dependant listeners for this datapool </s>
|
funcom_train/45598818 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void open() throws IOException {
if (!checkClose())
return;
File f = GUIUtils.open(new FileNameExtensionFilter[]{new javax.swing.filechooser.FileNameExtensionFilter("PJC PackJacket Configuration (.pjc)", new String[]{"pjc"})});
open(f, true);
}
COM: <s> asks user to open pjc </s>
|
funcom_train/3785068 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean setROI(int rX1, int rY1, int rX2, int rY2)
{ /* setROI */
roiX1= rX1;
roiY1= rY1;
roiX2= rX2;
roiY2= rY2;
if(!forceROIUpperAndLowerCorners())
return(false);
return(true);
} /* setROI */
COM: <s> set roi set computing window region of interest roi </s>
|
funcom_train/1444653 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addPossibleStateToList(AbstractState state) {
double assessment = state.getStateAssessment();
int i = 0;
for (; i < this.possibleStates.size(); i++) {
if (this.possibleStates.get(i).getStateAssessment() < assessment) {
break;
}
}
this.possibleStates.add(i, state);
}
COM: <s> adds a state to the possible states </s>
|
funcom_train/23949678 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void init() {
setForeground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW));
setBackground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW));
addFocusUnfocusEventHandlers();
addReturnKeyEventHandler();
setReturnKeyCommand(new ReturnKeyCommand<Integer>() {
@Override public Integer command() {
log.warn("No return key command defined for widget, please disable feature on widget or define action.");
return null;
}
});
}
COM: <s> handles initialization functions </s>
|
funcom_train/10804900 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int readHeader(char[] buf, int off, int len) {
int read = 0;
for (; len > 0 && _headerPos < _header.length; read++, off++, len--)
buf[off] = _header[_headerPos++];
return read;
}
COM: <s> read from the buffered header to the given array returning the </s>
|
funcom_train/27823043 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void deleteOIModel() throws KAONException {
try {
m_kaonConnection.getEngineeringServer().deleteOIModel(m_kaonConnection.getConnectionIdentifier(),m_modelID);
}
catch (RemoteException e) {
throw new KAONException("Error in remote call",e);
}
}
COM: <s> deletes the model </s>
|
funcom_train/37822502 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setSearchTextHighlighter(int start, int end) {
try {
tastwithcode.getHighlighter().removeAllHighlights();
tastwithdesc.getHighlighter().removeAllHighlights();
tastwithcode.getHighlighter().addHighlight(start, end,
new DefaultHighlighter.DefaultHighlightPainter(GUIConstants.SEARCHTEXT_HIGHLIGHT));
tastwithdesc.getHighlighter().addHighlight(start, end,
new DefaultHighlighter.DefaultHighlightPainter(GUIConstants.SEARCHTEXT_HIGHLIGHT));
}
catch(BadLocationException ble) {
ble.printStackTrace();
}
catch(NullPointerException npe) {
}
}
COM: <s> sets the highlighter in the searchtextarea </s>
|
funcom_train/12638519 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String encode(byte aBuffer[]) {
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
ByteArrayInputStream inStream = new ByteArrayInputStream(aBuffer);
String retVal = null;
try {
encode(inStream, outStream);
// explicit ascii->unicode conversion
retVal = outStream.toString("8859_1");
} catch (Exception IOException) {
// This should never happen.
throw new Error("ChracterEncoder::encodeBuffer internal error");
}
return (retVal);
}
COM: <s> a streamless version of encode that simply takes a buffer of </s>
|
funcom_train/27782606 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Cell merge(Cell m, Cell e) {
if (m.cmd == e.cmd && m.ref == e.ref && m.skip == e.skip) {
Cell c = new Cell(m);
c.cnt += e.cnt;
return c;
} else {
return null;
}
}
COM: <s> merge the given cells and return the resulting cell </s>
|
funcom_train/1529977 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: final public void removeFromUpdateSets(AlgoElement algorithm) {
boolean removed = algoUpdateSet != null && algoUpdateSet.remove(algorithm);
if (removed) {
// propagate up the graph
if (algoParent != null) {
GeoElement [] input = algoParent.getInputForUpdateSetPropagation();
for (int i = 0; i < input.length; i++) {
input[i].removeFromUpdateSets(algorithm);
}
}
}
}
COM: <s> remove algorithm from update sets up the construction graph </s>
|
funcom_train/20874814 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean canEnroll(Enrollment enrollment) {
// Check if student can use this reservation
if (!isApplicable(enrollment.getStudent())) return false;
// Check if the enrollment meets the reservation
if (!isIncluded(enrollment)) return false;
// Check the limit
return getLimit() < 0 || getUsedSpace() + enrollment.getRequest().getWeight() <= getLimit();
}
COM: <s> true if the enrollment can be done using this configuration </s>
|
funcom_train/5244084 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void begin() {
// We assume it makes no difference the exact order the agents and the
// environment (if relevant) start in so make this atomic.
System.out.println("entered begin");
specification.createAutomaton();
specification.checkProperties();
mas.MCAPLstart();
for (MCAPLAgent a: agents.values()) {
System.out.println("starting agent" + a.getName());
a.start();
}
mainconcluded = true;
}
COM: <s> starts the controller and the underlying system and agents </s>
|
funcom_train/20116445 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setController(Element source) {
if (source.hasAttribute(CONTROLLER_ATTRIBUTE)) {
String action = source.getAttribute(CONTROLLER_ATTRIBUTE);
if (action!=null && !action.isEmpty()) {
this.action = action;
} else {
throw new MailException(MailException.MAIL_CONFIG_INVALID_CONTROLLER_ATTR,"Invalid controller attribute value for source element");
}
}
}
COM: <s> setter of controller name from source attribute </s>
|
funcom_train/41721871 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setNumericAttributes(Map<String,AttributeExpression> numericAttributes) {
// Create a list of equal weights
Map<String,Double> numericWeights = new HashMap<String,Double>();
int numericsSize = numericAttributes.size();
for (String name : numericAttributes.keySet()) {
numericWeights.put(name, (double) 1/numericsSize);
}
// Set the attributes with those weights
setNumericAttributes(numericAttributes,numericWeights);
}
COM: <s> sets the numeric attributes </s>
|
funcom_train/44222088 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void flushForm () {
Iterator it = this.getCurrentControlVector().iterator();
while (it.hasNext()) {
FormControl fc = (FormControl) it.next();
try {
fc.flushData();
}
//
// We want to catch this exception. This is not OK.
//
catch (Exception e) {
e.printStackTrace();
}
}
}
COM: <s> flush the data from form controls to the view instance </s>
|
funcom_train/45483910 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void distributeMessage(ChatMemberModelInterface modelInterface, ChatMemberModelInterface from, MessageInterface message) throws RemoteException {
if (modelInterface != null && !(modelInterface.getName().equals(from.getName()))) {
modelInterface.receiveOrDistributeMessage(this, message);
}
}
COM: <s> finally distribute the message to the children or parent </s>
|
funcom_train/1213687 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setWinner(String s) {
if (this.red.getFirstInitialLastName().equalsIgnoreCase(s)) {
setWinner(this.red);
} else if (this.green.getFirstInitialLastName().equalsIgnoreCase(s)) {
setWinner(this.green);
} else {
logger.error("Winner is not valid : s=[" + s + "]");
}
}
COM: <s> set the winner based on the first initial last name string </s>
|
funcom_train/5868735 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void clientInputDecode(FacesContext context) {
String clientId = this.getClientId(context);
Map requestMap = context.getExternalContext().getRequestParameterMap();
if (requestMap.containsKey(clientId)) {
String newValue = (String)context.getExternalContext().getRequestParameterMap().get(clientId);
if("on".equals(newValue)){
setSubmittedValue("true");
return;
}
}
setSubmittedValue("false");
}
COM: <s> override method decode value in requests parameter </s>
|
funcom_train/51237406 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JFrame getJFrame() {
if (jFrame == null) {
jFrame = new JFrame();
jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jFrame.setJMenuBar(getJJMenuBar());
jFrame.setSize(800, 600);
jFrame.setContentPane(getJContentPane());
jFrame.setTitle("PracticeMaster");
}
return jFrame;
}
COM: <s> this method initializes j frame </s>
|
funcom_train/6319485 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public EmptyResponse updateApplication(UpdateApplicationRequest updateRequest)throws RemoteException, BaseFaultType{
ApplicationContext app = null;
try {
Object obj = HelperUtil.parseObject(updateRequest.get_any());
if(obj != null)
app = (ApplicationContext) obj;
broker.updateApplication(app);
} catch (Exception e) {
throw new RemoteException("Failed to save application context "+e.getMessage(),e);
}
return new EmptyResponse();
}
COM: <s> save application context from the application resource to database </s>
|
funcom_train/22183777 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initialize() {
this.setLayout(null);
this.setSize(n24, n23);
this.setTitle("Frame");
this.add(getPanel(), null);
this.add(getPanel1(), null);
this.add(getPanel2(), null);
this.add(getPanel3(), null);
this.add(getPanel4(), null);
}
COM: <s> this method initializes this </s>
|
funcom_train/1373186 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void getFailed(Message msg){
bpanel.drawChess(msg.coordinateX,msg.coordinateY);
JOptionPane.showMessageDialog(null,
"Sorry,You've failed the game",
"Try Again",
JOptionPane.INFORMATION_MESSAGE);
label3.setText("Player2");
// have a new game to continue to play
newGame();
}
COM: <s> failed the game and have a new one </s>
|
funcom_train/3415569 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getPoolSize() {
final ReentrantLock mainLock = this.mainLock;
mainLock.lock();
try {
// Remove rare and surprising possibility of
// isTerminated() && getPoolSize() > 0
return runStateAtLeast(ctl.get(), TIDYING) ? 0
: workers.size();
} finally {
mainLock.unlock();
}
}
COM: <s> returns the current number of threads in the pool </s>
|
funcom_train/25421259 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public HttpSession extractHttpSession() {
Object o = null;
ExternalContext ec = getExternalContext();
if (ec != null) o = ec.getSession(true);
if ((o != null) && (o instanceof HttpSession)) {
return (HttpSession)o;
} else {
return null;
}
}
COM: <s> extracts the http session from the faces context instance </s>
|
funcom_train/5461592 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void text(String text) throws IOException {
// Escape special characters in text
text = StringUtil.replace("&", "&", text);
text = StringUtil.replace("<", "<", text);
text = StringUtil.replace("]]>", "]]>", text);
writer.write(text);
}
COM: <s> writes a piece of text </s>
|
funcom_train/14416459 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setLogger(Logger newLogger) {
if (!isGlobal()) throw new IllegalStateException(
"Logger settings can be changed via the global properties instance only.");
setProperty(KEY_LOGGER_NAMESPACE, logger.getName());
setProperty(KEY_LOGGER, logger.getLevel().intValue() < Level.OFF.intValue() ? Boolean
.toString(true) : Boolean.toString(false));
logger = newLogger;
}
COM: <s> allows applications to specify external code logger code to be used </s>
|
funcom_train/9759948 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void updateCache(IStorageEditorInput input) throws CoreException {
StorageInfo info= (StorageInfo) getElementInfo(input);
if (info != null) {
try {
IStorage storage= input.getStorage();
if (storage != null) {
boolean readOnly= storage.isReadOnly();
info.fIsReadOnly= readOnly;
info.fIsModifiable= !readOnly;
}
} catch (CoreException x) {
handleCoreException(x, TextEditorMessages.StorageDocumentProvider_updateCache);
}
info.fUpdateCache= false;
}
}
COM: <s> updates the internal cache for the given input </s>
|
funcom_train/41705586 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void drawImage(Graphics g, Image img, int imgx, int imgy, int x, int y, int w, int h) {
Graphics ng = g.create();
try {
ng.clipRect(x, y, w, h);
ng.drawImage(img, imgx, imgy, this);
} finally {
ng.dispose();
}
}
COM: <s> this utility method draws a rectangular subset of a highlight image </s>
|
funcom_train/46458011 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double evaluate(double x) {
if (function == null) return Double.NaN;
double[] supportValues = evaluateSupportFunctions(x);
int n = supportValues.length + paramValues.length + 1;
double[] values = new double[n];
values[0] = x;
System.arraycopy(paramValues, 0, values, 1, paramValues.length);
System.arraycopy(supportValues, 0, values, 1+paramValues.length, supportValues.length);
return function.evaluate(values);
}
COM: <s> evaluates the function for a single variable x </s>
|
funcom_train/1578155 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getContext() {
String xmlContext = "";
if ( source != null ) {
int n = source.get_startLine();
xmlContext += "line " + n;
String fileName = source.get_fileName();
xmlContext += " of " + fileName;
addContext(xmlContext);
errorLocation = new ErrorContext(n, fileName, super.getMessage());
}
return context;
}
COM: <s> gets the context </s>
|
funcom_train/8685271 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addDataTypeDefinition(String typeName, Class typeClass) {
AntTypeDefinition def = new AntTypeDefinition();
def.setName(typeName);
def.setClass(typeClass);
updateDataTypeDefinition(def);
project.log(" +User datatype: " + typeName + " "
+ typeClass.getName(), Project.MSG_DEBUG);
}
COM: <s> adds a new datatype definition </s>
|
funcom_train/22489208 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void run() {
try {
if(targetBrowser != null) {
launcher.openURLinBrowser(targetBrowser, url);
} else {
launcher.openURLinBrowser(url);
}
}
catch (Exception ex) {
launcher.getLogger().error("fatal error opening url", ex);
errorHandler.handleException(ex);
}
}
COM: <s> when an object implementing interface code runnable code is used to </s>
|
funcom_train/3183879 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getA1Reference() {
StringBuffer sb = new StringBuffer();
sb.append(Address.calculateColumn(c1));
sb.append(r1);
sb.append(":");
sb.append(Address.calculateColumn(c2));
sb.append(r2);
return sb.toString();
}
COM: <s> gets a string in a1 reference style denoting the range of this area </s>
|
funcom_train/10191505 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void call(String target_url)
{ ua.hangup();
ua.printLog("UAC: CALLING "+target_url);
if (!ua.m_userProfile.m_bUseAudio && !ua.m_userProfile.m_bUseVideo) ua.printLog("ONLY SIGNALING, NO MEDIA");
ua.call(target_url);
}
COM: <s> makes a new call </s>
|
funcom_train/2893269 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isValidSite(String id) {
if (sites == null)
return false;
int nSites = sites.size();
Site site = null;
for (int i = 0; i < nSites; i++) {
site = (Site) sites.get(i);
if (site.id.getKey().equals(id))
return true;
}
return false;
}
COM: <s> check if site is in cached list </s>
|
funcom_train/25702095 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void segmentVertexRemoved(boolean local, int entityID, int vertexID) {
if (mainScene == null)
return;
X3DNode transform = (X3DNode) modelMap.get(entityID);
MFNode children = (MFNode) transform.getField("children");
generateX3D(entityID, children, mainScene);
}
COM: <s> a vertex was removed from the segment sequence </s>
|
funcom_train/1148041 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getBackCommand6() {
if (backCommand6 == null) {//GEN-END:|170-getter|0|170-preInit
// write pre-init user code here
backCommand6 = new Command("Back", Command.BACK, 0);//GEN-LINE:|170-getter|1|170-postInit
// write post-init user code here
}//GEN-BEGIN:|170-getter|2|
return backCommand6;
}
COM: <s> returns an initiliazed instance of back command6 component </s>
|
funcom_train/44161742 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setViewable(String fieldname, String value) {
Field field = null;
for (int i = 0; i < this.fieldsToAdd.size(); i++) {
field = (Field)this.fieldsToAdd.get(i);
if (fieldname.equals(field.getStructure() + "."
+ field.getColumnname())) {
field.setDisplay(value);
}
}
}
COM: <s> set viewable sets view state </s>
|
funcom_train/50892009 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSimpleConstructor() throws Exception {
LabyPosition pos = new LabyPosition();
assertEquals("Invalid X-Position", 0, pos.getX());
assertEquals("Invalid Y-Position", 0, pos.getY());
assertEquals("Invalid Z-Position", 0, pos.getZ());
}
COM: <s> tests the constructor without parameters </s>
|
funcom_train/48553022 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void render(int[] pieces, int[][] segments, int threads){
initRender();
Runnable rt[] = new Runnable[threads];
for(int i = 0; i < threads; ++i){
rt[i] = new RenderThread(pieces, segments[i][0], segments[i][1]);
new Thread(rt[i]).start();
}
}
COM: <s> performs a multithreaded render of a partial part of the scene </s>
|
funcom_train/12563071 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void unregister(MIDletPeer m) {
// Find it in the list and switch the last one for it.
for (int i = 0; i < nmidlets; i++) {
if (m == midlets[i]) {
// Switch the last MIDlet into that offset.
midlets[i] = midlets[nmidlets-1];
// null out from array and remove from map to allow for GC
midlets[--nmidlets] = null;
break;
}
}
}
COM: <s> removes a midlet from the list if it is there </s>
|
funcom_train/47483288 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Tag remove(Integer ID) {
if (!tagTable.containsKey(ID)) return null;
for (Event e : EventManager.getInstance().getAll()) {
e.remove(ID);
}
Tag tag = (Tag) tagTable.remove(ID);
save();
return tag;
}
COM: <s> remove a tag </s>
|
funcom_train/14266096 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public List getBestPongs() {
synchronized(PONGS) {
Iterator iter = PONGS.iterator();
int i = 0;
List pongs = new LinkedList();
for(;iter.hasNext() && i<NUM_HOPS; i++) {
pongs.add((PingReply)iter.next());
}
return pongs;
}
}
COM: <s> accessor for the tt set tt of cached pongs </s>
|
funcom_train/27757755 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void grow(int size) {
size += stack.length;
Object newStack[] = new Object[size];
// TODO a little dumb here
// TODO maybe we should know how much to copy
for(int i = 0; i < stack.length; i++){
newStack[i] = stack[i];
}
stack = newStack;
}
COM: <s> grows the stack by a given amount </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.