__key__
stringlengths 16
21
| __url__
stringclasses 1
value | txt
stringlengths 183
1.2k
|
---|---|---|
funcom_train/3415977 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private CharProperty unicodeBlockPropertyFor(String name) {
final Character.UnicodeBlock block;
try {
block = Character.UnicodeBlock.forName(name);
} catch (IllegalArgumentException iae) {
throw error("Unknown character block name {" + name + "}");
}
return new CharProperty() {
boolean isSatisfiedBy(int ch) {
return block == Character.UnicodeBlock.of(ch);}};
}
COM: <s> returns a char property matching all characters in a unicode block </s>
|
funcom_train/1773209 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetFilteredQueries() {
DataQuery dataQuery = TestUtil.getFilledDataQuery();
List<String> dimensionValues = new ArrayList<String>();
FilteredQueries queries = queryManager.getFilteredQueries(dataQuery, dimensionValues);
assertNotNull(queries);
DataQuery testQuery = queries.getQuery();
assertNotNull(testQuery);
List<String> filterList = queries.getFilterList();
assertNotNull(filterList);
}
COM: <s> test getting filtered queries </s>
|
funcom_train/38529820 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void update(final Observable observable, final Object object) {
final BroadcastEvent event = (BroadcastEvent) object;
final BroadcastEvent.Command command = event.getCommand();
if (command == BroadcastEvent.Command.HISTOGRAM_NEW
|| command == BroadcastEvent.Command.HISTOGRAM_ADD) {
setupHistChooser();
}
}
COM: <s> implementation of observable interface listeners for broadcast events </s>
|
funcom_train/11317187 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Stanza generateJIDDontMatchErrorStanza(Entity sender, Entity receiver, IQStanza stanza) {
XMLElement invalidJID = createXMLElement(INVALID_JID, NamespaceURIs.XEP0060_PUBSUB_ERRORS);
return ServerErrorResponses.getStanzaError(StanzaErrorCondition.BAD_REQUEST, stanza, StanzaErrorType.MODIFY, null,
null, invalidJID);
}
COM: <s> create the jid dont match error stanza </s>
|
funcom_train/47515410 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void cleanupPersistence(){
boolean found = false;
Set<String> pFiles = persistence.getFiles();
List<String> removal = new ArrayList<String>(pFiles.size());
for(String file : pFiles){
for(String loadedFile : mResultFilePaths){
if(file.equals(loadedFile)) found = true;
}
if(!found) removal.add(file);
found = false;
}
for(String removeFile : removal){
persistence.removeFile(removeFile);
}
}
COM: <s> remove persistence for files that are no longer loaded </s>
|
funcom_train/19845364 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addFrame(int duration, int x, int y) {
if (duration == 0) {
Log.error("Invalid duration: " + duration);
throw new RuntimeException("Invalid duration: " + duration);
}
if (frames.isEmpty()) {
nextChange = (int) (duration / speed);
}
frames.add(new Frame(duration, x, y));
currentFrame = 0;
}
COM: <s> add animation frame to the animation </s>
|
funcom_train/46578780 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setPeriodYear(PeriodYear periodYear) {
if (periodYear == null) {
return;
}
this.periodYear = (PeriodYear) periodYear.clone();
for (JLabel label : labels) {
deselectLabel(label);
}
for (int month : periodYear.getSelectedMonths()) {
selectMonth(month);
}
}
COM: <s> sets the period week </s>
|
funcom_train/26529286 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isDefaultMergeAppropriate(EVTask task) {
// if this is not a rollup schedule, a default merge isn't appropriate.
if (!EVTaskListRollup.TASK_LIST_FLAG.equals(task.getFlag()))
return false;
// add other potential checks here. Think about this further before
// enabling this feature.
return false;
//return true;
}
COM: <s> check to see whether a default merge is appropriate for a given task </s>
|
funcom_train/16079872 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void add2Situation(Situation s, Repository r){
s.getDescription(r).addConcept(this);
if (classifieds.isEmpty())
l.warn("No particulars to classify associated to "+getClass().getSimpleName()+" -> make sure you add them to the situation manually, e.g. using the method Situation.setSettingFor(Particular p)!");
for (ClassifiedType c:classifieds){
s.setSettingFor(c);
}
}
COM: <s> adds this concept to the description of the </s>
|
funcom_train/949820 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean containsKey(Object key) {
Object k = key;
if (k == null) return false;
int hash = hash(k);
int i = indexFor(hash, table.length);
Entry e = table[i];
while (e != null) {
if (e.hash == hash && eq(k, e.key))
return true;
e = e.next;
}
return false;
}
COM: <s> returns tt true tt if this map contains a mapping for the </s>
|
funcom_train/328046 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean loadTrainingData(String folderName, boolean subFolders, boolean useFolderNames) {
clearStore();
TrainingFileList tfl = new TrainingFileList();
ArrayList<File> trainingFiles = tfl.getFileList(folderName, subFolders);
for (int i = 0; i < trainingFiles.size(); i++) {
addFileData(trainingFiles.get(i), useFolderNames);
}
return true;
}
COM: <s> load all the training data for all species from a given store </s>
|
funcom_train/9705526 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public SOAPElement getParentElement() {
if (this.parentElement == null) {
javax.xml.soap.Node parentNode = toSAAJNode(element.getParentNode());
if (parentNode instanceof SOAPElement) {
this.parentElement = (SOAPElement) parentNode;
}
}
return this.parentElement;
}
COM: <s> returns the parent element of this code node code object </s>
|
funcom_train/28877591 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void selectionChanged(IAction action, ISelection selection) {
/*
System.out.println("selectionChanged method invocated on JdeepAction class:");
System.out.println("action: " + action.getText() + " - " + action.getDescription());
System.out.println("selection: " + selection.getClass().getCanonicalName());
// org.eclipse.jface.text.TextSelection if selection happens on an Editor
*/
}
COM: <s> selection in the workbench has been changed </s>
|
funcom_train/28875507 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setPopupPattern(Track track) {
int size=track.getSize();
// check for insert pattern
// cannot be in last 2 positions
if (actCol>=size-2) {
jMenuItemInsPat.setEnabled(false);
return;
}
jMenuItemInsPat.setEnabled(true);
}
COM: <s> set pop up menu for insert pattern </s>
|
funcom_train/19409305 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Type lookup(String name) {
// System.out.println("--- lookup: " + name);
for (int i = fScopes.size() - 1; i >= 0; i--) {
HashMap names = (HashMap) fScopes.elementAt(i);
Entry e = (Entry) names.get(name);
if (e != null)
return e.fType;
}
if (fGlobalBindings != null) {
Value v = fGlobalBindings.getValue(name);
if (v != null)
return v.type();
}
return null;
}
COM: <s> looks up a name and returns its type </s>
|
funcom_train/51209799 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setTransformParam(int seriesIndex, double parameter) {
if (seriesIndex < 0)
return;
TransformMode transMode = getTransformMode(seriesIndex);
parameter = ensureGoodTransformParam(transMode, parameter);
if (parameter == getTransformParam(seriesIndex))
return;
Event<? extends SettingsEvent> actionEvent = checkObservers(DSS_Series_TransformParam,
false, seriesIndex, parameter, transMode);
if (null == actionEvent)
return;
ensureLength(seriesIndex);
settings.get(seriesIndex).param = parameter;
notifyObservers(actionEvent);
}
COM: <s> sets the parameter for the transformation of the plotted values of the data </s>
|
funcom_train/51696891 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: @Test public void addMarkItemInGroup() throws InvalidWeightException {
Course cm = new Course();
MarkItem mg = new MarkItem("Quizzes", 50);
MarkItem item = new MarkItem(mg);
assertTrue(mg.hasChild(item));
assertTrue(cm.hasMarkItem(cm.DEFAULT_GROUP));
cm.addMarkItem(item);
assertEquals(mg, item.getGroup());
assertTrue(cm.hasMarkItem(mg));
item = new MarkItem();
cm.addMarkItem(item);
assertEquals(cm.DEFAULT_GROUP, item.getGroup());
}
COM: <s> mark sure group is added when item in group </s>
|
funcom_train/24376650 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ParameterItem () {
Name = "Parameter1";
Type = INTEGER;
Description = "new parameter item";
ID = "P1";
SearchString = "@@parameter1@@";
ValuesString = "[ : : ] & { , , , } ^ { , , }";
}
COM: <s> construct an empty entry </s>
|
funcom_train/9206935 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void registerNotificationBroadcaster(ObjectName serviceName, MBeanServer mbs) {
try {
MBeanInfo mBeanInfo = mbs.getMBeanInfo(serviceName);
if(mBeanInfo.getNotifications().length > 0 ||
serverName != null){
mbs.addNotificationListener(serviceName, serverName, null, null);
//mbs.removeNotificationListener(serviceName, serverName, null, null);
}
} catch(Exception e) {
log.error(e,e);
}
}
COM: <s> register the main service as notification broadcaser forward all notification to all services </s>
|
funcom_train/40882809 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JSONArray (Object array) throws JSONException {
this();
if (array.getClass().isArray()) {
int length = Array.getLength(array);
for (int i = 0; i < length; i += 1) {
this.put(JSONObject.wrap(Array.get(array, i)));
}
} else {
throw new JSONException("JSONArray initial value should be a string or collection or array.");
}
}
COM: <s> construct a jsonarray from an array </s>
|
funcom_train/3111547 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setCanvas(ExtendedCanvas3D[] canvas) {
for (int nCanvas = 0; nCanvas < canvas.length; nCanvas++) {
canvas[nCanvas].addMouseListener(this);
canvas[nCanvas].addMouseMotionListener(this);
canvas[nCanvas].addMouseWheelListener(this);
canvas[nCanvas].addKeyListener(this);
}
}
COM: <s> sets the canvases </s>
|
funcom_train/48338027 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private HttpResponse createResponseError(HttpRequest req) {
HttpResponse res = new HttpResponse();
// Fix up bad requests
if (HttpRequest.getVersionString(req.version) == null) {
res.version = HttpEvent.HTTP09;
} else {
res.version = req.version;
}
res.status = req.status;
createResponseError(res);
return res;
}
COM: <s> we are dealing with an error of some sort </s>
|
funcom_train/12662818 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String setKey() {
key = getRole() + "+" + getContextDepot() + "+" + getContextType() + "+" + getContextName() + "+" +
getModule() + "+" + getCommand() + "+" + getTimeanddayExp().toString() + "+" + isScriptAllowed();
return key;
}
COM: <s> set the key to be referenced in an acl map </s>
|
funcom_train/19143356 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Region regionExtraction(String str){
int index0 = str.indexOf('{');
int index1 = str.indexOf(',',index0+1);
int index2 = str.indexOf('{',index1+1);
int index3 = str.lastIndexOf(',');
int last = str.indexOf('}');
String regionName = str.substring(index0+1,index1);
Vector nodes = new Vector();
int i = index2+1;
while(i < index3) {
int j = str.indexOf(',',i);
nodes.add(new Integer(str.substring(i,j)));
i = j+1;
}
nodes.add(new Integer(str.substring(index3+1,last)));
return new Region( regionName, nodes);
}
}
COM: <s> code region extraction code returns a region from a file string line </s>
|
funcom_train/46753666 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Cache buildCache(String region, Properties properties) throws CacheException {
int refreshPeriod = PropertiesHelper.getInt(
StringHelper.qualify(region, OSCACHE_REFRESH_PERIOD),
OSCACHE_PROPERTIES,
CacheEntry.INDEFINITE_EXPIRY
);
String cron = OSCACHE_PROPERTIES.getProperty( StringHelper.qualify(region, OSCACHE_CRON) );
// construct the cache
return new OSCache(refreshPeriod, cron, region);
}
COM: <s> builds a new </s>
|
funcom_train/9664906 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void synchronizeDataModel() {
Editable dataModel = getModel();
DataModelCallbackHandler<Editable> callbackHandler = dataModel.getHandler();
if (callbackHandler != null)
callbackHandler.synchronize(dataModel); //redisplay will be done automatically
else
drawContent(); //just redisplay the content if data synchronization is not required
runDecorators();
}
COM: <s> this method invokes the data model handler to synchronize the model and persistence </s>
|
funcom_train/34233196 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean openDB() throws Exception {
if (!connected) {
// read in config details
readFileAsString();
// Load Driver
Class.forName("com.mysql.jdbc.Driver");
System.out.println(url + " " + userName + " " + password);
// Establish connection to database
try {
con = DriverManager.getConnection(url, userName, password);
connected = true;
} catch (SQLException e) {
System.out.println(e);
}
}
return connected;
}// close openDB
COM: <s> process for creating a connection to the database </s>
|
funcom_train/13902163 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: /*public boolean isSubsignature(IMethod overriding, IMethod overridden) throws JavaModelException {
if (!overridden.getElementName().equals(overriding.getElementName())) {
return false;
}
int nParameters= overridden.getNumberOfParameters();
if (nParameters != overriding.getNumberOfParameters()) {
return false;
}
if (!hasCompatibleTypeParameters(overriding, overridden)) {
return false;
}
return nParameters == 0 || hasCompatibleParameterTypes(overriding, overridden);
}*/
COM: <s> tests if a method is a subsignature of another method </s>
|
funcom_train/3064289 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public BigInteger setBit(int n) {
if (n<0)
throw new ArithmeticException("Negative bit address");
int intNum = n/32;
int[] result = new int[Math.max(intLength(), intNum+2)];
for (int i=0; i<result.length; i++)
result[result.length-i-1] = getInt(i);
result[result.length-intNum-1] |= (1 << (n%32));
return valueOf(result);
}
COM: <s> returns a big integer whose value is equivalent to this big integer </s>
|
funcom_train/41029463 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void loadRulePlugins() {
List<String> rulesCardIds = CardManager.getCardFactory().lookupCardBySupertype(MagicWarsModel.CardSuperType.Rule);
for (String id : rulesCardIds) {
Card c = CardManager.getCard(id);
c.entersTheGame();
c.setOwner(getPlayer1().getPlayerId());
c.setController(getPlayer1().getPlayerId());
getExile().add(c);
c.entersTheBattlefield();
}
}
COM: <s> this method load rules 2 </s>
|
funcom_train/35921592 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void handleMemberAddedEvent(MemberAddedEvent newMemberEvent) {
String idAsString = newMemberEvent.getSNR().getId().toString();
if (currentComponents.containsKey(idAsString)) {
// We already new about this component.
return;
}
currentComponents.put(idAsString, true);
currentAllocatedServiceComponents++;
}
COM: <s> called when a new service component has joined the service component </s>
|
funcom_train/19379133 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void updateSkinTheme(String newSkin, boolean useSkin) {
if (!useSkin) {
Skin skin = SkinLookAndFeel.getSkin();
skin.unload();
updateLookAndFeel();
SwingUtilities.updateComponentTreeUI(this);
}
else
setSkinTheme(newSkin);
}
COM: <s> this method loads unloads a skin </s>
|
funcom_train/18730464 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void drawHit(GL gl, GLU glut) {
int width = width();
int height = height();
gl.glBegin(GL.GL_POLYGON);
gl.glVertex3d(0, 0, 0);
gl.glVertex3d(width, 0, 0);
gl.glVertex3d(width, height, 0);
gl.glVertex3d(0, height, 0);
gl.glEnd();
}
COM: <s> displays this widget for hit detection </s>
|
funcom_train/37565753 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void moveFromLocalFile(File src, File dst) throws IOException {
if (! src.equals(dst)) {
if (useCopyForRename) {
FileUtil.copyContents(this, src, dst, true);
fullyDelete(src);
} else src.renameTo(dst);
}
}
COM: <s> in the case of the local filesystem we can just rename the file </s>
|
funcom_train/6404772 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void update(float dt) {
for (int x = 0, nSize = nodes.size(); x < nSize; x++) {
SpringPoint node = nodes.get(x);
node.update(dt);
}
for (int i = 0, sSize = springs.size(); i < sSize; i++) {
Spring spring = springs.get(i);
for (int x = 0; x < relaxLoops; x++) {
spring.update();
}
}
}
COM: <s> update the spring nodes and springs in this system </s>
|
funcom_train/45464539 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void run() {
try {
log.info("requesting url " + url);
log.info("request body " + requestBody);
resultBody = doBrowserRequest(url, requestBody);
log.info("request got result: " + resultBody);
} catch (IOException e) {
ioex = e;
} catch (RuntimeException e) {
rtex = e;
}
}
COM: <s> do the actual request capturing the result or the exception </s>
|
funcom_train/47336701 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void preloadItems() {
// check if there are any items present, load some if not
if(dao.findAll(JsffullcrudItem.class).isEmpty()){
// use the dao to preload some data here
dao.save( new JsffullcrudItem("Preload Title",
"Preload Owner", "Preload Site", Boolean.TRUE, new Date()) );
log.info("Preloaded " + dao.countAll(JsffullcrudItem.class) + " items");
}
}
COM: <s> preload some items into the database </s>
|
funcom_train/40324520 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void dumpRDF(OutputStream out, RDFFormat outFormat) {
try {
RepositoryConnection con = theRepository.getConnection();
try {
RDFWriter w = Rio.createWriter(outFormat, out);
con.export(w);
} finally {
con.close();
}
} catch (Exception ex) {
log.log(Level.WARNING, "Error while connecting to local repository.", ex);
}
}
COM: <s> dump rdf graph </s>
|
funcom_train/16604735 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addPoint() {
ControlPoint point = new ControlPoint(Color.white, 0.5f);
for (int i=0;i<list.size()-1;i++) {
ControlPoint now = (ControlPoint) list.get(i);
ControlPoint next = (ControlPoint) list.get(i+1);
if ((now.pos <= 0.5f) && (next.pos >=0.5f)) {
list.add(i+1,point);
break;
}
}
selected = point;
sortPoints();
repaint(0);
fireUpdate();
}
COM: <s> add a new control point </s>
|
funcom_train/785223 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Schema getSchema() {
if ( m_schema == null ) {
Schema s = new Schema();
for ( int i=0; i<getColumnCount(); ++i ) {
s.addColumn(getColumnName(i), getColumnType(i),
getColumn(i).getDefaultValue());
}
s.lockSchema();
m_schema = s;
}
return m_schema;
}
COM: <s> returns this tables schema </s>
|
funcom_train/47944488 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setValues(String low, String high) throws MotuInvalidDepthException {
MotuInvalidDepthException invalidDepth = null;
try {
setFrom(high);
} catch (MotuInvalidDepthException e) {
invalidDepth = e;
}
try {
setTo(low);
} catch (MotuInvalidDepthException e) {
invalidDepth = e;
}
if (invalidDepth != null) {
throw invalidDepth;
}
}
COM: <s> set criteria from low depth and end depth values </s>
|
funcom_train/3416390 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void write(byte b[], int off, int len) throws IOException {
if ((off | len | (b.length - (len + off)) | (off + len)) < 0)
throw new IndexOutOfBoundsException();
for (int i = 0 ; i < len ; i++) {
write(b[off + i]);
}
}
COM: <s> writes code len code bytes from the specified </s>
|
funcom_train/10951424 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setProperty(String name, Object value, Object o, Map<String, Object> context, boolean throwPropertyExceptions) {
Ognl.setTypeConverter(context, getTypeConverterFromContext(context));
Object oldRoot = Ognl.getRoot(context);
Ognl.setRoot(context, o);
internalSetProperty(name, value, o, context, throwPropertyExceptions);
Ognl.setRoot(context, oldRoot);
}
COM: <s> sets the named property to the supplied value on the object </s>
|
funcom_train/36662964 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void destroy() throws Exception {
Connection connection = DriverManager.getConnection(
beanSetupProperties.getProperty(KEY_CONNECTION_URL),
beanSetupProperties.getProperty(KEY_USER_NAME),
beanSetupProperties.getProperty(KEY_PASSWORD));
Statement statement = connection.createStatement();
statement.execute("SHUTDOWN");
connection.close();
}
COM: <s> destroys the database instance </s>
|
funcom_train/20287615 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isValid() {
if (!StringUtils.hasText(subject)) {
errors.put("subjectError", "Required field");
}
if (!StringUtils.hasText(filename)) {
errors.put("filenameError", "Required field");
}
return !hasErrors();
}
COM: <s> gets the valid attribute of the file item object </s>
|
funcom_train/24186211 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetNeighborhoodSizes() {
for (Map.Entry<String, DCOPProblemInterface<AddableInteger, AddableInteger>> entry : this.trueSubProbs.entrySet())
assertEquals (entry.getValue().getNeighborhoodSizes(), this.subProbs.get(entry.getKey()).getNeighborhoodSizes());
}
COM: <s> test method for problem get neighborhood sizes </s>
|
funcom_train/35848413 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSetUp() {
assertEquals(NO_OF_ELEMENTS, model.getSize());
assertTrue(model.contains(signals[NO_OF_ELEMENTS / 2]));
assertTrue(model.contains(signals[0]));
assertTrue(model.contains(signals[NO_OF_ELEMENTS - 1]));
}
COM: <s> set up the test </s>
|
funcom_train/36047042 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setPort(int port) {
if (port < 0) {
this.port = RFB_PORT_OFFSET;
} else {
if (port > 0xFFFE) {
throw new IllegalArgumentException(res.getString("com.tplan.robot.rfb.RfbModule.errInvalidPort"));
}
this.port = port;
}
}
COM: <s> set the port of the target rfb server </s>
|
funcom_train/19657180 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testCreateSingleRadio() {
mockRadioCollection = new MockAbstractRadioCollection("test",
new String[] { "blah" });
// insure that the radio button was created and that all the styles were
// set appropriately.
assertEquals("mshab-RadioButtonGroup", mockRadioCollection
.getStylePrimaryName());
assertEquals(1, mockRadioCollection.size());
assertEquals("blah", mockRadioCollection.getRadio("blah").getText());
}
COM: <s> test creating a single </s>
|
funcom_train/646481 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initialize() {
_formattedTime = _dateFormatter.format(new Date(_time));
_searchableString = (_rawSQLString + " " + aliasName + "/" + userName + " " + _formattedTime).toLowerCase();
_singleLineText = TextUtil.removeLineBreaks(_rawSQLString);
}
COM: <s> initialize our search string immediately this allows for very fast </s>
|
funcom_train/50313676 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setChecked (boolean value) {
checkWidget ();
if ((parent.getStyle () & SWT.CHECK) == 0) return;
if (checked == value) return;
checked = value;
Rectangle bounds = getCheckboxBounds ();
parent.redraw (bounds.x, bounds.y, bounds.width, bounds.height, false);
}
COM: <s> sets the checked state of the checkbox for this item </s>
|
funcom_train/39315511 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSquare1ActionPerformed() {
System.out.println("testSquare1ActionPerformed");
f.square1ActionPerformed(actionEvent);
assertEquals(f.curBrush,f.square1);
//t.square1ActionPerformed(actionEvent);
//assertEquals(t.curBrush,t.square1);
assertEquals(f.toolBrush.getBrushType(), f.toolBrush.SQUARE1);
}
COM: <s> test of square1 action performed method of class terp paint </s>
|
funcom_train/17675311 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object put(int key, Object value) {
int i = key & (table.length - 1);
for (Entry e = table[i]; e != null; e = e.next) {
if (key == e.key) {
Object oldValue = e.value;
e.value = value;
return oldValue;
}
}
addEntry(key, value, i);
return null;
}
COM: <s> associates the specified value with the specified key in this map </s>
|
funcom_train/50069539 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void paint() {
if (dc == null) dc = getDefaultContainer();
if (!getVisible()) return;
/* Ellipse2D.Double circle = new Ellipse2D.Double(curr.x-getRadius(), curr.y-getRadius(), (double)getRadius()*2, (double)getRadius()*2);
dc.draw(circle);
*/
dc.drawCircle(curr.x,curr.y, getRadius(), mypaint);
}
COM: <s> the default paint method for the particle </s>
|
funcom_train/9888321 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int compareTo(DeviceRange rhs) {
// If the device's range extends below rhs, but not above it
if(start < rhs.start && end <= rhs.end) return -1;
// If the device's range ends above rhs, but does not start before it
if(start >= rhs.start && end > rhs.end) return 1;
// Otherwise one range contains the other
return 0;
}
COM: <s> compare two device ranges </s>
|
funcom_train/8242868 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void start() {
state = STATE_START;
positions.removeAllElements();
id = controller.configuration.getPilotId();
url = Constant.LOGURL;
int period = controller.configuration.getSendInterval() * 60 * 1000;
timer = new Timer();
timer.scheduleAtFixedRate(new Helper(), 100, period);
}
COM: <s> start sending positions </s>
|
funcom_train/45801576 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getWidth() {
TopicIF oType = OntopolyModelUtils.getTopicIF(getTopicMap(), PSI.ON_WIDTH);
OccurrenceIF occ = OntopolyModelUtils.findOccurrence(oType, getTopicIF());
return (occ == null ? 50 : Integer.parseInt(occ.getValue()));
}
COM: <s> returns the assigned width of the occurrence text field </s>
|
funcom_train/26588005 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getParameterTypeName(int param) throws SQLException {
checkParameterIndex(param);
try {
int dbType = serverParameterMetaData.getParameterDataType(param-PARAMETER_OFFSET);
return Utilities.getDataBaseTypeName(dbType);
}
catch (DException ex) {
throw ex.getSqlException(connection.getLocale());
}
}
COM: <s> retrieves the designated parameters database specific type name </s>
|
funcom_train/21652960 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void directFlushStream(Player p) {
if (p == null) {
return;
}
try {
p.socket.write(p.getByteVector().outBuffer, 0, p.getByteVector().outOffset);
p.getByteVector().outOffset = 0;
} catch (Exception exception) {
exception.printStackTrace();
}
}
COM: <s> send the bytes in the streams out buffer directly to the client </s>
|
funcom_train/24931425 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public SequenceValue excluding(Value v) {
SequenceValue res = new SequenceValue(elemType());
Iterator it = fElements.iterator();
while (it.hasNext() ) {
Value elem = (Value) it.next();
if (! v.equals(elem) )
res.add(elem);
}
return res;
}
COM: <s> returns a copy of this sequence excluding all occurrences of v </s>
|
funcom_train/37592114 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public SEList parseTopLevelExp() {
Tokens.SExpToken t = _lex.readToken();
if (t == Tokens.LeftParenToken.ONLY) {
return parseList();
}
else if (t == null) {
return null;
}
else {
throw new PrivateParseException("A top-level s-expression must be a list. " +
"Invalid start of list: " + t);
}
}
COM: <s> a top level s expression is simply a non empty list </s>
|
funcom_train/9236158 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private DefaultMutableTreeNode changeFocusDown(final DefaultMutableTreeNode node) {
DefaultMutableTreeNode nextNode;
nextNode = node.getNextNode();
if (nextNode == null && !rootVisible) {
nextNode =
(DefaultMutableTreeNode) rootNode.getFirstChild();
} else if (nextNode == null) {
nextNode = (DefaultMutableTreeNode) model.getRoot();
}
return nextNode;
}
COM: <s> changes the tree focus down </s>
|
funcom_train/1239531 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Deserializer getGeneralPurpose(String mechanismType) {
if (javaType == null || xmlType == null) {
return super.getGeneralPurpose(mechanismType);
}
if (deserClass == EnumDeserializer.class) {
return super.getGeneralPurpose(mechanismType);
}
return new BeanDeserializer(javaType, xmlType, typeDesc, propertyMap);
}
COM: <s> optimize construction of a bean deserializer by caching the </s>
|
funcom_train/1975727 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String formatDate(Date date) {
GregorianCalendar calendar = new GregorianCalendar(GMT_TIME_ZONE);
calendar.setTime(date);
return String.format("%1$tY%1$tm%1$td%1$tH%1$tM%1$tS.%1$tL", calendar);
}
COM: <s> format the date according to the ofx spec </s>
|
funcom_train/45257516 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void partActivated(IWorkbenchPart part) {
super.partActivated(part);
IWorkbenchPartSite site = part.getSite();
SubActionBars bars = (SubActionBars) ((PartSite) site).getActionBars();
bars.addPropertyChangeListener(propertyChangeListener);
setActionHandler(bars.getGlobalActionHandler(getId()));
}
COM: <s> a workbench part has been activated </s>
|
funcom_train/32824295 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void guessOptional(ZipFile zipfile, ArrayList apis) {
OptionalLibraryInfo[] infoArray = getOptionalLibraryInfo();
for (int i = 0; i < infoArray.length; i++) {
OptionalLibraryInfo info = infoArray[i];
if (zipContainsEntry(zipfile, info.classEntry)) {
API api = new API();
apis.add(api);
api.setIdentifier(info.identifier);
api.setName(info.description);
api.setType(APIType.OPTIONAL);
api.setVersion(info.version);
}
}
}
COM: <s> guess at the optional information for the specified library file </s>
|
funcom_train/6233509 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private ISQLConnection createUnmanagedConnection() throws SQLException {
ISQLConnection unmanagedConnection = getSession().createUnmanagedConnection();
if(unmanagedConnection == null){
int option = JOptionPane.showConfirmDialog(null, "Unable to open a new connection. The current connection will be used instead.", "Unable to open a new Connection", JOptionPane.OK_CANCEL_OPTION);
if(option == JOptionPane.CANCEL_OPTION){
return null;
}
}else{
// we didn't want a autocommit
unmanagedConnection.setAutoCommit(false);
}
return unmanagedConnection;
}
COM: <s> create a new unmanaged connection which is not associated with the current session </s>
|
funcom_train/37831412 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean prev() throws java.sql.SQLException {
checkClosed();
int rowIndex = rowData.getCurrentRowNumber();
if ((rowIndex - 1) >= 0) {
rowIndex--;
rowData.setCurrentRow(rowIndex);
thisRow = (byte[][]) rowData.getAt(rowIndex);
return true;
} else {
return false;
}
}
COM: <s> the prev method is not part of jdbc but because of the </s>
|
funcom_train/10927394 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected LinkCache getLinkCache() {
LinkCache linkCache = (LinkCache) getSession().get(SpiSessionParameter.LINK_CACHE);
if (linkCache == null) {
linkCache = new LinkCache(getSession());
getSession().put(SpiSessionParameter.LINK_CACHE, linkCache);
}
return linkCache;
}
COM: <s> returns the link cache or creates a new cache if it doesnt exist </s>
|
funcom_train/45929958 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public AbstractNode visitSimpleNode(ASTSearchVisitorContext context, SimpleNode node) {
Assert.isTrue(context.size() == 0, "Unconsumed context node %s %s", node, context);
Assert.notNull(node, "Cannot locate node for context: %s", context);
return node;
}
COM: <s> performs simple assertions and returns the node </s>
|
funcom_train/32748889 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void save(DataAdaptor container, boolean useTwiss) {
DataAdaptor stateNode = container.createChild(STATE_LABEL);
stateNode.setValue(TYPE_LABEL, getClass().getName());
stateNode.setValue("id", this.getElementId());
this.useTwiss = useTwiss;
addPropertiesTo(stateNode);
}
COM: <s> save the state information to a data sink represented by </s>
|
funcom_train/18196538 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isRequestMethodServed(Method method, HttpMethod httpMethod) {
boolean accepts = false;
switch (httpMethod) {
case GET:
accepts = method.getAnnotation(GET.class) != null;
break;
case POST:
accepts = method.getAnnotation(POST.class) != null;
break;
case PUT:
accepts = method.getAnnotation(PUT.class) != null;
break;
case DELETE:
accepts = method.getAnnotation(DELETE.class) != null;
break;
default:
throw new IllegalArgumentException("HTTP method not supported: " + httpMethod);
}
return accepts;
}
COM: <s> checks if a resources method attends http requests using a concrete </s>
|
funcom_train/27960015 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void ensureCapacity(int minCapacity) {
if (elementData.length >= minCapacity) return;
int newCapacity = elementData.length + capacityIncrement;
if (capacityIncrement <= 0) newCapacity = elementData.length * 2;
Object[] newArray = new Object[Math.max(newCapacity, minCapacity)];
System.arraycopy(elementData, 0, newArray, 0, elementData.length);
elementData = newArray;
}
COM: <s> ensures that b min capacity b elements can fit within this vector </s>
|
funcom_train/47545751 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getIncrement () {
checkWidget ();
int /*long*/ hAdjustment = OS.gtk_spin_button_get_adjustment (handle);
GtkAdjustment adjustment = new GtkAdjustment ();
OS.memmove (adjustment, hAdjustment);
int digits = OS.gtk_spin_button_get_digits (handle);
for (int i = 0; i < digits; i++) adjustment.step_increment *= 10;
return (int) adjustment.step_increment;
}
COM: <s> returns the amount that the receivers value will be </s>
|
funcom_train/1959151 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public EventProcessor getProcessor(String name) throws NetSimException {
EventProcessor result = null;
Enumeration e = processorelements();
while (e.hasMoreElements()) {
EventProcessor p = (EventProcessor) e.nextElement();
if (p.getName().equals(name)) {
result = p;
}
}
if (result == null) {
throw new NetSimException("unknown Processor: " + name);
}
return result;
}
COM: <s> gets a packet processor that is instancaied in this layer </s>
|
funcom_train/31350031 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void makeStatusChart(String directory){
StatusChart sc = new StatusChart();
JFreeChart chart = sc.getChart();
chart.setAntiAlias(true);
try{
saveAsFile(chart.createBufferedImage(600,450), directory);
}catch(NullPointerException e){
System.out.println("No Image");
}
}
COM: <s> testing method at the moment </s>
|
funcom_train/21963884 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSingle() {
String html = "<html>";
SgmlLexer lex = new SgmlLexer(new StringCharacterStream(html));
String test = "";
int count = 0;
while (lex.hasNext()) {
test += lex.next();
count++;
}
assertEquals(html,test);
assertEquals(1,count);
}
COM: <s> tests a single tag </s>
|
funcom_train/27786259 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Money add(TradingDate date, Money destinationMoney, Money sourceMoney) {
if(!destinationMoney.getCurrency().equals(sourceMoney.getCurrency()))
sourceMoney = sourceMoney.exchange(destinationMoney.getCurrency(),
getRate(date,
sourceMoney.getCurrency(),
destinationMoney.getCurrency()));
return destinationMoney.add(sourceMoney);
}
COM: <s> add the two given monies </s>
|
funcom_train/39965286 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public long store(String value) {
Name name = namesByValue.get(value);
if (name == null) {
long id = getNextId();
name = new Name(id, value);
namesById.put(id, name);
namesByValue.put(value, name);
} else {
name.incrementCount();
}
return name.id;
}
COM: <s> stores a string value in the namepool </s>
|
funcom_train/37754270 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString() {
if ( check_nobreak_text ) {
return String.format( ":no:%s:pre:%s:post:%s: :%s:%s: %d:",
nobreak, pre_brkpt, post_brkpt, replace_pre_brkpt, replace_post_brkpt, weight );
}
return "" + weight;
}
COM: <s> gets a string representation of the </s>
|
funcom_train/7607406 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private float getProp(Vector2f src, Vector2f den) {
if ((den.getX() == 0) && (den.getY() == 0)) {
return 0;
}
if (den.getX() != 0) {
return src.getX() / den.getX();
}
return src.getY() / den.getY();
}
COM: <s> get the proportion that the src vector is of </s>
|
funcom_train/10546612 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void assertMatchingStringExists(String actualOutput) {
for (int i=0; i < OUTPUT.size(); i ++ ) {
String s = (String) OUTPUT.get(i);
assertTrue("cannot find " + s + " in actualOutput:" + actualOutput,
actualOutput.indexOf(s) >=0);
}
}
COM: <s> check sysinfo output to make sure that it contains strings </s>
|
funcom_train/7272185 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private LimeXMLSchema hasXMLSelected(){
for(int i = 0; i < fds.length; i++) {
LimeXMLDocument doc = fds[i].getXMLDocument();
if( doc != null ) {
doc.getXMLString();
return doc.getSchema();
}
}
return null;
}
COM: <s> determines if this unknown file type has a lime xmldoc associated with it </s>
|
funcom_train/23827995 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addFacetSet(FacetSet fs) {
if (fs.isForAll())
this._facets.setDefaultSet(fs);
else {
for (Iterator<Resource> ti = fs.getForTypes(); ti.hasNext(); ) {
this._facets.putFacetSet(ti.next(), fs);
}
}
this._all.put(fs.getIdentifier(), fs);
}
COM: <s> extension for declaring facets </s>
|
funcom_train/51611255 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setFile(int scope, String path, String name, InputStream stream) throws IOException {
if(path==null)
path = "";
File target_dir = new File(new File(paths.get(scope)), path);
if(!target_dir.exists())
target_dir.mkdirs();
File target = new File(target_dir, name);
if(target.exists())
target.delete();
if(stream==null)
return;
FileCopyUtils.copy(stream, new FileOutputStream(target));
}
COM: <s> this method writes the content of the </s>
|
funcom_train/25731993 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void actionPerformed(ActionEvent e) {
AbstractButton abstractButton = (AbstractButton) e.getSource();
boolean selected = abstractButton.getModel().isSelected();
logger.debug("Action - selected=" + selected);
ImageFrame parent = (ImageFrame)abstractButton.getTopLevelAncestor();
parent.getSelectionPanel().setVisible(selected);
}
COM: <s> makes the selection panel visible if the selection button is toggled </s>
|
funcom_train/15918892 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isVirtual(X10ProcedureDef def, ClassDef container) {
Flags mf = ((MemberDef) def).flags();
Flags cf = container.flags();
if (mf.isStatic() || mf.isFinal() || mf.isPrivate() || (def instanceof ConstructorDef))
return false;
if ( cf.isFinal() || container.isStruct())
return false;
return true;
}
COM: <s> check that a method is eligible to be inlined for non virtual call </s>
|
funcom_train/45074884 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void init(String id, IdState state, Trait[] tvalues) {
Id = id;
this.state = state.value();
for (int i = 0; i < tvalues.length; i++) {
Trait_ a = TraitFactory.current().newTrait();
a.init(this, tvalues[i]);
addTrait(a);
}
preferred_id = id;
}
COM: <s> construct id from input string id and array of traits </s>
|
funcom_train/36632083 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String createSignature(SageMethod m) {
String signature = m.name + "(";
for (int i = 0; i < m.args.size(); i++) {
MethodParam arg = m.args.get(i);
signature += arg.dataType;
if (i < m.args.size() - 1) {
signature += ", ";
}
}
signature += ")";
return signature;
}
COM: <s> create the method signature that is printed in the files comment </s>
|
funcom_train/9849316 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void moveMarkerBy(int distanceX, int distanceY) {
setMarkerXY(markerX - distanceX, markerY - distanceY);
unscaledX = (int) (markerX / scale);
unscaledY = (int) (markerY / scale);
System.out.println("Marker: " + markerX + "," + markerY);
System.out.println("Unscaled Marker: " + unscaledX + "," + unscaledY);
}
COM: <s> moves the marker by specified distance </s>
|
funcom_train/7295501 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean equals(Object that) {
if (that instanceof NFRule) {
NFRule that2 = (NFRule)that;
return baseValue == that2.baseValue
&& radix == that2.radix
&& exponent == that2.exponent
&& ruleText.equals(that2.ruleText)
&& sub1.equals(that2.sub1)
&& sub2.equals(that2.sub2);
}
return false;
}
COM: <s> tests two rules for equality </s>
|
funcom_train/3014160 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Status updateCustomer(Customer customer) {
Status status = new StatusImpl();
try {
update(customer);
status.addMessage(Status.GLOBAL_MESSAGE,
new Message("message.customer.update.success", new Object[] {
customer.getName()
}));
}
catch (DatabaseException de) {
addStatusMessage(status, de);
}
return status;
}
COM: <s> update a customer </s>
|
funcom_train/28300270 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void checkExtension() {
if (getActualFile()==null) return;
String name=getActualFile().getName();
if (!getActualFile().exists() && name.indexOf(".")==-1) {
setActualFile(new File(getActualFile().getPath()+"."+TransBaseSettings.extensionGame[0]));
}
}
COM: <s> if there is no extension the standard game extension is set </s>
|
funcom_train/34538045 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addSelectParameter(String _parameter, String _fieldName) {
if (this.paramSelect == null) this.paramSelect = new Vector<QueryParameterStructure>();
QueryParameterStructure aux = new QueryParameterStructure(_parameter, _fieldName, "SELECT");
this.paramSelect.addElement(aux);
}
COM: <s> adds a new parameter to the select clause </s>
|
funcom_train/27841614 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public List getSelectedRoots() {
List l = new ArrayList(3);
for (Iterator i = fileSystemRoots.iterator(); i.hasNext();) {
FSRoot f = (FSRoot) i.next();
if (f.isEnabled()) {
l.add(f.file);
}
}
return l;
}
COM: <s> gets the selected roots </s>
|
funcom_train/31729324 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void nodeSelected2(Node n) {
if(selected_node!=null && n!=null) {
Person p1 = ((PersonNode)selected_node).getPerson();
Person p2 = ((PersonNode)n).getPerson();
RelationshipFinder finder = new RelationshipFinder(family);
Relationship rel = finder.findRelationship(p1, p2);
setStatus(rel.toString());
related_node = (PersonNode)n;
refresh();
}
}
COM: <s> a node was selected by the second mouse button </s>
|
funcom_train/7880289 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String buildJType() {
// syntax: halt n (0 <= n <= 255 (?), n may be addressing reference of
// any of the four types)
op = operand.get(0);
addrAndMode = translateAddr(op);
addr = addrAndMode[0];
mode = addrAndMode[1];
objectCode = objectCode.concat(mode);
objectCode = rightExtend(objectCode, 8);
objectCode = objectCode.concat(addr);
relative = false;
absolute = true;
return objectCode;
}
COM: <s> procedure name build jtype br br description constructs object code </s>
|
funcom_train/40539387 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public List getObjects(Object object, String... parameters) {
Criteria criteria = getSession().createCriteria(object.getClass());
for (int i = 0; i < parameters.length; i++) {
criteria.add(Restrictions.eq(parameters[i], BeanUtil.getPropertyValue(object, parameters[i])));
}
return criteria.list();
}
COM: <s> get objects by objects specific parameter </s>
|
funcom_train/25878886 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private HMS_User controlCredential(String username,String password){
EmployeeHandler emp=new EmployeeHandler();
Employee employee=emp.findByUsernamePassword(username, password);
if(employee==null){
return(null);
}
Hotelfunctionalarea hfa=employee.getHotelfunctionalarea();
String ruolo=hfa.getName();
HMS_User u= new HMS_User(ruolo,employee.getUsername(),employee.getTaxcode(),ruolo);
return u;
}
COM: <s> this metod return an hms user if username ad password identify an </s>
|
funcom_train/3742363 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int countMails(EMailAccount account) throws MessagingException {
int count = 0;
Store store = null;
Folder inbox = null;
try {
Session session = Session.getInstance(new Properties());
store = session.getStore(account.getProvider());
store.connect(account.getHost(), account.getAccountUser(), account.getAccountPassword());
inbox = store.getFolder("INBOX");
inbox.open(Folder.READ_ONLY);
count = inbox.getMessageCount();
} finally {
if (inbox != null)
inbox.close(true);
if (store != null)
store.close();
}
return count;
}
COM: <s> count all mails from the specified account </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.