__key__ stringlengths 16 21 | __url__ stringclasses 1
value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/12768133 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public TreeItem moveTreeItemToRoot(TreeItem item, boolean disposeItem) {
TreeItem newItem = item;
if (item != null && !item.isDisposed()) {
if (item.getParentItem() != null) {
newItem = moveTreeItem(null, tree.getItemCount(), item, disposeItem);
} else {
//System.out.println("Already a root node");
}
}
return newItem;
}
COM: <s> moves a tree item to be a root item directly under the tree </s>
|
funcom_train/3273772 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean accept(File f) {
if (f.isDirectory()) {
return true;
}
String extension = ImageFileChoiceUtils.getExtension(f);
return (extension != null) &&
((extension.equals(ImageFileChoiceUtils.tif)) ||
(extension.equals(ImageFileChoiceUtils.tiff)));
}
COM: <s> accept all directories and all tif files </s>
|
funcom_train/38724479 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ShapePinpanel (final ShapePinboard board) {
this.board = board;
setPreferredSize(new Dimension(60,60));
setLayout(new BorderLayout());
setBorder(new BevelBorder(BevelBorder.LOWERED));
addMouseListener(new MouseAdapter() {
public void MouseClicked(MouseEvent evt) {
clicked(evt);
}
});
}
COM: <s> creates a new form shape pinpanel </s>
|
funcom_train/50700941 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void visitDirectory(XenoxFile parent, VisitModuleCallback nodeCB, int maxdepth) {
if (maxdepth == 0) {
return;
}
LinkedList subNodes = xnxDB.getSubNodes(parent.getID());
Collections.sort(subNodes, parent);
for (Iterator it = subNodes.listIterator(); it.hasNext(); ) {
XenoxFile subNode = (XenoxFile) it.next();
visitNode(subNode, nodeCB, maxdepth);
}
nodeCB.fireDone();
}
COM: <s> uses a callback class to visit all nodes in a directory recursively </s>
|
funcom_train/8368539 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getOkCommand1() {
if (okCommand1 == null) {//GEN-END:|324-getter|0|324-preInit
// write pre-init user code here
okCommand1 = new Command("Weiter", Command.OK, 0);//GEN-LINE:|324-getter|1|324-postInit
// write post-init user code here
}//GEN-BEGIN:|324-getter|2|
return okCommand1;
}
COM: <s> returns an initiliazed instance of ok command1 component </s>
|
funcom_train/42771379 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public long toRangeValue(int x) {
// if (x <= getVisualLow()) {
// x -= HANDLE_SIZE;
// } else if (x >= getVisualHigh()) {
// x -= HANDLE_SIZE*2;
// }
Rectangle bounds = getCanvas().getClientArea();
if (scale == 0.0) {
return 0;
}
return Math.round((x-bounds.x+HANDLE_SIZE)/scale) + getMinimum();
}
COM: <s> converts the given </s>
|
funcom_train/5343399 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void recoverHosts() {
// Notify the HostCatcher that it should keep any hosts it has already
// used instead of discarding them.
// The HostCatcher can be null in testing.
if(_catcher != null && _catcher.getNumHosts() < 100) {
_catcher.recoverHosts();
}
}
COM: <s> utility method that tells the host catcher to recover hosts from disk </s>
|
funcom_train/25291088 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setFrontDistance(double frontDistance) {
if (isLiveOrCompiled())
if(!this.getCapability(ALLOW_DISTANCE_WRITE))
throw new CapabilityNotSetException(Ding3dI18N.getString("LinearFog0"));
if (isLive())
((LinearFogRetained)this.retained).setFrontDistance(frontDistance);
else
((LinearFogRetained)this.retained).initFrontDistance(frontDistance);
}
COM: <s> sets front distance for fog </s>
|
funcom_train/49676845 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getDamage(ElementAbility ability) {
int damageCount = 0;
for (Entry<ElementaryEnum, Pair<Integer, Integer>> entry : this.abilities
.entrySet()) {
Pair<Integer, Integer> defensePair = ability.getAbility(entry.getKey());
damageCount += entry.getValue().getFirstElement()
* (100 - defensePair.getSecondElement()) / 100;
}
return damageCount;
}
COM: <s> gets damage value corresponding to an attack with ability given </s>
|
funcom_train/31155983 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void mapPixel(PixelMapper f) {
for (int x = 0; x < getImageWidth(); x++) {
for (int y = 0; y < getImageHeight(); y++) {
Color newPixelColor = f.trans(x, y, getColor(x, y));
setColor(x, y, newPixelColor);
}
}
}
COM: <s> applies the given pixel transformation to every pixel in the image </s>
|
funcom_train/12127994 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean hasTypeTags(int type) {
Attribute attr = null;
Hashtable tags;
switch(type) {
case NODE:
attr = getNodeAttribute(TAG_ATTR);
break;
case EDGE:
attr = getEdgeAttribute(TAG_ATTR);
break;
case SUBGRAPH:
attr = getLocalAttribute(TAG_ATTR);
break;
}
if(attr == null) return false;
tags = (Hashtable)(attr.getValue());
if(tags == null || tags.size() == 0) return false;
return(true);
}
COM: <s> check if this element type has any default tags at all </s>
|
funcom_train/17724463 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void configureValidator(UIComponent component, String name, String value) {
if (value == null) {
return;
}
if (isValueReference(value)) {
MethodBinding mb =
getFacesContext().getApplication().
createMethodBinding(value, VALIDATOR_SIGNATURE);
((EditableValueHolder) component).setValidator(mb);
} else {
throw new IllegalArgumentException(value);
}
}
COM: <s> p configure a validator method binding </s>
|
funcom_train/12561922 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void serialize(OutputStream out) throws IOException {
OutputStorage storage = new OutputStorage(out);
Enumeration e;
PublicKeyInfo keyInfo;
e = keyList.elements();
while (e.hasMoreElements()) {
keyInfo = (PublicKeyInfo)e.nextElement();
putKeyInStorage(storage, keyInfo);
}
}
COM: <s> serializes the keystore to the given stream </s>
|
funcom_train/44819813 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ToolItem createToolItem(ToolBar toolBar, Action action) {
Image image = getActionImage(action);
if (image == null) {
return null;
}
ToolItem newToolItem = createToolItem(toolBar);
newToolItem.setImage(image);
setToolItemAction(newToolItem, action);
return newToolItem;
}
COM: <s> create tool item by swing action </s>
|
funcom_train/26230345 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setMinMax(String uMax, String vMax) {
// we only set these if NOMINAL is selected
if(jComboBoxRr.getSelectedIndex()==0) {
jTextFieldUmi.setText("0");
jTextFieldUma.setText(uMax);
jTextFieldVmi.setText("0");
jTextFieldVma.setText(vMax);
}
}
COM: <s> sets the minimum and maximum values for umin vmin umax and vmax </s>
|
funcom_train/44497751 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void load_xml(String fname) {
Object ret[] = TestCommon.load_xml_document(fname);
_doc = (Document) ret[0];
_dc = (DynamicContext) ret[1];
_dc.add_namespace("xs", XSCtrLibrary.XML_SCHEMA_NS);
_dc.add_function_library(new FnFunctionLibrary());
_dc.add_function_library(new XSCtrLibrary());
_dc.add_function_library(new XDTCtrLibrary());
}
COM: <s> load xml document into array of type object </s>
|
funcom_train/35682010 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testProxyInvokeDirectCultureInfo() throws Exception {
DirectOperationProxy invoker = new DirectOperationProxy(
CultureinfoJaxwsCases.getDirectConfig());
byte[] replyBytes = invoker.invoke(CultureinfoJaxwsCases
.getDirectConfig(), getName(), HostData
.toByteArray(CultureinfoCases.getHostBytesHexRequestFr()));
CultureinfoCases.checkHostBytesReplyFr(replyBytes);
}
COM: <s> test actual invoke using the proxy classes </s>
|
funcom_train/5865269 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setFrameBgColor(String color) {
if (Objects.equals(color, _bgColor)) {
return;
}
_bgColor = color;
if (_bgColor == null) {
_bgRGB = null;
} else {
_bgRGB = new int[3];
Chart.decode(_bgColor, _bgRGB);
}
fireEvent(ChartDataEvent.CHANGED, null, null);
}
COM: <s> set the background color of the dial frame </s>
|
funcom_train/32800658 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addTypeNamePropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(
((ComposeableAdapterFactory) adapterFactory)
.getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_VariableDeclarationWithInitCS_typeName_feature"),
getString(
"_UI_PropertyDescriptor_description",
"_UI_VariableDeclarationWithInitCS_typeName_feature",
"_UI_VariableDeclarationWithInitCS_type"),
OclPackage.Literals.VARIABLE_DECLARATION_WITH_INIT_CS__TYPE_NAME,
true, false, true, null, null, null));
}
COM: <s> this adds a property descriptor for the type name feature </s>
|
funcom_train/13272239 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getPointIndexAt(float x, float y, float margin) {
for (int i = 0; i < this.points.length; i++) {
if (Math.abs(x - this.points [i][0]) <= margin && Math.abs(y - this.points [i][1]) <= margin) {
return i;
}
}
return -1;
}
COM: <s> returns the index of the point of this room equal to </s>
|
funcom_train/12625068 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getTestSuiteClassName(ITestElement elem) {
String className = null;
if (elem == null) {
return className;
}
if (elem instanceof ITestSuiteElement) {
className = getTestSuiteClassName(((ITestSuiteElement) elem)
.getChildren()[0]);
} else if (elem instanceof ITestCaseElement) {
className = ((ITestSuiteElement) elem.getParentContainer())
.getSuiteTypeName();
}
return className;
}
COM: <s> return the the test suite class which is running </s>
|
funcom_train/26519227 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void decrypt( IKey key, IPart part ) {
try {
xjava.security.Cipher ci = xjava.security.Cipher.getInstance( mCipher, mProvider );
ci.initDecrypt( key.getKey() );
byte[] ct = (byte[]) part.getContent();
ct = ci.crypt( ct );
part.setContent( ct );
} catch (Exception ex ) {
printError( ex );
}
}
COM: <s> note does not call update on the part </s>
|
funcom_train/33281934 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void jsxSet_hash(String hash) {
// IMPORTANT: This method must not call setUrl(), because
// we must not hit the server just to change the hash!
if (hash != null) {
if (hash.length() > 0 && ('#' == hash.charAt(0))) {
hash = hash.substring(1);
}
}
hash_ = hash;
}
COM: <s> sets the hash portion of the location url the portion following the </s>
|
funcom_train/36061415 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getAddressFromInt( int addressInt ){
int quad1 = addressInt >> 24;
if( quad1 < 0 )
quad1 = 256 + quad1;
int quad2 = (addressInt & 0x00ff0000) >> 16;
int quad3 = (addressInt & 0x0000ff00) >> 8;
int quad4 = addressInt & 0x000000ff;
return quad1 + "." + quad2 + "." + quad3 + "." + quad4;
}
COM: <s> derives a dotted quad string from the integer representation of an ip address </s>
|
funcom_train/16462437 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void replyManager_refreshKeywordList() {
Object replyManagerListComponent = find(COMPONENT_REPLY_MANAGER_LIST);
removeAll(replyManagerListComponent);
for (KeywordAction action : keywordActionDao.getReplyActions()) {
add(replyManagerListComponent, getReplyManagerRow(action));
}
replyManager_enableButtons(getSelectedItems(replyManagerListComponent).length > 0);
setEnabled(find(COMPONENT_REPLY_MANAGER_CREATE_BUTTON), true);
}
COM: <s> refreshes the keyword list on the reply manager </s>
|
funcom_train/19270495 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void handleUndefinedMode(CliOptionContainer option) {
CliStyle style = this.cliState.getCliStyle();
CliStyleHandling handling = style.modeUndefined();
if (handling != CliStyleHandling.OK) {
ObjectNotFoundException exception = new ObjectNotFoundException(CliMode.class, option.getOption().mode());
handling.handle(getLogger(), exception);
}
}
COM: <s> this method handles a </s>
|
funcom_train/50556817 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGettingUCC128BarcodeReturnsCorrectType() throws Exception {
params.put("type", "UCC128");
params.put("appid", UCCEAN128Barcode.GTIN_AI);
req.setParameters(params);
servlet.doGet(req, res);
assertEquals("image/png", res.getContentType());
assertTrue(res.hasOutput());
}
COM: <s> verifies fix for bug 736794 </s>
|
funcom_train/35683098 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void initModel(final IFile xsdFile) throws CoreException {
_genModel.setXsdFile(xsdFile.getLocation().toFile());
try {
_jaxbPackageName.setText(_genModel.getJaxbPackageName());
_coxbPackageName.setText(_genModel.getCoxbPackageName());
} catch (CoxbGenException e) {
throwCoreException(e);
}
}
COM: <s> create an initial model based on the selected xml schema </s>
|
funcom_train/15726295 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Item create(String type) {
ItemPrototype prototype = prototypeByType(type);
Model m = new Model();
m.setName(type);
ItemEntity ie = new ItemEntity(type, m);
if (prototype.isContainer())
return container(prototype, ie);
else
return item(prototype, ie);
}
COM: <s> creates and item and fills it with default item entity </s>
|
funcom_train/46860725 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JMenuItem getMnuitmSelectNone() {
if (mnuitmSelectNone == null) {
mnuitmSelectNone = new JMenuItem();
mnuitmSelectNone.setText("Select None");
mnuitmSelectNone.setIcon(new ImageIcon(getClass().getResource("/resources/icons/clear.png")));
mnuitmSelectNone.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
SelectNone();
}
});
}
return mnuitmSelectNone;
}
COM: <s> this method initializes mnuitm select none </s>
|
funcom_train/38724261 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void parseParameters(String[] argv) {
parameters = new HashMap<String, String>();
for (int i = 0; i < argv.length; i++) {
if (argv[i].startsWith("--config=")) {
parameters.put("--config", argv[i].substring(9));
}
//Todo: other command line parameters
}
}
COM: <s> parses prompt parameters and stores them to hash map parameters </s>
|
funcom_train/50354850 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JComboBox getSimulationTypeComboBox() {
if (simulationTypeComboBox == null) {
simulationTypeComboBox = new JComboBox(new String[] {
"Auth Only",
"Auth & Acct (Start, Interim, Stop)",
"Auth & Acct (Start, Stop)" });
// "Auth & Acct (Start until you Stop)" });
}
COM: <s> this method initializes simulation type combo box </s>
|
funcom_train/43337118 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public InstanceContext getContext(MultipleDimensionType mdt, int scen_seg) {
if (mdt == null)
return null;
Iterator<String> contextIterator = contextMap.keySet().iterator();
while (contextIterator.hasNext()) {
String currID = contextIterator.next();
InstanceContext currCtx = contextMap.get(currID);
if (currCtx.getDimensionalInformation(scen_seg) != null
&& currCtx.getDimensionalInformation(scen_seg).equals(mdt)) {
return currCtx;
}
}
return null;
}
COM: <s> returns the context for a specific dimension domain combination which is </s>
|
funcom_train/22758022 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void show(Element r, Element c, List <ElementPair> collected) {
showParents(r, c, collected);
int n;
if ((n = c.getParentCount()) > 0) {
for (int i = 0; i < n; i++) {
show(r, c.getParents()[i], collected);
}
}
}
COM: <s> iterates over all parents in a row and adds the visited parents </s>
|
funcom_train/14093267 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testEvaluateMatchesString() {
String leftside = "ABCD";
String rightside = "BC";
int operation = Operator.Operation.MATCH;
boolean ignoreCase = false;
boolean expectedReturn = true;
boolean actualReturn = Operator.evaluate(leftside, rightside, operation,
ignoreCase);
assertEquals("return value", expectedReturn, actualReturn);
}
COM: <s> test match true </s>
|
funcom_train/2487799 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Boolean useJava5() {
String templateValue = (String) getTemplateSettings().get(GragGenerator.TEMPLATE_USE_JAVA5);
if (templateValue == null || "false".equalsIgnoreCase(templateValue)) {
return new Boolean(false);
}
else {
return new Boolean(true);
}
}
COM: <s> check if the use java5 checkbox was checked to generate java5 support </s>
|
funcom_train/33734559 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private ByteArrayBuffer readBytesFromInputStream(InputStream in) throws IOException {
final int bufferSize = 1024;
ByteArrayBuffer bytes = new ByteArrayBuffer(bufferSize);
byte buffer[] = new byte[bufferSize];
int read = 0;
try {
while((read = in.read(buffer)) != -1) {
bytes.append(buffer, 0, read);
}
in.close();
} catch(Exception ex) {
log.error("Error reading from the input stream to the buffer", ex);
}
return bytes;
}
COM: <s> method to read bytes from an input stream into a byte array buffer </s>
|
funcom_train/51104349 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void initEventBridgeParameters(Map properties) {
String eventBridgeFactoryName = (String) properties
.get(BaseRemoteService.EVENT_BRIDGE_FACTORY_PROPERTY);
if (eventBridgeFactoryName != null) {
Map eventBridgeParameters = new HashMap(properties);
eventBridgeParameters.remove(BaseRemoteService.EVENT_BRIDGE_FACTORY_PROPERTY);
this.eventBridgeFactoryName = eventBridgeFactoryName;
this.eventBridgeParameters = eventBridgeParameters;
}
}
COM: <s> initializes event bridge parameters for remote clients peer to peer communications </s>
|
funcom_train/22557051 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String XML2String() throws Exception, Error{
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
//initialize StreamResult with File object to save to file
StreamResult result = new StreamResult(new StringWriter());
DOMSource source = new DOMSource(dom);
transformer.transform(source, result);
String xmlString = result.getWriter().toString();
return xmlString;
}
COM: <s> returns a string that contains the xml file </s>
|
funcom_train/26022238 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String stringToRegex(String sourceCode) {
// add whitespace before and after any non-character
sourceCode = addWhitespaceAroundNonLiteral(sourceCode);
// replace non literal with proper regex
sourceCode = replaceNonLiteralWithProperRegex(sourceCode);
// replace blank spaces with proper regex
sourceCode = replaceWhitespaceWithRegex(sourceCode);
return sourceCode;
}
COM: <s> returns regular expression of source code </s>
|
funcom_train/21913326 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addStatePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_StateForm_state_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_StateForm_state_feature", "_UI_StateForm_type"),
UIMPackage.Literals.STATE_FORM__STATE,
true,
false,
true,
null,
null,
null));
}
COM: <s> this adds a property descriptor for the state feature </s>
|
funcom_train/16486345 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String getResource( String fileName ) throws FusionGWException {
if( registry.equals( "org.fusiongw.velocity.cache", "true" ) ) {
Object resource = cache.get( fileName );
if( resource == null ) {
resource = kernel.getFileAsString( fileName );
cache.put( fileName, resource );
}
return resource.toString();
} else
return kernel.getFileAsString( fileName );
}
COM: <s> gets a resource or a cached resource </s>
|
funcom_train/20210644 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setupListeners() {
History.addHistoryListener(this);
EventManager.getInstance().addEventListener(LoginEventType.LOGIN.toString(), this);
EventManager.getInstance().addEventListener(LoginEventType.LOGOUT.toString(), this);
EventManager.getInstance().addEventListener(LoginEventType.TIMEOUT.toString(), this);
}
COM: <s> register the dashboard as listener for different types of events </s>
|
funcom_train/28996230 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getGroupIds() {
String groupIds = "";
Group[] grps = getGroups();
if (grps != null && grps.length > 0) {
for (int i = 0; i < grps.length; i++) {
groupIds += grps[i].getId();
if (i < grps.length - 1) {
groupIds += ",";
}
}
}
return groupIds;
}
COM: <s> return a comma delimeted string of group ids for this user </s>
|
funcom_train/45771893 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public EmbeddedObject getEmbeddedObject(String name) {
if (name == null) {
return null;
}
if (embeddedObjects == null) {
getEmbeddedObjects();
}
if (embeddedObjects.containsKey(name)) {
return (EmbeddedObject)embeddedObjects.get(name);
}
else {
return null;
}
}
COM: <s> returns the embedded object corresponding to the name provided </s>
|
funcom_train/50119509 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String query_jurney_room(int n) {
String rname = "";
if(n == DEST1)
rname = (String) query_dest_room(0);
else
if(n == DEST2)
rname = (String) query_dest_room(1);
else
rname = (String) jurney_rooms.elementAt(n);
return rname;
}
COM: <s> returns a journey room </s>
|
funcom_train/8342957 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void initThisComponent() {
editListenerList = new ArrayList<TableEditedListener>();
dataRequestedListeners = new Vector<DataRequestedListener>();
setLayout(new BorderLayout());
this.add(initToolbar(), BorderLayout.NORTH);
this.add(initTable(), BorderLayout.CENTER);
this.addComponentListener(this);
setOpaque(true);
setInsets(2, 2, 2, 2);
}
COM: <s> initialize this component </s>
|
funcom_train/5544575 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String command(String commandText){
String temp = "";
if(isSpecialCommand(commandText)){
this.specialAction(commandText);
}
else{
sendCommand(commandText);
temp = getResponse();
if(commandText.compareTo("quit") == 0){
disconnect();
}
}
return temp;
}
COM: <s> send command to gtp engine and received reponse </s>
|
funcom_train/41382486 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Control createHeader(Composite parent) {
Label description = new Label(parent, SWT.NONE);
description.setText(MessagesPreference.LPDocPreferencePage_description);
GridData gridData= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
gridData.widthHint= 150; // only expand further if anyone else requires it
description.setLayoutData(gridData);
return description;
}
COM: <s> creates the label describing the preference page </s>
|
funcom_train/20433549 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void selectItem() {
removeAll();
currMenuItems = new JButton[item.getSubMenu().length];
for (int i = 0; i < currMenuItems.length; i++) {
currMenuItems[i] = new JButton(ITEMS[item.getSubMenu()[i]]
.toString());
currMenuItems[i].addActionListener(new ItemActionListener(
ITEMS[item.getSubMenu()[i]]));
add(currMenuItems[i]);
}
updateUI();
}
COM: <s> selects options menu item initializes the new current menu items and </s>
|
funcom_train/10514630 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void stringReplace(StringBuffer str, String str1, String str2) {
int found = str.indexOf(str1);
final int str1Length = str1.length();
final int str2Length = str2.length();
while (found >= 0) {
str.replace(found, found + str1Length, str2);
found = str.indexOf(str1, found + str2Length);
}
}
COM: <s> replace occurrences of str1 in string buffer str with str2 </s>
|
funcom_train/13781436 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void checkSchemaVersion(NodeTypeManager ntm) throws RepositoryException {
String schemaVersion = getCurrentSchemaVersion(ntm);
// compare expected and repository schema versions
String expectedVersion = getExpectedSchemaVersion();
if (!expectedVersion.equals(schemaVersion)) {
throw new RepositoryException("Schema version is different. Has (" + schemaVersion + ") when ("
+ expectedVersion + ") expected.");
}
}
COM: <s> checks whether schema version of the repository is valid </s>
|
funcom_train/50344205 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setTrain(Train train) {
Train old = _train;
_train = train;
if ((old != null && !old.equals(train)) || old != train){
if(old != null){
old.removePropertyChangeListener(this);
}
if(train != null)
train.addPropertyChangeListener(this);
firePropertyChange(TRAIN_CHANGED_PROPERTY, old, train);
}
}
COM: <s> sets the train that will service this rolling stock </s>
|
funcom_train/22946093 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setValues(){
try{
positiveValue=Double.parseDouble(panel.positiveValueTF.getText());
negativeValue=Double.parseDouble(panel.negativeValueTF.getText());
}
catch (Exception e){
positiveValue=Double.MAX_VALUE;
negativeValue=Double.MIN_VALUE;
}
}
COM: <s> sets missing value variable by the value from panel </s>
|
funcom_train/125598 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public TS createShiftDumTS(String name, TSDateRange shiftRange) {
if (name == null || name.length() == 0)
throw new IllegalArgumentException("Dummy name cannot be empty.");
String check = encloses(shiftRange);
if (check != null)
throw new IllegalArgumentException(check);
double[] obs = createShiftDum(shiftRange);
TS dummy = new TS(obs, name, lowerBound(), TSTypes.DETERMINISTIC);
return dummy;
}
COM: <s> creates a time series that is a shift dummy for this range </s>
|
funcom_train/46188338 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void indexBlogEntries(Collection<BlogEntry> blogEntries) {
synchronized (blog) {
try {
Analyzer analyzer = getAnalyzer();
IndexWriter writer = new IndexWriter(blog.getSearchIndexDirectory(), analyzer, false);
for (BlogEntry blogEntry : blogEntries) {
index(blogEntry, writer);
}
writer.close();
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
}
COM: <s> allows a collection of blog entries to be indexed </s>
|
funcom_train/48406382 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addUsedToolPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_TaskDefinition_usedTool_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_TaskDefinition_usedTool_feature", "_UI_TaskDefinition_type"),
SpemxtcompletePackage.eINSTANCE.getTaskDefinition_UsedTool(),
true,
false,
true,
null,
null,
null));
}
COM: <s> this adds a property descriptor for the used tool feature </s>
|
funcom_train/48668101 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void changeMonitoringLevel(MonitoringLevel level) throws InvalidConfiguration, Throwable {
for(Iterator<Entity> iter = fChildrenEntities.values().iterator(); iter.hasNext();) {
EntityConfiguration nConf = new EntityConfiguration();
nConf.setMonitoringLevel(level);
nConf.setRecursiveMonitoringLevel(true);
((WebSphereEntity)iter.next()).configure(nConf);
}
}
COM: <s> this is called by the agent when its monitoring level has changed </s>
|
funcom_train/1060456 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void createPartControl(Composite parent) {
messageViewer = new StyledText(parent, SWT.V_SCROLL | SWT.MULTI);
GridData messageViewerData = new GridData();
messageViewerData.heightHint = 200;
messageViewerData.horizontalAlignment = GridData.FILL;
messageViewerData.verticalAlignment = GridData.FILL;
messageViewerData.grabExcessHorizontalSpace = false;
messageViewerData.grabExcessVerticalSpace = true;
messageViewer.setLayoutData(messageViewerData);
messageViewer.setEditable(false);
}
COM: <s> this is a callback that will allow us </s>
|
funcom_train/21846471 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object getSettingValue(String settingName) {
synchronized (Settings.class) {
Object value = settingsMap.get(settingName);
if (value == null && !customSettingsNamesMap.containsKey(settingName)) {
value = Settings.getValue(getKitClass(), settingName);
if (value == null) {
value = NULL_VALUE;
}
settingsMap.put(settingName, value);
}
return (value != NULL_VALUE) ? value : null;
}
}
COM: <s> get the value of the given setting </s>
|
funcom_train/2624812 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public PDimension getDeltaRelativeTo(final PNode nodeOnPath) {
if (pickPath == null) {
throw new RuntimeException("Attempting to use pickPath for a non-mouse event.");
}
final PDimension r = getCanvasDelta();
return (PDimension) pickPath.canvasToLocal(r, nodeOnPath);
}
COM: <s> return the delta between the last and current mouse positions relative to </s>
|
funcom_train/36359897 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Spacer getSpacer6() {
if (spacer6 == null) {//GEN-END:|71-getter|0|71-preInit
// write pre-init user code here
spacer6 = new Spacer(16, 1);//GEN-LINE:|71-getter|1|71-postInit
// write post-init user code here
}//GEN-BEGIN:|71-getter|2|
return spacer6;
}
COM: <s> returns an initiliazed instance of spacer6 component </s>
|
funcom_train/10937892 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean startStartLoaders() {
synchronized (this.loaders) {
// start the loaders
for (StartupLoader loader: this.loaders) {
if (this.serverStopping) {
return false;
}
try {
loader.start();
} catch (StartupException e) {
e.printStackTrace();
return false;
}
}
serverStarted = true;
}
return true;
}
COM: <s> returns code true code if all loaders were started </s>
|
funcom_train/3272887 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Chassis readChassis() throws IOException, MultiplayerException {
// Populate a Ship Chassis
Chassis chassis = null;
String chassisTag = peek().value;
// Read runtime type-specific data
if(chassisTag.equals(EvenChassis.ELEMENT_NAME)){
chassis = new EvenChassis(this);
}
else if(chassisTag.equals(MassChassis.ELEMENT_NAME)){
chassis = new MassChassis(this);
}
else if(chassisTag.equals(SpaceChassis.ELEMENT_NAME)){
chassis = new SpaceChassis(this);
}
return chassis;
}
COM: <s> read a ship chassis from the stream </s>
|
funcom_train/7982591 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Connection getConnection() throws SQLException {
if ((conn != null) && !conn.isClosed()) {
return conn;
}
if (dataSource == null) {
initialize();
}
// Keep this around to allow re-use
// Caller should make sure conn is released to pool
conn = dataSource.getConnection();
return conn;
}
COM: <s> returns a connection </s>
|
funcom_train/50502145 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void unloadPlugin(){
if(!isLoaded()){
log.warn("Task not yet loaded, aborting unload.");
return;
}
// unload editors and command providers
activateEditorFactories(false);
activateCommands(false);
activateGlue(ch.orcasys.ideplugin.EditorContext.getHostType(), false);
loaded = false;
}
COM: <s> this method sets loaded to false deactivates the involved classes </s>
|
funcom_train/25195808 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected CZTDefEntry getDefEntryByLocAnn(ZName zName){
Map<String, CZTDefEntry> entries = defTable.get(zName.getWord());
if (entries != null)
for (CZTDefEntry entry : entries.values()){
if (entry.matches((ZName) zName))
return entry;
}
return null;
}
COM: <s> utility to find a def entry that matches the current one </s>
|
funcom_train/16165219 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void run() {
int cnt = 1;
try {
InetAddress address = InetAddress.getByName("130.226.45.127");
for (;;) {
// send request
byte[] buf = ("Hello "+cnt).getBytes();
++cnt;
DatagramPacket packet =
new DatagramPacket(buf, buf.length, address, 1234);
socket.send(packet);
System.out.print('*');
Thread.sleep(1000);
}
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
COM: <s> kind of ping the client to send a new packet </s>
|
funcom_train/15645059 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isNonWorkingDay(final E date) {
if (date != null && (holidayCalendar.getEarlyBoundary() != null || holidayCalendar.getLateBoundary() != null)) {
checkBoundary(date);
}
return (isWeekend(date) || holidayCalendar.isHoliday(date));
}
COM: <s> is the given date a non working day </s>
|
funcom_train/51146505 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean driverFound( String driverName ) {
IEditorUtility editorUtility = XEditorProjectManager.getEditorUtility();
URL[] urls = editorUtility.getProjectURLs( currentProject );
ClassLoader classLoader = new URLClassLoader( urls );
boolean driverFound = true;
try {
Class.forName( driverName, false, classLoader );
}
catch( ClassNotFoundException ex ) {
driverFound = false;
}
return driverFound;
}
COM: <s> tests whether the the specified tabase driver is in the projects </s>
|
funcom_train/22345420 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setReady(int type) {
// Server is available
T.tyInfo.setStatus(TymeacInfo.AVAILABLE);
// Server is this type
T.tyInfo.setStartType(type);
// *--- all done message ---*
msgOut(TyMsg.getMsg(99) + T.start_time, 10);
} // end-method
COM: <s> set ready for clients </s>
|
funcom_train/29029737 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public GridLineBuilder segment(float lengthLineSegment, float lengthBlankSegment) {
if (lengthBlankSegment < 0)
throw new IllegalArgumentException(
"lengthBlankSegement can not be < 0");
if (lengthLineSegment < 0)
throw new IllegalArgumentException(
"lengthLineSegment can not be < 0");
this.isStepSizeDefined = true;
this.lengthLineSegment = lengthLineSegment;
this.lengthBlankSegment = lengthBlankSegment;
return this;
}
COM: <s> adds the segment </s>
|
funcom_train/12162226 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testControlSingleSelect() throws Exception {
privateSetUp();
boolean[] selected = {false, false, false};
// no options selected
// single select - ie radio
// vertical options
// align caption to the left
// do not create any optgroups
boolean multiple = false;
boolean vertical = true;
boolean alignright = false;
int optGroupCount = 0;
doTestControlSelect(selected, multiple, vertical,
alignright, optGroupCount);
}
COM: <s> test the output for a single control select </s>
|
funcom_train/51058820 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void switchApplet() throws Exception {
setState(STATE_SWITCHING_APPLET);
percentage = 100;
debug_sleep(2000);
// set correct context classloader for lwjgl applet
Thread.currentThread().setContextClassLoader(classLoader);
Class appletClass = classLoader.loadClass(getParameter("al_main"));
lwjglApplet = (Applet) appletClass.newInstance();
lwjglApplet.setStub(this);
lwjglApplet.setSize(getWidth(), getHeight());
setLayout(new BorderLayout());
add(lwjglApplet);
validate();
setState(STATE_INITIALIZE_REAL_APPLET);
lwjglApplet.init();
setState(STATE_START_REAL_APPLET);
lwjglApplet.start();
}
COM: <s> replace the current applet with the lwjgl applet </s>
|
funcom_train/35744496 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected ID intern() {
synchronized (ID.class) {
Reference<ID> common = interned.get(this);
ID result = null;
if (null != common) {
result = common.get();
}
if (null == result) {
interned.put(this, new WeakReference<ID>(this));
result = this;
}
return result;
}
}
COM: <s> returns a canonical representation for the id object </s>
|
funcom_train/10948318 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void checkFile(String label, File file, Collection<File> files) {
for (int i = 0; i < 20; i++) {
if (files.contains(file)) {
return; // found, test passes
}
sleepHandleInterruped(pauseTime);
}
fail(label + " " + file + " not found");
}
COM: <s> check all the file collections have the expected sizes </s>
|
funcom_train/23824961 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Rectangle rectangleToZoomedRectangle(Rectangle rect) {
Rectangle convertedRect = new Rectangle(rect);
convertedRect.x = (int) (convertedRect.x * (zoomLevel / 100.0));
convertedRect.y = (int) (convertedRect.y * (zoomLevel / 100.0));
convertedRect.width = (int) (convertedRect.width * (zoomLevel / 100.0));
convertedRect.height = (int) (convertedRect.height * (zoomLevel / 100.0));
return convertedRect;
}
COM: <s> converts a code rectangle code to a zoomed code rectangle code </s>
|
funcom_train/26484006 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected JPanel buildButtonPanel() {
JPanel buttonPanel = new JPanel();
JButton button;
buttonPanel.add(button = new JButton(I18N.get("GUI.ok")));
button.addActionListener(this);
button.setDefaultCapable(true);
buttonPanel.add(button = new JButton(I18N.get("GUI.cancel")));
button.addActionListener(this);
return buttonPanel;
}
COM: <s> builds and returns a panel containing the ok and cancel </s>
|
funcom_train/18986275 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Array createArrayOf(String typeName, Object[] elements) throws SQLException
{
return (Array) callMethodRtnObj("createArrayOf",
new Class[] { String.class, Object[].class },
new Object[] { typeName, elements });
}
COM: <s> factory method for creating array objects </s>
|
funcom_train/20364783 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testBasic() {
//make test Skill
Skill skillA = new Skill();
skillA.setName("Coding");
for (String s : testChildren ) {
skillA.getChildren().add(s);
}
//Test it
assertTrue( skillA.getName().equals("Coding"));
assertEquals( skillA.getChildren().size(), testChildren.length );
for (String s : testChildren ) {
assertTrue( skillA.getChildren().contains(s));
}
assertTrue( skillA.equals(skillA) );
}
COM: <s> test basic functionality </s>
|
funcom_train/34673442 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testValidatorServiceInRangeSuccess() throws Exception {
// set up key & value & validation
String key = "TestForm";
TestTypesObject value = new TestTypesObject();
value.setShortValue("10");
value.setIntValue("10");
value.setFloatValue("10");
value.setDoubleValue("10");
String validationXml = getCore().getParameterValue("ServiceInRangeValidationSpec","");
String error = testValidatorServiceGeneric(key, value, validationXml);
if(error.equals("")){
// success - no errors
return;
}
System.out.println();
System.out.println("testValidatorServiceInRangeSuccess");
System.out.println(error);
fail(error);
}
COM: <s> test validator service value range validation </s>
|
funcom_train/47615964 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void updateMeting() {
// Load in a new measurement
meting = new Meting(getDate(), getTime(), controller.getHumidity(), controller.getLight(), controller
.getTemperature());
// Refresh the GUI in a new thread
SwingUtilities.invokeLater(new Runnable() {
public void run() {
refresh();
}
});
}
COM: <s> update the measurements </s>
|
funcom_train/12562128 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void restrictAPIAccess() {
if (midletSuite.checkPermission(
Permissions.getName(Permissions.AMS)) != 1) {
// Permission is not allowed.
//
// Shutdown access to Isolate references before a MIDlet is
// loaded. This will not effect the reference already obtained.
currentIsolate.setAPIAccess(false);
}
}
COM: <s> restricts suite access to internal api </s>
|
funcom_train/50366886 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void executeUpdate ( Connection con, String sqlStatement )
throws Exception {
try {
Statement s = con.createStatement ( );
s.execute ( sqlStatement );
s.close ( );
} catch ( SQLException e ) {
System.out.println ( "Error executing sql statement" );
throw ( e );
}
}
COM: <s> this method executes an update statement </s>
|
funcom_train/17675415 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JdoExtension findFetchGroupExt(JdoExtension[] a) {
if (a == null) return null;
int n = a.length;
for (int i = 0; i < n; i++) {
if (a[i].key == JdoExtensionKeys.FETCH_GROUP) return a[i];
}
return null;
}
COM: <s> return the first fetch group extension in a or null if none </s>
|
funcom_train/44778944 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addValues(DistinctPropertyValues values) {
if (values == null) {
return;
}
Property [] properties = values.getDefinedProperties();
for (int i=0; i<properties.length; i++) {
List current = values.getValues(properties[i]);
addValues(properties[i], current);
}
}
COM: <s> this adds the given values to this instance </s>
|
funcom_train/10655556 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetMaximumSpan01() {
assertEquals(view.getPreferredSpan(View.X_AXIS), view.getMaximumSpan(View.X_AXIS),
0.000001f);
assertEquals(view.getPreferredSpan(View.Y_AXIS), view.getMaximumSpan(View.Y_AXIS),
0.000001f);
}
COM: <s> tests code get maximum span code with default view setup </s>
|
funcom_train/21616493 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean checkForUserName(String userName) {
Thread[] threadArray = new Thread[connections.activeCount()];
connections.enumerate(threadArray);
for (int x=0;x<threadArray.length;x++) {
if (((ConnectionThread) threadArray[x]).getUserName().compareToIgnoreCase(userName) == 0) {
return true;
}
}
return false;
}
COM: <s> check to see if a user is logged into another thread </s>
|
funcom_train/27943659 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public URL getResource( String strResName ) {
try {
URL url = new URL( "jar:file:" + jarFile.getName() + "!/" + strResName );
return url;
} catch( MalformedURLException e ) {
System.err.println( "JJarClassloader.getResource() - " + e );
return null;
}
}
COM: <s> get the resource following the first jjar class loader rule </s>
|
funcom_train/4681240 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeChatArea(int userID) {
// Loop all chatwindows
for (int i = 0; i < chatWindows.size(); i++) {
ChatWindows curChat = (ChatWindows) chatWindows.get(i);
// If this is the correct chatwindow
if (userID == curChat.getID()) {
// Remove it and end
chatWindows.remove(i);
break;
}
}
}
COM: <s> this will remove the chatwindow for the specified user </s>
|
funcom_train/28471734 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetSubject() {
News testNews = new News();
String testSubj1 = "Tulpen und Narzissen";
String testSubj2 = "Guns And Trucks";
testNews.setSubject(testSubj1);
assertTrue(testSubj1.equals(testNews.getSubject()));
testNews.setSubject(testSubj2);
assertTrue(testSubj2.equals(testNews.getSubject()));
}
COM: <s> this should test the methods get subject and set subject of news </s>
|
funcom_train/37125224 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void close() {
java.util.logging.Handler[] handlers = getHandlers() ;
for(int i=0; (handlers != null) && (i < handlers.length); i++) {
java.util.logging.Handler handler = handlers[i] ;
if(handler != null) {
handler.flush() ;
handler.close() ;
}
}
}
COM: <s> close the handlers on exit </s>
|
funcom_train/50983431 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testConstructor_null() {
try {
new MockWorkerTask(null);
fail("Expected NullPointerException");
}
catch( final NullPointerException e ) {
// Expected path;
}
assertEquals( "", new MockWorkerTask().getName() );
assertEquals( "foo", new MockWorkerTask("foo").getName() );
}
COM: <s> try null in the constructor </s>
|
funcom_train/2026424 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel getJButtonPanel() {
if (jButtonPanel == null) {
jButtonPanel = new JPanel();
jButtonPanel.setLayout(new BoxLayout(getJButtonPanel(), BoxLayout.X_AXIS));
jButtonPanel.add(getJContButton(), null);
jButtonPanel.add(getJStopButton(), null);
jButtonPanel.add(getJUpdateButton(), null);
jButtonPanel.add(getJSplitButton(), null);
}
return jButtonPanel;
}
COM: <s> this method initializes j button panel </s>
|
funcom_train/9408500 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testTake() {
ExecutorService e = Executors.newCachedThreadPool();
ExecutorCompletionService ecs = new ExecutorCompletionService(e);
try {
Callable c = new StringTask();
ecs.submit(c);
Future f = ecs.take();
assertTrue(f.isDone());
} catch (Exception ex) {
unexpectedException();
} finally {
joinPool(e);
}
}
COM: <s> a taken submitted task is completed </s>
|
funcom_train/11470201 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public WebClient matrix(String name, Object ...values) {
if (!"".equals(name)) {
getCurrentBuilder().matrixParam(name, values);
} else {
addParametersToBuilder(getCurrentBuilder(), name, values[0], ParameterType.MATRIX);
}
return this;
}
COM: <s> updates the current uri matrix parameters </s>
|
funcom_train/19267812 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setKey(String key) throws BuildException {
if (key == null) {
throw new BuildException("Key name can not be null.");
}
if (isJavaIdentifier(key)) {
this.key = key;
} else {
throw new BuildException("Invalid key name: should be a valid Java identifier.");
}
}
COM: <s> set the name of the key in the poperty file </s>
|
funcom_train/7751753 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void deleteRow(final String rowKey, final String columnFamily, final ConsistencyLevel cLevel) throws Exception {
IOperation operation = new IOperation() {
@Override
public Object execute(Connection conn) throws Exception {
ColumnPath path = new ColumnPath(columnFamily);
conn.getAPI().remove(keyspace, rowKey, path, timestamp, cLevel);
return null;
}
};
tryOperation(operation);
}
COM: <s> delete a row with a specified key from a specified column family </s>
|
funcom_train/8569098 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private long calculateTotal(Base[] gene) {
long value = 0;
int l = gene.length;
for (int i = l - 1; i >= 0; i--) {
Base base = gene[i];
value += ((base.ordinal() - 2) * 4) * (l - i) * (l - i);
}
return value;
}
COM: <s> calculate a total number for the gene </s>
|
funcom_train/10789976 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean removeForeignKey(ForeignKey fk) {
if (fk == null || _fkList == null)
return false;
if (!_fkList.remove(fk))
return false;
Schema schema = getSchema();
if (schema != null && schema.getSchemaGroup() != null)
schema.getSchemaGroup().removeName(fk.getIdentifier());
_fks = null;
fk.remove();
return true;
}
COM: <s> remove the given foreign key from the table </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.