__key__
stringlengths 16
21
| __url__
stringclasses 1
value | txt
stringlengths 183
1.2k
|
---|---|---|
funcom_train/10588391 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void recycle() {
// Note: configure() and initialize() are not called after every
// recycle, so don't null origConf, origLinkAttrs, etc.
this.conf = null;
this.badLinkStr = null;
this.linkAttrs = null;
this.inSchemes = null;
this.outSchemes = null;
super.recycle();
}
COM: <s> recycle this component for use in another map transform </s>
|
funcom_train/36108203 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean write(Writer writer) {
if(classCode==null)return false;
try{
int closingBrace = classCode.toString().lastIndexOf('}');
writer.write(classCode.substring(0, closingBrace));
for(int i = 0; i<fields.size(); i++){
writer.write(createMethodsFor((Field)fields.get(i)));
}
writer.write(classCode.substring(closingBrace));
return true;
}catch(IOException e){
return false;
}
COM: <s> writes the class code read by read to the given writer </s>
|
funcom_train/32138290 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void displayError(String message) {
LogManager.logDebug("Start OpenScriptOutputAction.displayError", this);
LogManager.logInfo("Initializing", MessageDialog.class);
MessageDialog.openWarning(fWindow.getShell(), Localization.getString("OpenScriptOutputAction.Problem"), message);
LogManager.logInfo("Disposing", MessageDialog.class);
LogManager.logDebug("End OpenScriptOutputAction.displayError", this);
}
COM: <s> this method will display the error message to the user in the case </s>
|
funcom_train/32040619 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean validateSortType_Enumeration(String sortType, DiagnosticChain diagnostics, Map context) {
boolean result = SORT_TYPE__ENUMERATION__VALUES.contains(sortType);
if (!result && diagnostics != null)
reportEnumerationViolation(ImsldPackage.eINSTANCE.getSortType(), sortType, SORT_TYPE__ENUMERATION__VALUES, diagnostics, context);
return result;
}
COM: <s> validates the enumeration constraint of em sort type em </s>
|
funcom_train/2795972 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void run() {
try {
while (true) {
Evendec event=null;
byte[] buf=new byte[2048];
// decide what kind of event it is and how to process it
byte type = i.readByte();
event = EventTypeIdentifier.getEvendec(type);
// get all of the rawdata into buffer
int m = i.read(buf);
byte[] dat = new byte[m+1];
System.arraycopy(buf,0,dat,1,m);
dat[0] = type;
buf=dat;
// process event
al.processEvent(event.decode(buf));
Thread.sleep(50);
}
} catch (Exception ex) {
ex.printStackTrace();
} finally {
listener = null;
try {
o.close();
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
COM: <s> polls the socket for info to output </s>
|
funcom_train/14000778 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private ImageStack cropImageStack3D(ImageStack is) {
ImageStack cropped_is = new ImageStack(is.getWidth()-2*radius, is.getHeight()-2*radius);
for(int s = radius + 1; s <= is.getSize()-radius; s++) {
cropped_is.addSlice("", cropImageStack2D(is.getProcessor(s)));
}
return cropped_is;
}
COM: <s> crops a 3 d image at all of sides of the imagestack cube </s>
|
funcom_train/50501764 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean dict_updateDict( CRDict data ) {
if ( ensureCurrentCatalogDict( data ) ) {
JDictPDebug.debugMess( "WbDict: update data:" + data );
if ( m_cc.rs().restartRecord( WbDictionaryV2.RECPOS_DICTGENERAL ) ) {
dictRecWrite( data );
}
m_cc.rs().endRecord();
return true;
}
return false;
}
COM: <s> set dicts data </s>
|
funcom_train/36770521 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void start(int interval) {
if (interval < 1) {
throw new IllegalArgumentException("interval < 1");
}
if (sampler != null) {
throw new IllegalStateException("profiling already started");
}
sampler = new Sampler();
hprofData.setStartMillis(System.currentTimeMillis());
timer.scheduleAtFixedRate(sampler, 0, interval);
}
COM: <s> starts profiler sampling at the specified rate </s>
|
funcom_train/34083664 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void handleRouteInput(String s) {
GeoPoint center;
Location loc = mLocManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if (!mIsMapView && validLocation(loc, System.currentTimeMillis()))
center = FirbiHelper.locToGeo(loc);
else
center = mMap.getMapCenter();
routeThread(s, center);
}
COM: <s> handles when the user enters a route number </s>
|
funcom_train/5032640 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void load(String id) throws XmlLoadException {
if (id == null) {
return;
}
String path = persistenceHelper.getFileIndex().getFullPath(id);
if (path == null) {
logger.log(Level.WARNING, "Load called for id " + id + " but file indexer returns null");
return;
}
load(new File(path));
}
COM: <s> loads an xelement by its id </s>
|
funcom_train/10657230 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testRemoveAttributeFromOne() {
AttributeSet as = StyleContextTest.addAttribute(1);
as = sc.removeAttribute(as, StyleContextTest.attr[0]);
assertEquals(0, as.getAttributeCount());
if (!BasicSwingTestCase.isHarmony()) {
assertTrue(as instanceof SmallAttributeSet);
} else {
assertSame(as, sc.getEmptySet());
}
}
COM: <s> removes the last attribute from a set </s>
|
funcom_train/38574821 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setRewards(int direction, double value) {
if (direction == GridModel.UP) {
up.setText(Double.toString(value));
}
if (direction == GridModel.DOWN) {
down.setText(Double.toString(value));
}
if (direction == GridModel.LEFT) {
left.setText(Double.toString(value));
}
if (direction == GridModel.RIGHT) {
right.setText(Double.toString(value));
}
}
COM: <s> set the reward in the textfield of the respective direction </s>
|
funcom_train/2620274 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Double parseDoubleAttribute(String key, Map<String, String> data) {
Double num = null;
if ( data.containsKey(key) ) {
try {
num = Double.valueOf(data.get(key));
} catch ( NumberFormatException e) {
log.debug("Error parsing double attribute [{}] value [{}]: {}",
new Object[] {key, data.get(key), e.getMessage()});
}
}
return num;
}
COM: <s> parse a double from an attribute value </s>
|
funcom_train/33334352 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean process(final Class<?> cls, final MethodRemover methodRemover, final FacetHolder facetHolder) {
boolean facetsAdded = false;
final List<FacetFactory> factoryList = getFactoryListByFeatureType(NakedObjectFeatureType.OBJECT);
for (final FacetFactory facetFactory : factoryList) {
facetsAdded = facetFactory.process(cls, removerElseNullRemover(methodRemover), facetHolder) | facetsAdded;
}
return facetsAdded;
}
COM: <s> attaches all facets applicable to the provided </s>
|
funcom_train/29792898 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString() {
return getCourseID() + ", " + getDay() + ", " + getStartTime() + ", " +
getEndTime() + ", " + getLocation() + "," + this.getType() + "\n";
}
COM: <s> returns a string representation of the time slot </s>
|
funcom_train/36643547 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setTaxonAttribute(int taxonIndex, String name, Object value) {
Taxon taxon = getTaxon(taxonIndex);
if (taxon != null)
taxon.setAttribute(name, value);
else
((SimpleNode)getExternalNode(taxonIndex)).setAttribute(name, value);
fireTreeChanged();
fireTaxaChanged();
}
COM: <s> sets an named attribute for the taxon of a given external node </s>
|
funcom_train/44838566 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public List findStudents(String hqlStatement) throws RemoteException {
List result = null;
try {
result = studentManager.findStudents(hqlStatement);
} catch (RemoteException rex) {
System.out.println("Error on the remote server" + rex);
throw new RemoteException("Error on the remote server" + rex);
}
return result;
}
COM: <s> find students only a certain hql statement as parameter </s>
|
funcom_train/18043040 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JMenuBar getJJMenuBar() {
if (jJMenuBar == null) {
jJMenuBar = new JMenuBar();
jJMenuBar.add(getJMenu());
jJMenuBar.add(getJMenu3());
jJMenuBar.add(getJMenu1());
}
return jJMenuBar;
}
COM: <s> this method initializes j jmenu bar </s>
|
funcom_train/39950008 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JRadioButton getJRadioButtonObjectTransfer() {
if (jRadioButtonObjectTransfer == null) {
jRadioButtonObjectTransfer = new JRadioButton();
jRadioButtonObjectTransfer.setText("ObjectTransfer");
jRadioButtonObjectTransfer
.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
setDeviceClass();
}
});
}
return jRadioButtonObjectTransfer;
}
COM: <s> this method initializes j radio button object transfer </s>
|
funcom_train/25761936 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JTextField getTxtUsername() {
if (txtUsername == null) {
txtUsername = new JTextField();
txtUsername.setText(StateSaver.getInstance().getDatabaseSettings().getUsername());
txtUsername.setBounds(new Rectangle(139, 107, 140, 35));
}
return txtUsername;
}
COM: <s> this method initializes txt username </s>
|
funcom_train/3740388 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Messag sendMessage(String contents, String subject, User receiver, User sender) throws Exception {
sess=HibernateUtil.currentSession();
try {
Messag retVal = mman.sendMessage(contents, subject, receiver, sender);
log.info("sendMessage(contents, subject, receiver, sender): Wyslanie "
+"wiadomosci wewnatrzsystemowej");
HibernateUtil.closeSession();
return retVal;
} catch (Exception e) {
HibernateUtil.closeSession();
throw e;
}
}
COM: <s> sends new message </s>
|
funcom_train/11730298 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetDate() throws RepositoryException {
Value val = PropertyUtil.getValue(prop);
Calendar calendar = val.getDate();
assertEquals("Conversion from Double value to Date value is not correct.",
calendar.getTimeInMillis(), new Double(val.getDouble()).longValue());
}
COM: <s> tests conversion from double type to date type </s>
|
funcom_train/43431095 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isValidName(String nameToTest) {
boolean foundMatchingFormat = false;
for(int i=0;i<allowedFormats.size();i++) {
Matcher m = allowedFormats.get(i).namePattern.matcher(nameToTest);
if (!m.matches()) {
continue;
} else {
foundMatchingFormat = true;
break;
}
}
return foundMatchingFormat;
}
COM: <s> verifies a given string conforms to at least one allowable format </s>
|
funcom_train/47968474 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void setSubTaskName(String name) {
synchronized (listenerLock) {
boolean nameChanged = this.subTaskName != name
&& (this.subTaskName == null || !this.subTaskName
.equals(name));
if (nameChanged) {
this.subTaskName = name;
if (listeners != null) {
for (IExtendedCallableListener l : listeners) {
l.subTaskChanged(name);
}
}
}
}
}
COM: <s> sets the sub tast name and informs listeners about this change </s>
|
funcom_train/17576727 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getJButtonOK() {
if (jButtonOK == null) {
jButtonOK = new JButton();
jButtonOK.setBounds(new java.awt.Rectangle(356,294,81,22));
jButtonOK.setText("OK");
jButtonOK.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
((JDialog) getParent().getParent().getParent()).dispose();
}
});
}
return jButtonOK;
}
COM: <s> this method initializes j button ok </s>
|
funcom_train/5076691 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setDefinition(org.fgml.xml.gen.Screen definition) {
this.definition = definition;
if (definition.getEvents()!=null && definition.getEvents().getKeyEventAction()!=null)
this.globalListener
= new GlobalKeyListener(this,display,definition.getEvents().getKeyEventAction());
else
this.globalListener
= new GlobalKeyListener(this,display,new ArrayList<KeyEventAction>());
}
COM: <s> sets the definition </s>
|
funcom_train/49995504 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getParameterAsString() {
StringBuffer stringBuffer = new StringBuffer();
for (String model : this.parameters) {
stringBuffer.append(model);
stringBuffer.append(',');
}
String param = stringBuffer.toString();
if (param.length() >= 1) {
param = param.substring(0, param.length() - 1);
}
return param;
}
COM: <s> return the comma separated list of parameters in string </s>
|
funcom_train/23943691 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void load(String fileName) {
File dsFile = new File(fileName);
if (dsFile.canRead()) {
try {
load(XElement.parseXML(dsFile));
} catch (IOException ex) {
LOG.error(ex.toString(), ex);
} catch (XMLStreamException ex) {
LOG.error(ex.toString(), ex);
}
}
}
COM: <s> load database from disk </s>
|
funcom_train/48868799 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JToggleButton getSelectButton() {
if (selectButton == null) {
selectButton = new JToggleButton("Select",new ImageIcon("resources/images/select.png"), true);
selectButton.setToolTipText("Select");
group.add(selectButton);
selectButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
setSelectedButton(SELECT);
}
});
}
return selectButton;
}
COM: <s> this method initializes select button </s>
|
funcom_train/43416819 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void reset() {
historySizeAtReset = historyIndex = history.size();
for (int i = 0; i < history.size(); i++) {
final HistoryEntry entry = history.get(i);
entry.edited.clear();
entry.edited.addAll(entry.original);
}
}
COM: <s> resets the index of the history to the last entry </s>
|
funcom_train/25069221 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public PublicKey getPublicKey(final String userName){
PublicKey pubKey = null;
String mod = getModulusString(userName);
BigInteger modulus = new BigInteger(mod);
BigInteger pub = new BigInteger("65537");
RSAPublicKeySpec newSpec = new RSAPublicKeySpec(modulus, pub);
KeyFactory fact;
try {
fact = KeyFactory.getInstance("RSA");
pubKey = fact.generatePublic(newSpec);
return pubKey;
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (InvalidKeySpecException e) {
e.printStackTrace();
}
return pubKey;
}
COM: <s> returns a users public key </s>
|
funcom_train/19036115 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addPostWatch(PID pid, MemberID memberID) {
StoredMember temp = this.getStoredMember(memberID);
if(temp != null) {
StoredPost post = this.getStoredPost(pid);
if(post != null) {
temp.addPostWatch(post);
}
}
}
COM: <s> adds a post watch to an account </s>
|
funcom_train/38382294 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean existsClass(java.lang.String qualifiedName) {
Iterator it = this.getClasses().iterator();
while (it.hasNext()) {
if (qualifiedName.compareTo(((ClassType)it.next()).getSimpleName()) == 0)
return true;
}
return false;
}
COM: <s> checks whether a class with the given qualified name exists </s>
|
funcom_train/34193981 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean setLabel(int row, int col, String value){
if(row > 0 && row <=3 && col > 0 && col <=3){
label[(row-1)*3+col-1].setText(value);
return true;
}else{
return false;
}
}
COM: <s> set label at element according to row and colume </s>
|
funcom_train/21888590 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel getJPanelModalities() {
if (jPanelModalities == null) {
jLabel5 = new JLabel(
"Modality (permission, recommendation etc.) TBD.");
jPanelModalities = new JPanel();
jPanelModalities.setBorder(javax.swing.BorderFactory
.createEmptyBorder(5, 5, 5, 5));
jPanelModalities.add(jLabel5, null);
}
return jPanelModalities;
}
COM: <s> this method initializes j panel modalities </s>
|
funcom_train/31805625 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public DeliveryMessageThread getDeliveryMessageThread(AgletProxy proxy, Message message){
// check parameters
if( proxy == null || message == null )
return null;
// synchornize
synchronized(this){
if( this.deliveryPool.size() == 0 ){
// no delivery thread yet created, create a new one
DeliveryMessageThread dmt = new DeliveryMessageThread(proxy, message);
return dmt;
}
else{
// we have a thread in the pool, get it
DeliveryMessageThread dmt = (DeliveryMessageThread) this.deliveryPool.pop();
return dmt;
}
}
}
COM: <s> returns a delivery message thread </s>
|
funcom_train/9101195 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void createEntry(long token, SearchResultSet set) throws Exception {
if (!resultsets.containsKey(new Long(token))) {
if (set != null) {
resultsets.put(new Long(token), set);
} else {
throw new Exception("Cannot create SearchResultSet as there are no sources specified OR set is null");
}
}
}
COM: <s> creates a new entry in the searchresult cache if it does not already </s>
|
funcom_train/22605987 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Button createButton(Group group, String label, boolean enabled, DotMethod method) {
Button button;
button = createRadioButton(group, label);
button.setSelection(getCurrentDotMethod() == method);
button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
boolean enabled = specifyDotButton.getSelection();
dotBrowser.setEnabled(enabled);
dotBrowserChanged(null);
}
});
button.setEnabled(enabled);
return button;
}
COM: <s> creates the mildly complex radio buttons that the prefs dialog uses </s>
|
funcom_train/41096836 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void advanceLevel(){
// reset current levels score
_levelsScore = 0;
// if true is returned then a another level exists otherwise the player has clocked the game :)
if( _world.nextLevel() ){
setState( GAME_WAITING );
_bgColour = _world.getBGColour();
} else
setState( GAME_DONE );
}
COM: <s> called when the player tocuhes the checkpoint on the current level </s>
|
funcom_train/18479636 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Vector3 normalize() throws ZeroLengthException {
if (normalized) {
return this ;
}
double len = length() ;
if (GeomUtils.eq(len,0)) {
throw new ZeroLengthException("normalize called on zero vector") ;
}
else {
return new Vector3(x / len,y / len,z / len,true) ;
}
}
COM: <s> returns the normalized form of this vector </s>
|
funcom_train/14430934 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean isTestMethod(Method pMethod) {
return (pMethod.getName().startsWith("test") && pMethod.getName().length() > 4
&& Modifier.isPublic(pMethod.getModifiers()) && pMethod.getReturnType().getName().equals("void")
&& pMethod.getParameterTypes().length == 0);
}
COM: <s> checks if the method is a valid junit test method </s>
|
funcom_train/34104770 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public LexicalToken classify(Token token) {
if(token.getToken().equals(Constants.EOF_S)){
return new LexicalToken( token, Signal.EOF );
}
char firsCharacter = token.getToken().charAt(0);
if(Character.isLetter(firsCharacter) && Character.isLowerCase(firsCharacter)){
return recognizeIdentifier(token.getToken());
}else if(Character.isDigit(firsCharacter)){
return recognizeNumber(token.getToken());
}else{
return recognizeOperator(token.getToken());
}
}
COM: <s> classifies the token according to the kind </s>
|
funcom_train/40769022 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getParameter_String(String key) {
if (parameters == null) {
return null;
}
if (key == null) {
return null;
}
if (key.length() == 0) {
return null;
}
String rtn = null;
if (parameters.get(key).toString().length() > 0) {
rtn = parameters.get(key).toString().trim();
}
return rtn;
}
COM: <s> get a query string parameter and return a string </s>
|
funcom_train/20655292 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JCheckBox getJcbSaveLogin() {
if (jcbSaveLogin == null) {
jcbSaveLogin = new JCheckBox();
jcbSaveLogin.setSize(new Dimension(221, 21));
jcbSaveLogin.setText(MainWindow.resTxt.getString("Save_Login"));
jcbSaveLogin.setLocation(new Point(20, 200));
jcbSaveLogin.setEnabled(false);
}
return jcbSaveLogin;
}
COM: <s> this method initializes jcb save login </s>
|
funcom_train/3761799 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Runtime getRuntime(Object pk) throws SystemException {
final RuntimeDAO runtimeDAO = daoFactory.createRuntimeDAO();
Connection connection = null;
try {
connection = ds.getConnection();
return runtimeDAO.findByPk(connection, pk);
} catch(SQLException sqle) {
throw new SystemException(sqle);
} finally {
if (connection != null)
try {
connection.close();
} catch (SQLException sqle) { }
}
}
COM: <s> return runtime by its pk </s>
|
funcom_train/43888962 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Envelope getBounds(Query query) throws IOException {
String typeName = query.getTypeName();
FeatureTypeMapping mapping = getMapping(typeName);
Query unmappedQuery = unrollQuery(query, mapping);
FeatureSource mappedSource = mapping.getSource();
Envelope bounds = mappedSource.getBounds(unmappedQuery);
return bounds;
}
COM: <s> computes the bounds of the features for the specified feature type that </s>
|
funcom_train/17491975 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setSignature(String rt, String[] pt) {
String r = JVMUtilities.getReturnTypeName(rt);
String[] p = new String[pt.length];
for (int i = 0; i < pt.length; i++) {
p[i] = JVMUtilities.getParameterTypeName(pt[i]);
}
String sig = JVMUtilities.createMethodDescriptor(r, p);
descriptorIndex = constantPool.putUTF8(sig);
}
COM: <s> sets the signature of this method </s>
|
funcom_train/19318117 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double readDouble() throws JMSException {
if(isBodyModifiable()) {
throw new MessageNotReadableException("BytesMessage write_only");
}
try {
return getInputStream().readDouble();
}
catch(EOFException e) {
throw new MessageEOFException("BytesMessage end_of_message");
}
catch(IOException e) {
throw new JMSException(e.getMessage());
}
}
COM: <s> reads a code double code from the bytes message stream </s>
|
funcom_train/38631998 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel getJPanelIdFactura() {
if (jPanelIdFactura == null) {
GridLayout gridLayout2 = new GridLayout();
gridLayout2.setRows(1);
gridLayout2.setHgap(4);
gridLayout2.setColumns(2);
jPanelIdFactura = new JPanel();
jPanelIdFactura.setLayout(gridLayout2);
jPanelIdFactura.add(getJTextFieldIdFactura(), null);
jPanelIdFactura.add(getJButtonFacturaPorId(), null);
}
return jPanelIdFactura;
}
COM: <s> this method initializes j panel id factura </s>
|
funcom_train/3762473 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void clearSelection(){
// clear the selection in all the views
ListIterator iter = m_setOfObservers.listIterator();
while ( iter.hasNext() ) {
((Observer)iter.next()).clearSelection();
}
// clear the list with the last packages
m_lastSelection.clear();
}
COM: <s> clears all the selections in all the views </s>
|
funcom_train/17397404 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int writeToInputStream(InputStream input, boolean append) throws IOException {
int bytesWritten = 0;
final OutputStream output = newOutputStream(false, append);
try {
byte[] buffer = new byte[getBufferSize()];
while (true) {
int bytesRead = input.read(buffer);
if (bytesRead < 1) {
break;
}
output.write(buffer, 0, bytesRead);
bytesWritten += bytesRead;
}
} finally {
output.close();
}
return bytesWritten;
}
COM: <s> write this file from the given input stream </s>
|
funcom_train/31842832 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setUp(){
author=new TeamMember(tmFirstName, tmLastName,email,pw);
attatch1=new Attachment(1,"attachment 1",null,null);
attatch2=new Attachment(1,"attachment 2",null,author);
attatch1.setId(new Long(1));
attatch2.setId(new Long(2));
wikipage=new WikiPage("test wiki",null,null,1,null,null, null);
}
COM: <s> attachment test set up </s>
|
funcom_train/44713009 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Collection getParentCategories() {
Collection parents = new LinkedList();
DataAssociationCursor cursor =
((DataAssociation) get(PARENTS)).cursor();
applyOrderAndFilter(cursor, s_categoryFields);
while (cursor.next()) {
Category c = new Category(cursor.getDataObject(),
m_categoryFilter);
c.setPreferredOrder(getPreferredOrder());
parents.add(c);
}
return parents;
}
COM: <s> returns the parent categories for the receiving category the categories </s>
|
funcom_train/22028630 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void writeBooleanArray(boolean[] b) throws IOException {
byte[] bx = new byte[b.length];
for (int i=0; i<b.length; i += 1) {
if (b[i]) {
bx[i] = 1;
} else {
bx[i] = 0;
}
}
write(bx, 0, bx.length);
}
COM: <s> write an array of booleans </s>
|
funcom_train/1951942 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addAsChild( final PhylogenyNode parent ) {
if ( isEmpty() ) {
throw new IllegalArgumentException( "Attempt to add an empty tree." );
}
if ( !isRooted() ) {
throw new IllegalArgumentException( "Attempt to add an unrooted tree." );
}
parent.addAsChild( getRoot() );
externalNodesHaveChanged();
}
COM: <s> adds this phylogeny to the list of child nodes of phylogeny node parent </s>
|
funcom_train/23379508 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int searchFor(String searchString) {
for(int i = 0; i < list.size(); i++) {
if(list.get(i).getItemString().contains(searchString) || list.get(i).getItemDescription().contains(searchString) || list.get(i).getItemTags().contains(searchString))
return i;
}
return -1;
}
COM: <s> searches for the provided string in title tags and description </s>
|
funcom_train/16743839 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean equals(Object obj) {
if (!(obj instanceof BitSetPlus))
return false;
if (this == obj)
return true;
BitSetPlus set = (BitSetPlus) obj;
checkInvariants();
set.checkInvariants();
if (mWordsInUse != set.mWordsInUse)
return false;
// Check words in use by both BitSetPluss
for (int i = 0; i < mWordsInUse; i++)
if (mWords[i] != set.mWords[i])
return false;
return true;
}
COM: <s> compares this object against the specified object </s>
|
funcom_train/14068926 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void replaceTitle(Title oldTitle, Title newTitle){
// Search the title and the original path of the title to replace
int titleId = (Integer)titles.getValue(oldTitle);
// Note that the path should stay as it is
// TODO check if there is anything to do with covers
// Remove old title
titles.remove(oldTitle);
// Add new title
addTitle(newTitle, titleId);
}
COM: <s> replace a title in the database by another </s>
|
funcom_train/12913420 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void shuffle(int[] deck) {
for (int i = 0; i < deck.length; ++i) {
deck[i] = i;
}
for (int i = 0; i < deck.length; ++i) {
int j = random.nextInt(deck.length);
int t = deck[i];
deck[i] = deck[j];
deck[j] = t;
}
}
COM: <s> initialize the deck such that deck i i </s>
|
funcom_train/49022167 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JsonIterator convertToJsonIterator(final JsonIterator it) {
return new JsonIterator() {
@Override
public boolean moveNext() throws Exception {
boolean moveNext = it.moveNext();
if (moveNext) {
JsonValue v = it.current();
currentValue = convertToJsonString(v);
return true;
} else {
return false;
}
}
};
}
COM: <s> converts the json iterator into a json iterator for del lines </s>
|
funcom_train/26219276 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void encrypt(int[] buffer) {
int nLen = buffer.length;
long lTemp;
for (int nI = 0; nI < nLen; nI +=2) {
// encrypt a temporary 64bit block
lTemp = BinConverter.intArrayToLong(buffer, nI);
lTemp = encryptBlock(lTemp);
BinConverter.longToIntArray(lTemp, buffer, nI);
};
};
COM: <s> encrypts an int buffer should be aligned to a </s>
|
funcom_train/50254135 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeSignalling(Token token) {
if (taskInstances != null) {
Iterator<TaskInstance> iter = taskInstances.iterator();
while (iter.hasNext()) {
TaskInstance taskInstance = iter.next();
if ((token != null) && (token.equals(taskInstance.getToken()))) {
taskInstance.setSignalling(false);
}
}
}
}
COM: <s> removes signalling capabilities from all task instances related to the given token </s>
|
funcom_train/31902362 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getCompare(String str) {
String ret = null;
int count = 0;
for (int ii = 0; ii < this.getItemCount(); ii++) {
if (this.getItemAt(ii).toString().indexOf(str) != -1) {
count++;
ret = this.getItemAt(ii).toString();
}
}
if (count == 1) {
return ret;
} else {
return null;
}
}
COM: <s> compare a string to the items in the combo box </s>
|
funcom_train/31646276 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Store getStore(String protocol) throws NoSuchProviderException {
// Variables
Provider provider;
// Get Provider for Protocol
provider = (Provider) providersByProtocol.get(protocol);
// Check Result
if (provider == null) {
throw new NoSuchProviderException();
} // if
// Check Type
if (provider.getType() != Provider.Type.STORE) {
throw new NoSuchProviderException();
}
// Generate Store Object
return getStore(provider);
} // getStore()
COM: <s> get store instance </s>
|
funcom_train/1985029 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void run(TestResult result) {
// setup test context
setUp();
try {
result.startTest(this);
runTest();
result.endTest(this);
} catch (AssertionFailedError ae) {
result.addFailure(this, ae);
} catch (Throwable ee) {
result.addError(this, ee);
} finally {
// end context
tearDown();
}
}
COM: <s> runs the test and collects the data into test result </s>
|
funcom_train/20077650 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean verifiesConditionParade(Matrix matrixX, double tolerance, Matrix matrix_X_previousIteration) throws MSNException {
double distanceBetweenTwoIterations = getIncreasedDistanceBetweenTwoIterations(matrixX, matrix_X_previousIteration);
double distantRelative = getDistantRelative(matrixX,distanceBetweenTwoIterations);
if (distantRelative > tolerance){
return true;
}
return false;
}
COM: <s> notes that the result of the system has been achieved condition stoppage </s>
|
funcom_train/7751111 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testLoadClassesName() throws ClassNotFoundException, InstantiationException, IllegalAccessException {
//List<Plugin> l = new ArrayList<Plugin>();
//l.add(new ListPlugin());
assertFalse("Load plugins and get ListPlugin..",PluginFactory.loadClassesName(true).contains(new ListPlugin()));
}
COM: <s> test method for </s>
|
funcom_train/18743278 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JLabel getErrorLabel() {
if (this.errorLabel == null) {
JLabel result = this.errorLabel = new JLabel();
result.setForeground(Color.RED);
result.setMinimumSize(getOkButton().getPreferredSize());
}
return this.errorLabel;
}
COM: <s> returns the label displaying the current error in entered string if any </s>
|
funcom_train/27768748 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object put(Object key, Object value, ExpirationCalculator timer){
synchronized(lock){
if(timeMap.size() +1 >= maxSize){
removeLast();
}
Long tstamp = new Long(System.currentTimeMillis());
timeMap.put(tstamp, key);
reverseTimeMap.put(key, tstamp);
}
return super.put(key, value, timer);
}
COM: <s> store the given value under the given key with the given timer </s>
|
funcom_train/45547203 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setContentLocation(String uri) {
ByteBuffer valueBuffer = BufferUtil.INSTANCE.asciiBuffer(uri + "\r\n");
appendNameValue(HEADERS.contentLocation.buffer(), valueBuffer);
appendNameValue(HEADERS.contentBase.buffer(), valueBuffer.slice());
// appendNameValue(HEADERS.location.buffer(), valueBuffer.slice());
}
COM: <s> sets the content location header </s>
|
funcom_train/17256915 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void applyRenderState(Stack[] states) {
if(children == null) {
return;
}
for (int i = 0, cSize = children.size(); i < cSize; i++) {
Spatial pkChild = getChild(i);
if (pkChild != null)
pkChild.updateRenderState(states);
}
}
COM: <s> applies the stack of render states to each child by calling </s>
|
funcom_train/40615527 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void readAllRows() {
for (int i = 0; i < entryCount; i++) {
SearchRow row = rows[i];
if (row == null) {
row = index.readRow(data, offsets[i], onlyPosition, false);
rows[i] = row;
}
}
}
COM: <s> ensure all rows are read in memory </s>
|
funcom_train/46738205 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setApplicationGroupRef(DisplayModel applicationGroupRef) {
if (Converter.isDifferent(this.applicationGroupRef, applicationGroupRef)) {
DisplayModel oldapplicationGroupRef= new DisplayModel(this);
oldapplicationGroupRef.copyAllFrom(this.applicationGroupRef);
this.applicationGroupRef.copyAllFrom(applicationGroupRef);
setModified("applicationGroupRef");
firePropertyChange(String.valueOf(APPLICATIONVIEWS_APPLICATIONGROUPREFID), oldapplicationGroupRef, applicationGroupRef);
}
}
COM: <s> application module for view </s>
|
funcom_train/26402055 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public PhoneNumber findPhoneNumber(String category) {
PhoneNumber rvalue = null;
for (Iterator i = getPhoneNumbers().iterator(); i.hasNext(); ) {
PhoneNumber c = (PhoneNumber) i.next();
if (c.getCategory().equals(category)) {
rvalue = c;
break;
}
}
return rvalue;
}
COM: <s> given a phone number category find the phone number </s>
|
funcom_train/9370133 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getNumUnreadConversations(long labelId) {
Integer unreadConversations =
getLabelIdValues(labelId).getAsInteger(LabelColumns.NUM_UNREAD_CONVERSATIONS);
// There seems to be a race condition here that can get the label maps into a bad
// state and lose state on a particular label.
int result = 0;
if (unreadConversations != null) {
result = unreadConversations < 0 ? 0 : unreadConversations;
}
return result;
}
COM: <s> returns the number of unread conversation with a given label </s>
|
funcom_train/12173550 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addThElementCapabilities() {
DeviceElementCapability dec =
manager.getDeviceElementCapability("th", true);
dec.setElementSupportLevel(CapabilitySupportLevel.FULL);
dec.addSupportedStyleProperty(StylePropertyDetails.VERTICAL_ALIGN,
getSupportLevel(DeviceCapabilityConstants.TH_VERTICAL_ALIGN));
dec.addSupportedAttribute("valign",
getSupportLevel(DeviceCapabilityConstants.TH_ATTRIBUTE_VALIGN));
manager.addDeviceElementCapability(dec);
}
COM: <s> add a device element capability for the th element </s>
|
funcom_train/18397966 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setAttribute(AttributeContainer container, String objectKey) {
if (Config.getInstance().isEnabled() && Config.getInstance().isCleanerEnabled() &&
!NavigationManagerFactory.isNavigationManagerKey(objectKey)) {
if (removedObjectSet.contains(objectKey)) {
removedObjectSet.remove(objectKey);
} else {
addedObjectSet.add(objectKey);
}
}
}
COM: <s> sets an attribute </s>
|
funcom_train/15410843 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void saveVanillaInsert(Object bean, Transaction t, Object parentBean, BeanManager<?> mgr) {
PersistRequestBean<?> req = createRequest(bean, t, parentBean, mgr);
try {
req.initTransIfRequired();
insert(req);
req.commitTransIfRequired();
} catch (RuntimeException ex) {
req.rollbackTransIfRequired();
throw ex;
}
}
COM: <s> perform insert on non enhanced bean effectively same as enhanced bean </s>
|
funcom_train/19829847 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetLong() throws SQLException {
assertEquals((long) 0, rs.getLong(1));
assertTrue(rs.wasNull());
assertEquals((long) 0, rs.getLong("column"));
assertTrue(rs.wasNull());
// Set what gets returned to something other than the default
long l = (long) 10;
rs2.setNullLong(l);
assertEquals(l, rs.getLong(1));
assertEquals(l, rs.getLong("column"));
}
COM: <s> tests the get long implementation </s>
|
funcom_train/4975614 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSetCRS() {
System.out.println("setCRS");
String srsName = "urn:ogc:crs:epsg:4326";
ParserFactory instance = ParserFactory.getInstance();
Object result = instance.getParser(srsName);
assertNotNull(result);
assertTrue(result instanceof EPSG4326Parser);
}
COM: <s> test of set crs method of class coordinate parser factory </s>
|
funcom_train/5580523 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Class getClassForColumn(int column) throws WrongColumnException {
try {
switch (column) {
case IP:
case HOSTNAME:
case OWNER:
return Class.forName("java.lang.String");
case OS:
return Class.forName("sol.admin.systemmanagement.base.host.OperatingSystem");
case MACADDR:
return Class.forName("sol.admin.systemmanagement.base.host.MAC");
default:
throw (new WrongColumnException("no such column type"));
}
} catch (Exception e) {
throw (new WrongColumnException("class for column " + column +
" not found"));
}
}
COM: <s> get class for index </s>
|
funcom_train/48336759 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public DataObject toDataObject() {
Vector v = new Vector();
for (int i=0; i<numAttributeNameValues(); i++) {
v.addElement(getAttributeNameValuesAt(i).toDataObject());
}
return new DataObject(RETRIEVAL_RESULTS, v);
}
COM: <s> this method converts the retrieval results object to a data object </s>
|
funcom_train/35922112 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void log( String message ){
// TODO: configure YacsLogger, in a convenient, but customizable way for the task implementation
// or should I just provide a simple configure interface, i.e. to hook up to the "real"
// Niche logger and let the task do the rest?
if( logger != null )
logger.log( message );
else
System.err.println( message );
}
COM: <s> convenience function for logging </s>
|
funcom_train/50381740 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void paste() {
checkWidget();
String text = (String) getClipboardContent( DND.CLIPBOARD );
if ( text != null && text.length() > 0 ) {
for ( int i = 0; i < text.length(); i++ ) {
Event event = new Event();
event.character = text.charAt( i );
notifyListeners( SWT.KeyDown, event );
}
}
}
COM: <s> triggers paste from the clipboard into the terminal </s>
|
funcom_train/32758459 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void performChannelSet(final ActionEvent event) {
// need a place to post an error dialog box in case an exception
// is thrown and this view isn't visible
final Container container = this.getParent();
Thread thread = new Thread() {
public void run() {
try {
channelSetButton.setEnabled(false);
channelField.setEnabled(false);
handleChannelSetAction(event, container);
}
finally {
dispatchUpdateView();
}
}
};
thread.start();
}
COM: <s> set the channel to that specified by the pv in the channel field </s>
|
funcom_train/18000137 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Set getValueSet() {
Object result = getValue();
if (result instanceof Set) return (Set)result;
if (result instanceof CommaSeparatedValue)
return ((CommaSeparatedValue)(result)).getValueSet();
if (result instanceof PackedValue)
return ((PackedValue)(result)).getValueSet();
Set v = new LinkedHashSet();
if (result != null) v.add(result);
return v;
}
COM: <s> return the value as a set </s>
|
funcom_train/39468193 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setQuestionCollection(final QuestionCollection col) {
this.col = col;
reviews.removeAll();
checkBoxes = new JCheckBox[col.getSize()];
int i = 0;
for (final QuestionText question : col) {
reviews.add(new ReviewCheckbox(question, i++));
}
invalidate();
validate();
repaint();
}
COM: <s> set the question collection to review </s>
|
funcom_train/8079337 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double precision(int classIndex) {
double correct = 0, total = 0;
for (int i = 0; i < m_NumClasses; i++) {
if (i == classIndex) {
correct += m_ConfusionMatrix[i][classIndex];
}
total += m_ConfusionMatrix[i][classIndex];
}
if (total == 0) {
return 0;
}
return correct / total;
}
COM: <s> calculate the precision with respect to a particular class </s>
|
funcom_train/45571514 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void init() {
GuiBeanManager beanManager = GuiBeanManager.getInstance();
// this crap should be removed...
topLevel = new Column();
JScrollPane areaScrollPane = (JScrollPane) beanManager
.getJComponent("schrifttable");
// uh, we don't like direct sizes, but actually this is needed!
Dimension size = new Dimension(140, 140);
areaScrollPane.setSize(size);
areaScrollPane.setPreferredSize(size);
topLevel.newRow(Row.CENTER, Row.CENTER, areaScrollPane);
topLevel.createLayout(this);
}
COM: <s> method to initiate this container the structure follows </s>
|
funcom_train/46759279 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public FormStateModel getFormState(final long formStateId, final IChainStore chain, final ServiceCall call) throws Exception {
IBeanMethod method = new IBeanMethod() { public Object execute() throws Exception {
return ClinicalData.getFormState(formStateId, chain, call);
}}; return (FormStateModel) call(method, call);
}
COM: <s> same transaction return the single form state model for the primary key </s>
|
funcom_train/13187292 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getIndex(Comparable key) {
int result = -1;
int i = 0;
Iterator iterator = this.data.iterator();
while (iterator.hasNext()) {
KeyedObject ko = (KeyedObject) iterator.next();
if (ko.getKey().equals(key)) {
result = i;
}
i++;
}
return result;
}
COM: <s> returns the index for a given key </s>
|
funcom_train/25365775 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addDamagePoisonPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Enemy_damagePoison_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Enemy_damagePoison_feature", "_UI_Enemy_type"),
LeveleditorPackage.Literals.ENEMY__DAMAGE_POISON,
true,
false,
false,
ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the damage poison feature </s>
|
funcom_train/34557132 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public RowSelectionModel getSelectionModel() {
JavaScriptObject smObj = getSelectionModelAsJavaScriptObject();
if(smObj != null) {
return new RowSelectionModel(smObj);
} else {
RowSelectionModel sm = new RowSelectionModel();
setSelectionModel(sm);
return sm;
}
}
COM: <s> returns the grids row selection model </s>
|
funcom_train/38952566 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void loadImage(BufferedImage img) {
this.img = img;
// TODO find out where to find the "real" size of the decoration and use
Dimension size = new Dimension(this.img.getWidth(null) + 1, this.img
.getHeight(null) + 24);
Icon i = new ImageIcon(img);
this.label.setIcon(i);
this.setAlwaysOnTop(true);
this.setSize(size);
this.setPreferredSize(size);
}
COM: <s> load this image having right size into preview </s>
|
funcom_train/40465219 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean updateTitle(int id, String title) {
String sql = "UPDATE resume SET title='" + addSlashes(title) + "' WHERE id=" + id;
try {
dbStatement = connection.createStatement();
dbStatement.execute(sql);
;
return true;
}
catch(SQLException e) {
return false;
}
}
COM: <s> updates the title in the resume record </s>
|
funcom_train/23393738 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addDealinePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_DeadlineViolation_dealine_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_DeadlineViolation_dealine_feature", "_UI_DeadlineViolation_type"),
FactPackage.Literals.DEADLINE_VIOLATION__DEALINE,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the dealine feature </s>
|
funcom_train/42062168 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void sendData(String s) throws IOException {
// if(!s.equals(PING))
// logger.debug("Sending "+DELIM + s + DELIM);
synchronized (dos) {
try{
dos.writeUTF(DELIM + s + DELIM);
dos.flush();
} catch (Throwable t){
//this try-catch stuff is here because
//flush() can throw NullPointerException AFAIHaveExperimented
throw new IOException(t);
}
}
}
COM: <s> this low level method write raw data to the </s>
|
funcom_train/7297176 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void prepareSocket(final Socket socket) throws IOException {
socket.setTcpNoDelay(HttpConnectionParams.getTcpNoDelay(this.params));
socket.setSoTimeout(HttpConnectionParams.getSoTimeout(this.params));
int linger = HttpConnectionParams.getLinger(this.params);
if (linger >= 0) {
socket.setSoLinger(linger > 0, linger);
}
}
COM: <s> prepares the given </s>
|
funcom_train/47085920 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String reac_describe_sub() {
String list_sub="";
for (int i=0; i<subst.size(); i++)
{
list_sub=list_sub+" "+subst.get(i).getName();
}
String res=this.enzyme_name+" "+ rev_state() +" ("+list_sub+" )";
return res;
}
COM: <s> gives appropriate information to the modele class in order to display them </s>
|
funcom_train/13720135 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Exponentiation getChannel2Exponentiation() throws InterruptedException, IOException {
isActive(true);
try{
byte[] response = getSetting(Exponentiation.CH2COMMANDCODE);
int val;
Exponentiation exp = Exponentiation.getExponentiation(val = MathUtilities
.hex2int(response));
if(exp == null)
logger.log(Level.SEVERE,
"Unable to getChannel1Exponentiation - Bad Response: " + val);
return exp;
}catch(InterruptedException e){
logger.log(Level.SEVERE, "Unable to getChannel2Exponentiation", e);
throw e;
}catch(IOException e){
logger.log(Level.SEVERE, "Unable to getChannel2Exponentiation", e);
throw e;
}
}
COM: <s> this command requests the current channel 2 exponentiation setting from the </s>
|