__key__
stringlengths 16
21
| __url__
stringclasses 1
value | txt
stringlengths 183
1.2k
|
---|---|---|
funcom_train/9759180 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void writeHistory(List history, IDialogSettings settings, String sectionName) {
int itemCount= history.size();
Set distinctItems= new HashSet(itemCount);
for (int i= 0; i < itemCount; i++) {
String item= (String)history.get(i);
if (distinctItems.contains(item)) {
history.remove(i--);
itemCount--;
} else {
distinctItems.add(item);
}
}
while (history.size() > 8)
history.remove(8);
String[] names= new String[history.size()];
history.toArray(names);
settings.put(sectionName, names);
}
COM: <s> writes the given history into the given dialog store </s>
|
funcom_train/31937148 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setDefaultPerspective(String id) {
IPerspectiveDescriptor desc = findPerspectiveWithId(id);
if (desc != null) {
defPerspID = id;
IDialogSettings dialogSettings = WorkbenchPlugin.getDefault().getDialogSettings();
dialogSettings.put(ID_DEF_PERSP, id);
}
}
COM: <s> sets the default perspective for the workbench to the given perspective id </s>
|
funcom_train/41472440 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void fireTCAbortV1(Dialog tcapDialog) throws MAPException {
TCUserAbortRequest tcUserAbort = this.getTCAPProvider().getDialogPrimitiveFactory().createUAbort(tcapDialog);
try {
tcapDialog.send(tcUserAbort);
} catch (TCAPSendException e) {
throw new MAPException(e.getMessage(), e);
}
}
COM: <s> issue tc u abort without any apdu for map v1 </s>
|
funcom_train/23307886 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double getCameraPitch() {
Vector3f dir = cam.getDirection();
// Project direction onto the x-z plane
tmpVec.x = dir.x;
tmpVec.y = 0;
tmpVec.z = dir.z;
tmpVec.normalizeLocal();
int d = dir.y > 0 ? 1 : -1;
// return the angle between dir and v1
return Math.toDegrees(dir.angleBetween(tmpVec)) * d;
}
COM: <s> get the pitch up and down angle of the camera in degrees </s>
|
funcom_train/33453552 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object sdaiGetAttrBN(Pointer instance, String attributeName, SdaiTypes valueType) {
PointerByReference ptrRef = new PointerByReference();
engine.sdaiGetAttrBN(instance, attributeName, valueType.ordinal(), ptrRef);
switch (valueType) {
case STRING:
return ptrRef.getValue().getString(0);
default:
return ptrRef.getValue();
}
}
COM: <s> returns the data value of the specified attribute in the actual instance </s>
|
funcom_train/25332934 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetChromosomeDAO() throws Exception {
DBDAOSingleSpeciesCoreFactory instance = new DBDAOSingleSpeciesCoreFactory();
DBSpecies sp = new DBSpecies();
instance.setSpecies(sp);
DBChromosomeDAO result = instance.getChromosomeDAO();
assertNotNull(result);
assertTrue(result.getFactory()==instance);
assertTrue(result.getSpecies()==sp);
}
COM: <s> test of get chromosome dao method of class dbdaosingle species core factory </s>
|
funcom_train/42702365 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Point getLowerRight() {
Point p = new Point(this.getLocation());
//note that a rectangle with location (1,1) and dimensions (1,1) will only
//contain the point (1,1); which illustrates that it is correct to compute
//the lower right point in this manner. (1,1) would be the top left and the
//lower right point of the rectangle at the same time.
p.translate(this.width-1, this.height-1);
return p;
}
COM: <s> get the lower right point of the rectangle </s>
|
funcom_train/9568795 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void createFrame() {
internalFrame = new JInternalFrame("Add3D", true, true, true);
internalFrame.setSize(300, 80);
internalFrame.setJMenuBar(getMenubar());
System.out.println("=== Add3D OPENED ===");
}
COM: <s> creates the internal frame </s>
|
funcom_train/33872517 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int getVariantInteger(StandardToken search) throws ParseException {
try {
TokenGroup levelGroup = getVariantOption(search);
return (Integer) levelGroup.next().getData();
}
catch (ClassCastException e) {
return -1;
}
catch (NullPointerException e) {
return -1;
}
catch (NoSuchElementException e) {
throw new ParseException("There was no integer token for the specified parameter and one was expected");
// TODO could have an option to simply ignore a time limit command
// if there is no level specified.
}
}
COM: <s> gets the integer associated with the specified variant option </s>
|
funcom_train/31301587 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean ensureImplementationLoaded() {
if (_expressionImplementation != null) {
return true;
}
String expressionName = _expressionDefinition.getAction();
_expressionImplementation = ExpressionFactory.createFromAction(expressionName);
if (_expressionImplementation == null) {
return false;
}
_expressionImplementation.init(_ctx);
return true;
}
COM: <s> makes sure that the implementation class is loaded and initialized </s>
|
funcom_train/45624539 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addTemplateTypesPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_TemplatedType_TemplateTypes_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_TemplatedType_TemplateTypes_feature", "_UI_TemplatedType_type"),
CSMPackage.Literals.TEMPLATED_TYPE__TEMPLATE_TYPES,
true,
false,
true,
null,
null,
null));
}
COM: <s> this adds a property descriptor for the template types feature </s>
|
funcom_train/51162725 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object load(InputPort in) {
while(!exit) {
try {
Object x = in.read();
if (x == InputPort.EOF) return U.TRUE;
else evalToplevel(x, interactionEnvironment);
} catch(Exception e) {
E.warn("Error during load (lineno "+in.getLineNumber()+"): ", e);
e.printStackTrace(error);
}
}
return U.FALSE; // (exit)
}
COM: <s> eval all the expressions coming from an input port putting them </s>
|
funcom_train/42951112 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public BitSet InitPerm(BitSet P) {
P = Util.copyBitSet(P, 64);
BitSet P_perm = new BitSet(64);
for (int i = 0; i < 64; i++) {
P_perm.set(i, P.get(IP[i] - 1));
}
return P_perm;
}
COM: <s> compute initial permutation ip </s>
|
funcom_train/23182844 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void startKMLServer(KMLServerProfile profile) {
logger.info("startKMLServer(profile) - Entry");
if (this.kmlServer == null) {
try {
this.kmlServer = new KMLServer(profile);
new Thread(kmlServer).start();
this.kmlServerActive = true;
this.updateCoreProfile();
} catch (IOException e) {
e.printStackTrace();
}
} else {
this.stopKMLServer();
this.startKMLServer(profile);
}
logger.info("startKMLServer(profile) - Exit");
}
COM: <s> this method start the kmlserver which provides kml data for google earth </s>
|
funcom_train/50716473 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void append(CPhrase cphrase2){
//go through the phrases in the new part
// and add then one by one
double et = this.getEndTime();
Enumeration enum = cphrase2.getPhraseList().elements();
while(enum.hasMoreElements()){
Phrase tempPhrase = (Phrase) enum.nextElement();
tempPhrase.setStartTime(et + tempPhrase.getStartTime());
this.addPhrase(tempPhrase);
}
}
COM: <s> adds a second cphrase to the end of this one </s>
|
funcom_train/45238894 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void lostFocus() {
int clmId = this.jTable.getSelectedColumn();
int rowId = this.jTable.getSelectedRow();
if ((rowId != -1) && (clmId != -1)) {
this.jTable.getCellEditor(rowId, clmId).stopCellEditing();
}
}
COM: <s> when focus is lost all editor must stop editing </s>
|
funcom_train/50370796 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean writeData(IStorageAdapter tsi, String fileName, byte[] data) throws IOException {
OutputStream os = null;
boolean isSuccessful = false;
try {
os =tsi.getOutputStream(fileName, false);
os.write(data);
os.flush();
isSuccessful = true;
} catch (Exception e) {
throw new IOException("Unable to save the metadata file.");
} finally {
os.close();
}
return isSuccessful;
}
COM: <s> utility method to write the data using storage adapter to file system </s>
|
funcom_train/24121129 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void write(OutputStream out) throws IOException {
int size = this.getSize();
WMFConstants.writeLittleEndian(out, size);
WMFConstants.writeLittleEndian(out, WMFConstants.WMF_RECORD_SETLAYOUT);
WMFConstants.writeLittleEndian(out, layout);
WMFConstants.writeLittleEndian(out, (short)0);
}
COM: <s> writes the setlayout record to a stream </s>
|
funcom_train/3372824 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void editingStopped(ChangeEvent e) {
// Take in the new value
TableCellEditor editor = getCellEditor();
if (editor != null) {
Object value = editor.getCellEditorValue();
setValueAt(value, editingRow, editingColumn);
removeEditor();
}
}
COM: <s> invoked when editing is finished </s>
|
funcom_train/33783969 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public PropertyDO loadPropertyById(final Long propertyId) throws StorageException {
final Session session = getSession();
PropertyDO propertyDO = null;
try {
propertyDO = (PropertyDO) session.get(PropertyDO.class, propertyId);
} catch (final HibernateException e) {
throw new StorageException(e, MapErrorCodes.STORAGE_ERROR);
}
return propertyDO;
}
COM: <s> loads the property based on a object id </s>
|
funcom_train/15365352 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void randomize(int o, int oo, int ooo, int oooo) {
outStream.createFrame(53);
outStream.writeWord(o);
outStream.writeWord(oo);
outStream.writeByte(ooo);
outStream.writeWordBigEndianA(oooo);
flushOutStream();
}
COM: <s> i wish people would be more specific with their method names </s>
|
funcom_train/44465805 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testBadResourceList() {
try {
AuthorizationContext ctx = getManagerContext();
PurchaseOrder po = new PurchaseOrder();
List<Object> list = new ArrayList<Object>();
list.add(po);
PermissionsFactory.getPermissions(list, ctx);
} catch (Exception e) {
fail(e.getMessage());
}
}
COM: <s> tests that a list containing one protected resource can be passed </s>
|
funcom_train/41724792 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean equals(Object object) {
if (!(object instanceof ColumnSet))
return false;
ColumnSet other = (ColumnSet) object;
if (this.columnNames.size() != other.columnNames.size())
return false;
for (int i = 0; i < this.columnNames.size(); i++) {
String thisColumnName = this.columnNames.get(i);
String otherColumnName = other.columnNames.get(i);
if (!thisColumnName.equals(otherColumnName))
return false;
}
return true;
}
COM: <s> determine whether this instance is equal to another object </s>
|
funcom_train/48655918 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public conversionTypeBO create() throws Exception{
String id = GUID.generate();
conversionTypeBO conversionType = new conversionTypeBO(id);
//put RS into Cache
Cache c = Cache.getInstance();
c.put(conversionType.getId(),conversionType);
return conversionType;
}
COM: <s> create new conversion order </s>
|
funcom_train/5406310 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void deletePrivacyLists(String username) {
assert(username.indexOf('@')>0);
for (String listName : provider.getPrivacyLists(username).keySet()) {
// Remove the list from the cache
listsCache.remove(getCacheKey(username, listName));
}
// Delete user privacy lists from the DB
provider.deletePrivacyLists(username);
}
COM: <s> deletes all privacy lists of a user </s>
|
funcom_train/3742764 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getTerms(int count, String text, String language) throws Exception {
StringBuffer result = new StringBuffer();
Analyzer analyzer = AnalyzerFactory.getAnalyzer(language);
analyzer.analyze(text);
Collection terms = analyzer.getTopWords(count);
Iterator iter = terms.iterator();
int temp = 0;
while (iter.hasNext() && (temp < count)) {
Entry entry = (Entry) iter.next();
if (temp > 0) {
result.append(", ");
}
result.append(entry.getOriginWord());
temp++;
}
return result.toString();
}
COM: <s> this method extracts a specified number of keywords and appends them to a </s>
|
funcom_train/34593767 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getViewRecommendationXsl() {
if (rtProps.getProperty("view.recommendation.xsl.file") == null) {
rtProps.setProperty("view.recommendation.xsl.file", getXslDir() + File.separator + "viewRecommendation.xsl");
}
return getInstallDir() + File.separator + rtProps.getProperty("view.recommendation.xsl.file");
}
COM: <s> return the view recommendation xsl </s>
|
funcom_train/12175418 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public VolantisProtocol build(String protocolName, InternalDevice device) {
ProtocolFactory protocolFactory = (ProtocolFactory)
nameFactoryMap.get(protocolName);
if (protocolFactory == null) {
throw new IllegalStateException("No protocol factory registered " +
"for protocol name: " + protocolName);
}
return protocolBuilder.build(protocolFactory, device);
}
COM: <s> build a configured ready to use protocol using the protocol name </s>
|
funcom_train/10498564 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public long approximateDataSize() {
long result = 0;
for (Map.Entry<String, DataNode> entry : nodes.entrySet()) {
DataNode value = entry.getValue();
synchronized (value) {
result += entry.getKey().length();
result += value.getApproximateDataSize();
}
}
return result;
}
COM: <s> get the size of the nodes based on path and data length </s>
|
funcom_train/51186267 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void bind(final BusMember member, final String busname){
BusDispatcher dispatcher;
/**
* Create a dispatcher if it does not exist
*/
if (busDispatchers.get(busname) == null){
dispatcher = new BusDispatcher();
busDispatchers.put(busname, dispatcher);
} else {
dispatcher = (BusDispatcher) busDispatchers.get(busname);
}
/**
* Add the member
*/
dispatcher.bind(member);
}
COM: <s> binds a bus member to a logical bus name </s>
|
funcom_train/33472914 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setTabPlacement(int p) {
if (p != SwingConstants.TOP && p != SwingConstants.BOTTOM &&
p != SwingConstants.LEFT && p != SwingConstants.RIGHT) {
throw new IllegalArgumentException("Invalid tab placement.");
}
this.tabPlacement = p;
show(this.percentVisible);
}
COM: <s> sets the tab component placement </s>
|
funcom_train/18268689 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void generateArchive(boolean buildAll) throws IOException, InterruptedException {
commands.createAllDirectory();
if(buildAll)
{
System.out.println("Compile source of " + Parameters.NAME );
executor.exec(commands.javacCommand());
System.out.println("Create jar file");
executor.exec(commands.jarCommand());
System.out.println("Create zip file");
executor.exec(commands.zipCommand());
}
}
COM: <s> generate all archive </s>
|
funcom_train/311140 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setAppearance(boolean showGrid2, HealSphere shape) {
sphereApp = new Appearance();
// sphereApp.setCapability(Appearance.ALLOW_POLYGON_ATTRIBUTES_WRITE);
TransparencyAttributes sphereTrans = new TransparencyAttributes();
PolygonAttributes spherePa = new PolygonAttributes();
spherePa.setCullFace(showGrid2 ? PolygonAttributes.CULL_BACK
: PolygonAttributes.CULL_NONE);
sphereApp.setPolygonAttributes(spherePa);
sphereTrans.setTransparency(transparencyValue);
sphereTrans.setTransparencyMode(TransparencyAttributes.NICEST);
sphereApp.setTransparencyAttributes(sphereTrans);
shape.setAppearance(sphereApp);
}
COM: <s> apply the transparency appearance properties to a shape </s>
|
funcom_train/13648093 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getValue(String nodePath) throws Exception {
try {
XPath xPath = new DOMXPath(nodePath);
if (this.namespaceContext != null) {
xPath.setNamespaceContext(this.namespaceContext);
}
return (xPath.stringValueOf(this.document));
} catch (XPathSyntaxException e) {
throw new Exception(e.getMultilineMessage());
}
}
COM: <s> gets the value of a node given by the node path </s>
|
funcom_train/46731401 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isMinDoseLevelOk(double strength, long strengthUnitRefId) throws StrengthMissingUnitsException {
if (getMinStrength() == 0) {
return true;
} else {
if (strengthUnitRefId == 0 || getMinStrengthUnitRef().isNew()) {
throw new StrengthMissingUnitsException();
} else {
return strength >= StandardUnits.convertValue(getMinStrength(), getMinStrengthUnitRef().getId(), strengthUnitRefId);
}
}
}
COM: <s> checks the minimum dose </s>
|
funcom_train/38415500 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void init() {
// 1 - any data ?
if(worldMaps==null) {
Debug.signal(Debug.WARNING, this, "Universe inits failed: No WorldMaps.");
return;
}
// 2 - we transmit the init() call
for( int i=0; i<worldMaps.length; i++ )
if( worldMaps[i]!=null )
worldMaps[i].init();
}
COM: <s> to initialize this whole universe it rebuilds shortcuts </s>
|
funcom_train/126891 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String read(int count) throws MalformedJsonSourceException {
int start = pointer;
int end = pointer + count;
if (end > json.length()) {
throw error("Too many characters: tried to read " + count +
" characters when only " + (json.length() - pointer) +
" were available");
}
pointer += count;
return json.substring(start, end);
}
COM: <s> retrieves an arbitrary number of characters from the parsers json </s>
|
funcom_train/2724109 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setupAddThis() {
footer.removeAllComponents();
addThis = new AddThis();
addThis.addButton("twitter");
addThis.addButton("facebook");
addThis.addButton("dzone");
addThis.addButton("digg");
addThis.addButton("slashdot");
addThis.addSeparator("|");
addThis.addButton("expanded", userState.translateFromEnglish("More share link options!"));
//addThis.setWidth(100, Component.UNITS_PERCENTAGE);
footer.addComponent(addThis);
addThis.setSizeFull();
//footer.setComponentAlignment(addThis, Alignment.MIDDLE_CENTER);
}
COM: <s> setup add this </s>
|
funcom_train/4187627 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private ReposRights getRolePriviledge(String projectIdentifier, int roleId) {
// Check read roles
for (Integer role : readRoles) {
if (role.intValue() == roleId) {
return ReposRights.READ;
}
}
// Check read/write roles
for (Integer role : readWriteRoles) {
if (role.intValue() == roleId) {
return ReposRights.READ_WRITE;
}
}
// Default: NO rights
return ReposRights.NONE;
}
COM: <s> returns a permission determined by a projects role policy </s>
|
funcom_train/27905236 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void show() {
for(int c = 0; c < size; c++){
if(s[c] < 0) {
JDDConsole.out.print(" (");
for(int i = 0; i < size; i++) {
if(find(i) == c) {
Node n = (Node) graph.getNodes().elementAt(i);
JDDConsole.out.print( n.label + " ");
}
}
JDDConsole.out.print(") ");
}
}
JDDConsole.out.println();
}
COM: <s> very inefficient for debugging small partitions only </s>
|
funcom_train/3102305 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Button createButton(final Composite group, final SelectionListener listener, final int index) {
final Button button= new Button(group, fButtonStyle | SWT.LEFT);
button.setFont(group.getFont());
button.setText(fButtonNames[index]);
button.setEnabled(isEnabled() && fButtonsEnabled[index]);
button.setSelection(fButtonsSelected[index]);
button.addSelectionListener(listener);
button.setLayoutData(new GridData());
return button;
}
COM: <s> creates a selection button for the control </s>
|
funcom_train/22600399 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JCheckBox getLayoutCheckBox() {
if (layoutCheckBox == null) {
layoutCheckBox = new JCheckBox();
layoutCheckBox.setText("dynamic layout");
layoutCheckBox.setBackground(Color.gray);
layoutCheckBox.setForeground(Color.orange);
layoutCheckBox.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
setLayout(layoutCheckBox.isSelected());
}
});
}
return layoutCheckBox;
}
COM: <s> this method initializes layout check box </s>
|
funcom_train/37840457 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void register() {
actions.put("clear_action", new ClearAction());
actions.put("create_dot_action", new CreateDotAction());
actions.put("create_rectangle_action", new CreateRectangleAction());
actions.put("create_straight_line_action", new CreateStraightLineAction());
actions.put("create_oval_action", new CreateOvalAction());
actions.put("import_shapes_action", new ImportShapesAction());
}
COM: <s> registers all actions </s>
|
funcom_train/25968034 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean readConfigurations() {
// loading file to hashtable
Properties pfile = loadPropertiesFile();
if (pfile == null) {
return false;
}
//read all properties from file and distribute them to the appropriate objects
//anomaly detector properties
Configurations.state = State.valueOf(pfile.getProperty("state"));
//alerts manager properties
Configurations.allowedDeviationLimit = Double.valueOf(pfile.getProperty("allowed_deviation_limit"));
//agent properties
Configurations.agentLoopTime = Long.valueOf(pfile.getProperty("agent_loop_time_in_ms"));
return true;
}
COM: <s> read all values from properties file into static variables in matching classes </s>
|
funcom_train/23263928 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Domain getDomain(int code){
Domain domain = null;
if (domains != null && !domains.isEmpty()) {
Iterator<Domain> it = domains.iterator();
while (it.hasNext()) {
Domain d = it.next();
if (d.getCode() == code){
domain = d;
break;
}
}
}
return domain;
}
COM: <s> search for a single domain by a identifier code </s>
|
funcom_train/43245858 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSetBNCity() {
System.out.println("setBNCity");
String bNCity = "";
EmergencyContactDG5Object instance = new EmergencyContactDG5Object();
instance.setBNCity(bNCity);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
COM: <s> test of set bncity method of class org </s>
|
funcom_train/14271615 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getNextExecDate(String cronString) {
String val = null;
try {
CronExpression c = new CronExpression(cronString);
val = c.getNextValidTimeAfter(new Date()).toString();
} catch (Exception e) {
val = "unknown";
}
return "Next Execution: " + val;
}
COM: <s> calculate the next time the given cron string would be executed </s>
|
funcom_train/50370750 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void sendInput(String input)throws IOException,ExecutionException{
while(true){
try{
TSI tsi=config.getTargetSystemInterface(client);
if(!tsi.isLocal())input="\""+input+"\"";
ctx.setDaemon(true);
tsi.execAndWait(empty+" -s -o "+ctx.getWorkingDirectory()+"/"+uuid+".in.fifo "+input,ctx);
return;
}catch(TSIBusyException tbe){
try{
Thread.sleep(1000);
}catch(InterruptedException ie){}
}
}
}
COM: <s> send the given input to the process </s>
|
funcom_train/24570295 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void insert(MenuSet menuSet, int position) {
if (menuSet == null)
return;
JMenu[] menus = menuSet.getMenuSet();
// add set for later use
if (!menuSets.contains(menuSet))
menuSets.add(menuSet);
for (int i = 0; i < menus.length; i++) {
this.insert(menus[i], position++);
}
}
COM: <s> inserts the given menus into this menu bar starting at the passed </s>
|
funcom_train/11710784 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String convertEntities(String input) {
String result = ltPattern.matcher(input).replaceAll("<");
result = gtPattern.matcher(result).replaceAll(">");
result = aposPattern.matcher(result).replaceAll("'");
result = quotPattern.matcher(result).replaceAll("\"");
result = ampPattern.matcher(result).replaceAll("&");
return (result);
}
COM: <s> convert character entities in a string to the corresponding character </s>
|
funcom_train/13867811 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public CDATASection createCDATASection(String data) {
try {
return (CDATASection) NodeImpl.build(XMLParserImpl.createCDATASection(
this.getJsObject(), data));
} catch (JavaScriptException e) {
throw new DOMNodeException(DOMException.INVALID_CHARACTER_ERR, e, this);
}
}
COM: <s> this function delegates to the native method </s>
|
funcom_train/10626805 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testLoadByDefaultClassLoader() throws Exception {
String beanName = "org.apache.harmony.beans.tests.support.SampleBean";
Object bean = Beans.instantiate(null, beanName);
SampleBean sampleBean;
assertNotNull(bean);
assertEquals(bean.getClass(), SampleBean.class);
sampleBean = (SampleBean) bean;
assertNull(sampleBean.getText());
}
COM: <s> the test checks the method instantiate using default classloader for </s>
|
funcom_train/20297353 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testBug908625() throws Exception {
testTypes("/** @constructor */function A(){}" +
"/** @constructor\n * @extends A */function B(){}" +
"/** @param {B} b" +
"\n @return {(A,undefined)} */function foo(b){return b}");
}
COM: <s> tests that named types play nicely with subtyping </s>
|
funcom_train/10017290 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: static private int _getSizeOfNamespace(int namespace, int[] nodes) {
return EXISchemaLayout.SZ_NAMESPACE + _getElemCountOfNamespace(namespace, nodes) +
_getAttrCountOfNamespace(namespace, nodes) + _getTypeCountOfNamespace(namespace, nodes);
}
COM: <s> returns the size of a namespace </s>
|
funcom_train/25086958 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addKindPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_PicDioConfig_kind_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_PicDioConfig_kind_feature", "_UI_PicDioConfig_type"),
dioPackage.Literals.PIC_DIO_CONFIG__KIND,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the kind feature </s>
|
funcom_train/18582370 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void initializeList(List list) {
for (Object elem : list) {
if (elem instanceof Any) {
Any any = (Any) elem;
this.initObject(any, new HashSet());
}
else if (elem instanceof Object[]) {
Object objarray[] = (Object[]) elem;
Any any = (Any) objarray[0];
this.initObject(any, new HashSet());
}
}
}
COM: <s> initializes a list of arbitrary persistent objects </s>
|
funcom_train/7852504 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getChangeTypeString(final int changeType) {
String changeTypeString;
switch (changeType) {
case LDAPPersistSearchControl.ADD:
changeTypeString = "ADD";
break;
case LDAPPersistSearchControl.MODIFY:
changeTypeString = "MODIFY";
break;
case LDAPPersistSearchControl.MODDN:
changeTypeString = "MODDN";
break;
case LDAPPersistSearchControl.DELETE:
changeTypeString = "DELETE";
break;
default:
changeTypeString =
"No change type: " + String.valueOf(changeType);
break;
}
return changeTypeString;
}
COM: <s> return a string indicating the type of change represented by the </s>
|
funcom_train/13272184 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setCeilingShininess(float ceilingShininess) {
if (ceilingShininess != this.ceilingShininess) {
float oldCeilingShininess = this.ceilingShininess;
this.ceilingShininess = ceilingShininess;
this.propertyChangeSupport.firePropertyChange(Property.CEILING_SHININESS.name(),
oldCeilingShininess, ceilingShininess);
}
}
COM: <s> sets the ceiling shininess of this room </s>
|
funcom_train/3898764 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getPropertyElementValue(AbstractPropertyDef def) {
// Check edit cache first
String value = (String)_editCache.get(def);
// Get original value
if(value == null) {
AbstractPropertyElement entry = _propsHandler.getPropertyElement(def);
if(entry != null) {
value = entry.getValue();
}
}
return value;
}
COM: <s> get a property element value given its property def key </s>
|
funcom_train/50499301 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private GECoverPanel newProvidedPanel( String ident ) {
if ( ident.equals( PANEL_EMPTY ) ) {
return new GEEmptyPanel();
}
if ( ident.equals( PANEL_PICTURE ) ) {
return new GEPicturePanel();
}
if ( ident.equals( PANEL_LOGIN ) ) {
return new GEUserPass();
}
if ( ident.equals( PANEL_DICTS ) ) {
return new GEDictPanel();
}
// default
return null;
}
COM: <s> this is also the assignment between panel identifiers and panels </s>
|
funcom_train/7618158 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addRoundRect(RectF rect, float rx, float ry, Direction dir) {
if (rect == null) {
throw new NullPointerException("need rect parameter");
}
native_addRoundRect(mNativePath, rect, rx, ry, dir.nativeInt);
}
COM: <s> add a closed round rectangle contour to the path </s>
|
funcom_train/23234422 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double squaredDistance(Entity other) {
if ((!has("width") || getInt("width") == 1) && (!has("height") ||getInt("height") == 1)) {
// This doesn't work properly if the other entity is larger
// than 1x1, but it is faster.
return squaredDistance(other.x, other.y);
}
return squaredDistanceBetween(getArea(), other.getArea());
}
COM: <s> this returns square of the distance between this entity and the </s>
|
funcom_train/16893721 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private ISaveParticipant getSaveParticipant() {
if (saveParticipant == null) {
saveParticipant = new ISaveParticipant() {
public void doneSaving(ISaveContext context) {
}
public void prepareToSave(ISaveContext context) throws CoreException {
}
public void rollback(ISaveContext context) {
}
public void saving(ISaveContext context) throws CoreException {
context.needDelta();
}
};
}
return saveParticipant;
}
COM: <s> we are only interested in the resource delta while the plugin was </s>
|
funcom_train/39001024 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isBranchSourceInstruction() {
if (getMnemonic().startsWith("GOTO")
|| getMnemonic().startsWith("IF")
|| getMnemonic().startsWith("JSR")
|| getMnemonic().startsWith("LOOKUPSWITCH")
|| getMnemonic().startsWith("TABLESWITCH")) {
return true;
}
return false;
}
COM: <s> it return ture or false based on the mnmenonic of the instruction </s>
|
funcom_train/45797766 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void run() {
try {
while (!_shouldFinish) {
if (_sleepMS > 0) {
try { Thread.sleep(_sleepMS); } catch (InterruptedException e) { }
} else {
Thread.yield();
}
_ri.flushBuffer();
}
} catch (Exception e) {
_error = e;
}
}
COM: <s> flush the buffer until the finish signal arrives from another </s>
|
funcom_train/4014997 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void updateText(){
//if(widget != null && txtText.getText().trim().length() > 0) //No setting of empty strings as text.
if(widget != null /*&& txtText.getText().length() > 0*/) //We now allow setting of empty strings as text.
widget.setText(txtText.getText());
}
COM: <s> updates the selected widget with the new text as typed by the user </s>
|
funcom_train/4427785 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createNewRule(Symbol symbol, Digram digram) {
Rule newRule = new Rule(String.valueOf(ruleIndex), digram);
ruleIndex++;
// removes digram located at symbol, and references rule
NonTerminalSymbol s1 = new NonTerminalSymbol(newRule);
replaceDigram(symbol, s1);
// append reference to rule
NonTerminalSymbol s2 = new NonTerminalSymbol(newRule);
replaceDigram(digram.getS1(), s2);
}
COM: <s> creates a new rule to represent the given digram </s>
|
funcom_train/50908239 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: static private File getFile() throws IOException {
StringBuffer filename = new StringBuffer(System.getProperty("user.home"));
filename.append(System.getProperty("file.separator"));
filename.append(".jhess");
File propsFile = new File(filename.toString());
propsFile.createNewFile();
return propsFile;
}
COM: <s> gets a file object referencing the </s>
|
funcom_train/50927350 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void adjustHydrogenCountsToValency(HydrogenControl control) {
if (molecule.isMoleculeContainer()) {
CMLElements<CMLMolecule> molecules = molecule.getMoleculeElements();
for (CMLMolecule mol : molecules) {
MoleculeTool.getOrCreateTool(mol).adjustHydrogenCountsToValency(control);
}
} else {
List<CMLAtom> atoms = molecule.getAtoms();
for (CMLAtom atom : atoms) {
AtomTool atomTool = AtomTool.getOrCreateTool(atom);
atomTool.adjustHydrogenCountsToValency(control);
}
}
}
COM: <s> add or delete hydrogen atoms to satisy valence </s>
|
funcom_train/12546746 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void add(Production production) {
String lhs = production.getLHS(), rhs = production.getRHS();
// Does the RHS already have a unique mapping?
if (rhsToLhs.containsKey(rhs))
throw new IllegalArgumentException(rhs
+ " already represented by " + rhsToLhs.get(rhs));
// Add the production.
Set rhses = (Set) lhsToRhs.get(lhs);
if (rhses == null) {
rhses = new HashSet();
lhsToRhs.put(lhs, rhses);
}
rhses.add(rhs);
rhsToLhs.put(rhs, lhs);
}
COM: <s> after the first initialization this can be used to add productions </s>
|
funcom_train/1602462 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void resetBounds() {
if(calendarModel.getCalendarViewMode() != model.CalendarViewMode.month) {
setBounds(0, getHeight(), getWidth() - calendarModel.getScrollbar().getWidth(), calendarModel.getScrollbar().getHeight());
} else {
setBounds(0, 25, getWidth(), getHeight() - 25);
}
}
COM: <s> this method resets all components to its default values and position </s>
|
funcom_train/21017298 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setData(String name, Object value) {
requireNotNull(name, "@require(name != null)");
if ((_data == null) && (value != null)) {
_data = new HashMap<String, Object>();
}
if (_data != null) {
if (value != null) {
_data.put(name, value);
} else {
_data.remove(name);
if (_data.isEmpty()) {
_data = null;
}
}
}
}
COM: <s> sets a data object at this composite </s>
|
funcom_train/36444791 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String stopRecord(){
stream.stop(); //.stopRecording();//停止记录
stream.close(); //关闭stream
//System.out.println("byte Recieved: "+stream.getBytesReceived());
System.out.println("Recording Stopped!");
return "Server stop recording!";
}
COM: <s> stop the recording </s>
|
funcom_train/32752599 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void preConfigure() {
RULES.clear();
RULES.add( new Rule( "*.jar", "Application", "java -DuseDefaultAccelerator=true -jar %f" ) );
RULES.add( new Rule( "*.rb", "JRuby", "jruby %f" ) );
RULES.add( new Rule( "*.py", "Jython", "jython %f" ) );
FILE_WATCHER.preConfigure();
LAUNCHER.preConfigure();
refreshApplications();
}
COM: <s> preconfigure the model when initializing without a document file </s>
|
funcom_train/46678255 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void save(){
if (!getFilename().equals("untitled.exb")){
try{
getModel().getTranscription().writeXMLToFile(getFilename(),"none");
} catch (Throwable t){
saveTranscription();
}
}
else {
saveTranscription();
}
}
COM: <s> saves the current transcription under its current name </s>
|
funcom_train/14128246 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel getJPanel12() {
if (jPanel1 == null) {
jPanel1 = new JPanel();
jPanel1.setLayout(new BorderLayout());
jPanel1.setPreferredSize(new Dimension(0, 50));
jPanel1.add(getJPanel(), BorderLayout.SOUTH);
jPanel1.add(getJPanel4(), BorderLayout.NORTH);
jPanel1.add(getJScrollPane(), BorderLayout.CENTER);
}
return jPanel1;
}
COM: <s> this method initializes j panel1 </s>
|
funcom_train/15908152 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setMarginInside(boolean val) {
if (!isOpen())
marginInside = val;
else {
l = JWintab.WTGet(HCTX);
if (val)
l[0] |= (OPT_MARGIN_INSIDE | OPT_MARGIN);
else
l[0] &= ~OPT_MARGIN_INSIDE;
if (JWintab.WTSet(HCTX, getContextName(), l))
marginInside = val;
}
if (marginInside)
marginEnabled = true;
}
COM: <s> specifies whether the margin must be inside the context </s>
|
funcom_train/9495407 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double cumulativeProbability(int x0, int x1) throws MathException {
if (x0 > x1) {
throw MathRuntimeException.createIllegalArgumentException(
"lower endpoint ({0}) must be less than or equal to upper endpoint ({1})",
x0, x1);
}
return cumulativeProbability(x1) - cumulativeProbability(x0 - 1);
}
COM: <s> for a random variable x whose values are distributed according </s>
|
funcom_train/1479120 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean fillStream(Player p, int forceRead) throws Exception {
if (p == null) {
return false;
}
if (forceRead >= 500) {
return false;
}
if (p.socket.avail() < forceRead) {
return false;
}
p.stream.inOffset = 0;
p.socket.read(forceRead);
return true;
}
COM: <s> check and read any incoming bytes </s>
|
funcom_train/47712356 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean getGenerate() {
try {
JSONObject request = createRequest("getgenerate");
JSONObject response = session.sendAndReceive(request);
return response.getBoolean("result");
} catch (JSONException e) {
throw new BitcoinClientException("Exception when getting whether the server is generating coins or not", e);
}
}
COM: <s> returns boolean true if server is trying to generate bitcoins false otherwise </s>
|
funcom_train/3517783 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void moveDown(DUID child) {
int pos = children.indexOf(child);
// child not found or already on the bottom of the list
if (pos == -1 || pos == children.size() - 1)
return;
children.setElementAt(children.elementAt(pos + 1), pos);
children.setElementAt(child, pos + 1);
}
COM: <s> moves the ddso child one position down in the tree hierarchy </s>
|
funcom_train/1285348 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getMenuElementID(int index) throws IndexOutOfBoundsException {
if ((index < 0) || (index >= menuElements.size())) throw new IndexOutOfBoundsException("Wrong index for menu element: "+index);
return ((MenuElement)menuElements.elementAt(index)).focusableElement.getId();
}
COM: <s> gets menu element id for given index </s>
|
funcom_train/37822860 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void componentResized(ComponentEvent arg0) {
// change the position in a way, that the new content is at the
// same place where the old was.
Point p = gui.getGraphViewPosition();
if(p==null) return;
int x = p.x - scrollPane.getViewport().getWidth() / 2;
int y = p.y - scrollPane.getViewport().getHeight() / 2;
scrollPane.getViewport().setViewPosition(new Point(x,y));
}
COM: <s> scroll area has been resized </s>
|
funcom_train/35838739 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Vector getChildViews (PCSession session, String viewID) throws SQLException {
//
// DBConnection dbcon = getDatabaseManager().requestConnection(session.getModelName()) ;
// Vector nodes = new Vector();
// nodes = DBNode.getChildViews(dbcon, viewID, session.getUserID(), nodes);
//
// getDatabaseManager().releaseConnection(session.getModelName(),dbcon);
return null;
}
COM: <s> returns an vector of all nodes for the given view id </s>
|
funcom_train/5597740 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setTimeGeometricPrimitive(AbstractTimeGeometricPrimitiveType value) {
if (value instanceof TimePeriodType) {
this.timePeriod = (TimePeriodType) value;
} else if (value instanceof TimeInstantType) {
this.timeInstant = (TimeInstantType) value;
} else {
this.timeGeometricPrimitive = value;
}
}
COM: <s> sets the value of the time geometric primitive property </s>
|
funcom_train/42508429 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isTopRightPointAt(float x, float y, float margin) {
float [][] points = getPoints();
return Math.abs(x - points[1][0]) <= margin && Math.abs(y - points[1][1]) <= margin;
}
COM: <s> returns code true code if the top right point of this piece is </s>
|
funcom_train/20404508 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void joinGroups() {
Collections.sort(overlapGroups, Range.byFrom);
OverlapGroup next = overlapGroups.get(0);
for (int i = 1; i < overlapGroups.size(); i++) {
OverlapGroup current = next;
next = overlapGroups.get(i);
if (Range.Tools.overlapping(current, next)) {
// move ranges to first group
for (Range r : next) {
rangeMapping.get(r).group = current;
}
next.join(current);
next = current;
// remove second group
overlapGroups.remove(i--);
}
}
}
COM: <s> call this when a new range has joined a group </s>
|
funcom_train/40358861 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testConnectorNotFound() throws Exception {
String connectorName = "UnknownConnector";
String expectedResult =
"<CmResponse>\n" +
" <StatusId>5303</StatusId>\n" +
" <CMParams Order=\"0\" CMParam=\""+ connectorName + "\"/>\n" +
"</CmResponse>\n";
doTest(connectorName, expectedResult);
}
COM: <s> test connector not found returns status code </s>
|
funcom_train/31909885 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Point2D getPoint2D (Point2D srcPt, Point2D destPt){
// This operation does not affect pixel location
if(destPt==null)
destPt = new Point2D.Double();
destPt.setLocation(srcPt.getX(), srcPt.getY());
return destPt;
}
COM: <s> returns the location of the destination point given a </s>
|
funcom_train/31654859 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void stop(int wait) {
long current = new Date().getTime();
long end = current + (wait*1000);
while (!stopped && current < end && wait != 0) {
try {
Thread.sleep(1000);
}catch(Exception e) {
}
current = new Date().getTime();
}
}
COM: <s> checks to see if a pool rat has stopped </s>
|
funcom_train/18903406 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public long getNumberOfStatements(URI modelURI) throws QueryException {
boolean exceptionOccurred = true;
beginTransaction(false);
try {
// Create Filtered Statement Store.
FilteredStatementStore fss = new FilteredStatementStore(
getStore(), getMetaNodes(modelURI));
return fss.getNrTriples();
}
finally {
if (exceptionOccurred) {
needsRollback = true;
}
// Always end the transaction
endTransaction();
}
}
COM: <s> return the number of statements in a particular graph </s>
|
funcom_train/12808844 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int compareTo(TextChunk rhs) {
if (this == rhs) return 0; // not really needed, but just in case
int rslt;
rslt = compareInts(orientationMagnitude, rhs.orientationMagnitude);
if (rslt != 0) return rslt;
rslt = compareInts(distPerpendicular, rhs.distPerpendicular);
if (rslt != 0) return rslt;
return Float.compare(distParallelStart, rhs.distParallelStart);
}
COM: <s> compares based on orientation perpendicular distance then parallel distance </s>
|
funcom_train/29678984 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void close() {
if (frame != null) {
frame.setVisible(false);
frame.dispose();
frame = null;
}
if (player != null) {
player.close();
player = null;
}
// close the RTP session.
if (mgr != null) {
mgr.removeTargets( "Closing session from AVReceive3");
mgr.dispose();
mgr = null;
}
}
COM: <s> close the players and the session managers </s>
|
funcom_train/3079490 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void draw(java.awt.Graphics2D g2) {
java.awt.Color c = new java.awt.Color(250, 250, 210, (int)(intensity * 2));
java.awt.Color oldColor = g2.getColor();
g2.setColor(c);
g2.fill(myShape);
g2.setColor(oldColor);
}
COM: <s> draws this light in the supplied context </s>
|
funcom_train/28345075 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void applyModelInputToRFGaps( final RfCavity cavity, final String property, final double value ) {
if ( property.equals( RfCavityPropertyAccessor.PROPERTY_PHASE ) ) {
applyCavityPhaseToRFGaps( cavity, value );
}
else if ( property.equals( RfCavityPropertyAccessor.PROPERTY_AMPLITUDE ) ) {
applyCavityAmplitudeToRFGaps( cavity, value );
}
}
COM: <s> workaround to address a bug in the way that cavities are handled </s>
|
funcom_train/3308602 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setValue(String value) {
StringTokenizer tokenizer = new StringTokenizer( value, ",", false );
while (tokenizer.hasMoreTokens()) {
String token = tokenizer.nextToken();
for (int i = 0; i < list.length; i++) {
if (list[i].equals( token )) {
checkBoxes[i].setSelected( true );
break;
}
}
}
}
COM: <s> sets the value attribute of the property language field object </s>
|
funcom_train/51526419 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel getJContentPane() {
if (jContentPane == null) {
jContentPane = new JPanel();
jContentPane.setLayout(new BorderLayout());
jContentPane.add(getSeasonPanel(), BorderLayout.WEST);
jContentPane.add(getButtonPanel(), BorderLayout.CENTER);
jContentPane.add(getFrequencyPanel(), BorderLayout.EAST);
}
return jContentPane;
}
COM: <s> this method initializes j content pane </s>
|
funcom_train/46731852 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setEntityRef(DisplayModel entityRef) {
if (Converter.isDifferent(this.entityRef, entityRef)) {
DisplayModel oldentityRef= new DisplayModel(this);
oldentityRef.copyAllFrom(this.entityRef);
this.entityRef.copyAllFrom(entityRef);
setModified("entityRef");
firePropertyChange(String.valueOf(MEDINTERACTIONS_ENTITYREFID), oldentityRef, entityRef);
}
}
COM: <s> entity interacting foreign key to refs on groups such as medication </s>
|
funcom_train/4124977 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean addModifier(Modifier modifier) {
if (modifier == null) {
return false;
}
Set<Modifier> modifierSet = modifiers.get(modifier.getId());
if (modifierSet == null) {
modifierSet = new HashSet<Modifier>();
modifiers.put(modifier.getId(), modifierSet);
}
return modifierSet.add(modifier);
}
COM: <s> add the given modifier to the set of modifiers present </s>
|
funcom_train/3417654 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean equals(Object obj) {
if (obj instanceof RemoteObject) {
if (ref == null) {
return obj == this;
} else {
return ref.remoteEquals(((RemoteObject)obj).ref);
}
} else if (obj != null) {
/*
* Fix for 4099660: if object is not an instance of RemoteObject,
* use the result of its equals method, to support symmetry is a
* remote object implementation class that does not extend
* RemoteObject wishes to support equality with its stub objects.
*/
return obj.equals(this);
} else {
return false;
}
}
COM: <s> compares two remote objects for equality </s>
|