__key__
stringlengths 16
21
| __url__
stringclasses 1
value | txt
stringlengths 183
1.2k
|
---|---|---|
funcom_train/16465229 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void taskTypeChanged(Object dialog, Object selected) {
String name = getString(selected, Thinlet.NAME);
Object label = find(dialog, COMPONENT_LB_TEXT);
if (name.equalsIgnoreCase(COMPONENT_RB_HTTP)) {
//HTTP
setText(label, InternationalisationUtils.getI18NString(COMMON_URL));
setIcon(label, Icon.ACTION_HTTP_REQUEST);
} else {
//CMD
setText(label, InternationalisationUtils.getI18NString(COMMON_COMMAND));
setIcon(label, Icon.ACTION_EXTERNAL_COMMAND);
}
}
COM: <s> method called when the user changes the task type </s>
|
funcom_train/46190188 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSecurityRolesForThemeFiles() {
request.setParameter("type", FileMetaData.THEME_FILE);
String roles[] = action.getRoles(request);
assertEquals(2, roles.length);
assertEquals(Constants.BLOG_ADMIN_ROLE, roles[0]);
assertEquals(Constants.BLOG_OWNER_ROLE, roles[1]);
}
COM: <s> tests that only blog owners can manage theme files </s>
|
funcom_train/37456145 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean delete(ProteinEvent evt) throws ProcessorException {
boolean isDeleted = deleteProtein(evt.getProtein(), evt);
if (isDeleted && evt.getSource() instanceof ProteinUpdateProcessor){
// log in 'deleted.csv'
ProteinUpdateProcessor processor = (ProteinUpdateProcessor) evt.getSource();
processor.fireOnDelete(evt);
}
// delete the protein
return isDeleted;
}
COM: <s> delete the protein from the database </s>
|
funcom_train/23777665 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void actionPerformed(ActionEvent evt) {
if (evt.getActionCommand().startsWith("Calculate")) {
((ICalculateForm) callingComp).calculateResult();
}
if (evt.getActionCommand().startsWith("Clear")) {
((ICalculateForm) callingComp).clearForm();
}
}
COM: <s> call calculate on the form when action calls for calculate </s>
|
funcom_train/40528110 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setXmlnsPolicy(XmlViolationPolicy xmlnsPolicy) {
if (xmlnsPolicy == XmlViolationPolicy.FATAL) {
throw new IllegalArgumentException("Can't use FATAL here.");
}
this.xmlnsPolicy = xmlnsPolicy;
if (tokenizer != null) {
tokenizer.setXmlnsPolicy(xmlnsPolicy);
}
}
COM: <s> whether the code xmlns code attribute on the root element is </s>
|
funcom_train/46760567 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public PatientModel getPatientVisit(final long patientId, final long visitId, final ServiceCall call) throws Exception {
IBeanMethod method = new IBeanMethod() { public Object execute() throws Exception {
PatientModel patient = PatientData.getPatient(patientId, call);
VisitModel visit = PatientData.getVisit(visitId, call);
patient.setVisit(visit);
return patient;
}}; return (PatientModel) call(method, call);
}
COM: <s> get the patient model with the specified visit </s>
|
funcom_train/10988689 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testPlain() throws ServletException, JspException {
HttpServletResponse response =
(HttpServletResponse) pageContext.getResponse();
boolean gotCorrectException = false;
try {
int startTagReturn = elFrameTag.doStartTag();
} catch (JspException ex) {
// This is supposed to happen.
gotCorrectException = true;
} catch (Exception ex) {
fail();
}
if (!gotCorrectException) {
fail();
}
}
COM: <s> tests all attributes unset which is illegal </s>
|
funcom_train/28595536 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void first() {
DetailTablePanel detailTablePanel = getDetailPanel().getDetailTablePanelsMap().get(idTable);
if (detailTablePanel.getTable() != null) {
detailTablePanel.getTablePanel().selectFirstRow();
FieldUtility.setDataToFields(detailTablePanel.getSysTable().getBean(), fields, detailTablePanel.getTable()
.getSelected().get(0));
refreshRowNumberDisplay();
}
}
COM: <s> main toolbar listener implementation </s>
|
funcom_train/3653000 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object createObject() {
try {
if (null == defaultDriver) {
return XMLReaderFactory.createXMLReader();
} else {
return XMLReaderFactory.createXMLReader(defaultDriver);
}
} catch (SAXException e) {
throw new ObjectFactoryException("failed to load SAX driver", e);
}
}
COM: <s> creates a new xmlreader using the default driver configured </s>
|
funcom_train/25787625 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void writeElement(XmlWriter writer) throws SAXException {
writer.startElement(APP_NAMESPACE, "workspace");
if (getTitle() != null) {
writer.dataElement(ATOM_NAMESPACE, "title", getTitle());
}
for (final Collection collection : getCollections()) {
collection.writeElement(writer);
}
writer.endElement(APP_NAMESPACE, "workspace");
}
COM: <s> writes the current object as an xml element using the given sax writer </s>
|
funcom_train/44297130 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void validate(final GeodeticDatum object) {
if (object == null) {
return;
}
validateIdentifiedObject(object);
final PrimeMeridian meridian = object.getPrimeMeridian();
mandatory("GeodeticDatum: must have a prime meridian.", meridian);
validate(meridian);
final Ellipsoid ellipsoid = object.getEllipsoid();
mandatory("GeodeticDatum: must have an ellipsoid.", ellipsoid);
validate(ellipsoid);
}
COM: <s> validates the given datum </s>
|
funcom_train/1216282 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void DropOnFloor(PacketParser p3){
int ID = p3.inStream.readUnsignedWordA();
int Junk = p3.inStream.readUnsignedByte() + p3.inStream.readUnsignedByte();
int Slot = p3.inStream.readUnsignedWordA();
boolean valid = p3.check(ID);
if(!valid){
Flagger.flag(p3);
return;
}
if(p3.isUntradable(ID)){
p3.sendMessage("You destroy the item.");
p3.deleteItem(ID, p3.GetItemSlot(ID), 1);
} else {
p3.dropItem(ID, Slot);
}
}
COM: <s> dropping an item onto the floor </s>
|
funcom_train/36190119 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void registerEventsListener() {
if (!registeredForEvent) {
String eventTypes[] = { PeerEventTypes.SERVICE_SESSION_EVENT };
this.getEventsManagerReference().registerListener(new SessionEventsListener(this.getOwnServiceIdentifier(), this.getUIMReference(), this.getPssManagerReference()), eventTypes, null);
registeredForEvent = true;
controlLogger.debug("Registering event listener");
}
}
COM: <s> register the session control events listener </s>
|
funcom_train/24535458 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void postInvalidImages() {
if (queuedInvalidImages != null && !queuedInvalidImages.isEmpty()) {
// We have something to do, but queue it off to the AWT UI thread so that the validates are done on the UI thread.
// This will make sure most (but unfortunately not all) size/location changes are grouped together and batched rather
// than happening sporadically.
EventQueue.invokeLater(validateImages);
}
}
COM: <s> called from the client to post back all of the invalid images </s>
|
funcom_train/16081833 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void notifyBegin(DetailAST aRootAST, FileContents aContents) {
final Iterator it = mAllChecks.iterator();
while (it.hasNext()) {
final Check check = (Check) it.next();
check.setFileContents(aContents);
check.beginTree(aRootAST);
}
}
COM: <s> notify interested checks that about to begin walking a tree </s>
|
funcom_train/636866 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void handleResponse(String url, HTTPTransaction response) {
/** Don't bother with it if we somehow already have this url. **/
if (s_cache.containsKey(url))
return;
// if it's not valid, no-op
if (response != null && response.getResponse() != 200) {
return;
}
// Add it to our response queue
s_responses.addElement(new ImageResponse(url, response));
synchronized(s_responses){
s_responses.notifyAll();
}
}
COM: <s> called by gmap when our request returns </s>
|
funcom_train/14059571 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void hitSelection() {
final int[] sel;
final ListModel m;
int i;
sel = this.getSelectedIndices();
if (sel != null) {
m = this.getModel();
for (i = sel.length; (--i) >= 0;) {
this.hit(m.getElementAt(sel[i]));
}
}
}
COM: <s> hit all elements in the selection </s>
|
funcom_train/33886414 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setUpView(final JavaCallGraph callGraph) throws IOException {
graph = callGraph;
Graph<CallGraphNode, CallGraphLink> jungGraph =
callGraph.getJungGraph();
setUpVisualizerAndLayout(jungGraph);
// recordPositions(jungGraph);
Container content = getContentPane();
content.removeAll();
content.add(new GraphZoomScrollPane(visualizer));
JPanel southPanel = setUpSouthPanel();
content.add(southPanel, BorderLayout.SOUTH);
displayGraphClusterText();
visualizer.validate();
visualizer.repaint();
}
COM: <s> shows the cluster text </s>
|
funcom_train/20239773 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void add(T actual, T predicted, int count) {
if (matrix.containsKey(actual)) {
matrix.get(actual).add(predicted, count);
} else {
CountCollection<T> counts = new CountCollection<T>();
counts.add(predicted, count);
matrix.put(actual, counts);
}
classes.add(actual);
classes.add(predicted);
}
COM: <s> increments the entry specified by actual and predicted by count </s>
|
funcom_train/2037628 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isMaxImageUploaded() {
if (maxImage != null && !maxImage.isEmpty()) {
String imageURL = maxImage.getSrc();
return !(DEFAULT_HORIZONTAL_MAX_IMAGE.equals(imageURL) || DEFAULT_VERTICAL_MAX_IMAGE.equals(imageURL));
}
return false;
}
COM: <s> not upload the default max image </s>
|
funcom_train/24601220 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel addPairsPanel(String option, int panelRow, String... values) {
JPanel panel = new JPanel(new GridBagLayout());
int row = 0;
for (String value : values) {
addPair(panel, value, row++, null);
}
mainPanel.add(panel,
XmippWindowUtil.getConstraints(gbc, 0, panelRow, 2));
dictPanels.put(option, panel);
panel.setBorder(BorderFactory.createTitledBorder("Params"));
panel.setVisible(false);
return panel;
}
COM: <s> create panel with values pairs needed </s>
|
funcom_train/8089530 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addOne() {
m_GridVector[0] = addOne(m_GridVector[0]);
int i = 1;
while (overflow(m_GridVector[i - 1]) && i < m_Size) {
m_GridVector[i] = addOne(m_GridVector[i]);
i++;
}
}
COM: <s> add 1 to vector </s>
|
funcom_train/3640825 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void checkConstructorArguments() {
// VT: FIXME: Have to see if the suggested directory and file name
// are sane, in particular, file name should be a valid file name
// for a local filesystem.
if ( contextKey == null ) {
throw new IllegalArgumentException("contextKey can't be null");
}
}
COM: <s> check if the constructor arguments are sane </s>
|
funcom_train/37749530 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object getValue(String key, int role) {
switch (role) {
case Configuration.STANDARD:
return standardConfiguration.get(key);
case Configuration.PDF:
return pdfConfiguration.get(key);
case Configuration.AWT:
return awtConfiguration.get(key);
default:
return standardConfiguration.get(key);
}
}
COM: <s> general access method </s>
|
funcom_train/9026469 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void declareWorkbenchImage(Bundle ideBundle, String symbolicName, String path, boolean shared) {
URL url = FileLocator.find(ideBundle, new Path(path), null);
ImageDescriptor desc = ImageDescriptor.createFromURL(url);
getWorkbenchConfigurer().declareImage(symbolicName, desc, shared);
}
COM: <s> declares an ide specific workbench image </s>
|
funcom_train/50862317 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean enterAirlock(Person person, boolean inside) {
boolean result = super.enterAirlock(person, inside);
// Check if person is entering airlock from inside.
if (result && inside) {
// Add person to the building.
BuildingManager.addPersonToBuilding(person, building);
}
return result;
}
COM: <s> enters a person into the airlock from either the inside or the outside </s>
|
funcom_train/24364743 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: final public String getAlgebraDescription() {
if (strAlgebraDescriptionNeedsUpdate) {
if (isDefined()) {
strAlgebraDescription = toString();
} else {
sbAlgebraDesc.setLength(0);
sbAlgebraDesc.append(label);
sbAlgebraDesc.append(' ');
sbAlgebraDesc.append(app.getPlain("undefined"));
strAlgebraDescription = sbAlgebraDesc.toString();
}
strAlgebraDescriptionNeedsUpdate = false;
}
return strAlgebraDescription;
}
COM: <s> returns algebraic representation of this geo element </s>
|
funcom_train/50501898 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public List getPlugins(String taskGroup){
List result = new LinkedList();
synchronized (plugins) {
Iterator iter = plugins.iterator();
while (iter.hasNext()) {
IPlugin plugin = (IPlugin)iter.next();
if(plugin.getPluginGroup().equals(taskGroup))
result.add(plugin);
}
}
return result;
}
COM: <s> gets the tasks attribute of the itask manager object </s>
|
funcom_train/51300286 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getPVSExpression(String[] stateName, int row, String result1, String result2) {
System.out.println("ERROR.. base getPVSExpression called");
Exception e = new Exception("ERROR.. base getPVSExpression called");
e.printStackTrace();
return null;
}
COM: <s> return a pvs expression for the weakened equality </s>
|
funcom_train/45750197 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addLowerPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_MultiplicityElement_lower_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_MultiplicityElement_lower_feature", "_UI_MultiplicityElement_type"),
OntoUMLPackage.Literals.MULTIPLICITY_ELEMENT__LOWER,
true,
false,
false,
ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the lower feature </s>
|
funcom_train/49410789 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean deleteIdentifier(String identifier, int type) throws IndexException {
for (Iterator i = identifiers.iterator(); i.hasNext(); ) {
Identifier c = (Identifier) i.next();
if (c.getIdentifier().equals(identifier)) {
i.remove();
return true;
}
}
throw new IndexException("Index for specified identifier " + identifier + " was not found.");
}
COM: <s> remove an identifier using the id and type </s>
|
funcom_train/10343503 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void paint(Graphics2D g2d, boolean setColor) {
if (setColor)
g2d.setColor(m_color);
final int x = (int)m_xPos;
final int y = (int)m_yPos;
g2d.fillRect(x-size,y-size,size,size);
}
COM: <s> displays the star </s>
|
funcom_train/37741479 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isMemberOfPerformers(WfProcess member) {
for (Iterator ps = performers().iterator(); ps.hasNext();) {
WfProcess p = (WfProcess)ps.next();
try {
if (p.key().equals (member.key())) {
return true;
}
} catch (RemoteException e) {
throw new EJBException (e);
}
}
return false;
}
COM: <s> check if the given process is among the performers of this requester </s>
|
funcom_train/21015679 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Content getContent(ResourceBundle resource, String key) {
String file = resource.getString(key);
URL url = getClass().getResource(file);
if (url == null) {
throw new IllegalArgumentException("Unknown resource " + file);
} else {
return new URLContent(url);
}
}
COM: <s> returns a valid urlcontent instance from the resource file value of key </s>
|
funcom_train/22105737 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected int computedPageCount() {
int result = 0;
if( ( this.masterList != null ) && ( this.pageSize > 0 ) ) {
int size ;
size = this.masterList.size();
int div = size / this.pageSize;
int mod = size % this.pageSize;
result = ( mod == 0 ) ? div : div + 1;
}
return result;
}
COM: <s> returns the computed number of pages it would take to show all the </s>
|
funcom_train/16678152 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void init() {
RobotSpecs robotSpecs = robot.getRobotSpecs( );
Length length = robotSpecs.getLength( );
Width width = robotSpecs.getWidth( );
robotWidth = toMillimeter(width.getWidth( ), width.getUnit( ));
robotLength = toMillimeter(length.getLength( ), length.getUnit( ));
ratio = robotLength / robotWidth;
}
COM: <s> reads the basics from the robot and does some calculations </s>
|
funcom_train/8436445 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void prepareCompleteGraphs() {
unifyingPremises = new TreeMap<Integer, TreeSet<Integer>>();
completeModel = probModel.createSpecificCopy();
for(Integer i : completeModel) {
TreeSet<Integer> premiseSet = new TreeSet<Integer>();
premiseSet.add(i);
unifyingPremises.put(i,premiseSet);
}
}
COM: <s> initialize for completion </s>
|
funcom_train/24080477 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addListeners() {
userActionPanel.getDirButton().addActionListener(this);
userActionPanel.getPlainTextRadio().addActionListener(this);
userActionPanel.getRegexRadio().addActionListener(this);
userActionPanel.getCountButton().addActionListener(this);
userActionPanel.getSearchButton().addActionListener(this);
userActionPanel.getReplaceButton().addActionListener(this);
userActionPanel.getClearAreaButton().addActionListener(this);
}
COM: <s> set the button and menu listeners </s>
|
funcom_train/40409552 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testWhenReportReady() throws RemoteException, InterruptedException {
asyncThread = new ReportUtils(reportService, reportService.scheduleReportJob(reportJob))
.whenReportReady(reportCallback);
waitForCallback();
assertFalse("Report Failure occured.", asyncFailure);
assertFalse("Asynchronous thread was interrupted.", asyncInterrupted);
assertNull("Exception occured on callback.", asyncException);
}
COM: <s> tests asynchronously waiting for a successful report </s>
|
funcom_train/41550159 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setApplicationContext(ApplicationContext applicationContext) {
logger.debug("注入ApplicationContext到SpringContextHolder:" + applicationContext);
if (SpringContextHolder.applicationContext != null) {
logger.warn("SpringContextHolder中的ApplicationContext被覆盖, 原有ApplicationContext为:" + SpringContextHolder.applicationContext);
}
SpringContextHolder.applicationContext = applicationContext; // NOSONAR
}
COM: <s> application context aware context </s>
|
funcom_train/35326863 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public MethodType changeParameterType(int num, Class<?> nptype) {
if (parameterType(num) == nptype) return this;
checkPtype(nptype);
Class<?>[] nptypes = ptypes.clone();
nptypes[num] = nptype;
return makeImpl(rtype, nptypes, true);
}
COM: <s> finds or creates a method type with a single different parameter type </s>
|
funcom_train/3106533 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean logout(HttpServletRequest request, HttpServletResponse response, IloaClient client) {
// If CAS Server is enabled, test if we need logout from CAS
if (IloaFilterCAS.isEnabled()) {
if (client.isDisconnected()) {
if (IloaFilterCAS.logout(request, response, client)) {
return true;
}
}
}
return false;
}
COM: <s> logout the user </s>
|
funcom_train/34564581 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int fnd(final int p) {
int l = 0, h = ch.length - 1;
while(l <= h) { // binary search
final int m = l + h >>> 1;
final int v = ch[m].pre;
if(v == p) return m;
if(v < p) l = m + 1;
else h = m - 1;
}
return l - 1;
}
COM: <s> adds a child at the specified position </s>
|
funcom_train/24512625 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean canBreakMidWord() {
boolean ret = false;
// if (hyphProps != null && hyphProps.language != null
// &&!hyphProps.language.equals("NONE")) {
// String lang = hyphProps.language.toLowerCase();
// if ("zh".equals(lang) || "ja".equals(lang) || "ko".equals(lang)
// || "vi".equals(lang))
// ret = true;
// }
return ret;
}
COM: <s> checks if its legal to break a word in the middle </s>
|
funcom_train/35443042 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public SegmentTreeNode next() {
if (s.isEmpty()) return null;
SegmentTreeNode res = null;
while (!s.isEmpty()) {
SegmentTreeNode t = s.peek();
if (visited.containsKey(t)) {
//visit t
res = t;
s.pop();
break;
} else {
visited.put(t, true);
if (t.rightSon() != null ) {
s.push(t.rightSon());
}
if (t.leftSon() != null ) {
s.push(t.leftSon());
}
}
}
return res;
}
COM: <s> next tree node pointed by iterator </s>
|
funcom_train/42036137 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public List getObjectList (Object key, Object... defaultValues) {
Object object = getObject(key);
if (!(object instanceof List)) {
List list = new ArrayList();
if (object != null) list.add(object);
return list;
}
if (object != null) return (List)object;
if (defaultValues == null) return null;
List list = new ArrayList();
for (Object value : defaultValues)
list.add(value);
return list;
}
COM: <s> returns a list of objects under the specified key </s>
|
funcom_train/36117727 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void shutdown() {
logger.info("Shuting down the framework...");
try {
Naming.unbind(this.adminRMIName);
logger.info("Stoping Admin Conlose: [success]");
} catch (Exception e) {
e.printStackTrace();
logger.info("Stoping Admin Conlose: [failed]");
}
this.componentContainer.clear();
logger.info("Stoping components: [success]");
this.serviceContainer.clear();
logger.info("Stoping platform services: [success]");
logger.info("FOUNTAIN Framework terminated.");
terminate(0); // quit
}
COM: <s> shut down the framework </s>
|
funcom_train/3866870 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int findTest(Test target, Test node, Vector path) {
if (target.equals(node))
return 0;
TestSuite suite= isTestSuite(node);
for (int i= 0; i < getChildCount(node); i++) {
Test t= suite.testAt(i);
int index= findTest(target, t, path);
if (index >= 0) {
path.insertElementAt(node, 0);
if (path.size() == 1)
return i;
return index;
}
}
return -1;
}
COM: <s> finds the path to a test </s>
|
funcom_train/38520032 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void fill(GraphModel m) {
for(int i = 0; i < m.getRootCount(); i++) {
Object gc = m.getRootAt(i);
if(gc instanceof SpecialGraphCell) {
SpecialGraphCell cell = (SpecialGraphCell) gc;
Map attribs = m.getAttributes(gc);
Rectangle r = GraphConstants.getBounds(attribs);
Cell c = new Cell(
(String) cell.getUserObject(),
cell.getCellType(),
cell.getTooltip(),
r.getX(),
r.getY()
);
cells.add(c);
}
}
}
COM: <s> fills the graph model with the cells this class has </s>
|
funcom_train/4814252 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testContains() {
// Test that tileA isn't on the board
assertFalse("BoardImpl shouldn't contain the tile A", board.contains(tree));
// Add the tile and check it's there
board.addTile(tree, 0, 0);
assertTrue("BoardImpl should contain tree A", board.contains(tree));
}
COM: <s> tests the method that reports whether the board contains a given tile </s>
|
funcom_train/48962778 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void generateConnections() {
int nc;
int ns;
float weight;
int count = 0;
while (numberOfConnections< maxConnections && count < 100){
nc = rand.nextInt(numberOfCircles);
ns = rand.nextInt(numberOfSquares);
// if(n1 == n2){
// count++;
// continue;
// }
// else{
weight = rand.nextFloat() * 2 + 1;
addGraphConnection(new GraphConnection(circles[nc], squares[ns], weight));
// }
}
}
COM: <s> generates random graph connections for testing purposes </s>
|
funcom_train/36474319 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void updateNextScreen( AccessibleCanvas next, Image nextImage, int[] rgb ) {
Graphics g = nextImage.getGraphics();
next.paint( g );
//#if polish.midp2
if (rgb != null) {
nextImage.getRGB(rgb, 0, this.screenWidth, 0, 0, this.screenWidth, this.screenHeight );
}
//#endif
}
COM: <s> updates the image and possibly the rgb data of the next screen </s>
|
funcom_train/33724437 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private BnTextField getBnTextField2() {
if (bnTextField2 == null) {
bnTextField2 = new BnTextField();
bnTextField2.setPath(new Path("this.city"));
bnTextField2.setModelProvider(getMyDataSource());
}
return bnTextField2;
}
COM: <s> this method initializes bn text field2 </s>
|
funcom_train/40061306 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void reassessSickness(EntityManager entityManager) {
Query query = entityManager.createNamedQuery("SicknessReport.findAll");
List<SicknessReport> reports = query.getResultList();
for (SicknessReport report : reports) {
double oldCost = report.getHoursLost();
double newCost = getSicknessSpend(entityManager, report, null);
// Persist any changes
if (oldCost != newCost) {
entityManager.merge(report);
}
}
}
COM: <s> reassesses the spend on all sickness requests note that the method </s>
|
funcom_train/13693037 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void selectLinksBetweenSelectedNodes(){
GuiLink tmplink = null;
for(Enumeration en = links.elements(); en.hasMoreElements();) {
tmplink = (GuiLink)en.nextElement();
if (tmplink == null)
continue;
if (tmplink.source.selectionMode && tmplink.target.selectionMode) {
tmplink.setSelectionMode(true);
}
}
repaint();
}
COM: <s> selects links which are between two selected nodes </s>
|
funcom_train/37565330 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public PluginDescriptor getPluginDescriptor(String pPluginId) {
for (int i = 0; i < fRegisteredPlugins.size(); i++) {
PluginDescriptor descriptor =
(PluginDescriptor) fRegisteredPlugins.get(i);
if (descriptor.getPluginId().equals(pPluginId))
return descriptor;
}
return null;
}
COM: <s> return the descriptor of one plugin identified by a plugin id </s>
|
funcom_train/1379456 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JToolBar getJJToolBarBar() {
if (jJToolBarBar == null) {
try {
jJToolBarBar = new JToolBar();
jJToolBarBar.add(getBtnTavoli()); // Generated
jJToolBarBar.add(getBtnConfigurazione());
} catch (java.lang.Throwable e) {
// TODO: Something
}
}
return jJToolBarBar;
}
COM: <s> this method initializes j jtool bar bar </s>
|
funcom_train/44492270 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public IHTMLInputElement getCheckboxWithNameAndValue(String checkboxFieldName, String checkboxFieldValue) {
IHTMLInputElement checkbox = (IHTMLInputElement) getFormElement("input", new String[]{"type", "name", "value"}, new String[]{"checkbox", checkboxFieldName, checkboxFieldValue});
highlightFormField(checkbox);
return checkbox;
}
COM: <s> gets the checkbox given by its field name and value </s>
|
funcom_train/49211125 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public SparseMatrix run(SparseMatrix a, double maxResidual, double pGamma,double loopGain, double maxZero){
// add cycles
addLoops(a, loopGain);
// make stochastic
a.normaliseRows();
double residual = 1.;
int i = 0;
// main iteration
while (residual > maxResidual){
i++;
a = expand(a);
residual = inflate(a, pGamma, maxZero);
}
return a;
}
COM: <s> run the mcl process </s>
|
funcom_train/10927433 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String getTypeLink(String repositoryId, String typeId, String rel, String type) {
if (repositoryId == null) {
throw new CmisInvalidArgumentException("Repository id must be set!");
}
if (typeId == null) {
throw new CmisInvalidArgumentException("Type id must be set!");
}
return getLinkCache().getTypeLink(repositoryId, typeId, rel, type);
}
COM: <s> gets a type link from the cache </s>
|
funcom_train/28672937 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addIndexPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_ConstructorArgType_index_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_ConstructorArgType_index_feature", "_UI_ConstructorArgType_type"),
BeansPackage.Literals.CONSTRUCTOR_ARG_TYPE__INDEX,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the index feature </s>
|
funcom_train/32639866 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected int updatePosition(int offset, int max_offset) {
int i = getTargetOffset(); // Depending on old position value
position += offset; // Position may be shifted by preceding expansions
if(Math.abs(i) >= (32767 - max_offset)) { // to large for short (estimate)
opcode = de.fub.bytecode.Constants.GOTO_W;
length = 5;
return 2; // 5 - 3
}
return 0;
}
COM: <s> called in pass 2 of instruction list </s>
|
funcom_train/3651520 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initLogEvent() {
installLogConstants();
logEvent = new LogEvent(this, vocab, variableSrc);
try {
logEvent.setProperty("hostname",
InetAddress.getLocalHost().getHostName());
} catch (UnknownHostException e) {
logEvent.setProperty("hostname", "localhost");
}
}
COM: <s> creates a new shared log event and sets it up with </s>
|
funcom_train/11310799 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeFromCache(MetaBean beanInfo) {
cacheById.remove(beanInfo.getId());
if (beanInfo.getBeanClass() != null &&
beanInfo.getId().equals(beanInfo.getBeanClass().getName())) {
cacheByClass.remove(beanInfo.getBeanClass());
}
}
COM: <s> remove a single meta bean from the cache </s>
|
funcom_train/5450769 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeBean (RemoveConfirm RP) {
if (RP.OK) {
int SelectedBeanNo = NIL.getSelectedIndex();
PalettePage PP = PM.getPage (PageList.getSelectedIndex());
PP.removeBean (SelectedBeanNo);
setSource (PP);
NIL.setSelectedIndex (SelectedBeanNo);
}
updateButtons();
RP.dispose();
toFront();
}
COM: <s> this method is called by the remove confirm dialog on exit </s>
|
funcom_train/21845083 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String errorPointer() {
StringBuffer pointerString = new StringBuffer();
int spaces;
/*
* Figure out which token we're on, and get it's character position.
*/
if (queuePosition < queue.size()) {
final Token t = queue.get(queuePosition);
spaces = t.position;
}
else
spaces = buffSize;
/*
* Dashes to the desired position and then a marker.
*/
for (int i = 0; i < spaces; i++)
pointerString.append('-');
pointerString.append(ERROR_MARKER_CHARACTER);
return pointerString.toString();
}
COM: <s> return a string containing an error pointer that indicates where in the </s>
|
funcom_train/3051783 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isInverseOneToManyOrNoOrphanDelete() {
CollectionEntry ce = session.getPersistenceContext().getCollectionEntry(this);
return ce != null && ce.getLoadedPersister().isInverse() && (
ce.getLoadedPersister().isOneToMany() ||
!ce.getLoadedPersister().hasOrphanDelete()
);
}
COM: <s> is this the inverse end of a bidirectional one to many or </s>
|
funcom_train/30136252 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public CertPath getCertPath(){
if (isPathRetrieved) {
return this.certPath;
} else {
this.certPath = MyProxyProc.getCred(myProxyInfo);
publicKey = CertPathUtil.getPublicKeyFromCertPath(certPath);
isPathRetrieved = true;
return this.certPath;
}
}
COM: <s> get the value of cert path </s>
|
funcom_train/39189769 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addLoggingHandlers() {
LogManager manager = LogManager.getLogManager();
Logger rootLogger = manager.getLogger("");
for (HandlerConfigurationElement element : HandlerConfigurationElement
.listAllConfigurationElements()) {
try {
Class<Handler> clazz = element.getClassAttribute();
Handler handler = getHandler(clazz);
initializeHandler(handler);
rootLogger.addHandler(handler);
} catch (Throwable t) {
getLog()
.log(
new Status(
IStatus.ERROR,
JavaPlatformLoggingSupportPlugin.class
.getName(),
0,
"Failed to create handler "
+ element
.getAttribute(Attribute.id.value),
t));
}
}
}
COM: <s> adds all logging handlers to the </s>
|
funcom_train/34529760 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public DataSource get(DataSourceConfiguration configuration) throws DataSourceException {
SpreadsheetDataSource ds = new SpreadsheetDataSource();
ds.setName(configuration.getName());
// setup properties
Collection<Property> properties = configuration.getProperties();
for (Property property : properties) {
ds.setProperty(property.getName(), property.getValue());
}
ds.initialise();
return ds;
}
COM: <s> returns a new spreadsheet data source object </s>
|
funcom_train/28217744 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean intersects(Rectangle r) {
if (isEmpty() || r.isEmpty()) return false;
if (r.x + r.width < x) return false;
if (r.x > x + width) return false;
if (r.y + r.height < y) return false;
if (r.y > y + height) return false;
return true;
}
COM: <s> test if this rectangle intersects a specified rectangle </s>
|
funcom_train/3805385 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toHTML() {
String html = "<form method\"GET\" action=\"" + getFormAction() + "\">\n" +
super.getDescription() + "<br>\n" + "<input type=\"text\" name=\"" +
getInputName() + "\">\n</form>";
return html;
}
COM: <s> a basic rendering in html </s>
|
funcom_train/14455650 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void process(String[] args) {
for (int i=0; i<args.length; i++)
if (args[i] != null && args[i].startsWith("-"))
JClipProperties.getObjectFactory().set(object, getFieldForFlag(args[i]), args[i+1]);
}
COM: <s> set the parameters </s>
|
funcom_train/1472172 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Recurrings listRecurrings(int page, Integer perPage, Long clientId) throws ApiException, IOException {
Request request = new Request(RequestMethod.RECURRING_LIST);
request.setPage(page);
request.setPerPage(perPage);
request.setClientId(clientId);
return performRequest(request).getRecurrings();
}
COM: <s> list recurring profiles for a client </s>
|
funcom_train/41046730 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void saveToFile(Game game, File file, GameType gameType) {
XStream xs = new XStream();
try {
FileOutputStream fileoutputstream = new FileOutputStream(file);
xs.toXML(game, fileoutputstream);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
COM: <s> save game to a xml file </s>
|
funcom_train/37514737 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getName (Object o) {
String hashCode = Integer.toString(System.identityHashCode(o));
String clazz = o.getClass().getName();
int index = clazz.lastIndexOf(".");
if ( index == -1 )
return clazz + "@" + hashCode;
else
return clazz.substring(index + 1) + "@" + hashCode;
}
COM: <s> generates a name for an object </s>
|
funcom_train/16760019 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private SectorIndex getIndex( SectorIndex index, int level ) {
float oldLevelSize = levelMults[index.getLevel()];
final float x = index.x / oldLevelSize;
final float y = index.y / oldLevelSize;
final float z = index.z / oldLevelSize;
return getIndexFromPos( x, y, z, level );
}
COM: <s> compute an index for a different level </s>
|
funcom_train/5237420 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isCellFullyVisible(int row, int col) {
checkWidget();
if (layoutAdvisor == null)
return false;
return ((col >= leftColumn && col < leftColumn + columnsFullyVisible
&& row >= topRow && row < topRow + rowsFullyVisible)
|| (col < layoutAdvisor.getFixedColumnCount() && row < layoutAdvisor
.getFixedRowCount()));
}
COM: <s> decide whether the cell is fully visible or not </s>
|
funcom_train/28215910 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void calculateWeights(RangeReadings rr, Map map) {
maxWeight = 0f;
for (int i = 0; i < numParticles; i++) {
particles[i].calculateWeight(rr, map);
float weight = particles[i].getWeight();
if (weight > maxWeight) {
maxWeight = weight;
}
}
System.out.println("Max = " + maxWeight);
}
COM: <s> calculate the weight for each particle </s>
|
funcom_train/20606145 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void visitExprHolderHelper(ExprHolderNode exprHolder) {
for (ExprRootNode<? extends ExprNode> expr : exprHolder.getAllExprs()) {
if (currFileHasOptParams && !usesFunctionHasData &&
(new UsesFunctionHasDataVisitor()).exec(expr)) {
usesFunctionHasData = true;
}
getDataKeysInExprVisitor.exec(expr);
}
}
COM: <s> helper for visiting a node that holds one or more expressions </s>
|
funcom_train/48406534 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addAppliedQualificationPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_RoleUse_appliedQualification_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_RoleUse_appliedQualification_feature", "_UI_RoleUse_type"),
SpemxtcompletePackage.eINSTANCE.getRoleUse_AppliedQualification(),
true,
false,
true,
null,
null,
null));
}
COM: <s> this adds a property descriptor for the applied qualification feature </s>
|
funcom_train/39283553 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: //----------------------------------------------------------------------------
protected String getFile() { return m_strFile; }
COM: <s> get fully quailified file name </s>
|
funcom_train/9764351 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean equals(BondsArray av) {
if (av == null) {
return false;
}
if (size() != av.size()) {
return false;
}
for (int i = 0; i < size(); i++) {
BondInterface a1 = getBond(i);
BondInterface a2 = av.getBond(i);
if (!a1.equals(a2)) {
return false;
}
}
return true;
}
COM: <s> compares this atom vector with another </s>
|
funcom_train/5374960 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getUrl() {
checkWidget();
/*
int[] rgdispid = auto.getIDsOfNames(new String[] { "LocationURL" }); //$NON-NLS-1$
Variant pVarResult = auto.getProperty(rgdispid[0]);
if (pVarResult == null || pVarResult.getType() != OLE.VT_BSTR)
return "";
String result = pVarResult.getString();
pVarResult.dispose();
return result;
*/
return handle.contentWindow.location;
// return url;
}
COM: <s> returns the current url </s>
|
funcom_train/27779032 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setLookAndFeel() {
String lLookAndFeel = null;
try {
lLookAndFeel = UIManager.getSystemLookAndFeelClassName();
log.info("PDFBatchFrame.setLookAndFeel() using: " + lLookAndFeel);
UIManager.setLookAndFeel(lLookAndFeel);
} catch (Exception aException) {
aException.printStackTrace();
}
}
COM: <s> sets the look and feel attribute of the pdfbatch frame object </s>
|
funcom_train/2481727 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getDisplayName(Person person) {
String Return = "";
if (person.getGivenNames().length() > 0) {
Return += person.getGivenNames() + " ";
}
if (person.getFamilyName().length() > 0) {
Return += person.getFamilyName();
}
return Return;
}
COM: <s> returns the display name of the given person </s>
|
funcom_train/22549228 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void loadSettings() {
final int currentRevision = ++_revision;
if(LOG.isDebugEnabled())
LOG.debug("Starting new library revision: " + currentRevision);
LOADER.execute(new Runnable() {
public void run() {
loadStarted(currentRevision);
loadSettingsInternal(currentRevision);
}
});
}
COM: <s> starts a new revision of the library ensuring that only items present </s>
|
funcom_train/31679076 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void lock() {
Thread caller = Thread.currentThread();
synchronized (this) {
if (caller == _owner) {
_count++;
} else {
try {
while (_owner != null) {
checkCanceled();
this.wait();
}
_owner = caller;
_count = 1;
} catch (InterruptedException exception) {
return;
}
}
}
}
COM: <s> acquires the lock </s>
|
funcom_train/33725593 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Date getBuildTimestampAsDate() {
final SimpleDateFormat sdf = new SimpleDateFormat(BUILD_TIMESTAMP_FORMAT);
try {
return sdf.parse(buildTimestamp);
} catch (final ParseException ex) {
// Should never happen as it's checked in the constructor!
throw new IllegalStateException("The value '" + buildTimestamp
+ "' of the property 'buildTimestamp' was not in the format '"
+ BUILD_TIMESTAMP_FORMAT + "'!");
}
}
COM: <s> returns the build timestamp converted into a date </s>
|
funcom_train/50314165 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setText (String string) {
checkWidget ();
if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
if (handles (SWT.Verify)) {
int length = single? Fox.FXTextField_getText(handle).length(): Fox.FXText_getLength(handle);
string = verifyText (string, 0, length);
if (string == null) return;
}
if(single)
Fox.FXTextField_setText(handle, removeCRLF(string));
else
Fox.FXText_setText(handle, string, false);
sendEvent(SWT.Modify);
}
COM: <s> sets the contents of the receiver to the given string </s>
|
funcom_train/23182787 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void deleteTable(String table, String whereClause) {
logger.info("deleteTable(table, whereClause) - Entry");
PreparedStatement prepstmt = null;
String sql = "DELETE FROM app." + table + " where " + whereClause;
try {
prepstmt = this.getConnection(DBConnector.ConTypes.DBCREATOR)
.prepareStatement(sql);
prepstmt.execute();
commit(DBConnector.ConTypes.DBCREATOR);
} catch (SQLException e) {
e.printStackTrace();
} finally {
closePreparedStatement(prepstmt);
}
logger.info("deleteTable(table, whereClause) - Exit");
}
COM: <s> method used to delete table specified </s>
|
funcom_train/8096722 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testMissingPredictors() {
int i;
for (i = FIRST_CLASSTYPE; i <= LAST_CLASSTYPE; i++) {
// does the Kernel support this type of class at all?
if (!canPredict(i))
continue;
// 20% missing
checkMissingPredictors(i, 20, true);
// 100% missing
if (m_handleMissingPredictors[i])
checkMissingPredictors(i, 100, true);
}
}
COM: <s> tests whether the kernel can handle missing predictors 20 and 100 </s>
|
funcom_train/1114711 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString() {
return
this.m00 + ", " + this.m01 + ", " + this.m02 + "\n" +
this.m10 + ", " + this.m11 + ", " + this.m12 + "\n" +
this.m20 + ", " + this.m21 + ", " + this.m22 + "\n";
}
COM: <s> returns a string that contains the values of this matrix3d </s>
|
funcom_train/13714482 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public DPNSymbol createSymbol(String string) {
string = string.trim();
switch (string.charAt(0)) {
case '#':
return new Sharp(this);
case 'p':
return new ControlSymbol(Integer.parseInt(string.substring(1)),
this);
case 'g':
return new GammaSymbol(Integer.parseInt(string.substring(1)), this);
default:
throw new IllegalArgumentException("DPNSymbol representation must"
+ " start with either p or g");
}
}
COM: <s> creates a tt dpnsymbol tt from a string </s>
|
funcom_train/22924049 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected File getTempDir(boolean deleteOnExit) throws Exception {
File tempFile = File.createTempFile(this.getClass().getSimpleName() + "_", "trash");
File tempDir = new File(tempFile.getAbsolutePath() + "_dir");
tempDir.mkdirs();
tempFile.delete();
if (deleteOnExit) tempDir.deleteOnExit();
return tempDir;
}
COM: <s> gets a temporary directory </s>
|
funcom_train/31678167 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPopupMenu getJPopupMenu() {
if (jPopupMenu == null) {
jPopupMenu = new JPopupMenu();
jPopupMenu.add(getJPopupMenuItemBreak()); // Generated
jPopupMenu.add(getJPopupMenuItemCopy()); // Generated
jPopupMenu.add(getJPopupMenuItemPaste()); // Generated
// jPopupMenu.setVisible(false); // Generated
}
return jPopupMenu;
}
COM: <s> this method initializes j popup menu </s>
|
funcom_train/46492788 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void closed(Connection connection) {
// See if any queries are still outstanding for that Connection.
Map queryMap = getQueryDataMap(connection);
boolean reconnect = false;
synchronized (queryMap) {
if (queryMap.size()!=0) {
reconnect = true;
}
}
if (reconnect) {
// reconnect - the queue will be sent then.
connection.connect(remoteAddress, localAddress);
}
}
COM: <s> the connection has been closed </s>
|
funcom_train/31887124 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void fireLoopSliderChanged(boolean valueIsAdjusting) {
LoopSliderListener[] keyListeners =
mListenerList.getListeners(LoopSliderListener.class);
for (int i = keyListeners.length - 1; i >= 0; --i) {
keyListeners[i].loopSliderChanged(
new LoopSliderEvent(durationSlider.getValue(),
loopInPoint, loopOutPoint, valueIsAdjusting));
}
}
COM: <s> notify listeners that are interested in loop slider events </s>
|
funcom_train/43607361 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Node visitChildren(NodeVisitor v) {
TypeNode baseType = (TypeNode) visitChild(this.baseType, v);
List dims = visitList(this.dims, v);
ArrayInit init = (ArrayInit) visitChild(this.init, v);
return reconstruct(baseType, dims, init);
}
COM: <s> visit the children of the expression </s>
|
funcom_train/46759544 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public IContainer getContainerByRef(final int appDialogRefId, final ServiceCall call) throws Exception {
IBeanMethod method = new IBeanMethod() { public Object execute() throws Exception {
if (call.getUserId() == 0L) {
throw new NullPointerException();
}
return getApplicationContainer(appDialogRefId, call);
}}; return (IContainer) call(method, call);
}
COM: <s> looks up the application dialog defined by the setting tree </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.