__key__ stringlengths 16 21 | __url__ stringclasses 1 value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/19254512 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Component add(Component c) {
// I don't understand why this is necessary but it seems to be in
// in some cases
if(c instanceof JSWTMenuComponent) {
return add((JSWTMenuComponent)c);
}
throw new IllegalArgumentException("Sorry, SwingWT cannot support components in menus: " + c);
}
COM: <s> adds a component to the menu </s>
|
funcom_train/23853293 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void loadImmutableRulesets() throws DatabaseException {
List<Dataset> datasets;
Ruleset ruleset;
immutableRulesets = new LinkedList<Ruleset>();
datasets = controller.getDbManager().getAllDatasets();
// loads all rulesets in any tree in any dataset
for (Dataset dataset : datasets) {
for (Tree tree : dataset.getTrees()) {
ruleset = tree.getRuleset();
if (ruleset != null) {
immutableRulesets.add(ruleset);
}
}
}
}
COM: <s> loads all rulesets used by any tree in any dataset </s>
|
funcom_train/43245520 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetBadAddrIdentifier() {
System.out.println("getBadAddrIdentifier");
PatientDemographicsDG4Object instance = new PatientDemographicsDG4Object();
String expResult = "";
String result = instance.getBadAddrIdentifier();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
COM: <s> test of get bad addr identifier method of class org </s>
|
funcom_train/37016206 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getLanguage(Resource base) {
String l_language = "";
if (base == null) {
return l_language;
}
try {
Statement s2 = base.getProperty(DC.language);
LangString l = getLangString4Statement(s2, base.getModel());
if(l != null)
l_language = l.getValue();
} catch (RDFException e) {
e.printStackTrace();
}
return l_language;
}
COM: <s> gets the language </s>
|
funcom_train/49800133 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: /*public void testIsLifetimeLeft() throws Exception {
System.out.println("isLifetimeLeft");
Certificate instance = null;
boolean expResult = true;
boolean result = instance.isLifetimeLeft();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
COM: <s> test of is lifetime left method of class uk </s>
|
funcom_train/41164933 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public CoActivityUserHistory update(CoActivityUserHistory entity) {
EntityManagerHelper.log("updating CoActivityUserHistory instance", Level.INFO, null);
try {
CoActivityUserHistory result = getEntityManager().merge(entity);
EntityManagerHelper.log("update successful", Level.INFO, null);
return result;
} catch (RuntimeException re) {
EntityManagerHelper.log("update failed", Level.SEVERE, re);
throw re;
}
}
COM: <s> persist a previously saved co activity user history entity and return it or </s>
|
funcom_train/39907759 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void updateInfo(){
//update cPos
odo.getPosition(cPos);
//compute unitH
synchronized(dataLock){
unitH[0]=Trig.sin2(cPos[2]);
unitH[1]=Trig.cos2(cPos[2]);
//compute targV
targV[0]=targPos[0]-cPos[0];
targV[1]=targPos[1]-cPos[1];
}
}
COM: <s> gets called by timed out </s>
|
funcom_train/35621535 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void xformPt(Vec3f src, Vec3f dest) {
if(src == null)
{
System.err.println(src);
}
for (int rc = 0; rc < 3; rc++) {
float tmp = 0.0f;
for (int cc = 0; cc < 3; cc++) {
tmp += get(rc, cc) * src.get(cc);
}
tmp += get(rc, 3);
dest.set(rc, tmp);
}
}
COM: <s> transforms a 3 d vector as though it had a homogeneous coordinate </s>
|
funcom_train/13995256 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initCenterPanel() {
centerPanel = new JPanel(new BorderLayout());
centerPanel.add(createContentPanel(), BorderLayout.CENTER);
centerPanel.add(toolBar, BorderLayout.NORTH);
centerPanel.add(exceptionBox, BorderLayout.SOUTH);
}
COM: <s> initializes the center panel </s>
|
funcom_train/29274958 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void clean(File _file) {
if (_file.isDirectory()) {
for (File file : _file.listFiles()) {
clean(file);
}
}
if (_file.delete()) {
RuntimeContext.getInstance().message("cleaned " + _file + " OK");
} else {
RuntimeContext.getInstance().warning("failed to clean " + _file);
}
}
COM: <s> a recursive function for cleaning a directory tree </s>
|
funcom_train/48454613 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isPlayerLeagueAdmin(Integer playerId, Long leagueId) {
String sql = "select count(*) " + " from " + LEAGUE_ADMINS_TABLE + " where "
+ LEAGUE_ADMINS_LEAGUE_ID + " = ? and " + LEAGUE_ADMINS_PLAYER_ID + " = ?";
return simpleJdbcTemplate.queryForInt(sql, leagueId.intValue(), playerId) > 0;
}
COM: <s> determines if player is league admin for a specific league </s>
|
funcom_train/7368300 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void clear(final int bitIndex) {
if ((bitIndex < 0) || (bitIndex > bitNum)) { throw new IndexOutOfBoundsException("" + bitIndex); }
final int blockIndex = BitSet.blockIndex(bitIndex);
bits[blockIndex] &= ~BitSet.bit(bitIndex);
}
COM: <s> sets the bit specified by the index to code false code </s>
|
funcom_train/12560803 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void lSetAltText(String altText) {
// Only update native resource if it exists.
if (nativeId != DisplayableLFImpl.INVALID_NATIVE_ID) {
setContent0(nativeId, itemImageData, altText,
appearanceMode);
}
lRequestInvalidate(true, true);
}
COM: <s> notifies l amp f of an alternative text change </s>
|
funcom_train/34451277 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addObjectPropertyDescriptor(Object object) {
itemPropertyDescriptors.add(createItemPropertyDescriptor(
((ComposeableAdapterFactory) adapterFactory)
.getRootAdapterFactory(), getResourceLocator(),
getString("_UI_MRuntimeChange_object_feature"), getString(
"_UI_PropertyDescriptor_description",
"_UI_MRuntimeChange_object_feature",
"_UI_MRuntimeChange_type"),
RuntimePackage.Literals.MRUNTIME_CHANGE__OBJECT, true, false,
true, null, null, null));
}
COM: <s> this adds a property descriptor for the object feature </s>
|
funcom_train/4114272 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setNextOccupant(Unit _nextOccupant) {
/*
if (_nextOccupant == null) {
nextOccupant = _nextOccupant;
} else if (_nextOccupant.getGame().getBoard().getTile(getX(), getY()) == this) {
nextOccupant = _nextOccupant;
} else {
throw new IllegalArgumentException("Unit not in game");
}
*/
nextOccupant = _nextOccupant;
}
COM: <s> mutator set the unit attempting to move to this tile </s>
|
funcom_train/29063114 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Collection getChildrenFeatures(Object object) {
if (childrenFeatures == null) {
super.getChildrenFeatures(object);
childrenFeatures.add(AspectxPackage.eINSTANCE.getNotType_And());
childrenFeatures.add(AspectxPackage.eINSTANCE.getNotType_Or());
childrenFeatures.add(AspectxPackage.eINSTANCE.getNotType_Restriction());
childrenFeatures.add(AspectxPackage.eINSTANCE.getNotType_Pointcut());
childrenFeatures.add(AspectxPackage.eINSTANCE.getNotType_PointcutRef());
}
return childrenFeatures;
}
COM: <s> this specifies how to implement </s>
|
funcom_train/3679911 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean replace(Object oldObj, Object newObj)
{
if (nest != null)
{
return nest.replace(oldObj, newObj);
}
else
{
int sz = elements.size();
for (int i = 0; i < sz; i++)
{
if (elements.get(i) == oldObj)
{
elements.set(i,newObj);
return true;
}
}
}
return false;
}
COM: <s> replace an object within the composite </s>
|
funcom_train/7511105 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public TestTransactionMode getTransactionMode() throws PersistentException {
if (currentTransactionMode != null) {
return currentTransactionMode;
}
final TestTransactionMode default_ = TestTransactionMode.COMMIT_EVERY_ROW;
if (this.virualMode) {
return default_;
}
try {
currentTransactionMode = TestTransactionMode.valueOf(this.commonConfigInstance
.getString(PARAM_TRANSACTION_MODE, default_.name()));
//AppHelper.setDatabaseTransactionMode(currentTransactionMode);
return currentTransactionMode;
} catch (IllegalArgumentException iae) {
return default_;
}
}
COM: <s> return current transaction mode </s>
|
funcom_train/44313221 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void writeToXmlDoc(SAXWriter wrt) throws SAXException {
if (!shouldWrite()){
return;
}
if (inserted) {
return;
}
List<SAXWriter.Attr> attrs = new ArrayList<SAXWriter.Attr>();
writeAttrs(attrs);
wrt.startElement(RELATIONSHIP, attrs);
for (Reference ref : references) {
ref.writeToXmlDoc(wrt);
}
wrt.endElement(RELATIONSHIP);
}
COM: <s> notify the content handler of the state of this class </s>
|
funcom_train/51792481 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void drawCurrent(Graphics g, int x, int y) {
g.clipRect(x, y, width, height);
g.drawImage(imageSeq,
x - width * currentImage,
y - height * currentState,
Graphics.TOP | Graphics.LEFT);
g.setClip(0, 0, Constants.SCREEN_WIDTH, Constants.SCREEN_HEIGHT);
}
COM: <s> draw current image in sequence </s>
|
funcom_train/40866566 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void logMessage(Map message) {
StringBuffer buf = new StringBuffer(message.size() * 200);
String key;
for(Iterator it = message.keySet().iterator(); it.hasNext(); ) {
key = (String) it.next();
buf.append("\t[" + key + "] -> [" + message.get(key) + "]\n");
}
log.debug(buf.toString());
}
COM: <s> logs a cyber source message </s>
|
funcom_train/29538732 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JSplitPane getTopBottomSplitPane() {
if (topBottomSplitPane == null) {
topBottomSplitPane = new JSplitPane();
topBottomSplitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
topBottomSplitPane.setTopComponent(getTopLeftRightSplitPane());
topBottomSplitPane.setBottomComponent(getBottomLeftRightSplitPane());
topBottomSplitPane.setDividerLocation(properties.getMainTopBottomSplit());
}
return topBottomSplitPane;
}
COM: <s> this method initializes top bottom split pane </s>
|
funcom_train/5382543 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private long getThreshold(String eventName) {
Long value = (Long) thresholdMap.get(eventName);
if (value == null) {
String option = InternalPlatform.getDefault().getOption(eventName);
if (option != null) {
try {
value = new Long(option);
} catch (NumberFormatException e) {
//invalid option, just ignore
}
}
if (value == null)
value = new Long(Long.MAX_VALUE);
thresholdMap.put(eventName, value);
}
return value.longValue();
}
COM: <s> returns the performance threshold for this event </s>
|
funcom_train/5343565 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initializeOutgoingSession(ChatHost host) {
try {
host.getSocket().setSoTimeout(10000);
ByteReader br = new ByteReader(host.getSocket().getInputStream());
// we send
host.initiateHandshake();
// they respond
host.parseResponseString(br);
host.readHandshake(br);
// we conclude
host.concludeHandshakeOK();
host.initReadWrite();
} catch (IOException ioe) {
host.stop();
}
synchronized (this) {
_chats.add(host);
}
}
COM: <s> initializes an outgoing session </s>
|
funcom_train/3736278 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void destroy(boolean success) {
if (!destroyed) {
if (listeners != null) {
for (Iterator i = listeners.iterator(); i.hasNext();) {
ContextListener contextListener = (ContextListener) i.next();
contextListener.contextDestroyed(success);
}
}
destroyed = true;
}
}
COM: <s> destroy the pipeline context </s>
|
funcom_train/25291407 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public float getAttributeGain() {
if (isLiveOrCompiled())
if (!this.getCapability(ALLOW_ATTRIBUTE_GAIN_READ))
throw new CapabilityNotSetException(Ding3dI18N.getString("AuralAttributes1"));
return ((AuralAttributesRetained)this.retained).getAttributeGain();
}
COM: <s> retrieve attribute gain amplitude </s>
|
funcom_train/3341927 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void reset() {
// Trigger reset
io.outPortByte(iobase + NE_RESET, io.inPortByte(iobase + NE_RESET));
while ((io.inPortByte(iobase + NE_P0_ISR) & NE_ISR_RST) == 0) {
Thread.yield();
}
// Reset Interrupt flags
io.outPortByte(iobase + NE_P0_ISR, 0xff);
}
COM: <s> reset the device </s>
|
funcom_train/28633460 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getRemoveButton() {
if (removeButton == null) {
removeButton = new JButton();
removeButton.setText("Remove");
removeButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
try {
queue.cancel(getSelectedIds());
} catch (Throwable ex) {
ErrorMessageHandler.handle(ex);
}
}
});
}
return removeButton;
}
COM: <s> this method initializes remove button </s>
|
funcom_train/44451562 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void sendMSNPMessage( OutgoingMessage msg ) {
try {
PrintWriter pw = new PrintWriter( new OutputStreamWriter( connection.getOutputStream(), "UTF-8" ) );
pw.write( msg.getMessageString() );
pw.flush();
System.out.println( ">>> " + msg.toString().trim() );
} catch( Exception e ) {
System.out.println( e );
}
}
COM: <s> sends the specified msnp packet to the server </s>
|
funcom_train/13849528 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isCompleted(long waitFor) throws JobException {
//If nothing has started, the
//task could not have completed.
//Less than zero means initial value
//and greater than zero means there
//are outstanding tasks. In each of
//these cases, the Job is not done.
awaitPending(waitFor);
synchronized(this) {
if (pending == 0)
return true;
if (pending < 0)
throw new JobNotStartedException("No jobs started");
return false;
}
}
COM: <s> check to see if the code job code execution has </s>
|
funcom_train/7690045 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double getDemographic(double t) {
double nZero = getN0();
double r = getGrowthRate();
double c = getShape();
// return nZero * (1 + c) / (1 + (c * Math.exp(r*t)));
// AER rearranging this to use exp(-rt) may help
// with some overflow situations...
double common = Math.exp(-r*t);
return (nZero * (1 + c) * common) / (c + common);
}
COM: <s> gets the value of the demographic function n t at time t </s>
|
funcom_train/2304110 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void parseObligations(Node root) throws ParsingException {
NodeList nodes = root.getChildNodes();
for (int i = 0; i < nodes.getLength(); i++) {
Node node = nodes.item(i);
if (node.getNodeName().equals("Obligation"))
obligations.add(Obligation.getInstance(node));
}
}
COM: <s> helper routine to parse the obligation data </s>
|
funcom_train/25495370 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Number parseNumber(String s) {
if (s==null || s.length()<1) {
return null;
}
float newValue;
try {
newValue = Float.parseFloat(s);
} catch(NumberFormatException e) {
return null;
}
if(Float.isInfinite(Math.abs(newValue))) {
return null;
}
if(Float.isNaN(newValue)) {
return null;
}
return new Float(newValue);
}
COM: <s> parses the string as a floating point value </s>
|
funcom_train/5511019 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void append(URIList other) {
if (other == null) {
return;
}
String[] l = other.list();
for (int i = 0; i < l.length; i++) {
if (m_elements.indexOf(l[i]) == -1) {
m_elements.add(l[i]);
}
}
}
COM: <s> append the contents of the other urilist instance to this </s>
|
funcom_train/803550 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getKeyByAccountType(String accountTypeName) {
for ( Account a : loggedInSuperUser.getAccounts().values() ) {
if( accountTypeName.equals( a.getAccountType().getName() ) ) {
return getKey( a.getAccountId() );
}
}
throw new IllegalArgumentException("There is no such account type");
}
COM: <s> returns the decrypted key for an account of a given account type </s>
|
funcom_train/51571909 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int maxTokenLength() {
int maxLen = 0;
for (String localName : tokens.keySet()) {
maxLen = Math.max(maxLen, localName.length());
}
maxLen += name.length();
maxLen++; //the dot
return maxLen;
}
COM: <s> length of the longest token namespaced name in this namespace </s>
|
funcom_train/5341744 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void handleRemoveEvent(FileManagerEvent evt) {
FileDesc file = evt.getFileDescs()[0];
Song song = map.remove(file.getSHA1Urn());
if (song != null) {
Transaction txn = library.open(true);
txn.addTransactionListener(new ServerUpdater(server));
database.remove(txn, song);
}
}
COM: <s> handles a remove event </s>
|
funcom_train/22909664 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void write(File file) throws IOException {
if (GoogleearthFileFilter.isKmlFile(file)) {
writeKml(file);
} else if (GoogleearthFileFilter.isKmzFile(file)) {
writeKmz(file);
} else {
throw new IOException("Neither KML nor KMZ " + file.getPath()); //$NON-NLS-1$
}
}
COM: <s> write image data to a file </s>
|
funcom_train/12560843 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void lSetFont(int elementNum, Font font) {
// Only update native resource if it exists.
if (nativeId != DisplayableLFImpl.INVALID_NATIVE_ID) {
setFont0(nativeId, elementNum,
font.getFace(), font.getStyle(), font.getSize());
lRequestInvalidate(true, true);
}
}
COM: <s> notifies look amps feel that a new font was set for an </s>
|
funcom_train/35050888 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel getJPanel_button() {
if (jPanel_button == null) {
jPanel_button = new JPanel();
GridLayout gridLayout = new GridLayout();
gridLayout.setRows(1);
jPanel_button.setLayout(gridLayout);
jPanel_button.add(getJButton_add(), new GridBagConstraints());
jPanel_button.add(getJButton_cancel(), new GridBagConstraints());
}
return jPanel_button;
}
COM: <s> this method initializes j panel button </s>
|
funcom_train/2844988 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void setAnnotatorNames(Object[] names) {
taggerChoice.addItem(NONE);
Arrays.sort(names);
for (int ni = 0; ni < names.length; ni++) {
taggerChoice.addItem(((String) names[ni]).replace('_', ' '));
}
}
COM: <s> sets the list of displayed annotator names to the specified names array </s>
|
funcom_train/12622093 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean getNextPage(final Vector elements) {
boolean ret = true;
int s = size();
elements.removeAllElements(); // just in case...
for (int i=0 ; i < page; ++i) {
if (nextPageIndex >= s)
{
ret = false;
break;
}
elements.addElement(elementAt(nextPageIndex++));
}
return ret;
}
COM: <s> fills the given vector with the elements of the next page </s>
|
funcom_train/3080526 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int compareTo(Object o) {
Coordinate that = (Coordinate) o;
int order;
if (this.getY() == that.getY()) {
order = this.getX() - that.getX();
} else {
order = (this.getY() - that.getY()) * 0x10000 + this.getX() - that.getX();
}
return order;
}
COM: <s> compares this coordinate to another </s>
|
funcom_train/636962 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Element getChild(String name) {
if (m_children != null) {
// Iterate across our children looking for a match
for (int i = 0; i < m_children.size(); i++) {
Element child = (Element) m_children.elementAt(i);
if (child.getName().equals(name)) {
return child;
}
}
}
// No match was found, return null
return null;
}
COM: <s> returns the child element with the passed in name </s>
|
funcom_train/2587512 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void init(final RootXmlReadHandler rootHandler, final String tagName) {
if (rootHandler == null) {
throw new NullPointerException("Root handler must not be null");
}
if (tagName == null) {
throw new NullPointerException("Tag name must not be null");
}
this.rootHandler = rootHandler;
this.tagName = tagName;
}
COM: <s> initialises the handler </s>
|
funcom_train/19825466 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void abortCommand() {
if (closed) {
throw new IllegalStateException("Session is closed");
}
synchronized (cmdline) {
for (Enumeration e = cmdline.elements(); e.hasMoreElements();) {
Command c = (Command) e.nextElement();
if (c.thread != null) {
c.thread.interrupt();
}
}
}
}
COM: <s> abort current command in session </s>
|
funcom_train/46455464 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void mouseDragged(MouseEvent e) {
mouseEvent = e;
mouseAction = MOUSE_DRAGGED;
if(interactive!=null) {
interactive.handleMouseAction(InteractivePanel.this, e);
}
if(showCoordinates) {
String s = coordinateStrBuilder.getCoordinateString(InteractivePanel.this, e);
blMessageBox.setText(s);
}
}
COM: <s> handles the mouse dragged event </s>
|
funcom_train/26526777 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setPay(String pay) {
if (pay.equals(C_Bookstore.C_Visa)){
this.pay = "You want to pay with your Visa card";
}
else if (pay.equals(C_Bookstore.C_MasterCard)) {
this.pay = "You want to pay with your MasterCard";
}
else
this.pay = "No valid way to pay";
}
COM: <s> sets payment method </s>
|
funcom_train/12561855 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object clone() {
MD5 cpy = new MD5();
System.arraycopy(this.state, 0, cpy.state, 0, 4);
System.arraycopy(this.num, 0, cpy.num, 0, 1);
System.arraycopy(this.data, 0, cpy.data, 0, 16);
System.arraycopy(this.count, 0, cpy.count, 0, 2);
return cpy;
}
COM: <s> clones the message digest object </s>
|
funcom_train/42715140 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String resolveName(String name) {
String address = "";
try {
for (int i = 0;; i++) {
// Vectors without generics SUCK
Buddy temp = (Buddy) buddys.elementAt(i);
if (name.equals(temp.getName())) {
address = temp.getAddress();
}
}
} catch (ArrayIndexOutOfBoundsException e) {
}
return address;
}
COM: <s> looks for a name and if its found the corresponding address is returned </s>
|
funcom_train/2710063 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void checkName(String name) throws InvalidNameException{
if (Arrays.binarySearch(Function.DEFAULTS, name) > -1)
throw new ExistingNameException(name);
if (name.matches(".*[ &\\|\\+-/\\%*].*"))
throw new InvalidNameException(name);
}
COM: <s> checks that a function name is valid for the parser </s>
|
funcom_train/29372491 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JMenu getJMenu_Windows() {
if (jMenu_Windows == null) {
jMenu_Windows = new JMenu();
jMenu_Windows.setText("Windows");
// This is a know fix problem for menus going behind canvas
jMenu_Windows.add(getJMenuItem_VSCS());
jMenu_Windows.add(getJMenuItem_StripBay());
jMenu_Windows.add(getJMenuItem_InfSys4());
jMenu_Windows.getPopupMenu().setLightWeightPopupEnabled(false);
}
return jMenu_Windows;
}
COM: <s> this method initializes j menu windows </s>
|
funcom_train/8425066 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Dimension calculatePreferredSize(IFigure figure, int wHint, int hHint) {
Dimension d = new Dimension();
d.width=canvas.getClientArea().width;
d.height=400;
List children = figure.getChildren();
IFigure child;
int maxH=0;
for (int i = 0; i < children.size(); i++) {
child = (IFigure)children.get(i);
int h=child.getBounds().y+child.getBounds().height;
if(h>maxH){
maxH=h;
}
}
d.height=maxH;
ExplorerView.log.info("children:"+children.size());
ExplorerView.log.info("d:"+d);
return d;
}
COM: <s> calculates and returns the preferred size of the given figure </s>
|
funcom_train/2961703 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double getEnumImpactVar(IntDomainVar var) {
int idx = var.getExtension(ABSTRACTVAR_EXTENSION).get();
if (idx != -1) {
double imp = 0.0;
DisposableIntIterator it = var.getDomain().getIterator();
int blockadress = dataS.blocks[idx] - dataS.offsets[idx];
while (it.hasNext()) {
int val = it.next();
imp += 1 - getImpactVal(blockadress + val);
}
it.dispose();
return imp;
} else
return 0;
}
COM: <s> sum over each value of var the remaining search space </s>
|
funcom_train/42659462 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void fireAfterGetEvent(E obj) {
// generate after remove event
if (this.afterGetEvent != null && 0 < this.afterGetEvent.getListenerCount()) {
// create event
ActionEventAfter_1x0<E> e = new ActionEventAfter_1x0<E>(this, eventID++, STR_AFTER_GET);
e.setData(obj);
this.afterGetEvent.fire(e);
}
}
COM: <s> fires the after get event </s>
|
funcom_train/49319081 | /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 == this) return true;
if (!super.equals(obj)) return false;
if (!(obj instanceof ProperMotion)) return false;
ProperMotion that = (ProperMotion) obj;
return (fRaError == that.fRaError) && (fDecError == that.fDecError);
}
COM: <s> determines whether two proper motions are equal </s>
|
funcom_train/9528677 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object getOnlyValue(URI uriKey) throws MultipleAttributeValuesException {
if (!bag.containsKey(uriKey)) return null;
List<Object> valList = (List<Object>)bag.get(uriKey);
if (valList.size() > 1) {
throw new MultipleAttributeValuesException("Attempted to retrieve sole value for attribute " + uriKey.toString() + " but multiple values are present.");
}
return valList.get(0);
}
COM: <s> get the only value associated with the provided uri key </s>
|
funcom_train/3004174 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void flush( String holderName, Hashtable prefs){
logGraphBegin( "flushing pref for " + holderName );
String fullName = normalizeName( holderName );
PathItemLocal item = getPathItem( fullName );
if ( item != null )
item.setItem( prefs );
else
createItem( fullName, prefs );
logGraphEnd("flush pref");
}
COM: <s> flushes the modification and removal in the database </s>
|
funcom_train/34793951 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Change integrate(String source, StringBuffer sb, Change c) throws PerforceException {
if (null == c) {
c = new Change();
c.setDescription("Automated Integration");
c.commit();
}
return Branch.integrate(this.getEnv(), source, this.getName(), sb, c);
}
COM: <s> class method for integrating using the instantiated branch </s>
|
funcom_train/49456653 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected JFreeChart callPortalChart(String key) throws Exception {
PortalRequestObject pro = portalCalls.get(key);
if (pro == null)
throw new IllegalArgumentException("No PortalRequestObject is associated to the key ("+key+")");
return PortalHelper.getJFreeChartForWS(getDb(), pro);
}
COM: <s> wrapper for call to portal helper </s>
|
funcom_train/46059897 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void releaseAdminLockAndGroupMUE() {
// deregister for group change events
if (this.currentGroup != null) {
CoordinatorManager.getCoordinator().getEventBus().deregisterFor(this, this.currentGroup);
}
// this is done by simply disposing the businessgroup managing controller
if (groupEditCtr != null) {
groupEditCtr.dispose();
groupEditCtr = null;
}
}
COM: <s> add every admin child controller which must be disposed </s>
|
funcom_train/7800726 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object execute(final Map<Object, Object> iArgs) {
if (schemaClass == null)
throw new OCommandExecutionException("Can't execute the command because it hasn't been parsed yet");
final long recs = schemaClass.count();
try {
schemaClass.truncate();
} catch (IOException e) {
throw new OCommandExecutionException("Error on executing command", e);
}
return recs;
}
COM: <s> execute the command </s>
|
funcom_train/50076581 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean hasIInterfaceInstance(IInterfaceInstance iface){
IComponentInstance comp = (IComponentInstance)element;
Collection coll = comp.getAllInterfaceInstances();
if(coll==null) return false;
Iterator iter = coll.iterator();
while(iter.hasNext()){
if(iter.next()==iface) return true;
}
return false;
}
COM: <s> checks if the xarchlib element has this iinterface instance </s>
|
funcom_train/45255977 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void toggleTreeEnablement(boolean enabled) {
Object[] elements = provider.getElements(activitySupport);
//reset grey state to null
dualViewer.setGrayedElements(new Object[0]);
//enable all categories
for (int i = 0; i < elements.length; i++) {
dualViewer
.expandToLevel(elements[i], AbstractTreeViewer.ALL_LEVELS);
dualViewer.setSubtreeChecked(elements[i], enabled);
}
}
COM: <s> toggles the enablement state of all activities </s>
|
funcom_train/91077 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public long getChildrenTime(){
long childrenTime = 0;
java.util.Enumeration e = getChildren().elements();
while (e.hasMoreElements()){
childrenTime = childrenTime + ((RealBasicNoPutResultSetStatistics)e.nextElement()).getTotalTime();
}
return childrenTime;
}
COM: <s> return the time for all operations performed by the children of this node </s>
|
funcom_train/50187028 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void showExprValue(ShowEvent showevent) throws SAXException {
Value v = Helper.getExprValue(showevent.expr);
if (v != null) {
String msg = "expr (" + showevent.expr + ") = " + v.getNode().value;
log.info(msg);
DebugManager.updateShell(msg);
}
}
COM: <s> this method displays the value of a stx expression </s>
|
funcom_train/31692837 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString( Map dictionary ) throws NoDefinitionException {
StringBuffer buf = new StringBuffer();
for (Iterator itr = tokens.iterator(); itr.hasNext();) {
Object v = itr.next();
if(v instanceof String) buf.append((String)v);
else
buf.append( ((Variable)v).toString(dictionary) );
}
return buf.toString();
}
COM: <s> expands all the variables with a given dictionary </s>
|
funcom_train/41024123 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel getJContentPane() {
if (jContentPane == null) {
jContentPane = new JPanel();
jContentPane.setLayout(new BorderLayout());
jContentPane.add(getJTitlePanel(), BorderLayout.NORTH);
jContentPane.add(getJConfigurationPanel(), BorderLayout.CENTER);
jContentPane.add(getJNavigationPanel(), BorderLayout.SOUTH);
}
return jContentPane;
}
COM: <s> this method initializes j content pane </s>
|
funcom_train/8660237 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void invalidateObject(Object obj) throws Exception {
if (config != null && config.getRemoveAbandoned()) {
synchronized (trace) {
boolean foundObject = trace.remove(obj);
if (!foundObject) {
return; // This connection has already been invalidated. Stop now.
}
}
}
super.invalidateObject(obj);
}
COM: <s> invalidates an object from the pool </s>
|
funcom_train/2578106 | /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 == this) {
return true;
}
if (!(obj instanceof CompositeTitle)) {
return false;
}
CompositeTitle that = (CompositeTitle) obj;
if (!this.container.equals(that.container)) {
return false;
}
if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) {
return false;
}
return super.equals(obj);
}
COM: <s> tests this title for equality with an arbitrary object </s>
|
funcom_train/32156881 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JMenuItem getRandomDCOPMenuItem() {
if (randomDCOPMenuItem == null) {
randomDCOPMenuItem = new JMenuItem();
randomDCOPMenuItem.setText("Random DCOP");
randomDCOPMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
printlnWarning("random DCOP generator is not yet implemented");
}
});
}
return randomDCOPMenuItem;
}
COM: <s> this method initializes random dcopmenu item </s>
|
funcom_train/10956800 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSimple() throws Exception {
TestAction testAction = (TestAction) action;
testAction.setFoo("bar");
ComponentTag tag = new ComponentTag();
tag.setPageContext(pageContext);
tag.setLabel("mylabel");
tag.setName("myname");
tag.setValue("foo");
tag.doStartTag();
tag.doEndTag();
verify(ComponentTag.class.getResource("Component-1.txt"));
}
COM: <s> note this test uses empty </s>
|
funcom_train/51766402 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void checkConsistency(Check check) {
ConsistencyCheck cc = null;
try {
Class classDefinition = Class.forName(check.getCode());
cc = (ConsistencyCheck) classDefinition.newInstance();
} catch (InstantiationException e) {
System.out.println(e);
} catch (IllegalAccessException e) {
System.out.println(e);
} catch (ClassNotFoundException e) {
System.out.println(e);
}
try {
String msg = cc.checkConsistency();
getMccPane().updateResults(msg);
} catch (Exception e) {
Log.write(e.getMessage());
e.printStackTrace(Log.p);
}
}
COM: <s> this method executes the corresponding check </s>
|
funcom_train/42474134 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getIndent(String line) {
assert line != null : line;
StringBuffer indent = new StringBuffer();
// Ex.: >(1) < -> 4 spaces.
// for (int counter = 0, spaces = line.substring(line.indexOf("("), line.indexOf(")") + 2).length();
// counter < spaces;
// counter++)
// indent.append(" ");
return indent.toString();
}
COM: <s> calculates the indent to be added to subsequent lines </s>
|
funcom_train/49469689 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean addVendorProductVersion(VulnId e_vulnerability_id, String vendor, String product, String version, String patchlevel) throws Exception {
return addVendorProductVersion(e_vulnerability_id, new VendorProductVersion(vendor, product, version, patchlevel));
}
COM: <s> register the vendor product version patchlevel information into the database </s>
|
funcom_train/30280264 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void calculateAndFillAvgCallLength() {
if (callAgentItem != null && callAgentItem.getNumberOfCalls() != 0) {
AvgCallLength prevAvgCallLength = new AvgCallLength(
productivity.getProductivityTime().getTotalTime(),
productivity.getNonProductivityTime().getTotalTime(),
callAgentItem.getNumberOfCalls(),
productivity.getChangingType());
callAgentItem.setAverageCallLenght(prevAvgCallLength);
}
}
COM: <s> average call length </s>
|
funcom_train/19454558 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addTool(Tool aTool) {
//aTool.setLocation(0, tools.size() + aTool.getSize().width );
aTool.setLocation( tools.size() * aTool.getSize().width , 2 );
aTool.setSize(aTool.getSize().width, getSize().height - 3 );
tools.addElement(aTool);
add(aTool);
aTool.setVisible(true);
aTool.addToolListener(this);
}
COM: <s> this method was created in visual age </s>
|
funcom_train/18644230 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public MessageHandler getClientMessageHandler(Class cls) {
MessageHandler ret=null;
if (getClientMessageHandlers() != null) {
for (int i=0; ret == null && i <
getClientMessageHandlers().length; i++) {
if (getClientMessageHandlers()[i] != null) {
ret = getClientMessageHandlers()[i].
getMessageHandlerForType(cls);
}
}
}
return(ret);
}
COM: <s> this method returns a message handler that is assignable </s>
|
funcom_train/25420707 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: @Override
public int countDocuments() throws CatalogIndexException {
IndexSearcher searcher = null;
try {
searcher = newSearcher();
return searcher.maxDoc();
} catch (Exception e) {
String sMsg = "Error accessing index:\n "+Val.chkStr(e.getMessage());
throw new CatalogIndexException(sMsg,e);
} finally {
closeSearcher(searcher);
}
}
COM: <s> counts the documents within the index </s>
|
funcom_train/32943300 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getRendering(String format) throws IOException {
long start = System.currentTimeMillis();
String result;
if(format.equals(FileFactory.CSV_FORMAT)){
result = getCSVRendering();
}
else if(format.equals(FileFactory.HTML_FORMAT)){
result = getHTMLRendering();
}
else {
log.debug("Unknown format: " + format);
result = "";
}
log.debug("getRendering took " + (System.currentTimeMillis()-start) + "ms");
return result;
}
COM: <s> output rendering according to a format </s>
|
funcom_train/35316967 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setFixedLengthStreamingMode(long contentLength) {
if (connected) {
throw new IllegalStateException("Already connected");
}
if (chunkLength != -1) {
throw new IllegalStateException(
"Chunked encoding streaming mode set");
}
if (contentLength < 0) {
throw new IllegalArgumentException("invalid content length");
}
fixedContentLengthLong = contentLength;
}
COM: <s> this method is used to enable streaming of a http request body </s>
|
funcom_train/5260958 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean checkServerIP() {
fromSrvIP = null;
for (int l = 0; l < 3; l++) {
try {
fromSrvIP = InetAddress.getByName(props.getFromSrv()).getHostAddress();
break;
} catch (UnknownHostException uhe) {
log.debug("UnknownHostException while checking server ip:",uhe);
}
}
return fromSrvIP != null;
}
COM: <s> check if can get server ip address from name </s>
|
funcom_train/13937444 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton configureButton(String label, String cmd) {
JButton btn = new JButton(label);
Font f = btn.getFont();
btn.setFont(new Font(f.getName(), f.getStyle(), f.getSize() - 2));
btn.setActionCommand(cmd);
btn.addActionListener(this);
return btn;
}
COM: <s> helper to configure a button with a label action command and listener </s>
|
funcom_train/50353147 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void writeExternal(ObjectOutput out) throws IOException {
out.writeByte((byte)responseCode);
switch (responseCode) {
case AUTH_GRANTED:
out.writeObject(identity);
break;
case AUTH_REDIRECT:
out.writeObject(identity);
out.writeObject(server);
break;
case AUTH_DENIED:
break;
}
}
COM: <s> the object implements the write external method to save its contents </s>
|
funcom_train/40680879 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setRenderDate(final Date renderDate) {
final Date old = this.renderDate;
this.renderDate = new Date(renderDate.getTime());
if (!this.renderDate.equals(old)) {
if (this.isAttached()) {
this.render();
}
this.changes.firePropertyChange("renderDate", old, renderDate);
}
}
COM: <s> sets a date value that represents the month and year the calendar </s>
|
funcom_train/2839134 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void prepareOutput() throws Exception {
String combinedOutputName;
if (!survey.getTestMode()) {
combinedOutputName = survey.getOutputPrefix() + "_all";
combinedOutput = new PrintWriter(new FileWriter(combinedOutputName + ".csv"), true);
combinedXML = new PrintWriter(new FileWriter(combinedOutputName + ".xml"), true);
}
resetCurrentOutput();
beginSurvey();
}
COM: <s> call this method to prepare the various output streams for writing </s>
|
funcom_train/33143250 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addField(FieldType aField) {
List tempFields = new ArrayList(Arrays.asList(fields));
tempFields.add(aField);
fields = (FieldType[]) tempFields.toArray(new FieldType[tempFields.size()]);
if (isCalcWidth()) {
width += aField.getWidth();
}
}
COM: <s> adds a field definition to the record </s>
|
funcom_train/44168266 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public MoveType getMoveType(Direction direction) {
Tile tile = getTile();
if (tile == null) {
throw new IllegalStateException("getTile() == null, location is "
+ location);
}
Tile target = tile.getNeighbourOrNull(direction);
return (target == null) ? MoveType.MOVE_ILLEGAL : getMoveType(target);
}
COM: <s> gets the type of a move made in a specified direction </s>
|
funcom_train/47732003 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JTreeNode toCompetenceTree() {
JTreeNode root = new JTreeNode("Competences", "", Configuration.getRGB("colours/rootNode"), this, null);
// root.setRendered(false);
Iterator items = alElements.iterator();
while (items.hasNext()) {
IEditableElement item = (IEditableElement) items.next();
if (!(item instanceof Competence))
continue;
Competence comp = (Competence) item;
comp.buildTree(root, this, true, false);
}
return root;
}
COM: <s> produce a tree hierarchy of competence elements </s>
|
funcom_train/29864525 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean stopService(Long bundleID) {
boolean stopped = false;
Bundle[] bundleList = bc.getBundles();
Bundle b;
for (int i=0;i<bundleList.length;i++) {
b = bundleList[i];
if ( b.getBundleId() == bundleID )
try {
b.stop();
stopped = true;
} catch (BundleException e) {
Log log = Log.getInstance();
log.writeToLog("Failed to stop service with ID=" + bundleID, Log.WARNING);
e.printStackTrace();
}
}
return stopped;
}
COM: <s> method to stop a service installed on the ubi node </s>
|
funcom_train/19259524 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setPitch(int angle) {
// Range: -180 <= angle < 180.
while (angle < -180)
angle += 360;
while (angle >= 180)
angle -= 360;
// Only accept angles between -90 and +90 degrees.
if (angle > 90)
angle = 90;
else if (angle < -90)
angle = -90;
if (pitch != angle) {
pitch = angle;
pitchR = angle*Math.PI/180;
// Redraw the artificial horizon with these new settings.
repaint();
}
}
COM: <s> sets the pitch angle displayed by this artificial horizon panel </s>
|
funcom_train/50698246 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Collection getPilotsWithCallsignPrefix( String prefix ){
Collection all = new ArrayList();
Collection pilots = getPilots();
for (Iterator iterator = pilots.iterator(); iterator.hasNext();) {
ClientSession session = (ClientSession) iterator.next();
if( session.getCallSign().getText().startsWith(prefix) )
all.add( session );
}
return all;
}
COM: <s> get all pilots with a call sign with a particular prefix </s>
|
funcom_train/11766051 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel getAtomicLeftPanel() {
if (atomicLeftPanel == null) {
atomicLeftPanel = new JPanel();
atomicLeftPanel.setLayout(new BorderLayout());
atomicLeftPanel.add(getAtomicLeftSplitPane(), BorderLayout.CENTER);
// getAtomicLeftSplitPane().setDividerLocation(getAtomicLeftSplitPane().getHeight()/3);
}
return atomicLeftPanel;
}
COM: <s> returns the atomic left panel </s>
|
funcom_train/3022422 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected File getActiveFile() {
java.awt.Frame view = IDEPlugin.getEditorFrame();
Object buffer = IDEPlugin.getCurrentBuffer(view);
//System.out.println("CurrentSummary.getActiveFile() -> " + IDEPlugin.getFile(view, buffer));
return IDEPlugin.getFile(view, buffer);
}
COM: <s> gets the active file attribute of the current summary object </s>
|
funcom_train/15719219 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getWinTVCapGUIChannelPositionAsStringFor(Channel ch) {
WinTVCapGUIChannel winTVCapGUIChannel = mChannelTable.get(getKeyForChannel(ch));
if(winTVCapGUIChannel != null) {
return String.valueOf(winTVCapGUIChannel.getPosition());
}
return null;
}
COM: <s> gets the external channel name for the given channel </s>
|
funcom_train/21877047 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Resource getType() {
Resource type = getObjectResource(RDF.type);
assert
null != type:"Unable to determine type for resource: " + getURI();
if (null == type) {
throw new RuntimeException("Unable to determine type for resource: " + getURI());
}
return type;
}
COM: <s> return the rdf type resource </s>
|
funcom_train/25528363 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void invertProbability() {
normalizeToSum();
double dRemaining = 1.0;
Iterator<TKeyType> iIter = hDistro.keySet().iterator();
while (iIter.hasNext()) {
TKeyType oNext = iIter.next();
setValue(oNext, dRemaining - getValue(oNext));
dRemaining += getValue(oNext);
}
}
COM: <s> inverts the probabilities of this distribution </s>
|
funcom_train/26020167 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void start() {
if (!opened) {
// Player not opened
return;
}
if (started) {
// Already started
return;
}
// Start RTP layer
rtpSender.startSession();
// Start capture
captureThread.start();
// Player is started
videoStartTime = SystemClock.uptimeMillis();
started = true;
notifyPlayerEventStarted();
}
COM: <s> start the player </s>
|
funcom_train/17763290 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testCorrectness() {
// sanity check
assertEquals(100, results.length);
BaileyCrandall r = new BaileyCrandall();
r.setSeedRaw(5559060566555623L);
for (int i = 0; i < 100; ++i) {
// detla is 1e-15, or in other words
// only the last digit may be off by 1 (rounding for printing)
assertEquals(results[i], r.nextDoubleOpen(), 0.000000000000001);
}
}
COM: <s> test to make sure implementation matches published results </s>
|
funcom_train/16760013 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void removeSectors( Spatial container ) {
if ( container instanceof Node ) {
final Node node = ( (Node) container );
for ( int i = node.getQuantity() - 1; i >= 0; i-- ) {
Spatial spatial = node.getChild( i );
removeSectors( spatial );
}
if ( node instanceof Sector ) {
removeIfEmpty( (Sector) node );
}
}
}
COM: <s> remove all empty sectors contained in container if node or sector </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.