__key__ stringlengths 16 21 | __url__ stringclasses 1
value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/26405726 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object getAdmin() {
if (operationsLogger.isLoggable(Level.FINER)) {
operationsLogger.entering(
GroupTxnManagerImpl.class.getName(), "getAdmin");
}
readyState.check();
if (operationsLogger.isLoggable(Level.FINER)) {
operationsLogger.exiting(
GroupTxnManagerImpl.class.getName(), "getAdmin", txnMgrAdminProxy);
}
return txnMgrAdminProxy;
}
COM: <s> returns the administration object for the </s>
|
funcom_train/8436718 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object getArgument(String name) {
Argument arg = arguments.get(name);
if(!isReady)
throw new IllegalStateException("Arguments not initialized");
if(arg == null)
throw new IllegalArgumentException("Argument " + name + " had not been registered");
return arg.getObject();
}
COM: <s> get the value of the particular argument </s>
|
funcom_train/17397084 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected EObject createInitialModel() {
EClass eClass = ExtendedMetaData.INSTANCE.getDocumentRoot(tracePackage);
EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(initialObjectCreationPage.getInitialObjectName());
EObject rootObject = traceFactory.create(eClass);
rootObject.eSet(eStructuralFeature, EcoreUtil.create((EClass)eStructuralFeature.getEType()));
return rootObject;
}
COM: <s> create a new model </s>
|
funcom_train/48588207 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void verifyState() {
if (relayStateTextArea.getDynamicProperty("value") == null || samlResponseTextArea.getDynamicProperty("value") == null) {
throw new IllegalStateException("Be sure relayState and samlResponse are not null. Respestively the are: " + relayStateTextArea.getDynamicProperty("value") + " , " + samlResponseTextArea.getDynamicProperty("value"));
}
}
COM: <s> checks the form </s>
|
funcom_train/12276804 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getUriEncoded() {
String uriEncoded = Util.isNullOrTrimmedBlank(requestParameters.getProxiedURIDetails().getProxiedURL().getFile()) ? "/" : requestParameters.getProxiedURIDetails().getProxiedURL().getFile();
if (log.isDebugEnabled())
log.debug("Returning URI " + uriEncoded);
return uriEncoded;
}
COM: <s> get the path of the uri for the request including any request </s>
|
funcom_train/3766857 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void handleException(Exception anException) {
IMarker aMarker = null;
try {
if (anException == null) {
throw new NullPointerException(
"WOBuilder.handleException called without an exception.");
}
aMarker = this.getBuildfileMarker();
aMarker.setAttribute(IMarker.MESSAGE, "WOLips: "
+ anException.getMessage());
} catch (Exception e) {
ProjectBuildPlugin.getDefault().getPluginLogger().log(e);
} finally {
aMarker = null;
}
}
COM: <s> method handle exception </s>
|
funcom_train/29546971 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isInTrashNotebook(String uri) {
if(uri!=null) {
ResourceDescriptor[] resourceDescriptors=getDiscardedNotebookDescriptors();
if(resourceDescriptors!=null && resourceDescriptors.length>0) {
for (int i = 0; i < resourceDescriptors.length; i++) {
if(uri.equals(resourceDescriptors[i].uri)) {
return true;
}
}
}
}
return false;
}
COM: <s> detect whether notebook is in trash </s>
|
funcom_train/14144286 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Range createRange(Set<Range> container, Match match, Object value) {
if(value == null) {
return new NullRange(container, match);
}
if(match == Match.LT || match == Match.LTE) {
return new Range(container, null, null, (Comparable<?>) value, match);
}
return new Range(container, (Comparable<?>) value, match, null, null);
}
COM: <s> creates a range bounded on one side by the specified value </s>
|
funcom_train/14356684 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Icon get(String url) {
StackTraceElement[] stacks = new Exception().getStackTrace();
try {
Class callerClazz = Class.forName(stacks[1].getClassName());
return get(callerClazz.getResource(url));
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
}
COM: <s> gets the icon denoted by url </s>
|
funcom_train/22335459 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: @Test public void testGetHtmlTidyTranformXslTranformCompiled() {
try {
XmlHttpClient xmlHttpClient = new XmlHttpClient("org/placidus/xmlhttplib/test/tests/test5/test5-compiled-clients.xml");
Map<String, Object> result = xmlHttpClient.execMap("gethtmltidytranformxsltranform", getDefaultParams());
Log.logInfo("Result of gethtmltidytranformxsltranform: " + CollectionHelper.dump(result));
assertTrue(((String) result.get("gethtmltidytranformxsltranform_statuscode")).equals("200"));
assertTrue(((String) result.get(XmlHttpConstants.FIELDNAME_STRINGRESULT)).equals("mailto:liam@htmlhelp.com"));
} catch (Exception ex) {
Log.logError(ex);
fail(ex.getMessage());
}
}
COM: <s> gets html transforms it with tidy transformation to xhtml and </s>
|
funcom_train/15919137 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public StmtExpr createStmtExpr(Position pos, List<Stmt> stmts, Expr expr) {
if (null == expr) return (StmtExpr) nf.StmtExpr(pos, stmts, null).type(ts.Void());
return (StmtExpr) nf.StmtExpr(pos, stmts, expr).type(expr.type());
}
COM: <s> create a statement expression a block of statements with a result value </s>
|
funcom_train/47985434 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void onScanClick(View v) {
if (isIntentAvailable(this,"com.google.zxing.client.android.SCAN")){
Intent intent = new Intent("com.google.zxing.client.android.SCAN");
intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
startActivityForResult(intent, 0);
}else{
Context context = getApplicationContext();
CharSequence text = "Sorry, you have no Barcode Scanner installed. \n Please install one.";
int duration = Toast.LENGTH_SHORT;
Toast toast = Toast.makeText(context, text, duration);
toast.show();
}
}
COM: <s> handle qr scan action </s>
|
funcom_train/22287838 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public SourceWriter createSourceWriter(GeneratorContext ctx, PrintWriter printWriter) {
return new ClassSourceFileComposer(ctx, printWriter, getCreatedPackage(),
getCreatedClassShortName(), getSuperclassName(), getInterfaceNames(),
getImports());
}
COM: <s> creates an implementation of </s>
|
funcom_train/5418144 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton createXButton() {
JButton closeButton = new JButton("X");
closeButton.setOpaque(false);
closeButton.setMargin(null);
closeButton.setFont(closeButton.getFont().deriveFont(Font.BOLD).deriveFont((float) 10));
closeButton.setBorder(new EmptyBorder(1, 1, 1, 1));
return closeButton;
}
COM: <s> creates a jbutton with an x </s>
|
funcom_train/17387319 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public long getDelay(String text) {
Enumeration<OutgoingTextPlugin> e = outgoingTextPlugins.elements();
long delay = 0;
while (e.hasMoreElements()) {
OutgoingTextPlugin plugin = (OutgoingTextPlugin) e.nextElement();
delay += ((OutgoingTextCallback) plugin.getCallback()).getDelay(text, plugin.getData());
}
return delay > 0 ? delay : 0;
}
COM: <s> gets the amount of time to wait before sending the text </s>
|
funcom_train/27689592 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean evaluate(PPpExpression expression, Set symbolConfiguration) {
if (symbolConfiguration != null) {
this.symbolConfiguration = symbolConfiguration;
} else {
this.symbolConfiguration = new HashSet();
}
expression.apply(this);
ExprEval expr = (ExprEval) expr2eval.get(expression);
return expr.expr_val;
}
COM: <s> evaluates the expression </s>
|
funcom_train/9550229 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel getCatBPanel() {
if (catBPanel == null) {
catBLabel = new JLabel();
catBLabel.setFont(bcFont);
catBLabel.setPreferredSize(bcTextLabelSize);
catBPanel = new JPanel();
catBPanel.setLayout(new BoxLayout(catBPanel,BoxLayout.Y_AXIS));
catBPanel.add(catBLabel, null);
}
return catBPanel;
}
COM: <s> this method initializes cat bpanel </s>
|
funcom_train/9372958 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean decodeExtensionMedia(int startIndex) {
int index = startIndex;
dataLength = 0;
stringValue = null;
int length = wspData.length;
boolean rtrn = index < length;
while (index < length && wspData[index] != 0) {
index++;
}
dataLength = index - startIndex + 1;
stringValue = new String(wspData, startIndex, dataLength - 1);
return rtrn;
}
COM: <s> decode the extension media type for wsp pdu </s>
|
funcom_train/40222487 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean selectJustDrawn() {
/** Get our model element. */
Pile justDrawn = (Pile) justDrawnView.getModelElement();
if (!justDrawn.empty()) {
if (justDrawn.getNumSelectedCards() == 0) {
if (!selectionManager.isSelected()) {
justDrawn.select();
selectionManager.setSelected (SelectionManager.JUSTDRAWN);
return true;
}
}
}
/* if for any reason this fails, make sure nothing is selected */
selectionManager.clearSelected();
return false;
}
COM: <s> selects the card in just drawn </s>
|
funcom_train/18737913 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public SyntheticFieldBinding createSyntheticFieldBinding(SourceTypeBinding owningType, ResolvedMember member) {
SyntheticFieldBinding sfb = new SyntheticFieldBinding(member.getName().toCharArray(), makeTypeBinding(member
.getReturnType()), member.getModifiers() | Flags.AccSynthetic, owningType, Constant.NotAConstant, -1); // index
// filled in
// later
owningType.addSyntheticField(sfb);
return sfb;
}
COM: <s> build a new eclipse synthetic field binding for an aspect j resolved member </s>
|
funcom_train/45697945 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void confirmChapter(final Chapter chapter) {
this.numChaptersConfirmed++;
this.cumulativeDistance += chapter.getMinDistance();
if (this.numChaptersConfirmed > size()) {
throw new RuntimeException("Faulty logic - cannot confirm more chapters than there are");
}
if (!list.contains(chapter)) {
throw new RuntimeException("Cannot confirm a chapter that doesn't belong to this set");
}
}
COM: <s> confirm this chapter </s>
|
funcom_train/28752087 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setHcbillingtablecolumn(String newVal) {
if ((newVal != null && this.hcbillingtablecolumn != null && (newVal.compareTo(this.hcbillingtablecolumn) == 0)) ||
(newVal == null && this.hcbillingtablecolumn == null && hcbillingtablecolumn_is_initialized)) {
return;
}
this.hcbillingtablecolumn = newVal;
hcbillingtablecolumn_is_modified = true;
hcbillingtablecolumn_is_initialized = true;
}
COM: <s> setter method for hcbillingtablecolumn </s>
|
funcom_train/1562681 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addURL(String path) {
URL url = null;
try {
url = new URL(path);
ClassPathManipulator.addURL(url, null);
} catch (MalformedURLException e) {
Application
.debug("addPath: MalformedURLExcepton for "
+ path);
} catch (Throwable e) {
Application.debug("addPath: " + e.getMessage()
+ " for " + path);
}// try-catch
}// addURL(String)
COM: <s> add path for a plugin on the net to classpath </s>
|
funcom_train/4026064 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String retrieveObjectName(List list) {
String type = "";
for(int i = 0; i < list.size(); i++) {
type += ( (ASTIdentifier) list.get(i) ).getName() + ( i < list.size() - 1 ? "." : "");
}
return type;
}
COM: <s> returns the comlete name of an object </s>
|
funcom_train/43849624 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void logEntryStructOps(MergeEntry m1, MergeEntry m2, int childPos) {
if( m1.moved )
elog.move(m1.getNode(),childPos);
else if( m2.moved )
elog.move(m2.getNode(),childPos);
}
COM: <s> determine and log operation on entry in merge list </s>
|
funcom_train/40505341 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void updateSensors() {
Square s = level.getSquare(position.x, position.y);
Collection squareSensors = s.getSensorTypes();
for (Map.Entry<SensorConfig, RobotSensorOutput> entry : outputs.entrySet()) {
entry.getValue().setState(squareSensors.contains(entry.getKey()));
}
}
COM: <s> updates all the sensor outputs to correspond with the square this robot </s>
|
funcom_train/40515682 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void poll() {
for (int i = 0; i < p.getHosts().length; i++) {
PrototypedHost h = p.getHost(i);
boolean up = h.isUp();
if (oldState[i] != up) {
notifyListeners(h.getAnAddress(), i, up);
oldState[i] = up;
}
}
}
COM: <s> polls each prototyped host for changes of online ness </s>
|
funcom_train/9120434 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void trConsult() throws IOException, ClassNotFoundException, InterruptedException {
// selection
fin = select(true);
while (!fin) {
MessageClientAgence msg = (MessageClientAgence) in.readObject();
if (msg.type_message.equals("lire"))
lire(msg.id_document);
else if (msg.type_message.equals("liberer"))
liberer(msg.id_document);
else if (msg.type_message.equals("valider") || msg.type_message.equals("invalider"))
liberer();
else
out.writeChars("error : type invalide : " + msg.type_message);
}
}
COM: <s> gere une transaction de consultation procede a la selection </s>
|
funcom_train/17361215 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetLeftHandSide() {
System.out.println("getLeftHandSide");
MathematicalFormulaDto instance = new MathematicalFormulaDto();
BigDecimal expResult = null;
BigDecimal result = instance.getLeftHandSide();
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 left hand side method of class mathematical formula dto </s>
|
funcom_train/1589213 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString() {
return "ConverterManager[" +
iInstantConverters.size() + " instant," +
iPartialConverters.size() + " partial," +
iDurationConverters.size() + " duration," +
iPeriodConverters.size() + " period," +
iIntervalConverters.size() + " interval]";
}
COM: <s> gets a debug representation of the object </s>
|
funcom_train/37741684 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean equals (Object o) {
String ons = ((NsAndLocal)o).namespace;
if (namespace == null && ons != null
|| namespace != null && ons == null
|| namespace != null && ons != null && !namespace.equals(ons)) {
return false;
}
return localName.equals (((NsAndLocal)o).localName);
}
COM: <s> compare with other object </s>
|
funcom_train/18437447 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void start(int setCount, int legCount) {
// Create the set array
sets = new Set[setCount];
// Populate the array, creating also legs
for (int i = 0; i < setCount; i++) {
sets[i] = new Set(legCount);
}
// Set the current Set
currentSet = 0;
// Remember the leg and set Counts
this.setCount = setCount;
this.legCount = legCount;
}
COM: <s> start the match with these numbers of sets and legs </s>
|
funcom_train/510853 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Complex log() {
double rpart = StrictMath.sqrt(this.x*this.x + this.y*this.y);
double ipart=StrictMath.atan2(this.y, this.x);
if(ipart>StrictMath.PI) ipart = ipart - 2.0*StrictMath.PI;
return new Complex(StrictMath.log(rpart), ipart);
}
COM: <s> compute the natural logarithm of the complex number </s>
|
funcom_train/10657283 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testInsertString02() throws BadLocationException {
int length = doc.getLength();
assertEquals(0, length);
assertEquals("", doc.getText(0, length));
doc.insertString(0, null, null);
// Try to insert null at inappropriate position
doc.insertString(-1, null, null);
}
COM: <s> tests method insert string when passing null as text </s>
|
funcom_train/4892075 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double getDouble(String key) throws JSONException {
Object o = get(key);
try {
return o instanceof Number ?
((Number)o).doubleValue() : Double.parseDouble((String)o);
} catch (Exception e) {
throw new JSONException("JSONObject[" + quote(key) +
"] is not a number. value is ="+o, e);
}
}
COM: <s> get the double value associated with a key </s>
|
funcom_train/48939722 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setBlockConstraint(int row, int col, int constraint) {
if (constraint < 0 || constraint > 4)
throw new IllegalArgumentException("constraint not valid: "
+ constraint);
Object f = getField(row, col);
if (f != null && !(f instanceof Integer))
throw new IllegalArgumentException("The field " + row + ", " + col
+ " is already occupied by " + f);
setField(row, col, Integer.valueOf(constraint));
}
COM: <s> set a field on the board to a constrained block </s>
|
funcom_train/21461731 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setRequestValue(String key, Object value) {
HttpServletRequest request = requestGetter.getRequest();
if (request != null) {
if (value instanceof String) {
request.setAttribute(key, value);
}
}
getInternalMap().put(key, value);
}
COM: <s> allows user to set the value of a key directly including reserved keys </s>
|
funcom_train/28768875 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String resolveNamespaces(Node node, String value) {
int prefixLength = value.indexOf(':');
if (prefixLength>=0)
{
String prefix = value.substring(0, prefixLength);
String nsUri = node.lookupNamespaceURI(prefix);
if (nsUri==null)//prefix not resolved, let's use prefix instead
{
nsUri = prefix;
}
return nsUri+value.substring(prefixLength);
}
else
{
String nsUri = node.lookupNamespaceURI(null);
return nsUri+":"+value;
}
}
COM: <s> replaces namespace prefixes with their urls </s>
|
funcom_train/8108896 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void onModuleLoad() {
LoginServiceAsync loginService = GWT.create(LoginService.class);
loginService.login(GWT.getHostPageBaseURL(), new AsyncCallback<LoginInfo>() {
@Override
public void onFailure(Throwable caught) {
loadLogin();
}
@Override
public void onSuccess(LoginInfo result) {
loginInfo = result;
if(loginInfo.isLoggedIn()){
final HandlerManager eventBus = new HandlerManager(null);
AppController appViewer = new AppController(eventBus,loginInfo);
appViewer.go(RootPanel.get());
}else{
loadLogin();
}
}
});
}
COM: <s> this is the entry point method </s>
|
funcom_train/49048762 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void updateInterLevelDistance(int interLevelDistance){
if (this.getSubTasks() != null){
Iterator<Task> it = getSubTasks().iterator();
while (it.hasNext()) {
Task task = (Task) it.next();
task.setPosition(new Point(
task.getPosition().x,
this.getPosition().y + interLevelDistance*getTaskDiagram().getNodeHeight()));
task.updateInterLevelDistance(interLevelDistance);
}
}
}
COM: <s> update the inter level distance between this task and its sub tasks </s>
|
funcom_train/28403893 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getRequestBase(ServletRequest request) {
// Included Path
String include = (String) request.getAttribute("javax.servlet.include.servlet_path");
if (include != null) {
return include;
}
// As opposed to includes, if a forward occurs, it will update the servletPath property
// and include the original as the request attribute.
return ((HttpServletRequest) request).getServletPath();
}
COM: <s> returns the request base i </s>
|
funcom_train/8048181 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void unregisterForLocking(AbstractCursorProcessor ia){
Set<AbstractCursorProcessor> keys = interestedProcessorsToPriority.keySet();
for (Iterator<AbstractCursorProcessor> iterator = keys.iterator(); iterator.hasNext();) {
AbstractCursorProcessor inputAnalyzer = (AbstractCursorProcessor) iterator.next();
if (inputAnalyzer.equals(ia)){
iterator.remove();
}
}
// if (interestedAnalyzersToPriority.containsKey(ia)){ //FIXME REMOVE, NOT RELIABLE - BUG?
// interestedAnalyzersToPriority.remove(ia);
// }
}
COM: <s> input processors should call this when input has ended </s>
|
funcom_train/45272436 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isOutputPort(FlexotaskPortTemplate port) {
boolean foundFlag = false;
if (outputPorts != null) {
int i = 0;
while (i < outputPorts.length && foundFlag == false) {
if (outputPorts[i].equals(port)) {
foundFlag = true;
}
i++;
}
}
return foundFlag;
}
COM: <s> determine if a port of this task is an output port </s>
|
funcom_train/50865639 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void removeUnit(Unit oldUnit) {
if (resourceCache == null) resourceCache = new HashMap<Unit, Map<AmountResource, Integer>>();
if (resourceCache.containsKey(oldUnit)) {
Map<AmountResource, Integer> resourceMap = resourceCache.get(oldUnit);
resourceMap.clear();
resourceCache.remove(oldUnit);
}
super.removeUnit(oldUnit);
}
COM: <s> remove a unit to the model </s>
|
funcom_train/27754905 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setColoringStyle(String name) throws IllegalArgumentException {
baseEditor.setRegionMapper("rgb", name);
StyledRegion sr = (StyledRegion) baseEditor.getBackground();
setForeground(getColor(sr.bfore, sr.fore));
setBackground(getColor(sr.bback, sr.back));
};
COM: <s> changes style color scheme into one specified with name paramenter </s>
|
funcom_train/44433502 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString() {
String res="";
for (int n=0;n<moveList.length;n++) {
res+="Level "+n+"\n";
if (moveList[n]!=null) {
for (int i=0;i<moveList[n].size();i++) res+=((Move)moveList[n].get(i)).toString();
res+="\n";
}
}
return res;
}
COM: <s> converts the lookup table to a string </s>
|
funcom_train/42856632 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void add(int episodeId, IntervalSet example) {
Map<String,IntervalSet> map = findOrAdd(episodeId);
if (map.containsKey(example.intervals().toString()))
throw new RuntimeException("Adding something already defined: " + example.intervals());
map.put(example.intervals().toString(), example);
}
COM: <s> add the list of intervals as an example of this pattern </s>
|
funcom_train/21469565 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public IPacket addStanzaTo(final IPacket parent) {
final IPacket packet = parent.addChild("item", null);
packet.With("jid", jid.toString()).With("name", name);
for (final String group : groups) {
packet.addChild("group", null).setText(group);
}
return packet;
}
COM: <s> creates a new item stanza and appends to the parent </s>
|
funcom_train/1662697 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean insertProject(Project currentProject) {
if (!freenetInterface.hasNode()) {
outputWriter.println("Node is not running!");
return false;
}
projectInserter.setProject(currentProject);
projectInserter.start();
synchronized (lockObject) {
while (!finished) {
try {
lockObject.wait();
} catch (InterruptedException e) {
/* ignore, we're in a loop. */
}
}
}
return success;
}
COM: <s> inserts the given project </s>
|
funcom_train/42536872 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean equals(Object o){
if(!(o instanceof NESubtypeList))return false;
if(o == this)return true;
NESubtypeList oo = (NESubtypeList)o;
return (((Object)first).equals(oo.first))&&(((Object)rest).equals(oo.rest));
}
COM: <s> is the given object equal to this nesubtype list </s>
|
funcom_train/17789750 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getGuardBits(int component) {
int guardBits = -1;
if ((qccParametersList != null) && qccParametersList.containsKey(component)) {
guardBits = qccParametersList.get(component).guardBits;
} else if (qcdParameters != null) {
guardBits = qcdParameters.guardBits;
} else {
assert (true);
}
return guardBits;
}
COM: <s> returns the number of guard bits for the component code component code </s>
|
funcom_train/22525170 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void install() {
if (!fIsInstalled) {
if (sourceViewer instanceof ITextViewerExtension) {
ITextViewerExtension e= (ITextViewerExtension) sourceViewer;
e.prependVerifyKeyListener(this);
} else {
StyledText text= sourceViewer.getTextWidget();
text.addVerifyKeyListener(this);
}
fKeyBindingService= getEditorSite().getKeyBindingService();
fIsInstalled= true;
}
}
COM: <s> installs this trigger on the editors text widget </s>
|
funcom_train/4921111 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testNoEscalationType() {
// Record no escalation type
this.record_issue("Null escalation type for 0");
// Record no escalation type
this.record_factoryAndExtensionInterfaceType();
this.recordReturn(this.metaData, this.metaData.getFlowMetaData(),
new GovernanceFlowMetaData<?>[0]);
this.recordReturn(this.metaData, this.metaData.getEscalationTypes(),
new Class<?>[1]);
// Attempt to load
this.loadGovernanceType(false, null);
}
COM: <s> ensure issue if no escalation type </s>
|
funcom_train/27837860 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void listRightBox2_itemStateChanged(ItemEvent e) {
String value = (String) _listRightBox2.getSelectedItem();
if (value != null) {
if (value.equals(" ")) {
_listRightBox2.setSelectedIndex(-1);
}
}
_query.setModified(true);
} //--listRightBox2_itemStateChanged
COM: <s> executed when value of the right combobox in row 2 has changed </s>
|
funcom_train/50927613 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void calculateBondedAtoms() {
for (CMLMolecule mol : molecule.getDescendantsOrMolecule()) {
List<CMLAtom> atoms = mol.getAtoms();
// need to remove old bonds first
for (CMLBond bond : mol.getBonds()) {
bond.detach();
}
CMLBondArray ba = mol.getBondArray();
if (ba != null) {
ba.indexBonds();
}
calculateBondedAtoms(atoms, mol);
}
}
COM: <s> calculates which atoms are bonded by covalent radius criterion </s>
|
funcom_train/7979567 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void makeHeritable(String key) {
@SuppressWarnings("unchecked")
List<String> heritableKeys = (List<String>) getObject(A_HERITABLE_KEYS);
if(heritableKeys==null) {
heritableKeys = new ArrayList<String>();
heritableKeys.add(A_HERITABLE_KEYS);
putObject(A_HERITABLE_KEYS,heritableKeys);
}
heritableKeys.add(key);
}
COM: <s> make the given key heritable meaning its value will be </s>
|
funcom_train/2565015 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public CompositeState findAncestor(MetaState ancestorMetaState) {
CompositeState parent = getParent();
if (parent == null) {
throw ErrorMessages.newIllegalArgumentException(ErrorMessage.NON_EXISTING_ANCESTOR, ancestorMetaState.toString());
}
if (parent.hasMetaState(ancestorMetaState)) {
return parent;
} else {
return parent.findAncestor(ancestorMetaState);
}
}
COM: <s> search for an ancestor of this state whose </s>
|
funcom_train/31477330 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void calculateCurrentPoint() {
double value = posAlpha.getValue();
setX(fromPos.getX() +
(toPos.getX()-fromPos.getX()) * value);
setY(fromPos.getY() +
(toPos.getY()-fromPos.getY()) * value);
}
COM: <s> recalculates and caches the current point </s>
|
funcom_train/22032882 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean equals(Object obj) {
if (this == obj)
return true;
if (!(obj instanceof WeakMapValue))
return false;
WeakMapValue that = (WeakMapValue)obj;
Object thisVal = get();
Object thatVal = that.get();
return
thisVal == null
? thatVal == null
: thisVal.equals(thatVal);
}
COM: <s> indicates if this instance equals another object </s>
|
funcom_train/48498101 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public TimeDTO copy () {
TimeDTO copy = new TimeDTO ();
copy.setDate(new String(this.getDate()));
copy.setDuration(this.getDuration());
copy.setIteration(new String(this.getIteration()));
copy.setProject(this.getProject());
copy.setStory(new String(this.getStory()));
copy.setTask(this.getTask());
copy.setTime_id(this.getTime_id());
copy.setUser(new String(this.getUser()));
return copy;
}
COM: <s> create a copy from this object </s>
|
funcom_train/15625835 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isEmpty() {
for (int x = 0; x < mapSize.getWidth(); x++) {
for (int y = 0; y < mapSize.getHeight(); y++) {
if (!mapGrid.get(x).get(y).isEmpty()) {
return false;
}
}
}
return true;
}
COM: <s> returns whether the map is empty </s>
|
funcom_train/14240906 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getBaseName() {
String n = getName();
if (n.endsWith(COMPRESSED_FILE_EXT)) {
return n.substring(0, n.length() - COMPRESSED_FILE_EXT.length());
}
if (n.endsWith(UNCOMPRESSED_FILE_EXT)) {
return n.substring(0, n.length() - UNCOMPRESSED_FILE_EXT.length());
}
return n;
}
COM: <s> added eugenios patches to load 0 </s>
|
funcom_train/9544707 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isChild (String parent, String newParent) {
CategoryNod[] children;
children = this.getCategoryTree(parent, 0, this.defaultLanguage, null);
for (int i=0; i < children.length; i++) {
if (newParent.equals(children[i].getCode())) {return true;}
}
return false;
}
COM: <s> this method tests if new parents is not a child of the category </s>
|
funcom_train/45310992 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void updataColorsWithPrefs() {
for (Iterator iter = colors.keySet().iterator(); iter.hasNext();) {
String id = (String) iter.next();
ManagedColor mc = colors.get(id);
mc.setCurrentColor(PreferenceConverter.getColor(
JSGFEditorPlugin.getDefault().getPreferenceStore(),id));
registry.put(mc.getId(),mc.getCurrentColor());
}
}
COM: <s> update the stored colors with the preferences </s>
|
funcom_train/8104379 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addSynonym(String word,float hub_weight,float authority_weight,boolean rate) {
if (null != rows) {
SynonymRow r = new SynonymRow();
r.word = word;
r.hub_weight = hub_weight;
r.authority_weight = authority_weight;
r.rate = rate;
rows.add(r);
}
}
COM: <s> adds row in synonyms table </s>
|
funcom_train/46338107 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void stop() {
isRunning = false;
if (thread == null) {
Log.w(TAG, "Server was stopped without being started.");
return;
}
Log.d(TAG, "Stopping server.");
thread.interrupt();
try {
thread.join(5000);
} catch (InterruptedException e) {
Log.w(TAG, "Server was interrupted while stopping", e);
}
}
COM: <s> stop the server </s>
|
funcom_train/12117492 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void connEtoC44(java.awt.event.ActionEvent arg1) {
try {
// user code begin {1}
// user code end
this.anticipiModificaJButton_ActionPerformed(arg1);
// user code begin {2}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {3}
// user code end
handleException(ivjExc);
}
}
COM: <s> conn eto c44 anticipi modifica jbutton </s>
|
funcom_train/32057598 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testUninstallKeyboardActions() {
System.out.println("testUninstallKeyboardActions");
JGraph jg=new JGraph();
BasicGraphUI x = new BasicGraphUI();
GraphLayoutCache g = new GraphLayoutCache( new DefaultGraphModel(),jg );
x.installUI(jg);
x.installKeyboardActions();
x.uninstallKeyboardActions();
}
COM: <s> test of uninstall keyboard actions method of class basic graph ui </s>
|
funcom_train/15954425 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testDelete() throws BMLException{
String lsValue = "Good!!!";
DataString ldString = new DataString(fBlank);
ldString.setString(lsValue);
ldString.delete(1,2);
assertEquals("Gd!!!",ldString.toString());
}
COM: <s> test of delete method </s>
|
funcom_train/17637517 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void keyPressed(KeyEvent keyEvent) {
String value = inputField.getValue();
if(maxLen <=0 || value.length()< maxLen) {
return;
}
int keyCode = keyEvent.getKeyCode();
if (keyCode != KeyEvent.VK_ENTER && keyCode != '\t' && keyCode!=KeyEvent.VK_ESCAPE) {
keyEvent.consume();
}
}
COM: <s> key pressed events are fired when any key including a function </s>
|
funcom_train/9748212 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void TEMPpollcheck() {
if (System.currentTimeMillis() - lastTemperatureUpdate > 10000) {
// Polled updates are having a hard time getting through with
// the temporary comms locking, so we'll get them through here
try {
RefreshEmptySensor();
RefreshTemperature();
//tH[tHi] = currentTemperature;
//currentTemperature = tempVote();
} catch (Exception ex) {
Debug.d(material + " extruder exception during temperature/material update ignored");
ex.printStackTrace();
}
}
}
COM: <s> temporary workaround function </s>
|
funcom_train/11345332 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void ungetService(ServiceReference ref) {
m_tracker.ungetService(ref);
Object obj = m_serviceObjects.remove(ref); // Remove the service object
if (obj != null && obj instanceof IPOJOServiceFactory) {
((IPOJOServiceFactory) obj).ungetService(m_instance, obj);
}
}
COM: <s> ungets a used service reference </s>
|
funcom_train/5897476 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setType(String type) throws WrongValueException {
if (!BUTTON.equals(type) && !"submit".equals(type) && !"reset".equals(type))
throw new WrongValueException(type);
if (!Objects.equals(_auxinf != null ? _auxinf.type: BUTTON, type)) {
initAuxInfo().type = type;
smartUpdate("type", getType());
}
}
COM: <s> sets the button type </s>
|
funcom_train/311237 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void ensureSize(int arraySize){
if(arraySize%2!=0) throw new IllegalArgumentException("not divide by 2");
// grow the array if necessary.
if (ranges.length < arraySize) {
long[] newRanges = new long[arraySize];
System.arraycopy(ranges,0,newRanges,0,ranges.length);
ranges = newRanges;
}
}
COM: <s> make sure underling array have at least given size </s>
|
funcom_train/5436933 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void doSaveAs() {
try {
ProgressMonitorDialog dialog = new ProgressMonitorDialog(getEditorSite().getShell());
dialog.run(false, false, new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) {
doSave(monitor);
}
});
} catch (Throwable e) {
e.printStackTrace();
}
}
COM: <s> does the same thing as do save </s>
|
funcom_train/7982442 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setFile(String file) {
String[] parts = file.split("\\" + File.separatorChar);
if (parts.length > 1) {
String path = Helper.join(File.separatorChar + "", parts, 0, parts.length - 2);
File dir = new File(path);
if (!dir.exists()) {
dir.mkdir();
}
}
this.file = file;
}
COM: <s> sets the file </s>
|
funcom_train/29517968 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int computeTableHypergeometricProbabilities(double[] probs, int... t) {
ProbTableVisitor visitor = (ProbTableVisitor) getVisitor(ProbTableVisitor.class);
visitor.setProbs(probs);
int n = enumerateAllCompatibleTables(visitor, t);
visitor.setProbs(null); // useless, but who knows
return n;
}
COM: <s> compute table hypergeometric probabilities by the standard method </s>
|
funcom_train/49469138 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getAnomalyForAnomalyId(int anomaly_id) throws Exception, RaciException {
Db db = dbRO();
try {
_logger.info("IM : getAnomalyForAnomalyId ("+anomaly_id+")");
checkUserCanAccess(db);
MetricFactory mf = newMetricFactory(db);
MetricReports metrics = mf.getMetricReports();
return metrics.lookUpForAnomaly(anomaly_id);
} catch (Exception e) { store(e); throw e; } finally { db.safeClose(); }
}
COM: <s> get the description of an anomaly with its anomaly id </s>
|
funcom_train/25030409 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Node external_mutator_write_chunked_buffer(Node startAt) throws Exception {
startAt.isGoodArgsCnt(2);
Heap.Tk.require_SELF_mutable();
buffer.write_chunked_Buffer(((External_Buffer) AExtTools.getArgExternalInstance(startAt, 1, External_Buffer.class, Node.ACCESSVTYPE_MUTABLE_WRITELOCK)).buffer);
return null;
}
COM: <s> ecriture dun chunked buffer dans le tampon </s>
|
funcom_train/5374525 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void subtract (int[] pointArray) {
if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (pointArray == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
/*
if (OS.IsWinCE) SWT.error(SWT.ERROR_NOT_IMPLEMENTED);
int polyRgn = OS.CreatePolygonRgn(pointArray, pointArray.length / 2, OS.ALTERNATE);
OS.CombineRgn (handle, handle, polyRgn, OS.RGN_DIFF);
OS.DeleteObject (polyRgn);
*/
}
COM: <s> subtracts the given polygon from the collection of polygons </s>
|
funcom_train/25990998 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isBreakStatement(Node node) {
breakLoop: do {
if (node == null) return false;
switch (node.getNodeType()) {
case NEWLINENODE:
node = ((NewlineNode) node).getNextNode();
continue breakLoop;
case BREAKNODE: case NEXTNODE: case REDONODE:
case RETRYNODE: case RETURNNODE:
return true;
default:
return false;
}
} while (true);
}
COM: <s> is the supplied node a break control statement </s>
|
funcom_train/18894667 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Mp3ModelListener getMp3ModelListener() {
return new Mp3ModelListener() {
public void loadExceptionOccurred(Mp3File file, Exception e) {
String newline = System.getProperty("line.separator");
//just print it
log.warn("An exception occurred while loading: " + file, e);
}
};
}
COM: <s> returns a new mp3 model listener that logs the exception </s>
|
funcom_train/28178019 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void modifyUserAttributes(String oldLogin, String newLogin, String newPassword){
if(oldLogin.compareTo(newLogin) != 0 ){
findUserByLogin(oldLogin).setLogin(newLogin);
}
if(newPassword.compareTo("") != 0){
findUserByLogin(newLogin).setPassword(newPassword);
}
}
COM: <s> change rbac user attributes </s>
|
funcom_train/2408281 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object processBytes(byte[] pattern) {
int[] td1 = new int[256];
for (int i = 0; i < td1.length; ++i) {
td1[i] = pattern.length + 1;
}
for (int i = 0; i < pattern.length; ++i) {
td1[index(pattern[i])] = pattern.length - i;
}
return td1;
}
COM: <s> returns a code int code array </s>
|
funcom_train/51483127 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void mouseDown(MouseEvent e, int x, int y) {
super.mouseDown(e, x, y);
Figure pressedFigure = drawing().findFigureInside(x, y);
TextHolder textHolder = (TextHolder)createdFigure();
if (!fConnected && pressedFigure != null &&
textHolder != null && pressedFigure != textHolder) {
textHolder.connect(pressedFigure);
fConnected = true;
}
}
COM: <s> if the pressed figure is a text holder it can be edited otherwise </s>
|
funcom_train/35461039 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int tokenDelimiter(final String line, final int startPos) {
int i = startPos;
while (i > -1) {
/* A white space if found and we are not in the middle of a literal */
if (line.charAt(i) == ' ' && !isInLiteral(line, i)) {
return i;
}
i--;
}
return i;
}
COM: <s> cobol lines can be split on token delimiters </s>
|
funcom_train/18059017 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getFieldExplanation(UID objectId) throws RemoteException {
synchronized(SO) {
SO.rmcCount++;
LocalField pc_obj =
(LocalField) SO.objectMap.get(objectId);
try {
return pc_obj.getFieldExplanation();
} catch(PerformanceException e) {
throw new RemoteException(e.getMessage());
}
}
}
COM: <s> retrieve the explanation text for the field </s>
|
funcom_train/936590 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void stop() {
System.out.println("Stop my simple plug-in");
/*
* Sleep awhile just to simulate that something is being done
* during shutdown.
*/
try {
Thread.sleep(TIMEOUT);
} catch (InterruptedException exception) {
exception.printStackTrace();
}
System.out.println("My simple plug-in has stopped");
}
COM: <s> this method is invoked when the plug work core stop this plug in </s>
|
funcom_train/5413345 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getPath() throws ServiceException {
String path = getFolder().getPath(), name = getName();
if (name == null || path == null)
return null;
return path + (path.endsWith("/") ? "" : "/") + name;
}
COM: <s> returns the path to the mail item </s>
|
funcom_train/10859752 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Highlighter getPhraseHighlighter(Query query, String fieldName, SolrQueryRequest request, CachingTokenFilter tokenStream) throws IOException {
SolrParams params = request.getParams();
Highlighter highlighter = null;
highlighter = new Highlighter(
getFormatter(fieldName, params),
getEncoder(fieldName, params),
getSpanQueryScorer(query, fieldName, tokenStream, request));
highlighter.setTextFragmenter(getFragmenter(fieldName, params));
return highlighter;
}
COM: <s> return a phrase </s>
|
funcom_train/40634808 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addClickHandler() {
this.addDomHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
addThisClick(anchorElement, Window.Location.getHref(), message);
event.preventDefault();
}
}, ClickEvent.getType());
}
COM: <s> shows the more popup menu when the add this button is directly clicked </s>
|
funcom_train/34011747 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String findUniquePropertyValueWithLanguageName(String propertyValueKey, String languageName){
PropertyValueResult propertyValueResult = this.findPropertyValueResultWithLanguageName(languageName, propertyValueKey);
Long resultSize = propertyValueResult.resultSize();
if( resultSize > 1){
throw new OnFindPropertyValueException("Property value not unique [" + resultSize + "] for [" + propertyValueKey + "].");
}
return propertyValueResult.getTextFor(propertyValueKey, languageName);
}
COM: <s> find a unique property value with a property key associated with a language </s>
|
funcom_train/9120315 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JMenuBar buildMenuBar() {
JMenuItem openItem = new JMenuItem(OPEN);
openItem.setActionCommand(OPEN);
openItem.setMnemonic('O');
openItem.addActionListener(this);
JMenuItem exitItem = new JMenuItem(EXIT);
exitItem.setActionCommand(EXIT);
exitItem.setMnemonic('x');
exitItem.addActionListener(this);
JMenu fileMenu = new JMenu(FILE);
fileMenu.add(openItem);
fileMenu.add(exitItem);
fileMenu.setMnemonic('F');
JMenuBar menuBar = new JMenuBar();
menuBar.add(fileMenu);
return (menuBar);
}
COM: <s> builds the menu bar for the sample application </s>
|
funcom_train/18808819 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (obj instanceof KeyToGroupMap) {
KeyToGroupMap m = (KeyToGroupMap) obj;
boolean b0 = ObjectUtils.equal(this.defaultGroup, m.defaultGroup);
boolean b1 = this.keyToGroupMap.equals(m.keyToGroupMap);
return b0 && b1;
}
return false;
}
COM: <s> tests the map for equality against an arbitrary object </s>
|
funcom_train/48338271 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean equals(final Object o) {
if (this == o) return true;
if (!(o instanceof NamedResource)) return false;
NamedResource r = (NamedResource)o;
return (name.equals(r.name) && host.equals(r.host) && (port == r.port));
}
COM: <s> determines whether this named resource equals the specified object </s>
|
funcom_train/18028161 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void nextRecord() {
index++;
if ( index == current.length() ) {
if ( finished==null ) finished= new ArrayList<DDataSet>(4);
finished.add( current );
offset += current.length();
index -= current.length();
newCurrent();
}
}
COM: <s> this must be called each time a record is complete </s>
|
funcom_train/50842577 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: synchronized public void release() {
if (userConnection != null) {
// userConnection is already closed in normal use
try {
userConnection.close();
} catch (SQLException e) {
// check connection problems
}
}
try {
connection.reset();
} catch (SQLException e) {
// check connection problems
}
isInUse = false;
}
COM: <s> force close the user connection no close event is fired </s>
|
funcom_train/8228589 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean connectToPhone() {
_phone = new PhoneInterface("Phone @ " + _myPort, IP.getIP(IP_PHONE + _myPort), DUMMY_PORT, COMMANDO_HOST, COMMANDO_PORT);
if(!_phone.AcquireResource()){
System.err.println("Can't acquire phone.");
return false;
}
return true;
}
COM: <s> connect to phone method </s>
|
funcom_train/32793915 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void setVariable(Node n, String var) {
if (nnm.containsKey(n)) {
throw new RuntimeException(
"tried to assign second variable to node \""+n+"\"; old variable: "+
nnm.get(n)+", new variable:"+var);
}
nnm.put(n, var);
}
COM: <s> set the variable for a node </s>
|
funcom_train/27904670 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void post_removal_callbak() {
// NOTE: dont do any advanced stuffs here, HashTable is invalid at this point!!
// NOTE: we cant use partial invalidation for some cahce types since they hold
// more than just BDD nodes [I think quant_cache is fixed, however]
sat_cache.invalidate_cache(); // NO NEED TO GROW THIS ONE ?
relprod_cache.free_or_grow(this);
replace_cache.free_or_grow(this);
quant_cache.free_or_grow(this);
ite_cache.free_or_grow(this);
not_cache.free_or_grow(this);
op_cache.free_or_grow(this);
}
COM: <s> this function is called after the garbage collector hash changed some internal data </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.