__key__
stringlengths 16
21
| __url__
stringclasses 1
value | txt
stringlengths 183
1.2k
|
|---|---|---|
funcom_train/48070935
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void auctionClosed(int auction) {
log.fine("auctionClosed(" + getAuctionTypeAsString(auction) + ") called");
if (getAuctionCategory(auction) == CAT_HOTEL){
if (agent.getAllocation(auction) > agent.getOwn(auction))
recoverFromMissedHotel(auction);
if (agent.getAllocation(auction) > agent.getOwn(auction))
log.warning("recovery failed");
clientAllocator();
}
}
COM: <s> called when an auction closes </s>
|
funcom_train/44478391
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected void loadSpecs(Model model, Resource rDRMInterface) {
// -- specification
this.lSpecs.clear();
Iterator<Statement> stmtit = model.findStatements(rDRMInterface, EAC.JDL_DRMSPECIFICATION.getURI(), Variable.ANY);
while(stmtit.hasNext()){
Node vres = stmtit.next().getObject();
if(vres instanceof Literal){
Literal lit = (Literal)vres;
Specification spec = this.processSpec(lit.getValue());
if(spec != null)
this.lSpecs.add(spec);
}
}
}
COM: <s> loads information about the specification of the drmprotection </s>
|
funcom_train/4103438
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private Interactor getInteractorByRange( InputStreamRange range ) {
Interactor interactor;
try {
// FileInputStream fis = new FileInputStream( file );
final InputStream snippetStream = PsimiXmlExtractor.extractXmlSnippet( file, range );
interactor = psimiXmlPullParser.parseInteractor( snippetStream );
} catch ( Exception e ) {
throw new PsimiXmlReaderRuntimeException( "An error occured while parsing interactor", e );
}
return interactor;
}
COM: <s> extracts an interaction from the xml file and resolve references recursively </s>
|
funcom_train/14336725
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public Anchor getAnchorAt(int mx, int my){
// top anchors
for(int i= 0; i < inputAnchorDisplays.size(); i++){
if (inputAnchorDisplays.get(i).contains(mx-x, my-y)){
return cw.getInputAnchor(i);
}
}
//bottom anchors
for(int i= 0; i < outputAnchorDisplays.size(); i++){
if (outputAnchorDisplays.get(i).contains(mx-x, my-y)){
return cw.getOutputAnchor(i);
}
}
return null;
}
COM: <s> look for an anchor at the point mx my </s>
|
funcom_train/42043653
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public Department getDepartmentByName(String name) {
Department department = null;
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
session.beginTransaction();
try {
department = (Department) session.createQuery(
"from Department " + "where name = ?").setString(0, name)
.uniqueResult();
session.getTransaction().commit();
} catch (HibernateException e) {
// TODO: handle exception
session.getTransaction().rollback();
throw e;
}
return department;
}
COM: <s> returns department by name </s>
|
funcom_train/18655654
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void write(String s) {
String logString = "[" + Calendar.getInstance().getTime() + "] : " + s;
try {
FileWriter fw = new FileWriter(logFile, true);
PrintWriter pw = new PrintWriter(fw);
pw.println(logString);
pw.flush();
pw.close();
fw.close();
} catch (Exception e) {
System.out.println("Error writing to log file.");
}
}
COM: <s> writes the specified string to the file this logger was created to use </s>
|
funcom_train/5446440
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected String removeTrailingSlash( String v ) {
String match = "/";
if ( v.endsWith( match ) ) {
try {
return v.substring( 0, v.length() - match.length() );
}
catch( Throwable ignore ) {
println( "[" + ignore.getClass().getName() + "] " + ignore.getMessage() );
}
}
return v;
}
COM: <s> removes trailing slash </s>
|
funcom_train/46428118
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void processConcept() {
Concept currentConcept = (Concept) concepts.takeOut();
if (currentConcept != null) {
currentTerm = currentConcept.getTerm();
concepts.putBack(currentConcept); // current Concept remains in the bag all the time
currentConcept.fire(); // a working cycle
}
}
COM: <s> select a concept to fire </s>
|
funcom_train/13557872
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public int sendGetChallengeAndStore(boolean useSM) throws CardServiceException {
CommandAPDU capdu = createGetChallengeAPDU();
if (useSM) {
capdu = getWrapper().wrap(capdu);
}
ResponseAPDU rapdu = transmit(capdu);
if (useSM) {
rapdu = getWrapper().unwrap(rapdu, rapdu.getBytes().length);
}
if (rapdu.getSW() == 0x9000) {
lastChallenge = rapdu.getData();
}
return rapdu.getSW();
}
COM: <s> send a get challenge the challenge received will be stored and used </s>
|
funcom_train/7269564
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void begin() {
if(initialized.getAndSet(true))
return;
runLater(new Runnable() {
public void run() {
initialize();
splashWindow.toFront();
splashWindow.setVisible(true);
glassPane.setVisible(true);
setStatusText(I18n.tr("Loading FrostWire..."));
}
});
}
COM: <s> sets the splash window to be visible </s>
|
funcom_train/36489617
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void removeConnection(Socket s) {
int i = 0;
boolean exists = false;
for (i = 0; i < connections.size(); i++) {
if (s.equals(connections.get(i))) {
exists = true;
break;
}
}
if(exists)
connections.remove(s);
if(connections.size() != loggedUsers.size())
loggedUsers.remove(i);
}
COM: <s> removes the specified socket from the connections array list if </s>
|
funcom_train/4780692
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void refreshGroupList(final Group selectedGroup) {
getGroupsPane().getGroupList().setListData(document.getGroupObjects());
toggleGroupActions(getGroupsPane().getGroupList().isSelectionEmpty() == false);
if (selectedGroup != null) {
getGroupsPane().getGroupList().setSelectedValue(selectedGroup, true);
}
refreshGroupDetails();
}
COM: <s> refreshes group list with current groups </s>
|
funcom_train/17417918
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public String getMD5ofStr(String inbuf) {
md5Init();
md5Update(inbuf.getBytes(), inbuf.length());
md5Final();
digestHexStr = "";
for (int i = 0; i < 16; i++) {
digestHexStr += byteHEX(digest[i]);
}
return digestHexStr;
}
COM: <s> public method for use md5 </s>
|
funcom_train/37648651
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void testDefaulltRuleSets() {
try {
RuleSetFactory factory = new RuleSetFactory();
Iterator<RuleSet> iterator = factory.getRegisteredRuleSets();
while (iterator.hasNext()) {
iterator.next();
}
} catch (RuleSetNotFoundException e) {
e.printStackTrace();
fail("unable to load registered rulesets ");
}
}
COM: <s> try to load all the plugin known rulesets </s>
|
funcom_train/7277407
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private boolean readContentURNHeader(Header header) {
if (!HTTPHeaderName.GNUTELLA_CONTENT_URN.matches(header))
return false;
try {
uploader.setRequestedURN(URN.createSHA1Urn(header.getValue()));
} catch(IOException e) {
uploader.setRequestedURN(URN.INVALID);
}
return true;
}
COM: <s> this method parses the x gnutella content urn header as specified </s>
|
funcom_train/15811438
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public B2BUAContext createNewOpposeB2BUAContext(B2BUAModule b2buaModue, SIPropMessage opposePacket) {
// get bindingPeer.
BindingResolver bindReso = b2buaModue.getCallBackManager().getBindingResolver();
// create new context key.
List<String> newContextkey =
createContextKey(opposePacket, b2buaModue, AbstractB2BUAModule.GENERATOR_NAME_SEND);
B2BUAContext opposeB2BUAContext = b2buaModue.getB2BUAContext(newContextkey);
return opposeB2BUAContext;
}
COM: <s> create new oppose side b2 buacontext </s>
|
funcom_train/47553032
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public NodeVisitor enterCall(Node parent, Node n) throws SemanticException {
Type t = null;
if (parent != null && n instanceof Expr) {
t = parent.childExpectedType((Expr) n, this);
}
AscriptionVisitor v = (AscriptionVisitor) copy();
v.outerAscriptionVisitor = this;
v.type = t;
return v;
}
COM: <s> sets up the expected type information for later calls to </s>
|
funcom_train/7660960
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void testGetCorePoolSize() {
ThreadPoolExecutor p1 = new ThreadPoolExecutor(1, 1, LONG_DELAY_MS, TimeUnit.MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
assertEquals(1, p1.getCorePoolSize());
joinPool(p1);
}
COM: <s> get core pool size returns size given in constructor if not otherwise set </s>
|
funcom_train/43475188
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected NodeHandle findPredecessor(NodeHandle handle) {
if (handle.getId().equals(this.id)) {
return this.nodeHandle; //return predecessor.successor();
} else if (finger[0] != null && handle.getId().betweenE(this.id, finger[0].getId())) {
return finger[0];
} else {
return null;
}
}
COM: <s> finds the predecessor of a node </s>
|
funcom_train/16450466
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void meta(MetaMessage mm) {
byte[] data = mm.getData();
if (data.length > 0 && data[0] == '@')
return;
if (mm.getType() == Syllable.ST_TEXT
|| mm.getType() == Syllable.ST_LYRICS) {
karaokePane.seek(sequencer.getTickPosition(), false);
}
}
COM: <s> callback method for meta event listener </s>
|
funcom_train/34794220
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void revert() throws PerforceException {
if (PENDING != status) {
throw new PerforceException("Change already submitted.");
}
Enumeration en = getFileEntries().elements();
try {
while (en.hasMoreElements()) {
((FileEntry)en.nextElement()).revert();
}
} catch (Exception ex) {
throw new PerforceException(ex.getMessage());
}
}
COM: <s> reverts all the files associated with a pending changelist </s>
|
funcom_train/13994333
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void initHeader(String title, Icon icon) {
JPanel header = new JPanel(new GridLayout(1, 2));
header.add(new JLabel(title, icon, SwingConstants.LEFT),
BorderLayout.WEST);
header.add(toolbar, BorderLayout.CENTER);
header.setPreferredSize(new Dimension(25, 25));
add(header, BorderLayout.NORTH);
}
COM: <s> inits the header </s>
|
funcom_train/46858985
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public Player getPlayer(String playerName) {
Player result = null;
for (Player p : players) {
if (p.getName().equals(playerName)) {
result = p;
}
}
if (result == null) {
logger.warn("Unknown Playername: " + playerName + " available players:" + StringUtil.toString(getAllPlayers(), ", "));
return null;
} else {
return result;
}
}
COM: <s> get a player by his player name </s>
|
funcom_train/536947
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void testParenthesisInsensitivity() {
assertEquals(Artist.getArtist("Kiss"), Artist.getArtist("(Kiss)"));
assertEquals(Artist.getArtist("Kiss"), Artist.getArtist("[Kiss]"));
assertEquals("Kiss", Artist.getArtist("Kiss").getName());
}
COM: <s> verify that we properly ignore surrounding parentheses in artist names </s>
|
funcom_train/8075521
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void setControlEnabledStatus(boolean status) {
m_classAttBox.setEnabled(status);
m_redClassValueBox.setEnabled(status);
m_greenClassValueBox.setEnabled(status);
m_blueClassValueBox.setEnabled(status);
m_xAttBox.setEnabled(status);
m_yAttBox.setEnabled(status);
m_samplesText.setEnabled(status);
}
COM: <s> set the enabled status of the controls </s>
|
funcom_train/21249961
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public boolean getIDbyName(String gr,String ins) {
if((m_GroupID=getGroupID(gr))!=-1) {
if((m_InstanceID=SNMPgroups.get(m_GroupID).getInstanceID(ins))!=-1) {
return true;
}
}
return false;
}
COM: <s> this method return index by string name of variable </s>
|
funcom_train/13412355
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private BlendState getAlphaState() {
if (this.alphaState == null) {
alphaState = DisplaySystem.getDisplaySystem().getRenderer()
.createBlendState();
alphaState.setBlendEnabled(true);
// alphaState.setSrcFunction(BlendState..SB_SRC_ALPHA);
// alphaState.setDstFunction(AlphaState.DB_ONE);
// alphaState.setTestEnabled(true);
// alphaState.setTestFunction(AlphaState.TF_GREATER);
alphaState.setEnabled(true);
}
return alphaState;
}
COM: <s> creates the alpha state </s>
|
funcom_train/32865048
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public String getValueXPath(String path) {
data.normalize();
Node n = null;
try {
n = xpath_api.selectSingleNode(data,path);
} catch(Exception ex) {
log.error("XPath failure for path '" + path
+ "'. Continuing as if path not found.");
// TODO: throw
}
return (n == null) ? null : n.getNodeValue();
}
COM: <s> return the node value of a single node selected by the given xpath </s>
|
funcom_train/25027844
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void updateByID(int id, String content, Integer score) {
ContentValues values = new ContentValues();
values.put(KEY_NAME, content);
values.put(KEY_SCORE, score);
sqLiteDatabase.update(DATABASE_TABLE, values, KEY_ID + "=" + id, null);
}
COM: <s> update the score by id </s>
|
funcom_train/11742938
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public DataRow getCachedSnapshot(ObjectId oid) {
if (context != null && context.getChannel() != null) {
ObjectIdQuery query = new CachedSnapshotQuery(oid);
List<?> results = context.getChannel().onQuery(context, query).firstList();
return results.isEmpty() ? null : (DataRow) results.get(0);
}
else {
return null;
}
}
COM: <s> returns a snapshot for object id from the underlying snapshot cache </s>
|
funcom_train/33819361
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public NaturalSet removeAbove(int position){
if(!isEmpty() && domain.contains(position)){
if(position >= min()){
if(isContinuous()){
max = Math.min(max, position);
} else {
if(position < max()){
try {
int lposition = domain.toRelativeCoordinate(position);
BitSetIterator iterate = new BitSetIterator(map);
int i = iterate.next(lposition + 1);
while(i > -1 && i <= domain.max()){
map.fastClear(i);
i = iterate.next();
}
normalize();
} catch (NaturalSetException e) {
e.printStackTrace();
}
}
}
} else {
clear();
}
}
return this;
}
COM: <s> remove all the element strictly bigger than code position code </s>
|
funcom_train/50502152
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void close(boolean validate) {
if(validate) {
try {
validateForm();
save();
setVisible(false);
dispose();
}
catch(Exception e) {
ch.orcasys.editor.panel.dlog.Message.showError(this, "Form error", e.toString());
return;
}
}
else {
setVisible(false);
dispose();
}
}
COM: <s> closes the dialog </s>
|
funcom_train/18135694
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void applyFilter() {
toExpand.clear();
if (root == null) {
super.setRoot(null);
} else {
FilterState filterState = filterNode(root, new Stack<TreeNode>(),
FilterState.INVISIBLE);
if (filterState != FilterState.INVISIBLE) {
super.setRoot(root);
} else {
super.setRoot(null);
}
}
// paths collected during filtering
for (TreePath path : toExpand) {
parent.expandPath(path);
}
}
COM: <s> method for applying the filter </s>
|
funcom_train/25710009
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void writeInput(File inputFile) {
BufferedReader input;
try {
input = new BufferedReader(new FileReader(inputFile));
String nextLine = input.readLine();
while (nextLine != null) {
println(nextLine);
nextLine = input.readLine();
}
input.close();
}
catch (IOException e) {
e.printStackTrace();
}
}
COM: <s> takes a fred method hillclimbing input or output file and writes it to </s>
|
funcom_train/6484966
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public boolean act( FOS action ) {
String name = action.argAt( 0 ).toString( );
//System.out.println( "Removing: " + name );
PerformanceManagement model = ( PerformanceManagement ) getModuleByName( "allocationModel" );
model.getSystem().getAgentByName( name ).remove();
return true;
}
COM: <s> remove an agent from the allocation model </s>
|
funcom_train/36685227
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private JPanel createUsernamePanel ()
{
JPanel panel = initializePanel("RegisterScreen.UsernameLabel");
myUsernameField = new JTextField(10);
myUsernameField.setMaximumSize(new Dimension(200, 20));
myUsernameField.addActionListener(createUserListener);
panel.add(myUsernameField);
return panel;
}
COM: <s> creates a label and input box for a username </s>
|
funcom_train/46735929
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void setResultStatusRef(DisplayModel resultStatusRef) {
if (Converter.isDifferent(this.resultStatusRef, resultStatusRef)) {
DisplayModel oldresultStatusRef= new DisplayModel(this);
oldresultStatusRef.copyAllFrom(this.resultStatusRef);
this.resultStatusRef.copyAllFrom(resultStatusRef);
setModified("resultStatusRef");
firePropertyChange(String.valueOf(FORMRECORDLOGS_RESULTSTATUSREFID), oldresultStatusRef, resultStatusRef);
}
}
COM: <s> complex status of record value used to determine the display </s>
|
funcom_train/8486593
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private Noeud ajouterTousLesfils(Noeud noeud, ArrayList<Pion> coups, int prof) {
ArrayList<Pion> temp;
int longeur = coups.size();
temp = (ArrayList<Pion>) coups.clone();
for(int i=0;i<longeur;i++){
temp = (ArrayList<Pion>) coups.clone();
Noeud n = new Noeud(coups.get(i));
coupsJouer.add(coups.get(i));
noeud.AjouterFils(n);nbNoeuds++;
temp.remove(coups.get(i));
if(temp.size()>prof){
ajouterTousLesfils(n,temp, prof);
}else {
temp = (ArrayList<Pion>) coups.clone();
}
coupsJouer.remove(coups.get(i));
}
return noeud;
}
COM: <s> method which permits to construct the tree </s>
|
funcom_train/40655887
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void fillDropTargets() {
dropTargets.clear();
for (int r=0; r<getRowCount(); r++) {
for (int c=0; c<getColumnCount(); c++) {
DropTarget target =
new DropTarget(
r, c, getCellFormatter().getElement(r, c), cellWidth, cellHeight);
dropTargets.add(target);
}
}
}
COM: <s> clears and recreates the drop targets list </s>
|
funcom_train/33973973
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private String streamPublish() throws Exception {
FacebookJsonRestClient client = FacebookSessionTestUtils.getValidClient( FacebookJsonRestClient.class );
String message = "Facebook stream publish test.";
FacebookSessionTestUtils.pauseForStreamRate();
Object result = client.stream_publish( message, null, null, null, null );
Assert.assertNotNull( result );
return result.toString();
}
COM: <s> used by various unit tests to create stream item </s>
|
funcom_train/19097079
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private JSplitPane getJSplitPane1() {
if (jSplitPane1 == null) {
jSplitPane1 = new JSplitPane();
jSplitPane1.setBorder(null);
jSplitPane1.setLeftComponent(getJBoard());
jSplitPane1.setRightComponent(getGameStatus());
jSplitPane1.setResizeWeight(1.0D);
}
return jSplitPane1;
}
COM: <s> this method initializes j split pane1 </s>
|
funcom_train/41332066
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private Icon getIcon(AbstractButton b, Icon specificIcon, Icon defaultIcon, int state) {
Icon icon = specificIcon;
if (icon == null) {
if (defaultIcon instanceof UIResource) {
icon = getSynthIcon(b, state);
if (icon == null) {
icon = defaultIcon;
}
} else {
icon = defaultIcon;
}
}
return icon;
}
COM: <s> this method will return the icon that should be used for a button </s>
|
funcom_train/17997330
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public ModelAndView handleRenderRequestAfterValidation(RenderRequest request, RenderResponse response) throws Exception {
Map model = new HashMap();
WeekendsAndHolidaysConfig weekendsAndHolidaysConfig = getAdminModule().getWeekendsAndHolidaysConfig();
model.put(WebKeys.SCHEDULE_CONFIG, weekendsAndHolidaysConfig);
model.put(WebKeys.USER_PRINCIPAL, RequestContextHolder.getRequestContext().getUser());
return new ModelAndView(WebKeys.VIEW_ADMIN_CONFIGURE_SCHEDULE, model);
}
COM: <s> called as the page is rendering to supply the data need by the </s>
|
funcom_train/16533035
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void setStorageLoadedValues() {
Long interval = controller.getAutosaveInterval() /1000 / 60; /* stored as ms and displayed as minutes */
((SpinnerNumberModel)saveIntervalSpinner.getModel()).setValue(interval.intValue());
saveLocationTextField.setText(controller.getAutosaveLocation());
saveEnabledCheckBox.setSelected(controller.getAutosaveOn());
}
COM: <s> sets the loaded values for the storage settings </s>
|
funcom_train/21753188
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private PersonUpdate createPersonUpdate() {
// Create and persist
PersonUpdate defined = new PersonUpdate();
defined.setEventFamilyId(1);
defined.setPersonId(1);
defined.setUpdateDate(new Date());
defined.setUserId(1);
defined.setUserName("test");
em.persist(defined);
return defined;
}
COM: <s> returns the created person update </s>
|
funcom_train/7531977
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: synchronized public void setFidgets(Collection hosts) {
if (hosts == null)
throw new NullPointerException();
mFidgets = Collections.synchronizedCollection(new TreeSet(hosts));
for (Iterator iter = hosts.iterator(); iter.hasNext();) {
PGridHost element = (PGridHost)iter.next();
mHosts.put(element.getGUID().toString(), element);
}
}
COM: <s> sets the fidget hosts with the given hosts </s>
|
funcom_train/44770288
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void cacheItem(ItemImpl item) {
ItemId id = item.getId();
if (itemCache.containsKey(id)) {
log.warn("overwriting cached item " + id);
}
if (log.isDebugEnabled()) {
log.debug("caching item " + id);
}
itemCache.put(id, item);
}
COM: <s> puts the reference of an item in the cache with </s>
|
funcom_train/30075701
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected ModelAndView onSubmit(Object command) throws ServletException {
Site site = (Site) command;
// delegate the insert to the Business layer
getGpir().storeSite(site);
return new ModelAndView(getSuccessView(), "siteId", Integer.toString(site.getId()));
}
COM: <s> method inserts a new code site code </s>
|
funcom_train/14308050
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private int doImport(File f) {
if (f.isDirectory()) {
List files = new ArrayList();
buildFileList(f, files);
if (files.size() > 0) {
project.importFiles(files);
}
return files.size();
} else {
project.importFile(new ProjectFile(f.getAbsolutePath()));
return 1;
}
}
COM: <s> import a file into the project </s>
|
funcom_train/39872676
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void internalWrite(byte[] b, int off, int len, boolean finish) throws IOException {
coder.output = embiggen(coder.output, coder.maxOutputSize(len));
if (!coder.process(b, off, len, finish)) {
throw new IOException("bad base-64");
}
out.write(coder.output, 0, coder.op);
}
COM: <s> write the given bytes to the encoder decoder </s>
|
funcom_train/1386067
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private JButton getBtnVisualizzaConti() {
if (btnVisualizzaConti == null) {
btnVisualizzaConti = new JButton();
btnVisualizzaConti.setText("Gestione Conti");
btnVisualizzaConti.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
gestioneConti();
}
});
}
return btnVisualizzaConti;
}
COM: <s> this method initializes btn visualizza conti </s>
|
funcom_train/28122746
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected boolean addVisualiserMethod(String methodName, Class parms[]) {
Method m = null;
try {
m = getClass().getMethod(methodName, parms);
} catch (java.lang.NoSuchMethodException e) {
return false;
}
Connector c = new Connector(this, m);
c.setLayoutDirection(Connector.EASTTOWEST);
c.setProxyInstance(this);
addConnector(c, false);
return true;
}
COM: <s> add a visualiser method i </s>
|
funcom_train/50570179
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public Object next() {
// Ask the top iterator for the next thread group reference.
ThreadGroupReference group = (ThreadGroupReference) peek().next();
// If this group has more groups, add them to the stack.
push(group.threadGroups());
// Return the thread group.
return group;
}
COM: <s> returns the next element in the interation </s>
|
funcom_train/51633803
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public ImageDescriptor getWorkbenchImageDescriptor(IAdaptable adaptable, int flags) {
IWorkbenchAdapter wbAdapter= (IWorkbenchAdapter) adaptable.getAdapter(IWorkbenchAdapter.class);
if (wbAdapter == null) {
return null;
}
ImageDescriptor descriptor= wbAdapter.getImageDescriptor(adaptable);
if (descriptor == null) {
return null;
}
Point size= useSmallSize(flags) ? SMALL_SIZE : BIG_SIZE;
return new JavaElementImageDescriptor(descriptor, 0, size);
}
COM: <s> returns an image descriptor for a iadaptable </s>
|
funcom_train/45538226
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected ITextSelection getCurrentTextSelection() {
IWorkbenchPart part= JSCPlugin.getActivePage().getActivePart();
if (part instanceof IEditorPart) {
ISelectionProvider selectionProvider= part.getSite().getSelectionProvider();
if (selectionProvider != null) {
ISelection selection= selectionProvider.getSelection();
if (selection instanceof ITextSelection) {
return (ITextSelection) selection;
}
}
}
return null;
}
COM: <s> returns the text selection of the current editor </s>
|
funcom_train/20804414
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void createPartControl(Composite parent) {
viewer = new ContainerCheckedTreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
drillDownAdapter = new DrillDownAdapter(viewer);
viewer.setContentProvider(new ViewContentProvider());
viewer.setLabelProvider(new ViewLabelProvider());
viewer.setSorter(new NameSorter());
viewer.setInput(getViewSite());
makeActions();
hookContextMenu();
hookDoubleClickAction();
contributeToActionBars();
}
COM: <s> this is a callback that will allow us </s>
|
funcom_train/17917197
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public TreeNode addSubtree(TreeManager manager, TreeElement node, TreeElement parent, double weight) {
TreeNode result = null;
if (node != null) {
if (parent == null) parent = getRoot();
TreeElement element = addNodeInternal(node);
result = new TreeNode(parent,element,weight);
addConsolidation(result);
addDescendants(manager,getDescendants(manager,new ArrayList<TreeNode>(), node));
}
return result;
}
COM: <s> adds a full subtree of an external manager to this manager </s>
|
funcom_train/45257253
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void updateActionsEnableState() {
cellCutAction.updateEnabledState();
cellCopyAction.updateEnabledState();
cellPasteAction.updateEnabledState();
cellDeleteAction.updateEnabledState();
cellSelectAllAction.updateEnabledState();
cellFindAction.updateEnabledState();
cellUndoAction.updateEnabledState();
cellRedoAction.updateEnabledState();
}
COM: <s> updates the enable state of the cut copy </s>
|
funcom_train/5714149
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void writeString(String vals) throws IOException{
char[] chars = vals.toCharArray();
for (int i = 0; i < chars.length; i++){
if (Character.isWhitespace(chars[i])){
continue;
}
writeBoolean(chars[i] == '1');
}
}
COM: <s> writes a sequence of 0 or 1 characters to the stream </s>
|
funcom_train/18935380
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void checkIfLocalFileExistsAndCanRead() throws FileTransferException {
if ( !localFile.exists() ) {
throw new FileTransferException( localFile.getAbsolutePath(),
new FileNotFoundException( localFile.getAbsolutePath() ), true );
}
if ( !localFile.canRead() ) {
throw new FileTransferException( localFile.getAbsolutePath(), "File exists but cannot be read", true );
}
}
COM: <s> checks if the given file exists and is readable </s>
|
funcom_train/1242647
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected boolean checkState() {
boolean result = false;
if (emptyStringAllowed) {
result = true;
}
if (textField == null) {
result = false;
}
String txt = textField.getText();
result = (txt.trim().length() > 0) || emptyStringAllowed;
// call hook for subclasses
result = result && doCheckState();
if (result) {
clearErrorMessage();
} else {
showErrorMessage(errorMessage);
}
return result;
}
COM: <s> checks whether the text input field contains a valid value or not </s>
|
funcom_train/26126476
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public boolean hasParameter(String name) {
if (name != null) {
if (pnames != null) {
String lname = name.toLowerCase();
for (int i = 0; i < pnames.length; i++) {
if (pnames[i].equals(name))
return true;
}
}
}
return false;
}
COM: <s> does this mime type has some value for the given parameter </s>
|
funcom_train/23635941
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected void addDescriptionPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_NamedElement_description_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_NamedElement_description_feature", "_UI_NamedElement_type"),
CescsmodelPackage.Literals.NAMED_ELEMENT__DESCRIPTION,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the description feature </s>
|
funcom_train/15907148
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void moveAfter(UmlItem x) throws RuntimeException {
UmlCom.send_cmd(identifier_(), OnInstanceCmd.moveAfterCmd,
(x != null) ? x.identifier_() : 0);
UmlCom.check();
parent().reread_children_if_needed_();
}
COM: <s> if the parameter is null move the current item to be </s>
|
funcom_train/46363856
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public BaseDaoTestCase () {
// Since a ResourceBundle is not required for each class, just
// do a simple check to see if one exists
String className = this.getClass().getName();
try {
rb = ResourceBundle.getBundle(className);
}
catch (MissingResourceException mre) {
// log.warn("No resource bundle found for: " + className);
}
}
COM: <s> default constructor populates rb variable if properties file exists </s>
|
funcom_train/50538319
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected void waitUntilNextExecution() {
lock.lock();
try {
if(!running)
return;
next_execution_time=tasks.firstKey();
long sleep_time=next_execution_time - System.currentTimeMillis();
tasks_available.await(sleep_time, TimeUnit.MILLISECONDS);
}
catch(InterruptedException e) {
}
finally {
lock.unlock();
}
}
COM: <s> sleeps until the next task in line is ready to be executed </s>
|
funcom_train/22564934
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public String importColoData() {
try {
ColoConverter converter = new ColoConverter();
converter.importColo(getInputFile().getFileInfo().getFile());
PortletUtils.addInfoMessage(Bundle.getLabel("import-succeeded"), null);
} catch (Throwable e) {
PortletUtils.addErrorMessage(Bundle.getLabel("import-failed"), e.getMessage());
}
return null;
}
COM: <s> action handler for importing the colo data </s>
|
funcom_train/47555398
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void prettyPrint(CodeWriter w, PrettyPrinter tr) {
if (qualifier != null) {
print(qualifier, w, tr);
w.write(".");
}
w.write(kind + "(");
w.begin(0);
for (Iterator i = arguments.iterator(); i.hasNext(); ) {
Expr e = (Expr) i.next();
print(e, w, tr);
if (i.hasNext()) {
w.write(",");
w.allowBreak(0);
}
}
w.end();
w.write(");");
}
COM: <s> write the call to an output file </s>
|
funcom_train/46017242
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected Method findMethod(String name) {
Method[] methods = null;
boolean found = false;
int i = 0;
if (element != null) {
methods = element.getClass().getDeclaredMethods();
while (i < methods.length && !found) {
if (methods[i].getName().equals(name)) {
found = true;
} else {
i++;
}
}
}
return (found ? methods[i] : null);
}
COM: <s> find a method in the internal object </s>
|
funcom_train/5021881
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void addEditor(String uuid, IEditorPart editorPart) {
if (!openEditors.containsKey(uuid)) {
openEditors.put(uuid, editorPart);
editorPart.addPropertyListener(new IPropertyListener() {
public void propertyChanged(Object source, int propId) {
if (source == getActiveEditor()) {
MainToolbarButtonManager.updateCancelAsync();
}
}
});
}
}
COM: <s> add the editor to the open editor list </s>
|
funcom_train/50260002
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void setupFormButton(Subject subject, Executor[] executors) throws AuthenticationException, BatchPresentationNotFoundException {
BatchPresentation batchPresentation = getBatchPresentation();
for (boolean isEnable : BatchExecutorPermissionHelper.getEnabledCheckboxes(subject, executors, batchPresentation, ExecutorPermission.UPDATE)) {
if (isEnable) {
isButtonEnabled = true;
break;
}
}
}
COM: <s> check if exists executor to remove to enable or disable form button </s>
|
funcom_train/5855568
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void initialise(Node node, Object key) {
for (int i = 0, n = initialisers.length; i < n; i++) {
if (initialisers[i].init(node, key)) { return; }
}
throw new IllegalStateException(
"No initialiser for key: " + key
+ " {" + key.getClass().getName() + "}");
}
COM: <s> initialise the node using the given key </s>
|
funcom_train/17053803
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public SMSPoint pointFactory(SecureRandom rand) {
BigInteger k;
do {
k = new BigInteger(sms.getN().bitLength(), rand).mod(sms.getN());
} while (k.signum() == 0);
return G.multiply(k);
}
COM: <s> get a random nonzero point on this curve given a fixed base point </s>
|
funcom_train/18272033
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public Road findRoad(final Node node1, final Node node2) {
Road road = null;
for (String name : this.roads.keySet()) {
Road current = this.roads.get(name);
if ((current.getStart().equals(node1))
&& (current.getEnd().equals(node2))) {
road = current;
break;
}
if ((current.getStart().equals(node2))
&& (current.getEnd().equals(node1))) {
road = current;
break;
}
}
return road;
}
COM: <s> finds a road that connects two nodes </s>
|
funcom_train/5309199
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public ValueAxis getRangeAxisForDataset(int index) {
ValueAxis result = getRangeAxis();
Integer axisIndex = (Integer) this.datasetToRangeAxisMap.get(index);
if (axisIndex != null) {
result = getRangeAxis(axisIndex.intValue());
}
return result;
}
COM: <s> returns the range axis for a dataset </s>
|
funcom_train/48391902
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public HandlerRegistration addChangeHandler(com.smartgwt.client.widgets.grid.events.ChangeHandler handler) {
if(getHandlerCount(com.smartgwt.client.widgets.grid.events.ChangeEvent.getType()) == 0) setupChangeEvent();
return doAddHandler(handler, com.smartgwt.client.widgets.grid.events.ChangeEvent.getType());
}
COM: <s> add a change handler </s>
|
funcom_train/45243454
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public JNumberFloatField getJNumberFloatFieldPesosSitiosKimura() {
if (jNumberFloatFieldPesosSitiosKimura == null) {
jNumberFloatFieldPesosSitiosKimura = new JNumberFloatField();
jNumberFloatFieldPesosSitiosKimura.setLocation(new Point(328, 193));
jNumberFloatFieldPesosSitiosKimura.setSize(new Dimension(65, 20));
}
return jNumberFloatFieldPesosSitiosKimura;
}
COM: <s> this method initializes j number float field pesos sitios kimura </s>
|
funcom_train/18216466
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected BigDecimal doCalculate(final List<CaseValue> caseValues) {
long result = 0;
HashMap hash = new HashMap();
for (Iterator<CaseValue> caseValueIter = caseValues.iterator(); caseValueIter
.hasNext();) {
long id = caseValueIter.next().getId();
if (!hash.containsKey(id)) {
result++;
hash.put(id, null);
}
}
return new BigDecimal(result);
}
COM: <s> counts the number of cases in the set of code case values code </s>
|
funcom_train/50141003
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void setStringArrayProperty(String[] property) {
this.stringArrayProperty = property;
System.err.print("String[]{");
for (int i = 0; i < property.length - 1; i++) {
System.err.print("" + property[i] + ",");
}
System.err.println("" + property[property.length - 1] + "}");
}
COM: <s> sets the string array property attribute of the property test object </s>
|
funcom_train/25191594
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public boolean equals(Object obj) {
boolean same = false;
if (obj instanceof ServiceRep) {
ServiceRep rep = (ServiceRep) obj;
// serviceID can be null if we haven't registered
if (serviceID == null) {
same = name.equals (rep.getName ());
} else {
same = serviceID.equals (rep.getServiceID ());
}
}
return same;
}
COM: <s> overrides equals so that if basic service rep refers to the same </s>
|
funcom_train/2903189
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private Icon getTinyIconMap(Object key){
if(verySmallImgTable == null){
verySmallImgTable = new Hashtable(100);
}
if(verySmallImgTable.containsKey(key)){
return (Icon)verySmallImgTable.get(key);
}
StringBuffer sb = new StringBuffer(iconPath.toString()).append("16x16").append(File.separator).append(key+".png");
Icon i = ZImageRetriever.getImageIcon(sb.toString());
synchronized(verySmallImgTable){
verySmallImgTable.put(key, i);
}
return i;
}
COM: <s> get a small image that represents the type </s>
|
funcom_train/40299770
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public double offsetFrom(final AbsoluteDate instant, final TimeScale timeScale) {
final double elapsedDuration = (epoch - instant.epoch) +
(offset - instant.offset);
final double startOffset = timeScale.offsetFromTAI(instant);
final double endOffset = timeScale.offsetFromTAI(this);
return elapsedDuration - startOffset + endOffset;
}
COM: <s> compute the apparent clock offset between two instant em in the </s>
|
funcom_train/28215567
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected void addDelayPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_AbstractEvent_delay_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_AbstractEvent_delay_feature", "_UI_AbstractEvent_type"),
StateMachinePackage.Literals.ABSTRACT_EVENT__DELAY,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the delay feature </s>
|
funcom_train/21606855
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected URI createURI(String value) throws URISyntaxException {
int idx = value.indexOf(':');
if (idx != -1) {
String scheme = value.substring(0, idx);
String ssp = value.substring(idx + 1);
return new URI(scheme, ssp, null);
}
else {
// value contains no scheme, fallback to default
return new URI(value);
}
}
COM: <s> create a uri instance for the given resolved string value </s>
|
funcom_train/3908193
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void setMetadataType(MetadataType mdType) {
_mdType = mdType;
// Schema
_tfSchema.setElement(mdType.getSchemaDataElement());
// Schema Version
_tfSchemaVersion.setElement(mdType.getSchemaVersionDataElement());
// Panel
_hiderPanel.getTitleLabel().setText(mdType.getTitle());
_hiderPanel.getDescriptionLabel().setText(mdType.getDescription());
}
COM: <s> set the metadata type for the metadata node </s>
|
funcom_train/5080261
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void setConstraint(IFigure child, Object constraint) {
remove(child);
super.setConstraint(child, constraint);
if (constraint == null) {
return;
}
switch (((Integer) constraint).intValue()) {
case PositionConstants.CENTER :
center = child;
break;
case PositionConstants.TOP :
top = child;
break;
case PositionConstants.BOTTOM :
bottom = child;
break;
case PositionConstants.RIGHT :
right = child;
break;
case PositionConstants.LEFT :
left = child;
break;
default :
break;
}
}
COM: <s> sets the location of hte given child in this layout </s>
|
funcom_train/31093656
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void init() throws ServletException {
cf = new Properties();
try {
cf.load(new FileInputStream(getServletContext().getRealPath(".")
+ "/WEB-INF/notepad.properties"));
} catch (Exception e) {
e.printStackTrace();
}
try {
String padPath = getServletContext()
.getRealPath(".")
+ "/" + cf.getProperty("pad.filename");
PenHome.loadPad("Handwritten", new File(padPath));
} catch (Exception e) {
e.printStackTrace();
}
}
COM: <s> setting properties file and initiates connectionpool </s>
|
funcom_train/33122722
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void saveChangedDataValue(String newValue) {
if (oldSelectedIndex>-1) {
if (oldSelectedValue != null && !oldSelectedValue.equals(newValue)) {
hashtable.put(getJList1().getModel().getElementAt(oldSelectedIndex), newValue);
getSaveBtn().setEnabled(true);
}
}
return;
}
COM: <s> save the text value specified if and only if it is </s>
|
funcom_train/3114936
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected GraphicalObjectImpl clone(GraphicalObjectImpl gobClone) {
gobClone.parent = null;
gobClone.tx = (AffineTransform) this.tx.clone();
gobClone.flagDirty = true;
//// 1. Clone the view handler. No need to clone the interaction handler,
//// since it is initialized correctly in the constructor.
gobClone.setViewHandler((ViewHandler) view.clone());
return (gobClone);
} // of clone
COM: <s> clone all of the state in the current graphical object into the passed </s>
|
funcom_train/21728021
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void requestMap() {
ArrayList<String> values = new ArrayList<String>();
ArrayList<String> valuenames = new ArrayList<String>();
XMLParam root = null;
XMLParam submethodcall = null;
valuenames.add("methodid");
valuenames.add("desc");
values.add(Integer.toString(XMLEnum.request_map));
values.add("Requesting map from server");
try {
submethodcall = new XMLParam("methodcall", values, valuenames);
root = new XMLParam("root", new ArrayList<String>(), new ArrayList<String>());
} catch (Exception e) {
e.printStackTrace();
return;
}
root.addSubParam(submethodcall);
update(root);
}
COM: <s> method to request the map from the server </s>
|
funcom_train/17624300
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public Point getPosition(Brick brick) {
for (int i = 0; i < Layout.MAX; i++) {
for (int j = 0; j < Layout.MAX; j++) {
if (bricks[i][j] == brick) {
return new Point(i, j);
}
}
}
return null;
}
COM: <s> returns position of the selected brick at the window </s>
|
funcom_train/16476128
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void fireElementDeletedEvent(BenchmarkElement e) {
// System.out.println("Fire ElementDeletedEvent: " + e.toString()); // DEBUG
final BenchmarkElementEvent event = new BenchmarkElementEvent (e);
fireEvent(
new EventHandler<BenchmarkElementEvent>(event) {
@Override
protected void dispatch(ElementEventListener listener, BenchmarkElementEvent event)
{
listener.elementDeleted(event);
}
});
}
COM: <s> fire an event to note that the given element was deleted </s>
|
funcom_train/14585626
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public String getSummaryPlayTypeStatHist() {
return isOffense() ?
getSummaryOffensePlayTypeStats(playTypeStatHist, playTypeStatHistIdx) + NEWLINE + NEWLINE
+ getSummaryDefensePlayTypeStats(playTypeStatHist, playTypeStatHistIdx) :
getSummaryDefensePlayTypeStats(playTypeStatHist, playTypeStatHistIdx) + NEWLINE + NEWLINE
+ getSummaryOffensePlayTypeStats(playTypeStatHist, playTypeStatHistIdx);
}
COM: <s> gets a summary of the play type stats history </s>
|
funcom_train/46680438
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void removeEmptyEvents(){
for (int pos=0; pos<getNumberOfEvents(); pos++){
Event event = getEventAt(pos);
if (event.getDescription().trim().length()<=0){
this.removeElementAt(pos);
pos--;
}
}
updatePositions();
}
COM: <s> removes all empty events from this tier i </s>
|
funcom_train/10794090
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public OpenJPAException newStoreException(String msg, SQLException[] causes, Object failed) {
if (causes != null && causes.length > 0) {
OpenJPAException ret = narrow(msg, causes[0], failed);
ret.setFailedObject(failed).setNestedThrowables(causes);
return ret;
}
return new StoreException(msg).setFailedObject(failed).
setNestedThrowables(causes);
}
COM: <s> return a new exception that wraps code causes code </s>
|
funcom_train/2897906
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void fireRelationEditEvent(VisibleRelationEvent aVisibleRelationEvent) {
Object[] listeners = myEventListenerList.getListenerList();
for (int i = listeners.length - 2; i >= 0; i -= 2) {
if (listeners[i] == VisibleRelationEventListener.class) {
((VisibleRelationEventListener) listeners[i + 1])
.onRelationEdit(aVisibleRelationEvent);
}
}
}
COM: <s> fires an code visible relation event code by calling on relation edit </s>
|
funcom_train/3613350
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void testBuildModule() {
final Builder b = new Builder(null, null, null, null);
b.buildModule("test");
assertEquals("test", b.getProjectName());
assertTrue(b.getAtticFileNames().isEmpty());
}
COM: <s> test if the module name is correctly passed on </s>
|
funcom_train/13759162
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void autoSizeColumn(int column, boolean useMergedCells) {
double width = ColumnHelper.getColumnWidth(this, column, useMergedCells);
if(width != -1){
columnHelper.setColBestFit(column, true);
columnHelper.setCustomWidth(column, true);
columnHelper.setColWidth(column, width);
}
}
COM: <s> adjusts the column width to fit the contents </s>
|
funcom_train/26625866
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private boolean _GetState(Event evt, long timeout) {
synchronized(get_state_mutex) {
state=null;
Down(evt);
try {
get_state_mutex.wait(timeout); // notified by GET_STATE_OK event
}
catch(Exception e) {
}
if(state != null) // 'state' set by GET_STATE_OK event
return true;
else
return false;
}
}
COM: <s> receives the state from the group and modifies the jchannel </s>
|
funcom_train/48151529
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void itemStateChanged(ItemEvent event) {
if (event.getSource() == getStopChoice()) {
int j = getStopChoice().getSelectedIndex();
if (j >= 5) {
setStopFreq(-1);
stopValue = j - 5;
} else super.itemStateChanged(event);
} else super.itemStateChanged(event);
}
COM: <s> this method causes the experiment to stop when the hand is a certain </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.