__key__
stringlengths 16
21
| __url__
stringclasses 1
value | txt
stringlengths 183
1.2k
|
---|---|---|
funcom_train/26450624 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean refresh() {
if (colorsChanged) {
for (int c=0; c<colorChanged.length; c++) {
if (colorChanged[c]) {
colorChanged[c] = false;
for (int n = 0; n < gdi.gfx.total; n++) {
valid[n] = (tileColor[n] == c) && (tileImg[n] != null) ;
}
}
}
colorsChanged = false;
return true;
}
return false;
}
COM: <s> resets all changed flags </s>
|
funcom_train/12553760 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void cmd_deleteStudent(StringTokenizer studentInfo) {
String username = studentInfo.nextToken();
String courseID = studentInfo.nextToken();
try {
instDB.deleteStudent(username, courseID);
sendtoClient("1500");
} catch(InvalidDBRequestException e) {
sendtoClient("1501 "+e.getMessage());
}
}
COM: <s> remove a student from a course </s>
|
funcom_train/4358478 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString() {
StringBuffer sb = new StringBuffer("LifecycleException: ");
if (message != null) {
sb.append(message);
if (throwable != null) {
sb.append(": ");
}
}
if (throwable != null) {
sb.append(throwable.toString());
}
return (sb.toString());
}
COM: <s> return a formatted string that describes this exception </s>
|
funcom_train/25524340 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean saveGroupStrategyRateScore(Long linkId,Double finalRate,String method) {
String sql = "insert into group_strategy_rate(linkId, final_rate, method) "
+ " values (" + linkId + "," + finalRate + ",'" + method + "')";
PreparedStatement ps = dbAccess.prepareStatement(sql);
int result = dbAccess.ExecUpdate(ps);
return result > 0;
}
COM: <s> saves the groups strategy rate score for a given method </s>
|
funcom_train/35119205 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void put(String str, int idx) throws TrieException {
// update the string entry
this.frequencies.get(idx).setStr(str.toCharArray());
// update the trie
List<Integer> allOccurences = this.trie.addOccurence(str, idx);
// populate updated frequencies
for (Integer i : allOccurences) {
this.frequencies.get(i).setFrequency(allOccurences.size());
}
}
COM: <s> put an actual entrance in the magic trie </s>
|
funcom_train/12643040 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: synchronized public void print(String s) {
if(writer == null) {
writer = Helper.getStreamWriter(this);
}
if (s == null) {
s = "null";
}
try {
writer.write(s);
writer.flush();
} catch(IOException x) {
trouble = true;
}
}
COM: <s> prints a string </s>
|
funcom_train/18501956 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void findImportantMp() {
CRNetAttribute attr;
ArrayList list;
CRNetCase c;
for (Iterator it = arr_attributes.iterator(); it.hasNext(); ) {
attr = (CRNetAttribute) it.next();
list = attr.getOpenMp(exec.globalTime);
exec.openSet.addAll(list);
}
}
COM: <s> find important mp </s>
|
funcom_train/48703905 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void parseTitleString(BibtexEntry be) throws IOException {
// skip article number
this.lastLine = this.lastLine.substring(this.lastLine.indexOf('.') + 1, this.lastLine.length());
be.setField("title", readMultipleLines());
}
COM: <s> implements grammar rule title string </s>
|
funcom_train/34289240 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void remove() {
OntModel model = OntologyManager.getInstance().getModel();
// List statements with Resource as Subject
StmtIterator stmList = model.listStatements(resource, null,
(RDFNode) null);
while (stmList.hasNext()) {
Statement stm = stmList.nextStatement();
RDFNode node = stm.getObject();
if (node.isResource()) {
model.removeAll((Resource) node, null, null);
}
}
model.removeAll(resource, null, null);
model.commit();
}
COM: <s> remove all statements of a resourse </s>
|
funcom_train/49009287 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getJButton6() {
if (jButton6 == null) {
jButton6 = new JButton();
jButton6.setText("提取骨架");
jButton6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
Filter filter = new SkeletonizeFilter();
doFilter(filter, true);
}
});
}
return jButton6;
}
COM: <s> this method initializes j button6 </s>
|
funcom_train/10637768 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testCFII_ServerClosed_Block() throws Exception {
// ensure
ensureServerOpen();
assertTrue(this.channel1.isBlocking());
statusNotConnected_NotPending();
// connect
assertTrue(this.channel1.connect(localAddr1));
statusConnected_NotPending();
ensureServerClosed();
tryFinish();
this.channel1.close();
statusChannelClosed();
}
COM: <s> connect server closed finish close </s>
|
funcom_train/26395082 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getInitParameter(ServletConfig servletconfig, String name) throws ServletException {
String value = servletconfig.getInitParameter(name);
if (value == null) {
value = servletconfig.getServletContext().getInitParameter(name);
}
getInitParameter("test");
if (value == null) {
throw new ServletException("Context parameter " + name + " needs to be set.");
}
return value;
}
COM: <s> get an init parameter first trying servlet config then trying servlet context </s>
|
funcom_train/1170063 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getJButtonStart() {
if (jButtonStart == null) {
jButtonStart = new JButton();
jButtonStart.setEnabled(false);
jButtonStart.setBounds(new Rectangle(136, 239, 123, 17));
jButtonStart.setText("Import");
jButtonStart.addMouseListener(new CustomListener());
}
return jButtonStart;
}
COM: <s> this method initializes j button start </s>
|
funcom_train/12777098 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected ImageIcon createImageIcon(String path) {
java.net.URL imgURL = DualTreeCellRenderer.class.getResource(path);
if (imgURL != null) {
return new ImageIcon(imgURL);
} else {
System.err.println("Couldn't find file: " + path);
return null;
}
}
COM: <s> returns an image icon or null if the path was invalid </s>
|
funcom_train/3366608 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void propertyChange(PropertyChangeEvent e) {
if(e.getPropertyName().equals("defaultButton")) {
JRootPane rootpane = (JRootPane)e.getSource();
updateDefaultButtonBindings(rootpane);
if (rootpane.getClientProperty("temporaryDefaultButton") == null) {
rootpane.putClientProperty("initialDefaultButton", e.getNewValue());
}
}
}
COM: <s> invoked when a property changes on the root pane </s>
|
funcom_train/2487327 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean isTagDefBodyClose() {
if (!ismatch(tagDefBodyClose))
return false;
int mark = input.mark();
boolean returnValue = true;
try {
match(tagDefBodyClose);
processIdent(TAGNAME);
match(COLON);
processIdent(TAGACTION);
match(tagDefEnd);
} catch (Exception e) {
returnValue = false;
}
input.rewind(mark);
return returnValue;
}
COM: <s> method is tag def body close </s>
|
funcom_train/21612272 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void mergeWith(Grammar other) {
Set<String> productionNames = productions.keySet();
for(Map.Entry<String, Production> entry : other.productions.entrySet() ) {
if( productionNames.contains( entry.getKey() ) ) {
continue;
}
productions.put( entry.getKey(), entry.getValue() );
}
}
COM: <s> merges a grammar with a sub grammar verifying possible conflicts between production names </s>
|
funcom_train/26100536 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void exchange(int a,int b) {
LocalAssignment x,y;
x = anwserList.get(a);
y = anwserList.get(b);
AnObject temp = x.getObject();
x.setObject(y.getObject());
y.setObject(temp);
assignment.put(x.getPosition(), x.getObject());
assignment.put(y.getPosition(),y.getObject());
antyAssignment.put(x.getObject(),x.getPosition());
antyAssignment.put(y.getObject(),y.getPosition());
}
COM: <s> exchanges assigned objects beetwen two positions </s>
|
funcom_train/44489712 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getNumberOfColums ( ResultSet rs ) {
try {
ResultSetMetaData rsmd = rs.getMetaData();
return rsmd.getColumnCount();
} catch ( Exception ex ) {
System.err.println ( "Error in getNumberOfColums: " + ex.getMessage() );
}
return 0;
}
COM: <s> returns the number of colums for the given result set </s>
|
funcom_train/14012474 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setCellRenderer(ListCellRenderer newValue) {
if (newValue == null) {
throw new IllegalArgumentException("Cell Renderer may not be null.");
}
ListCellRenderer oldValue = listCellRenderer;
listCellRenderer = newValue;
firePropertyChange(LIST_CELL_RENDERER_CHANGED_PROPERTY, oldValue, newValue);
}
COM: <s> sets the renderer for items </s>
|
funcom_train/12562144 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean lastInIsolate(MIDletProxy proxy) {
Isolate isolate = (Isolate)isolates.get(proxy);
int midletCount = 0;
if (isolate != null) {
Enumeration enum = isolates.elements();
while (enum.hasMoreElements()) {
Isolate current = (Isolate)enum.nextElement();
if (current == isolate) {
midletCount++;
}
}
}
return midletCount == 1;
}
COM: <s> determine if a midlet is the last midlet in an isolate </s>
|
funcom_train/39397941 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getDomain(URL url) {
url = handleRedirectors(url);
String encodedHost = url.getHost(); // may contain hex-chars (%a7 and so on)
String decodedHost = decode(encodedHost);
// IP-Address
String ip = handleIP(decodedHost);
if (ip != null) {
return ip;
}
String encodedPath = url.getPath(); // get everything after the domain
String decodedPath = decode(encodedPath);
// Common case
String commonCase = handleCommonCase(decodedHost,decodedPath);
return commonCase;
}
COM: <s> returns the domain from a url e </s>
|
funcom_train/23271460 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setSubtitleFont(Font font) {
if (font == null) {
throw new IllegalArgumentException("Null 'font' argument.");
}
Font old = this.subtitle.getFont();
this.subtitle.setFont(font);
firePropertyChange("subtitleFont", old, font);
}
COM: <s> sets the font for the charts subtitle and sends a </s>
|
funcom_train/38350832 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double getDistance(Genotype gt1, Genotype gt2){
BitStringGenotype bst1 = (BitStringGenotype)gt1;
BitStringGenotype bst2 = (BitStringGenotype)gt2;
if (bst1.size()!=bst2.size()) throw new RuntimeException("Size of both genotypes is not equal");
BitSet bsXOR = ((BitSet)bst1.getBitSet().clone());
bsXOR.xor(bst2.getBitSet());
return bsXOR.cardinality();
}
COM: <s> returns the hamming distance of gt1 and gt2 </s>
|
funcom_train/11098699 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public AdminCommandsServiceMBean getAdminCommandsService() throws IOException, MalformedObjectNameException {
ObjectName objectName = getObjectName(AdminCommandsServiceMBean.class);
return (AdminCommandsServiceMBean) MBeanServerInvocationHandler.newProxyInstance(jmxConnector.getMBeanServerConnection(),
objectName, AdminCommandsServiceMBean.class, true);
}
COM: <s> get the admin commands service </s>
|
funcom_train/48614578 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setAllItemsWithinCollectionPublic(InstitutionalCollection institutionalCollection) {
for(InstitutionalItem institutionalItem: institutionalCollection.getItems()) {
for(InstitutionalItemVersion version :institutionalItem.getVersionedInstitutionalItem().getInstitutionalItemVersions()) {
GenericItem item = version.getItem();
item.setPubliclyViewable(true);
for(ItemFile file:item.getItemFiles()) {
file.setPublic(true);
}
}
institutionalItemDAO.makePersistent(institutionalItem);
}
}
COM: <s> sets all items within a collection as public </s>
|
funcom_train/3332815 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getSize() {
int size = frames.getLength();
int sizeDiff = 0;
if( head.getExtendedHeader() ) {
size += ext_head.getSize();
}
size += padding;
sizeDiff = size - writtenTagSize;
if( (padding == writtenPadding) && (sizeDiff != 0) ) {
if( (sizeDiff < 0) || (sizeDiff <= padding) ) {
size = head.getTagSize();
}
}
return size;
}
COM: <s> returns the size of this id3v2 tag </s>
|
funcom_train/29282698 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void checkResponseCode(long requestId, ResponseCode responseCode) {
BillingRequest request = mSentRequests.get(requestId);
if (request != null) {
LogUtil.d(TAG, "%s: %s", request.getClass().getSimpleName(), responseCode);
request.responseCodeReceived(responseCode);
}
mSentRequests.remove(requestId);
}
COM: <s> this is called when we receive a response code from android market for </s>
|
funcom_train/44166473 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int incite(Unit unit, Direction direction, Player enemy, int gold) {
HashMap<String, String> results = loadMap("gold");
if (!askHandling(new InciteMessage(unit, direction, enemy, gold),
null, results)) return -1;
try {
return Integer.parseInt(results.get("gold"));
} catch (NumberFormatException e) {}
return -1;
}
COM: <s> server query response for inciting the natives </s>
|
funcom_train/22500935 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String elementToHTML(final Element element) {
final HTMLDocument document = (HTMLDocument) getDocument();
final StringWriter stringWriter = new StringWriter();
final SHTMLWriter shtmlWriter = new SHTMLWriter(stringWriter, document);
try {
shtmlWriter.write(element);
}
catch (final Exception ex) {
}
return stringWriter.getBuffer().toString();
}
COM: <s> returns the string html representation of the element </s>
|
funcom_train/1290493 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString() {
String ret = "[";
for(Enumeration<Feature> en = features.keys(); en.hasMoreElements();) {
Feature next = en.nextElement();
ret += "(" + next + ": " + features.get(next) + ") ";
}
ret += "]\n";
return ret;
}
COM: <s> returns the string representation of this feature vector </s>
|
funcom_train/4509227 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public DownloadStatus installPlugin(String url, int hashCode) {
UpdateManager updateManager = XMPPServer.getInstance().getUpdateManager();
boolean worked = updateManager.downloadPlugin(url);
final DownloadStatus status = new DownloadStatus();
status.setHashCode(hashCode);
status.setSuccessfull(worked);
status.setUrl(url);
return status;
}
COM: <s> installs a new plugin into openfire </s>
|
funcom_train/30278024 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initDuration(InitDuration duration, boolean isForGeneralRow) {
if (LOG.isInfoEnabled()) {
LOG.info(duration + "; forGeneralRow = " + isForGeneralRow);
}
if (!isForGeneralRow) {
ServerSideAvgTimes ssAT = findServerSideAvgTimes(duration.queueName);
ssAT.initStatistic(duration);
} else {
averageTimeForGeneralRow.initStatistic(duration);
}
}
COM: <s> initializes duration from database </s>
|
funcom_train/1627208 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private State getActiveState(StateMachineContext context) throws EventProcessorException {
StateMachinePath path = getStateMachinePath();
StateMachineConfigManager configManager = engine.getEventProcessor().getModelStructure().getConfigManager(machine.getName());
StateMachineConfig config = configManager.load(path, context);
return CoreContract.decodeState(machine, config.getActiveState());
}
COM: <s> returns active state by given </s>
|
funcom_train/49159606 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void play() {
super.play();
Team[] teams = GameController.getInstance().getScenario().getTeams();
for (int i = 0; i < teams.length; i++) {
teams[i].getSponsoring().checkValidContracts();
teams[i].getSponsoring().generateOfferedContracts();
}
}
COM: <s> check valid contracts and generate new offered contracts for each team </s>
|
funcom_train/10933075 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void parseType(XMLStreamReader parser) throws Exception {
Unmarshaller u = JaxBHelper.createUnmarshaller();
JAXBElement<CmisTypeDefinitionType> jaxbObject = u.unmarshal(parser, CmisTypeDefinitionType.class);
if (jaxbObject != null) {
typeDef = Converter.convert(jaxbObject.getValue());
}
}
COM: <s> parses a cmis type </s>
|
funcom_train/41209291 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean intersects(int x, int y, int width, int height) {
int tw = size.getWidth();
int th = size.getHeight();
return intersects(this.x, this.y, tw, th, x, y, width, height);
}
COM: <s> determines whether or not this rectangle and the specified rectangle </s>
|
funcom_train/15720351 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Vector getSensorVec(int id) {
try{
Integer idKey = new Integer(id);
if (sensors.containsKey(idKey)) return (Vector) sensors.get(idKey);
return null;
}catch (Exception e){if (MainClass.DEBUG) System.out.println(e.toString()+"SensoValsVector getSensorVec");return null;}
}
COM: <s> returns the vector of sensor data of the specified esb </s>
|
funcom_train/3598143 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testDisjunction() {
try {
List results = engine.search(nom, "($n np):$n@hlem='toy' || start($n)>'2'");
results.remove(0); // remove list of vars
Collections.sort(results, new SearchResultIDComparator());
assertTrue(results.size()==2);
NOMElement r1 = (NOMElement)((List)results.get(1)).get(0);
assertTrue(r1.getID().equals("np_3"));
} catch (Throwable ex) {
ex.printStackTrace();
fail("Conjunction test failed!");
}
}
COM: <s> disjunction of two conditions including start for checking </s>
|
funcom_train/10628014 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetter() throws Exception {
Expression expr = new Expression(new SampleBean("hello"), "getText",
new Object[] {});
Object result = expr.getValue();
if (result != null && result instanceof String) {
assertEquals("hello", result);
} else {
fail("Result of SampleBean.getText() call is not "
+ "of String type.");
}
}
COM: <s> the test checks the correct getter is initialized </s>
|
funcom_train/22796400 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JToolBar getControlToolBar() {
if (controlToolBar == null) {
controlToolBar = new JToolBar();
controlToolBar.setFloatable(false);
controlToolBar.add(getStartButton());
controlToolBar.add(getPauseButton());
controlToolBar.add(new JToolBar.Separator());
controlToolBar.add(getPreviousButton());
controlToolBar.add(getNextButton());
controlToolBar.add(new JToolBar.Separator());
}
return controlToolBar;
}
COM: <s> this method initializes control tool bar </s>
|
funcom_train/4984373 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void start() {
if (isEmpty()) {
throw new GameEmptyException();
}
players.get(thisplayer).clearHand();
jackDealer.clearHand();
jackCanvas.clearPlayerPanel();
jackCanvas.clearDealerPanel();
jackCanvas.clearDealerTotal();
dealCards();
}
COM: <s> starts this game if there is one or more players throws unchecked </s>
|
funcom_train/37822968 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void removeEdge(int start, int end) {
VisualEdge edge = null;
// look for existing edges
for (VisualGraphElement element : elements) {
if (element instanceof VisualEdge) {
edge = (VisualEdge) element;
// check start and end nodes
if (edge.getStartNode() == start && edge.getEndNode() == end) {
// specified edge found: remove it
deletedElements.add(new DeletedEdge(edge, graphController));
elements.remove(element);
break;
}
}
}
}
COM: <s> remove edge with the specified start end end nodes </s>
|
funcom_train/34637276 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isCompatibleFormat(CodeSnippet codeSnippet, Format format) {
Set<String> csTargets = repository.getQuery(codeSnippet).getQueryTargets();
List<String> fTargets = format.getTargetList();
//the format is compatible with the codeSnippet if all
//targets of the query have an appropriate target in the format
boolean isCompatible = true;
for (String s : csTargets) {
isCompatible = isCompatible && (fTargets.contains(s) || fTargets.contains("*"));
}
return isCompatible;
}
COM: <s> checks whether a format can be applied to a code snippet </s>
|
funcom_train/14305744 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public List getSourceFilesContaining(String string) {
if (string.length() > msIndexSize) {
string = string.substring(0,msIndexSize);
}
List sourceFileList = (List) mQuickAccessMap.get(string.toLowerCase());
if(sourceFileList == null) {
return new ArrayList();
}
return Collections.unmodifiableList(sourceFileList);
}
COM: <s> gets a list of all source files containing the specified substring </s>
|
funcom_train/17174964 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testMixedRead() throws IOException {
Stream llr = new LogicalLineReader(new MultiFileReader(), '#', '\\');
llr.addFile("src/util/test/fileWithSpaces.txt");
assertEquals('a', llr.read());
assertEquals(' ', llr.read());
assertEquals('l', llr.read());
assertEquals("ine", llr.readLine());
assertEquals("a second line", llr.readLine());
assertNull(llr.readLine());
llr.close();
}
COM: <s> execute the mixed read test </s>
|
funcom_train/43133383 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getOrientation() {
String orientation = prop.getProperty("orientation");
if (orientation == null) {
orientation = String.valueOf(JSplitPane.HORIZONTAL_SPLIT);
}
try {
return Integer.parseInt(orientation);
}
catch (NumberFormatException e) {
logger.error("the orientation property is not an integer : "+e.getMessage());
return JSplitPane.HORIZONTAL_SPLIT;
}
}
COM: <s> get the split pane orientation </s>
|
funcom_train/43875890 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean isLocked() {
if ( masterController.isLocked() ) {
try {
Messagebox.show( "Listbox is locked.", "Locked", Messagebox.OK, Messagebox.INFORMATION );
} catch ( InterruptedException ex ) {
LOGGER.debug( "Messagebox failed.", ex );
}
return true;
} else {
return false;
}
}
COM: <s> checks if the master model is locked or not </s>
|
funcom_train/45289581 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected int digit(int pos, int base) {
char c = ch;
int result = Character.digit(c, base);
if (result >= 0 && c > 0x7f) {
log.error(pos + 1, "illegal.nonascii.digit");
ch = "0123456789abcdef".charAt(result);
}
return result;
}
COM: <s> convert an ascii digit from its base 8 10 or 16 </s>
|
funcom_train/14416010 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public CIMQualifier getQualifier(String pName) {
if (pName == null) throw new IllegalArgumentException("null qualifier name argument");
Iterator iter = iQualifiers.iterator();
while (iter.hasNext()) {
CIMQualifier qualifier = (CIMQualifier) iter.next();
if (qualifier.getName().equalsIgnoreCase(pName)) { return qualifier; }
}
return null;
}
COM: <s> gets the specified qualfier it exits on the cim element </s>
|
funcom_train/1797653 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setIncludeAllSites(String includeAllSites) {
// check if setting to existing value
if (this.includeAllSites == null ? includeAllSites != null :
!this.includeAllSites.equals(includeAllSites)) {
// set to new value for customer parameter
this.includeAllSites = includeAllSites;
setStringCustomParameter("include-all-sites", includeAllSites);
}
}
COM: <s> sets the include all sites that can be viewed </s>
|
funcom_train/1653435 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSimpleFieldSetPutSingle_StringString_WithTwoPairedMultiLevelChars() {
SimpleFieldSet methodSFS = new SimpleFieldSet(true);
String methodKey = "foo..bar.";
String methodValue = "foobar";
methodSFS.putSingle(methodKey,methodValue);
assertEquals(methodSFS.subset("foo").subset("").subset("bar").get(""),methodValue);
assertEquals(methodSFS.get(methodKey),methodValue);
}
COM: <s> tests put single string string method </s>
|
funcom_train/10547610 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testStatementSeverityErrorInProcedure() throws SQLException {
Statement s = createStatement();
s.execute("create procedure proc_5280() language java " +
"parameter style java external name '" +
getClass().getName() + ".proc_5280' reads sql data");
s.execute("call proc_5280()");
}
COM: <s> test that a statement severity error inside a procedure doesnt kill </s>
|
funcom_train/13479769 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setState(Plugin plugin, boolean enabled) {
PEntry entry = registry.get(plugin);
if (entry != null) {
entry.enabled = enabled;
if (enabled == true)
config.addToList(PAR_PLUGIN, plugin.getName());
else
config.remFromList(PAR_PLUGIN, plugin.getName());
}
}
COM: <s> changes the state of activation of a plugin </s>
|
funcom_train/3289035 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getPadding() {
int padding = 0;
try {
PortletConfig conf = getPortlets().getPortletConfig();
padding = Integer.parseInt( conf.getSkin( "padding" , String.valueOf( DEFAULT_PADDING ) ) );
} catch ( RuntimeException e ) {
padding = DEFAULT_PADDING;
}
return padding;
}
COM: <s> returns the padding value between the displayed portlets </s>
|
funcom_train/50016564 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Date getCachedOnset(final Date date) {
for (Iterator i = onsets.keySet().iterator(); i.hasNext();) {
Period onsetPeriod = (Period) i.next();
if (onsetPeriod.includes(date, Period.INCLUSIVE_START)) {
return (Date) onsets.get(onsetPeriod);
}
}
return null;
}
COM: <s> returns a cached onset for the specified date </s>
|
funcom_train/9532234 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public OBOProperty getCurrentRelation() throws CharFieldGuiEx {
if (currentRel == null) throw new CharFieldGuiEx("relation is empty");
if (!currentRel.getName().equals(getText()))
throw new CharFieldGuiEx("(relation "+currentRel.getName()+" and input "+getText()+
" dont match)");
return currentRel;
}
COM: <s> throws exception if there isnt a current relation for relation lists </s>
|
funcom_train/32258608 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected MJButton getBtCustRepShowReport() {
if (btCustRepShowReport == null) {
btCustRepShowReport = new MJButton();
btCustRepShowReport.setPreferredSize(new Dimension(100, 20));
btCustRepShowReport.setText("Open");
btCustRepShowReport.setMnemonic(KeyEvent.VK_O);
}
return btCustRepShowReport;
}
COM: <s> this method initializes bt cust rep show report </s>
|
funcom_train/22077815 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void test03ModifyEmpty() throws MapperException {
ctxmock.expects(once()).method("modifyAttributes").with(same(cn),
modopCheck03());
/* input */
Map input = new HashMap();
input.put("nom", "");
/* operations */
this.mods = new ModificationsVariables(output);
mods.modifyAttribute("name", new VariableString("${nom}"));
sm.setOperations(mods);
sm.modify(input, input);
}
COM: <s> test modify operation with empty value </s>
|
funcom_train/38311281 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void swapRows(int a, int b) {
if (a == b) {
return;
}
DataRow rowA = (DataRow) rows.get(a);
DataRow rowB = (DataRow) rows.get(b);
rows.set(a, rowB);
rows.set(b, rowA);
}
COM: <s> swaps the rows with the given two indices </s>
|
funcom_train/51343167 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isClosureProgram2(IStep step) {
if (step == null)
throw new IllegalArgumentException();
if (step.isRule()) return false;
final IProgram program = (IProgram)step;
if (program.isClosure())
return true;
final Iterator<IStep> itr = program.steps();
while (itr.hasNext()) {
if (isClosureProgram2(itr.next()))
return true;
}
return false;
}
COM: <s> code true code iff this program is or contains a closure operation </s>
|
funcom_train/37035251 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeRole(String rolename) {
UserDatabase database = (UserDatabase) this.resource;
Role role = database.findRole(rolename);
if (role == null) {
return;
}
try {
MBeanUtils.destroyMBean(role);
database.removeRole(role);
} catch (Exception e) {
throw new IllegalArgumentException("Exception destroying role " +
role + " MBean: " + e);
}
}
COM: <s> remove an existing role and destroy the corresponding mbean </s>
|
funcom_train/32628747 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ExtendedIterator getEquivalenceSet() {
Set s = new HashSet();
s.add( this );
for (Iterator i = getEquivalentValues(); i.hasNext(); s.add( i.next() ) );
s.remove( this );
return WrappedIterator.create( s.iterator() );
}
COM: <s> answer the set of equivalent values to this value but not including the </s>
|
funcom_train/37089111 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean hasEdgeMetaData(EdgeDataSetMetaData metaData) {
if (meta != null) return meta.equals(metaData);
if (metaData.getName().equals(getName())
&& metaData.getType().equals(getType())) {
meta = metaData; // we've found our meta - cache it for future calls
return true;
}
return false;
}
COM: <s> this is not used </s>
|
funcom_train/4684562 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setFragType(byte type) {
byte save = (byte)(rp.getMACPayloadAt(fragIndex) & 0x07); // save size bits (low 3)
save |= (type & 0xe0);// OR in the high 3 bits - two middle unused
rp.setMACPayloadAt(fragTagIndex, save);
}
COM: <s> define the fragment type for this packet as defined in the 6lowpan spec </s>
|
funcom_train/18592538 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int tabNameToIndex(JTabbedPane tabs, String name) {
for (int i=0;i < tabs.getTabCount();i++) {
String value = tabs.getTitleAt(i);
if (ExtendedComparator.stringsMatch(name, value))
return i;
}
return -1;
}
COM: <s> return the row col of the first object matching the given string </s>
|
funcom_train/8452543 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void sendBirthdayReminder(String email, Date date) throws MessagingException, LembreteSystemException {
User user = userDAO.findByLogin(email);
if (user == null) {
throw new LembreteSystemException("Non user email address: " + email);
}
String text = generateBirthdayEmailMessageContent(user.getId(), date);
if (text != null) {
mailManager.sendMessage(user.getEmail(), "Birthday Reminders", text);
}
}
COM: <s> sends the birthday reminder email to the users email </s>
|
funcom_train/33495030 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void formatNode(Node node, int offset, int length, CoStyledDocument doc) {
// Nodes are either paragraph nodes or nodes within a paragraph that specifies
// style for characters
String tag = node.getNodeName();
if(tag.equals("p")) {
formatParagraph(node, offset, length, doc);
} else {
formatCharacters(node, offset, length, doc);
}
}
COM: <s> applies formatting to nodes </s>
|
funcom_train/5231123 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void setCustomOptions(Parameter[] customOptions) {
if (customOptions == null) {
customOptions = new Parameter[] {};
}
this.customOptions = customOptions;
for (int i = 0; i < customOptions.length; i++) {
handler.addOption(customOptions[i]);
}
}
COM: <s> sets options specific to a subclass </s>
|
funcom_train/33943270 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void scanPathForTemplates(String templatePath) {
File dir = new File(templatePath);
String[] children = dir.list();
if (children != null) {
for (int i = 0; i < children.length; i++) {
// Get filename of file or directory
OOTemplateFilename oOTemplateFilename = new OOTemplateFilename(templatePath, children[i]);
if (oOTemplateFilename.getExtension().equalsIgnoreCase(".ott"))
templates.add(oOTemplateFilename);
}
}
}
COM: <s> scans the template path for all templates </s>
|
funcom_train/8910976 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String execute(){
String resultHtml = null;
debug(1,"jsrpc start..."+screenName+" "+rpcid);
HashMap hm = jsrpcProcessBL(screenName);
JSONObject jobj = new JSONObject(hm);
resultHtml = jobj.toString();
debug(1,"json result:"+resultHtml);
inputStream = new StringBufferInputStream(resultHtml);
return SUCCESS;
}
COM: <s> execute method is executed by default </s>
|
funcom_train/18219295 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Test getSuite(String rootDirectory) {
final ThreadSafetyTest thisInstance = this;
BugzillaTest theTest = new BugzillaTest() {
/**
* Threaded test cases have a different behaviour. e.g. no database
* setup.
*/
@Override
protected void addTestCasesToSuite(File directory, TestSuite suite,
String filename) {
suite.addTest(new BugzillaWithThreadsTestCase(directory,
filename, thisInstance));
}
};
return theTest.createSuite(new File(rootDirectory));
}
COM: <s> helper method to create a test suite for threaded testing </s>
|
funcom_train/28151273 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Expr getBound(int i) {
if (i<0) throw new NoSuchElementException();
for(Decl d: decls) {
if (i < d.names.size()) return d.expr;
i = i - d.names.size();
}
throw new NoSuchElementException();
}
COM: <s> return the i th variables bound </s>
|
funcom_train/38286249 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String extractPath(String fileId) {
String path = "";
if (fileId != null && fileId.length() > 0) {
path = fileId.substring(fileId.indexOf("/"), fileId.lastIndexOf("/"));
}
return path;
}
COM: <s> returns file path from id entry point id path filename </s>
|
funcom_train/40484457 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double getAnimationPosition(double input){
// Apply the pre TransitionPhysics (if there are any);
input = this.applyBeforeTransitions(input);
// Apply the easing for the subclass of this.
input = applyTransitionPhysics(input);
// Apply the post TransitionPhysics (if there are any).
input = this.applyAfterTransitions(input);
// Return the guarded value.
return guardResult(input);
}
COM: <s> the get animation progress method returns the progress of animation according to </s>
|
funcom_train/23872798 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public List generate(ContextDeclaration con, String indent, OclProcessor processor) {
//--- Create result
List result = new Vector();
//--- For each constraint: genarate code and add resulting Pair to result
Iterator i = con.getConstraint().iterator();
while (i.hasNext()) {
result.add(generate((Constraint)i.next(), indent, processor));
}
return result;
}
COM: <s> generate code for a context declaration and returns a list of pairs containing </s>
|
funcom_train/37422359 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: static public int ExecuteOperation(Connection pConnect, String pSql, boolean pCommit) throws ClassNotFoundException, SQLException {
Statement tStmt = pConnect.createStatement();
int tResult = tStmt.executeUpdate(pSql);
tStmt.close();
if (pCommit == true) pConnect.commit();
return tResult;
}
COM: <s> executes an sql operation on the database </s>
|
funcom_train/43467262 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetPKValue() throws ZXException {
// book has a primary key is id.
ZXBO objBO = zx.createBO("test/cntry");
objBO.setValue("id", "1");
assertEquals("The Pk value does not match.", "1", objBO.getPKValue().getStringValue());
}
COM: <s> tests whether the get pkvalue is correct </s>
|
funcom_train/41723550 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void checkReturnType(Method method) throws HandlerMethodException {
GenericClass<?> requiredReturnType = getReturnType();
Type specifiedReturnType = method.getGenericReturnType();
if (!requiredReturnType.representsType(specifiedReturnType))
throw new HandlerMethodException(
HandlerMethodException.INCORRECT_RETURN_TYPE,
"Return type should be "
+ requiredReturnType.getSimpleName(), this);
}
COM: <s> checks that the return type of the extracted method is correct </s>
|
funcom_train/5373426 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public MenuItem getDefaultItem () {
checkWidget ();
/*
if (OS.IsWinCE) return null;
int id = OS.GetMenuDefaultItem (handle, OS.MF_BYCOMMAND, OS.GMDI_USEDISABLED);
if (id == -1) return null;
MENUITEMINFO info = new MENUITEMINFO ();
info.cbSize = MENUITEMINFO.sizeof;
info.fMask = OS.MIIM_ID;
if (OS.GetMenuItemInfo (handle, id, false, info)) {
return display.getMenuItem (info.wID);
}
*/
return defaultItem;
}
COM: <s> returns the default menu item or null if none has </s>
|
funcom_train/10526375 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getPageCount() {
if(_dataSetSize != null)
return (int)Math.ceil(_dataSetSize.doubleValue()/(double)getPageSize());
else throw new IllegalStateException(Bundle.getErrorString("PagerModel_CantCalculateLastPage"));
}
COM: <s> get the total number of pages </s>
|
funcom_train/7294611 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addElements(Object[] newValues) {
int newCount = count + newValues.length;
if (newCount > dataArray.length) setCapacity(newCount);
for (int i = count; i < newCount; ++i)
dataArray[i] = newValues[i-count];
count = newCount;
isValid = false;
}
COM: <s> adds multiple elements </s>
|
funcom_train/12761412 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean wordMatches(String text) {
if (text == null) {
return false;
}
//If the whole text matches we are all set
if(match(text))
{
return true;
}
// Otherwise check if any of the words of the text matches
String[] words = getWords(text);
for (int i = 0; i < words.length; i++)
{
String word = words[i];
if (match(word))
{
return true;
}
}
return false;
}
COM: <s> return whether or not if any of the words in text satisfy the </s>
|
funcom_train/5521069 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String handleSinglePixel(int x, int y, int pixel) throws IOException{
//translates pixel integer
int alpha = (pixel >> 24) & 0xff;
int red = (pixel >> 16) & 0xff;
int green = (pixel >> 8) & 0xff;
int blue = (pixel ) & 0xff;
//converts to hex
return hexConverter(red,green, blue);
}
COM: <s> this method translates the integer value passed by pixe grabber into </s>
|
funcom_train/32986828 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setFingerprint() throws TorqueException, CDKException {
MDLV2000Reader mdlreader = new MDLV2000Reader(new StringReader(getStructureFile(1,false)));
IMolecule mol2 = (IMolecule) mdlreader.read(new org.openscience.cdk.Molecule());
CDKHueckelAromaticityDetector.detectAromaticity(mol2);
setFingerprint(mol2);
}
COM: <s> sets the fingerprint values of the dbmolecule object taking the molecule from db </s>
|
funcom_train/12180637 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void dispose() {
for (Iterator it = imageCache.values().iterator(); it.hasNext();) {
final Image image = (Image) it.next();
image.dispose();
}
imageCache.clear();
removeAllListeners();
ImageErrorDecorator decorator = ImageErrorDecorator.getSingleton();
}
COM: <s> disposes of any image resources used by the labels and also </s>
|
funcom_train/45485736 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getJButton9Add() {
if (jButton9Add == null) {
jButton9Add = new JButton();
jButton9Add.setBounds(new Rectangle(5, 225, 64, 26));
Font font = new Font("Serif", Font.BOLD, 16);
jButton9Add.setFont(font);
jButton9Add.setForeground(Color.green);
jButton9Add.setText("9");
}
return jButton9Add;
}
COM: <s> this method initializes j button9 add </s>
|
funcom_train/44216650 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected JTextField getStartTextField() {
if (startTextField == null) {
startTextField = new JTextField();
startTextField.setHorizontalAlignment(JTextField.RIGHT);
startTextField.setEditable(true);
startTextField.setBounds(95,15,70,20);
}
return startTextField;
}
COM: <s> this method initializes start text field </s>
|
funcom_train/22184645 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeRankingLabels() {
PluggableRenderer pr = (PluggableRenderer) vv.getRenderer();
if (pr.getEdgeStringer() instanceof RankingStringer) {
EdgeStringer fes = ((RankingStringer) pr.getEdgeStringer()).getFormerEdgeStringer();
pr.setEdgeStringer(fes);
}
if (pr.getVertexStringer() instanceof RankingStringer) {
VertexStringer fvs = ((RankingStringer) pr.getVertexStringer()).getFormerVertexStringer();
pr.setVertexStringer(fvs);
}
vv.repaint();
}
COM: <s> remove the labels from a ranking </s>
|
funcom_train/46576908 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void valueChanged(ListSelectionEvent e) {
if (e.getValueIsAdjusting()) return;
Collection<ContextNode> nodes = new Vector<ContextNode>();
for (Context context : selectionModel.getSelected()) {
nodes.add(new ContextNode(data.getContextManager(), context));
}
contextProvider.provide(nodes);
}
COM: <s> handle table selection change by calling context provider for the new </s>
|
funcom_train/35299990 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setConcurrency(int concurrency) throws SQLException {
if((concurrency != ResultSet.CONCUR_READ_ONLY) &&
(concurrency != ResultSet.CONCUR_UPDATABLE)) {
throw new SQLException("Invalid concurrency set. Must be either " +
"ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE.");
}
this.concurrency = concurrency;
}
COM: <s> sets the concurrency for this code row set code object to </s>
|
funcom_train/37520105 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void paint(Graphics g, JComponent c) {
DOMNodeCellRenderer renderer = (DOMNodeCellRenderer)c;
FontMetrics fm = g.getFontMetrics();
int y = fm.getAscent();
for (Line line : renderer.getLines()) {
paintLine(renderer, g, line, 0, y);
y = y + fm.getHeight();
}
}
COM: <s> paint the label text in the foreground color if the label </s>
|
funcom_train/8661816 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void cacheCtClass(String classname, CtClass c, boolean dynamic) {
if (dynamic) {
super.cacheCtClass(classname, c, dynamic);
}
else {
if (repository.isPrune())
c.prune();
softcache.put(classname, c);
}
}
COM: <s> cache a class </s>
|
funcom_train/50585603 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeReference(TreeParent treeParent) {
TreeParent testSeriesTreeParent = treeParent.getParent();
checkTreeParent(testSeriesTreeParent);
if (!(treeParent.getContent() instanceof Scenario)) {
throw new IllegalArgumentException("Content isn't a Scenario");
}
Scenario scenario = (Scenario) treeParent.getContent();
TestSeries testSeries = (TestSeries) testSeriesTreeParent.getContent();
testSeries.remove(scenario);
persistenceManager.updateTestSeries(testSeries);
refreshTree();
}
COM: <s> this method removes the selected reference scenario </s>
|
funcom_train/12369101 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void render(GL gl) {
// update camera state
this.update();
// render target
// clear modelview stack
gl.glMatrixMode(GL.GL_MODELVIEW);
gl.glLoadIdentity();
// place inverse camera transformation on modelview stack
GLU glu = new GLU();
glu.gluLookAt(this.position.x, this.position.y, this.position.z,
this.target.x, this.target.y, this.target.z, this.up.x,
this.up.y, this.up.z);
saveMatrices(gl);
renderTarget(gl);
}
COM: <s> renders the camera </s>
|
funcom_train/18500742 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double compute(Object s, Object t) {
String news = (String)s;
String newt = (String)t;
if (news.equals(newt)) return 1.0;
else return ((double)MaxSubString(news,newt)/(double)Math.max(news.length(),newt.length()));
}
COM: <s> applies the similarity function </s>
|
funcom_train/43923049 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void handleCharacters() {
if (characters.length() == 0) {
return;
}
// if inside a property element, add the element
if (insideTag.equals("PropertyName")) {
String name = characters.toString().trim();
characters.setLength(0);
LOGGER.finest("found property name: " + name);
currentQuery.addPropertyName(name);
}
}
COM: <s> handles the string chunks collected in </s>
|
funcom_train/25188325 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetMinLength() throws Exception {
System.out.println("getMinLength");
JSchema instance = new JSchema();
assertNull(instance.getMinLength());
instance.setMinLength(20);
assertEquals((Integer) 20, instance.getMinLength());
}
COM: <s> test of get min length method of class jschema </s>
|
funcom_train/4865651 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void renderBackground(Renderer r, Camera camera) {
if ( this.backgroundImage == null ) {
return;
}
Rectangle viewport = camera.getViewPort();
r.setColor(Renderer.WHITE);
r.drawImage(this.backgroundImage
, viewport.getX()
, viewport.getY()
, viewport.getWidth()
, viewport.getHeight());
// r.drawImage(this.backgroundImage
// , (int) screenCord.x
// , (int) screenCord.y
// , viewport.getWidth()
// , viewport.getHeight()
// , camPos.x
// , camPos.y);
}
COM: <s> render the background image </s>
|
funcom_train/32144338 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initFromTemplate(JFrame templateFrame) {
log.debug("Loaded from template");
frame = templateFrame;
buttonsPanel = new JPanel();
panel = (JPanel) SwingHelper.getComponentFromTree(frame, CONTENT_PANE);
buttonsPanel = (JPanel) SwingHelper.getComponentFromTree(frame, BUTTONS_PANEL);
}
COM: <s> initializes the ui from the java fx template script </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.