__key__
stringlengths 16
21
| __url__
stringclasses 1
value | txt
stringlengths 183
1.2k
|
|---|---|---|
funcom_train/47127397
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public double getNormalizedValue() {
double weightedProduct = 1.0;
int i = 0;
for (FitnessAspect aspect: aspects) {
weightedProduct *= Math.pow(aspect.getNormalizedValue(), weight[i++]);
}
return Math.pow(weightedProduct, 1 / totalWeight);
}
COM: <s> gets the normalized aspect i </s>
|
funcom_train/2969219
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public int getIndex(T timetable) {
Integer i = map.get(timetable.hashCode());
if(i == null) {
list.add(timetable);
map.put(timetable.hashCode(), list.size() - 1);
return list.size() - 1;
} else {
return i;
}
}
COM: <s> this method returns the index of the object in the iraster </s>
|
funcom_train/45465593
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public boolean hasFacet(String name) {
if (name == null) return false;
for (int i = 0; i < facets.size(); i++) {
Facet facet = facets.get(i);
if (name.equals(facet.getName())) return true;
}
return false;
} //-- hasFacet
COM: <s> returns true if this simpletype has a specified facet </s>
|
funcom_train/46589755
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public InputStream getDecodedInputStream() {
InputStream isResult = null;
try {
javax.mail.internet.MimeBodyPart mbp = new javax.mail.internet.MimeBodyPart(getInputStream());
isResult = (InputStream) mbp.getContent();
} catch (Exception e) {
Log.log(Log.FATAL, "lazyj.mail.Attachment", "Attachment: getDecodedInputStream exception : "+ e); //$NON-NLS-1$ //$NON-NLS-2$
}
return isResult;
}
COM: <s> get the decoded input stream </s>
|
funcom_train/5697847
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected ResourceEntry findResourceInternal(File file, String path){
ResourceEntry entry = new ResourceEntry();
try {
entry.source = getURI(new File(file, path));
entry.codeBase = getURL(new File(file, path));
} catch (MalformedURLException e) {
return null;
}
return entry;
}
COM: <s> find specified resource in local repositories </s>
|
funcom_train/35108889
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public interface Exporter extends Event.Exporter {
/**
* Adds the new value assigned to the variable. This method is called by
* {@code AssignEvent#export(Exporter)}.
*
* @param v the new value
*/
public void addNewValue(Value v);
/**
* Adds the identifier for the contour that contains the variable whose
* value is changing.
*
* @param contourID the variables context
*/
public void addContourID(ContourID contourID);
/**
* Adds the identifier of the variable that has changed value.
*
* @param variableID the variable identifier
*/
public void addVariableID(VariableID variableID);
}
COM: <s> exporter reverse builder for assign events </s>
|
funcom_train/46860934
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected void checkResponse(Map<?, ?> response) throws XmlRpcFault {
String status = (String) response.get("status");
// if there is no status at all, assume everything was OK
if (status == null || status.equals("200 OK")) {
return;
}
try {
throw new XmlRpcFault(new Scanner(status).nextInt(), status);
} catch (NoSuchElementException e) {
throw new XmlRpcException("Illegal status code: " + status);
}
}
COM: <s> check whether status is ok or not </s>
|
funcom_train/50104146
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void setDataSetParm(DataSetParm dsp) {
try {
dataSetParm = (DataSetParm) dsp.clone();
dataSetParm.setDataIterator(createDataIterator());
} catch (Exception e) {
throw new RuntimeExceptionBase("Failure in setting DataSetParms: ", e);
}
}
COM: <s> method that sets the data set parm for the data set instance </s>
|
funcom_train/22103511
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void logEvent(AbstractEvent event) {
EventLogManagerLocal elMan = EventLogManagerEJBImpl.getOne();
if (event.isLoggingSupported()) {
LoggableInterface le = (LoggableInterface) event;
elMan.createLog(event, le.getSubject(), le.getLevelString(), true);
}
}
COM: <s> log the event if it supports logging </s>
|
funcom_train/4891718
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected R callBody() throws Exception {
R returnResult;
if (wrappedCallable != null) {
returnResult = wrappedCallable.call();
} else if (wrappedRunnable != null) {
wrappedRunnable.run();
returnResult = null;
} else {
throw new IllegalStateException("No wrapped runnable to run!");
}
return returnResult;
}
COM: <s> subclasses should override this method </s>
|
funcom_train/26369678
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private int delete(int loc) {
int len = getLength(loc);
int oldLen = getLength();
byte [] tmp = new byte [2*(oldLen-len)];
System.arraycopy(contents,0,tmp,0,2*loc);
System.arraycopy(contents,2*(loc+len),tmp,2*loc,2*(oldLen-loc-len));
contents = tmp;
return len; // How much was removed in short units
}
COM: <s> remove the form at the indicated location </s>
|
funcom_train/37841607
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected void receiveRequestReply(Handle handle, ClientRequest request) {
ServiceURI requestURI = request.getRequestURI();
//System.out.println("processing request reply from: "+request.getReplyURI());
//System.out.println("which is a match for: "+ requestURI);
handleManager.saveHandle(request.toString(), handle);
}
COM: <s> internal method to deal with an incomming service request responce from a provider </s>
|
funcom_train/495045
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void addColorString(String legendName, SubEntity subEntity, Color legendColor) {
if (legendStringList.contains(legendName))
return;
legendStringList.add(legendName);
legendMap.put(legendName, legendColor);
colorMap.put(legendColor, legendName);
subEntityList.add(subEntity);
if (legendModelListener != null)
legendModelListener.updateLegendModel();
}
COM: <s> this is how to put new values </s>
|
funcom_train/50390560
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private String getDetailMessage(Throwable throwable){
StringBuilder sb=new StringBuilder();
Throwable cause=throwable;
String message=null;
String type=null;type=cause.getClass().getName();
do{
type=cause.getClass().getName();
message=cause.getMessage();
cause=cause.getCause();
}
while(cause!=null);
if(message!=null)sb.append(type).append(": ").append(message);
else sb.append(type).append(" (no further message available)");
return sb.toString();
}
COM: <s> construct a hopefully useful error message from the root cause of an </s>
|
funcom_train/35731545
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected void copyToClipboard(InputStream inputStream, Display display) {
assert inputStream != null;
assert display != null;
Checksum checksum;
try {
checksum = Checksum.forInputStream(inputStream);
Clipboard clipboard = new Clipboard(display);
TextTransfer textTransfer = TextTransfer.getInstance();
clipboard.setContents(new Object[] { checksum.toString() },
new Transfer[] { textTransfer });
clipboard.dispose();
} catch (IOException e) {
e.printStackTrace();
}
}
COM: <s> copies the md5 checksum from created from the contents of the provided </s>
|
funcom_train/8262206
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected void bindTransactionInterceptor(MethodInterceptor txInterceptor) {
// We support forAll, and assume the user knows what he/she is doing.
for (ClassAndMethodMatcher matcher : transactionMatchers) {
bindInterceptor(matcher.getClassMatcher(), matcher.getMethodMatcher(), txInterceptor);
}
}
COM: <s> bind the transaction interceptor </s>
|
funcom_train/18238673
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void compareToFile(String myAnswer, String filePath) throws Exception{
//open this file that contains teh correct answer
FileInputStream fin = new FileInputStream(filePath);
int filesize = fin.available();
byte[] correctAnswer = new byte[filesize];
fin.read(correctAnswer);
assertTrue(new String(correctAnswer).equals(myAnswer));
}
COM: <s> compares the given string answer with the correct </s>
|
funcom_train/23180826
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void start() {
String chartSpec = getParameter("chart");
try {
Map params = Parameters.parseQueryString(chartSpec);
JFreeChart chart = ChartEngine.buildChart(params,
new Font("Dialog", Font.PLAIN, 12));
this.chartPanel.setChart(chart);
}
catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
COM: <s> starts the applet </s>
|
funcom_train/22927356
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected FloraIndentationModification pop(FloraToken currentToken) {
FloraIndentationModification mod = null;
if (currentToken.equals(FloraKeywords.COMMA)) {
if (indentations.size() > 0) {
mod = indentations.peek();
if (currentToken.equals(mod.getIndentationDecreaser()))
mod = indentations.pop();
}
} else {
do {
if (indentations.size() > 0)
mod = indentations.pop();
else {
mod = null;
break;
}
} while (!currentToken.equals( mod.getIndentationDecreaser()));
}
return mod;
}
COM: <s> pops the matching increaser token for the given token from </s>
|
funcom_train/27845741
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public TableCellRenderer getDefaultRenderer(Class columnClass) {
if (columnClass == null) {
return null;
} else if (columnClass.isAssignableFrom(TreeTableModel.class)) {
Object renderer = defaultRenderersByColumnClass.get(columnClass);
return (TableCellRenderer) renderer;
} else {
return super.getDefaultRenderer(columnClass);
}
}
COM: <s> gets the default renderer </s>
|
funcom_train/27842906
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void setView(View inView) {
if (inView == view) {
return;
}
if (view != null) {
hideView();
view.setController(null);
bindModelToView(view, null);
}
view = inView;
if (view != null) {
view.setController(this);
bindModelToView(view, model);
}
}
COM: <s> sets the view that this controller links to its model object </s>
|
funcom_train/6442497
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void test02_throwApplicationException(){
try{
ejbObject.throwApplicationException();
} catch (ApplicationException e){
//Good. This is the correct behaviour
return;
} catch (Throwable e){
fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
}
fail("An ApplicationException should have been thrown.");
}
COM: <s> throw an application exception and make sure the exception </s>
|
funcom_train/23411532
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected void addBuiltInPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_BuiltInAtom_builtIn_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_BuiltInAtom_builtIn_feature", "_UI_BuiltInAtom_type"),
SwrlPackage.Literals.BUILT_IN_ATOM__BUILT_IN,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the built in feature </s>
|
funcom_train/20885290
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void testSimpleFieldCSV() {
check(CSV, "valid;valid", SimpleFieldTestDTO.class, VALID);
check(CSV, ";invalid", SimpleFieldTestDTO.class, INVALID);
check(CSV, ";invalid", SimpleFieldTestDTO.class, VALIDATION_OFF);
}
COM: <s> tests validation for a simple field value csv </s>
|
funcom_train/28672934
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected void addKeyTypePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_MapType_keyType_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_MapType_keyType_feature", "_UI_MapType_type"),
BeansPackage.Literals.MAP_TYPE__KEY_TYPE,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the key type feature </s>
|
funcom_train/46759477
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public ISTreeModel getTree(ServiceCall call) throws Exception {
ISTreeModel treeModel = new ISTreeModel();
ISTreeNode hiddenRoot = new ISTreeNode();
treeModel.setRoot(hiddenRoot);
for (ISTreeNode node : getDialogTreeNodeChildren(null, call)) {
hiddenRoot.add(node);
// get two levels
node.addAll(getDialogTreeNodeChildren(node, call));
}
return treeModel;
}
COM: <s> get the tree model representation of the dialog builder tree </s>
|
funcom_train/13190034
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected int getRangeAxisIndex(ValueAxis axis) {
int result = this.rangeAxes.indexOf(axis);
if (result < 0) {
// try the parent plot
Plot parent = getParent();
if (parent instanceof XYPlot) {
XYPlot p = (XYPlot) parent;
result = p.getRangeAxisIndex(axis);
}
}
return result;
}
COM: <s> returns the index of the given range axis </s>
|
funcom_train/35559868
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void setAllFields(int firstLine, String tag, String newValue) {
int line_index = firstLine;
line_index = getLineContaining(line_index, "<" + tag + ">");
while (line_index != -1) {
setField(line_index, tag, newValue);
line_index++;
line_index = getLineContaining(line_index, "<" + tag + ">");
}
}
COM: <s> change all the fields with a given tag </s>
|
funcom_train/41440806
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected void afterSetCmpField() throws ManagementException {
if (logger.isDebugEnabled()) {
logger.debug("afterSetCmpField() on profile with name "+profileName+" of table "+profileTable.getProfileTableName());
}
try {
sleeContainer.getTransactionManager().suspend();
} catch (Throwable e) {
throw new ManagementException(e.getMessage(),e);
}
}
COM: <s> logic to execute after invoking a cmp setter method on the mbean </s>
|
funcom_train/20996313
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void invokeContractMethod(ContractOwner owner, int firstParam) {
boolean _static = isStatic() || owner.isStaticContract();
if(!_static)
loadThis();
if(firstParam != -1) {
loadLocal(indexContractContext);
loadLocal(firstParam);
}
loadArgs();
if(!_static) {
invokeVirtual(owner.getType(), owner.getMethod());
} else {
invokeStatic(owner.getType(), owner.getMethod());
}
}
COM: <s> calls a contract method so that its result a boolean is </s>
|
funcom_train/22209233
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected void clearChildren(Node contextNode) {
String xPathExpr = "*";
NodeList children = this.selectNodeList(xPathExpr);
int length = children.getLength();
for (int i = 0; i < length; i++) {
contextNode.removeChild(children.item(i));
}
}
COM: <s> removes all child elements from the specified context node </s>
|
funcom_train/30196777
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void testSetNomePatente() {
System.out.println("setNomePatente");
String nomePatente = "test";
Patente instance = new Patente();
instance.setNomePatente(nomePatente);
String result = instance.getNomePatente();
assertEquals("test", result);
}
COM: <s> test of set nome patente method of class com </s>
|
funcom_train/26401887
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void addFailure(Test test, Throwable t) {
// convert the stack trace
StringWriter writer = new StringWriter();
PrintWriter printer = new PrintWriter(writer);
writer.write(test.toString());
writer.write(": ");
t.printStackTrace(printer);
getTextArea().append(writer.toString());
}
COM: <s> add a failure to the </s>
|
funcom_train/36142623
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public boolean referredFilesChanged() throws MalformedURLException, IOException {
for (String file : referredFiles) {
if (FileUtils.isURI(file)) {
URLConnection url = new URL(file).openConnection();
if (url.getLastModified() > created)
return true;
} else if (FileUtils.isFile(file)) {
File f = new File(file);
if (f.lastModified() > created)
return true;
}
}
return false;
}
COM: <s> check if one of the referred files in the mapping has changed </s>
|
funcom_train/38290018
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void insertNode() {
if (node.getParentNode() != null)
throw new IllegalStateException(
"Node is present in the document"); //$NON-NLS-1$
final DomPointer ptr;
if (isParent) {
ptr = DomPointerFactory.create(where, (Node) null);
} else {
ptr = DomPointerFactory.create(where);
}
DOMMutils.insertNode(node, ptr, false);
}
COM: <s> inserts the node at given position </s>
|
funcom_train/44324269
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected String serializeBinaryDigest(byte[] binaryDigest) {
StringBuffer result = new StringBuffer();
for (int i = 0; i < binaryDigest.length; i++) {
int val = binaryDigest[i] & 0xFF;
String segment = Integer.toHexString(val);
if (val < 10)
result.append('0');
result.append(segment);
}
return result.toString();
}
COM: <s> method serialize binary digest </s>
|
funcom_train/28405137
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public ICommand getCommand(int index) throws java.lang.IndexOutOfBoundsException {
logger.debug("In getCommand. Index is " + index);
if((index < 0) || (index > commands.size())) {
throw new IndexOutOfBoundsException();
}
return(ICommand) commands.get(index);
}
COM: <s> code get command code gets the </s>
|
funcom_train/14160478
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public String toString(Source source) throws TransformerException {
if (source == null) {
return null;
} else if (source instanceof StringSource) {
return ((StringSource) source).getText();
} else {
StringWriter buffer = new StringWriter();
toResult(source, new StreamResult(buffer));
return buffer.toString();
}
}
COM: <s> converts the given input source into text </s>
|
funcom_train/46455509
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public double getYMax() {
if(markerShape==RE_IM_CURVE) {
return ampmax;
} else if(centered&&(markerShape==PHASE_BAR||markerShape==PHASE_CURVE)) {
return ampmax/2;
}
if(markerShape==PHASE_POST) {
return 1.1*ampmax;
} else {
return ampmax;
}
}
COM: <s> gets y world coordinate for the top of the panel </s>
|
funcom_train/47199090
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void getPlayerCoordinate() {
if (coordinateCount < 8) {
for (Iterator<Integer> playerPosIter = cordinates.keySet()
.iterator(); playerPosIter.hasNext();) {
Integer key = playerPosIter.next();
if (cordinates.get(key) == null) {
coordinateCount = key;
}
}
}
bufferedList.put(coordinateCount, cordinates.remove(coordinateCount));//remove when people go.
}
COM: <s> this method manipulates on which chair the new player will sit </s>
|
funcom_train/3549701
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public boolean isNextVersion(VersionedName nameToCompare) {
if (nameToCompare == null) {
throw new IllegalArgumentException("name to compare parameter is null");
}
if (nameToCompare.getName().equals(name)) {
if (nameToCompare.getVersion() == (version + 1) ) {
return true;
}
else {
return false;
}
}
else {
return false;
}
}
COM: <s> determines if the parameter passed in is the next version </s>
|
funcom_train/34675291
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void testCollectPremiumFail() throws Exception {
// create policy
Policy policy = new Policy();
policy.setId("pol1");
policy.setPolicyNumber("pol1");
policy.setStatus(PolicyStatus.ON_RISK);
// run command
CollectPremiumCommand command = (CollectPremiumCommand) getCore().newCommand("CollectPremiumService");
command.setPolicyArg(policy);
try {
command.invoke();
fail("collect premium should fail due to no payment details");
} catch (PreconditionException e) {
// ignore this - it's what we're looking for
}
}
COM: <s> test collect premium from on risk status no payment details </s>
|
funcom_train/38952837
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void stripClassAttributes(Document d) throws XPathExpressionException {
XPath xp = xpf.newXPath();
XPathExpression xpe = xp.compile("//@class");
NodeList nl = (NodeList)xpe.evaluate(d, XPathConstants.NODESET);
for (int i = 0; i < nl.getLength(); i++) {
Attr a = (Attr)nl.item(i);
a.getOwnerElement().removeAttribute(a.getName());
}
}
COM: <s> remoevs all class attributes from a document </s>
|
funcom_train/17286674
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected void fireDataReceived(byte[] data, int offset, int length) {
Object[] listeners = listenersList.getListenerList();
for (int i = listeners.length - 2; i >= 0; i -= 2)
if (listeners[i] == DataListener.class)
((DataListener) listeners[i + 1]).dataReceived(
new DataEvent(this, data, offset, length));
}
COM: <s> sends the data to all data listeners </s>
|
funcom_train/40424035
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public Collection getRecommendationForMovie(String movieName, int start){
int amount = m_dataController.getListLength();
PageSplitter<Recommendation> ps = new PageSplitter<Recommendation>();
return ps.splitCollectionToPages(m_recommendationHandler.getMovieRecommendations(movieName),start,amount);
}
COM: <s> get all the recommendations of movie name </s>
|
funcom_train/17026535
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public Model removeAllData(Model model) {
Model newModel = null;
switch (type) {
case SDB:
Store store = SDBFactory.connectStore(cachedStoreDesc);
store.getTableFormatter().truncate();
newModel = SDBFactory.connectDefaultModel(store);
break;
case TDB:
case RDB:
default:
model.removeAll();
newModel = model;
}
return newModel;
}
COM: <s> removes all the data from the model </s>
|
funcom_train/16394373
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void setAnonymousPermissions(AccessControlledEntry object, Long[] permissions) {
if (object != null) {
Query q = session.createQuery("delete from AnonymousAccessRule p where p.accessControlEntry = :OBJ");
q.setEntity("OBJ", object);
q.executeUpdate();
if (permissions != null) {
for (Long p : permissions) {
setAnonymousPermission(object, p);
}
}
}
}
COM: <s> set permissions for anonymous access for specified object </s>
|
funcom_train/12211885
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public UserVO authenticate (String login, String password) throws ConfigurationException {
switch(CommonConfiguration.getConfiguration().getAuthenticationType()) {
case LDAP:
return this.authenticateLDAP(login, password);
case NONE:
return this.authenticateNONE(login, password);
default:
throw new IllegalStateException("Unknown authentication type. Should never happens!");
}
}
COM: <s> authenticate a user </s>
|
funcom_train/31357719
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected void writePermissionFile(HashMap map, File file) {
// Variables
Writer writer;
XMLObject xml = null;
try {
// XMLObject.writeStream(new FileWriter(file), PropertyManager.map2XML(map));
writer = new FileWriter(file);
xml = PropertyXML.map2XML(map);
XMLObject.writeStream(writer, xml);
writer.close();
} catch (IOException e) {
} finally {
if (xml != null)
xml.consume();
}// try
} // writePermissionFile()
COM: <s> write permissions to file </s>
|
funcom_train/46747179
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void setUpdateDt(DateTimeModel updateDt) {
if (Converter.isDifferent(this.updateDt, updateDt)) {
DateTimeModel oldupdateDt= DateTimeModel.getNow();
oldupdateDt.copyAllFrom(this.updateDt);
this.updateDt.copyAllFrom(updateDt);
setModified("updateDt");
firePropertyChange(String.valueOf(REMINDERS_UPDATEDT), oldupdateDt, updateDt);
}
}
COM: <s> date the reminder was updated </s>
|
funcom_train/45719213
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public IntCollection intersect(Object o) {
IntCollection res = new IntCollection(true);
IntCollection test = new IntCollection(true, o);
int[] here = toIntArray();
for (int i = 0; i < here.length; i++) {
if (test.contains(here[i])) {
res.add(here[i]);
}
}
return res;
}
COM: <s> calculate the intersect of this collection with the other collection of </s>
|
funcom_train/7496178
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void shape(char[] source, int start, int length) throws ArabicShapingException {
if ((options & LAMALEF_MASK) == LAMALEF_RESIZE) {
throw new ArabicShapingException("Cannot shape in place with length option resize.");
}
shape(source, start, length, source, start, length);
}
COM: <s> convert a range of text in place </s>
|
funcom_train/51782677
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private double truncateToMinimumWidth(double diffx, BooleanHolder success) {
double dx = westernSwap(diffx);
if (node.getSize().getWidth() + dx < node.getMinimumSize().getWidth()) {
dx = node.getMinimumSize().getWidth() - node.getSize().getWidth();
success.setValue(true);
}
return westernSwap(dx);
}
COM: <s> truncate the specified diffx depending on the resizing direction </s>
|
funcom_train/18288664
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private boolean isValidSetName(String name) {
boolean isValid =
(name != null) &&
(name.trim().length() > 0);
for (int i = 0; isValid && (i < name.length()); i++) {
char c = name.charAt(i);
isValid =
(c == ' ') ||
(Character.isLetterOrDigit(c));
}
return isValid;
}
COM: <s> return a boolean indicating whether the specified set name </s>
|
funcom_train/41325957
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected void checkTransRank1(Matrix C) {
if (!isSquare())
throw new IndexOutOfBoundsException("!A.isSquare");
if (numRows != C.numColumns())
throw new IndexOutOfBoundsException("A.numRows != C.numColumns ("
+ numRows + " != " + C.numColumns() + ")");
}
COM: <s> checks that a transposed rank1 update is leagal with the given argument </s>
|
funcom_train/29038281
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private Item getVisibleAncestorOf(Item item) {
Item result = item;
final TreePath path = getTreePathFromItem(item);
if (path.getSegmentCount() > 1) {
for (int i = 0; i < path.getSegmentCount(); i++) {
final TreeItem ancestor = (TreeItem)findItem(path.getSegment(i));
if (!ancestor.getExpanded()) {
result = ancestor;
break;
}
}
}
return result;
}
COM: <s> returns a visible ancestor of the given item </s>
|
funcom_train/3707841
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public ByteArrayOutputStream toBAOS(){
ByteArrayOutputStream ret = new ByteArrayOutputStream();
ret.write(this.id);
ret.write(this.channel);
try{
ret.write(Convert.ShortToByteArray(thisSequence));
ret.write(Convert.ShortToByteArray(this.length));
// Rest of the BAOS
byte[] theRest = this.snac.toBAOS().toByteArray();
ret.write(theRest); // Now convert the SNAC
}
catch (IOException e){
System.err.println("FLAP toBAOS() IOException: " + e);
}
return ret;
}
COM: <s> converts this flap object to an array of bytes </s>
|
funcom_train/18755729
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected boolean suppressAttribute(GrammarSimpleType simpleType) {
String s = _node.getNodeName() + "." + simpleType.getName();
String t = (String) _hideAttrs.get(s);
if (t != null) {
MerlotDebug.msg("Suppressing attribute: " + s);
return true;
}
return false;
}
COM: <s> returns true if the attribute doesnt show in the editor display </s>
|
funcom_train/9774906
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: final public void setCoords(Ggb3DVector v, boolean doPathOrRegion) {
super.setCoords(v);
updateCoords();
if (doPathOrRegion){
// region
if (hasRegion()){
//Application.printStacktrace(getLabel());
region.pointChangedForRegion(this);
}
// path
if (hasPath()) {
// remember path parameter for undefined case
//PathParameter tempPathParameter = getTempPathparameter();
//tempPathParameter.set(getPathParameter());
path.pointChanged(this);
}
updateCoords();
}
}
COM: <s> sets homogenous coordinates and updates </s>
|
funcom_train/9543242
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void compileAllParents(Compileable comp) throws CompilerException {
// goto root
LinkedList<Compileable> complist = new LinkedList<Compileable>();
Compileable parent = comp.getParentCompileableObject();
while (parent != null) {
complist.addFirst(parent);
}
// now all parents from are in the list first is the root
Compileable c;
while (!complist.isEmpty()) {
c = complist.removeFirst();
compile(c);
}
}
COM: <s> compile all objects which are parents from comp </s>
|
funcom_train/4377668
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public int getInt(int index) throws RJSONException {
Object object = get(index);
try {
return object instanceof Number ?
((Number)object).intValue() :
Integer.parseInt((String)object);
} catch (Exception e) {
throw new RJSONException("JSONArray[" + index +
"] is not a number.");
}
}
COM: <s> get the int value associated with an index </s>
|
funcom_train/7850512
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private String getLastNsToken(QName n) {
String[] tokens = n.getNamespaceURI().split("[/.:]");
for( int i=tokens.length-1; i>=0; i-- ) {
if(tokens[i].length()!=0)
return NameConverter.standard.toVariableName(tokens[i]);
}
return null;
}
COM: <s> return a token from namespace uri </s>
|
funcom_train/47983010
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void initializeLayout() {
// for (GroupMember currMember : groupMembers) {
// if ((currMember.getGeoloc() != null) &&
// currMember.getGeoloc().hasGeoLocation()) {
// memberContainer.put(currMember.getJid(), new MemberData(
// currMember.getJid(), currMember.getGeoloc()
// .getLocation()));
// }
// }
}
COM: <s> transform the group members list to the slighter internal representation </s>
|
funcom_train/5395535
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void testGetIntValue() {
System.out.println("getIntValue");
DBPInteger instance = new DBPInteger();
int expResult = 0;
int result = instance.getIntValue();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
COM: <s> test of get int value method of class org </s>
|
funcom_train/31770462
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public String printAttribute() {
StringBuffer attribute = new StringBuffer();
Iterator attrs = this.attributes.keySet().iterator();
int numberOfAttribute = 0;
while(attrs.hasNext()) {
String attrName = (String)attrs.next();
attribute.append(this.attribute(attrName));
numberOfAttribute++;
}
return attribute.toString();
}
COM: <s> print the xml presentation of all attributes in this node </s>
|
funcom_train/2958323
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void propagateInfEvent(C evtCause) throws ContradictionException {
RealVarImpl v = getModifiedVar();
DisposableIterator<Couple<C>> cit = v.getActiveConstraints(evtCause);
try {
while (cit.hasNext()) {
Couple<C> cc = cit.next();
cc.c.awakeOnInf(cc.i);
}
} finally {
cit.dispose();
}
}
COM: <s> propagates the update to the lower bound </s>
|
funcom_train/8249874
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private String getJavaScriptMenuArray() {
String menuArray = "var aItems = [";
for (Iterator iter = configuration.getMenu().iterator(); iter.hasNext();) {
YUIContextMenuItem menuItem = (YUIContextMenuItem) iter.next();
menuArray += menuItem.toJavaScriptString();
if(iter.hasNext()) {
menuArray += ",";
}
}
return menuArray + "]; ";
}
COM: <s> creates a part of the script with the menu array </s>
|
funcom_train/48052860
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public OPCEventSubscriptionMgt getSubscriptionsMgt(boolean active, int dwBufferTime, int dwMaxSize, int opcHandle) throws IllegalArgumentException, UnknownHostException, JIException {
return new OPCEventSubscriptionMgt(createEventSubscription(active, dwBufferTime, dwMaxSize, opcHandle).getComObject());
}
COM: <s> get event subscription mgt object code iopcevent subscription mgt code </s>
|
funcom_train/11709401
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public boolean containsNode(String node) {
String[] nodes = new FlowNodes(getModelFlow()).getFlow();
if (null == nodes)
return false;
for (int i = 0; i < nodes.length; i++) {
if (node.equals(nodes[i]))
return true;
}
return false;
}
COM: <s> proofs if a node is contained in the list of nodes </s>
|
funcom_train/28476619
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void setUrl(String name, String url) {
Util.throwIfNull(name, "name");
if (name.equals("")) {
name = properties.getProperty(DATABASE_DEFAULT);
}
if (!name.equals("")) {
properties.setProperty(DATABASE_URL + "." + name, url);
} else {
properties.setProperty(DATABASE_URL, url);
}
}
COM: <s> sets the url value to the database </s>
|
funcom_train/8103713
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public TPage getPage() {
// wiki_text_word.page_id -> page.id
if(null != page)
return page;
// wiki_text_word.page_inflection_id -> page_inflection.id -> page.id
if(null != page_inflection)
return page_inflection.getPage();
return null;
}
COM: <s> gets page article entry from the table page </s>
|
funcom_train/18574400
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void setEnabledType(MysterType type, boolean enable) {
int index = getIndexFromType(type);
//errs
if (index == -1)
return; //no such type
if (types[index].getEnabled() == enable)
return;
types[index].setEnabled(enable);
saveEverythingToDisk();
dispatcher.fireEvent(new TypeDescriptionEvent(
(enable ? TypeDescriptionEvent.ENABLE
: TypeDescriptionEvent.DISABLE), this, type));
}
COM: <s> must be done on the event thread </s>
|
funcom_train/4614375
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected void destroyApp(boolean unconditional) throws MIDletStateChangeException {
ITriColorLED[] leds = MyTriColorLED.getLEDs(getSensorBoard().getLEDs());// getSensorBoard().getLEDs();
for (int i = 0; i < 8; i++){
leds[i].setOff(); // turn off all LEDs
}
}
COM: <s> called if the midlet is terminated by the system </s>
|
funcom_train/28553677
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public SalsaIdentificationEvaluation merge(SalsaIdentificationEvaluation sie) {
this.truePositives += sie.truePositives;
this.falsePositives += sie.falsePositives;
this.trueNegatives += sie.trueNegatives;
this.falseNegatives += sie.falseNegatives;
this.numOfSamples += sie.numOfSamples;
return this;
}
COM: <s> merge a given identification evaluation into this one </s>
|
funcom_train/44856323
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public String createCompletion(String inCompletion, String inQuestionID, int inState) throws VException, SQLException {
DomainObject lCompletion = getCompletionHome().create();
lCompletion.set(CompletionHome.KEY_COMPLETION, inCompletion);
lCompletion.set(CompletionHome.KEY_QUESTION_ID, new Long(inQuestionID));
lCompletion.set(CompletionHome.KEY_STATE, new Long(inState));
return lCompletion.insert(true).toString();
}
COM: <s> creates a completion with specified state and returns its id </s>
|
funcom_train/32909312
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public ArtifactList getParentDependentItems(int artifactId, ServiceCall call) throws java.rmi.RemoteException, DataAccessException, Exception {
try {
startService(call);
ArtifactList list = ada.getDependentParentArtifacts(artifactId);
setReference(list, artifactId);
stopService(call);
return list;
} catch (Exception ex) {
Debug.LogException(this, ex);
throw ex;
}
}
COM: <s> get items dependent on this artifact </s>
|
funcom_train/36558762
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void addEntity(Entity entity) {
synchronized (subEntities) {
entity.setParent(this);
entity.setWorldManager(worldManager);
subEntities.add(entity);
}
// If we have a world manager, we are live and therefore need
// to add via the world manager
if (worldManager != null) {
worldManager.addEntity(entity);
}
}
COM: <s> add a sub entity to this entity </s>
|
funcom_train/29269642
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public JMUnmarshaller getJMUnmarshaller() throws UnmarshalException {
Class c = getJMUnmarshallerClass();
if (c == null) {
throw new UnmarshalException("A JMUnmarshaller class is not set.");
}
try {
return (JMUnmarshaller) c.newInstance();
} catch (Exception e) {
throw new UnmarshalException("Failed to instantiate JMUnmarshaller class " + c, e);
}
}
COM: <s> p returns a new jmunmarshaller </s>
|
funcom_train/38735031
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void decreaseProjectLangNS(String projectName, String language, String ns) {
FilteredWMProject pr = projects.get(projectName.toUpperCase());
if (pr != null) {
pr.decreaseLangNS(language.toUpperCase(), ns.toUpperCase());
}
}
COM: <s> decreases in one unit the number of occurrences of the given namespace </s>
|
funcom_train/3277744
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void move(Point p) throws NoSuchNodeException {
// inform any arcs (that are connected with us) that we've moved
if (actionListener != null) {
actionListener.actionPerformed(
new ActionEvent(this, MOVE_EVENT, Integer.toString(node.getId())));
}
parentView.moveNode(this, p);
}
COM: <s> move node to point p </s>
|
funcom_train/10449871
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public String getName() {
StringBuilder name = new StringBuilder(getNamePrefix());
name.append('-');
if (getAddress() != null) {
name.append(getAddress());
name.append('-');
}
name.append(endpoint.getPort());
return ObjectName.quote(name.toString());
}
COM: <s> the name will be prefix address port if address is non null and </s>
|
funcom_train/20169293
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public Param arrayAtConst(ParamArray a, String b) {
if (a==null) {return null;} //not interested.
Param res = a.getElemValue(b);
if (res==null) {
a.addElem(b, createParam(a.getType().getComponentType(), b));
res = a.getElemValue(b);
}
assert res!=null;
return res;
}
COM: <s> select select elems a 137 </s>
|
funcom_train/46443448
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected void addToUndo() {
if (continuousAction) {
return;
}
if (undo == null) {
undo = new ArrayList();
}
addToStack(data_set, undo);
enableUndo(true);
if (redo == null) {
redo = new ArrayList();
}
redo.clear();
enableRedo(false);
}
COM: <s> adds a new action to the undo stack </s>
|
funcom_train/51811859
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void testAddListenerMultiArgNoContents() {
try {
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("classpath:oranjestad/spring/beanutils/messaging/xml/" + getName() + ".xml");
fail("Undetected error with invalid XML");
}
catch (BeanDefinitionParsingException e) {
}
}
COM: <s> test that if an arg is specified with no contents this is reported </s>
|
funcom_train/48945106
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void serviceFound(DNSSDService browser, int flags, int ifIndex, String serviceName, String regType, String domain) {
System.out.println("**Found Service** " + serviceName);
contactList.addContact(serviceName, domain, regType, ifIndex);
}
COM: <s> this callback is invoked when a node joins the network </s>
|
funcom_train/32767369
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected void applyBeanSettings() {
final Map<String,PropertyDescriptor> descriptorTable = getProperyDescriptorTable();
final Iterator<String> nameIter = BEAN_SETTINGS.keySet().iterator();
while( nameIter.hasNext() ) {
final String name = nameIter.next();
final PropertyDescriptor descriptor = descriptorTable.get( name );
final Object value = BEAN_SETTINGS.get( name );
try {
setPropertyValue( descriptor, value );
}
catch( Exception exception ) {
exception.printStackTrace();
}
}
}
COM: <s> apply the bean settings </s>
|
funcom_train/22122105
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void removeItem(ICDeploymentDescriptor pItem) {
String lKey = pItem.name;
for (int i = 0; i < getRowCount(); i++) {
if (getValueAt(i, 0).equals(lKey)) {
mItems.remove(pItem);
removeRow(i);
return;
}
}
}
COM: <s> remove a item of the table </s>
|
funcom_train/3409201
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected Object readResolve() throws ObjectStreamException {
try {
CertificateFactory cf = CertificateFactory.getInstance(type);
return cf.generateCertPath(new ByteArrayInputStream(data));
} catch (CertificateException ce) {
NotSerializableException nse =
new NotSerializableException
("java.security.cert.CertPath: " + type);
nse.initCause(ce);
throw nse;
}
}
COM: <s> returns a code cert path code constructed from the type and data </s>
|
funcom_train/50331448
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void setCommandStationType(XNetReply l) {
if(l.getElement(0)==XNetConstants.CS_SERVICE_MODE_RESPONSE)
{
// This is the Command Station Software Version Response
if(l.getElement(1)==XNetConstants.CS_SOFTWARE_VERSION)
{
cmdStationType=l.getElement(3);
}
}
}
COM: <s> set the cs type based on an xpress net message </s>
|
funcom_train/47277592
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void setDecimalPrecision(int theValue) {
_myDecimalPoints = theValue;
_myValueLabel = new Label(
""
+ (((adjustValue(_myMax)).length() > (adjustValue(_myMin)).length())
? adjustValue(_myMax)
: adjustValue(_myMin)),
color.colorValue);
_myValueLabel.set("" + adjustValue(_myValue));
}
COM: <s> sets the decimal precision of a controllers float value displayed </s>
|
funcom_train/37080255
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void setDatabases(ChadoDatabase[] databases) {
this.databases = databases;
// look for & set default db (used for command line)
for (int i=0; i<databases.length; i++) {
if (databases[i].isDefaultDatabase()) {
setDefaultDatabase(databases[i]);
return; // we're done
}
}
}
COM: <s> sets databases instance var sets default db if there is one </s>
|
funcom_train/1558794
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void actionPerformed(ActionEvent e) {
Object source = e.getSource();
if (source == btnHelpToggle) {
if(btnHelpToggle.isSelected()){
InputBarHelpPanel helpPanel = (InputBarHelpPanel) app.getGuiManager().getInputHelpPanel();
helpPanel.setLabels();
helpPanel.setCommands();
app.setShowInputHelpPanel(true);
}else{
app.setShowInputHelpPanel(false);
}
}
}
COM: <s> action listener implementation for input help panel toggle button </s>
|
funcom_train/12333609
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void indexAll() throws IOException {
boolean finished = false;
Long lastID = new Long(0);
indexed = 0;
do {
List<Account> users = myciteseer.getUsers(lastID, 1000);
finished = users.isEmpty();
if (!finished) {
indexUsers(users);
lastID = users.get(users.size()-1).getInternalId();
}
}while (!finished);
sendOptimize();
} //- indexAll
COM: <s> updates the index with records stored in the myciteseerx users table </s>
|
funcom_train/1553907
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void updateLabels(){
for (int i=0;i<outputList.size();i++){
if (!outputList.get(i).isLabelSet()){
if (indexLabel!=null){ //use indexed label
outputList.get(i).setLabel(outputList.get(i).getIndexLabel(indexLabel));
}else if (labels!=null&&i<labels.length)
outputList.get(i).setLabel(labels[i]);
else
outputList.get(i).setLabel(null);
}
}
}
COM: <s> assigns labels to unlabeled elements </s>
|
funcom_train/31800372
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public boolean saveEmail(String userId, String email ) {
boolean retVal;
retVal = true;
logger.info("UserProfile EJB activated (saveEmail). Processing demand.");
try {
UserProfileTO upTO = new UserProfileTO();
upTO.setEmail(email);
upTO.setUserProfile_id(userId);
upDAO.update(upTO);
} catch (DAOException e) {
retVal = false;
logger.info(e.getMessage());
}
logger.info("UserProfile EJB (saveEmail) finished.");
return retVal;
}
COM: <s> this method saves users email </s>
|
funcom_train/5787917
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void loadFile(String streamid, String file) {
File fin = new File(file);
try {
logger.debug("loading file :"+file);
BufferedReader in = new BufferedReader(new FileReader(fin));
String line;
while ((line = in.readLine()) != null) {
if(!line.equals(""))
Core.execute("setvalue "+streamid+" "+line);
}
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
COM: <s> loads a file and sequentially reads values one at a time </s>
|
funcom_train/34813048
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public int countNumberReads (ArrayList<PointData> pdAL){
if (pdAL == null || pdAL.size() == 0) return 0;
int num = pdAL.size();
int numberReads = 0;
for (int i=0; i< num; i++){
numberReads += pdAL.get(i).getInfo().getNumberObservations();
}
return numberReads;
}
COM: <s> counts number of reads </s>
|
funcom_train/5375796
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void setAntialias(int antialias) {
if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (data.gdipGraphics == 0 && antialias == SWT.DEFAULT) return;
/*
int mode = 0;
switch (antialias) {
case SWT.DEFAULT:
mode = Gdip.SmoothingModeDefault;
break;
case SWT.OFF:
mode = Gdip.SmoothingModeNone;
break;
case SWT.ON:
mode = Gdip.SmoothingModeAntiAlias;
break;
default:
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
initGdip(false, false);
Gdip.Graphics_SetSmoothingMode(data.gdipGraphics, mode);
*/
}
COM: <s> sets the receivers anti aliasing value to the parameter </s>
|
funcom_train/24414918
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void setScrollCount(int scrollCount) {
if (scrollCount <= 0) {
throw new IllegalArgumentException(
"scrollCount must be greater than 0");
}
this.scrollCount = scrollCount;
if (menu != null) {
menu.doClick();
}
MenuSelectionManager.defaultManager().clearSelectedPath();
}
COM: <s> sets the number of items in the scrolling portion of the menu </s>
|
funcom_train/2580184
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public RectangleEdge getRangeAxisEdge(int index) {
AxisLocation location = getRangeAxisLocation(index);
RectangleEdge result = Plot.resolveRangeAxisLocation(location,
this.orientation);
if (result == null) {
result = RectangleEdge.opposite(getRangeAxisEdge(0));
}
return result;
}
COM: <s> returns the edge for a range axis </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.