__key__ stringlengths 16 21 | __url__ stringclasses 1 value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/8539008 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public MetaProperty getNested(String tag, boolean persist) {
// check tag argument
if (tag == null || tag.length() == 0)
throw new IllegalArgumentException("tag can't be empty");
// current tag in map?
MetaProperty result = tag2nested.get(tag);
if (result == null) {
result = new MetaProperty(grammar, tag, new HashMap<String, String>(), false);
if (persist)
addNested(result);
}
// done
return result;
}
COM: <s> resolve sub by tag </s>
|
funcom_train/27823205 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void createPropertyInstance(int modelID,OIModelEntity property,OIModelEntity sourceInstance,OIModelEntity targetInstance,String textValue) throws SQLException {
if (targetInstance!=null)
createRelationInstance(modelID,property,sourceInstance,targetInstance);
if (textValue!=null)
createAttributeInstance(modelID,property,sourceInstance,textValue);
}
COM: <s> creates a property instance object </s>
|
funcom_train/15911802 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void keyReleased(KeyEvent e) {
if (currentDesk == null || !isEnabled())
return;
MyUtil.correctModifiers(e);
// UPDATE MANIPULATION
if (operation == MANIPULATE) {
manipulation = getManipulation(pickedManip, e);
manipulationChanged();
updateFisheye(e);
return;
}
int k = e.getKeyCode();
// HELP MODE OFF
if (k == KeyEvent.VK_F1) {
setHelpMode(false);
}
}
COM: <s> p modifiers calls update node operation with events modifiers </s>
|
funcom_train/48051660 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public LocalTime toLocalTime() {
if (getClass() == GregorianCalendar.class) {
return LocalTime.of(get(HOUR_OF_DAY), get(MINUTE), get(SECOND), get(MILLISECOND));
}
return toZonedDateTime().toLocalTime();
}
COM: <s> converts this object to a code local time code </s>
|
funcom_train/8693993 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Iterator getAllDirectoryScanners() {
Collection out = new ArrayList();
if (mSourceRoot2Scanner != null) {
out.addAll(mSourceRoot2Scanner.values());
}
if (mClassRoot2Scanner != null) {
out.addAll(mClassRoot2Scanner.values());
}
return out.iterator();
}
COM: <s> returns all of the directory scanners for all class and source </s>
|
funcom_train/31361093 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Point getRobotAnimationStep(int step) {
return new Point((int) Math.round(startPos.getX() + (endPos.getX() - startPos.getX()) * step / steps), (int) Math.round(startPos.getY() + (endPos.getY() - startPos.getY()) * step / steps));
}
COM: <s> method get robot animation step does all the mathematics for an animation step </s>
|
funcom_train/22798540 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ActionMessages deleteHardwareComponent(HardwareComponent component) throws DatabaseException {
QueryHelper queryHelper = new QueryHelper(HardwareQueries.deleteHardwareComponentQuery());
queryHelper.addInputInt(ObjectTypes.HARDWARE_COMPONENT);
queryHelper.addInputInt(component.getHardwareId());
queryHelper.addInputInt(component.getId());
return executeProcedure(queryHelper);
}
COM: <s> deletes hardware component </s>
|
funcom_train/33501421 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void createMessage(Object receiver, String methodName, Object args[]) {
Class arg[] = {};
if (args != null)
{
arg = new Class[args.length];
for (int i = arg.length-1; i>=0; i--)
arg[i] = args[i].getClass();
}
try
{
message = new Message(receiver, receiver.getClass().getMethod(methodName, arg), args);
}
catch(Exception e)
{
message = null;
}
}
COM: <s> create a action message with the specified receiver method </s>
|
funcom_train/17492413 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Node getDefaultQualifier(Node node, String tname) {
if (tname.equals("")) {
return defaultQualifier;
} else {
try {
Class c = lookupClass(tname);
Class t = declaringClass;
Node result = defaultQualifier;
while (t != null) {
if (t == c) {
return result;
}
result = new ObjectFieldAccess((Expression)result,
getOuterThisName(t));
t = InterpreterUtilities.getDeclaringClass(t);
}
throw new ExecutionError("this.expression", node);
} catch (ClassNotFoundException e) {
throw new CatchedExceptionError(e, node);
}
}
}
COM: <s> returns the default qualifier for this context </s>
|
funcom_train/1416568 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean scrollToCaret () {
int line = getCaretLine ();
int lineStart = getLineStartOffset (line);
int offset = Math.max (0, Math.min (getLineLength (line) - 1,
getCaretPosition () - lineStart));
return scrollTo (line, offset);
}
COM: <s> ensures that the caret is visible by scrolling the text area if </s>
|
funcom_train/25011139 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void drawTopLeft(final GL2 gl) {
if (listMap.get(GemfireBorderSprite.TOP_LEFT) != null) {
gl.glPushMatrix();
gl.glColor4fv(super.getColor());
// move to top-left corner of sprite
double y = super.getPosition().getY();
y += super.getHeight();
y -= imageInsets.top;
gl.glTranslated(
super.getPosition().getX(),
y,
0d
);
gl.glCallList(listMap.get(GemfireBorderSprite.TOP_LEFT));
gl.glPopMatrix();
}
}
COM: <s> renders the top left corner </s>
|
funcom_train/9708478 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initPropertiesMap() {
if (properties == null) {
// This needs to be a concurrent collection to prevent ConcurrentModificationExcpetions
// for async-on-the-wire. It was originally:
// properties = new HashMap(DEFAULT_MAP_SIZE);
properties = new HashMapUpdateLockable<String, Object>(DEFAULT_MAP_SIZE);
}
}
COM: <s> if the properties map has not been allocated yet then allocate it </s>
|
funcom_train/18741990 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void decorateLabelText(String name, StringBuilder text) {
if (getResource(name).isEnabled()) {
HTMLConverter.STRONG_TAG.on(text);
HTMLConverter.HTML_TAG.on(text);
} else {
text.insert(0, "(");
text.append(")");
}
}
COM: <s> adds html formatting to the label text for the main display </s>
|
funcom_train/3848035 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean startStatement(String statement, String condition) {
try{
Statement stmt = Statement.newInstance(statement);
stmt.setCondition(condition);
stmt.setLineProcessor(this);
boolean addResult = true;
if( statements.size() > 0 )
addResult = addStatementBody(statement+" "+condition) && addResult;
statements.add(stmt);
return addResult;
}
catch( Throwable t ){
Logger.getRef().error("Unable to start statement " + statement + " " + t);
}
return false;
}
COM: <s> starts a new statement </s>
|
funcom_train/11764276 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel createMessagePanel(){
JPanel messagePanel = new JPanel();
this.helpMessage = "<html>"
+ " CD++ Modeler manual contains the detailed <BR> "
+ "instructions on usage of the tool "
+ "</html>";
this.messageLabel = new JLabel();
this.messageLabel.setFont(new Font("Courier New", Font.PLAIN, 12));
this.messageLabel.setText(this.helpMessage);
messagePanel.add(this.messageLabel);
return messagePanel;
}
COM: <s> panel containing label with message is created and returned for further </s>
|
funcom_train/8988236 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String removeCondition(String itemSeq, boolean isAnd){
StringBuffer buff = new StringBuffer();
condValueHt.remove(itemSeq);
condDescHt.remove(itemSeq);
this.displayCondPlus = condValueHt.isEmpty();
buff.append(this.getOldCondition(isAnd));
return buff.toString();
}
COM: <s> remove a condition </s>
|
funcom_train/3795994 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean removeService(String serviceName){
NodeList maps = document.getElementsByTagName("map");
for(int i = 0; i < maps.getLength(); i++){
if(((Element)maps.item(i)).getAttribute("name").equals(serviceName)){
Element parent = (Element)maps.item(i).getParentNode();
parent.removeChild(maps.item(i));
MODIFIED = true;
return true;
}
}
return false;
}
COM: <s> method remove service </s>
|
funcom_train/31126314 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void featureDetected(Feature feature, FeatureDetector detector) {
detector.enableDetection(false);
Sound.beepSequence();
int side = 0;
// Identify which bumper was pressed:
if(feature.getRangeReading().getAngle() < 0)
side = LEFT_SIDE;
else
side = RIGHT_SIDE;
// Perform a movement to avoid the obstacle.
pilot.travel(-5 - rand.nextInt(5));
int angle = 60 + rand.nextInt(60);
pilot.rotate(-side * angle);
detector.enableDetection(true);
pilot.travel(10 + rand.nextInt(60));
nav.goTo(target);
}
COM: <s> causes the robot to back up turn away from the obstacle </s>
|
funcom_train/18226925 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public NFSFile getNFSFileByHandle(nfs_fh fh) throws StaleHandleException {
final NFSFile nfsFile = (NFSFile) handlesToFiles.get(handleToInt(fh));
if (null == nfsFile)
throw new StaleHandleException();
if (!nfsFile.validateHandle(fh))
throw new StaleHandleException("Handle was defined, but wrong generation");
nfsFile.updateTimestamp();
return nfsFile;
}
COM: <s> get an nfsfile by its nfs fh handle </s>
|
funcom_train/41329046 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void imageAdded( JPanel src, ImageElement img ) {
if ( src == mapTileBuilder ) {
mapBuilder.mapTileAdded(img);
} else if ( src == figureSideBuilder ) {
gameTreeEditor.figureSideViewAdded(img);
} else if ( src == figureTopBuilder ){
gameTreeEditor.figureTopViewAdded(img);
} else {
Debug.out("These imageAdded() calls have not been implemented yet.");
}
}
COM: <s> call here when a new terrain piece has been added to the list </s>
|
funcom_train/7341802 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addMappedStatement(MappedStatement mappedStatement) {
if (mappedStatements.containsKey(mappedStatement.getName())) {
throw new SqlMapException("This SQL map already contains an MappedStatement named " + mappedStatement.getName());
}
mappedStatements.put(mappedStatement.getName(), mappedStatement);
}
COM: <s> adds a named mapped statement </s>
|
funcom_train/12834759 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void cleanRoutingTable() {
RoutingTableEntry entry;
synchronized (routingTable) {
for (Iterator<RoutingTableEntry> i = routingTable.values().iterator(); i.hasNext(); ) {
entry = i.next();
if (entry.expirationTime < now) {
entry.isActive = false;
if (removeOnTimeout) {
i.remove();
// out("cleanRoutingTable", "TIMEOUT! removed RouteEntry for dest=" + entry.destination );
}
}
}
}
}
COM: <s> removes expired entries from the routing table </s>
|
funcom_train/20654238 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {
if ("CmiServicePort".equals(portName)) {
setCmiServicePortEndpointAddress(address);
}
else
{ // Unknown Port Name
throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName);
}
}
COM: <s> set the endpoint address for the specified port name </s>
|
funcom_train/7616542 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int getComponentFrom_RGB(int pixel, int idx) {
int components[] = getComponents(pixel, null, 0);
float[] normComponents = getNormalizedComponents(components, 0, null, 0);
float[] sRGBcomponents = cs.toRGB(normComponents);
return (int)(sRGBcomponents[idx] * 255.0f + 0.5f);
}
COM: <s> this method return rgb component value if color model has arbitrary rgb </s>
|
funcom_train/3722789 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getTitle() {
if (rtCorpus != null) {
String fileName = rtCorpus.getLocation().getFile();
fileName = fileName.substring(fileName.lastIndexOf(File.separatorChar)+1, fileName.length());
return fileName;
} else {
return "annotations";
}
}
COM: <s> return the name of the corpus </s>
|
funcom_train/3601879 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getTitle() {
String title = "";
DockingWindow window;
for (int i = 0; i < getChildWindowCount(); i++) {
window = getChildWindow(i);
title += (i > 0 ? ", " : "") + (window != null ? window.getTitle() : "");
}
return title;
}
COM: <s> returns the title of this window </s>
|
funcom_train/39562672 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public RefBaseObject lookupPathName(Collection path) {
RefBaseObject o = null;
for (Iterator iter = path.iterator(); iter.hasNext(); ) {
String item = (String)iter.next();
if (o == null) {
o = (RefBaseObject)lookupLocal(item);
}
else {
o = changeEnvironment(o, item);
}
}
return o;
}
COM: <s> lookups a path name denoted with a string collection </s>
|
funcom_train/17782361 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Resolution fatClientResolution() {
if (object!=null) {
XmlObject xmlObject = (XmlObject)WebFacets.get(getRequest()).getFacet(FacetConstants.xml, object, getRequest());
return xmlObject.execute(getContext());
} else {
return null;
}
}
COM: <s> return the target object serialized </s>
|
funcom_train/46680721 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getTimeAsString(int afterComma){
String result = (new Double(time)).toString();
if (result.indexOf('.')>0){
result = result.substring(0,Math.min(result.length()-1,result.indexOf('.')+afterComma+1));
}
return result;
}
COM: <s> returns time as string with soundsoviel nachkommastellen </s>
|
funcom_train/46760931 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Long store(final CensusModel census, final ServiceCall call) throws Exception {
IBeanMethod method = new IBeanMethod() { public Object execute() throws Exception {
IChainStore chain = new ChainStore();
try {
Long censusId = store(census, chain, call);
chain.execute();
// return primary key
return censusId;
} catch (Exception ex) {
Log.exception(ex);
Log.error(census);
chain.rollback();
throw ex;
}
}}; return (Long) call(method, call);
}
COM: <s> save the census model model creating a new census or updating existing rows </s>
|
funcom_train/44497286 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ResultSequence plus(ResultSequence arg) throws DynamicError {
AnyType at = get_single_arg(arg);
if( !(at instanceof XSFloat) )
DynamicError.throw_type_error();
XSFloat val = (XSFloat) at;
return ResultSequenceFactory.create_new(new XSFloat(float_value() + val.float_value()));
}
COM: <s> mathematical addition operator between this xsfloat and the supplied result sequence </s>
|
funcom_train/8342377 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void add(final JComponent comp, final JLabel label){
if(maxColumns < 2){
throw new IllegalArgumentException(COMP_WIDTH_EXCEEDS_MAX_COL);
}
label.setLabelFor(comp);
//move to the next 2x1 opening
moveToNextOpenSpot(2,1);
addLabel(label);
add(comp);
}
COM: <s> add the component and its label to the grid in </s>
|
funcom_train/39810806 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void delete(int id) throws SQLException {
// Sanity check - if id is null there's nothing to do
if (id == -1) {
return;
}
try {
this.conn = this.openConnection();
UserDAO myUserDao = new UserDAO();
myUserDao.resetCompanyId(id, "System");
PreparedStatement ps = conn.prepareStatement(CompanySQL.DELETE_COMPANY);
ps.setInt(1, id);
ps.executeUpdate();
} finally {
this.closeConnection();
}
}
COM: <s> used to remove a company from the company table </s>
|
funcom_train/30206508 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void toXmlElement(Element root){
Element acl = root.addElement("acl");
acl.addElement("id").addText(String.valueOf(getId()) );
acl.addElement("name").addText( LocalMessage.loc(getName()));
acl.addElement("sysName").addText(getName());
acl.addElement("description").addText( LocalMessage.loc(getDescription()));
}
COM: <s> add the folder as xml element acl to the parameter element </s>
|
funcom_train/40725100 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void deleteAll() {
Session session = null;
Transaction transaction = null;
try {
log.info("Removing all messages...");
System.out.println("Removing all messages...");
session = getSession();
transaction = session.beginTransaction();
String queryString = "delete from Message";
Query queryObject = session.createQuery(queryString);
queryObject.executeUpdate();
transaction.commit();
} catch (Exception e) {
log.error(e);
transaction.rollback();
}
}
COM: <s> method to delete all messages </s>
|
funcom_train/16466841 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void writeOtrk2File() {
FileOutputStream stream = null;
OutputStreamWriter mapWriter;
File otrk2File = new File(oruxMapsLayerDir, map.getName() + ORUXMAPS_EXT);
try {
stream = new FileOutputStream(otrk2File);
mapWriter = new OutputStreamWriter(stream, "UTF8");
mapWriter.append(prepareOtrk2File());
mapWriter.flush();
} catch (IOException e) {
log.error("", e);
} finally {
Utilities.closeStream(stream);
}
}
COM: <s> main calibration file per layer </s>
|
funcom_train/24178117 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void showSelected() {
if (this.getFigure().getBorder() == null) {
showSelected = true;
BoundsRefreshment.refreshBounds(this, this.getSize().width + 2, 59);
RoundedRectangleBorder border = new RoundedRectangleBorder(10, 10);
border.setWidth(2);
border.setColor(ColorConstants.orange);
this.getFigure().setBorder(border);
this.getFigure().repaint();
}
}
COM: <s> it will also show while loop highlighted if its linked to any handler </s>
|
funcom_train/41326071 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void assertEquals(Matrix A, Matrix B) {
assertEquals(A.numRows(), B.numRows());
assertEquals(A.numColumns(), B.numColumns());
for (int i = 0; i < A.numRows(); ++i) {
for (int j = 0; j < A.numColumns(); ++j) {
assertEquals(A.get(i, j), B.get(i, j), DELTA);
}
}
}
COM: <s> assert that the given matrices are identical </s>
|
funcom_train/16177061 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addInEdge(Edge edge) {
Node from = edge.getFrom();
HashSet s = (HashSet)inMap.get(from);
if (s == null) {
s = new HashSet();
inMap.put(from, s);
s.add(edge);
inEdges.add(edge);
} else if (!s.contains(edge)) {
s.add(edge);
inEdges.add(edge);
}
}
COM: <s> adds an in edge to this default node </s>
|
funcom_train/26512610 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String get_is_EncryptedXML() {
String retVal = new String ("<encrypted>");
if (getEncryptionScheme().equals("NO")) {
retVal += "no encryption"; }
else {
retVal += getEncryptionScheme(); }
retVal += "</encrypted>";
return retVal;
}// end method
COM: <s> returns appropriate encryption descriptor wrapped in xml tags as per </s>
|
funcom_train/12173438 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void updateWhitespaceState() {
switch (whitespaceState) {
case WS_KEEP:
if (!isPreFormatted()) {
whitespaceState = WS_IGNORE;
}
break;
case WS_IGNORE:
if (isPreFormatted()) {
whitespaceState = WS_KEEP;
}
break;
case WS_PRUNING:
if (isPreFormatted()) {
whitespaceState = WS_KEEP;
}
break;
}
}
COM: <s> update the current whitespace state </s>
|
funcom_train/12313042 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void destroy()
{
for (int i=_fields.size();i-->0;)
{
Field field=(Field)_fields.get(i);
if (field!=null)
field.destroy();
}
_fields=null;
_index=null;
_dateBuffer=null;
_calendar=null;
_dateReceive=null;
}
COM: <s> destroy the header </s>
|
funcom_train/4187636 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String drawTableRow(int [] lengths, String [] labels) {
StringBuilder result = new StringBuilder();
result.append('|');
for (int i = 0; i < labels.length; i++) {
String label = String.format(String.format("%%%ds", lengths[i]-1), labels[i]);
result.append(label);
result.append(" |");
}
result.append("\n");
return result.toString();
}
COM: <s> draw a table row with the specified column code lenghts code </s>
|
funcom_train/2871939 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setConsensusStudyExpertsGUI(org.spim.tridem.gui.ConsensusStudyExpertsGUI consensusStudyExpertsGUI) {
this.consensusStudyExpertsGUI = consensusStudyExpertsGUI;
bind();
if (!isBound())
return;
initPathologistListSubject();
initConsensusStudySubject();
// fetchPathologistList();
}
COM: <s> setter for property consensus study experts gui </s>
|
funcom_train/169031 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private DnDJToolBar getJToolBar() {
if (jToolBar == null) {
jToolBar = new DnDJToolBar();
jToolBar.setOrientation(javax.swing.JToolBar.HORIZONTAL);
jToolBar.setFont(new java.awt.Font("Dialog", 0, 8));
jToolBar.setMinimumSize(new java.awt.Dimension(82, 20));
jToolBar.setPreferredSize(new java.awt.Dimension(82, 20));
}
return jToolBar;
}
COM: <s> this method initializes j tool bar </s>
|
funcom_train/9924952 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void generateInstance(String group,String user,String instanceName ) throws APP_SPECException{
groups.getInstance(group, user, instanceName).generateWorkflow(user);
groups.getInstance(group, user, instanceName).setJobStatuses(user);
}
COM: <s> generates new workflow from base workflow sets statuses of jobs and updates database </s>
|
funcom_train/10768987 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void loadFiles() throws IOException {
// #1. clear all existing content
clear();
// #3. put the root map
initRoot();
for (File file : files) {
Properties props = loadFile(file);
if(!props.isEmpty()) processProperties(props, file);
}
replacePlaceholders();
}
COM: <s> clear all existing content then read the file and parse each property </s>
|
funcom_train/4305012 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addField(String name, String value) {
String field = "--" + formBoundary + NEW_LINE +
"Content-Disposition: form-data; " +
"name=\"" + name + "\"" + NEW_LINE + NEW_LINE +
value + NEW_LINE;
fields.add(getBytes(field));
}
COM: <s> add a plain text form field to this form </s>
|
funcom_train/33353088 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getRealTimeButton() {
if (realTimeButton == null) {
realTimeButton = new JButton();
realTimeButton.setBounds(new Rectangle(129, 32, 97, 25));
realTimeButton.setText("Real Time");
realTimeButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
instantUpdater.changeAdvanceRate(1);
}
});
}
return realTimeButton;
}
COM: <s> this method initializes real time button </s>
|
funcom_train/3024885 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getFieldGetter(FieldSummary summary) {
String typeName = summary.getType();
String prefix = "get";
if (typeName.equalsIgnoreCase("boolean")) {
prefix = "is";
}
String name = summary.getName();
return prefix + name.substring(0, 1).toUpperCase() + name.substring(1);
}
COM: <s> gets the name of the getter for the field </s>
|
funcom_train/19536399 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setShowCountdown(boolean aShowCoundown) {
if (showCountdown == aShowCoundown) return;
boolean old = showCountdown;
showCountdown = aShowCoundown;
pcs.firePropertyChange(SHOW_COUNTDOWN_PROP_NAME, old, showCountdown);
ps.getPreferences().putBoolean(SHOW_COUNTDOWN_PROP_NAME, showCountdown);
}
COM: <s> set the value of show coundown for this init tool preferences </s>
|
funcom_train/37853233 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void indexText(NodeId nodeId, QName qname, NodePath path, LuceneIndexConfig config, CharSequence content) {
PendingDoc pending = new PendingDoc(nodeId, qname, path, content, config);
nodesToWrite.add(pending);
cachedNodesSize += content.length();
if (cachedNodesSize > maxCachedNodesSize)
write();
}
COM: <s> adds the passed character sequence to the lucene index </s>
|
funcom_train/19160721 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void createProjectNew( ) {
addProjectConfirmButton.setEnabled(true);
addProjectCancelButton.setEnabled(true);
addProjectNewButton.setEnabled(false);
createProjectTitleTextField.setEditable(true);
createProjectDescriptionTextArea.setEditable(true);
this.projectState = NEW_PROJECT_STATE;
}
COM: <s> starts the project creation process by enabling appropriate text </s>
|
funcom_train/34960876 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void save(Fraser entity) {
EntityManagerHelper.log("saving Fraser instance", Level.INFO, null);
try {
getEntityManager().persist(entity);
EntityManagerHelper.log("save successful", Level.INFO, null);
} catch (RuntimeException re) {
EntityManagerHelper.log("save failed", Level.SEVERE, re);
throw re;
}
}
COM: <s> perform an initial save of a previously unsaved fraser entity </s>
|
funcom_train/38996329 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void parseListeners(NodeList nodes) {
for (int i = 0; i < nodes.getLength(); i++) {
Element el = (Element) nodes.item(i);
String classname = getProperty(el);
try {
Class<?> clazz = Class.forName(classname);
Constructor cstr = clazz.getConstructor(Server.class);
Object obj = cstr.newInstance(server);
if (obj instanceof MessageListener) {
getOutput().add((MessageListener) obj);
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
COM: <s> parses the list of message listeners </s>
|
funcom_train/3174230 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void makeVisible(Model.Event event) {
double
min = model.min + scrollContent.getHorizontalScrollBar().getValue()/DPC.getX()/cmPerYear,
max = min + scrollContent.getViewport().getWidth()/DPC.getX()/cmPerYear;
if (event.to>max || event.from<min)
scroll2year(event.from);
}
COM: <s> make sure the given event is visible </s>
|
funcom_train/8265244 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void printError(String msg) {
PrintWriter writer = errWriter;
if (writer != null) {
writer.print("[" + serverId + "]: ");
writer.print("[" + Thread.currentThread() + "]: ");
writer.println(msg);
writer.flush();
}
}
COM: <s> prints an error message to this server objects err writer </s>
|
funcom_train/12708429 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean editRelation(EntityRelation relation) {
RelationEditor editor = new RelationEditor(this.getParentFrame(),
relation);
if (editor.showModal() == DialogConstants.MODAL_RESULT_OK) {
editor.applyChanges(relation);
relation.checkType();
this.m_definedEntities.updateAttributeForeignKeySigns();
this.m_viewManager.forceRepaint();
m_designer.notifyModelChanged();
return true;
}
return false;
}
COM: <s> edit a relation </s>
|
funcom_train/23950036 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public MaximaInteractiveProcess launchInteractiveProcess(final OutputStream maximaStderrHandler) {
final MaximaInteractiveProcessImpl process = new MaximaInteractiveProcessImpl(newMaximaProcessController(maximaStderrHandler),
computeDefaultTimeout(maximaConfiguration.getDefaultCallTimeout(), DEFAULT_CALL_TIMEOUT),
computeMaximaCharset());
process.advanceToFirstInputPrompt();
logger.debug("Maxima interactive process started and ready for communication");
return process;
}
COM: <s> launches a new </s>
|
funcom_train/20218850 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testDoRender() throws Exception {
List innerElements = new ArrayList();
// 此处实际上应该增加 Element 对象,但是我们仅仅测试List的内容,
// 所以装入了字符串。
innerElements.add("a");
innerElements.add("b");
blockDirectiveHandler.doRender(context, "test", "blockName", innerElements);
assertEquals(innerElements, context.getParentLocalContext().getProperty(BlockDefineDirectiveHandler.BLOCK_TYPE, "blockName"));
}
COM: <s> block define directive handler </s>
|
funcom_train/3371789 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String paramString() {
String wrapString = (wrap ?
"true" : "false");
String wordString = (word ?
"true" : "false");
return super.paramString() +
",colums=" + columns +
",columWidth=" + columnWidth +
",rows=" + rows +
",rowHeight=" + rowHeight +
",word=" + wordString +
",wrap=" + wrapString;
}
COM: <s> returns a string representation of this jtext area </s>
|
funcom_train/50032624 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String possiblyQuote(Object obj) {
String objStr = obj.toString();
if (obj instanceof DottedPair) {
return objStr;
} else if (objStr.indexOf(' ')!=-1) {
return "|" + objStr + "|";
} else {
return objStr;
}
}
COM: <s> puts appropriate quotation characters around an atom so that </s>
|
funcom_train/43590432 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JMenu getJMenu() {
if (jMenu == null) {
jMenu = new JMenu();
jMenu.setText("File");
jMenu.add(getFindDevicesMenuItem());
jMenu.add(getCheckUpdateMenuItem());
if (!Zenses.getInstance().isMacOSX()) {
jMenu.addSeparator();
jMenu.add(getExitMenuItem());
}
}
return jMenu;
}
COM: <s> this method initializes j menu </s>
|
funcom_train/51657624 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Canvas createCanvas(Composite parent) {
return new Canvas(parent, SWT.NO_BACKGROUND) {
/*
* @see org.eclipse.swt.widgets.Control#addMouseListener(org.eclipse.swt.events.MouseListener)
* @since 3.0
*/
public void addMouseListener(MouseListener listener) {
if (isPropagatingMouseListener() || listener == fMouseListener)
super.addMouseListener(listener);
}
};
}
COM: <s> creates a canvas with the given parent </s>
|
funcom_train/5459532 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int externaldocumentUpdate(DrupalNode node) throws Exception {
Vector<Object> params = generateDefaultParams(MethodExternalDocumentUpdate);
params.add(node);
Object o;
try {
o = xmlRpcClient.execute(MethodExternalDocumentUpdate, params);
} catch (XmlRpcExtensionException x) {
checkNullValue(x, node, params);
throw x;
}
if (log.isLoggable(Level.FINEST))
log.finest(MethodExternalDocumentUpdate+" returned "+o.toString());
return methodReturnInteger(MethodExternalDocumentUpdate, o);
}
COM: <s> this method call is provided on the server by </s>
|
funcom_train/36948132 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testLocalVariableMatches() {
String source = "class Klass;def foo(x);puts x*2;end;def bar;my_var = 5;my_var = 6;puts my_var;foo(my_var);end;end";
int[][] offsets = {{44,50},{55,61},{71,77},{82,88}};
assertOccurrencesEqual( source, 46, "my_var", offsets );
}
COM: <s> match locals within class node defn node </s>
|
funcom_train/638 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: final private void binaryTreeToBinaryHeap() {
byte[] treeDataTemp = new byte[packedBoardByteSize*treeSize];
for (int i=0, indexInVector = 0; i<treeSize; i++) {
System.arraycopy(treeData, arrayPointers[i]*packedBoardByteSize, treeDataTemp, indexInVector, packedBoardByteSize);
indexInVector += packedBoardByteSize;
}
treeData = treeDataTemp;
arrayPointers = null;
}
COM: <s> transforms the tree to a binary heap </s>
|
funcom_train/47145734 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setViewMode(final int viewMode) {
try {
SwingUtilities.invokeAndWait(new Thread() {
public void run() {
removeAllDisplays();
m_nViewMode = viewMode;
prepareNewContentPane(viewMode);
addAllDisplays();
}
});
}
catch (Exception e) {
e.printStackTrace();
}
}
COM: <s> sets a new view mode </s>
|
funcom_train/3446978 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void remove(int index) {
if (index < 0)
return;
Visualization vis = getVisualization(index);
if (vis == visualization) {
throw new RuntimeException("cannot remove main visualization");
}
vis.setParent(null);
layer.remove(index);
layerRank.remove(index);
repaint();
}
COM: <s> removes the layer at the specified index </s>
|
funcom_train/9381580 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean wakeWhenReadyTq(int keyCode) {
if (DEBUG) Log.d(TAG, "wakeWhenReady(" + keyCode + ")");
if (mKeyguardView != null) {
mKeyguardView.wakeWhenReadyTq(keyCode);
return true;
} else {
Log.w(TAG, "mKeyguardView is null in wakeWhenReadyTq");
return false;
}
}
COM: <s> a key has woken the device </s>
|
funcom_train/10585779 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String findNamespaceURI(String prefix) {
if (namespaceDeclarations != null && namespaceDeclarations.size() != 0) {
String uri = namespaceDeclarations.get(prefix);
if (uri != null) {
return uri;
}
}
if (parent != null) {
return parent.findNamespaceURI(prefix);
}
return null;
}
COM: <s> finds a namespace declaration on this element or containing elements </s>
|
funcom_train/47907279 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Double getEuroKM(){
Double euroKM = 0.0;
long ekm = (long) 0.0;
if (this.getCompleteKM() != 0.0){
euroKM = this.getPrice() / this.getCompleteKM();
}
else
euroKM = this.getPrice();
return this.roundTwoDecimals(euroKM, 2);
}
COM: <s> calculates the amount of euro you paid per km </s>
|
funcom_train/7707960 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String rename(String toRename, String targetName) throws IOException {
if (!folderExists(toRename)) {
throw new FileNotFoundException(toRename + " was not found from device");
}
return readResponse(doGet("/rename?src=" + rawUrlEncode(toRename) + "&dst=" + rawUrlEncode(targetName)));
}
COM: <s> renames directory to another </s>
|
funcom_train/45804702 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isShowType(TMAbstractNode node, TopicIF type) {
if (!(node instanceof TMTopicNode))
return true;
TopicIF primaryType = getPrimaryTypeFor((TMTopicNode)node);
if (primaryType == null)
return type == null;
return primaryType.equals(type);
}
COM: <s> returns true iff type is the appropriate config type for node </s>
|
funcom_train/32749219 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: static protected TransferRow extractVerticalSubMatrix( final PhaseMatrix transferMatrix ) {
final double t11 = transferMatrix.getElem( PhaseMatrix.IND_Y, PhaseMatrix.IND_Y );
final double t12 = transferMatrix.getElem( PhaseMatrix.IND_Y, PhaseMatrix.IND_YP );
final double t13 = 1000 * transferMatrix.getElem( PhaseMatrix.IND_Y, PhaseMatrix.IND_HOM );
return new TransferRow( t11, t12, t13 );
}
COM: <s> extract the vertical sub matrix </s>
|
funcom_train/8077365 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void stratStep (int numFolds){
FastVector newVec = new FastVector(m_Instances.capacity());
int start = 0, j;
// create stratified batch
while (newVec.size() < numInstances()) {
j = start;
while (j < numInstances()) {
newVec.addElement(instance(j));
j = j + numFolds;
}
start++;
}
m_Instances = newVec;
}
COM: <s> help function needed for stratification of set </s>
|
funcom_train/26379554 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String readLine() throws IOException {
char c;
String line = new String();
do {
c = getc();
} while (isSpace(c));
ungetc(c);
do {
c = getc();
line = line + c;
} while (c != '\n' && c != '\r');
do {
c = getc();
} while (c == '\n' || c == '\r');
ungetc(c);
return line;
}
COM: <s> basic file reading methods </s>
|
funcom_train/9373795 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void getEFLinearRecordSize(int fileid, Message onLoaded) {
Message response
= obtainMessage(EVENT_GET_EF_LINEAR_RECORD_SIZE_DONE,
new LoadLinearFixedContext(fileid, onLoaded));
phone.mCM.iccIO(COMMAND_GET_RESPONSE, fileid, getEFPath(fileid),
0, 0, GET_RESPONSE_EF_SIZE_BYTES, null, null, response);
}
COM: <s> get record size for a linear fixed ef </s>
|
funcom_train/51792400 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void insertItem(int elementNum, String stringPart, Image imagePart) {
if((elementNum >= 0) && (elementNum <= items.size())) {
if(stringPart != null) {
MenuItem menuItem = new MenuItem(stringPart, ORDINARY);
items.insertElementAt(menuItem, elementNum);
onResize();
}
}
}
COM: <s> inserts an element into the choice just prior to the element specified </s>
|
funcom_train/9886965 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void run() {
if(document.appendAlgorithm(data, parentNode.getID())) {
try {
updateTree();
scrollAllToVisible();
repaint();
} catch (Exception e) {e.printStackTrace(); }
} else {
System.out.println("doc base didn't append");
}
}
COM: <s> run method kicks off algorithm addition </s>
|
funcom_train/3132806 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Info info(File resource) throws Exception{
SVNWCClient client = context.getLocalClient();
SVNInfo info = client.doInfo(resource, BASE);
String location = info.getURL().getURIEncodedPath();
long revision = info.getRevision().getNumber();
return new Info(info.getAuthor(), location, revision);
}
COM: <s> this acquires local information for the specified resource </s>
|
funcom_train/5165453 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void add(final String currName, ConfigProperty a_cp) {
List props = (List) m_metaMap.get(currName);
if (null == props) {
props = Collections.synchronizedList(new ArrayList());
m_metaMap.put(currName, props);
}
props.add(a_cp);
}
COM: <s> add a new config property for a certain class to the hashtable of </s>
|
funcom_train/3368697 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setSelected(ButtonModel m, boolean b) {
if (b && m != null && m != selection) {
ButtonModel oldSelection = selection;
selection = m;
if (oldSelection != null) {
oldSelection.setSelected(false);
}
m.setSelected(true);
}
}
COM: <s> sets the selected value for the code button model code </s>
|
funcom_train/42225487 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void findPreviousFleet() {
logger.info("Inside FleetManager.findPreviousFleet()");
int currentFleetIndex = fleetList.indexOf(currentFleetNode);
do {
if (currentFleetIndex == 0)
currentFleetIndex = fleetList.size();
currentFleetIndex--;
currentFleetNode = fleetList.get(currentFleetIndex);
} while (currentFleetNode.getFleet().getOwner() != gameManager.playerRace);
}
COM: <s> find the previous fleet belonging to the player </s>
|
funcom_train/14323897 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean checkPasswords(String password1, String password2) {
if (password1 != null && password2 != null) {
return password1.equals(password2);
}
if (password1 != null) {
return password1.equals(password2);
}
if (password2 != null) {
return password2.equals(password1);
}
return password1 == password2;
}
COM: <s> performs equality checking for the given passwords </s>
|
funcom_train/31435085 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setDirectory(JTextField tf) {
if (fc == null) {
fc = new JFileChooser();
}
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
int fileState = fc.showSaveDialog(this);
File file = fc.getSelectedFile();
if (file !=null && fileState == JFileChooser.APPROVE_OPTION) {
tf.setText(file.getAbsolutePath());
updateProperties();
}
}
COM: <s> this allows the user to specify the file name they </s>
|
funcom_train/18827236 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean containsAlias(String alias) {
String aliases = getAliasList();
if (aliases == null) {
return false;
}
StringTokenizer tok = new StringTokenizer(aliases, ";");
while (tok.hasMoreTokens()) {
if (tok.nextToken().equals(alias)) {
return true;
}
}
return false;
}
COM: <s> tests if this envelope contains a primitive entry with the </s>
|
funcom_train/22470630 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getClick() {
StringBuilder sb = new StringBuilder();
sb.append("openPopup('");
sb.append(getHref());
sb.append("', 'popup', 400, 80); return false;");
return sb.toString();
}
COM: <s> returns the piece of javascript that is needed in order to open the </s>
|
funcom_train/49790310 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testViewAdDirectly() throws Exception {
IFile sitemap = beginAtSitemapThenPage("Page 2");
assertNoProblem();
gotoSitemapThenPage(sitemap, "Advertisement");
assertNoProblem();
gotoSitemapThenPage(sitemap, "External Page");
assertNoProblem();
// go to page 2
gotoSitemapThenPage(sitemap, "Page 3");
assertNoProblem();
gotoSitemapThenPage(sitemap, "Home");
assertNoProblem();
}
COM: <s> if we view the ad directly we can exit without any problems </s>
|
funcom_train/48600735 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Entity getParent(TransactionXML transaction, String parentIid) {
for (Entity entity:transaction.getServer().actions.actions) {
if (entity.iid != null && entity.iid.equals(parentIid)) {
if (entity.parentIid != null && entity.parentIid.length() > 0)
return getParent(transaction, entity.parentIid);
else
return entity;
}
}
return null;
}
COM: <s> returns the main or first entity </s>
|
funcom_train/32057713 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSetGraphLayoutCache() {
System.out.println("testSetGraphLayoutCache");
GraphLayoutCache c1 = new GraphLayoutCache( new DefaultGraphModel(), new JGraph() );
jgraph.setGraphLayoutCache( c1 );
GraphLayoutCache c2 = jgraph.getGraphLayoutCache();
assertEquals( c1, c2 );
}
COM: <s> test of set graph layout cache method of class jgraph </s>
|
funcom_train/43370178 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Collection getAllFileFormatLinks(Session session) {
List links = new LinkedList();
try {
for (Iterator i = session.createQuery(
"from doks.storage.FileFormat").iterate(); i.hasNext();) {
FileFormat fileFormat = (FileFormat) i.next();
links.add(new FileFormatLink(fileFormat));
}
} catch (HibernateException e) {
logger.debug(e);
}
return links;
}
COM: <s> get a collection with all the </s>
|
funcom_train/26325487 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setSessionCookie(String cookieString) {
if (cookieString != null && !cookieString.equals("")) {
cookieString = cookieString.substring(cookieString.indexOf("RETS"),cookieString.length());
}else{
cookieString = null;
}
this.sessionCookie = cookieString;
}
COM: <s> simple rets token parser from the http response header </s>
|
funcom_train/46054913 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean place(Object3D ground) {
SimpleVector dropDown=new SimpleVector(0, 1, 0);
float height=ground.calcMinDistance(getTransformedCenter(), dropDown, 500);
if (height!=Object3D.COLLISION_NONE) {
dropDown.scalarMul(height+getCenter().y);
translate(dropDown);
enableLazyTransformations();
return true;
} else {
return false;
}
}
COM: <s> place the plant </s>
|
funcom_train/18861159 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void handleAdd() {
DataSourceDialog dialog = new DataSourceDialog(getSection().getShell());
if (dialog.open() == DataSourceDialog.OK) {
DataSourceType element = dialog.getDataSource();
Command command = AddCommand.create(getEditingDomain(),
getDataSources(), StrutsConfigPackage.eINSTANCE
.getDataSourcesType_Sources(), element);
if (command.canExecute()) {
getEditingDomain().getCommandStack().execute(command);
}
}
}
COM: <s> adds a new data source element to the data sources element </s>
|
funcom_train/2860349 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void createDocument(){
filename = widgets.get("file");
String rootName = widgets.get("root");
xmldoc = new Document();
Element tmp = xmldoc.createElement(Element.ELEMENT, rootName);
xmldoc.addChild(tmp, null);
mantisXML.setDoc(xmldoc);
user.put("filename", filename);
}//createDocument
COM: <s> create an xml document object from scratch with a starting root element </s>
|
funcom_train/16219112 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Sprite checkPosMouse(PlayField field, boolean pixelCheck) {
SpriteGroup[] groups = field.getGroups();
int size = groups.length;
for (int i = 0; i < size; i++) {
if (groups[i].isActive()) {
Sprite s = this.checkPosMouse(groups[i], pixelCheck);
if (s != null) {
return s;
}
}
}
return null;
}
COM: <s> returns sprite in specified playfield that intersected with mouse pointer </s>
|
funcom_train/29397574 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isEnum() {
if (superClass == null)
return false;
if (!(superClass instanceof AssemblyTypeRef))
return false;
AssemblyTypeRef ref = (AssemblyTypeRef) superClass;
return (ref.getAssemblyRefInfo().equals(AssemblyRefInfo.MSCORLIB) && ref.getNamespace().equals("System") && ref.Name.equals("Enum"));
}
COM: <s> returns true iff this type def is an enum i </s>
|
funcom_train/21483918 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testCacheManagerReferenceInstance() {
instanceManager = new CacheManager();
instanceManager.addCache("test");
Ehcache cache = instanceManager.getCache("test");
assertEquals("test", cache.getName());
assertEquals(Status.STATUS_ALIVE, cache.getStatus());
CacheManager reference = cache.getCacheManager();
assertTrue(reference == instanceManager);
}
COM: <s> does the cache hang on to its instance </s>
|
funcom_train/45713555 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean saveAsText(String path) {
try {
Calibration cal = imp.getCalibration();
int precision = Analyzer.getPrecision();
int measurements = Analyzer.getMeasurements();
boolean scientificNotation = (measurements&Measurements.SCIENTIFIC_NOTATION)!=0;
if (scientificNotation)
precision = -precision;
TextEncoder file = new TextEncoder(imp.getProcessor(), cal, precision);
DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(path)));
file.write(out);
out.close();
}
catch (IOException e) {
showErrorMessage(e);
return false;
}
return true;
}
COM: <s> save the image as tab delimited text using the specified path </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.