__key__
stringlengths 16
21
| __url__
stringclasses 1
value | txt
stringlengths 183
1.2k
|
---|---|---|
funcom_train/4124937 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void attemptGiftToSettlement(Unit unit, Settlement settlement) {
Canvas canvas = freeColClient.getCanvas();
Goods goods;
goods = canvas.showSimpleChoiceDialog(Messages.message("gift.text"),
Messages.message("cancel"),
unit.getGoodsList());
if (goods != null) {
deliverGiftToSettlement(unit, settlement, goods);
}
}
COM: <s> user interaction for delivering a gift to the natives </s>
|
funcom_train/43526259 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addIsSynchronizedPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Method_isSynchronized_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Method_isSynchronized_feature", "_UI_Method_type"),
CallGraphPackage.Literals.METHOD__IS_SYNCHRONIZED,
true,
false,
false,
ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the is synchronized feature </s>
|
funcom_train/5576880 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void updateForPlaybackState() {
if (myManagement.getBackgroundWorkerStatus() != ReturnValues.BG_WORKING){
m.busy.setVisible(false);
PlaybackType t = myManagement.getPlaybackStatus();
if (t.equals(PlaybackType.PAUSED)) {
updateFlow(X4XConfiguration.getLangString("paused"));
}
else if (t.equals(PlaybackType.PLAYING)) {
updateFlow("");
}
else {
updateFlow(X4XConfiguration.getLangString("stopped"));
m.progress.setPosition(0);
m.progress.setToolTipText("0:00");
}
}
else {
m.busy.setVisible(true);
}
}
COM: <s> update flowtext status after getting current playbackstate </s>
|
funcom_train/48935216 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double getTotal(int customerID) {
double total = 0;
for( int i = 0; i < this.getSize(); i++ ) {
if( list.get(i).getCustomerID() == customerID ) {
total += list.get(i).getAmount();
}
}
return total;
}
COM: <s> retrieves the total </s>
|
funcom_train/25039714 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Actuator getActuatorWithId(int id) {
boolean found = false;
Actuator actuator = null;
Iterator<Actuator> i = actuators.iterator();
while (!found && i.hasNext()) {
actuator = i.next();
if (id == actuator.getId()) {
found = true;
}
}
if (!found) {
throw new RuntimeException("Cannot find actuator with id: " + id + ". (" + actuators.size() + " actuators available)");
}
return actuator;
}
COM: <s> get an actuator with a specific id </s>
|
funcom_train/3391615 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void writeTypeParamInfo() {
if (classDoc.typeParamTags().length > 0) {
dl();
dt();
TagletOutput output = (new ParamTaglet()).getTagletOutput(classDoc,
getTagletWriterInstance(false));
print(output.toString());
dlEnd();
}
}
COM: <s> write the type parameter information </s>
|
funcom_train/45834667 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public PrivacyList getActiveList() {
if (activeList != null) {
try {
return PrivacyListManager.getInstance().getPrivacyList(getUsername(), activeList);
} catch (UserNotFoundException e) {
Log.error(e.getMessage(), e);
}
}
return null;
}
COM: <s> returns the privacy list that overrides the default privacy list </s>
|
funcom_train/18037713 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setSaxConverterArgumentURI(String URI) throws WrongArgsException {
try {
saxConverter.setArguments(URI);
} catch (SaxConverterException e) {
WrongArgsException ne = new WrongArgsException("Error in the argument of the SAXConverter: " + e.getMessage());
ne.initCause(e);
throw ne;
}
}
COM: <s> the argument for the saxconverter </s>
|
funcom_train/18243537 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void saveDelegateAssembly(ICollection pCollection) throws SeqdataException {
try {
this.delegateAssembly.save(pCollection);
}
catch (SeqdataException se) {
Log.log(Log.ERROR, new Throwable(), se,
ResourceUtil.getMessage(TDBCollectionAssembly.class, "caught_seqdata_exception"));
throw se;
}
}
COM: <s> save the delegate assembly to the datastore </s>
|
funcom_train/43467914 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean checkArgs(int size, int min, int max) throws ZXException {
if (size >= min && size <= max) {
return true;
}
/**
* The number of arguements does not match the range specified.
*/
throw new ZXException("Arguments (" + size + ") is not within range ("
+ min + " to " + max + ")");
}
COM: <s> check whether the size if within the min max range </s>
|
funcom_train/5526095 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void gotoTabLine (int n, int pos, int tabsize)
{ if (n<0) return;
gotoLine(n);
if (pos<0) pos=0;
int i,k=0;
char a[]=CursorLine.getCharacters();
int L=CursorLine.length();
for (i=0; i<L; i++)
{ if (k>=pos) break;
if (a[i]==' ') k++;
else if (a[i]=='\t') k=(k/tabsize+1)*tabsize;
else k++;
}
CursorPos=i;
paintline(CursorLine,true);
testCursor();
}
COM: <s> goto specific line and position taking the tabwidth into account </s>
|
funcom_train/44488559 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isDelimitedStartChar(final char c, final boolean goingForward) {
switch (c) {
case '(': case '{': case '[': case '<':
return goingForward;
case ')': case '}': case ']': case '>':
return !goingForward;
default:
return false;
}
}
COM: <s> returns true if the specified character is a start delimiter when </s>
|
funcom_train/1482366 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addDocument(Document doc, Analyzer docAnalyzer) throws CorruptIndexException, LockObtainFailedException, IOException {
synchronized(directory) {
assureOpen();
createIndexWriter();
if (docAnalyzer != null)
indexWriter.addDocument(doc, docAnalyzer);
else
indexWriter.addDocument(doc);
}
}
COM: <s> adds a document to this index using the provided analyzer instead of the </s>
|
funcom_train/7243513 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: static public void assertNotInstanceof(String msg, Class expected, Object actual) {
if(instanceofCheck(expected, actual))
fail(formatComparison(NOT_INSTANCE_OF, msg,
expected.getName(), actual == null ? "null" : actual.getClass().getName()));
}
COM: <s> asserts that actual is an not instance of the class expected </s>
|
funcom_train/39946769 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String prettyPrintJson(String unformattedJSON) {
if (unformattedJSON == null || "".equals(unformattedJSON)) {
return unformattedJSON;
}
try {
// sort the keys in the output as well
return new JSONObject(unformattedJSON).toString(2);
} catch (JSONException je) {
return unformattedJSON; // fall back to unformatted json, if pretty print fails...
}
}
COM: <s> format pretty print json nicely for finerging output </s>
|
funcom_train/42746341 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addDirtyListener(final Text pText) {
pText.addModifyListener(new ModifyListener() {
/**
* Overrides modifyText. {@inheritDoc}
*
* @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
*/
public void modifyText(final ModifyEvent e) {
setDirtyState(true);
}
});
}
COM: <s> add a dirty listener on the given text </s>
|
funcom_train/41024654 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel getJPreviewOptionPanel() {
if (jPreviewOptionPanel == null) {
jPreviewOptionPanel = new JPanel();
jPreviewOptionPanel.setLayout(new BorderLayout());
jPreviewOptionPanel.add(getJSlider(), BorderLayout.CENTER);
jPreviewOptionPanel.add(getJCheckBox(), BorderLayout.EAST);
jPreviewOptionPanel.add(getJTextPane(), BorderLayout.SOUTH);
}
return jPreviewOptionPanel;
}
COM: <s> this method initializes j preview option panel </s>
|
funcom_train/8079677 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Instances labelIgnoreHigh(Instances instances, Instances used) throws Exception {
Instance curr;
double []probs;
int label;
double highestProb;
for(int i=0; i<instances.numInstances(); i++){
curr = instances.instance(i);
//compute the class membership probs predicted by the current ensemble
probs = distributionForInstance(curr);
label = (int) classifyInstance(curr);
highestProb = probs[label];
if(highestProb < m_Threshold){
curr.setClassValue(inverseLabel(probs));
used.add(curr);
}
}
return used;
}
COM: <s> label low confidence examples with inverse of ensembles prediction </s>
|
funcom_train/37766212 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void packageProcessing(RwiPackage rwiPackage, Writer writer) {
doActionUponPackage(rwiPackage, writer);
// getting all subpackages enumeration
RwiPackageEnumeration subPackages = rwiPackage.subpackages();
// processing each subpackage
while (subPackages.hasMoreElements()) {
// getting subpackage
RwiPackage nextPackage = subPackages.nextRwiPackage();
// processing subpackage
packageProcessing(nextPackage, writer);
}
}
COM: <s> this method recursively performs the same action upon the rwi package </s>
|
funcom_train/50530787 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isPageAccessible(Context context) throws Exception {
if (handlers.isEmpty()) return true; // border case
for (Iterator<IHandler> iter = handlers.iterator(); iter.hasNext(); ) {
IHandler handler = iter.next();
boolean test = handler.prerequisitesMet(context);
if (!test) {
return false;
}
}
return true;
}
COM: <s> the principal accessibility of a page is deduced as follows </s>
|
funcom_train/44709500 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getTotalPages(PageState state) {
int totalSize = m_builder.getTotalSize(this, state);
int pageSize = getPageSize(state);
int minSize = totalSize/pageSize;
if (minSize*totalSize == pageSize) {
return minSize;
} else {
return minSize + 1;
}
}
COM: <s> this returns the total number of pages that will be displayed </s>
|
funcom_train/37612053 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int waitFor() {
try {
m_process.waitFor();
}
catch (InterruptedException e) {
throw new UncheckedInterruptedException(e);
}
finally {
m_stdoutRedirector.stop();
m_stderrRedirector.stop();
}
try {
return m_process.exitValue();
}
catch (IllegalThreadStateException e) {
throw new AssertionError(e);
}
}
COM: <s> wait until the worker has completed </s>
|
funcom_train/21637522 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void log(String writerId, Status status, String message) {
if (status.getStatus() < logStatus.getStatus()) {
return;
}
LogEntry entry = new LogEntry(writerId, status.getValue(), message);
LogHelper.getInstance().saveLogEntry(entry);
}
COM: <s> logs an event </s>
|
funcom_train/19090287 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void reset() {
fDeclaration = null;
fTypeDecl = null;
fNil = false;
fSpecified = false;
fNotation = null;
fMemberType = null;
fValidationAttempted = ElementPSVI.VALIDATION_NONE;
fValidity = ElementPSVI.VALIDITY_NOTKNOWN;
fErrorCodes = null;
fValidationContext = null;
fNormalizedValue = null;
}
COM: <s> reset should be called in validator start element </s>
|
funcom_train/38562647 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private AbstractButton addIntelligentButton(JToolBar toolBar, Action action) {
final AbstractButton b = new JToggleButton(action);
b.setText(null);
toolBar.add(b);
action.addPropertyChangeListener(new PropertyChangeListener(){
public void propertyChange(PropertyChangeEvent pce) {
if (pce.getPropertyName().equals("selected")){
b.setSelected(((Boolean)pce.getNewValue()).booleanValue());
}
}
});
return b;
}
COM: <s> creates a button that can keep in synch with its associated action </s>
|
funcom_train/10781704 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testNonUpdatableBlobDoesNotFail() {
if (!skip) {
TimestampedEntity pc = new TimestampedEntity();
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
em.persist(pc);
em.getTransaction().commit();
em.clear();
pc.setNonUpdatableNonNullableDate(null);
assertCommitSucceeds(pc, !NEW);
}
// else no-op
}
COM: <s> test that a non updatable field may be set to null </s>
|
funcom_train/2609996 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void checkRemoteCandidate(final TransportCandidate offeredCandidate) {
offeredCandidate.addListener(new TransportResolverListener.Checker() {
public void candidateChecked(TransportCandidate cand,
final boolean validCandidate) {
if (validCandidate) {
if (!(getState() instanceof Active))
addValidRemoteCandidate(offeredCandidate);
}
}
public void candidateChecking(TransportCandidate cand) {
}
});
offeredCandidate.check(resolver.getCandidatesList());
}
COM: <s> check asynchronously the new transport candidate </s>
|
funcom_train/1476641 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Restriction getRestrictionByProperties(String[] properties) {
Restriction togo = null;
for (int i = 0; i < properties.length; i++) {
String property = properties[i];
Restriction r = this.getRestrictionByProperty(property);
if (r != null) {
togo = r;
break;
}
}
return togo;
}
COM: <s> finds if there are any search restrictions with one of the given properties </s>
|
funcom_train/5395466 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSetNetworkLatency() {
System.out.println("setNetworkLatency");
long value = 0L;
CubbyHole instance = new CubbyHole();
instance.setNetworkLatency(value);
// 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 network latency method of class org </s>
|
funcom_train/49123696 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void deleteByTabId(String tabId) {
HibernateTemplate templete = super.getHibernateTemplate();
List tabLayouts = templete.findByCriteria(DetachedCriteria.forClass(
TabLayout.class).add(Expression.eq("id.Tabid", tabId)).add(
Expression.eq("id.Temp", TabLayout.TEMP_TRUE)));
super.getHibernateTemplate().deleteAll(tabLayouts);
}
COM: <s> update the tab of the temporary data </s>
|
funcom_train/43230229 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void logout() {
LoginService.Util.getInstance().logout(new AsyncCallback<Void>() {
@Override
public void onSuccess(final Void result) {
final ArrayList<Presenter> list = new ArrayList<Presenter>(
ApplicationController.this.presenterStack);
for (final Presenter current : list) {
current.close();
}
ApplicationController.this.getContentPanel().clear();
ApplicationController.this.login();
}
@Override
public void onFailure(final Throwable caught) {
}
});
}
COM: <s> logout the client </s>
|
funcom_train/18255064 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Node findRandomUnoccupiedCell() {
for (int i = 0; i < 10; i++) {
Node cell = (Node) findRandom();
if (cell.isAvailable()) {
return cell;
}
}
List available = findAvailable();
if (available.size() > 0) {
return (Node) available.get(randomToLimit(available.size()));
} else {
return null;
}
}
COM: <s> returns a random unoccupied discrete location in the space </s>
|
funcom_train/47983261 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void refreshSelectedNetwork() {
if (markedNetwork != null) {
String lastLogin = disconnectFromSelectedNetwork();
if (lastLogin != null) {
String network = markedNetwork.getNetworkName();
Credential lastCredential = db.getCredential(lastLogin, network);
if (lastCredential != null) {
SessionService.getInstance().getLoginLoop().requestSingleLogin(lastCredential);
}
}
}
}
COM: <s> just reconnects to the selected network </s>
|
funcom_train/43014737 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getLevel() {
if (Header_Type.featOkTst && ((Header_Type) jcasType).casFeat_Level == null) {
jcasType.jcas.throwFeatMissing("Level", "org.apache.uima.mediawiki.types.Header");
}
return jcasType.ll_cas.ll_getIntValue(addr, ((Header_Type) jcasType).casFeatCode_Level);
}
COM: <s> getter for level gets the header level 1 is the highest main title </s>
|
funcom_train/1382337 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getBtnVisualizza() {
if (btnVisualizza == null) {
btnVisualizza = new JButton();
btnVisualizza.setText("Camere Libere");
btnVisualizza.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
visualizzaCamereDisponibili(); // TODO
// Auto-generated
// Event stub
// actionPerformed()
}
});
}
return btnVisualizza;
}
COM: <s> this method initializes btn visualizza </s>
|
funcom_train/1652493 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void writeReply(ToadletContext ctx, int code, String mimeType, String desc, byte[] data, int offset, int length) throws ToadletContextClosedException, IOException {
ctx.sendReplyHeaders(code, desc, null, mimeType, length);
ctx.writeData(data, offset, length);
}
COM: <s> client calls to write a reply to the http requestor </s>
|
funcom_train/46189363 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Year getBlogForYear(int year) {
Iterator it = years.iterator();
Year y;
while (it.hasNext()) {
y = (Year)it.next();
if (y.getYear() == year) {
return y;
}
}
y = new Year(this, year);
years.add(y);
Collections.sort(years);
return y;
}
COM: <s> gets the year instance for the specified year </s>
|
funcom_train/4977039 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private ImmNode getDescendant (final List<String> pathTokens) {
ImmNode node = this;
for (final Iterator<String> it = pathTokens.iterator (); node != null && it.hasNext ();) {
node = node._childNodes.get (it.next ());
}
return node;
}
COM: <s> tries to find a descendant of this node </s>
|
funcom_train/18643929 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Identity initializeSessionIdentity() {
Identity ret=null;
if (m_recordElement != null &&
m_recordElement.getLocalName().equals(RECORD)) {
org.w3c.dom.Node sessionIdentity=
XMLUtils.getChild(m_recordElement, null,
AbstractServiceTracker.SESSION_IDENTITY_NODE);
if (sessionIdentity != null) {
java.util.List<Identity> ids=TrackerInformationUtil.getIdentities(sessionIdentity);
if (ids != null && ids.size() == 1) {
ret = ids.get(0);
}
}
}
return(ret);
}
COM: <s> this method initializes the session identity </s>
|
funcom_train/43502543 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void loadModelAge(ElogsSummaryTableModel model) {
// Set the age range in the model
int age = this.ageComboBox.getSelectedIndex();
String key = CIAHelper.AGES[age];
HashMap<String,Pair<Long,Long>> map = CIAHelper.getAgeMap();
Long starts = map.get(key).getStarts();
Long ends = map.get(key).getEnds();
model.setStart(starts);
model.setEnd(ends);
}
COM: <s> sets up the age filters in the model </s>
|
funcom_train/13244204 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getXAccel() {
byte [] vals = getData(X_ACCEL_LSB, 2);
//System.out.print("LSB = " + vals[0] + " MSB = " + vals[1] + " ");
int accel = (vals[0]) | ((vals[1]) << 8);
return accel;
}
COM: <s> acceleration along x axis </s>
|
funcom_train/3155440 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Vector getRequests() {
Request request = new Request();
request.setType(FlhMciConstants.REQUEST_TYPE);
request.setFile(_requestFile);
getInputFile(request);
getOutputFile(request);
getParameter(request);
Vector vRet = new Vector();
vRet.add(request);
return vRet;
}
COM: <s> retrieves the request currently edited </s>
|
funcom_train/26206324 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean removeContainer(final String name) {
assertIsClosed();
final JobAbstractContainer container = (JobAbstractContainer) this.rootMap.remove(name);
final boolean result = container != null;
if (result) {
this.rootMap.remove(new Integer(container.id));
container.deletePersistent();
}
return result;
}
COM: <s> removes the persistent container with the given name </s>
|
funcom_train/42636195 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isWorkingTime(Number time0, Number time1){
double slot = ScheduleEnvironment.getInstance().getMinTimeSlot();
for (Number time = time0.copy() ; time.compareTo(time1)<0; time = time.add(slot)) {//time1 must not be accounted for
if(!isWorkingTime(time.doubleValue())) return false;
}
return true;
}
COM: <s> returns true if each time slot of the given interval is working </s>
|
funcom_train/21453422 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void saveSettings(){
FileOutputStream output;
try {
output = new FileOutputStream("settinghours.emp");
ObjectOutputStream obj_out = new ObjectOutputStream(output);
obj_out.writeObject(fHours);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
System.out.println("---saved Data---");
}
COM: <s> saves the settings entered from the gui into a file </s>
|
funcom_train/8035772 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void parseArguments(String[] args) {
if (args.length > 0) {
if (args[0].equalsIgnoreCase("jccjdbcclient")) {
framework = "jccjdbc";
driver = "com.ibm.db2.jcc.DB2Driver";
protocol = "jdbc:derby:net://localhost:1527/";
} else if (args[0].equalsIgnoreCase("derbyclient")) {
framework = "derbyclient";
driver = "org.apache.derby.jdbc.ClientDriver";
protocol = "jdbc:derby://localhost:1527/";
}
}
}
COM: <s> parses the arguments given and sets the values of this class instance </s>
|
funcom_train/5806901 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public long toLong(InetAddress addr) {
byte[] baddr = addr.getAddress();
return ((((long) baddr[0] & 0xffL) << 24) | (((long) baddr[1] & 0xffL) << 16) | (((long) baddr[2] & 0xffL) << 8) | ((long) baddr[3] & 0xffL));
}
COM: <s> this method is used to convert the passed ip address to a </s>
|
funcom_train/45422844 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel getEditPanelQuery() {
if (editPanelQuery == null) {
editPanelQuery = new JPanel();
editPanelQuery.setLayout(new BorderLayout());
editPanelQuery.add(getJScrollPaneQuery(), BorderLayout.CENTER);
editPanelQuery.add(getPnlButtonsEditor(), BorderLayout.EAST);
editPanelQuery.add(getJScrollPanePropsQuery(), BorderLayout.SOUTH);
}
return editPanelQuery;
}
COM: <s> this method initializes edit panel query </s>
|
funcom_train/18143127 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void encode(DataOutput out) throws IOException {
int[] props = getKnownPropertyTypes();
for (int i=0;i<props.length;++i) {
try {
Property p = getProperty(props[i]);
if (p.isValueKnown()) {
out.writeInt(p.getPropertyType());
p.encode(out);
}
}
catch (UnknownPropertyException e) {
// Should never happen
e.printStackTrace();
}
}
out.writeInt(PROPERTY_NULL);
}
COM: <s> write this rescue object to a data output </s>
|
funcom_train/14311112 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testIfQueueWith100ElementsIsFull() {
final Queue q = new Queue(100);
final Object test = new Object();
for (int i = 0; i < 100; i++) {
assertTrue("Failed to offer test object", q.offer(test)); //$NON-NLS-1$
}
assertEquals("Queue does not occupy 100 slots", 100, q.occupiedSlots()); //$NON-NLS-1$
assertTrue("Queue is not full", q.isFull()); //$NON-NLS-1$
}
COM: <s> tests if queue with 100 elements is full </s>
|
funcom_train/14415971 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public CIMProperty setProperty(String pPropertyName, CIMValue pValue) {
if (pPropertyName == null) throw new IllegalArgumentException("null property name argument");
CIMProperty property = getProperty(pPropertyName);
if (property == null) {
property = new CIMProperty(pPropertyName, pValue);
addProperty(property);
} else property.setValue(pValue);
return property;
}
COM: <s> sets the value for the property if the property already exists </s>
|
funcom_train/3172522 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Object lookup(Map index, String key, Class fallback) {
// look up and create lazily if necessary
Object result = index.get(key);
if (result==null) {
try {
result = fallback.newInstance();
} catch (Throwable t) {
t.printStackTrace();
throw new IllegalArgumentException("can't instantiate fallback "+fallback);
}
index.put(key, result);
}
// done
return result;
}
COM: <s> lookup an object in a map with a default class </s>
|
funcom_train/35690713 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isVisible() {
if (visible != null) {
return visible.booleanValue();
}
ValueBinding vb = getValueBinding("visible");
Boolean boolVal =
vb != null ? (Boolean) vb.getValue(getFacesContext()) : null;
return boolVal != null ? boolVal.booleanValue() : DEFAULT_VISIBLE;
}
COM: <s> p return the value of the code visible code property </s>
|
funcom_train/38429182 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public TreeModel getTree(int treeType, Card filterCard) {
if (treeType == TREE_TYPE_NAME) {
return createTree(TREE_TYPE_NAME, filterCard);
}
if (treeType == TREE_TYPE_SET) {
return createTree(TREE_TYPE_SET, filterCard);
}
return null;
} //getTree
COM: <s> returns a tree model grouped by tree type </s>
|
funcom_train/2557621 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void token() {
int mark = off;
while(mark < count) {
char ch = text[mark];
if(!isLetter(ch)) {
break;
}
if(mark > off) {
if(isUpper(ch)) {
break;
}
}
mark++;
}
if(mark > off) {
parse(text, off, mark - off);
commit(text, off, mark - off);
}
off = mark;
}
COM: <s> this is used to extract a token from the source string </s>
|
funcom_train/1236 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: final public boolean isEveryBoxOnAGoal() {
// Check all boxes for "on goal"
for (int boxNo = 0; boxNo < boxCount; boxNo++) {
// ignore deactivated boxes
if (isBoxInactive(boxNo))
continue;
if (board.isBoxOnGoal(boxPositions[boxNo]) == false) {
return false;
}
}
return true;
}
COM: <s> tells whether all our boxes are on some goal </s>
|
funcom_train/4291130 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addTargetPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_IdentifierDef_target_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_IdentifierDef_target_feature", "_UI_IdentifierDef_type"),
IdentificationPackage.Literals.IDENTIFIER_DEF__TARGET,
true,
false,
true,
null,
null,
null));
}
COM: <s> this adds a property descriptor for the target feature </s>
|
funcom_train/5243300 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void applyAttribute(Att att) {
if (this.getAttribute(att.getName()) == null) {
setAttribute(att);
}
else {
if (att instanceof AttVariable) {
AttVariable tempAtt = (AttVariable)this.getAttribute(att.getName());
tempAtt.setAvailable(calculateFormula(att, att.getApplyFormula()));
}
else {
setAttribute(att);
}
}
}
COM: <s> this applies attribute to unit </s>
|
funcom_train/28262165 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void checksum() {
int checksum = 0;
for (int reg = 0x10; reg <= 0x2D; reg++) {
checksum += ram[reg];
}
ram[CHECKSUM_LOW_BYTE] = (byte) (checksum & 0xFF);
ram[CHECKSUM_HIGH_BYTE] = (byte) ((checksum >> 8) & 0xFF);
}
COM: <s> performs a byte wise additive checksum of bytes of the values in </s>
|
funcom_train/24920311 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int selectPatriarchByFamilyName(String fName) {
int playerVnum = 0;
try {
this.selectPatriarchByFamilyName.setString(1, fName);
ResultSet rs = this.selectPatriarchByFamilyName.executeQuery();
if (rs.first()) {
playerVnum = rs.getInt("families_players_player_vnum");
}
} catch (SQLException e) {
e.printStackTrace();
}
return playerVnum;
}
COM: <s> the database is queried to determine the players vnum who is flagged as </s>
|
funcom_train/8477487 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setContentType(String contentType) throws IllegalStateException{
if(getState()!=UNREALIZED){
log(0, "FAILED! SP.setContentType() - " + contentType);
throw new IllegalStateException("Can only be called in UNREALIZED state");
}
else{
this.contentType = contentType;
log(0, "SP.setContentType() - " + contentType);
}
}
COM: <s> sets the content type </s>
|
funcom_train/8407296 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void broadcastListableChanged(Listable elt) {
Iterator it = _cursors.iterator();
while (it.hasNext()) {
WeakReference ref = (WeakReference) it.next();
Cursor cursor = (Cursor) ref.get();
if (cursor == null) {
it.remove(); // clean up list
} else {
cursor.listableChanged(elt);
}
}
}
COM: <s> informs all of my registered cursors that the specified </s>
|
funcom_train/42200312 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String toString(ColorRGBA color) {
if(color != null)
return "( " + decimal.format(color.r) + ", " + decimal.format(color.g) + ", " + decimal.format(color.b) + ", " + decimal.format(color.a) + " )";
else
return "null";
}
COM: <s> convenience method for converting a color to a string </s>
|
funcom_train/19402614 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private long hash( final int[] a, final int l, final int k ) {
final int[] w = weight[ k ];
long h = init[ k ];
int i = l;
while( i-- != 0 ) h ^= ( h << 5 ) + a[ i ] * w[ i % NUMBER_OF_WEIGHTS ] + ( h >>> 2 );
return ( h & 0x7FFFFFFFFFFFFFFFL ) % m;
}
COM: <s> hashes the given int array with the given hash function </s>
|
funcom_train/27746939 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public CTabItem getItem (Point pt) {
//checkWidget();
if (items.length == 0) return null;
int lastItem = getLastItem();
lastItem = Math.min(items.length - 1, lastItem + 1);
for (int i = topTabIndex; i <= lastItem; i++) {
Rectangle bounds = items[i].getBounds();
if (bounds.contains(pt)) return items[i];
}
return null;
}
COM: <s> gets the item at a point in the widget </s>
|
funcom_train/27848839 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testBadConnection() {
// create a new opener
opener = new URLOpener(urlBad);
// add us as an observer
opener.addObserver(this);
// create a new thread
t = new Thread(opener);
// run the opener
t.start();
// sleep for 5 seconds? lengthen for greater network latency
try {
Thread.sleep(delay);
} catch (InterruptedException e) {
fail();
e.printStackTrace();
}
// run tests
assertTrue(notifiedFlag);
assertTrue(opener.getStatus().startsWith(
" Unable to read document type: "));
}
COM: <s> test a bad url </s>
|
funcom_train/21132729 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public SubField getSubField(char id){
if(msf == null) return null;
for(int i=0;i<msf.length;i++){
if(msf[i].getIdentifier() == id){
return msf[i];
}
}// end of for
return null;
}
COM: <s> to get the subfield object for the character id </s>
|
funcom_train/45864005 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private BitmapFont findBestFont(int minW, int minH, String resource, String fallback) throws IOException {
try {
if (viewW >= minW && viewH >= minH) {
return new BitmapFont(resource);
}
} catch (Exception e) {
if (DEBUG) {
System.out.println("Failed loading: " + resource + " (" + e.getMessage() + ")");
}
if (fallback != null) {
return new BitmapFont(fallback);
}
}
return null;
}
COM: <s> returns the best code bitmap font code given the size choices </s>
|
funcom_train/9804412 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void appendProperties(StringBuffer bf) {
Object val;
for(Entry e:entrySet()) {
bf.append(prefix).append(e.getKey());
val = e.getValue();
if (val!=null && (!val.equals("")) ) {
bf.append(' ').append(e.getValue());
}
bf.append(suffix);
}
}
COM: <s> retrieve the list of the stored key value pairs in this object </s>
|
funcom_train/19456069 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void write(int b) throws IOException {
b &= bitMask; // Ensure we don't have extra baggage
b <<= bitsOfData; // Move beyond existing bits of data
data|= b; // Add in the additional data
bitsOfData+= requestedNumberOfBits;
while (bitsOfData >= 8) {
os.write(data & 0xff);
data >>= 8;
bitsOfData-= 8;
}
}
COM: <s> write the number of bits to the wrapped output stream </s>
|
funcom_train/18748309 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected JMenuBar createMenuBar() {
JMenuBar menuBar = new JMenuBar();
menuBar.add(editor.createEditMenu());
menuBar.add(editor.createDisplayMenu());
menuBar.add(createOptionsMenu());
menuBar.add(editor.createHelpMenu());
return menuBar;
}
COM: <s> creates and returns the menu bar </s>
|
funcom_train/48494303 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getCommand(String name, Type ... types) {
Command cmd = commands.get(name);
if (cmd == null)
return null;
if (cmd instanceof OverloadedCommand) {
cmd = ((OverloadedCommand) cmd).findCommand(types);
}
else {
if (types.length != cmd.getArgumentsNumber())
return null;
for (int i = 0; i < cmd.getArgumentsNumber(); i++) {
Type arg = cmd.getArgument(i).type;
if (!types[i].instanceOf(arg))
return null;
}
}
return cmd;
}
COM: <s> returns a globally defined command with the specific arguments </s>
|
funcom_train/50576777 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void iSetEnabled(boolean b) {
super.setEnabled(b);
discPlayItem.setEnabled(b);
trackPlayItem.setEnabled(b);
refreshItem.setEnabled(b);
rescanItem.setEnabled(b);
copyItem.setEnabled(b);
ejectItem.setEnabled(b);
editItem.setEnabled(b);
ft.setEnabled(b);
}
COM: <s> enable or disable the user interface not thread safe </s>
|
funcom_train/12923661 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void decodeSimpleCMAP(final BigDecoder coder) throws IOException {
charToGlyph = new int[256];
maxChar = 255;
for (int index = 0; index < 256; index++) {
charToGlyph[index] = coder.readByte();
glyphToChar[charToGlyph[index]] = index;
}
}
COM: <s> decode a simple character table </s>
|
funcom_train/32117003 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createAndConfigureComponents() {
cmdLine = new CmdLine();
JScrollPane cmdLineScrollPane = new JScrollPane(cmdLine,
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
if (hasScriptListener())
executeButton = new JButton(new ExecuteCmdAction(cmdLine,
scriptListener));
else
executeButton = new JButton(new ExecuteCmdAction(cmdLine));
setLayout(new BoxLayout(this, BoxLayout.LINE_AXIS));
add(cmdLineScrollPane);
add(executeButton);
}
COM: <s> create and configure components without awts edt creating convention </s>
|
funcom_train/35460950 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public CommonTree map(final CommonTree ast) throws PLIStructureParsingException {
String errorMessage = "Mapping PL/I structures failed.";
try {
ASTStructureMapper mapper = new ASTStructureMapper(getContext());
return mapper.map(ast);
} catch (StructureMappingException e) {
_log.error(errorMessage, e);
throw (new PLIStructureParsingException(e));
}
}
COM: <s> analyzes the pl i structures mapping </s>
|
funcom_train/12739255 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ArrayList getNodes() {
if (nodes != null) return nodes;
if (sources == null)
return null;
nodes = new ArrayList();
for (int i = 0; i < sources.size(); i++) {
ArrayList elementpaths = ((Source) sources.get(i)).getNodes();
if (elementpaths != null)
for (int j = 0; j < elementpaths.size(); j++) {
TypedXTreeNode nodej = (TypedXTreeNode) elementpaths.get(j);
nodes.add(nodej);
}
}
return nodes;
}
COM: <s> return all nodes of all sources for the current path expression </s>
|
funcom_train/26490130 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean doInit(Config config) {
RELOAD_TIME = config.getProperty("reloadtime");
NEWS_FILE = config.getProperty("newsfile");
SERVER = config.getProperty("server");
IMG_SERVER = config.getProperty("img_server");
PROP_FILE = config.getProperty("propfile");
return true;
}
COM: <s> do some initialization for this application e </s>
|
funcom_train/33352988 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JSlider getJSlider1() {
if (jSlider1 == null) {
jSlider1 = new JSlider();
jSlider1.setBorder(BorderFactory.createTitledBorder(null, "Brightest Star Size", TitledBorder.CENTER, TitledBorder.DEFAULT_POSITION, new Font("Dialog", Font.BOLD, 12), new Color(51, 51, 51)));
jSlider1.setPreferredSize(new Dimension(150, 42));
}
return jSlider1;
}
COM: <s> this method initializes j slider1 </s>
|
funcom_train/9139642 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void writeToWriter(RunWriter writer, Map<String, Posting> postings) throws IOException{
if (postings.size() != 0){
writer.beginWrite(maxSize, postings.size());
for( Entry<String,Posting> entry : postings.entrySet())
{
writer.writeTerm(entry.getKey(), entry.getValue());
}
}
writer.finishWrite();
}
COM: <s> writes the contents of the postings in memory to disk </s>
|
funcom_train/38291638 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getParameter(String key, String aDefault) {
String v = props.getProperty(key);
if (v==null) {
String dottedKey = key.replace('_', '.');
v = props.getProperty( dottedKey );
}
if (v==null) {
String underscoredKey = key.replace('.', '_');
v = props.getProperty( underscoredKey );
}
return (v != null ? v.trim() : aDefault);
}
COM: <s> retrieve a string value from the configuration properties </s>
|
funcom_train/40078496 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getPrefix(DiagnosticType dt) {
switch (dt) {
case FRAGMENT: return "";
case NOTE: return getLocalizedString("compiler.note.note");
case WARNING: return getLocalizedString("compiler.warn.warning");
case ERROR: return getLocalizedString("compiler.err.error");
default:
throw new AssertionError("Unknown diagnostic type: " + dt);
}
}
COM: <s> get the prefix string associated with a particular type of diagnostic </s>
|
funcom_train/50586840 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSend() {
WebRequest request =
new GetMethodWebRequest(properties.getString("RequestURL"));
try {
WebResponse response = player.send(request);
assertEquals("xPetStore", response.getTitle());
}
catch (SAXException e) {
fail(e.getMessage());;
} catch (MalformedURLException e) {
fail(e.getMessage());
} catch (IOException e) {
fail(e.getMessage());
}
}
COM: <s> method test send </s>
|
funcom_train/29881810 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected JButton createOpenLocalFileButton() {
JButton tJButton = createToolBarButton("V221Open.png", "Open File (Ctrl O)");
tJButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {mOpenPCLViewer.actionOpenLocalFileDialog();}
});
return tJButton;
}
COM: <s> open local file toolbar button </s>
|
funcom_train/2492227 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void refreshDictionaryTable(){
DictionaryTableModelIface vocModel = (DictionaryTableModelIface) dictionaryTable.getModel();
vocModel.fireTableChanged( new TableModelEvent( (TableModel) vocModel,0,0,0, -100 ) );
RowSorter<? extends TableModel> rowSorter= dictionaryTable.getRowSorter();
if(rowSorter != null){
rowSorter.allRowsChanged();
}
dictionaryTable.revalidate();
dictionaryTable.repaint();
}
COM: <s> refresh dictionary table </s>
|
funcom_train/2583073 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public List getRowKeys() {
// the CategoryDataset interface expects a list of series, but
// we've stored them in an array...
if (this.seriesKeys == null) {
return new java.util.ArrayList();
}
else {
return Collections.unmodifiableList(Arrays.asList(this.seriesKeys));
}
}
COM: <s> returns a list of the series in the dataset </s>
|
funcom_train/50864877 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addTowedTextLabel() {
try {
Component lastComponent = towedLabelPanel.getComponent(1);
if (lastComponent == towedButton) {
towedLabelPanel.remove(towedButton);
towedLabelPanel.add(towedTextLabel);
}
}
catch (ArrayIndexOutOfBoundsException e) {
towedLabelPanel.add(towedTextLabel);
}
}
COM: <s> adds the towed text label to the towed label panel </s>
|
funcom_train/38908015 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void start() {
if (thread != null && thread.isAlive() && reader != null
&& reader.isRunning()) {
throw new IllegalStateException("Reader is already running");
}
lastFired = -1;
thread = new Thread(reader);
thread.start();
}
COM: <s> starts reading the input stream and dispatching events </s>
|
funcom_train/25332996 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetChromosomes() throws Exception {
assertNull(instance.getChromosomes(sp));
assertNull(instanceWithReg.getChromosomes(null));
assertNull(instanceWithReg.getChromosomes(new DBCollectionSpecies()));
try {
instanceWithReg.getChromosomes(sp);
fail();
} catch (Exception e) {
}
}
COM: <s> test of get chromosomes method of class dbcollection core database </s>
|
funcom_train/47017452 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Text replace(CharSet charSet, CharSequence replacement) {
int i = indexOfAny(charSet);
return (i < 0) ? this : // No character to replace.
subtext(0, i).concat(Text.valueOf(replacement)).concat(
subtext(i + 1).replace(charSet, replacement));
}
COM: <s> replaces the specified characters in this text with the specified </s>
|
funcom_train/22178385 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void readFully(byte[] b, int off, int len) throws IOException {
while (len > 0) {
int n = super.read(b, off, len);
if (n == -1) {
throw new EOFException();
}
off += n;
len -= n;
}
}
COM: <s> reads code len code </s>
|
funcom_train/911723 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void createFieldEditors() {
addField(
new StringFieldEditor(PreferenceConstants.P_CARDLIST_URL, "URL to Standard Tournament Cardlist:", getFieldEditorParent()));
addField(
new StringFieldEditor(PreferenceConstants.P_REGEX_CARD, "Regular Expression to scan for card names:", getFieldEditorParent()));
addField(
new RestrictedListEditor(PreferenceConstants.P_RESTRICTED_CARDS, "List of restricted cards in this set:", getFieldEditorParent()));
}
COM: <s> creates the field editors </s>
|
funcom_train/3292472 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String transform(String xmlPath, String xslPath) {
// Do nothing for the time being
if (log.isDebugEnabled()) {
log.debug("XML file = "+xmlPath);
log.debug("XSL file = "+xslPath);
}
XSLTransformer T = new XSLTransformer();
return T.transform(xmlPath,xslPath);
}
COM: <s> transform xml file using an xsl file </s>
|
funcom_train/43036107 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void appendHit2(Player p, Stream str) {
if (p == null || str == null) {
return;
}
str.writeByteS(p.hitDiff2);
if (p.posionHit2 == 0) {
if (p.hitDiff2 > 0) {
str.writeByteA(1);
} else {
str.writeByteA(0);
}
} else {
str.writeByteA(2);
}
}
COM: <s> write a second damage mask </s>
|
funcom_train/32069676 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean addDocumentContents(Collection<DocumentContent> documentContents) {
boolean addOk = getDocumentContents().addAll(documentContents);
if (addOk) {
for(DocumentContent documentContent : documentContents) {
documentContent.setLocale((Locale)this);
}
} else {
if (logger.isWarnEnabled()) {
logger.warn("add returned false");
}
}
return addOk;
}
COM: <s> add the passed document contents collection to the locale collection </s>
|
funcom_train/1150442 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getItemCommand2() {
if (itemCommand2 == null) {//GEN-END:|307-getter|0|307-preInit
// write pre-init user code here
itemCommand2 = new Command("Escuchar", Command.ITEM, 0);//GEN-LINE:|307-getter|1|307-postInit
// write post-init user code here
}//GEN-BEGIN:|307-getter|2|
return itemCommand2;
}
COM: <s> returns an initiliazed instance of item command2 component </s>
|
funcom_train/5692363 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object getObject(Object key) throws TooManyObjectsException {
List list = get(key);
Object ret = null;
if (list != null) {
if (list.size() != 1) {
throw new TooManyObjectsException("You cannot do a getObject() on a key with more than one entry!");
}
ret = list.get(0);
}
return ret;
}
COM: <s> returns the actual object associated with the key </s>
|
funcom_train/26227162 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addStartEndBlocks() {
//this blocks have no code to generate and to
start = new BasicBlock(graph);
end = new BasicBlock(graph);
start.addDefaultNextBlock(firstBB);
start.addCFGNextBlock(end);
int i=0;
//all blocks with no succesor are linked to the end block
for (BasicBlock bb = firstBB; bb != null; bb = bb.getNext()){
if (!bb.hasSuccessor()) {
++i;
bb.addCFGNextBlock(end);
}
}
}
COM: <s> add the start and the end blocks in the cfg </s>
|
funcom_train/35725315 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Lemming (int number, Field f, Test t, int dir){
//TODO View.addAnim(new LemmingAnim(this));
position = new int[2];
test = t;
map = f;
direction = dir;
counter = number;
tools = new Tool[3];
current = map.getCurrent();
}
COM: <s> temporary for skeleton </s>
|
funcom_train/32057566 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testUninstallUI() {
System.out.println("testUninstallUI");
JGraph jg=new JGraph();
BasicGraphUI x = new BasicGraphUI();
GraphLayoutCache g = new GraphLayoutCache( new DefaultGraphModel(),jg );
x.installUI(jg);
x.uninstallUI(jg);
}
COM: <s> test of uninstall ui method of class basic graph ui </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.