__key__ stringlengths 16 21 | __url__ stringclasses 1
value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/21913212 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addPropertyPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_PropertyRef_property_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_PropertyRef_property_feature", "_UI_PropertyRef_type"),
UIMPackage.Literals.PROPERTY_REF__PROPERTY,
true,
false,
true,
null,
null,
null));
}
COM: <s> this adds a property descriptor for the property feature </s>
|
funcom_train/46459558 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void writeDocType(Writer out) {
try {
output = new BufferedWriter(out);
output.write(XML.getDTD(getDoctype()));
output.flush();
output.close();
} catch(IOException ex) {
OSPLog.info(ex.getMessage());
}
}
COM: <s> writes the dtd to a writer </s>
|
funcom_train/9162651 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Interval merge( final Interval otherInt ) {
if( !canMergeWith( otherInt ) ) {
throw new IllegalArgumentException( "These Intervals cannot be merged" );
}
final int newMin = Math.min( min, otherInt.min );
final int newMax = Math.max( max, otherInt.max );
return new Interval( newMin, newMax );
}
COM: <s> returns the code interval code that results from merging this one </s>
|
funcom_train/43279309 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean hasId(final EClassifier classifier) {
if (classifier instanceof EClass) {
EClass class_ = (EClass) classifier;
Iterator it = class_.getEStructuralFeatures().iterator();
while (it.hasNext()) {
EcoreModelPart part = (EcoreModelPart) it.next();
if (part instanceof EAttribute && ((EAttribute) part).isID()) {
return true;
}
}
// ask super classifiers
return hasId(class_.getESuperTypes());
}
// does not have an id
return false;
}
COM: <s> has a classifier an id </s>
|
funcom_train/3400506 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public SDDocumentImpl updateDocs() {
for (SDDocumentSource doc : newDocs) {
SDDocumentImpl docImpl = SDDocumentImpl.create(doc,serviceName,portTypeName);
if (doc == concreteWsdlSource) {
concreteWsdl = docImpl;
}
docs.add(docImpl);
}
return concreteWsdl;
}
COM: <s> converts sddocument source to sddocument impl and updates original docs </s>
|
funcom_train/10372273 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void doStart() throws Exception {
if (started.compareAndSet(false, true)) {
newSocket();
Thread listenerThread = new Thread(listener);
listenerThread.setName("MulticastDiscovery: Listener");
listenerThread.setDaemon(true);
listenerThread.start();
Broadcaster broadcaster = new Broadcaster();
Timer timer = new Timer("MulticastDiscovery: Broadcaster", true);
timer.scheduleAtFixedRate(broadcaster, 0, heartRate);
}
}
COM: <s> start the discovery agent </s>
|
funcom_train/44871252 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JFileChooser getTemplateFileChooser() {
if (templateFileChooser == null) {
templateFileChooser = new JFileChooser();
templateFileChooser.setFileFilter(new FileFilter() {
@Override
public boolean accept(File f) {
if (f.isDirectory())
return true;
String s = FunctionsFormatFrame.getExtension(f);
if (s == null)
return false;
return s.equalsIgnoreCase("wgt");
}
@Override
public String getDescription() {
return "WCMGrapher Template";
}
});
}
return templateFileChooser;
}
COM: <s> this method initializes template file chooser </s>
|
funcom_train/47135599 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addTradingStartTimePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Symbol_tradingStartTime_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Symbol_tradingStartTime_feature", "_UI_Symbol_type"),
TradingPackage.Literals.SYMBOL__TRADING_START_TIME,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the trading start time feature </s>
|
funcom_train/27836499 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JMenuItem getReloadMercatorMenuItem() {
if (reloadMercatorMenuItem2 == null) {
reloadMercatorMenuItem2 = new JMenuItem();
reloadMercatorMenuItem2.setText("Reload Mercator model");
reloadMercatorMenuItem2
.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
notifyObservers(new InitializeRequestCommand());
}
});
}
return reloadMercatorMenuItem2;
}
COM: <s> this method initializes reload mercator menu item2 </s>
|
funcom_train/24059186 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void undo() {
try {
// Undo the latest step first:
Iterator<Step> iterator = _steps.descendingIterator();
while (iterator.hasNext()) {
Step step = iterator.next();
if (step._type == Step.Type.INSERT) {
_annotations.removeLastOccurrence(step._annotation);
}
else if (step._type == Step.Type.REMOVE) {
_annotations.add(step._index, step._annotation);
}
}
} catch (IndexOutOfBoundsException e) {
throw new IllegalStateException();
}
}
COM: <s> undoes this action </s>
|
funcom_train/50248102 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected int searchForClosingPeer(int offset, int openingPeer, int closingPeer, IDocument document) throws IOException {
fReader.configureForwardReader(document, offset + 1, document.getLength(), true, true);
int stack= 1;
int c= fReader.read();
while (c != PythonCodeReader.EOF) {
if (c == openingPeer && c != closingPeer)
stack++;
else if (c == closingPeer)
stack--;
if (stack == 0)
return fReader.getOffset();
c= fReader.read();
}
return -1;
}
COM: <s> seaches for the closing peer relative to the starting offset </s>
|
funcom_train/48151193 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double getCDF(double x) {
NormalDistribution ND = new NormalDistribution(0,1);
return ND.getCDF((x/mu - 1)*Math.sqrt(lambda/x)) +
Math.exp(2*lambda/mu)*ND.getCDF(-(x/mu + 1)*Math.sqrt(lambda/x));
}
COM: <s> this method computes the cumulative distribution function this is known in closed form </s>
|
funcom_train/32635913 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testUpdate() {
// Save the Volunteer to the database
v.save();
// Find the Volunteer in the database.
Volunteer[] matches = v.find();
// Modify the Volunteer.
matches[0].setEMailAddress("jbaldassari@gmail.com");
// Update the volunteer in the database.
matches[0].update();
// Get all Volunteers (should only be 1)
matches = null;
matches = Volunteer.findAll();
// Verify that it contains the correct information.
assertTrue(matches.length == 1);
assertTrue(matches[0].getEMailAddress().equals("jbaldassari@gmail.com"));
}
COM: <s> test modifying a volunteer </s>
|
funcom_train/25494158 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setBorderDashed(boolean borderDashed) {
if (!isEditable() || borderDashed == this.borderDashed) {
return;
}
this.borderDashed = borderDashed;
fireModelChangeEvent(new ModelEvent(this, ModelEventDescriptor.MODEL_PRIMITIVE_CHANGED, borderDashed, !borderDashed));
}
COM: <s> sets if border is dashed </s>
|
funcom_train/39278835 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Enumeration enumerateAttributeNames() {
Vector result = new Vector();
Enumeration en = this.attributes.elements();
while (en.hasMoreElements()) {
XMLAttribute attr = (XMLAttribute) en.nextElement();
result.addElement(attr.getFullName());
}
return result.elements();
}
COM: <s> returns an enumeration of all attribute names </s>
|
funcom_train/3079758 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void halt() {
while ((state == PIVOTING_RIGHT) || (state == PIVOTING_LEFT)) {
try {
Thread.sleep((int) host.getDelay());
} catch (InterruptedException e) {
e.printStackTrace();
}
}
setState(STOPPED);
leftWheel.setInputRPM(0);
rightWheel.setInputRPM(0);
}
COM: <s> stops the robot from moving unless the robot is pivoting </s>
|
funcom_train/18568976 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void upgradeLsys0L_0_2_7(Lsys0LImage image) throws JAXBException {
if(image.getChromosome().getBaseIndex() == null) {
IntegerGene baseIndex = objectFactory.createIntegerGene();
baseIndex.setValue(0);
image.getChromosome().setBaseIndex(baseIndex);
}
}
COM: <s> upgrade lsys0 l to version 0 </s>
|
funcom_train/19309057 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void parseDocument() throws FOrayException {
final XMLReader parser = createParser();
try {
parser.parse(this.filename);
} catch (final SAXException e) {
if (e.getException() instanceof FOrayException) {
throw (FOrayException) e.getException();
}
throw new FOrayException(e);
} catch (final IOException e) {
throw new FOrayException(e);
}
}
COM: <s> parses the encapsulated sax input source and updates the encapsulated </s>
|
funcom_train/37592398 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void selectDocument(ItemT doc) {
/* */ assert Utilities.TEST_MODE || EventQueue.isDispatchThread();
boolean found;
// synchronized(_model) {
if (_current == doc) return; // doc is already _current (the active doc)
found = _model.contains(doc);
// }
if (found) setSelectedValue(doc, true);
// _current = doc; // already done by ListSelectionEvent listener created in init()
// }
COM: <s> sets the specified document as selected in the navigator </s>
|
funcom_train/37739946 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeProcesses() throws Exception {
Util.logEntry("removeProcesses");
int noprocs = procDir.processes().size();
Iterator procs = createdProcs.iterator ();
while (procs.hasNext()) {
//WfProcess proc = (Process)procs.next();
WrappedProcess proc = (WrappedProcess)procs.next();
Util.sleep(15000);
procDir.removeProcess(proc.getWfProcess());
}
assertTrue
(procDir.processes().size() == noprocs - createdProcs.size ());
createdProcs.clear();
Util.logExit("removeProcesses");
}
COM: <s> test removal of all previously created processes </s>
|
funcom_train/7589398 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean add(Solution solution) {
if (solutionsList_.size() == capacity_) {
Configuration.logger_.severe("The population is full");
Configuration.logger_.severe("Capacity is : "+capacity_);
Configuration.logger_.severe("Size is: "+ this.size());
return false;
} // if
solutionsList_.add(solution);
return true;
} // add
COM: <s> inserts a new solution into the solution set </s>
|
funcom_train/20307296 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean unify(Node n1, Node n2) {
Node dn1 = getGroundVersion(n1);
Node dn2 = getGroundVersion(n2);
if (dn1 instanceof Node_RuleVariable) {
bind(dn1, dn2);
return true;
} else if (dn2 instanceof Node_RuleVariable) {
bind(dn2, dn1);
return true;
} else {
return dn1.sameValueAs(dn2);
}
}
COM: <s> unify two nodes neither can be a literal </s>
|
funcom_train/19456691 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean is2ImgOrder() {
return filename.toLowerCase().endsWith(".2img") //$NON-NLS-1$
|| filename.toLowerCase().endsWith(".2img.gz") //$NON-NLS-1$
|| filename.toLowerCase().endsWith(".2mg") //$NON-NLS-1$
|| filename.toLowerCase().endsWith(".2mg.gz"); //$NON-NLS-1$
}
COM: <s> indicate if this disk is a 2 img disk </s>
|
funcom_train/41101455 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean componentStop() {
try {
System.out.println("exiting");
state = STOPPED;
if (IEventSubscriber.class.isInstance(this)) {
eventManager.removeLocalSubscriber((IEventSubscriber) this);
}
reconfigurationEngine.removeComponent(this);
return true;
} catch (Exception e) {
return false;
}
}
COM: <s> stops this component </s>
|
funcom_train/20270258 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void runCustomPasses(CustomPassExecutionTime executionTime) {
if (options.customPasses != null) {
Tracer t = newTracer("runCustomPasses");
try {
for (CompilerPass p : options.customPasses.get(executionTime)) {
process(p);
}
} finally {
stopTracer(t, "runCustomPasses");
}
}
}
COM: <s> runs custom passes that are designated to run at a particular time </s>
|
funcom_train/36888269 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public TransitCornView converterTransitCornDtoToView(TransitCornDTO dto){
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMinimumFractionDigits(2);
numberFormat.setMaximumFractionDigits(2);
TransitCornView transitCornView = null;
transitCornView = new TransitCornView();
transitCornView.setPoNumber(dto.getPoNumber());
transitCornView.setQuantity(numberFormat.format(dto.getQuantity()));
transitCornView.setPlace(dto.getPlace());
return transitCornView;
}
COM: <s> transit corn converter dto to view </s>
|
funcom_train/11023375 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testEvaluateWithNullInPath() {
BeanPropertyValueEqualsPredicate predicate =
new BeanPropertyValueEqualsPredicate("anotherNested.stringProperty","foo");
try {
// try to evaluate the predicate
predicate.evaluate(new TestBean());
fail("Should have throw IllegalArgumentException");
} catch (IllegalArgumentException e) {
/* ignore this is what should happen */
}
}
COM: <s> test evaluate with null in property path and ignore false </s>
|
funcom_train/2502283 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public DERObject getExtensionValue(String oid){
byte[] extvalue = certificate.getExtensionValue(oid);
if (extvalue == null) {
return null;
}
try {
DEROctetString oct = (DEROctetString) (new ASN1InputStream(extvalue).readObject());
return (new ASN1InputStream(oct.getOctets()).readObject());
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
COM: <s> returns the derobject for the informed oid br </s>
|
funcom_train/45045841 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setColumnMargin() {
int columnMargin = getColumnModel().getColumnMargin();
Iterator<ColumnGroup> iter = ((GroupableTableColumnModel) columnModel).columnGroupIterator();
while (iter.hasNext()) {
ColumnGroup cGroup = iter.next();
cGroup.setColumnMargin(columnMargin);
}
}
COM: <s> sets the margins correctly for all groups within </s>
|
funcom_train/15512844 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String format(FileNamePattern pattern) {
if(( pattern == null ) || (pattern.getPattern().length() > 256)) return "";
StringBuffer buffer = new StringBuffer( (pattern.isRegex()) ? "R" : "S" );
buffer.append(":").append( pattern.getPattern() );
return buffer.toString();
}
COM: <s> formats a file name pattern instance into a string </s>
|
funcom_train/46433815 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Object getAttributeForReport(String reportName, String attributeName, HashMap jasperReportsLocal) {
Object retVal = null;
HashMap reportParam = (HashMap) jasperReportsLocal.get(reportName);
if (reportParam != null) {
retVal = reportParam.get(attributeName);
}
return retVal;
}
COM: <s> this method delivers the attributestring asked for out of the jasper reports hashmap </s>
|
funcom_train/48631121 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void putCAPSerialized(byte[] serial, String nwsid) {
logger.trace("In putCAPSerialized()");
try {
mDb.execSQL("INSERT INTO " + CAP_TABLE + " (" + KEY_SERIALIZED
+ ", " + KEY_NWSID + ") VALUES ( ?, ? )", new Object[] {
serial, nwsid });
} catch (SQLException e) {
logger.warn("execute insert: " + e.toString());
}
return;
}
COM: <s> put a serialized cap entry into the database </s>
|
funcom_train/13390662 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected double getBottomLineValue() {
double bottomLineValue = mean - 3 * stdDev;
bottomLineValue = Math.min(bottomLineValue, min);
if(!Double.isNaN(lowThreshold)) {
bottomLineValue = Math.min(bottomLineValue, lowThreshold);
}
return bottomLineValue;
}
COM: <s> get the value for the bottom y axis </s>
|
funcom_train/10660831 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testNameQu_4() throws Exception {
String dn = "CN=\"A\\\", C=B\"";
X500Principal principal = new X500Principal(dn);
String s = principal.getName(X500Principal.RFC1779);
assertEquals("CN=\"A\\\", C=B\"", s);
}
COM: <s> inits x500 principal with the string with special characters a c b </s>
|
funcom_train/16392653 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void remove( Vertex v ) throws Exception {
beforeRemoveEdges(v,true);
GraphRemoveVertexEvent event = new GraphRemoveVertexEvent(this,v);
invokeRemoveVertexListeners(event,true);
// we have the go-ahead from all before-listeners; now do the real work
removeEdgesUnconditionally(v,true);
vertexDataMap.remove(v);
invokeRemoveVertexListeners(event,false);
}
COM: <s> this implementation of remove should not normally be </s>
|
funcom_train/31158485 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isGenerationNeeded(String fullClassName, String fullTestCaseName) {
boolean returnValue;
returnValue = isBuildAll();
returnValue = returnValue || !getWritingStrategy().isExistingAndNewer(getOutputRoot(),
fullTestCaseName,
getSourcePath(),
fullClassName);
return returnValue;
}
COM: <s> checks if file of application class is modified later than test case file </s>
|
funcom_train/2731493 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public VariableSet visit(CaseTerm caseTerm) {
VariableSet freeVars = new VariableSet();
freeVars.addAll(visit(caseTerm.getComparedTerm()));
freeVars.addAll(visit(caseTerm.getComparingTerm()));
freeVars.addAll(visit(caseTerm.getResultTerms()));
if (caseTerm.getOtherwiseTerm() != null) {
freeVars.addAll(visit(caseTerm.getOtherwiseTerm()));
}
return freeVars;
}
COM: <s> gets the free variables contained in the given case term </s>
|
funcom_train/36684678 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void notifyIfOnline(String userName, String friend) {
if (listeningToSocket(friend)) {
if (listeningToSocket(userName)) {
ObjectOutputStream out;
try {
out = getOutStream(userName);
out.writeObject(new VoogaChatMessage(
VoogaChatClient.FRIEND_UPDATE_CHANNEL,
VoogaChatClient.ONLINE, friend));
} catch (IOException e) {
// TODO handle this.
}
}
}
}
COM: <s> notifies user name if friend is online on friend update channel </s>
|
funcom_train/17204568 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public RVMMethod peekResolvedMethod() {
if (resolvedMember != null) return resolvedMember;
// Hasn't been resolved yet. Try to do it now without triggering class loading.
RVMType declaringClass = type.peekType();
if (declaringClass == null) return null;
return resolveInternal((RVMClass)declaringClass);
}
COM: <s> find the rvmmethod that this method reference refers to using </s>
|
funcom_train/37513970 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void generateClassListing() {
generateClassKindListing(packagedoc.interfaces(),
getText("doclet.Interfaces"));
generateClassKindListing(packagedoc.ordinaryClasses(),
getText("doclet.Classes"));
generateClassKindListing(packagedoc.exceptions(),
getText("doclet.Exceptions"));
generateClassKindListing(packagedoc.errors(),
getText("doclet.Errors"));
generateGFListing("Generic Functions");
}
COM: <s> generate class listing for all the classes in this package </s>
|
funcom_train/2967335 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isInTheVicinityOfTheLabel(Point2D mouseClick) {
// Rectangle2D boundingRectangle = new Rectangle(LINE_START_X - 5,
// LINE_START_Y - 5, LINE_END_X - LINE_START_X + 10, 10);
if (m_labelBoundingBox == null)
return false;
return (m_labelBoundingBox.contains(mouseClick));
}
COM: <s> determines if the specified point is on or near the height control </s>
|
funcom_train/20980709 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean sendChatMessage(int kind, String message, int playerID, int gameId) {
// hier wird die Chat Nachricht geschickt
try {
conn.write(new ChatMessage(kind, message, playerID, gameId));
} catch (Exception e) {
Logger.log(e);
}
return true;
}
COM: <s> sends a chat message to the bug wars lobby </s>
|
funcom_train/24233991 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void sendUdtPacket(byte[]data, int timeout, TimeUnit units)throws IOException, InterruptedException{
if(!started)start();
DataPacket packet=null;
do{
packet=flowWindow.getForProducer();
if(packet==null){
Thread.sleep(10);
// System.out.println("queue full: "+flowWindow);
}
}while(packet==null);
try{
packet.setPacketSequenceNumber(getNextSequenceNumber());
packet.setSession(session);
packet.setDestinationID(session.getDestination().getSocketID());
packet.setData(data);
}finally{
flowWindow.produce();
}
}
COM: <s> writes a data packet waiting at most for the specified time </s>
|
funcom_train/8775662 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void process(ArrayList<Sentence> sentences) throws LogicException {
// Process only unknown tokens
for(Sentence sentence : sentences) {
ArrayList<Token> tokens = sentence.getTokens();
for(Token token : tokens) {
// Check token
if(isSocialSecurityNumber(token)) {
if (ignoreList == null || (ignoreList != null && !ignoreList.contains(token.getContent()))) {
anonymize(token);
}
}
}
}
}
COM: <s> anonymizes social security numbers </s>
|
funcom_train/17672619 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void swapLeftAndRight() {
super.swapLeftAndRight();
switch (op) {
case GT: op = LT; break;
case LT: op = GT; break;
case GE: op = LE; break;
case LE: op = GE; break;
default:
throw BindingSupportImpl.getInstance().internal("Unknown op: " +
toOpString(op));
}
}
COM: <s> swap left and right nodes </s>
|
funcom_train/8079277 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean containsKey(double key) {
TableEntry [] table = m_Table;
int hash = hashCode(key);
int index = (hash & 0x7FFFFFFF) % table.length;
for (TableEntry e = table[index] ; e != null ; e = e.next) {
if ((e.hash == hash) && (Math.abs(e.key - key) < EPSILON)) {
return true;
}
}
return false;
}
COM: <s> tests if the specified double is a key in this hashtable </s>
|
funcom_train/1872473 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int next() {
if( pointer < 1 ) throw new NoSuchElementException();
double d = sum*r.nextDouble();
int i = pointer;
double tmp = weights[i-1];
while( tmp < d && i>1 ) tmp += weights[--i-1];
// now i-1 is the selected element, we shift it to next position
int a = buffer[i-1];
double b = weights[i-1];
buffer[i-1] = buffer[pointer-1];
weights[i-1] = weights[pointer-1];
buffer[pointer-1] = a;
weights[pointer-1] = b;
sum -= b;
return buffer[--pointer];
}
COM: <s> the first sample is drawn according to the probability distribution </s>
|
funcom_train/35157971 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setSpotDirection(float[] spotDirection) {
if (this.attachedGL != null)
this.attachedGL.glLightfv(numToID(lightNumber),GL.GL_SPOT_DIRECTION,spotDirection,0);
this.spotDirection = spotDirection.clone();
}
COM: <s> sets the spotlight direction for this light </s>
|
funcom_train/39953133 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean removeIncomingTransition(TransitionImpl transition) {
if ( (transition!=null)
&& (incomingTransitions!=null)
&& (incomingTransitions.remove(transition))
) {
transition.setDestination(null);
if (incomingTransitions.isEmpty()) {
incomingTransitions = null;
}
return true;
}
return false;
}
COM: <s> removes the given transition if it is contained in the arriving </s>
|
funcom_train/39238644 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public FreedbRecord read(String category, String discId) throws FreedbException {
FreedbRecord rec = null;
if (sendCommand("cddb read " + category + " " + discId, response) != null) {
// LOG.info("read: ok");
String code = response.getCode();
if ("210".equals(code)) {
rec = FreedbRecord.parse(response.getResponse());
}
}
return rec;
}
COM: <s> sends the em cddb read em command to the server </s>
|
funcom_train/16307528 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public AbstractLoop getLoop(String loopName) {
AbstractEntity e = getRootEntity();
while (!(e instanceof AbstractLoop)
|| !(e.getName().equals(loopName))) {
if (e.nestedEntity instanceof AbstractCommand) {
// We've reached the command, we can't find loop anymore.
return null;
}
else {
e = e.nestedEntity;
}
}
return (AbstractLoop)e;
}
COM: <s> gets the loop with the given name in the </s>
|
funcom_train/1342982 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public InputStream getInputStream() {
if (file!= null && file.isFile()) {
try {
return new FileInputStream(file);
} catch (FileNotFoundException e) {
logger.info(e.toString());
return null;
}
} else if (byteData!=null) {
return new ByteArrayInputStream(byteData);
} else {
return null;
}
}
COM: <s> gets a stream on the file data or null if </s>
|
funcom_train/11687761 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public long getFaultsReceiving() {
if (endpoint.getChildren() != null) {
long faultsReceiving = 0;
for (Endpoint e : endpoint.getChildren()) {
if (e.getMetricsMBean() != null) {
faultsReceiving += e.getMetricsMBean().getFaultsReceiving();
}
}
return faultsReceiving;
} else {
return faultsReceiving;
}
}
COM: <s> number of faults receiving replies </s>
|
funcom_train/18117347 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected JPanel buildGUI() {
JPanel tempPanel = new JPanel();
tempPanel.setLayout(new GridLayout(0, 2, 15, 0));
tempPanel.add(buildAddressPanel());
tempPanel.add(buildCommsPanel());
tempPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10));
// up,left,down,right
return tempPanel;
}
COM: <s> builds the main gui </s>
|
funcom_train/15896440 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Vector unMarshallUserKeys(String keyname) {
Vector vec = null;
StringTokenizer st;
st = new StringTokenizer(keyname, " ");
vec = new Vector();
while (st.hasMoreTokens()) {
String string = st.nextToken();
vec.add(string);
}
return vec;
}
COM: <s> this function is to unmarshall a string to retrieve the </s>
|
funcom_train/22467854 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean hasSubjectWeight(UserId user, IRatableItem item) {
List<String> subjects = ratable2InterestAdapter.getSubjects(item);
boolean has_weight = false;
if (subjects.size() > 0) {
String a_subject = (String) subjects.get(0); // Simply the first
has_weight = interestModel.isInterestDefined(user, a_subject);
}
return has_weight;
}
COM: <s> determines whether the first subject of a given content item is defined </s>
|
funcom_train/19239664 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Dimension preferredLayoutSize(Container parent) {
Dimension d = new Dimension();
for(int componentIndex=0; componentIndex<parent.getComponents().length; componentIndex++){
Component c = parent.getComponents()[componentIndex];
d.height += c.getPreferredSize().height;
d.width = Math.max(c.getPreferredSize().width, d.width);
}
return d;
}
COM: <s> calculates the preferred size dimensions for the specified panel </s>
|
funcom_train/8901596 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String num2ByteID(int num, char[] IDChars, int IDWidth) {
char ID[] = new char[IDWidth];
int i;
for (i = IDWidth - 1; i >= 0; i--) {
ID[i] = IDChars[num % IDChars.length];
num = num / IDChars.length - 1;
if (num < 0) {
break;
}
}
for (i--; i >= 0; i--) {
ID[i] = ' ';
}
return new String(ID);
}
COM: <s> method for generating indices for the confusion matrix </s>
|
funcom_train/48793171 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Class getClassObject() {
Class retClass = (Class) classRef.get();
if (retClass == null) {
try {
retClass = Class.forName(name);
classRef = new SoftReference(retClass);
} catch (ClassNotFoundException e) {
throw new ClassLostException(name);
}
}
cacheRef.add(retClass);
return retClass;
}
COM: <s> method get class object </s>
|
funcom_train/32759615 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setStateAction(Integer intValState) {
this.intState = intValState;
this.checkErrorDisplay(intValState);
ActionEvent evtAction = new ActionEvent(this, intValState, "State Selected");
for (ActionListener lsn : this.lstLsnSelect)
lsn.actionPerformed(evtAction);
}
COM: <s> selects the desired state value from inside the gui </s>
|
funcom_train/40671467 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void rescueMethodsIfInstantiable(JReferenceType type) {
if (instantiatedTypes.contains(type)) {
for (JMethod method : type.methods) {
if (!method.isStatic()) {
if (methodsLiveExceptForInstantiability.contains(method)) {
rescue(method);
continue;
}
}
}
}
}
COM: <s> if the type is instantiable rescue any of its virtual methods that a </s>
|
funcom_train/2676468 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean setAttribute(String name, Object value) {
if (name == null) {
return false;
}
if (value == null) {
// Remove value
return (attributes.remove(name) != null);
} else {
// Update with new value
Object previous = attributes.put(name, value);
return (previous == null || value == previous || !value.equals(previous));
}
}
COM: <s> set an attribute on this object </s>
|
funcom_train/17206913 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void scanObject(TransitiveClosure trace, ObjectReference object) {
int refs = ObjectModel.getRefs(object);
Address first = object.toAddress().plus(ObjectModel.REFS_OFFSET);
for (int i=0; i < refs; i++) {
trace.processEdge(object, first.plus(i << LOG_BYTES_IN_ADDRESS));
}
}
COM: <s> delegated scanning of a object processing each pointer field </s>
|
funcom_train/26397229 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void sendFileToFTPPath(final String text, final String path) throws CruiseControlException {
final ByteArrayInputStream bais = new ByteArrayInputStream(text.getBytes());
final FTPClient ftp = openFTP();
// we're sending text; don't set binary!
try {
makeDirsForFile(ftp, path, null);
sendStream(ftp, bais, path);
} finally {
closeFTP(ftp);
}
}
COM: <s> sends the specified text into the specified path on the ftp server </s>
|
funcom_train/40856272 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Query getRangeQuery(QParser parser, SchemaField field, String part1, String part2, boolean minInclusive, boolean maxInclusive) {
// constant score mode is now enabled per default
return new TermRangeQuery(
field.getName(),
part1 == null ? null : toInternal(part1),
part2 == null ? null : toInternal(part2),
minInclusive, maxInclusive);
}
COM: <s> returns a query instance for doing range searches on this field type </s>
|
funcom_train/19564194 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void normalize() {
cern.jet.math.Functions F = cern.jet.math.Functions.functions;
double max=this.aggregate(F.maxNaN, F.identityNaN);
double min=this.aggregate(F.minNaN, F.identityNaN);
this.assign(F.minus(min));
this.assign(F.div(max-min));
}
COM: <s> normalize matrix values in place to 0 </s>
|
funcom_train/41064132 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private AbstractStatusChecker generateStatusChecker(int schoolid) {
if(guids.containsKey(schoolid)) {
Aces2SchoolBean schoolBean = guids.get(schoolid);
return new Aces2Logic(schoolBean.getHost(), schoolBean.getFullPath());
} else {
switch(schoolid) {
case 35: //virginia
return new VirginiaLogic();
case 36: //cornell
return new CornellLogic();
case 37: //columbia
return new ColumbiaLogic();
default: return null;
}
}
}
COM: <s> a helper method that generates a suitable status checker logic </s>
|
funcom_train/13390909 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initialize() throws Exception {
if (websterConfigParameters == null) {
websterConfigParameters = new WebsterConfigParameters(this);
}
String root = System.getProperty("net.assimilator.webster.root");
if (root == null) {
root = System.getProperty("user.dir");
websterConfigParameters.setRootString(root);
}
initialize(root);
}
COM: <s> initialize webster serving code as determined by the either the </s>
|
funcom_train/1789821 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public PeriodFormatter toFormatter() {
PeriodFormatter formatter = toFormatter(iElementPairs, iNotPrinter, iNotParser);
FieldFormatter[] ret = new FieldFormatter[ iFieldFormatters.length];
ArrayUtils.copyArray(iFieldFormatters, ret);
iFieldFormatters = ret;
return formatter;
}
COM: <s> constructs a period formatter using all the appended elements </s>
|
funcom_train/10583570 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void generate() throws IOException, ProcessingException {
try {
InputStream inputStream = httpRequest.getInputStream();
try {
processStream(inputStream);
} finally {
if (inputStream != null) {
inputStream.close();
}
}
} catch (IOException e) {
getLogger()
.debug(
"Received an IOException, assuming client severed connection on purpose");
}
}
COM: <s> generates the requested resource </s>
|
funcom_train/23234060 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void notifyDead(Creature dead) {
Log4J.startMethod(logger, "notifyDead");
if (!respawning) {
// start respawning a new creature
respawning = true;
TurnNotifier.get().notifyInTurns(Rand.rand(respawnTime, respawnTime / 30), this);
}
creatures.remove(dead);
Log4J.finishMethod(logger, "notifyDead");
}
COM: <s> notifies this respawn point about the death of a creature that </s>
|
funcom_train/26313206 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void initializeListeners() {
client.game.addGameListener(this);
clientgui.getBoardView().addBoardViewListener(this);
clientgui.bv.addKeyListener(this);
addKeyListener(this);
// mech display.
clientgui.mechD.wPan.weaponList.addItemListener(this);
clientgui.mechD.wPan.weaponList.addKeyListener(this);
}
COM: <s> have the panel register itself as a listener wherever its needed </s>
|
funcom_train/34560714 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean columnModelIsSortable() {
if (columnModel == null || columnModel.getColumnConfigs() == null)
return false;
for (BaseColumnConfig columnConfig : columnModel.getColumnConfigs()) {
if (columnConfig instanceof ColumnConfig) {
if (((ColumnConfig) columnConfig).getSortable())
return true;
}
}
return false;
}
COM: <s> checks if the column model contains sortable columns </s>
|
funcom_train/22718662 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int differenceFound(Difference difference) {
final int returnValue = super.differenceFound(difference);
Difference localDifference = null;
switch (returnValue) {
case RETURN_IGNORE_DIFFERENCE_NODES_IDENTICAL:
return returnValue;
case RETURN_ACCEPT_DIFFERENCE:
break;
case RETURN_IGNORE_DIFFERENCE_NODES_SIMILAR:
difference.setRecoverable(true);
break;
}
allDifferences.add(difference);
return returnValue;
}
COM: <s> difference listener implementation </s>
|
funcom_train/44216641 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JCheckBox getOrderedCheckBox() {
if (orderedCheckBox == null) {
orderedCheckBox = new JCheckBox();
orderedCheckBox.setSelected(true);
orderedCheckBox.setBounds(new java.awt.Rectangle(90,15,20,20));
}
return orderedCheckBox;
}
COM: <s> this method initializes ordered check box </s>
|
funcom_train/18051402 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void deleteEntry(int index) throws KeydbLockedException {
passLock();
int offset = this.entriesOffsets[index];
int length = this.getEntryDataLength(index);
int size = this.contentSize - (offset + length);
if (size > 0)
System.arraycopy( this.plainContent, offset + length,
this.plainContent, offset,
size);
this.contentSize -= length;
this.header.numEntries -= 1;
this.changed = true;
this.makeGroupsIndexes();
this.makeEntriesIndexes();
}
COM: <s> delete entry from database </s>
|
funcom_train/25394328 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void cross(final JVector3d a_vector) {
// compute cross product
double a = (y * a_vector.z) - (z * a_vector.y);
double b = -(x * a_vector.z) + (z * a_vector.x);
double c = (x * a_vector.y) - (y * a_vector.x);
// store result in current vector
x = a;
y = b;
z = c;
}
COM: <s> compute the cross product between current vector and an external vector </s>
|
funcom_train/43093855 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Collection findFigsForMember(Object member) {
Collection figs = new ArrayList();
Iterator it = diagrams.iterator();
while (it.hasNext()) {
ArgoDiagram diagram = (ArgoDiagram) it.next();
Object fig = diagram.getContainingFig(member);
if (fig != null) {
figs.add(fig);
}
}
return figs;
}
COM: <s> finds all figs on the diagrams for some project member </s>
|
funcom_train/3597803 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void searchAndPrint(NOMCorpus nom, String observationname, String q, boolean t, List atts) {
try {
List reslist = searchEngine.search((SearchableCorpus)nom, q);
if (reslist.size()>0) {
reslist.remove(0);
Collections.sort(reslist, mycomp);
}
printResults(observationname, reslist, t, atts);
} catch (Throwable ex) {
ex.printStackTrace();
System.exit(0);
}
}
COM: <s> do the main work </s>
|
funcom_train/12179493 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetDeviceName() throws Exception {
accessorMock.expects.getDeviceName().returns("device-name");
Function function = new GetDeviceNameFunction();
Value value = function.invoke(expressionContextMock,
EMPTY_VALUE_ARRAY);
String name = value.stringValue().asJavaString();
assertNotNull(name);
assertEquals("device-name",
name);
}
COM: <s> tests the retrieval of a device name </s>
|
funcom_train/23379653 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void sort(final int serieNumber) {
switch (serieNumber) {
case ExamModel.WRONG:
Collections.sort(questions, COMPARATOR_WRONG);
break;
case ExamModel.NONE:
Collections.sort(questions, COMPARATOR_NONE);
break;
case ExamModel.RIGHT:
Collections.sort(questions, COMPARATOR_RIGHT);
break;
case ExamModel.AVERAGE:
Collections.sort(questions, COMPARATOR_AVERAGE);
break;
case ExamModel.MAXPTS:
Collections.sort(questions, COMPARATOR_MAXPTS);
break;
case ExamModel.MINPTS:
Collections.sort(questions, COMPARATOR_MINPTS);
break;
case ExamModel.NULLPTS:
Collections.sort(questions, COMPARATOR_NULLPTS);
break;
default:
Collections.sort(questions, COMPARATOR_HEURISTICS_1);// TODO default
// sorting method -
// some smart
// algorithm
break;
}
}
COM: <s> sorts data according to the given serie number using proper comparator class </s>
|
funcom_train/16849330 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getResourcePath(int resID) {
String path = null;
for (int i = 0; i < metadata.size(); i++) {
MetaData resData = (MetaData) metadata.get(i);
if (resData.getMetaDataID() == resID) {
path = resData.getResourcePath();
break;
}
}
return path;
}
COM: <s> gets a resource s path given its id </s>
|
funcom_train/5712692 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addConnection(CapiConnection conn){
if (started){
throw new IllegalThreadStateException("system is going down, no more connections possible");
}
connections.put(new Integer(conn.hashCode()), conn);
if (conn.traceOut != null){
conn.traceOut.println("================= shutdown-hook added");
}
}
COM: <s> adds a connection to be cleaned up on shutdown </s>
|
funcom_train/40411581 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetVideosByDirector() {
System.out.println("getVideosByDirector");
String director = "Director";
try {
Collection<Catalogue> result = instance.getVideosByDirector(director);
assertEquals(result.size(), 1);
} catch (CatalogueException ex) {
ex.printStackTrace();
}
}
COM: <s> test of get videos by director method of class usyd </s>
|
funcom_train/21319467 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public long updateGroup(Group group) {
String whereGroup = KEY_ID + "=" + group.getId();
ContentValues groupValues = new ContentValues();
groupValues.put(KEY_GROUP_ORDER, group.getOrder());
groupValues.put(KEY_GROUP_LABEL, group.getName());
db.update(DATABASE_TABLE_GROUP, groupValues, whereGroup, null);
return group.getId();
}
COM: <s> updates a group in database </s>
|
funcom_train/43094074 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String generateAssociationRole(Object assocRole) {
//get the associationRole name
String text = "/" + Model.getFacade().getName(assocRole) + ":";
//get the base association name
Object assoc = Model.getFacade().getBase(assocRole);
if (assoc != null) {
text = text + Model.getFacade().getName(assoc);
}
return text;
}
COM: <s> generate the name of an association role of the form </s>
|
funcom_train/18729626 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void changed(Object entity) {
List allObservers = new LinkedList(observers);
allObservers.addAll(staticObservers);
Iterator iter = allObservers.iterator();
updating = true;
while (iter.hasNext()) {
Observer current = (Observer) iter.next();
current.update(entity);
}
updating = false;
addSchedule();
makeDirty();
}
COM: <s> tell observers to update because an entity has changed </s>
|
funcom_train/5586009 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void generateNames() {
logger.log(Log.VERBOSE, "Generate obfuscated names");
walkTree(new TreeAction() {
public void packageAction(Pk pk) {
pk.generateNames();
}
public void classAction(Cl cl) {
cl.generateNames();
}
public void methodAction(Md md) {
}
public void fieldAction(Fd fd) {
}
});
}
COM: <s> traverse the class tree and generate obfuscated names within each </s>
|
funcom_train/43328209 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: final public double getTm(String output) {
if (output==null) return Double.NaN;
try {
BufferedReader in = new BufferedReader(new EOFStringReader(output));
String buffer = null;
while ((buffer=in.readLine()) != null) {
int pos = buffer.indexOf("Tm = ");
if (pos > 0) {
return StringUtil.atod(buffer,pos+5);
}
}
}
catch (Exception e) {
System.err.println(e.getMessage());
}
return Double.NaN;
}
COM: <s> get tm from raw output or double </s>
|
funcom_train/4521123 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public VistaCedulaVotacion update(VistaCedulaVotacion entity) {
LogUtil.log("updating VistaCedulaVotacion instance", Level.INFO, null);
try {
VistaCedulaVotacion result = entityManager.merge(entity);
LogUtil.log("update successful", Level.INFO, null);
return result;
} catch (RuntimeException re) {
LogUtil.log("update failed", Level.SEVERE, re);
throw re;
}
}
COM: <s> persist a previously saved vista cedula votacion entity and return it or a </s>
|
funcom_train/43795632 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setUser(User user){
_nameLabel.setText(user.getUsername());
_firstNameTextField.setText(user.getFirstName());
_lastNameTextField.setText(user.getLastName());
_emailTextField.setText(user.getEmail());
if (user.getGender().equalsIgnoreCase("Male")){
_maleRadio.setSelected(true);
}else{
_femaleRadio.setSelected(true);
}
_birthdateModelFactory.setCalendar(user.getBirthDate());
_typeComboBox.setSelectedItem(user.getUserType());
}
COM: <s> sets up the pane to display the given user </s>
|
funcom_train/12970418 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ActionForward loginSuccess(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception
{
ActionForward fwd = init(mapping, form, request, response);
if (fwd !=null)
return fwd;
return mapping.findForward(LOGIN_SUCCESS);
}
COM: <s> we load all the menus </s>
|
funcom_train/1491612 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ModelAndView downloadSpecies (HttpServletRequest request, HttpServletResponse response) throws ServiceException, UnsupportedEncodingException {
ModelAndView mav = getCountsView(request, response, "SERVICE.OCCURRENCE.QUERY.RETURNFIELDS.SPECIESCOUNTS", occurrenceFilterSpeciesCountsView, new SearchConstraints(0, speciesCountLimit));
mav.addObject(resultsLimitModelKey, speciesCountLimit);
return mav;
}
COM: <s> retrieves the counts against the species for this set of criteria </s>
|
funcom_train/47393821 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean valid() {
if (probabilities == null) {
return false;
} else if (length() == 0) {
return false;
} else {
double sum = 0;
for (int i = 0; i < length(); i++) {
if (probabilities[i] < 0 || probabilities[i] > 1
|| Double.isInfinite(probabilities[i])
|| Double.isNaN(probabilities[i])) {
return false;
}
sum += probabilities[i];
}
return (1 == sum);
}
}
COM: <s> checks if the probabilities add up to 1 and that all probabilities are </s>
|
funcom_train/20237797 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getCmdExitCadastroUsuario() {
if (cmdExitCadastroUsuario == null) {//GEN-END:|24-getter|0|24-preInit
// write pre-init user code here
cmdExitCadastroUsuario = new Command("Exit", Command.EXIT, 0);//GEN-LINE:|24-getter|1|24-postInit
// write post-init user code here
}//GEN-BEGIN:|24-getter|2|
return cmdExitCadastroUsuario;
}
COM: <s> returns an initiliazed instance of cmd exit cadastro usuario component </s>
|
funcom_train/19398297 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void test_leaf_serialization01() {
final int branchingFactor = 8;
BTree ndx = getBTree(branchingFactor,false);
// Create test node.
final Leaf expected = getRandomLeaf(ndx);
// expected.dump(System.err);
final Leaf actual = (Leaf)doRoundTripTest( true, ndx, expected );
// actual.dump(System.err);
}
COM: <s> test of leaf serialization </s>
|
funcom_train/3154545 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetTimeDiff() {
StopWatch watch = new StopWatch();
long startTime;
long endTime;
startTime = watch.getStartTime();
watch.stop();
endTime = watch.getEndTime();
assertEquals(endTime - startTime, watch.getTimeDiff());
}
COM: <s> tests the functionality of get time diff </s>
|
funcom_train/19257418 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Graphics2D createGraphics() {
if (gc != null) {
return (Graphics2D)gc.create();
}
// We have an image and no GC now - create it
else if (image != null) {
gc = new SWTGraphics2DRenderer( new GC(image), true);
return gc;
}
else
return null;
}
COM: <s> in awt swing </s>
|
funcom_train/15884393 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public UnMarshaler doCreateUnMarshaler(UnMarshaler unMarshaler) throws ProtocolException {
while (true) {
try {
sequence = unMarshaler.readInt();
System.out.println("received sequence number: " + sequence);
if (sequence < 0) {
Marshaler marshaler = createMarshaler();
marshaler.writeStringLine("NEGATIVE SEQUENCE NUMBER");
releaseMarshaler(marshaler);
} else {
break;
}
} catch (IOException e) {
throw new ProtocolException(e);
}
}
return unMarshaler;
}
COM: <s> removes an integer and records it as a sequence number </s>
|
funcom_train/32950440 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public long getTotalPerformanceData(){
Map<String, Object> params = new HashMap<String, Object>();
if (getTop().isAccountAdmin())
params.put("accountUserID", "");
else
params.put("accountUserID", getTop().getAccountUserId());
params.put("accountID", getTop().getAccountId());
return performanceBean.countPerformanceData(params);
}
COM: <s> function used to get total performance log count </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.