__key__
stringlengths
16
21
__url__
stringclasses
1 value
txt
stringlengths
183
1.2k
funcom_train/35669604
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addOutArcsPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Node_outArcs_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Node_outArcs_feature", "_UI_Node_type"), ModelsPackage.Literals.NODE__OUT_ARCS, true, false, true, null, null, null)); } COM: <s> this adds a property descriptor for the out arcs feature </s>
funcom_train/49603759
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public JasperClassDesc getClazzDesc(Class<?> clazz,JasperClassDescBuilder.Rootifier rootifier, boolean isMainReport,String contextForAnnotations){ // get the class desc JasperClassDesc classDesc=builder.getClassDesc(clazz,isMainReport,rootifier,contextForAnnotations); doLayout(classDesc, isMainReport); return classDesc; } COM: <s> get the class description layed out for the given class </s>
funcom_train/20128842
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getIntegerDigits(String column) throws SQLException { if (index.containsKey(column)) { return integerDigits[index.get(column).intValue()]; } else { final SqlExceptionState state = SqlExceptionState.COLUMN_NOT_FOUND; throw new SQLException("Column " + column + " does not exist in resultset.", state.name(), state.code()); } } COM: <s> returns the designated columns integer digits </s>
funcom_train/24000306
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testAccess() throws Exception{ OclType returnType = OclTypeRegistry.OclStringType; TestOperationDefinition op = new TestOperationDefinition("getTest",true,returnType); BeanGetterPropertyDefinition instance = new BeanGetterPropertyDefinition(op); OclObject source = OclObjectFactory.create("a"); assertEquals("agetTest-call",instance.access(null,source).asJavaObject()); } COM: <s> test of access method of class bean getter property definition </s>
funcom_train/49626630
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Element getCaptchaInfo() { return new Element("captcha") .addContent( new Element("public-key").setText(Lifecycle .getCaptchaAdapter().getPublicKey())) .addContent( new Element("div-id").setText(Lifecycle .getCaptchaAdapter().getDivId())) .addContent( new Element("adapter").setText(Lifecycle .getCaptchaAdapter().getClass() .getCanonicalName())); } COM: <s> gets the captcha public key info </s>
funcom_train/28741919
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void archiveDeliverables(Map deliverables, int orderNbr) throws SimsException { try { controller.archiveDeliverables(deliverables, new Integer(orderNbr)); } catch(RemoteException rex) { errMsg += ErrMsgConstants.REMOTE_EX; //Handle the RemoteException. ExceptionUtil.handleRemoteException(errMsg, rex); } } COM: <s> this method is called from terranode to populate deliverable data into srm </s>
funcom_train/25602242
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean isFileModified() { if (this.fileLastModified == -1) { return true; } if (ifModifiedSince != -1) { if (strict) { return fileLastModified != ifModifiedSince; } return fileLastModified > ifModifiedSince; } if (ifNoneMatch != null) { return !ifNoneMatch.equals(getFileETag()); } return true; } COM: <s> checks if th original file was modified compard with the file in the </s>
funcom_train/3005520
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Long getNextNumber(String sequenceName) { List sequenceCache = (List) _sequenceCache.get(sequenceName); if (sequenceCache == null || sequenceCache.size() == 0) { sequenceCache = generateNewBlock(sequenceName); _sequenceCache.put(sequenceName, sequenceCache); } return (Long) sequenceCache.remove(0); } COM: <s> the unique method to retrieve the keys </s>
funcom_train/46381836
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void sendToSession(Message message) { try { ByteBuffer buf = MessagePacker.pack(message, SessionInternalConnectionType.SESSION_INTERNAL_CLIENT_ID); getSession().send(buf); } catch (PackerException ioe) { logger.log(Level.WARNING, "Unable to send message " + message, ioe); } } COM: <s> send a message to the session </s>
funcom_train/10273815
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private CompiledStatement recompileStatement(int csid) { String sql = compiledStatementManager.getSql(csid); if (sql == null) { // invalid sql has been removed already return null; } Result r = sqlPrepare(sql); if (r.iMode == ResultConstants.ERROR) { // sql is invalid due to DDL changes compiledStatementManager.freeStatement(csid, sessionId); return null; } return compiledStatementManager.getStatement(csid); } COM: <s> recompile a prepard statement or free it if no longer valid </s>
funcom_train/862776
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setResponse(ConversationID id, Response response) { // write the request to the disk using the requests own id if (response == null) { return; } _responseCache.put(id, response); try { File f = new File(_conversationDir, id + "-response"); FileOutputStream fos = new FileOutputStream(f); response.write(fos); fos.close(); } catch (IOException ioe) { _logger.severe("IOException writing response(" + id + ") : " + ioe); } } COM: <s> associates the response with the specified conversation id </s>
funcom_train/7866724
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public AgentAggregator getAgentAggregator() { // First, get the selected aggregator from the combobox for the task. AgentAggregator lAgentAggregator = iAgentAggregators[cmbAgentAggregators.getSelectedIndex()]; // Second, set the latest version of the AgentFactory to the AgentAggregator. lAgentAggregator.setAgentsCollection(AgentFactory.getInstance().getActiveAgents()); return lAgentAggregator; } COM: <s> returns the selected agent aggregator in the combobox </s>
funcom_train/570853
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void focusGained(FocusEvent e) { if (e.getOppositeComponent() != null) { if (e.getOppositeComponent() instanceof JComponent) { JComponent opposite = (JComponent) e .getOppositeComponent(); if ((opposite.getTopLevelAncestor() != _calendarWindow) && (!_calendarWindowFocusLost)) _calendarWindowFocusLost = false; } } } COM: <s> invoked when a component gains the keyboard focus </s>
funcom_train/45333250
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private PersonName getPersonName(String lastName, String firstName){ if ((lastName == null || lastName.equalsIgnoreCase("")) && (firstName == null || firstName.equalsIgnoreCase("")) ) return null; PersonName pname= new PersonName(); pname.setLastName(lastName); pname.setFirstName(firstName); return pname; } COM: <s> gets code person name code </s>
funcom_train/35837457
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addButton(UIButton oButton) { GridBagConstraints gc = new GridBagConstraints(); gc.fill = GridBagConstraints.NONE; gc.insets = new Insets(10,10,10,10); gc.weightx = 1; gc.gridwidth=1; //gc.gridx = oXPos; //oXPos++; //gc.anchor = GridBagConstraints.EAST; gc.anchor = GridBagConstraints.WEST; oGridBagLayout.setConstraints(oButton, gc); super.add(oButton); } COM: <s> add the given button on the left of the panel </s>
funcom_train/15548325
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JButton getRestoreButton() { if (restoreButton == null) { restoreButton = new JButton(); restoreButton.setText("Restore"); restoreButton.setIcon(new ImageIcon(getClass().getResource("/restore.png"))); restoreButton.setContentAreaFilled(true); restoreButton.setFocusPainted(false); restoreButton.setFont(new Font("Dialog", Font.PLAIN, 10)); } return restoreButton; } COM: <s> this method initializes restore button </s>
funcom_train/22184886
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void cacheEmailBodies(BufferedEmailSet lightweightEmails) { // Collect all email messages... Set<EmailMessage> messageSet = new HashSet<EmailMessage>(); for (Iterator iter = lightweightEmails.iterator(); iter.hasNext();) { messageSet.add(((LightweightEmail) iter.next()).getEmailMessage()); } // ... and cache their bodies cacheEmailBodies(messageSet); } COM: <s> pre caches the bodies for all these emails </s>
funcom_train/20888261
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void enqueueEvent(ToDevice event, DeviceType toDevice) { if (event == null) { throw new IllegalArgumentException("event"); } if (event.getDelay() < 0) { throw new IllegalArgumentException("delay of an event should never be negative"); } if (toDevice == null) { throw new IllegalArgumentException("toDevice"); } Node node = allNodes.get(event.getReceiver()); NodeInternalToDeviceEnvelope env = new NodeInternalToDeviceEnvelope(event, node, toDevice); queue.add(env); } COM: <s> private method for internal communication </s>
funcom_train/51710190
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addRefinedDomainPropertyDescriptor(Object object) { itemPropertyDescriptors .add(createItemPropertyDescriptor( ((ComposeableAdapterFactory) adapterFactory) .getRootAdapterFactory(), getResourceLocator(), getString("_UI_MappingParameter_refinedDomain_feature"), getString("_UI_PropertyDescriptor_description", "_UI_MappingParameter_refinedDomain_feature", "_UI_MappingParameter_type"), QvtoperationalPackage.Literals.MAPPING_PARAMETER__REFINED_DOMAIN, true, false, true, null, null, null)); } COM: <s> this adds a property descriptor for the refined domain feature </s>
funcom_train/33814817
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JCheckBox getFuncionarioRecebeQuinquenioCheckBox() { if (funcionarioRecebeQuinquenioCheckBox == null) { funcionarioRecebeQuinquenioCheckBox = new JCheckBox(); funcionarioRecebeQuinquenioCheckBox.setBounds(new Rectangle(15, 15, 252, 22)); funcionarioRecebeQuinquenioCheckBox.setText("Funcionário recebe quinquênio?"); } return funcionarioRecebeQuinquenioCheckBox; } COM: <s> this method initializes funcionario recebe quinquenio check box </s>
funcom_train/28158327
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Matrix transpose() { final double[][] newValues = new double[cols][rows]; for (int row = 0; row < rows; row++) { for (int col = 0; col < cols; col++) { newValues[col][row] -= values[row][col]; } } values = newValues; final int c = rows; rows = cols; cols = c; return this; } COM: <s> transpose this matrix </s>
funcom_train/13551550
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void run() { monitor.opNotify(); // notify that we will use it while(io==null) { yield(); } while(true) { while (!power) { yield(); // give mutex to other threads } bodyAsync(); // execute tha async part of body bodySync(); // execute the cia clock boby monitor.opWait(); // attend clock signal } } COM: <s> performs the body of cia emulation </s>
funcom_train/4405256
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void start() { this.addNextPiece(pieceProvider.requestPiece()); // Ask for the first piece currentPiece = this.getNextPiece(); currentPosition = new Point(); isStarted = true; // Enable all registered players for (Player player : players) { player.setEnabled(true); } // notifyStarted(); afterNextPiece(); // call the post-new-piece routine } COM: <s> start the game by grabbing the first piece waiting in the list </s>
funcom_train/35838205
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public UINode addNode(UINode uinode) { // Don't add the same node twice UINode oldnode = (UINode)oViewPane.get(uinode.getNode().getId()); if (oldnode != null) return oldnode; Dimension d = uinode.getPreferredSize(); Point p = uinode.getNodePosition().getPos(); uinode.setBounds(p.x, p.y, d.width, d.height); oViewPane.add(uinode, UIViewPane.NODE_LAYER); return uinode; } COM: <s> adds an existing uinode to the view pane </s>
funcom_train/9817913
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getRelativeName(Node ancestor) { if (this == ancestor) return ""; Node parent = getParent(); if (parent == null || isRoot()) return null; if (parent == ancestor) return getLeafName(); String result = parent.getRelativeName(ancestor); return result == null ? null : result + LEVEL_DELIMITER + getLeafName(); } COM: <s> the relative name uniquely identifies this nameable with respect to an ancestor </s>
funcom_train/34799108
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void deleteOldParsers() { File dir = new File(Settings.getParserPath()); File[] files = dir.listFiles(); for (int i = 0; i < files.length; i++) { if (files[i].getName().startsWith(g.getName() + "Lexer") || files[i].getName().startsWith(g.getName() + "Parser")) { files[i].delete(); } } files = null; dir = null; } COM: <s> delete generated source and binary code of scanners parsers from hdd </s>
funcom_train/36149766
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private double SumXY() { double sum = 0; for (int i = 0; i < x.size(); ++i) { sum += ((Double)x.elementAt(i)).doubleValue() * ((Double)y.elementAt(i)).doubleValue(); } return sum; } COM: <s> returns the sum of pairwise products between the x and y values </s>
funcom_train/49790298
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testSessionExit() throws Exception { IFile sitemap = beginAtSitemapThenPage("Page 1"); assertNoProblem(); // but now if we try to visit External Page, we get // redirected to Advertisement gotoSitemapThenPage(sitemap, "External Page", "Advertisement"); assertNoProblem(); // but now if we try to access External Page, it is OK gotoSitemapThenPage(sitemap, "External Page", "External Page"); assertNoProblem(); } COM: <s> if we enter the session we have to view the ad </s>
funcom_train/9924832
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Value applyOperator(char operator, boolean allowForwardRef) { switch (operator) { case '+': return this; case '-': number = number.negate(); break; case '~': number = number.not(); break; default: throw new AssertionError((char)operator); } if (base != null && !allowForwardRef) Assemble.throwErr("Relocatability invalid for this operation " + (char)operator); return this; } COM: <s> evaluate a unary one operand operator </s>
funcom_train/48077176
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public StackOverflowApiUrlBuilder withFieldEnumSet(String name, Set<? extends ValueEnum> enumSet) { StringBuilder builder = new StringBuilder(); if (!enumSet.isEmpty()) { builder.append(":"); Iterator<? extends ValueEnum> iter = enumSet.iterator(); builder.append("("); while (iter.hasNext()) { ValueEnum fieldEnum = iter.next(); builder.append(fieldEnum.value()); if (iter.hasNext()) { builder.append(","); } } builder.append(")"); } fieldsMap.put(name, builder.toString()); return this; } COM: <s> with field enum set </s>
funcom_train/50879387
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object clone(){ // if this is an uninitialized multipoint, then return an uninitialized multipoint. if (myXCoordinates == null) return new MultiPoint(); // create a copy of this multipoint and return that one. double[] tempXCoordinates = new double[myXCoordinates.length]; double[] tempYCoordinates = new double[myYCoordinates.length]; return new MultiPoint(tempXCoordinates, tempYCoordinates); } COM: <s> creates a copy of the multi point </s>
funcom_train/51272279
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getIntervalPosition(StructuralIdentifier key) { if (currentSize == 0) { return -1; } else { int pos = binarySearch(keys, key, 0, currentSize - 1); // we are left-aligned, so we take equal to the right, non-equal at // insertion point if (pos < 0) { // key not found: calculate insertion point pos = -(pos + 1); } else { // key found: take right path pos++; } return pos; } } COM: <s> obtains the position in the nodes array that represents the interval in </s>
funcom_train/31013223
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Object getListValueFor(Object object) throws JspTagException { if (object == null) { return ""; } Class clazz = this.getObjectType(); Method method = null; if (this.getListattribute() != null) { return ReflectionHelper.getAttributeValue(object, this.getListattribute()); } else { if (object.getClass() == String.class) { return object; } else { return object.toString(); } } } COM: <s> answer the selected value that should appear in the list </s>
funcom_train/13962562
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void untag(Class<?> tagClass) { Iterator<Tag<?>> tagIter = _tags.iterator(); while (tagIter.hasNext()) { Tag<?> tag = tagIter.next(); if (tagClass.isInstance(tag)) { tagIter.remove(); } } } COM: <s> remove all tags of the given class </s>
funcom_train/40439603
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private ExternalAPI getService() throws RpcException { try { final Context ctx = new InitialContext(); final Object ref = ctx.lookup(getConfiguration().getString("externalApiPath")); return (ExternalAPI) PortableRemoteObject.narrow(ref, ExternalAPI.class); } catch (final NamingException e) { logger.error("Unable to retrieve the ExternalAPI EJB", e); throw new RpcException("An error occurred while contacting the naming service"); } } COM: <s> a helper method that retrieves a reference to the external api bean and </s>
funcom_train/13814215
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void calcColorTemp() { double rgb[] = { dlRedGreenRatio/redGreenRatio, 1., dlBlueGreenRatio/blueGreenRatio }; double ct[] = RawConversionSettings.rgbToColorTemp( rgb ); ctemp = ct[0]; greenGain = ct[1]; } COM: <s> calculate color temperature and green gain from channel multipliers </s>
funcom_train/23770110
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String toString() { StringBuffer buf = new StringBuffer(); int n = size(); for (int i=0; i<n; i++) { buf.append(get(i)); if ( (i+1)<n ) buf.append(" "); } return buf.toString(); } COM: <s> return string of current buffer contents non destructive </s>
funcom_train/4852829
/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:|67-getter|0|67-preInit // write pre-init user code here backCommand3 = new Command("Voltar", Command.BACK, 0);//GEN-LINE:|67-getter|1|67-postInit // write post-init user code here }//GEN-BEGIN:|67-getter|2| return backCommand3; } COM: <s> returns an initiliazed instance of back command3 component </s>
funcom_train/50154990
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void resetData() { newsFeed[currentFeed].elements = new HashMap(); newsFeed[currentFeed].imageElements = new HashMap(); newsFeed[currentFeed].textInputElements = new HashMap(); newsFeed[currentFeed].items = new ArrayList(); newsFeed[currentFeed].categories = new ArrayList(); currentElement = ""; parsingItems = false; isHTML = false; parsingImage = false; parsingTextInput = false; fElementDepth = 0; } COM: <s> empty any existing data before loading </s>
funcom_train/8311486
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object call(Context context, Vector args) throws FunctionCallException { if ((args.size()) == 3) { return TranslateFunction.evaluate(args.elementAt(0), args.elementAt(1), args.elementAt(2), context.getNavigator()); } throw new FunctionCallException("translate() requires three arguments."); } COM: <s> characters found in the second argument are replaced by </s>
funcom_train/46858913
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void initUnitZones(Tile t) { TileMover tileMover = t.getTileMover(); if (tileMover instanceof Unit) { Unit unit = (Unit) tileMover; List<Location> moveZone = map.getMovementZone(unit); List<Location> attackZone = map.getAttackZone(unit); unit.setMoveZone(moveZone); unit.setAttackZone(attackZone); } } COM: <s> create zones for each unit in the map </s>
funcom_train/1301355
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getLocalPosition(String machineName, int jvmNum) { int result = 0; final Collection<String> nodeNames = getNodeNames(getLevel(machineName, jvmNum), true); final String nodeName = machineName.toLowerCase() + "-" + jvmNum; for (String curName : nodeNames) { if (nodeName.equalsIgnoreCase(curName)) break; else ++result; } return result; } COM: <s> among all nodes at the given nodes level find its position </s>
funcom_train/15623764
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public double getStringSimilarity(String ngram1, String ngram2) { String n1 = ngram1.toLowerCase(); String n2 = ngram2.toLowerCase(); if (n1.length() < n2.length() && n2.startsWith(n1)) { return 0.75d; } if (n1.length() > n2.length() && n1.startsWith(n2)) { return 0.75d; } if (n1.length() == n2.length() && n2.equals(n1)) { return 1d; } return 0d; } COM: <s> this method is used to compare the atoms ie the n grams </s>
funcom_train/50542798
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean getState(Address target, long timeout) throws ChannelNotConnectedException, ChannelClosedException { StateTransferInfo info=new StateTransferInfo(StateTransferInfo.GET_FROM_SINGLE, target); return _getState(new Event(Event.GET_STATE, info), timeout); } COM: <s> retrieves the current group state </s>
funcom_train/50044310
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int getRealMax(Node node) { if (node.isNull()) return Integer.MIN_VALUE; int leftMax = getRealMax(node.left); int rightMax = getRealMax(node.right); int nodeHigh = (node.interval).getHigh(); int max1 = (leftMax > rightMax ? leftMax : rightMax); return (max1 > nodeHigh ? max1 : nodeHigh); } COM: <s> used for testing only </s>
funcom_train/13390492
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void waitForState(final State expectedState) throws Exception { Condition condition = new Condition() { public boolean test() { State state = getState(); logger.log(Level.INFO, "Detected: {0}", state); return state.equals(expectedState); } public String toString() { return expectedState.toString(); } }; Waiter waiter = new Waiter(); waiter.waitFor(condition); } COM: <s> waits for the current state of the system to become as expected </s>
funcom_train/28218610
/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( de.nordakademie.lejos.stateMachine.diagram.part.StateMachineVisualIDRegistry .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/13848490
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void close() { synchronized (lock) { if (closed) { return; } closed = true; } try { serverSocket.close(); } catch (IOException e) { } if (logger.isLoggable(Level.FINE)) { logger.log(Level.FINE, "closed server socket {0}", serverSocket); } /* * Iterating over connections without synchronization is * safe at this point because no other thread will access * it without verifying that closed is false in a * synchronized block first. */ for (Iterator i = connections.iterator(); i.hasNext();) { ((ServerConnectionImpl) i.next()).close(); } } COM: <s> stops this listen operation </s>
funcom_train/36188816
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void open_go_to_frame() { if (go_to_frame == null) { go_to_frame = new GoToFrame(); go_to_frame.setLocation(this.getLocationOnScreen().x + mouse_x - 10, this.getLocationOnScreen().y + mouse_y - 10); go_to_frame.setVisible(true); } } COM: <s> open the goto frame </s>
funcom_train/51301543
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void handleWait(int methodId) { PolicyEvent policyEvent = new PolicyEvent(PolicyEvent.WAIT); ActionList actionList = clientPolicy.getEventActionList(policyEvent); try { if (actionList != null) { executeActionList(actionList); } } catch (Exception e) { ErrorLog.add(e); } } COM: <s> handle wait is called by the reduced object instead of the normal wait </s>
funcom_train/42645808
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void reflectUndoCommands(){ UndoCaretaker undoCaretaker = ((DocumentViewModelImpl) documentViewController.getDocumentViewModel()). getAnnotationCareTaker(); setEnabled(undoMenuItem, undoCaretaker.isUndo()); setEnabled(redoMenuItem, undoCaretaker.isRedo()); } COM: <s> method to determine if the undo and redo menu items can be enabled </s>
funcom_train/44701902
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Sequence replaceAll(char oldChar, char newChar) { char[] newSequence = new char[sequence.length]; for (int i = 0; i < sequence.length; i++) { if(sequence[i] == oldChar) { newSequence[i] = newChar; } else { newSequence[i] = sequence[i]; } } return new Sequence(newSequence); } //replaceAll() COM: <s> replaces all ocurrences of code old char code by code new char code </s>
funcom_train/41211725
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void findServices(RemoteDevice device){ try { UUID[] uuids = new UUID[1]; uuids[0] = new UUID("37012f0c68af4fbf8dbe6bbaf7aa4300",false); //The UUID of the LinkBuild service agent.searchServices(null,uuids,device,this); } catch(Exception e) { this.do_alert("Error in initiating search" , 4000); } } COM: <s> calls discovery agent to search for services </s>
funcom_train/28248997
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean register(T sink) { if (sink==null) throw new NullPointerException(); synchronized (listSync) { if (isRegistered(sink)) return false; T[] newlist=Arrays.copyOf(registeredSinks, registeredSinks.length+1); newlist[newlist.length-1]=sink; registeredSinks=newlist; } return true; } COM: <s> registers a sink interested in the events of this source </s>
funcom_train/50863870
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private double exploringPhase(double time) { // Check for an accident during the EVA operation. checkForAccident(time); // Check if there is reason to cut the exploring phase short and return // to the rover. if (shouldEndEVAOperation()) { setPhase(EVAOperation.ENTER_AIRLOCK); return time; } // Collect rock samples. collectRockSamples(time); // Improve mineral concentration estimates. improveMineralConcentrationEstimates(time); // TODO: Add other site exploration activities later. // Add experience points addExperience(time); return 0D; } COM: <s> perform the exploring phase of the task </s>
funcom_train/1379428
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JButton getBtnTavoli() { if (btnTavoli == null) { try { btnTavoli = new JButton(); btnTavoli.setText("Tavoli"); // Generated btnTavoli.setSize(new Dimension(100, 30)); // Generated btnTavoli.setPreferredSize(new Dimension(100, 30)); // Generated btnTavoli.addActionListener(myActionListener); } catch (java.lang.Throwable e) { // TODO: Something } } return btnTavoli; } COM: <s> this method initializes btn tavoli </s>
funcom_train/23929581
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String getStringParameterValue( String key ) throws MapPSOConfigurationException { String paramValue = getProperty( key ); if( paramValue == null ) { final String errMsg = "Configuration parameter \"" + key + "\" missing."; logger.error( errMsg ); throw new MapPSOConfigurationException( errMsg ); } return paramValue.trim(); } COM: <s> obtains a string valued parameter value </s>
funcom_train/51812363
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testSameOutputStreamUsedBeforeClose() throws Exception { ByteArrayResource resource = new ByteArrayResource( ); OutputStream out = resource.getOutputStream(); assertSame("Same output stream not returned", out, resource.getOutputStream()); out.close(); assertTrue("New output stream not returned", out != resource.getOutputStream()); resource.getOutputStream().close(); } COM: <s> tests that a resource returns the same output stream until it is closed </s>
funcom_train/13334141
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void onClickDeleteDefinition() { if (null == selectedCandidateTerm) { logger.error("No term selected"); //$NON-NLS-1$ } else { selectedCandidateTerm.setUserDefinedDefinition(null); selectedCandidateTerm.setGeneratedDefinitions(null); candidateTermCache.addTerm(selectedCandidateTerm); updateParentAsTermFromDefinition(selectedCandidateTerm, candidateTermsTable, ontologyTermsTable, definitionTable); // commit to OBOClass if term is known adapter.commitDefinition(selectedCandidateTerm); updateSaveDefWarningLabel(false); deleteDefButton.setEnabled(false); } } COM: <s> delete definition for </s>
funcom_train/24527890
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getRawHTMLSource(String browserID){ Element htmlsrc = getHtmlsrcElement(browserID); if (htmlsrc == null){ logError("[112] getRawHTMLSource couldn't find source for browserID '"+browserID+"' in "+getFilename()); return ""; } String result = htmlsrc.getText(); return result; } COM: <s> return just the un rendered xhtml source un processed by webmacro </s>
funcom_train/49805597
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void stopCommandThread() { if (commandThreadChild != null && commandThreadChild.getIsRunning()) { sendMessage("Stopping the " + getSimpleCommandName() + " command thread.", eMsgTypes.publicMsg); commandThreadChild.stop(); } else { sendMessage("The " + getSimpleCommandName() + " command thread is not running.", eMsgTypes.publicMsg); } } COM: <s> this method is more of a pause command thread </s>
funcom_train/37571637
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testOtherMethods() throws Exception { Exception nested = new Exception("Problim!"); ModelException exception = new ModelException("Errer!", nested); // assertTrue(nested == exception.getNestedException()); // no longer storing the nexted exception. assertNotNull(exception.toString()); } COM: <s> test other methods in the class </s>
funcom_train/34503890
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void loadPatterns(String[] s, String[] r) throws Exception{ if(validStrAr(s) && validStrAr(r) && s.length == r.length){ for(int i = 0; i < s.length; i++){ loadPattern(s[i], r[i]); } }else{ if(s.length != r.length){ throw new Exception(); } } } COM: <s> adds 2 arrays of strings as string builders to the patterns array list </s>
funcom_train/26207757
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JMenuBar createMenubar() { JMenuItem mi; JMenuBar mb = new JMenuBar(); String[] menuKeys = tokenize(getResourceString("menubar")); for (int i = 0; i < menuKeys.length; i++) { JMenu m = createMenu(menuKeys[i]); if (m != null) { mb.add(m); } } return mb; } COM: <s> create the menubar for the app </s>
funcom_train/51588755
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void sendEvent(final Event event) { if (security != null) { // TODO: cache permissions security.checkPermission(new TopicPermission(event.getTopic(), TopicPermission.PUBLISH)); } final Subscription[] subscriptions = (Subscription[]) eventHandlerSubscriptions.values() .toArray(new Subscription[eventHandlerSubscriptions.size()]); for (int i = 0; i < subscriptions.length; i++) { if (subscriptions[i].matches(event)) { subscriptions[i].sendEvent(event); } } } COM: <s> send an event synchronously </s>
funcom_train/37821188
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void updateConst(SymbolTable symbolTable) throws SymbolException { if (declaration.getConstDecl() != null) { List<ConstIdent> constants = declaration.getConstDecl().getConstants(); for (ConstIdent ident : constants) { symbolTable.add(Symbol.constSymbol(ident.getName(), ident.getValue())); } } } COM: <s> fills the symbol table with the declared constants </s>
funcom_train/27944349
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void createPartControl(Composite parent) { this.parent = parent; list = new List(parent, SWT.BORDER); viewer = new ListViewer(list); viewer.setLabelProvider(new LabelProvider()); viewer.setContentProvider(new IStructuredContentProvider() { public Object[] getElements(Object input) { return ((ConnectionSet) input).getElements(); } public void dispose() { } public void inputChanged( Viewer viewer, Object oldInput, Object newInput) { } }); viewer.setInput(ConnectionSet.instance()); makeActions(); hookContextMenu(); hookDoubleClickAction(); contributeToActionBars(); } COM: <s> this is a callback that will allow us to create the viewer and </s>
funcom_train/23716526
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public StringItem getStringItem5 () { if (stringItem5 == null) {//GEN-END:|92-getter|0|92-preInit // write pre-init user code here stringItem5 = new StringItem ("Zdobyte punkty: \n", null);//GEN-LINE:|92-getter|1|92-postInit // write post-init user code here }//GEN-BEGIN:|92-getter|2| return stringItem5; } COM: <s> returns an initiliazed instance of string item5 component </s>
funcom_train/44211856
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void createTodo(final String listId, final Todo todo) { Date now = Calendar.getInstance().getTime(); todo.setCreationDate(now); TodoList todoList = todoListsManager.findTodoList(listId); todo.setTodoList(todoList); todoList.getTodos().add(todo); todoDAO.saveTodo(todo); todoListsManager.updateTodoList(todoList); } COM: <s> create a new todo </s>
funcom_train/11725208
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testRemoveFirstSibling3() throws RepositoryException { firstSiblingNode.remove(); // check if the node has been properly removed try { Item secondSibling = superuser.getItem(firstSiblingPath); // implementation specific: assertTrue("", removeItem.isSame(secondSibling)); } catch (PathNotFoundException e) { fail("Removing a SNS Node -> successor must be accessible from the session by removed path."); } } COM: <s> transiently removes a persisted item using </s>
funcom_train/4953422
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getExecutionTimeUnit(TestItemSummary tis) { double largest = 0.0; if (null == tis) { largest = th.getLargestExecutionTime(); } else { largest = tis.getLargestExecutionTime(); } if (largest <= 1.0) { return "ms"; } else if (largest <= 120.0) { return "sec"; } else if (largest <= 3600.0 * 2.0) { return "minutes"; } else { return "hours"; } } COM: <s> returns the execution time unit to display on the execution time graph </s>
funcom_train/45936072
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected ClassDoc getValidClass(ClassDoc[] classArray) { ClassDoc firstValidClass = null; if (!nodeprecated) firstValidClass = classArray[0]; else { for (int i = 0; i < classArray.length; i++) { if (classArray[i].tags("deprecated").length == 0) { firstValidClass = classArray[i]; break; } } } return firstValidClass; } COM: <s> given an array of classes return the first valid class </s>
funcom_train/29738090
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setColumnClass(int columnIndex, Class columnClass) { Class oldColumnClass = columns[columnIndex-1].klass; columns[columnIndex-1].klass = columnClass; pcs.firePropertyChange("columnClass"+columnIndex, oldColumnClass, columnClass); } COM: <s> sets the column class at the specified index </s>
funcom_train/45515628
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void setItalic(boolean active, boolean overwrite) { MutableAttributeSet attrItalic = new SimpleAttributeSet(); StyleConstants.setItalic(attrItalic, active); int length = TEXT_AREA.getSelectionEnd() - TEXT_AREA.getSelectionStart(); ((StyledDocument) TEXT_AREA.getDocument()).setCharacterAttributes( TEXT_AREA.getSelectionStart(), length, attrItalic, overwrite); } COM: <s> sets the current selection italic </s>
funcom_train/32631281
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void initDatabase(final DSession session, final NotesLocation location) throws DNotesException { final String path = location.getPath(); if (location.isIIOP()) { mDatabase = session.getDatabase("", path); } else { final String server = location.getServer(); mDatabase = session.getDatabase(server, path); } } COM: <s> initializes the database </s>
funcom_train/14233056
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void applyBackgroundSettings() { if (oldBackground.equals(mainBackgroundField.getText())) { return; } try { ConfigFile.setProperty("background-image", mainBackgroundField .getText()); } catch (IOException e) { JOptionPane .showMessageDialog( prefAppearance, "Could not create a configuration file, please make sure you have permissions to the folder Bancraft is in."); } } COM: <s> applies the background image settings </s>
funcom_train/3371709
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int rowAtPoint(Point point) { int y = point.y; int result = (rowModel == null) ? y/getRowHeight() : rowModel.getIndex(y); if (result < 0) { return -1; } else if (result >= getRowCount()) { return -1; } else { return result; } } COM: <s> returns the index of the row that code point code lies in </s>
funcom_train/810564
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addEncodedLengthPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_BinaryDataArrayType_encodedLength_feature"), getString("_UI_PropertyDescriptor_description", "_UI_BinaryDataArrayType_encodedLength_feature", "_UI_BinaryDataArrayType_type"), MzmlPackage.Literals.BINARY_DATA_ARRAY_TYPE__ENCODED_LENGTH, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the encoded length feature </s>
funcom_train/36767569
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void addLibrariesFromClasspath(final DefaultMutableTreeNode root) { String classpath = System.getenv("CLASSPATH"); String[] libs = classpath.split(";"); for (int i = 0; i < libs.length; i++) { addClassesFromJar(libs[i], root); } } COM: <s> looks up the classpath settings and adds the libraries from the </s>
funcom_train/41139801
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int getHashCode() { int hv = 0; for (int i = 0; i < attributes.length; i++) { if (included[i]){ if (missing[i]) { hv += (i * 13); } else { hv += (i * 5 * (attributes[i] + 1)); //the effecitivity of this hashing function } //should be verified } } key = hv; return hv; } COM: <s> calculates a hash code </s>
funcom_train/49017718
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void populateTreeByHits() { // delete previous tree top.removeAllChildren(); ArrayList<Track> tracks = TrackManager.getInstance().getTracksAsList(); Collections.sort(tracks, TrackManager.getInstance().getComparator()); for (Track track : tracks) { if (!track.shouldBeHidden()) { addTrackAndAlbum(top, track); } } } COM: <s> fill the tree by hits </s>
funcom_train/26415641
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object get(Object key) { Object returnObject = null; /* * if the caches contains the key then move that key to the beginning * of the MRU list and get the object from the cache */ if (cache.containsKey(key)) { mruList.remove(key); mruList.addFirst(key); returnObject = cache.get(key); } return returnObject; } COM: <s> returns the value to which this cache maps the specified key </s>
funcom_train/13647162
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private long computeRawHeaderSize(Properties header) { long size = 0; Enumeration enumeration = header.propertyNames(); while (enumeration.hasMoreElements()) { String key = (String) enumeration.nextElement(); //key + "=" size += key.length() + 1; //value + LF size += header.getProperty(key).length(); } return (size); } COM: <s> compute the header upload size for the jmx interface </s>
funcom_train/9218601
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void cleanupBatch() { for (int i = 0, n = statementList.size(); i < n; i++) { PreparedStatement ps = (PreparedStatement) statementList.get(i); closeStatement(ps); } currentSql = null; statementList.clear(); batchResultList.clear(); size = 0; } COM: <s> close all the statements in the batch and clear all the statements </s>
funcom_train/38808672
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void test_TCM__Object_clone() throws JHuPeDOMException { String publicID = "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"; String systemID = "FILE://temp/test.dtd"; DocType theDocType = jhupeDomFactory.newDocType("anElement", publicID, systemID); DocType theDocType2 = (DocType) theDocType.clone(); // assuming toString works as advertised.... assertEquals(theDocType.toString(), theDocType2.toString()); } COM: <s> use to string to test the clone </s>
funcom_train/40358946
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testEmptyConfig() throws Exception { language = "en"; connectorName = "ConnectorA"; connectorType = "documentum"; configData = new TreeMap<String, String>(); configXml = null; update = false; SetConnectorConfigHandler hdl = doTest(setXMLBody()); assertEquals(ConnectorMessageCode.RESPONSE_NULL_CONFIG_DATA, hdl.getStatus().getMessageId()); } COM: <s> test empty config map </s>
funcom_train/4644674
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addPropertyChangeSupportPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_BaseObject_propertyChangeSupport_feature"), getString("_UI_PropertyDescriptor_description", "_UI_BaseObject_propertyChangeSupport_feature", "_UI_BaseObject_type"), TassooPackage.Literals.BASE_OBJECT__PROPERTY_CHANGE_SUPPORT, false, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the property change support feature </s>
funcom_train/25797053
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean addToPlaylist(INotifiableManager manager, Artist artist, Genre genre, int sortBy, String sortOrder) { return mConnection.getBoolean(manager, "AddToPlayListFromDB", LIBRARY_TYPE + ";" + getSongsCondition(artist, genre) + songsOrderBy(sortBy, sortOrder)); } COM: <s> adds songs of a genre from an artist to the current playlist </s>
funcom_train/25529857
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void add( Vertex newvertex ) throws Exception { GraphAddVertexListener listener; if (this.containsVertex(newvertex)) { // vertex is already part of this graph; nothing to do return; } GraphAddVertexEvent event = new GraphAddVertexEvent(this,newvertex,null); // TODO: DEBUG invokeAddVertexListeners(event,true); addVertexUnconditionally(event); } COM: <s> this implementation of add vertex should not normally be </s>
funcom_train/5373196
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Rectangle getImageBounds (int index) { checkWidget(); /* RECT rect = getBounds (index, false, true, false); int width = rect.right - rect.left, height = rect.bottom - rect.top; return new Rectangle (rect.left, rect.top, width, height); */ return new Rectangle (0, 0, 0, 0); } COM: <s> returns a rectangle describing the size and location </s>
funcom_train/3655807
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setUnmarshallerClass(Class unmarshallerClass) { this.unmarshallerClass = unmarshallerClass; this.unmarshaller = null; this.handledNames = null; if (null != unmarshallerClass) { try { unmarshaller = (Unmarshaller)unmarshallerClass.newInstance(); handledNames = unmarshaller.getHandledNames(); } catch (Exception e) { throw new UnsupportedTypeException(e); } } else { handledNames = new QName[0]; } } COM: <s> sets the class of unmarshaller supported by this type if any </s>
funcom_train/18052886
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JDialog getAboutDialog() { if (aboutDialog == null) { aboutDialog = new JDialog(getJFrame(), true); aboutDialog.setTitle("About"); aboutDialog.setSize(new Dimension(400, 320)); aboutDialog.setResizable(false); aboutDialog.setPreferredSize(new Dimension(400, 320)); aboutDialog.setContentPane(getAboutContentPane()); } return aboutDialog; } COM: <s> this method initializes about dialog </s>
funcom_train/6261324
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testRemoveByIncorrectIndexFromSetRole() { constrNew.getListRole().addAll(clsList); try { constrNew.getListRole().remove(clsList.size() + 1); fail("Must be thrown IndexOutOfBoundsException"); } catch (Exception e) { } } COM: <s> tests removal participant from participant2 with the help of remover methods </s>
funcom_train/33064409
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected FcshShell createFcshShell(IProject project, IProgressMonitor monitor) throws IOException { FcshShell fcsh = fcshShells.get(project); monitor.worked(workd++); if (fcsh == null || fcsh.getProcess() == null) { fcsh = new FcshShell(); clearCompiler(project); fcshShells.put(project, fcsh); fcsh.startShell(new File(project.getLocation().toString()), monitor); monitor.worked(workd++); } fcsh.setWorkdIndex(workd); return fcsh; } COM: <s> create fcsh sell class </s>
funcom_train/12760311
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void logProperties() { System.out.println("Logging system properties..."); log(""); log("System Properties..."); logSystemProperties(); log("End System Properties."); log(""); log("PropertyCatalog Properties..."); List sortedList = new ArrayList(PropertyCatalog.getAllProperties() .keySet()); Collections.sort(sortedList); for (Iterator iter = sortedList.iterator(); iter.hasNext();) { String key = (String) iter.next(); log(key + " = " + PropertyCatalog.getProperty(key)); } log("End PropertyCatalog Properties."); log(""); } COM: <s> log all of the currently defined properties that this service could use </s>
funcom_train/10929512
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String fileToId(File file) throws Exception { if (file == null) { throw new IllegalArgumentException("File is not valid!"); } if (root.equals(file)) { return ROOT_ID; } String path = getRepositoryPath(file); return new String(Base64.encodeBase64(path.getBytes("UTF-8")), "ISO-8859-1"); } COM: <s> creates a file object from an id </s>
funcom_train/50909667
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testRandomFoodGeneration() { IItem item = null; ItemParameters parameters; try { parameters = new ItemParameters(); parameters.addParameter("Class", "Food"); item = generator.generateItem(parameters); } catch (Exception e) { fail("Exception was thrown"); } assertTrue("Random food was not generated", item!=null); } COM: <s> tests generation of random food </s>
funcom_train/24535572
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addExtension(ComponentManagerExtension extension) { if (extensions == null) { extensions = new ComponentManagerExtension[] {extension}; extension.setComponentManager(this); } else { for (int i = 0; i < extensions.length; i++) { if (extensions[i] == extension) return; } ComponentManagerExtension[] newExtensions = new ComponentManagerExtension[extensions.length+1]; System.arraycopy(extensions, 0, newExtensions, 0, extensions.length); newExtensions[newExtensions.length-1] = extension; extensions = newExtensions; extension.setComponentManager(this); } } COM: <s> add the extension </s>
funcom_train/3420181
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void warning (SAXParseException err) throws SAXParseException { System.out.println (MessageFormat.format(resBundle.handleGetObject("xmlrch.warning").toString(), new Object[] { err.getMessage(), err.getLineNumber(), err.getSystemId() })); } COM: <s> prints a warning message to code system </s>
funcom_train/50445295
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testSetDescription() { String description = "new Description"; pic.setDescription(description); assertSame(description, pic.getDescription()); assertEquals(description.hashCode(),pic.getDescription().hashCode()); pic.setDescription(null); assertSame(null, pic.getDescription()); } COM: <s> code test set description code tests if the description is </s>