__key__ stringlengths 16 21 | __url__ stringclasses 1
value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/21422811 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JFrame getMonitorFrame() {
if (monitorFrame == null) {
monitorFrame = new JFrame();
monitorFrame.setBounds(settings.bounds);
monitorFrame.setTitle("P2P Monitor");
monitorFrame.setContentPane(this);
monitorFrame.addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent e) {
close();
}
});
}
return monitorFrame;
}
COM: <s> returns a reference to the main jframe </s>
|
funcom_train/18837600 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initializeClientListener() throws ServerException {
try {
clientListener = new ServerSocket(clientPort);
}
catch (IOException e) {
String message = "Fatal error in initializing client listener: "
+ e.getMessage();
logger.severe(message);
throw new ServerException(message);
}
logger.config("Listening for clients on port " + clientPort);
try {
clientListener.setSoTimeout(1000);
}
catch (SocketException e) {
logger.warning("Setting socket options raised an exception: " + e.getMessage());
}
}
COM: <s> initializes the socket that will be used to listen for client </s>
|
funcom_train/20503555 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Performance getPerformanceForBooking(Booking booking) {
List result = getHibernateTemplate().findByNamedQueryAndNamedParam(
"getPerformanceForBooking",
new String[] { "booking" },
new Object[] { booking }
);
return (result.isEmpty()) ? null : (Performance)result.get(0);
}
COM: <s> returns the performance associated with the given booking </s>
|
funcom_train/36851812 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void writeZoned(BigDecimal value, int integerDigits, int fractionalDigits) throws IOException {
if (value.scale() != 0) {
value = value.scaleByPowerOfTen(fractionalDigits);
}
writeZoned(Util.format(value, 0, '.', true), integerDigits + fractionalDigits);
}
COM: <s> writes a tt big decimal tt in zoned format </s>
|
funcom_train/40793892 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getCancelCommand6() {
if (cancelCommand6 == null) {//GEN-END:|182-getter|0|182-preInit
// write pre-init user code here
cancelCommand6 = new Command("Cancel", Command.CANCEL, 0);//GEN-LINE:|182-getter|1|182-postInit
// write post-init user code here
}//GEN-BEGIN:|182-getter|2|
return cancelCommand6;
}
COM: <s> returns an initiliazed instance of cancel command6 component </s>
|
funcom_train/9868192 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSetFeatureValues() throws Exception {
_setFeatureToAcceptedValue(Feature.READ_ONLY, false);
_setFeatureToUnacceptedValue(Feature.READ_ONLY, true);
_setFeatureToAcceptedValue(Feature.AUTOMERGE, false);
_setFeatureToUnacceptedValue(Feature.AUTOMERGE, true);
}
COM: <s> tests if enabling disabling of various features delivers the expected </s>
|
funcom_train/49476822 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public PortalObject getTraficRepartitionForPeriod(String type, String dataName, int period) throws Exception {
Db db = dbRO();
try {
_logger.info("Portal : getTraficRepartitionForPeriod: "+type+","+dataName+","+period);
return PortalDataProvider.getTraficRepartitionForPeriod(db, type, dataName, period);
} catch (Exception e) { store(e); throw e; } finally { db.safeClose(); }
}
COM: <s> get trafic repartition for period webservice for getting the repartition of web trafic </s>
|
funcom_train/26318085 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean hasTacticalGenius(Player player) {
for (Entity entity : entities) {
if (entity.getCrew().getOptions().booleanOption("tactical_genius")
&& entity.getOwner().equals(player)
&& !entity.isDestroyed() && entity.isDeployed()
&& !entity.getCrew().isUnconscious()) {
return true;
}
}
return false;
}
COM: <s> returns true if the player has a valid unit with the tactical genius </s>
|
funcom_train/33442010 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Point toMapPixelsTranslated(final Point in, final Point reuse) {
final Point out = reuse != null ? reuse : new Point();
// 26 is the biggest zoomlevel we can project
final int zoomDifference = 28 - getPixelZoomLevel();
out.set((in.x >> zoomDifference) + offsetX, (in.y >> zoomDifference) + offsetY);
return out;
}
COM: <s> performs the second computationally light part of the projection </s>
|
funcom_train/49081231 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void copyMessagesOneByOne(Folder targetFolder, Message[] messages) {
for (Message message : messages) {
Message[] aux = new Message[1];
aux[0] = message;
try {
targetFolder.appendMessages(aux);
} catch (MessagingException e) {
log.error("Error copying 1 message to " + targetFolder.getFullName() + " Folder", e);
}
}
}
COM: <s> copy the list of messages one by one to the target folder </s>
|
funcom_train/10833660 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Reference item(int i) throws XMLSecurityException {
if (this.references.get(i) == null) {
// not yet constructed, so _we_ have to
Reference ref = new Reference(referencesEl[i], this.baseURI, this);
this.references.set(i, ref);
}
return this.references.get(i);
}
COM: <s> return the it i it sup th sup reference </s>
|
funcom_train/42044609 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String createFinder(DescriptorModel descriptorModel, boolean directoryOutput) throws IOException {
log("Building finder object " + descriptorModel.getFinderClass() + "...");
XMLFinderBuilder finder_builder = new XMLFinderBuilder(descriptorModel);
String text = finder_builder.build();
if (directoryOutput) {
// Save to disk
writeJavaFile(text, descriptorModel.getFinderClass());
}
return text;
}
COM: <s> create the finder class </s>
|
funcom_train/43752815 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Panel testMessagesPanel() {
FoodMessages foodMsgs = (FoodMessages)GWT.create(FoodMessages.class);
return new AxisPanel()
.put(foodMsgs.breakfastSpecial("Steak", "Potatoes", "Asparagus", "Coffee or Juice"))
.put(foodMsgs.breakfastSpecial("Chicken", "Rice", "Beans", "Pop or Juice"))
;
}
COM: <s> this just tests the resource bundle type utility offered by gwt </s>
|
funcom_train/21027453 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean convertibleToSwf(String from) {
log.debug("convertibleToSwf({})", from);
boolean ret = false;
if (!Config.SYSTEM_SWFTOOLS_PDF2SWF.equals("") && (Config.MIME_PDF.equals(from) || convertibleToPdf(from))) {
ret = true;
}
log.debug("convertibleToSwf: {}", ret);
return ret;
}
COM: <s> test if a mime document can be converted to swf </s>
|
funcom_train/30050471 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public GSSCredential getProxyFromMPS(String sessionId) throws Exception {
addTrustedCerts();
MyProxy myproxy = new MyProxy(myproxyHostname, myproxyPortNumber);
GSSCredential cred = myproxy.get(myproxyUserName, myproxyPassword, myproxyLifeTime);
ProxyManager.addProxy(sessionId, cred);
return cred;
}
COM: <s> get a proxy cert from myproxy server </s>
|
funcom_train/48578869 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getBackCommand3() {
if (backCommand3 == null) {//GEN-END:|194-getter|0|194-preInit
// write pre-init user code here
backCommand3 = new Command("Back", Command.BACK, 0);//GEN-LINE:|194-getter|1|194-postInit
// write post-init user code here
}//GEN-BEGIN:|194-getter|2|
return backCommand3;
}
COM: <s> returns an initiliazed instance of back command3 component </s>
|
funcom_train/5572537 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void configureLoggerFactory(Properties props) {
String factoryClassName = OptionConverter.findAndSubst(LOGGER_FACTORY_KEY,
props);
if(factoryClassName != null) {
LogLog.debug("Setting category factory to ["+factoryClassName+"].");
loggerFactory = (LoggerFactory)
OptionConverter.instantiateByClassName(factoryClassName,
LoggerFactory.class,
loggerFactory);
PropertySetter.setProperties(loggerFactory, props, FACTORY_PREFIX + ".");
}
}
COM: <s> check the provided code properties code object for a </s>
|
funcom_train/8065197 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void undoIt() {
Editor ed = (Editor) Globals.curEditor();
if (ed == null)
return;
if (_magnitude > 0.0) {
ed.setScale(ed.getScale() / _magnitude);
} else {
System.out.println("Cannot undo CmdZoom reset, yet.");
}
}
COM: <s> undo the zoom </s>
|
funcom_train/11311040 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addValid(Class<?> beanClass, AccessStrategy accessStrategy) {
List<AccessStrategy> slot = validAccesses.get(beanClass);
if (slot != null) {
slot.add(accessStrategy);
} else {
List<AccessStrategy> tmpList = new ArrayList<AccessStrategy>();
tmpList.add(accessStrategy);
validAccesses.put(beanClass, tmpList);
}
}
COM: <s> mark a property of code bean class code for nested validation </s>
|
funcom_train/46261280 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void doWrite(String data) {
request = ServerUtils.getClientRequest(clientMessageHeader, data);
if (isTransactionValid()) {
// write to file
sequenceNumberList.add(request.getSequenceNumber());
messageMap.put(request.getSequenceNumber(), data);
System.out.println("To write to file : " + data);
writeToFile();
sendACK();
} else {
sendError(errorCode);
}
}
COM: <s> write the data to the hidden file </s>
|
funcom_train/35240445 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Properties load() throws IOException {
if (!exists)
return this;
// Sorry it's an InputStream not a Reader, but that's what
// the superclass load method still requires (as of 1.4 at least).
InputStream inStr = new FileInputStream(fileName);
// now message the superclass code to load the file.
load(inStr);
inStr.close();
// Return "this" for convenience
return this;
}
COM: <s> load the properties from the saved filename </s>
|
funcom_train/50863511 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void endMission(String reason) {
// If at a settlement, associate all members with the settlement.
Iterator<Person> i = getPeople().iterator();
while (i.hasNext()) {
Person person = i.next();
if (person.getLocationSituation().equals(Person.INSETTLEMENT))
person.setAssociatedSettlement(person.getSettlement());
}
super.endMission(reason);
}
COM: <s> finalizes the mission </s>
|
funcom_train/31729234 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addItem(DataLayoutItem pd) {
ItemButton button = new ItemButton(pd);
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
DataLayoutItem item = ((ItemButton)e.getSource()).item;
addToLine(new JLabel(item.toString()), item);
}});
items.add(button);
button_labels.put(pd.toString(), button);
pack();
item_panel.revalidate();
line_panel.revalidate();
}
COM: <s> code add item code inserts a new piece of information that the user </s>
|
funcom_train/18049037 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean showDialog() {
// MODIFIES: this
// EFFECTS: Makes the dialog visible on the screen and sets the order
// to the front such that it is
// editable to the user modally, meaning input is blocked in other windows
// until either OK or Cancel is pressed by the user. Returns true if
// the user pressed OK, false otherwise.
setVisible(true);
toFront();
return pressedOK();
}
COM: <s> shows the editor window dialog </s>
|
funcom_train/9298412 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected final String TEXT_105 = NL + NL + "\t/**" + NL + "\t * @see HttpServlet#doDelete(HttpServletRequest, HttpServletResponse)" + NL + "\t */" + NL + "\tprotected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {" + NL + "\t\t// TODO Auto-generated method stub" + NL + "\t}";
COM: <s> protected final string text 104 nl nl t nl t </s>
|
funcom_train/25826883 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Number getMaximumOfList(List<Number> list) {
if (list.isEmpty()) return null;
Number max = list.get(0);
for (int i = 1; i < list.size(); i++) {
if (list.get(i).doubleValue() > max.doubleValue()) {
max = list.get(i);
}
}
return max;
}
COM: <s> usage return maximum of a list </s>
|
funcom_train/4291803 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean extractVariabilityInfo() throws Qvtr2Exception {
getLogger().logInfo("Extracting variability information");
VariabilityAnalyzer<TransformationType> va = new VariabilityAnalyzer<TransformationType>(
getTransAstHelper(parsingFacade.getAst()),
getVariabilityHelper(),
transformationPath.removeLastSegments(1).addTrailingSeparator(),
annotationsAST,
getLogger());
if (!va.analyze()) {
return false;
}
saveModel(va.getVariabilityModel(), variabilityModelURI);
return true;
}
COM: <s> performs the variability analysis </s>
|
funcom_train/29954497 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setValues(ParamObject obj) {
ShapeBlockObject param = (ShapeBlockObject)obj;
jTextFieldComment.setText(param.getComment());
ArrayList<ShapeObject> sh = param.getShapes();
setShapes(sh);
jTextFieldGrammar.setText("");
jTextFieldGrammar.setText(param.getGrammar());
}
COM: <s> set values param object obj </s>
|
funcom_train/16477511 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String extract_field_path(NamedNodeMap attributes) throws FileFormatException {
Node attrib;
attrib = attributes.getNamedItem("field_path");
if(attrib == null) return null;
else {
String path = attrib.getNodeValue();
if(path.equals(".")) return path; // return _reference_path; // the reference path object itself
else if(path.endsWith(".")) throw new FileFormatException("Cannot end a path with a . or ..");
else {
return path;
}
}
}
COM: <s> extract the path of a field from an attribute </s>
|
funcom_train/8073293 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void shrink() {
if(numElements<data.length/2 && data.length>300) {
IntSet result=new IntSet(numElements+100);
result.addAll(this);
this.data=result.data;
this.isThere=result.isThere;
this.lastIndex=result.lastIndex;
this.numElements=result.numElements;
}
}
COM: <s> deletes empty space if necessary </s>
|
funcom_train/28297985 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void loadImages() {
URL url;
// back pattern of the cards
for (int i=0; i<TransBaseSettings.maxColors;i++) {
url = getClass().getResource("/"+TransBaseSettings.filePathGraphic+"cardpattern"+(i+1)+".gif");
if (url!=null) {
imgPattern[i] = new ImageIcon(url);
if (imgPattern[i].getIconHeight()==-1) imgPattern[i]=null;
}
}
}
COM: <s> loads all images </s>
|
funcom_train/47614369 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private long calculateProductDiagonallyRD(int x, int y) {
if (x < matrix[y].length - 3 && y < matrix.length - 3) {
return matrix[y][x] * matrix[y + 1][x + 1] * matrix[y + 2][x + 2] * matrix[y + 3][x + 3];
}
else {
return 0;
}
}
COM: <s> calculate product diagonally in the right down direction </s>
|
funcom_train/119165 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected ConnectionSet handleConnectionSet(ConnectionSet cs) {
if (cs != null) {
ConnectionSet csundo = new ConnectionSet();
Iterator it = cs.connections();
while (it.hasNext()) {
ConnectionSet.Connection c =
(ConnectionSet.Connection) it.next();
Object edge = c.getEdge();
if (c.isSource())
csundo.connect(edge, getSource(edge), true);
else
csundo.connect(edge, getTarget(edge), false);
handleConnection(c);
}
return csundo;
}
return null;
}
COM: <s> applies code connection set code to the model </s>
|
funcom_train/48407140 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addAggregatedRolePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_CompositeRole_aggregatedRole_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_CompositeRole_aggregatedRole_feature", "_UI_CompositeRole_type"),
SpemxtcompletePackage.eINSTANCE.getCompositeRole_AggregatedRole(),
true,
false,
true,
null,
null,
null));
}
COM: <s> this adds a property descriptor for the aggregated role feature </s>
|
funcom_train/26096790 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getCommand(Request request) {
if (request instanceof ReconnectRequest) {
Object view = ((ReconnectRequest) request).getConnectionEditPart()
.getModel();
if (view instanceof View) {
Integer id = new Integer(ArneVisualIDRegistry
.getVisualID((View) view));
request.getExtendedData().put(VISUAL_ID_KEY, id);
}
}
return super.getCommand(request);
}
COM: <s> extended request data key to hold editpart visual id </s>
|
funcom_train/46620962 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private FileDialog getFileDialog() {
if (iFileDialog == null) {
try {
iFileDialog = new FileDialog(this);
iFileDialog.setName("FileDialog");
iFileDialog.setLayout(null);
centerDialog(iFileDialog);
} catch (Throwable iExc) {
handleException(iExc);
}
}
return iFileDialog;
}
COM: <s> return the file dialog property value </s>
|
funcom_train/46695961 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testExecute() {
System.out.println("execute");
Graph g = null;
PropertyToLink instance = new PropertyToLink();
instance.execute(g);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
COM: <s> test of execute method of class property to link </s>
|
funcom_train/5812806 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String determineSecurityName(Definition def) {
String securityName = (def.getSecurityName() == null ? m_config.getSecurityName() : def.getSecurityName() );
if (securityName == null) {
securityName = SnmpAgentConfig.DEFAULT_SECURITY_NAME;
}
return securityName;
}
COM: <s> helper method to find a security name to use in the snmp config </s>
|
funcom_train/37608647 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void clearScreen(int intno, int legno) {
itx = intno;
lgx = legno;
CatchKeys ckey = JavaDriver.getGKeys().getKEPP();
GMain gmain = JavaDriver.getGMain();
// hide map
ckey.hideDisplay();
// bring up turns panel
ckey.postProcessKeyEvent(new KeyEvent(
gmain, KeyEvent.KEY_PRESSED,
System.currentTimeMillis(),
KeyEvent.CTRL_DOWN_MASK,
KeyEvent.VK_L, 'L'));
} // end ClearScreen()
COM: <s> return user to the turns lanes screen when an error occurs </s>
|
funcom_train/8752271 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeRow(Object rowObject){
int rowIndex = getRowIndex(rowObject);
if ( rowIndex==-1 )
throw new IllegalArgumentException("Row for object not found. Object: "+rowObject);
if(rowIndex >= 0 && observableData != null && observableData.size() > rowIndex)
{
observableData.remove(rowIndex);
}
}
COM: <s> removes the row for the given object </s>
|
funcom_train/48024304 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JSONArray toJSONArray(JSONArray names) throws JSONException {
if ((names == null) || (names.length() == 0)) {
return null;
}
JSONArray ja = new JSONArray();
for (int i = 0; i < names.length(); i += 1) {
ja.put(opt(names.getString(i)));
}
return ja;
}
COM: <s> produce a jsonarray containing the values of the members of this jsonobject </s>
|
funcom_train/35677466 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getCounterCobolName(final String cobolName) {
if (cobolName.length() < 31 - COUNTER_COBOL_SUFFIX.length()) {
return cobolName + COUNTER_COBOL_SUFFIX;
} else {
return cobolName.substring(0, 30 - COUNTER_COBOL_SUFFIX.length())
+ COUNTER_COBOL_SUFFIX;
}
}
COM: <s> dynamic counters need a unique cobol name </s>
|
funcom_train/7794295 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getPrefixEnd() throws BadLocationException {
ITextRegion phpToken = getPHPToken();
int endOffset = regionCollection.getStartOffset() + phpScriptRegion.getStart() + phpToken.getTextEnd();
if (phpToken.getType() == PHPRegionTypes.PHP_CONSTANT_ENCAPSED_STRING) {
--endOffset;
}
return endOffset;
}
COM: <s> returns the end of the word on which code assist was invoked </s>
|
funcom_train/27960119 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void list(PrintWriter out) {
Enumeration keys = keys();
Enumeration elts = elements();
while (keys.hasMoreElements()) {
String key = (String) keys.nextElement();
String elt = (String) elts.nextElement();
String output = formatForOutput(key,elt);
out.println(output);
}
}
COM: <s> writes the key value pairs to the given print writer </s>
|
funcom_train/18443085 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object execute(final String name, final String... args) {
checkPermission(name, "execute");
ConsoleCommand command = getCommand(name);
if (command == null)
throw new UnsupportedOperationException("Command not found: " + name);
String[] nonNullArgs = (args == null) ? TK.EMPTY_STRING_ARRAY : args;
CommandOptions commandOptions = command.getCommandOptions();
if (commandOptions != null)
commandOptions.set(args);
synchronized (this) {
return command.onCommand(this, nonNullArgs);
}
}
COM: <s> executes the named command </s>
|
funcom_train/18950465 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Section modify( Section pSection, PropertySet pPropertySet ) throws ModifierException {
if( ErrorUtil.is_null( pSection, "pSection" ) ) {
return new BasicSection( Standard.EMPTY );
}
applyModificationsInOrder( pSection, pPropertySet );
return pSection;
}
COM: <s> modify the section </s>
|
funcom_train/5723618 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String addShortcut() {
try {
if (desktopInfo == null || desktopInfo.getId() == null) {
refreshDesktop();
}
desktopService2.linkInstitute(desktopInfo.getId(), instituteInfo.getId());
refreshDesktop();
} catch (Exception e) {
addError(i18n("institute_error_shortcut"), e.getMessage());
return Constants.FAILURE;
}
this.addMessage(i18n("institute_success_shortcut"));
return Constants.SUCCESS;
}
COM: <s> adds a shortcut to the institute </s>
|
funcom_train/805936 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void storeExpandedCategories(IDialogSettings settings) {
Object[] expandedElements = filteredTree.getViewer()
.getExpandedElements();
List<String> expandedElementPaths = new ArrayList<String>(
expandedElements.length);
for (Object o : expandedElements) {
if (o instanceof IWizardCategory) {
expandedElementPaths.add(((IWizardCategory) o).getPath()
.toString());
}
}
settings.put(STORE_EXPANDED_CATEGORIES_ID, expandedElementPaths
.toArray(new String[expandedElementPaths.size()]));
}
COM: <s> stores the collection of currently expanded categories in this pages </s>
|
funcom_train/3581923 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void expandUp(double x) {
int newSize = (int) Math.ceil((x - minimum) / binWidth);
int newContents[] = new int[newSize];
int n;
for (n = 0; n < contents.length; n++)
newContents[n] = contents[n];
for (n = contents.length; n < newSize - 1; n++)
newContents[n] = 0;
newContents[n] = 1;
contents = newContents;
}
COM: <s> expand the contents so that the highest bin include the specified </s>
|
funcom_train/26484999 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString() {
return "Format[size=" + size + ", bold=" + bold + ", italic=" + italic
+ ", underline=" + underline + ", wrap=" + wrap + ", align="
+ (align == null ? "null" : alignToString(align.intValue()))
+ ", format=" + format + ", color=" + color + ", font="
+ fontFamilyName + "]";
}
COM: <s> returns a string representation of this format </s>
|
funcom_train/3985362 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: static public PVector div(PVector v1, PVector v2, PVector target) {
if (target == null) {
target = new PVector(v1.x/v2.x, v1.y/v2.y, v1.z/v2.z);
} else {
target.set(v1.x/v2.x, v1.y/v2.y, v1.z/v2.z);
}
return target;
}
COM: <s> divide each element of one vector by the individual elements of another </s>
|
funcom_train/41962839 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void actionPerformed(ActionEvent arg0) {
if(arg0.getSource().equals(urlp.getEventTrigger())){
// get URL and send it to browser (main)
browser.setURL(urlp.getURL());
linktable.setURL(urlp.getURL());
linktable.updateLinks();
links.setViewportView(linktable.getTable());
}
}
COM: <s> action performed for new url in the text field </s>
|
funcom_train/38512862 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int allChildrenCount() {
if (mChildren == null) return 0;
int children = 0;
for (Iterator iter = mChildren.iterator(); iter.hasNext();) {
ConfigurationItem item = (ConfigurationItem) iter.next();
children += 1 + item.allChildrenCount();
}
return children;
}
COM: <s> returns the number of all children </s>
|
funcom_train/20296013 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean checkRow(int lastRow, int lastCol, Cell color) {
int count = 1;
for (int j = lastCol + 1; j < width; j++) {
if (board[lastRow][j].equals(color)) {
count++;
continue;
}
break;
}
for (int j = lastCol - 1; j >= 0; j--) {
if (board[lastRow][j].equals(color)) {
count++;
continue;
}
break;
}
if (count >= winTokens) {
return true;
}
return false;
}
COM: <s> returns true if the given cell is one of a row sequence </s>
|
funcom_train/3085671 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setWidth(int newWidth) throws OutOfBoundsException {
if (newWidth < 1)
throw new IllegalArgumentException("New width is < 1");
for (Iterator it = cells.iterator(); it.hasNext();) {
CellConstraints cell = (CellConstraints) it.next();
if (cell.getCol2() >= newWidth)
throw new OutOfBoundsException("New width " + newWidth + " is smaller than current contraints", cell);
}
width = newWidth;
}
COM: <s> sets the width of the grid layout manager </s>
|
funcom_train/12160312 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addFontSelector(Composite parent) {
fontSelector = new FontSelector(parent, SWT.NONE);
GridData selectorGrid =
new GridData(GridData.FILL_BOTH);
fontSelector.setLayoutData(selectorGrid);
fontSelector.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent modifyEvent) {
updateButtons();
}
});
fontSelectorFonts = fontSelector.getFonts();
}
COM: <s> creates and adds a font selector control </s>
|
funcom_train/18989455 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void send (PxRepSV reply)
{
try {
if (reply != null) {
synchronized (output_) {
if (Trace.isTraceProxyOn ()) {
trace_.print(getName() + " - ");
reply.dump(trace_);
}
reply.writeTo(output_);
output_.flush();
}
}
}
catch (IOException e) {
handleIOException (e);
}
}
COM: <s> sends a reply </s>
|
funcom_train/14227512 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getEventDisposition(JccEvent e) {
if (e instanceof JccConnectionEvent) {
JccConnection conn = ((JccConnectionEvent)e).getConnection();
if ((conn.getState() == JccConnection.ADDRESS_ANALYZE) &&
(conn.getAddress().getName().length() <= this.getMinAddrLength()))
return this.getMatchValue();
}
return this.getNoMatchValue();
}
COM: <s> return the match disposition value if the event address is in the range </s>
|
funcom_train/20537734 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private ExplorerTreeNode getLegislatorsNode() {
ExplorerTreeNode[] rootNodes = (ExplorerTreeNode[]) viewer.getInput();
for (ExplorerTreeNode rootNode : rootNodes) {
if (rootNode.getType() == ExplorerTreeNode.Type.LEGISLATORS) {
return rootNode;
}
}
return null;
}
COM: <s> returns the root legislators node </s>
|
funcom_train/37442786 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void SearchRetAll(String name, String value) {
try {
Attributes matchAttrs = new BasicAttributes(true); // ignore case
matchAttrs.put(new BasicAttribute(name, value));
// Search for objects with those matching attributes
NamingEnumeration answer = dctx.search("", matchAttrs);
System.out.println(" Searching Results ........");
printSearchEnumeration(answer);
} catch (Exception e) {
e.printStackTrace();
}
}
COM: <s> search and return all </s>
|
funcom_train/21405626 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void stop(boolean needJoin) {
StreamConnection conn;
synchronized (this) {
notify();
while (queue.size() != 0) {
conn = (StreamConnection)queue.firstElement();
queue.removeElementAt(0);
try {
conn.close();
} catch (IOException e) {
} // ignore
}
}
// wait until dispatching thread is done
try {
processorThread.join();
} catch (InterruptedException e) {
} // ignore
}
COM: <s> closes the connections and </s>
|
funcom_train/32018865 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JMenuItem getJMenuNewFolder() {
if (jMenuNewFolder == null) {
jMenuNewFolder = new JMenuItem("Nouveau dossier", new ImageIcon(getClass().getResource("/Icon/add_folder_bar.png")));
jMenuNewFolder.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_D, InputEvent.CTRL_MASK));
}
return jMenuNewFolder;
}
COM: <s> this method initializes j menu new folder </s>
|
funcom_train/5339564 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void transformMethod (MethodGen mg) {
if (!isContractMethod(mg)) {
MethodGen postconditionMethodGen =
transformer.getMethodSet()
.getMethod(getPostconditionMethodName(mg),
getPostconditionMethodSignature(mg));
if ((postconditionMethodGen != null)
&& canReferenceOld(mg)
&& refersToOld(postconditionMethodGen)) {
processPostcondition(postconditionMethodGen);
}
}
}
COM: <s> replace references to old in a postcondition method </s>
|
funcom_train/21175161 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Vector getAllUsers(){
Vector users = new Vector();
String result = "";
String sql = "SELECT username FROM Users ORDER BY username";
if(verbose)
System.out.println("DBClient: getAllUsers: "+sql);
//send query to database
ResultSet rs = query(sql);
try {
while(rs.next()){
result = rs.getString("username");
users.addElement(result);
}
}
catch (SQLException sqle) {
if (verbose)
System.out.println("A Database Error Occurred.\n" + sqle.getMessage() );
}
finally {
closeConnection ();
}
return users;
}
COM: <s> returns a vector of all the users in the database </s>
|
funcom_train/18024153 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
ListOption[] options = (ListOption[])value;
if (dialog != null && dialog.isVisible()) {
dialog.setVisible(false);
}
setOptions(options);
return this;
}
COM: <s> sets an initial code value code for the editor </s>
|
funcom_train/7282390 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testReuseConnection() throws Exception {
doReuseConnectionTest(httpUrls[0], httpServers[0]);
doReuseConnectionTest(tlsUrls[0], tlsServers[0]);
doReuseConnectionTest(httpsUrls[1], tlsServers[1]); // use a different server
}
COM: <s> tests that http client correctly reuses an open connection </s>
|
funcom_train/26433041 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public SubmitDBBeanPK ejbCreate(MHPTesterSubmission submit) throws EJBException, CreateException {
setValueObject(submit);
if( submit.getSubmitId() < 0 ) {
long seq = SequenceUtil.getNextNumber(SEQNAME);
if (seq == -1) {
throw new CreateException("SubmitDBBean: Could not create sequence number");
} else {
setSubmitId(seq);
}
}
return null;
}
COM: <s> create a submit dbbean based on the data from the given submission </s>
|
funcom_train/13260246 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void putNewSample(double newValue, double newWeight) {
// coumputes the maximum and the minimum value of the sequence
if (sumWeights == 0) {
//it's the first value
max = newValue;
min = newValue;
} else {
max = Math.max(max, newValue);
min = Math.min(min, newValue);
}
//computes mean and var
calcMeanAndVar(newValue, newWeight);
}
COM: <s> update the sample mean variance with the new value it uses stable </s>
|
funcom_train/29054317 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean sizeHasChanged(Set<Set<? extends Edge>> expandedReducedCandidates) {
int actualSize = Integer.MAX_VALUE;
if(expandedReducedCandidates.size() != 0){
for(Set<? extends Edge> set : expandedReducedCandidates){
if(set.size() < actualSize){
actualSize = set.size();
}
}
if(actualSize < getSetSize() && actualSize != 0){
setSetSize(actualSize);
return true;
}
else{
return false;
}
}
else{
return false;
}
}
COM: <s> checks if the size of input set has changed </s>
|
funcom_train/4786557 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public TableRow getControlRowObject(Control rowControl) {
for (Iterator rowsIter = rows.iterator(); rowsIter.hasNext();) {
TableRow row = (TableRow) rowsIter.next();
if (row.getRowControl() == rowControl) {
return row;
}
}
throw new IllegalArgumentException("getControlRowObject passed a control that is not visible inside CompositeTable");
}
COM: <s> method get control row object </s>
|
funcom_train/36717550 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void updateTrace(String cls, String fn, char pos) {
// EFFECTS: Writes one line of output of the format to the
// tracefile
if(!trace)
return;
final String sdt = new SimpleDateFormat().format(new Date());
String buf = prefix + cls + " " + fn + " " + sdt + " " + pos;
synchronized (Trace.class) {
os.println(buf);
}
}
COM: <s> updates trace and uses second level granularity to log </s>
|
funcom_train/29617206 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getInteger(String name){
int value = 0;
try {
if(containsKey(name))
value = Integer.parseInt(get(name));
else
System.err.println(name+ " key does not exist.");
} catch (NullPointerException e) {
System.err.println(name + " key is not valid.");
} catch (NumberFormatException e) {
System.err.println(get(name)+ " for key \"" + name +
"\" is not an Integer");
}
return value;
}
COM: <s> returns an integer value of the property </s>
|
funcom_train/243584 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int choose(int set, int combinations) {
int[] row = new int[set + 1];
row[0] = 1;
for (int i = 0; i < set; ++i) {
row[i + 1] = 1;
for (int j = i; j > 0; --j) {
row[j] += row[j - 1];
}
}
return row[combinations];
}
COM: <s> calculate the binomial coefficient </s>
|
funcom_train/23247244 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void processCharacters(final Characters characters) {
if (!characters.isWhiteSpace()) {
switch(currentElementType) {
case WAY_DEFINITION:
buildWayDefinition(characters.getData());
break;
case WAY_VISUALIZATION:
assignWayVisualizationDetail(characters.getData());
break;
case ZOOM_LEVEL_DATA:
assignWayWidth(characters.getData());
break;
default:
break;
}
}
}
COM: <s> process a character event </s>
|
funcom_train/36001822 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setProperties(Properties props) {
this.props = props;
user = props.getProperty("ftptest.user");
password = props.getProperty("ftptest.password");
host = props.getProperty("ftptest.host");
// socket timeout
String timeoutStr = props.getProperty("ftptest.timeout");
this.timeout = Integer.parseInt(timeoutStr);
}
COM: <s> set test properties for connecting </s>
|
funcom_train/47314400 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private ProjectionInfo projectPoint(Actor a, float p2x, float p2y, float nx, float ny, float lw){
ProjectionInfo res = new ProjectionInfo();
//calculate the point of collision, Q.
res.eff = a.getEffectiveRadius(nx, ny);
res.dot = nx*p2x + ny*p2y + lw - res.eff;
res.qx = p2x - res.dot*nx;
res.qy = p2y - res.dot*ny;
return res;
}
COM: <s> projects onto the given line returns projection in a nicely built package </s>
|
funcom_train/26314992 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void refreshPlayerInfo() {
playerModel.clearData();
for (Enumeration<Player> i = clientgui.getClient().getPlayers(); i
.hasMoreElements();) {
final Player player = i.nextElement();
if (player == null) {
continue;
}
playerModel.addPlayer(player);
}
}
COM: <s> refreshes the player info </s>
|
funcom_train/40222619 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setNumberCardsLeft() {
MutableInteger mu = new MutableInteger (numLeftName, 0);
if (model.addElement(mu) == false) {
// just extract value and replace. This invocation will generate a
// stateChange event.
numLeft.setValue(mu.getValue());
} else {
// otherwise, must set.
numLeft = mu;
}
}
COM: <s> set the model element for number of cards left </s>
|
funcom_train/48054035 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void issueMissingItemsWarning() {
PersistentOPCItemInfo[] allMissing = getAllMissing();
if (allMissing.length > 0) {
String itemList = "";
for (PersistentOPCItemInfo s : allMissing) {
itemList += s + "\n";
}
logger.log(Level.WARNING, "Unable_to_find_the_following_OPC_items_{0}", itemList);
}
}
COM: <s> logs a warning if there were missing opc items in the search </s>
|
funcom_train/22092827 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public FilterResponse waitForResponse(int id) {
FilterResponse res;
Integer intId = new Integer(id);
synchronized (this) {
do {
res = (FilterResponse)_resMap.get(intId);
if (res == null)
try {
_log.fine("Waiting for response to request # " + Integer.toString(id));
wait();
} catch (InterruptedException e) {
_log.severe("Unexpected interruption :" + e.getMessage());
e.printStackTrace();
System.exit(1);
}
else {
_resMap.remove(intId);
}
} while (res == null);
}
return res;
}
COM: <s> this method waits for a filter response to the request that has </s>
|
funcom_train/34356272 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Resource getJenaResource(Model model) {
// ensure proper handling of BNode elements
/*
if (isBlankNode()) {
String bnodeId = this.getRdfId().value().toString();
if (bnodeId != null) {
return model.createResource(new AnonId(bnodeId));
}
}
else {
*/
URI uri = getURI();
if (uri != null) {
return model.getResource(uri.toString());
}
//}
return null;
}
COM: <s> retrieves a corresponding jena resource for this element from a jena model </s>
|
funcom_train/17143889 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testCleanSpotPng() {
String fileName = "spot1Clean";
SLImage bp = runPluginFilterOnBufferedImage(filePath(fileName,".png"), _segmenter);
assertEquals(30,bp.getWidth());
assertEquals(900,bp.getPixelCount());
int pixel = bp.get(0,0);
assertEquals(0xffffff,pixel);
ValueAreaFactory factory = _segmenter.getSegmentation().getSegmentAreaFactory();
assertNull(factory);
// assertEquals(2,factory.getStore().size());
}
COM: <s> this gets opened as a byte interleaved and not as an int rgb </s>
|
funcom_train/2386019 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void sendRawMessage(IChatMessage aMessage, String aReceiver) throws IOException, IChatException {
IChatForwardMessage forwardMessage = messageFactory.createForwardMessage(serviceBot.getSender(), aReceiver,
aMessage);
writer.write(aReceiver, forwardMessage.asByteArray());
}
COM: <s> sends the message </s>
|
funcom_train/8279153 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getFarthestPoint() {
float max = Float.MIN_VALUE;
int point = 0;
if (distances != null) {
for (int i = length; --i >= 0;) {
float val = distances[i];
if (val > max) {
max = val;
point = i;
}
}
}
return point;
}
COM: <s> returns the point that has the largest associated distance value </s>
|
funcom_train/2801921 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int nativeType(Class pObject) {
if (pObject == null) {
return TibrvMsg.DEFAULT;
}
int pos = 0;
while (pos < KNOWN_CLASSES.length) {
if (KNOWN_CLASSES[pos].isAssignableFrom(pObject)) {
return KNOWN_TYPES[pos];
} else {
pos++;
}
}
return TibrvMsg.DEFAULT;
}
COM: <s> given the class of an object returns the type associated </s>
|
funcom_train/3169169 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isBoundedRight(XnRegion region) {
return (((transitionsCount(region)) & 1) == 0) != (startsInside(region));
/*
udanax-top.st:18248:EdgeManager methodsFor: 'testing'!
{BooleanVar} isBoundedRight: region {XnRegion}
"Same meaning as IntegerRegion::isBoundedRight"
^(((self transitionsCount: region) bitAnd: 1) == Int32Zero)
~~ (self startsInside: region)!
*/
}
COM: <s> same meaning as integer region is bounded right </s>
|
funcom_train/46578450 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setData(Data data) {
LOG.fine("Start");
if (this.data != null) {
this.data.removeObserver(this);
}
this.data = data;
DataLookup.instance().setData(data);
if (data == null) {
loaded = false;
} else {
loaded = true;
data.resetObservers();
data.addObserver(this);
}
notifyObservers(this);
}
COM: <s> sets the current working data </s>
|
funcom_train/16597186 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void clipVisibleRect(Graphics2D g2d) {
rectVisible = this.getVisibleRect();
g2d.clipRect((int) rectVisible.getMinX(), (int) rectVisible.getMinY(),
(int) rectVisible.getWidth(), (int) rectVisible.getHeight());
}
COM: <s> clip on visible rectangle </s>
|
funcom_train/37587204 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void textGotoLine7() throws BadLocationException {
final String s = "11111\n2222\n33333\n44444";
_doc.insertString(0, s, null);
_doc.gotoLine(3);
assertEquals("#0.0", 11, _doc.getCurrentLocation());
}
COM: <s> test that going to a line within the documents line count </s>
|
funcom_train/18497433 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addTask(Task task, List<Task> taskList) {
if(task.isCrucial() && taskList.contains(task)) {
return;
}
if (!task.start()) {
return;
}
// add in order of priority
int i;
for (i = 0; i < taskList.size(); ++i) {
Task t = taskList.get(i);
if (t.getPriority().greaterThan(task.getPriority())) {
break;
}
}
taskList.add(i, task);
}
COM: <s> add a task to a list in order of priority </s>
|
funcom_train/25365925 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addResistLightningPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Armor_resistLightning_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Armor_resistLightning_feature", "_UI_Armor_type"),
LeveleditorPackage.Literals.ARMOR__RESIST_LIGHTNING,
true,
false,
false,
ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the resist lightning feature </s>
|
funcom_train/18478791 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object get() {
while (true) {
Thread t = threadVar.get();
if (t == null) {
return getValue();
}
try {
t.interrupt();
t.join();
}
catch (InterruptedException e) {
Thread.currentThread().interrupt(); // propagate
return null;
}
}
}
COM: <s> return the value created by the code construct code method </s>
|
funcom_train/26598258 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean canWrite(int freeSpaceInCluster, int lengthOfBytes) {
; //freeSpaceInCluster > 1 + 1 + 4 + 1 + 2; // ACTIVE/DELETED + FULL/PARTIAL + INTSIZE + one data byte + DATA LENGTH IN THIS CLUSTER
if (lengthOfBytes <= MAXLENGTHFORFULLINSERT)
return freeSpaceInCluster >=
(lengthOfBytes + versionHandler.BLOBROWHEADER) ? true : false;
else
return freeSpaceInCluster > versionHandler.BLOBROWHEADER;
}
COM: <s> can write method calculates the free space present in the cluster </s>
|
funcom_train/4786508 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int fireInsertEvent() {
if (parent.insertHandlers.size() < 1) {
return -1;
}
for (Iterator insertHandlersIter = parent.insertHandlers.iterator(); insertHandlersIter
.hasNext();) {
IInsertHandler handler = (IInsertHandler) insertHandlersIter.next();
int resultRow = handler.insert(topRow + currentRow);
if (resultRow >= 0) {
return resultRow;
}
}
return -1;
}
COM: <s> request that the model insert a new row into itself </s>
|
funcom_train/28768827 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Resource findResourceForExpression(String xpath, URI uri, Document document) {
String resourcePath = evaluateExpression(xpath, uri, document);
logger.debug("Looking for resource \"" + resourcePath + "\"");
Resource resultResource = getResourceLoader().getResource(resourcePath);
resultResource = resultResource.exists() ? resultResource : null;
return resultResource;
}
COM: <s> looks for a resource using given expression </s>
|
funcom_train/7870674 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void copy(ResultSet resultSet) throws SQLException {
while (resultSet.next()) {
DynaBean bean = new BasicDynaBean(this);
for (int i = 0; i < properties.length; i++) {
String name = properties[i].getName();
bean.set(name, resultSet.getObject(name));
}
rows.add(bean);
}
}
COM: <s> p copy the column values for each row in the specified </s>
|
funcom_train/11754505 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testExecuteWithSingleEnvironmentVariable() throws Exception {
Map env = new HashMap();
env.put("TEST_ENV_VAR", "XYZ");
CommandLine cl = new CommandLine(testScript);
int exitValue = exec.execute(cl, env);
assertEquals("FOO.XYZ.", baos.toString().trim());
assertFalse(exec.isFailure(exitValue));
}
COM: <s> execute the test script and pass a environment containing </s>
|
funcom_train/38328187 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addAssociation(Class clazz, String templateName) throws TemplateAssociationException {
Defclass dclass = (Defclass)this.templateToDefclass.get(templateName);
if (dclass != null) {
addAssociation(clazz, findDeftemplate(dclass.getClassObject()) );
} else {
throw new TemplateAssociationException(templateName + " not found. Cound not add association");
}
}
COM: <s> method will try to find the defclass using the template name </s>
|
funcom_train/2884866 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void save() throws IOException {
OutputStream out = null;
try {
//now the workers
out = new BufferedOutputStream(new FileOutputStream(destFile));
Serializer ser = createSerializer(out);
ser.write(document);
out.flush();
out.close();
out = null;
} finally {
FileSystem.close(out);
}
}
COM: <s> write the document </s>
|
funcom_train/43254711 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int randomValue(int min, int max) throws CreationException {
if (max < min) {
throw new CreationException("max (" + min + ") < min (" + max
+ ")");
}
int retVal;
if (min == max) {
retVal = min;
} else {
int range = max - min + 1;
retVal = min + getUniformDisribution().nextInt(range);
}
return retVal;
}
COM: <s> returns a number in the range code min code to code max code </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.