__key__
stringlengths 16
21
| __url__
stringclasses 1
value | txt
stringlengths 183
1.2k
|
---|---|---|
funcom_train/37102498 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean satisfies(Object o) {
for(int i=0; i < filters.size(); i++) {
VectorFilter current = (VectorFilter) filters.elementAt(i);
boolean result = current.satisfies(o);
if (operation == NOT)
return !result;
else if (operation == OR && result)
return true;
else if (operation == AND && !result)
return false;
}
if (operation == OR)
return false;
else if (operation == AND)
return true;
else
return false;
}
COM: <s> if the operation for this filter is and this method returns the </s>
|
funcom_train/26415653 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object put(Object key, Object value) {
if (mruList.size() >= cacheSize) {
Object removedKey = mruList.removeLast();
Object removedValue = cache.remove(removedKey);
if (removalListener != null) {
removalListener.removed(removedKey, removedValue);
}
}
Object returnObject = cache.put(key, value);
mruList.addFirst(key);
return returnObject;
}
COM: <s> associates the specified value with the specified key in this cache </s>
|
funcom_train/18964488 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void runAnalyses() {
if (!slideWindow) {
runAnalysisForRegion(startSite, endSite);
return;
}
//slide the window
for (int i = startSite; i < (endSite - window); i += step) {
runAnalysisForRegion(i, i + window - 1);
}
}
COM: <s> this will run the basic analyses and controls the sliding window analyses </s>
|
funcom_train/45038482 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetPredefinedType() throws Exception {
UmlFacade uml = new UmlFacade(new UmlMDRepository(UmlMDRepository.UML_V13));
MofClassifier bool = (MofClassifier) uml.getClassifier("Foundation::Data_Types::Boolean");
Classifier supertype = bool.getOclSupertype();
Object o = bool.getClassifier().refGetValue("type");
assertTrue(supertype.equals(Classifier.Boolean));
assertTrue(!supertype.equals(Classifier.OclAny));
MofClassifier string = (MofClassifier) uml.getClassifier("Foundation::Data_Types::String");
supertype = string.getOclSupertype();
assertTrue(supertype.equals(Classifier.String));
assertTrue(!supertype.equals(Classifier.OclAny));
}
COM: <s> tests the mapping of alias types to ocl primitive types </s>
|
funcom_train/47731148 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object clone() {
try {
FastVector v = (FastVector)super.clone();
v.elementData = new Object[elementCount];
System.arraycopy(elementData, 0, v.elementData, 0, elementCount);
return v;
} catch (CloneNotSupportedException e) {
// this shouldn't happen, since we are Cloneable
throw new Error();
}
}
COM: <s> clones this vector </s>
|
funcom_train/10662179 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testExportObjectRemoteInt013() {
try {
UnicastRemoteObject.exportObject(new EchoWithStubUnicast_Imp(),
1100);
fail("Non export object who has just exported");
} catch (RemoteException e) {
} catch (Throwable e) {
fail("Failed with:" + e);
}
}
COM: <s> export a echo with stub unicast object form the port 1100 </s>
|
funcom_train/26177307 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void setUpOnce(TestResult result) {
for(Iterator i = getTests().iterator(); i.hasNext();) {
Test test = (Test) i.next();
if (test instanceof JFuncTestCase) {
try {
((JFuncTestCase)test).setUpOnce();
} catch (Exception e) {
result.addError(test, e);
}
}
}
}
COM: <s> this doesnt really work the way i want it to just yet </s>
|
funcom_train/1578218 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void loadConstant(final long value) {
if ( value == 0 ) {
addCode(2, Opcode.LCONST_0);
} else if ( value == 1 ) {
addCode(2, Opcode.LCONST_1);
} else {
ConstantInfo info = ConstantLongInfo.make(mCp, value);
mInstructions.new LoadConstantInstruction(2, info, true);
}
}
COM: <s> generates code that loads a constant long value onto the stack </s>
|
funcom_train/11774328 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void moveLine(String inName,int inWhichEnd,Point inPosition){
if(LineTable.containsKey(inName))
{
Line2D.Double myLine = (Line2D.Double)LineTable.get(inName);
if(inWhichEnd == 1){
Point2D p1 = (Point2D)inPosition;
Point2D p2 = myLine.getP2();
myLine.setLine(p1,p2);
}else{
Point2D p1 = myLine.getP1();
Point2D p2 = (Point2D)inPosition;
myLine.setLine(p1,p2);
}
repaint();
}
}
COM: <s> this method is used to move the co ordinates of a particular </s>
|
funcom_train/12735200 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void openLayer(XComponent layer, int x, int y, boolean focus) {
Dimension preferred_size = layer.getPreferredSize();
openLayer(layer, x, y, preferred_size.width, preferred_size.height, focus);
}
COM: <s> will open a new layer at the given coordinates </s>
|
funcom_train/44161194 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String createXML() {
StringBuffer sb = new StringBuffer();
sb.append(writeOpenTag());
sb.append(writeTagAttributes());
sb.append(writeCloseTag());
String child = writeChildElements();
if (child != null) {
sb.append(child);
}
sb.append(writeEndElement());
return sb.toString();
}
COM: <s> creates storage xml for the element </s>
|
funcom_train/6206241 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void loadIncomingTransitionHelpers() {
IGaijinWebFlowTransition[] transitions = getGaijinProcessState().getIncomingTransitions();
IWebFlowTransitionGeneratorHelper[] helpers = new IWebFlowTransitionGeneratorHelper[transitions.length];
for (int i = 0; i < transitions.length; i++) {
helpers[i] = new WebFlowTransitionGeneratorHelper(transitions[i]);
}
incomingTransitionHelpers = helpers;
}
COM: <s> load the helper classes for incoming state transitions </s>
|
funcom_train/3990152 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addSluchPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_BadanieOkresowe_sluch_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_BadanieOkresowe_sluch_feature", "_UI_BadanieOkresowe_type"),
PrzychodniaPackage.Literals.BADANIE_OKRESOWE__SLUCH,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the sluch feature </s>
|
funcom_train/1443238 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void receivedPlayerTypeInf(PlayerTypesInfo info) {
// all playertypes available
if (info.playerTypesFull()) {
allPConf = info.getPlayerTypes();
playingTypes = this.analyze(allPConf);
// map Players with playingTypes
for (int i = 0; i < playingTypes.length; i++) {
int id = playingTypes[i].getId();
Action a = new ChangePlayerTypeAction(i + 1, id);
olct.sendDirect(a.toString());
}
}
}
COM: <s> called at the arrival of a player type info </s>
|
funcom_train/4645698 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Rectangle getBounds() {
// The y coords is relative to the client area because it may return
// wrong values
// on win32 when using the scroll bars. Instead, I use the absolute
// position and make it relative using the current translation.
if (parent.isVertical()) {
return new Rectangle(x, y - parent.translate, width, height);
}
return new Rectangle(x - parent.translate, y, width, height);
}
COM: <s> return the current bounds of the item </s>
|
funcom_train/44798194 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean focusField(final String fieldName) {
LOG.debug("/" + fieldName + ")");
Field[] fields = locateFields(fieldName);
if (fields.length > 0) {
fields[0].getFocusComponent().requestFocus();
explicitelyFocusedComponent = fields[0].getFocusComponent();
return true;
} else
return false;
}
COM: <s> force focus on specific field </s>
|
funcom_train/40400275 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void constrain(int minLeft, int minTop, int maxLeft, int maxTop) {
left = Math.max(minLeft, Math.min(left, maxLeft));
top = Math.max(minTop, Math.min(top, maxTop));
}
COM: <s> constrain the widget location to the provided minimum and maximum values </s>
|
funcom_train/50093537 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: @Test public void testGetEntryDefinition() throws Exception {
EntryReact entry = (EntryReact) dictionary.getEntry(entryString.toLowerCase());
Assert.assertNotNull(
"The definition entry for ["+entryString+"] must not be null.",
entry.getDefinition());
}
COM: <s> test if this entry has a definition schema in the dictionary </s>
|
funcom_train/36462960 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void extractSimpleValue(DaiosOutputMessage m, OMElement el) {
try {
String val = el.getText();
String type = getType(el);
Class vClass = AtomicTypesMapper.get(type);
Object castedVal
= AtomicTypesMapper.construct(val,vClass);
m.set(el.getLocalName(),castedVal,vClass);
} catch (IOException e) {
internalError(e);
} catch (UnsupportedClassException e) {
internalError(e);
} catch (TypeErrorException e) {
internalError(e);
} catch (ArrayException e) {
internalError(e);
}
}
COM: <s> extract a simple value from the xml model and insert it into </s>
|
funcom_train/50925760 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addWedgeHatchBond(CMLAtom atom) throws RuntimeException {
CMLBond bond = getFirstWedgeableBond(atom);
if (bond == null) {
LOG.info("Cannot find ANY free wedgeable bonds! "
+ atom.getId());
} else {
String bondType = getWedgeHatchForBondAndParity(atom, bond);
if (bondType != null) {
CMLBondStereo bondStereo = new CMLBondStereo();
bondStereo.setXMLContent(bondType);
bond.addBondStereo(bondStereo);
}
}
}
COM: <s> uses atom parity to create wedge or hatch </s>
|
funcom_train/2587121 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addIgnoredBaseClass(final String baseClass) {
final Class loadedClass = loadClass(baseClass);
if (loadedClass != null) {
Log.debug (new Log.SimpleMessage("Added IgnClass: " , baseClass));
this.ignoredBaseClasses.add(loadedClass);
}
}
COM: <s> adds a base class that should be ignored </s>
|
funcom_train/46761562 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Long execute(Session session) throws Exception {
try {
int rowsDeleted = BaseData.deleteHql(session, deleteModel.getDeleteHql(), deleteModel.getHqlParameters(), call);
return new Long(rowsDeleted);
} catch (Exception ex) {
Log.exception(ex);
if (deleteModel.getDeleteHql() != null) {
Log.error(deleteModel.getDeleteHql().toString());
}
throw ex;
}
}
COM: <s> execute the delete command </s>
|
funcom_train/20270844 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isExternallyReferenceable(Scope scope, String name) {
if (compiler.getCodingConvention().isExported(name)) {
return true;
}
if (scope.isLocal()) {
return false;
}
for (String s : globalNames) {
if (name.startsWith(s)) {
return true;
}
}
return false;
}
COM: <s> checks whether a name can be referenced outside of the compiled code </s>
|
funcom_train/10587985 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testEventsFromMessage() throws JMSException {
TestJMSEventMessageListener listener = new TestJMSEventMessageListener();
TextMessage msg = new DummyTextMessage();
msg.setText("one");
Event event = listener.eventFromTextMessage(msg);
assertNotNull(event);
assertEquals("NamedEvent[one]", ((NamedEvent) event).toString());
}
COM: <s> test extracting an </s>
|
funcom_train/13784491 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean containsDeployment(String deploymentName, CommonVersion version) {
if (deploymentName == null) {
throw new IllegalArgumentException("deploymentName argument can't be null");
}
if (version == null) {
throw new IllegalArgumentException("version argument can't be null");
}
return getDeploymentFolder(deploymentName, version).exists();
}
COM: <s> check to existing deployment in local temporary folder </s>
|
funcom_train/25842332 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public CommandHandler createHandlerFor(CommandType commandType) {
switch (commandType) {
case CALL:
return new CallCommandHandler(context);
case ANSWER:
return new AnswerCommandHandler(context);
case HANG_UP:
return new HangupCommandHandler(context);
case SEND_SMS:
return new SmsCommandHandler();
case DISCOVER:
return new DiscoveryCommandHandler(context);
// TODO: Other types
default:
return null;
}
}
COM: <s> creates and returns a command handler for the given command type </s>
|
funcom_train/6333541 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void realToThis(){
this.setTitle (m_real_song.getTitle());
this.setAuthor (m_real_song.getAuthor());
this.setCopyright (m_real_song.getCopyright());
this.setPublisher (m_real_song.getPublisher());
}
COM: <s> moves data values from the associated persistent song </s>
|
funcom_train/5154229 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double fisherExactTestUp(int k, int N, int D, int n) {
if( k == 0 ) return 1; // This line speeds up a lot of cases
double cumulativeHG = 0;
int maxTest = Math.min(n, D);
for( int i = k; i <= maxTest; i++ )
cumulativeHG += hd.hypergeometric(i, N, D, n);
return Math.min(cumulativeHG, 1.0);
}
COM: <s> fishers exact test for k or more upper tail </s>
|
funcom_train/43322430 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean configureXMPPAccount() {
if (xmppAccountStore == null)
SarosPluginContext.initComponent(this);
if (!xmppAccountStore.hasActiveAccount())
return (WizardUtils.openSarosConfigurationWizard() != null);
return (WizardUtils.openEditXMPPAccountWizard(xmppAccountStore
.getActiveAccount()) != null);
}
COM: <s> opens the appropriate </s>
|
funcom_train/14402042 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeKeyValues(K pKey, V[] pValueArray) {
w.lock();
try {
List<V> valueList = getValues(pKey);
for (V value : pValueArray) {
valueList.remove(value);
}
// delete mapping when list is empty
if (valueList.isEmpty()) {
iMap.remove(pKey);
} else {
iMap.put(pKey, valueList);
}
} finally {
w.unlock();
}
}
COM: <s> removes all passed values from the code list code associated with </s>
|
funcom_train/21844581 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void execute(final InstructionContext env) throws JBasicException {
final Value value2 = env.pop();
Value value1 = env.popForUpdate();
Expression.coerceTypes(value1, value2);
switch (value1.getType()) {
case Value.DECIMAL:
BigDecimal d1 = value1.getDecimal();
BigDecimal d2 = value2.getDecimal();
value1.setDecimal(d1.remainder(d2));
break;
case Value.DOUBLE:
value1.setDouble(value1.getDouble() % value2.getDouble());
break;
case Value.INTEGER:
value1.setInteger(value1.getInteger() % value2.getInteger());
break;
default:
throw new JBasicException(Status.TYPEMISMATCH);
}
env.push(value1);
}
COM: <s> divide top two items on stack push remainder modulo value back on the </s>
|
funcom_train/3491696 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double min() {
if (size() == 0) {
throw new IllegalStateException("cannot find minimum of an empty list");
}
double min = _data[_pos - 1];
for (int i = _pos - 1; i-- > 0;) {
if (_data[i] < min) {
min = _data[i];
}
}
return min;
}
COM: <s> finds the minimum value in the list </s>
|
funcom_train/15400234 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String getStdDevText() {
StringBuffer sb = new StringBuffer("Std. Dev.: ");
sb.append(TWO_DIGITS_FMT.format(getStdDev()));
if (_isCT) sb.append(" HU");
return(sb.toString());
}
COM: <s> returns string representation of sd </s>
|
funcom_train/323755 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean tableExists(EmptyTableDefinition tableDef) {
try {
DatabaseMetaData dbm = databaseControll.getConnection().getMetaData();
ResultSet tables = dbm.getTables(null, null, tableDef.getTableName(), null);
if (tables.next()) return true;
}
catch (SQLException e) {
System.out.println("Invalid table name " + tableDef.getTableName());
e.printStackTrace();
}
return false;
}
COM: <s> check a database table exists </s>
|
funcom_train/19682196 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public NeuralNet restoreNeuralNet(String fileName) {
NeuralNet nnet = null;
try {
FileInputStream stream = new FileInputStream(fileName);
ObjectInput input = new ObjectInputStream(stream);
nnet = (NeuralNet) input.readObject();
} catch (Exception e) {
log.warn("Exception was thrown. Message is : " + e.getMessage(), e);
}
return nnet;
}
COM: <s> restore a nnet from a file </s>
|
funcom_train/39167811 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Set getLanguages() {
Set result = new HashSet();
for ( int i = 0 ; i < nodes.size() ; i++ ) {
String lang = ((LinearNode)nodes.get(i)).getLanguage();
if (null!=lang)
result.add(lang);
}
result.add("");
return result;
} // getMinors()
COM: <s> gets the set of all languages in this definition </s>
|
funcom_train/27755298 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setHRDSchema(String schemaid) {
for(int idx = 0; idx < hrdSchema.getItemCount(); idx++){
final String entry = hrdSchema.getItem(idx);
if (hrdSchema.getData(entry).equals(schemaid)){
hrdSchema.select(idx);
}
}
}
COM: <s> set currently selected hrd schema in list </s>
|
funcom_train/4470406 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void setSession(ClientSession session) {
DataManager dataMgr = AppContext.getDataManager();
dataMgr.markForUpdate(this);
if(session == null){
currentSessionRef = null;
}
else {
currentSessionRef = dataMgr.createReference(session);
}
logger.log(Level.INFO, "Set session for {0} to {1}", new Object[] { this, session });
}
COM: <s> mark this player as logged in on the given session </s>
|
funcom_train/28749770 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setPosition(Long newVal) {
if ((newVal != null && this.position != null && (newVal.compareTo(this.position) == 0)) ||
(newVal == null && this.position == null && position_is_initialized)) {
return;
}
this.position = newVal;
position_is_modified = true;
position_is_initialized = true;
}
COM: <s> setter method for position </s>
|
funcom_train/44467230 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void putObject(final Token token, final Object obj){
//Place the object in a map so only 1 object is made per token
//A weak reference ensures that this map will not
//keep the object around if no other object has a hard reference to the object
tokenMap.put(token, new TokenMapEntry(token, obj, referenceQueue));
}
COM: <s> puts an object into the cache associated with the provided token </s>
|
funcom_train/14059621 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void userAdvance() {
if ((this.getSelectedColumn() == (this.getColumnCount() - 1))
&& (this.getSelectedRow() == (this.getRowCount() - 1))) {
this.commit();
this.userAddRow();
}
}
COM: <s> advance one field by the user </s>
|
funcom_train/50084895 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void build() throws QSARModelException {
try {
this.modelfit = (CNNClassificationModelFit)revaluator.call("buildCNNClass",
new Object[]{ getModelName(), this.params });
} catch (Exception re) {
throw new QSARModelException(re.toString());
}
}
COM: <s> fits a cnn classification model </s>
|
funcom_train/21844165 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JComboBox getWeatherStationComboBox() {
if (weatherStationComboBox == null) {
weatherStationComboBox = new JComboBox();
weatherStationComboBox.setLocation(new java.awt.Point(134,93));
weatherStationComboBox.setSize(new java.awt.Dimension(151,19));
weatherStationComboBox.addItem("Davis vantage Pro");
weatherStationComboBox.addItem("Davis vantage Pro 2");
}
return weatherStationComboBox;
}
COM: <s> this method initializes weather station combo box </s>
|
funcom_train/10512693 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setResolvemode(String resolvemode) {
boolean found = false;
for (int counter = 0; counter < RESOLVE_MODES.length; counter++) {
if (resolvemode.equals(RESOLVE_MODES[counter])) {
found = true;
break;
}
}
if (!found) {
throw new BuildException("Unacceptable value for resolve mode");
}
this.resolvemode = resolvemode;
}
COM: <s> values for resolvemode </s>
|
funcom_train/3535372 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getLocalVersion(RemoteFile remoteFile) {
File file = getLocalFile(remoteFile);
if (file.exists()) {
try {
Entry entry = _handler.getEntry(file);
if (entry == null) {
return null;
} else {
return entry.getRevision();
}
} catch (IOException ex) {
// ignore
ex.printStackTrace();
return null;
}
} else {
return null;
}
}
COM: <s> returns the local version of the remote file </s>
|
funcom_train/49103787 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isNonSymmetricFault() {
AcscRunForm form = EditorSimuSpringCtx.getAcscRunForm();
if (form != null && form.getXmlCaseData() != null && form.getXmlCaseData().getFaultData() != null)
return form.getXmlCaseData().getFaultData().getFaultCategory() != AcscFaultCategoryDataType.FAULT_3_P;
else
return false;
}
COM: <s> check if the current acsc run form has a non symmetric fault </s>
|
funcom_train/40885101 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Animation (float frameDuration, List keyFrames) {
this.frameDuration = frameDuration;
this.keyFrames = new TextureRegion[keyFrames.size()];
for(int i = 0, n = keyFrames.size(); i < n; i++) {
this.keyFrames[i] = (TextureRegion)keyFrames.get(i);
}
}
COM: <s> constructor storing the frame duration and key frames </s>
|
funcom_train/34562490 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initRootStat() {
rootStat = new DeepStat();
rootStat.statimespec = System.currentTimeMillis();
rootStat.stctimespec = rootStat.statimespec;
rootStat.stmtimespec = rootStat.statimespec;
rootStat.stmode = getSIFDIR() | 0755;
rootStat.stsize = 0;
rootStat.stuid = sUID;
rootStat.stgid = sGID;
rootStat.stnlink = 0;
rootStat.stino = 1;
}
COM: <s> initializes default file attributes for root access </s>
|
funcom_train/21022525 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void refreshUsersInRoom(final String room) {
if (chatRoomActive) {
chatService.usersInRoom(room, new AsyncCallback<String>() {
@Override
public void onSuccess(String result) {
usersInRoomText.setHTML("(" + result +") " + Main.i18n("chat.users.in.room"));
Timer timer = new Timer() {
@Override
public void run() {
refreshUsersInRoom(room);
}
};
timer.schedule(DELAY_USERS_IN_ROOM);
}
@Override
public void onFailure(Throwable caught) {
Main.get().showError("UsersInRoom", caught);
}
});
}
}
COM: <s> refresh users in room </s>
|
funcom_train/37406327 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void leaveElement(String name) throws MonsterException {
Level level = stack.pop();
if (!level.node.getNodeName().equals(name))
throw new MonsterException("Expected ending tag '" + name
+ "' not found (instead '" + level.node.getNodeName()
+ " would be valid).");
level = stack.lastElement();
NodeList list = level.node.getChildNodes();
level.currentIndex++;
}
COM: <s> leaves scope of given element throws exception if wanted tag was not </s>
|
funcom_train/32059548 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Dimension getPreferredSize(JComponent jcomponent) {
Dimension dimension = getPreferredMinSize();
if (!validCachedPreferredSize) {
updateCachedPreferredSize();
}
if (graph != null) {
if (dimension != null) {
return new Dimension(Math.max(dimension.width,
preferredSize.width), Math.max(dimension.height,
preferredSize.height));
} else {
return new Dimension(preferredSize.width, preferredSize.height);
}
}
if (dimension != null) {
return dimension;
} else {
return new Dimension(0, 0);
}
}
COM: <s> returns the preferred size for the specified jcomponent </s>
|
funcom_train/44492685 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public HtmlElement getHtmlElementByXPath(String xpath) {
HtmlElement element;
if ( xpath != null ) {
element = getHtmlElementByXPath((HtmlPage)getCurrentPage(), xpath);
} else {
throw new RuntimeException("xpath was null! Supply an xpath expression.");
}
return element;
}
COM: <s> gets an html element matching the provided xpath expression </s>
|
funcom_train/25197767 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void test(String in, int len) throws Exception {
p.push(new TString(in, null));
new NumNames("num.names$").execute(p, null, null);
assertEquals(len, p.popInteger(null).getInt());
assertNull(p.popUnchecked());
}
COM: <s> run a single test </s>
|
funcom_train/31467274 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object visit(ArrayAccess node) {
Object t = node.getExpression().acceptVisitor(this);
Object o = node.getCellNumber().acceptVisitor(this);
if (o instanceof Character) {
o = new Integer(((Character)o).charValue());
}
return Array.get(t, ((Number)o).intValue());
}
COM: <s> visits an array access </s>
|
funcom_train/21087365 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public SNI createSNI(IPath path) {
createResource(path);
// Create a new workflow model
Map registry = EPackage.Registry.INSTANCE;
String SNI_URI = SNI_Package.eNS_URI;
SNI_Package wfPackage = (SNI_Package) registry.get( SNI_URI );
SNI_Factory wfFactory = wfPackage.getSNI_Factory();
sni = wfFactory.createSNI();
resource.getContents().add( sni );
return sni;
}
COM: <s> creates a new workflow </s>
|
funcom_train/31166715 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void decode(ASNReader is) throws IOException {
String cn = this.getClass().getName();
cat.debug("==> "+cn+".decode()");
is.mark(Integer.MAX_VALUE);
try {
is.decodeNull(this);
} catch (IOException x) {
cat.warn("Exception ("+String.valueOf(x)+") encountered while decoding a "+cn);
if (x instanceof ASNException || x instanceof EOFException) {
cat.warn("Resetting input stream...");
is.reset();
}
throw x;
}
cat.debug("<== "+cn+".decode()");
}
COM: <s> decodes a null from an input stream </s>
|
funcom_train/15858960 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void bind() throws LDAPException, IllegalArgumentException {
if (!this.ldapConnection.isBound()) {
switch (this.bindingMethod) {
case BIND_NONE:
this.bindAnonymous();
break;
case BIND_SIMPLE:
this.bindSimple();
break;
case BIND_SSL:
this.bindSSL();
break;
case BIND_MD5:
this.bindMD5();
break;
default:
throw new IllegalArgumentException("Unknown binding method: " + String.valueOf(this.bindingMethod));
}
}
}
COM: <s> authenticates after a connection was established </s>
|
funcom_train/30035301 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void sqlDuplicateError(HttpServletRequest request, String objName) {
ActionErrors aes = new ActionErrors();
aes.add(aes.GLOBAL_ERROR,
new ActionError("errors.database.duplicate", objName));
saveErrors(request, aes);
if (__log.isErrorEnabled()) {
__log.error(" [Post] Duplicate key Error - " + objName);
}
}
COM: <s> this method is called when a duplicate post is attempted to be saved </s>
|
funcom_train/17566337 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createContents() {
frame = new JFrame();
frame.setBounds(100, 100, 500, 375);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
final JMenuItem newItemMenuItem = new JMenuItem();
newItemMenuItem.addMouseListener(new MouseAdapter() {
public void mouseClicked(final MouseEvent arg0) {
button.getChangeListeners();
}
});
newItemMenuItem.setText("New Item");
}
COM: <s> initialize the contents of the frame </s>
|
funcom_train/48991669 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private PsiClass findContainingClass(PsiElement element) {
if (element instanceof PsiMethod)
{
return ((PsiMethod) element).getContainingClass();
}
PsiElement parent = element.getParent();
if (parent == null)
{
log.info(element + " has null parent");
return null;
}
return findContainingClass(parent);
}
COM: <s> locates the class containing the provided element </s>
|
funcom_train/5785452 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void execute() throws BuildException {
loadLibraryXml();
if (name == null)
throw new BuildException("Name cannot be null.");
if (library == null)
throw new BuildException("Library cannot be null.");
this.project = target.getProject();
String path = findLibrary(library, version);
if (path == null)
throw new BuildException("Library '"+library+"' was not defined in library.xml.");
addProperty(name, path);
}
COM: <s> main workhorse method </s>
|
funcom_train/8353000 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private IoBuffer encodeInitialGreetingPacket(final SocksProxyRequest request) {
byte nbMethods = (byte) SocksProxyConstants.SUPPORTED_AUTH_METHODS.length;
IoBuffer buf = IoBuffer.allocate(2 + nbMethods);
buf.put(request.getProtocolVersion());
buf.put(nbMethods);
buf.put(SocksProxyConstants.SUPPORTED_AUTH_METHODS);
return buf;
}
COM: <s> encodes the initial greeting packet </s>
|
funcom_train/33281515 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object jsxGet_tBodies() {
if (tBodies_ == null) {
final HtmlTable table = (HtmlTable) getDomNodeOrDie();
tBodies_ = new HTMLCollection(table, false, "HTMLTableElement.tBodies") {
@Override
protected List<Object> computeElements() {
return new ArrayList<Object>(table.getBodies());
}
};
}
return tBodies_;
}
COM: <s> returns the tbodys in the table </s>
|
funcom_train/5794425 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String getRedirectString(HttpServletRequest request) {
String redirectValue = request.getParameter("redirect");
if (redirectValue != null) {
return (redirectValue);
}
redirectValue = this.redirectSuccess;
String redirectParms = request.getParameter("redirectParms");
if (redirectParms != null) {
StringBuffer buffer = new StringBuffer(this.redirectSuccess);
buffer.append("?");
buffer.append(redirectParms);
redirectValue = buffer.toString();
}
return (redirectValue);
}
COM: <s> convenience method for dynamically creating the redirect url if </s>
|
funcom_train/13185888 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Stroke getSectionOutlineStroke(int section) {
// return the override, if there is one...
if (this.sectionOutlineStroke != null) {
return this.sectionOutlineStroke;
}
// otherwise look up the paint list
Stroke result = this.sectionOutlineStrokeList.getStroke(section);
if (result == null) {
result = this.baseSectionOutlineStroke;
}
return result;
}
COM: <s> returns the stroke for the specified section </s>
|
funcom_train/1491585 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ModelAndView preparingDownload(HttpServletRequest request, HttpServletResponse response) throws Exception {
//retrieve file name
String fileName = request.getParameter(downloadFileRequestKey);
String viewName = ServletRequestUtils.getStringParameter(request, "view", prepareView);
ModelAndView mav = new ModelAndView(viewName);
mav.addObject("fileName", fileName);
addFilePropertiesToRequest(mav, fileName, null);
return mav;
}
COM: <s> directs view to a preparing page </s>
|
funcom_train/49211293 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String writeToString(String sep,edu.uci.ics.jung.graph.Graph<Integer, Number> graph){
Collection<Number> c = graph.getEdges();
String out ="";
for(Number n : c)
out += graph.getEndpoints(n).getFirst() + sep + graph.getEndpoints(n).getSecond() + sep + "1.0\n";
return (out);
}
COM: <s> writes a edu </s>
|
funcom_train/50237718 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void centerOnScreen() {
Dimension screenDimension = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
Dimension frameDimension = getSize();
setLocation( (screenDimension.width-frameDimension.width)/2,
(screenDimension.height-frameDimension.height)/2 );
}
COM: <s> centers this code base dialog code on screen </s>
|
funcom_train/17922624 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Properties exampleConfig() {
Properties prop = new Properties();
prop.put("ip","192.168.1.5");
prop.put("port","21");
prop.put("savepath","C:\\\\testok.txt");
prop.put("requestpath","C:\\\\test.txt");
return prop;
}
COM: <s> returns example properties key value pairs </s>
|
funcom_train/46825382 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Player getPlayer (int seatNum) {
Vector players = getPlayers ();
// Get read lock (no one is currently writing)
rwLock.getReadLock();
// Loop through all the players until you get the correct player
for (int i = 0; i < players.size(); i++) {
Player player = (Player)players.get(i);
if (player.getSeatNum() == seatNum) {
rwLock.release();
return player;
}
}
rwLock.release();
return null;
}
COM: <s> return a player from a seat number </s>
|
funcom_train/17774183 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int spacesAvailable( SquareBoard board ) {
int spaces = 0;
for ( int y = board.getBoardHeight(); y > 0; y-- )
// If this line is not full then it has holes
if ( !board.isLineFull(y) )
for ( int x = 0; x < board.getBoardWidth(); x++ )
if ( board.isSquareEmpty(x, y) )
spaces++;
return spaces;
}
COM: <s> find the number of spaces available in the given board </s>
|
funcom_train/4519994 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void flipVertically() {
int width = bufferedImage.getWidth();
int height = bufferedImage.getHeight();
BufferedImage result = new BufferedImage(width, height,
BufferedImage.TYPE_INT_BGR);
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
int rgb = bufferedImage.getRGB(x, y);
result.setRGB(x, height - y - 1, rgb);
}
}
bufferedImage = result;
}
COM: <s> flips the image vertically </s>
|
funcom_train/37520090 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void createObject(JPanel optionPanel) {
JLabel label = new JLabel(longname);
label.setToolTipText(help);
constraints.gridx = 0;
constraints.gridy = row;
constraints.insets = noInsets;
constraints.weightx = 0.1;
gridbaglayout.setConstraints(label, constraints);
optionPanel.add(label);
}
COM: <s> adds the label of the object to the layout </s>
|
funcom_train/33072171 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void validateContainer(JSFProject project,IContainer folder){
try {
IResource[] resources = folder.members();
for(int i=0;i<resources.length;i++){
if(resources[i] instanceof IFile){
if(resources[i].getName().endsWith(".jsp")){
validateJSP(project,getProject().getFile(resources[i].getProjectRelativePath()));
}
} else if(resources[i] instanceof IContainer){
validateContainer(project,(IContainer)resources[i]);
}
}
} catch(Exception ex){
}
}
COM: <s> validate jsp files which contains by the container </s>
|
funcom_train/49247055 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void write(String characterID, Map<String, String> attributesOld, Map<String, Object> attributesNew) {
if (logger.isDebugEnabled()) {
logger.debug("--------");
logger.debug(attributesOld);
logger.debug(attributesNew);
logger.debug(extractChanges(attributesOld, attributesNew));
}
Map<String, Object> data = extractChanges(attributesOld, attributesNew);
deleteOutdatedAttributes(characterID, data);
insertNewAttributes(characterID, data);
}
COM: <s> writes the changed attributes for this character </s>
|
funcom_train/8022918 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void scan() {
try {
TokenValue v = new TokenValue(in);
while (v.valid) {
tokens.put(new Integer(pos), new TokenInformation(v.token,
v.length));
pos += v.length;
v = new TokenValue(in);
}
} catch (IOException e) {
e.printStackTrace();
}
}
COM: <s> scan the whole document and put token information to hashtable </s>
|
funcom_train/9345472 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void connect(String host, int port) throws IOException {
assert myChannel == null;
// create channel
try {
myChannel = SocketChannel.open();
myChannel.configureBlocking(false);
myChannel.connect(new InetSocketAddress(host, port));
myChannel.register(mySelector, myChannel.validOps());
//start thread
_start();
} catch (IOException e) {
myChannel = null;
throw e;
}
}
COM: <s> sends connection request to server </s>
|
funcom_train/35675120 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void jaxbgenAndCheck(final File schemaFile) throws Exception {
String schemaName = FilenameUtils.getBaseName(schemaFile.getName())
.toLowerCase();
jaxbgen(schemaName, schemaFile, true, 1L, true, null, null, null, null,
false, false);
check(schemaName);
}
COM: <s> a helper method to check generated code against reference </s>
|
funcom_train/46678955 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toXML(){
StringBuffer buffer = new StringBuffer();
buffer.append("<it-label formatref=\"");
buffer.append(getFormat().getID());
buffer.append("\">");
buffer.append(super.toXML());
buffer.append("</it-label>");
return buffer.toString();
}
COM: <s> returns the xml representation of this object </s>
|
funcom_train/25467501 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void onClick(DialogInterface dialog, int item) {
Item loc = locations.getItems().get(item);
if(departLocation){
startLocation = new Position(loc.getLon(), loc.getLat());
}
else{
stopLocation = new Position(loc.getLon(), loc.getLat());
}
btnNext.setEnabled(true);
if (departLocation){
imgValid2.setVisibility(View.GONE);
imgValid1.setVisibility(0);
}else{
imgValid3.setVisibility(0);
}
}
COM: <s> when a location from a list is clicked </s>
|
funcom_train/38589830 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void init() {
setLayout(new BorderLayout());
// configure basic window settings.
buildMainWindowBase();
// Menu Panel
setJMenuBar(initMenu());
// Content Panel
getContentPane().add(initContentPanel(),BorderLayout.CENTER);
// Status Bar ?
getContentPane().add(buildStatusBar(), BorderLayout.SOUTH);
// do this when all GUI Controls are created set Look&Feel.
initPopUpMenuFileInput();
}
COM: <s> common initialization of this window </s>
|
funcom_train/12128109 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void buildShape() {
if(grappaNexus == null) {
grappaNexus = new GrappaNexus(this);
Attribute attr = null;
Enumeration enm = listAttrsOfInterest();
while(enm.hasMoreElements()) {
attr = getAttribute((String)enm.nextElement());
if(attr != null) {
attr.addObserver(grappaNexus);
}
}
}
if(grappaNexus == null) {
throw new InternalError("grappaNexus did not get created");
}
}
COM: <s> creates and populates the grappa nexus object for this element </s>
|
funcom_train/9408721 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testToArray() {
ConcurrentLinkedQueue q = populatedQueue(SIZE);
Object[] o = q.toArray();
Arrays.sort(o);
for(int i = 0; i < o.length; i++)
assertEquals(o[i], q.poll());
}
COM: <s> to array contains all elements </s>
|
funcom_train/18079105 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void add(final T pojo) throws IOException {
final Document document = new Document();
addPojoToDocument(pojo, document);
synchronized (getDirectory()) {
final IndexWriter writer = new IndexWriter(getDirectory(), getAnalyzer(), false);
writer.addDocument(document);
writer.optimize();
writer.close();
}
}
COM: <s> adds a single pojo to the lucene index </s>
|
funcom_train/18868665 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private BigDecimal getReconciledTreeBalance(final CurrencyNode node) {
Lock l = transactionLock.readLock();
l.lock();
Lock cLock = childLock.readLock();
cLock.lock();
try {
BigDecimal balance = getReconciledBalance(node);
for (Account child : children) {
balance = balance.add(child.getReconciledTreeBalance(node));
}
return balance;
} finally {
l.unlock();
cLock.unlock();
}
}
COM: <s> returns the reconciled balance of the account plus any child accounts </s>
|
funcom_train/31303789 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void print( boolean immediately ) {
setBusy();
try {
print( immediately, rpo );
setReady();
} catch (Throwable t) {
setReady();
showExceptionDialog(getDesc("error"),getDesc("invoice_access_error"), t, false);
}
}
COM: <s> print the invoice </s>
|
funcom_train/12675084 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void makeElseBlock(SymTabAST tree) {
if (tree.getType() == TokenTypes.SLIST) {
BlockDef block = makeBlock(tree);
symbolTable.pushScope( block );
walkTree(tree, false);
symbolTable.popScope();
}
else {
walkTree(tree, false);
}
}
COM: <s> defines an anonymous block to enclose the scope of an else block </s>
|
funcom_train/13504538 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void waitForLockAccepted() {
int maxWait = 3;
for (int i = 0; i < maxWait; i++) {
if (lockAcceptedFile.exists()) {
return;
}
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
fail("Lock was not accepted after " + maxWait + " seconds.");
}
COM: <s> wait until the lock is accepted or until the time runs out </s>
|
funcom_train/18481435 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public View instantiateView(Model f) {
ViewInstantiator cons = instantiators.get(f.getClass()) ;
if (cons == null) {
throw new RuntimeException("No match for "+f.getClass()) ;
}
View v = cons.instantiate(f, this) ;
v.postinit() ;
return v ;
}
COM: <s> returns a view based upon the model </s>
|
funcom_train/22864880 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isUpToDate() {
if (changeMask != 0)
return false;
else if ((shader != null) &&
(((shader instanceof Material) && ((Material)shader).getStamp() != shaderStamp)) ||
((shader instanceof RGBAShader) && ((RGBAShader)shader).getStamp() != shaderStamp))
return false;
else
return super.isUpToDate();
}
COM: <s> check if this code gl20 resource shader code is up to date </s>
|
funcom_train/33336092 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected ObjectData encodeObject(final NakedObject adapter) {
// REVIEW: this implementation is a bit of a hack...
Data[] datas = getObjectEncoder().encodeActionParameters(
new NakedObjectSpecification[] { adapter.getSpecification() },
new NakedObject[] { adapter },
new KnownObjectsRequest());
return (ObjectData) datas[0];
}
COM: <s> convenience method for any implementations that need to map over </s>
|
funcom_train/17362876 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void showSaveListDialog(){
JFileChooser fch = getFileChooser();
String [] filters = {"pls"};
eff = InitiateFileFilter(filters, "MP3 music");
fch.setFileFilter(eff);
fch.setMultiSelectionEnabled(false);
fch.setFileSelectionMode(JFileChooser.FILES_ONLY);
fch.setDragEnabled(false);
int returnVal = fch.showSaveDialog(me());
if (returnVal == JFileChooser.APPROVE_OPTION){
SavePlayList(fch.getSelectedFile(), true);
}
}
COM: <s> shows dialog for saving playlist </s>
|
funcom_train/5166321 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getFunction(int a_index) {
CommandGene[] functions = getFunctions();
int len = functions.length;
for (int j = 0; j < len && functions[j] != null; j++) {
if (functions[j].getArity(m_ind) != 0) {
if (--a_index < 0) {
return j;
}
}
}
return -1;
}
COM: <s> gets the a indexth function in this chromosome </s>
|
funcom_train/9361247 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void writeToParcel(Parcel p, int flags) {
checkRecycled("Can't parcel a recycled bitmap");
if (!nativeWriteToParcel(mNativeBitmap, mIsMutable, mDensity, p)) {
throw new RuntimeException("native writeToParcel failed");
}
}
COM: <s> write the bitmap and its pixels to the parcel </s>
|
funcom_train/18014853 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public FeatureGraph () {
featureInstances = new HashMap <Feature, List <Instance>> ();
neighborMap = new HashMap <Variable, Map <Variable, Integer>> ();
observed = new HashSet <Variable> ();
unobserved = new HashSet <DiscreteVariable> ();
variableInstances = new HashMap <Variable, List <Instance>>();
weightMap = new HashMap <Feature, Double> ();
}
COM: <s> default constructor instanciates empty feature graph </s>
|
funcom_train/5862220 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Namespace getCurrent() {
if (!_nss.isEmpty()) {
Object o = _nss.get(0);
if (o == Objects.UNKNOWN)
return null; //no namespace allowed
if (o != null)
return (Namespace)o;
//we assume owner's namespace if null, because zscript might
//define a class that will be invoke thru, say, event listener
//In other words, interpret is not called, so ns is not specified
}
return Namespaces.getCurrent(_owner); //never null
}
COM: <s> returns the current namespace or null if no namespace is allowed </s>
|
funcom_train/28124376 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void refreshTree(javax.swing.JTree tree) {
javax.swing.tree.TreePath selections[] = tree.getSelectionPaths();
javax.swing.tree.TreeModel m = tree.getModel();
tree.setModel(null);
tree.setModel(m);
tree.setSelectionPaths(selections);
}
COM: <s> refresh a tree </s>
|
funcom_train/51752418 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setImageDimension(final int width, final int height) {
widthImage = width;
heightImage = height;
plotRelation = (double) heightImage / widthImage;
panFractal.setBounds(0, 0, widthImage, heightImage);
panFractal.setPreferredSize(panFractal.getSize());
setNoOfThreads(noOfThreads);
}//setImageWidth()
COM: <s> set width and height of image in pixels </s>
|
funcom_train/19811080 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public CompletionTask createDocumentationTask() {
return new AsyncCompletionTask( new AsyncCompletionQuery() {
protected void query(CompletionResultSet completionResultSet, Document document, int i) {
completionResultSet.setDocumentation(new HatomCompletionDocumentation(HatomCompletionItem.this));
completionResultSet.finish();
}
} );
}
COM: <s> creates and returns an asynchronous completion task with an included documentation panel </s>
|
funcom_train/29606991 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setViewConfiguration(ViewConfigurationModel newVc) {
edgeType = newVc.getEdgeType();
colorFunction = newVc.getColorFunction();
layout = newVc.getLayout();
dividerLocation = newVc.getDividerLocation();
log.finer("set dividerLocation=" + dividerLocation);
notifyViewConfigurationChange();
}
COM: <s> applies the view configuration of code new vc code to this one </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.