method
stringlengths 13
441k
| clean_method
stringlengths 7
313k
| doc
stringlengths 17
17.3k
| comment
stringlengths 3
1.42k
| method_name
stringlengths 1
273
| extra
dict | imports
list | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
list | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
|---|---|---|---|---|---|---|---|---|---|---|---|
public void requestAuthenticationOfClient(int accountId, AionConnection client, int loginOk, int playOk1, int playOk2) {
if (loginServer == null || loginServer.getState() != State.AUTHED) {
log.warn("LS !!! " + (loginServer == null ? "NULL" : loginServer.getState()));
// TODO! somme error packet!
client.close(true);
return;
}
synchronized (this) {
if (loginRequests.containsKey(accountId))
return;
loginRequests.put(accountId, client);
}
loginServer.sendPacket(new SM_ACCOUNT_AUTH(accountId, loginOk, playOk1, playOk2));
}
|
void function(int accountId, AionConnection client, int loginOk, int playOk1, int playOk2) { if (loginServer == null loginServer.getState() != State.AUTHED) { log.warn(STR + (loginServer == null ? "NULL" : loginServer.getState())); client.close(true); return; } synchronized (this) { if (loginRequests.containsKey(accountId)) return; loginRequests.put(accountId, client); } loginServer.sendPacket(new SM_ACCOUNT_AUTH(accountId, loginOk, playOk1, playOk2)); }
|
/**
* Starts authentication procedure of this client - LoginServer will sends response with information about account
* name if authentication is ok.
*
* @param accountId
* @param client
* @param loginOk
* @param playOk1
* @param playOk2
*/
|
Starts authentication procedure of this client - LoginServer will sends response with information about account name if authentication is ok
|
requestAuthenticationOfClient
|
{
"repo_name": "Estada1401/anuwhscript",
"path": "GameServer/src/com/aionemu/gameserver/network/loginserver/LoginServer.java",
"license": "gpl-3.0",
"size": 12964
}
|
[
"com.aionemu.gameserver.network.aion.AionConnection",
"com.aionemu.gameserver.network.loginserver.LoginServerConnection"
] |
import com.aionemu.gameserver.network.aion.AionConnection; import com.aionemu.gameserver.network.loginserver.LoginServerConnection;
|
import com.aionemu.gameserver.network.aion.*; import com.aionemu.gameserver.network.loginserver.*;
|
[
"com.aionemu.gameserver"
] |
com.aionemu.gameserver;
| 2,012,334
|
public com.mozu.api.contracts.productadmin.AttributeLocalizedContent addLocalizedContent(com.mozu.api.contracts.productadmin.AttributeLocalizedContent localizedContent, String attributeFQN, String responseFields) throws Exception
{
MozuClient<com.mozu.api.contracts.productadmin.AttributeLocalizedContent> client = com.mozu.api.clients.commerce.catalog.admin.attributedefinition.attributes.AttributeLocalizedContentClient.addLocalizedContentClient( localizedContent, attributeFQN, responseFields);
client.setContext(_apiContext);
client.executeRequest();
return client.getResult();
}
|
com.mozu.api.contracts.productadmin.AttributeLocalizedContent function(com.mozu.api.contracts.productadmin.AttributeLocalizedContent localizedContent, String attributeFQN, String responseFields) throws Exception { MozuClient<com.mozu.api.contracts.productadmin.AttributeLocalizedContent> client = com.mozu.api.clients.commerce.catalog.admin.attributedefinition.attributes.AttributeLocalizedContentClient.addLocalizedContentClient( localizedContent, attributeFQN, responseFields); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); }
|
/**
* Adds new localized content for an attribute based on a `localeCode`.
* <p><pre><code>
* AttributeLocalizedContent attributelocalizedcontent = new AttributeLocalizedContent();
* AttributeLocalizedContent attributeLocalizedContent = attributelocalizedcontent.addLocalizedContent( localizedContent, attributeFQN, responseFields);
* </code></pre></p>
* @param attributeFQN Fully qualified name for an attribute.
* @param responseFields Use this field to include those fields which are not included by default.
* @param dataViewMode DataViewMode
* @param localizedContent The localized name and description of the attribute, displayed in the locale defined for the master catalog.
* @return com.mozu.api.contracts.productadmin.AttributeLocalizedContent
* @see com.mozu.api.contracts.productadmin.AttributeLocalizedContent
* @see com.mozu.api.contracts.productadmin.AttributeLocalizedContent
*/
|
Adds new localized content for an attribute based on a `localeCode`. <code><code> AttributeLocalizedContent attributelocalizedcontent = new AttributeLocalizedContent(); AttributeLocalizedContent attributeLocalizedContent = attributelocalizedcontent.addLocalizedContent( localizedContent, attributeFQN, responseFields); </code></code>
|
addLocalizedContent
|
{
"repo_name": "bhewett/mozu-java",
"path": "mozu-java-core/src/main/java/com/mozu/api/resources/commerce/catalog/admin/attributedefinition/attributes/AttributeLocalizedContentResource.java",
"license": "mit",
"size": 12358
}
|
[
"com.mozu.api.MozuClient"
] |
import com.mozu.api.MozuClient;
|
import com.mozu.api.*;
|
[
"com.mozu.api"
] |
com.mozu.api;
| 1,590,132
|
private void parseIncludeAttributes(String layoutFile, AXmlNode rootNode) {
for (Entry<String, AXmlAttribute<?>> entry : rootNode.getAttributes().entrySet()) {
String attrName = entry.getKey().trim();
AXmlAttribute<?> attr = entry.getValue();
if (attrName.equals("layout")) {
if ((attr.getType() == AxmlVisitor.TYPE_REFERENCE || attr.getType() == AxmlVisitor.TYPE_INT_HEX)
&& attr.getValue() instanceof Integer) {
// We need to get the target XML file from the binary manifest
AbstractResource targetRes = resParser.findResource((Integer) attr.getValue());
if (targetRes == null) {
System.err.println("Target resource " + attr.getValue() + " for layout include not found");
return;
}
if (!(targetRes instanceof StringResource)) {
System.err.println("Invalid target node for include tag in layout XML, was "
+ targetRes.getClass().getName());
return;
}
String targetFile = ((StringResource) targetRes).getValue();
// If we have already processed the target file, we can
// simply copy the callbacks we have found there
if (callbackMethods.containsKey(targetFile))
for (String callback : callbackMethods.get(targetFile))
addCallbackMethod(layoutFile, callback);
else {
// We need to record a dependency to resolve later
addToMapSet(includeDependencies, targetFile, layoutFile);
}
}
}
}
}
|
void function(String layoutFile, AXmlNode rootNode) { for (Entry<String, AXmlAttribute<?>> entry : rootNode.getAttributes().entrySet()) { String attrName = entry.getKey().trim(); AXmlAttribute<?> attr = entry.getValue(); if (attrName.equals(STR)) { if ((attr.getType() == AxmlVisitor.TYPE_REFERENCE attr.getType() == AxmlVisitor.TYPE_INT_HEX) && attr.getValue() instanceof Integer) { AbstractResource targetRes = resParser.findResource((Integer) attr.getValue()); if (targetRes == null) { System.err.println(STR + attr.getValue() + STR); return; } if (!(targetRes instanceof StringResource)) { System.err.println(STR + targetRes.getClass().getName()); return; } String targetFile = ((StringResource) targetRes).getValue(); if (callbackMethods.containsKey(targetFile)) for (String callback : callbackMethods.get(targetFile)) addCallbackMethod(layoutFile, callback); else { addToMapSet(includeDependencies, targetFile, layoutFile); } } } } }
|
/**
* Parses the attributes required for a layout file inclusion
* @param layoutFile The full path and file name of the file being parsed
* @param rootNode The AXml node containing the attributes
*/
|
Parses the attributes required for a layout file inclusion
|
parseIncludeAttributes
|
{
"repo_name": "uds-se/soot-infoflow-android",
"path": "src/soot/jimple/infoflow/android/resources/LayoutFileParser.java",
"license": "lgpl-2.1",
"size": 16793
}
|
[
"java.util.Map"
] |
import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 335,430
|
void onAudioTrackInitializationError(AudioTrack.InitializationException e);
|
void onAudioTrackInitializationError(AudioTrack.InitializationException e);
|
/**
* Invoked when the {@link AudioTrack} fails to initialize.
*
* @param e The corresponding exception.
*/
|
Invoked when the <code>AudioTrack</code> fails to initialize
|
onAudioTrackInitializationError
|
{
"repo_name": "PavelSynek/ExoPlayer",
"path": "extensions/opus/src/main/java/com/google/android/exoplayer/ext/opus/LibopusAudioTrackRenderer.java",
"license": "apache-2.0",
"size": 12940
}
|
[
"com.google.android.exoplayer.audio.AudioTrack"
] |
import com.google.android.exoplayer.audio.AudioTrack;
|
import com.google.android.exoplayer.audio.*;
|
[
"com.google.android"
] |
com.google.android;
| 2,679,930
|
@Test(timeout = 30000, expected=IllegalStateException.class)
public void testCreateQueueOnTopicSession() throws JMSException {
topicSession.createQueue("test-queue");
}
|
@Test(timeout = 30000, expected=IllegalStateException.class) void function() throws JMSException { topicSession.createQueue(STR); }
|
/**
* Test that a call to <code>createQueue()</code> method
* on a <code>TopicSession</code> throws a
* <code>javax.jms.IllegalStateException</code>.
* (see JMS 1.1 specs, table 4-1).
*
* @since JMS 1.1
*
* @throws JMSException if an error occurs during the test.
*/
|
Test that a call to <code>createQueue()</code> method on a <code>TopicSession</code> throws a <code>javax.jms.IllegalStateException</code>. (see JMS 1.1 specs, table 4-1)
|
testCreateQueueOnTopicSession
|
{
"repo_name": "gemmellr/qpid-jms",
"path": "qpid-jms-client/src/test/java/org/apache/qpid/jms/session/JmsTopicSessionTest.java",
"license": "apache-2.0",
"size": 5688
}
|
[
"javax.jms.IllegalStateException",
"javax.jms.JMSException",
"org.junit.Test"
] |
import javax.jms.IllegalStateException; import javax.jms.JMSException; import org.junit.Test;
|
import javax.jms.*; import org.junit.*;
|
[
"javax.jms",
"org.junit"
] |
javax.jms; org.junit;
| 2,725,828
|
public static ResourceBundle getReportResourceBundle( )
{
return RESOURCE_BUNDLE;
}
|
static ResourceBundle function( ) { return RESOURCE_BUNDLE; }
|
/**
* Returns the resource bundle.
*
* @return the resource bundle.
*/
|
Returns the resource bundle
|
getReportResourceBundle
|
{
"repo_name": "sguan-actuate/birt",
"path": "engine/org.eclipse.birt.report.engine.emitter.config/src/org/eclipse/birt/report/engine/emitter/config/i18n/Messages.java",
"license": "epl-1.0",
"size": 2318
}
|
[
"java.util.ResourceBundle"
] |
import java.util.ResourceBundle;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,986,769
|
@SuppressWarnings("unchecked")
public <T> B attr(AttributeKey<T> key, T value) {
if (key == null) {
throw new NullPointerException("key");
}
if (value == null) {
synchronized (attrs) {
attrs.remove(key);
}
} else {
synchronized (attrs) {
attrs.put(key, value);
}
}
return (B) this;
}
|
@SuppressWarnings(STR) <T> B function(AttributeKey<T> key, T value) { if (key == null) { throw new NullPointerException("key"); } if (value == null) { synchronized (attrs) { attrs.remove(key); } } else { synchronized (attrs) { attrs.put(key, value); } } return (B) this; }
|
/**
* Allow to specify an initial attribute of the newly created {@link Channel}. If the {@code value} is
* {@code null}, the attribute of the specified {@code key} is removed.
*/
|
Allow to specify an initial attribute of the newly created <code>Channel</code>. If the value is null, the attribute of the specified key is removed
|
attr
|
{
"repo_name": "Techcable/netty",
"path": "transport/src/main/java/io/netty/bootstrap/AbstractBootstrap.java",
"license": "apache-2.0",
"size": 16694
}
|
[
"io.netty.util.AttributeKey"
] |
import io.netty.util.AttributeKey;
|
import io.netty.util.*;
|
[
"io.netty.util"
] |
io.netty.util;
| 748,346
|
public void setPatrolForce(final List<Ship> value) {
this.patrolForce = value;
}
|
void function(final List<Ship> value) { this.patrolForce = value; }
|
/**
* Set the patrolling force.
*
* @param value the patrolling force.
*/
|
Set the patrolling force
|
setPatrolForce
|
{
"repo_name": "EaW1805/engine",
"path": "src/main/java/com/eaw1805/battles/BattleField.java",
"license": "mit",
"size": 3808
}
|
[
"com.eaw1805.data.model.fleet.Ship",
"java.util.List"
] |
import com.eaw1805.data.model.fleet.Ship; import java.util.List;
|
import com.eaw1805.data.model.fleet.*; import java.util.*;
|
[
"com.eaw1805.data",
"java.util"
] |
com.eaw1805.data; java.util;
| 94,149
|
public ReportDataByPeriod getDataBuilder() {
return data;
}
|
ReportDataByPeriod function() { return data; }
|
/**
* Access to query results, such as min, max, mean and sum.
* @return Object on which the data is stored
*/
|
Access to query results, such as min, max, mean and sum
|
getDataBuilder
|
{
"repo_name": "emmanuel-florent/flowzr-android-black",
"path": "src/main/java/com/flowzr/graph/Report2DChart.java",
"license": "gpl-2.0",
"size": 10943
}
|
[
"com.flowzr.model.ReportDataByPeriod"
] |
import com.flowzr.model.ReportDataByPeriod;
|
import com.flowzr.model.*;
|
[
"com.flowzr.model"
] |
com.flowzr.model;
| 658,683
|
public void deleteDocumentDrafts(List<String> documentIds) throws Exception
{
deleteDocumentDrafts( documentIds, null);
}
|
void function(List<String> documentIds) throws Exception { deleteDocumentDrafts( documentIds, null); }
|
/**
* Deletes the drafts of the specified documents. Published documents cannot be deleted.
* <p><pre><code>
* DocumentDraftSummary documentdraftsummary = new DocumentDraftSummary();
* documentdraftsummary.deleteDocumentDrafts( documentIds);
* </code></pre></p>
* @param documentIds Unique identifiers of the documents to delete.
* @return
* @see string
*/
|
Deletes the drafts of the specified documents. Published documents cannot be deleted. <code><code> DocumentDraftSummary documentdraftsummary = new DocumentDraftSummary(); documentdraftsummary.deleteDocumentDrafts( documentIds); </code></code>
|
deleteDocumentDrafts
|
{
"repo_name": "sanjaymandadi/mozu-java",
"path": "mozu-java-core/src/main/java/com/mozu/api/resources/content/DocumentDraftSummaryResource.java",
"license": "mit",
"size": 5869
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,173,904
|
public IEntryResult[] queryEntriesMatching(char[] prefix, boolean isCaseSensitive) throws IOException {
BlocksIndexInput input= getBlocksIndexInput();
try {
return input.queryEntriesMatching(prefix,isCaseSensitive);
} finally {
if( !doCache ) {
input.close();
}
}
}
|
IEntryResult[] function(char[] prefix, boolean isCaseSensitive) throws IOException { BlocksIndexInput input= getBlocksIndexInput(); try { return input.queryEntriesMatching(prefix,isCaseSensitive); } finally { if( !doCache ) { input.close(); } } }
|
/**
* Overloaded the method in Index to allow a user to specify if the
* query should be case sensitive.
*/
|
Overloaded the method in Index to allow a user to specify if the query should be case sensitive
|
queryEntriesMatching
|
{
"repo_name": "jagazee/teiid-8.7",
"path": "metadata/src/main/java/org/teiid/internal/core/index/Index.java",
"license": "lgpl-2.1",
"size": 7066
}
|
[
"java.io.IOException",
"org.teiid.core.index.IEntryResult"
] |
import java.io.IOException; import org.teiid.core.index.IEntryResult;
|
import java.io.*; import org.teiid.core.index.*;
|
[
"java.io",
"org.teiid.core"
] |
java.io; org.teiid.core;
| 1,747,717
|
public static ExtensionInstructionWrapper extension(ExtensionTreatment extension,
DeviceId deviceId) {
checkNotNull(extension, "Extension instruction cannot be null");
checkNotNull(deviceId, "Device ID cannot be null");
return new ExtensionInstructionWrapper(extension, deviceId);
}
public static final class NoActionInstruction implements Instruction {
private NoActionInstruction() {}
|
static ExtensionInstructionWrapper function(ExtensionTreatment extension, DeviceId deviceId) { checkNotNull(extension, STR); checkNotNull(deviceId, STR); return new ExtensionInstructionWrapper(extension, deviceId); } public static final class NoActionInstruction implements Instruction { private NoActionInstruction() {}
|
/**
* Creates an extension instruction.
*
* @param extension extension instruction
* @param deviceId device ID
* @return extension instruction
*/
|
Creates an extension instruction
|
extension
|
{
"repo_name": "sdnwiselab/onos",
"path": "core/api/src/main/java/org/onosproject/net/flow/instructions/Instructions.java",
"license": "apache-2.0",
"size": 25757
}
|
[
"com.google.common.base.Preconditions",
"org.onosproject.net.DeviceId"
] |
import com.google.common.base.Preconditions; import org.onosproject.net.DeviceId;
|
import com.google.common.base.*; import org.onosproject.net.*;
|
[
"com.google.common",
"org.onosproject.net"
] |
com.google.common; org.onosproject.net;
| 2,500,066
|
public YangUInt16 getOvldStartDurationValue() throws JNCException {
YangUInt16 ovldStartDuration = (YangUInt16)getValue("ovld-start-duration");
if (ovldStartDuration == null) {
ovldStartDuration = new YangUInt16("10"); // default
}
return ovldStartDuration;
}
|
YangUInt16 function() throws JNCException { YangUInt16 ovldStartDuration = (YangUInt16)getValue(STR); if (ovldStartDuration == null) { ovldStartDuration = new YangUInt16("10"); } return ovldStartDuration; }
|
/**
* Gets the value for child leaf "ovld-start-duration".
* @return The value of the leaf.
*/
|
Gets the value for child leaf "ovld-start-duration"
|
getOvldStartDurationValue
|
{
"repo_name": "jnpr-shinma/yangfile",
"path": "hitel/src/hctaEpc/fgw/engineering/MmeFgwS1Overload.java",
"license": "apache-2.0",
"size": 18292
}
|
[
"com.tailf.jnc.YangUInt16"
] |
import com.tailf.jnc.YangUInt16;
|
import com.tailf.jnc.*;
|
[
"com.tailf.jnc"
] |
com.tailf.jnc;
| 585,803
|
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled=true)
public void createCenterTest() throws Exception {
String officeName = "MyOfficeDHMFT";
String qG1Name = "CreateCenterQG";
String qG2Name = "CreateCenterQG2";
createQuestions();
CreateQuestionGroupParameters qG1 = questionTestHelper.getCreateQuestionGroupParameters(qG1Name,
asList("center question 1", "center question 2", "center question 3"), "Create Center", "Sec 1");
questionTestHelper.createQuestionGroup(qG1);
CreateQuestionGroupParameters qG2 = questionTestHelper.getCreateQuestionGroupParameters(qG2Name,
asList("center question 4", "center question 5", "center question 6"), "Create Center", "Sec 2");
questionTestHelper.createQuestionGroup(qG2);
String testCenterName = "Center" + StringUtil.getRandomString(6);
CreateCenterEnterDataPage.SubmitFormParameters centerParams = getCenterParameters(testCenterName,
"loan officer");
QuestionResponseParameters responseParams = getQuestionResponseParameters("answer1");
QuestionResponseParameters responseParams2 = getQuestionResponseParameters("answer2");
List<CreateQuestionParameters> questionsList = new ArrayList<CreateQuestionParameters>();
questionsList.add(newFreeTextQuestionParameters("new center question 1"));
questionsList.add(newFreeTextQuestionParameters("new center question 2"));
String[] newActiveQuestions = { "new center question 1", "center question 2" };
String[] deactivateArray = { "center question 3", "center question 4", };
List<String> deactivateList = Arrays.asList(deactivateArray);
CenterViewDetailsPage centerViewDetailsPage = centerTestHelper.createCenterWithQuestionGroupsEdited(
centerParams, officeName, responseParams, responseParams2);
centerViewDetailsPage.navigateToViewAdditionalInformation().navigateBack();
questionTestHelper.addNewQuestionsToQuestionGroup(qG1Name, questionsList);
questionTestHelper.markQuestionsAsInactive(deactivateList);
questionTestHelper.markQuestionGroupAsInactive(qG2Name);
QuestionResponsePage responsePage = centerTestHelper.navigateToQuestionResponsePageWhenCreatingCenter(
centerParams, officeName);
responsePage.verifyQuestionsDoesnotappear(deactivateArray);
responsePage.verifyQuestionsExists(newActiveQuestions);
centerViewDetailsPage = centerTestHelper.navigateToCenterViewDetailsPage(testCenterName);
centerViewDetailsPage.verifyActiveCenter(centerParams);
ViewQuestionResponseDetailPage responseDetailsPage = centerViewDetailsPage
.navigateToViewAdditionalInformation();
responseDetailsPage.verifyQuestionsDoesnotappear(deactivateArray);
responseDetailsPage.verifyEditButtonDisabled("1");
QuestionnairePage questionnairePage = responseDetailsPage.navigateToEditSection("0");
questionnairePage.verifyField("details[0].sectionDetails[0].questions[0].value", "");
questionnairePage.verifyField("details[0].sectionDetails[0].questions[1].value", "");
questionTestHelper.markQuestionGroupAsInactive(qG1Name);
}
|
@SuppressWarnings(STR) @Test(enabled=true) void function() throws Exception { String officeName = STR; String qG1Name = STR; String qG2Name = STR; createQuestions(); CreateQuestionGroupParameters qG1 = questionTestHelper.getCreateQuestionGroupParameters(qG1Name, asList(STR, STR, STR), STR, STR); questionTestHelper.createQuestionGroup(qG1); CreateQuestionGroupParameters qG2 = questionTestHelper.getCreateQuestionGroupParameters(qG2Name, asList(STR, STR, STR), STR, STR); questionTestHelper.createQuestionGroup(qG2); String testCenterName = STR + StringUtil.getRandomString(6); CreateCenterEnterDataPage.SubmitFormParameters centerParams = getCenterParameters(testCenterName, STR); QuestionResponseParameters responseParams = getQuestionResponseParameters(STR); QuestionResponseParameters responseParams2 = getQuestionResponseParameters(STR); List<CreateQuestionParameters> questionsList = new ArrayList<CreateQuestionParameters>(); questionsList.add(newFreeTextQuestionParameters(STR)); questionsList.add(newFreeTextQuestionParameters(STR)); String[] newActiveQuestions = { STR, STR }; String[] deactivateArray = { STR, STR, }; List<String> deactivateList = Arrays.asList(deactivateArray); CenterViewDetailsPage centerViewDetailsPage = centerTestHelper.createCenterWithQuestionGroupsEdited( centerParams, officeName, responseParams, responseParams2); centerViewDetailsPage.navigateToViewAdditionalInformation().navigateBack(); questionTestHelper.addNewQuestionsToQuestionGroup(qG1Name, questionsList); questionTestHelper.markQuestionsAsInactive(deactivateList); questionTestHelper.markQuestionGroupAsInactive(qG2Name); QuestionResponsePage responsePage = centerTestHelper.navigateToQuestionResponsePageWhenCreatingCenter( centerParams, officeName); responsePage.verifyQuestionsDoesnotappear(deactivateArray); responsePage.verifyQuestionsExists(newActiveQuestions); centerViewDetailsPage = centerTestHelper.navigateToCenterViewDetailsPage(testCenterName); centerViewDetailsPage.verifyActiveCenter(centerParams); ViewQuestionResponseDetailPage responseDetailsPage = centerViewDetailsPage .navigateToViewAdditionalInformation(); responseDetailsPage.verifyQuestionsDoesnotappear(deactivateArray); responseDetailsPage.verifyEditButtonDisabled("1"); QuestionnairePage questionnairePage = responseDetailsPage.navigateToEditSection("0"); questionnairePage.verifyField(STR, STRdetails[0].sectionDetails[0].questions[1].valueSTR"); questionTestHelper.markQuestionGroupAsInactive(qG1Name); }
|
/**
* Capturing responses during the Center creation http://mifosforge.jira.com/browse/MIFOSTEST-665
*
* @throws Exception
*/
|
Capturing responses during the Center creation HREF
|
createCenterTest
|
{
"repo_name": "madhav123/gkmaster",
"path": "acceptanceTests/src/test/java/org/mifos/test/acceptance/center/CenterTest.java",
"license": "apache-2.0",
"size": 15608
}
|
[
"java.util.ArrayList",
"java.util.Arrays",
"java.util.List",
"org.mifos.test.acceptance.framework.center.CenterViewDetailsPage",
"org.mifos.test.acceptance.framework.center.CreateCenterEnterDataPage",
"org.mifos.test.acceptance.framework.loan.QuestionResponseParameters",
"org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters",
"org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters",
"org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage",
"org.mifos.test.acceptance.framework.questionnaire.QuestionnairePage",
"org.mifos.test.acceptance.framework.questionnaire.ViewQuestionResponseDetailPage",
"org.mifos.test.acceptance.util.StringUtil",
"org.testng.annotations.Test"
] |
import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.mifos.test.acceptance.framework.center.CenterViewDetailsPage; import org.mifos.test.acceptance.framework.center.CreateCenterEnterDataPage; import org.mifos.test.acceptance.framework.loan.QuestionResponseParameters; import org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters; import org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters; import org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage; import org.mifos.test.acceptance.framework.questionnaire.QuestionnairePage; import org.mifos.test.acceptance.framework.questionnaire.ViewQuestionResponseDetailPage; import org.mifos.test.acceptance.util.StringUtil; import org.testng.annotations.Test;
|
import java.util.*; import org.mifos.test.acceptance.framework.center.*; import org.mifos.test.acceptance.framework.loan.*; import org.mifos.test.acceptance.framework.questionnaire.*; import org.mifos.test.acceptance.util.*; import org.testng.annotations.*;
|
[
"java.util",
"org.mifos.test",
"org.testng.annotations"
] |
java.util; org.mifos.test; org.testng.annotations;
| 2,274,774
|
public Trie getTrie() {
return this.trie;
}
|
Trie function() { return this.trie; }
|
/**
* Returns the trie of the table.
*
* @return Trie object of the table.
*/
|
Returns the trie of the table
|
getTrie
|
{
"repo_name": "jabbalaci/Talky-G",
"path": "src/main/java/fr/loria/coronsys/coron/datastructure/Table.java",
"license": "gpl-3.0",
"size": 7060
}
|
[
"fr.loria.coronsys.coron.datastructure.trie.Trie"
] |
import fr.loria.coronsys.coron.datastructure.trie.Trie;
|
import fr.loria.coronsys.coron.datastructure.trie.*;
|
[
"fr.loria.coronsys"
] |
fr.loria.coronsys;
| 454,208
|
public String toBundleName(String baseName, Locale locale);
|
String function(String baseName, Locale locale);
|
/**
* Returns the bundle name for the given baseName and locale.
*/
|
Returns the bundle name for the given baseName and locale
|
toBundleName
|
{
"repo_name": "md-5/jdk10",
"path": "src/java.base/share/classes/sun/util/resources/Bundles.java",
"license": "gpl-2.0",
"size": 19988
}
|
[
"java.util.Locale"
] |
import java.util.Locale;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,378,113
|
@LifecycleStart
public void authenticate()
{
String principal = hdfsKerberosConfig.getPrincipal();
String keytab = hdfsKerberosConfig.getKeytab();
if (!Strings.isNullOrEmpty(principal) && !Strings.isNullOrEmpty(keytab)) {
UserGroupInformation.setConfiguration(hadoopConf);
if (UserGroupInformation.isSecurityEnabled()) {
try {
if (UserGroupInformation.getCurrentUser().hasKerberosCredentials() == false
|| !UserGroupInformation.getCurrentUser().getUserName().equals(principal)) {
log.info("Trying to authenticate user [%s] with keytab [%s]..", principal, keytab);
UserGroupInformation.loginUserFromKeytab(principal, keytab);
}
}
catch (IOException e) {
throw new ISE(e, "Failed to authenticate user principal [%s] with keytab [%s]", principal, keytab);
}
}
}
}
|
void function() { String principal = hdfsKerberosConfig.getPrincipal(); String keytab = hdfsKerberosConfig.getKeytab(); if (!Strings.isNullOrEmpty(principal) && !Strings.isNullOrEmpty(keytab)) { UserGroupInformation.setConfiguration(hadoopConf); if (UserGroupInformation.isSecurityEnabled()) { try { if (UserGroupInformation.getCurrentUser().hasKerberosCredentials() == false !UserGroupInformation.getCurrentUser().getUserName().equals(principal)) { log.info(STR, principal, keytab); UserGroupInformation.loginUserFromKeytab(principal, keytab); } } catch (IOException e) { throw new ISE(e, STR, principal, keytab); } } } }
|
/**
* Dose authenticate against a secured hadoop cluster
* In case of any bug fix make sure to fix the code in JobHelper#authenticate as well.
*/
|
Dose authenticate against a secured hadoop cluster In case of any bug fix make sure to fix the code in JobHelper#authenticate as well
|
authenticate
|
{
"repo_name": "deltaprojects/druid",
"path": "extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsStorageAuthentication.java",
"license": "apache-2.0",
"size": 2895
}
|
[
"com.google.common.base.Strings",
"java.io.IOException",
"org.apache.hadoop.security.UserGroupInformation"
] |
import com.google.common.base.Strings; import java.io.IOException; import org.apache.hadoop.security.UserGroupInformation;
|
import com.google.common.base.*; import java.io.*; import org.apache.hadoop.security.*;
|
[
"com.google.common",
"java.io",
"org.apache.hadoop"
] |
com.google.common; java.io; org.apache.hadoop;
| 730,558
|
private Worklog convertEntryToWorklog(WorklogEntry worklogEntry) {
Worklog worklog = objectFactory.createWorklog();
worklog.setId(worklogEntry.getId());
worklog.setBeginTime(worklogEntry.getBeginTimestamp());
worklog.setEndTime(worklogEntry.getEndTimeStamp());
worklog.setMessage(worklogEntry.getMessage());
return worklog;
}
|
Worklog function(WorklogEntry worklogEntry) { Worklog worklog = objectFactory.createWorklog(); worklog.setId(worklogEntry.getId()); worklog.setBeginTime(worklogEntry.getBeginTimestamp()); worklog.setEndTime(worklogEntry.getEndTimeStamp()); worklog.setMessage(worklogEntry.getMessage()); return worklog; }
|
/**
* Convert the given worklog entry to worklog JAXB element.
*
* @param worklogEntry
* {@link WorklogEntry} reference.
* @return {@link Worklog} reference.
*/
|
Convert the given worklog entry to worklog JAXB element
|
convertEntryToWorklog
|
{
"repo_name": "zsdoma/timetracker",
"path": "timetracker-xml/src/main/java/hu/zsdoma/timetracker/xml/XmlDataSource.java",
"license": "gpl-3.0",
"size": 7662
}
|
[
"hu.zsdoma.timetracker.api.dto.WorklogEntry",
"hu.zsdoma.timetracker.schemas.Worklog"
] |
import hu.zsdoma.timetracker.api.dto.WorklogEntry; import hu.zsdoma.timetracker.schemas.Worklog;
|
import hu.zsdoma.timetracker.api.dto.*; import hu.zsdoma.timetracker.schemas.*;
|
[
"hu.zsdoma.timetracker"
] |
hu.zsdoma.timetracker;
| 1,245,165
|
public void getData()
{
if (jobEntry.getName() != null) wName.setText( jobEntry.getName() );
wName.selectAll();
if (jobEntry.arguments != null)
{
for (int i = 0; i < jobEntry.arguments.length; i++)
{
TableItem ti = wFields.table.getItem(i);
if (jobEntry.arguments[i] != null)
ti.setText(1, jobEntry.arguments[i]);
if (jobEntry.filemasks[i] != null)
ti.setText(2, jobEntry.filemasks[i]);
}
wFields.setRowNums();
wFields.optWidth(true);
}
wPrevious.setSelection(jobEntry.argFromPrevious);
wIncludeSubfolders.setSelection(jobEntry.includeSubfolders);
wDeleteAllBefore.setSelection(jobEntry.deleteallbefore);
}
|
void function() { if (jobEntry.getName() != null) wName.setText( jobEntry.getName() ); wName.selectAll(); if (jobEntry.arguments != null) { for (int i = 0; i < jobEntry.arguments.length; i++) { TableItem ti = wFields.table.getItem(i); if (jobEntry.arguments[i] != null) ti.setText(1, jobEntry.arguments[i]); if (jobEntry.filemasks[i] != null) ti.setText(2, jobEntry.filemasks[i]); } wFields.setRowNums(); wFields.optWidth(true); } wPrevious.setSelection(jobEntry.argFromPrevious); wIncludeSubfolders.setSelection(jobEntry.includeSubfolders); wDeleteAllBefore.setSelection(jobEntry.deleteallbefore); }
|
/**
* Copy information from the meta-data input to the dialog fields.
*/
|
Copy information from the meta-data input to the dialog fields
|
getData
|
{
"repo_name": "dianhu/Kettle-Research",
"path": "src-ui/org/pentaho/di/ui/job/entries/addresultfilenames/JobEntryAddResultFilenamesDialog.java",
"license": "lgpl-2.1",
"size": 22566
}
|
[
"org.eclipse.swt.widgets.TableItem"
] |
import org.eclipse.swt.widgets.TableItem;
|
import org.eclipse.swt.widgets.*;
|
[
"org.eclipse.swt"
] |
org.eclipse.swt;
| 2,296,720
|
public void setAlgorithm(int alg) {
switch (alg) {
case Georeferencing.AFFINE:
getAffine().setSelected(true);
getPolynomial().setSelected(false);
actionPerformed(new ActionEvent(getAffine(), 0, ""));
break;
case Georeferencing.POLYNOMIAL:
getPolynomial().setSelected(true);
getAffine().setSelected(false);
actionPerformed(new ActionEvent(getPolynomial(), 0, ""));
break;
}
}
|
void function(int alg) { switch (alg) { case Georeferencing.AFFINE: getAffine().setSelected(true); getPolynomial().setSelected(false); actionPerformed(new ActionEvent(getAffine(), 0, STR")); break; } }
|
/**
* Asigna el algoritmo
* @param alg
*/
|
Asigna el algoritmo
|
setAlgorithm
|
{
"repo_name": "iCarto/siga",
"path": "extGeoreferencing/src/org/gvsig/georeferencing/ui/launcher/AlgorithmSelectionPanel.java",
"license": "gpl-3.0",
"size": 7575
}
|
[
"java.awt.event.ActionEvent",
"org.gvsig.georeferencing.main.Georeferencing"
] |
import java.awt.event.ActionEvent; import org.gvsig.georeferencing.main.Georeferencing;
|
import java.awt.event.*; import org.gvsig.georeferencing.main.*;
|
[
"java.awt",
"org.gvsig.georeferencing"
] |
java.awt; org.gvsig.georeferencing;
| 1,973,623
|
invocationCount++;
long currentPosition = pos;
long eof = validateAndGetFileChannel().size();
// return -1 if the given position is greater than or equal to the file's current size.
if (pos >= eof) {
return -1;
}
while (dest.remaining() > 0) {
// Check if the data is in the buffer, if so, copy it.
if (readBufferStartPosition <= currentPosition && currentPosition < readBufferStartPosition + readBuffer.limit()) {
long posInBuffer = currentPosition - readBufferStartPosition;
long bytesToCopy = Math.min(dest.remaining(), readBuffer.limit() - posInBuffer);
ByteBuffer rbDup = readBuffer.duplicate();
rbDup.position((int)posInBuffer);
rbDup.limit((int)(posInBuffer + bytesToCopy));
dest.put(rbDup);
currentPosition += bytesToCopy;
cacheHitCount++;
} else if (currentPosition >= eof) {
// here we reached eof.
break;
} else {
// We don't have it in the buffer, so put necessary data in the buffer
readBuffer.clear();
readBufferStartPosition = currentPosition;
int readBytes = 0;
if ((readBytes = validateAndGetFileChannel().read(readBuffer, currentPosition)) <= 0) {
throw new IOException("Reading from filechannel returned a non-positive value. Short read.");
}
readBuffer.limit(readBytes);
}
}
return (int)(currentPosition - pos);
}
|
invocationCount++; long currentPosition = pos; long eof = validateAndGetFileChannel().size(); if (pos >= eof) { return -1; } while (dest.remaining() > 0) { if (readBufferStartPosition <= currentPosition && currentPosition < readBufferStartPosition + readBuffer.limit()) { long posInBuffer = currentPosition - readBufferStartPosition; long bytesToCopy = Math.min(dest.remaining(), readBuffer.limit() - posInBuffer); ByteBuffer rbDup = readBuffer.duplicate(); rbDup.position((int)posInBuffer); rbDup.limit((int)(posInBuffer + bytesToCopy)); dest.put(rbDup); currentPosition += bytesToCopy; cacheHitCount++; } else if (currentPosition >= eof) { break; } else { readBuffer.clear(); readBufferStartPosition = currentPosition; int readBytes = 0; if ((readBytes = validateAndGetFileChannel().read(readBuffer, currentPosition)) <= 0) { throw new IOException(STR); } readBuffer.limit(readBytes); } } return (int)(currentPosition - pos); }
|
/**
* Read as many bytes into dest as dest.capacity() starting at position pos in the
* FileChannel. This function can read from the buffer or the file channel
* depending on the implementation..
* @param dest
* @param pos
* @return The total number of bytes read. -1 if the given position is greater than or equal to the file's current size.
* @throws IOException if I/O error occurs
*/
|
Read as many bytes into dest as dest.capacity() starting at position pos in the FileChannel. This function can read from the buffer or the file channel depending on the implementation.
|
read
|
{
"repo_name": "robindh/bookkeeper",
"path": "bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BufferedReadChannel.java",
"license": "apache-2.0",
"size": 4145
}
|
[
"java.io.IOException",
"java.nio.ByteBuffer"
] |
import java.io.IOException; import java.nio.ByteBuffer;
|
import java.io.*; import java.nio.*;
|
[
"java.io",
"java.nio"
] |
java.io; java.nio;
| 1,271,906
|
private void applyExternalForces (double deltaT, Point2D.Double mousePosition, Point2D.Double previousMousePosition) {
// pour chaque particule
ListIterator<Particle> iterator = particles.listIterator ();
while (iterator.hasNext ()) {
// particule courante
Particle particle = iterator.next ();
// appliquer la gravite
particle.setVelocity (particle.getVelocity ().plus (gravity.times (deltaT)));
// si l'utilisateur est en train de cliquer
if (mousePosition != null) {
// appliquer la force de la souris
Vector mouseForce = getMouseForce (particle, mousePosition, previousMousePosition, deltaT);
particle.setVelocity (particle.getVelocity ().plus (mouseForce));
}
}
}
|
void function (double deltaT, Point2D.Double mousePosition, Point2D.Double previousMousePosition) { ListIterator<Particle> iterator = particles.listIterator (); while (iterator.hasNext ()) { Particle particle = iterator.next (); particle.setVelocity (particle.getVelocity ().plus (gravity.times (deltaT))); if (mousePosition != null) { Vector mouseForce = getMouseForce (particle, mousePosition, previousMousePosition, deltaT); particle.setVelocity (particle.getVelocity ().plus (mouseForce)); } } }
|
/**
* Applique les forces externes si approprie.
*
* @param deltaT Intervalle de temps.
* @param mousePosition Position de la souris, ou null si elle n'interagit pas avec la
* simulation.
*/
|
Applique les forces externes si approprie
|
applyExternalForces
|
{
"repo_name": "6112/fluid-simulator",
"path": "src/simulation/Simulation.java",
"license": "mit",
"size": 16470
}
|
[
"java.awt.geom.Point2D",
"java.util.ListIterator"
] |
import java.awt.geom.Point2D; import java.util.ListIterator;
|
import java.awt.geom.*; import java.util.*;
|
[
"java.awt",
"java.util"
] |
java.awt; java.util;
| 350,813
|
public NodeConnector getNodeConnector(Node configNode, String bridgeIdentifier, String portIdentifier);
|
NodeConnector function(Node configNode, String bridgeIdentifier, String portIdentifier);
|
/**
* Returns a NodeConnector mapped to a Port (if available) that is created using addPort.
* @param configNode Node serving this configuration service.
* @param bridgeIdentifier Name of the bridge domain that would map to a dedicated Node
* @param portIdentifier String representation of a Port.
* @return NodeConnector that is mapped to a port created using addPort.
* returns null if there is no such nodeConnector is available or mapped.
*/
|
Returns a NodeConnector mapped to a Port (if available) that is created using addPort
|
getNodeConnector
|
{
"repo_name": "niuqg/controller",
"path": "opendaylight/sal/networkconfiguration/api/src/main/java/org/opendaylight/controller/sal/networkconfig/bridgedomain/IPluginInBridgeDomainConfigService.java",
"license": "epl-1.0",
"size": 8194
}
|
[
"org.opendaylight.controller.sal.core.Node",
"org.opendaylight.controller.sal.core.NodeConnector"
] |
import org.opendaylight.controller.sal.core.Node; import org.opendaylight.controller.sal.core.NodeConnector;
|
import org.opendaylight.controller.sal.core.*;
|
[
"org.opendaylight.controller"
] |
org.opendaylight.controller;
| 2,442,965
|
Set<AffectedComponentDTO> getActiveComponentsAffectedByVariableRegistryUpdate(VariableRegistryDTO variableRegistryDto);
|
Set<AffectedComponentDTO> getActiveComponentsAffectedByVariableRegistryUpdate(VariableRegistryDTO variableRegistryDto);
|
/**
* Determines which components are active and will be affected by updating the given Variable Registry. These active components
* are needed to authorize the request and deactivate prior to changing the variables.
*
* @param variableRegistryDto the variable registry
* @return the components that will be affected
*/
|
Determines which components are active and will be affected by updating the given Variable Registry. These active components are needed to authorize the request and deactivate prior to changing the variables
|
getActiveComponentsAffectedByVariableRegistryUpdate
|
{
"repo_name": "mcgilman/nifi",
"path": "nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiServiceFacade.java",
"license": "apache-2.0",
"size": 85713
}
|
[
"java.util.Set",
"org.apache.nifi.web.api.dto.AffectedComponentDTO",
"org.apache.nifi.web.api.dto.VariableRegistryDTO"
] |
import java.util.Set; import org.apache.nifi.web.api.dto.AffectedComponentDTO; import org.apache.nifi.web.api.dto.VariableRegistryDTO;
|
import java.util.*; import org.apache.nifi.web.api.dto.*;
|
[
"java.util",
"org.apache.nifi"
] |
java.util; org.apache.nifi;
| 2,542,451
|
@Override
public void removeGroupEntry(Group group) {
StoredGroupEntry existing = getStoredGroupEntry(group.deviceId(),
group.id());
if (existing != null) {
log.debug("removeGroupEntry: removing group entry {} in device {}",
group.id(),
group.deviceId());
//Removal from groupid based map will happen in the
//map update listener
getGroupStoreKeyMap().remove(new GroupStoreKeyMapKey(existing.deviceId(),
existing.appCookie()));
notifyDelegate(new GroupEvent(Type.GROUP_REMOVED, existing));
} else {
log.warn("removeGroupEntry for {} in device{} is "
+ "not existing in our maps",
group.id(),
group.deviceId());
}
}
|
void function(Group group) { StoredGroupEntry existing = getStoredGroupEntry(group.deviceId(), group.id()); if (existing != null) { log.debug(STR, group.id(), group.deviceId()); getGroupStoreKeyMap().remove(new GroupStoreKeyMapKey(existing.deviceId(), existing.appCookie())); notifyDelegate(new GroupEvent(Type.GROUP_REMOVED, existing)); } else { log.warn(STR + STR, group.id(), group.deviceId()); } }
|
/**
* Removes the group entry from store.
*
* @param group group entry
*/
|
Removes the group entry from store
|
removeGroupEntry
|
{
"repo_name": "sdnwiselab/onos",
"path": "core/store/dist/src/main/java/org/onosproject/store/group/impl/DistributedGroupStore.java",
"license": "apache-2.0",
"size": 65493
}
|
[
"org.onosproject.net.group.Group",
"org.onosproject.net.group.GroupEvent",
"org.onosproject.net.group.StoredGroupEntry"
] |
import org.onosproject.net.group.Group; import org.onosproject.net.group.GroupEvent; import org.onosproject.net.group.StoredGroupEntry;
|
import org.onosproject.net.group.*;
|
[
"org.onosproject.net"
] |
org.onosproject.net;
| 1,532,510
|
@Generated
@Selector("disambiguationWithEnergyToDisambiguate:")
public static native INEnergyResolutionResult disambiguationWithEnergyToDisambiguate(
NSArray<? extends NSMeasurement<NSUnitEnergy>> energyToDisambiguate);
|
@Selector(STR) static native INEnergyResolutionResult function( NSArray<? extends NSMeasurement<NSUnitEnergy>> energyToDisambiguate);
|
/**
* This resolution result is to ask Siri to disambiguate between the provided energy.
*/
|
This resolution result is to ask Siri to disambiguate between the provided energy
|
disambiguationWithEnergyToDisambiguate
|
{
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/intents/INEnergyResolutionResult.java",
"license": "apache-2.0",
"size": 6290
}
|
[
"org.moe.natj.objc.ann.Selector"
] |
import org.moe.natj.objc.ann.Selector;
|
import org.moe.natj.objc.ann.*;
|
[
"org.moe.natj"
] |
org.moe.natj;
| 2,829,710
|
public void set(String name, PyObject value) {
}
|
void function(String name, PyObject value) { }
|
/**
* Sets a variable in the local namespace.
*
* @param name the name of the variable
* @param value the Python object to set the variable to
*/
|
Sets a variable in the local namespace
|
set
|
{
"repo_name": "github/codeql",
"path": "java/ql/test/stubs/jython-2.7.2/org/python/util/PythonInterpreter.java",
"license": "mit",
"size": 8104
}
|
[
"org.python.core.PyObject"
] |
import org.python.core.PyObject;
|
import org.python.core.*;
|
[
"org.python.core"
] |
org.python.core;
| 1,378,777
|
public Builder yValueType(ValueType yValueType) {
JodaBeanUtils.notNull(yValueType, "yValueType");
this.yValueType = yValueType;
return this;
}
|
Builder function(ValueType yValueType) { JodaBeanUtils.notNull(yValueType, STR); this.yValueType = yValueType; return this; }
|
/**
* Sets the y-value type, providing meaning to the y-values of the curve.
* <p>
* This type provides meaning to the y-values. For example, the y-value might
* represent a zero rate, as represented using {@link ValueType#ZERO_RATE}.
* <p>
* If using the builder, this defaults to {@link ValueType#UNKNOWN}.
* @param yValueType the new value, not null
* @return this, for chaining, not null
*/
|
Sets the y-value type, providing meaning to the y-values of the curve. This type provides meaning to the y-values. For example, the y-value might represent a zero rate, as represented using <code>ValueType#ZERO_RATE</code>. If using the builder, this defaults to <code>ValueType#UNKNOWN</code>
|
yValueType
|
{
"repo_name": "OpenGamma/Strata",
"path": "modules/market/src/main/java/com/opengamma/strata/market/curve/InterpolatedNodalCurveDefinition.java",
"license": "apache-2.0",
"size": 34460
}
|
[
"com.opengamma.strata.market.ValueType",
"org.joda.beans.JodaBeanUtils"
] |
import com.opengamma.strata.market.ValueType; import org.joda.beans.JodaBeanUtils;
|
import com.opengamma.strata.market.*; import org.joda.beans.*;
|
[
"com.opengamma.strata",
"org.joda.beans"
] |
com.opengamma.strata; org.joda.beans;
| 1,468,534
|
public boolean validate(Component object, Log log, boolean failOnWarning) {
Validator validator = new Validator();
//LOG.debug("Validating with Log4j output");
boolean passed = validator.validate(object, failOnWarning);
writeToLog(log, validator, passed);
return passed;
}
|
boolean function(Component object, Log log, boolean failOnWarning) { Validator validator = new Validator(); boolean passed = validator.validate(object, failOnWarning); writeToLog(log, validator, passed); return passed; }
|
/**
* Validates a Component with output going to Log4j
*
* @param object - The component to be validated
* @param log - The Log4j logger the output is sent to
* @param failOnWarning - Whether detecting a warning should cause the validation to fail
* @return Returns true if the beans past validation
*/
|
Validates a Component with output going to Log4j
|
validate
|
{
"repo_name": "ua-eas/ksd-kc5.2.1-rice2.3.6-ua",
"path": "rice-framework/krad-web-framework/src/main/java/org/kuali/rice/krad/datadictionary/validator/ValidationController.java",
"license": "apache-2.0",
"size": 17267
}
|
[
"org.apache.commons.logging.Log",
"org.kuali.rice.krad.uif.component.Component"
] |
import org.apache.commons.logging.Log; import org.kuali.rice.krad.uif.component.Component;
|
import org.apache.commons.logging.*; import org.kuali.rice.krad.uif.component.*;
|
[
"org.apache.commons",
"org.kuali.rice"
] |
org.apache.commons; org.kuali.rice;
| 280,547
|
public PIX15 readPIX15(String name) throws IOException {
PIX15 ret = new PIX15();
newDumpLevel(name, "PIX15");
readUB(1, "reserved");
ret.red = (int) readUB(5, "red");
ret.green = (int) readUB(5, "green");
ret.blue = (int) readUB(5, "blue");
endDumpLevel();
return ret;
}
|
PIX15 function(String name) throws IOException { PIX15 ret = new PIX15(); newDumpLevel(name, "PIX15"); readUB(1, STR); ret.red = (int) readUB(5, "red"); ret.green = (int) readUB(5, "green"); ret.blue = (int) readUB(5, "blue"); endDumpLevel(); return ret; }
|
/**
* Reads one PIX15 value from the stream
*
* @param name
* @return PIX15 value
* @throws IOException
*/
|
Reads one PIX15 value from the stream
|
readPIX15
|
{
"repo_name": "realmaster42/jpexs-decompiler",
"path": "libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java",
"license": "gpl-3.0",
"size": 122880
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,529,419
|
public static Window getNearestWindow(Component c){
while(c!=null && !(c instanceof Window)){
c=c.getParent();
}
return (Window)c;
}
|
static Window function(Component c){ while(c!=null && !(c instanceof Window)){ c=c.getParent(); } return (Window)c; }
|
/**
* Returns the nearest Window for the component
*/
|
Returns the nearest Window for the component
|
getNearestWindow
|
{
"repo_name": "Anode1/aisconvert",
"path": "src/org/ais/convert/gui/GUIUtils.java",
"license": "gpl-2.0",
"size": 8449
}
|
[
"java.awt.Component",
"java.awt.Window"
] |
import java.awt.Component; import java.awt.Window;
|
import java.awt.*;
|
[
"java.awt"
] |
java.awt;
| 2,207,568
|
void onDismiss(GridView gridView, int[] reverseSortedPositions);
}
public SwipeDismissGridViewTouchListener(GridView listView, DismissCallbacks callbacks) {
ViewConfiguration vc = ViewConfiguration.get(listView.getContext());
mSlop = vc.getScaledTouchSlop();
mMinFlingVelocity = vc.getScaledMinimumFlingVelocity() * 16;
mMaxFlingVelocity = vc.getScaledMaximumFlingVelocity();
mAnimationTime = listView.getContext().getResources().getInteger(
android.R.integer.config_shortAnimTime);
mGridView = listView;
mCallbacks = callbacks;
}
|
void onDismiss(GridView gridView, int[] reverseSortedPositions); } public SwipeDismissGridViewTouchListener(GridView listView, DismissCallbacks callbacks) { ViewConfiguration vc = ViewConfiguration.get(listView.getContext()); mSlop = vc.getScaledTouchSlop(); mMinFlingVelocity = vc.getScaledMinimumFlingVelocity() * 16; mMaxFlingVelocity = vc.getScaledMaximumFlingVelocity(); mAnimationTime = listView.getContext().getResources().getInteger( android.R.integer.config_shortAnimTime); mGridView = listView; mCallbacks = callbacks; }
|
/**
* Called when the user has indicated they she would like to dismiss one or more list item
* positions.
*
* @param gridView The originating {@link ListView}.
* @param reverseSortedPositions An array of positions to dismiss, sorted in descending
* order for convenience.
*/
|
Called when the user has indicated they she would like to dismiss one or more list item positions
|
onDismiss
|
{
"repo_name": "PhaniGaddipati/Stacks-Flashcards",
"path": "src/main/java/com/google/android/apps/dashclock/ui/SwipeDismissGridViewTouchListener.java",
"license": "gpl-3.0",
"size": 14664
}
|
[
"android.view.ViewConfiguration",
"android.widget.GridView"
] |
import android.view.ViewConfiguration; import android.widget.GridView;
|
import android.view.*; import android.widget.*;
|
[
"android.view",
"android.widget"
] |
android.view; android.widget;
| 1,290,368
|
public static void testHeapSizeChanges(final BlockCache toBeTested,
final int blockSize) {
HFileBlockPair[] blocks = generateHFileBlocks(blockSize, 1);
long heapSize = ((HeapSize) toBeTested).heapSize();
toBeTested.cacheBlock(blocks[0].blockName, blocks[0].block);
assertTrue(heapSize < ((HeapSize) toBeTested).heapSize());
toBeTested.evictBlock(blocks[0].blockName);
assertEquals(heapSize, ((HeapSize) toBeTested).heapSize());
}
|
static void function(final BlockCache toBeTested, final int blockSize) { HFileBlockPair[] blocks = generateHFileBlocks(blockSize, 1); long heapSize = ((HeapSize) toBeTested).heapSize(); toBeTested.cacheBlock(blocks[0].blockName, blocks[0].block); assertTrue(heapSize < ((HeapSize) toBeTested).heapSize()); toBeTested.evictBlock(blocks[0].blockName); assertEquals(heapSize, ((HeapSize) toBeTested).heapSize()); }
|
/**
* Just checks if heapsize grows when something is cached, and gets smaller
* when the same object is evicted
*/
|
Just checks if heapsize grows when something is cached, and gets smaller when the same object is evicted
|
testHeapSizeChanges
|
{
"repo_name": "tobegit3hub/hbase",
"path": "hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/CacheTestUtils.java",
"license": "apache-2.0",
"size": 12720
}
|
[
"org.apache.hadoop.hbase.io.HeapSize",
"org.junit.Assert"
] |
import org.apache.hadoop.hbase.io.HeapSize; import org.junit.Assert;
|
import org.apache.hadoop.hbase.io.*; import org.junit.*;
|
[
"org.apache.hadoop",
"org.junit"
] |
org.apache.hadoop; org.junit;
| 2,601,620
|
private static List<Value> compact(Value[] values) {
List<Value> list = Lists.newArrayListWithCapacity(values.length);
for (Value value : values) {
if (value != null) {
list.add(value);
}
}
return list;
}
|
static List<Value> function(Value[] values) { List<Value> list = Lists.newArrayListWithCapacity(values.length); for (Value value : values) { if (value != null) { list.add(value); } } return list; }
|
/**
* Removes all {@code null} values from the given array.
*
* @param values value array
* @return value list without {@code null} entries
*/
|
Removes all null values from the given array
|
compact
|
{
"repo_name": "code-distillery/jackrabbit-oak",
"path": "oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/NodeImpl.java",
"license": "apache-2.0",
"size": 62456
}
|
[
"com.google.common.collect.Lists",
"java.util.List",
"javax.jcr.Value"
] |
import com.google.common.collect.Lists; import java.util.List; import javax.jcr.Value;
|
import com.google.common.collect.*; import java.util.*; import javax.jcr.*;
|
[
"com.google.common",
"java.util",
"javax.jcr"
] |
com.google.common; java.util; javax.jcr;
| 645,274
|
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
}
|
void function(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { super.looseUnmarshal(wireFormat, o, dataIn); }
|
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
|
Un-marshal an object instance from the data input stream
|
looseUnmarshal
|
{
"repo_name": "Mark-Booth/daq-eclipse",
"path": "uk.ac.diamond.org.apache.activemq/org/apache/activemq/openwire/v1/DataStructureSupportMarshaller.java",
"license": "epl-1.0",
"size": 3208
}
|
[
"java.io.DataInput",
"java.io.IOException",
"org.apache.activemq.openwire.OpenWireFormat"
] |
import java.io.DataInput; import java.io.IOException; import org.apache.activemq.openwire.OpenWireFormat;
|
import java.io.*; import org.apache.activemq.openwire.*;
|
[
"java.io",
"org.apache.activemq"
] |
java.io; org.apache.activemq;
| 1,936,521
|
@Test
public void annotationConstraint() {
Constraint constraint = getConstraint("AnnotationConstraint.json");
assertThat(constraint, instanceOf(AnnotationConstraint.class));
AnnotationConstraint annotationConstraint = (AnnotationConstraint) constraint;
assertThat(annotationConstraint.key(), is("key"));
assertThat(annotationConstraint.threshold(), is(123.0D));
}
|
void function() { Constraint constraint = getConstraint(STR); assertThat(constraint, instanceOf(AnnotationConstraint.class)); AnnotationConstraint annotationConstraint = (AnnotationConstraint) constraint; assertThat(annotationConstraint.key(), is("key")); assertThat(annotationConstraint.threshold(), is(123.0D)); }
|
/**
* Tests annotation constraint.
*/
|
Tests annotation constraint
|
annotationConstraint
|
{
"repo_name": "sonu283304/onos",
"path": "core/common/src/test/java/org/onosproject/codec/impl/ConstraintCodecTest.java",
"license": "apache-2.0",
"size": 7418
}
|
[
"org.hamcrest.MatcherAssert",
"org.hamcrest.Matchers",
"org.onosproject.net.intent.Constraint",
"org.onosproject.net.intent.constraint.AnnotationConstraint"
] |
import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.onosproject.net.intent.Constraint; import org.onosproject.net.intent.constraint.AnnotationConstraint;
|
import org.hamcrest.*; import org.onosproject.net.intent.*; import org.onosproject.net.intent.constraint.*;
|
[
"org.hamcrest",
"org.onosproject.net"
] |
org.hamcrest; org.onosproject.net;
| 151,421
|
Class<?>[] inspectedClasses = new Class<?>[] { VDS.class, VdsStatic.class, VdsDynamic.class };
mUpdateVdsStatic =
new ObjectIdentityChecker(VdsHandler.class, Arrays.asList(inspectedClasses));
for (Pair<EditableField, Field> pair : extractAnnotatedFields(EditableField.class, inspectedClasses)) {
mUpdateVdsStatic.AddPermittedFields(pair.getSecond().getName());
}
for (Pair<EditableOnVdsStatus, Field> pair : extractAnnotatedFields(EditableOnVdsStatus.class, inspectedClasses)) {
mUpdateVdsStatic.AddField(Arrays.asList(pair.getFirst().statuses()), pair.getSecond().getName());
}
}
public VdsHandler() {
mUpdateVdsStatic.setContainer(this);
}
|
Class<?>[] inspectedClasses = new Class<?>[] { VDS.class, VdsStatic.class, VdsDynamic.class }; mUpdateVdsStatic = new ObjectIdentityChecker(VdsHandler.class, Arrays.asList(inspectedClasses)); for (Pair<EditableField, Field> pair : extractAnnotatedFields(EditableField.class, inspectedClasses)) { mUpdateVdsStatic.AddPermittedFields(pair.getSecond().getName()); } for (Pair<EditableOnVdsStatus, Field> pair : extractAnnotatedFields(EditableOnVdsStatus.class, inspectedClasses)) { mUpdateVdsStatic.AddField(Arrays.asList(pair.getFirst().statuses()), pair.getSecond().getName()); } } public VdsHandler() { mUpdateVdsStatic.setContainer(this); }
|
/**
* Initialize static list containers, for identity and permission check. The initialization should be executed
* before calling ObjectIdentityChecker.
*
* @see Backend#InitHandlers
*/
|
Initialize static list containers, for identity and permission check. The initialization should be executed before calling ObjectIdentityChecker
|
init
|
{
"repo_name": "jtux270/translate",
"path": "ovirt/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsHandler.java",
"license": "gpl-3.0",
"size": 5154
}
|
[
"java.lang.reflect.Field",
"java.util.Arrays",
"org.ovirt.engine.core.common.businessentities.EditableField",
"org.ovirt.engine.core.common.businessentities.EditableOnVdsStatus",
"org.ovirt.engine.core.common.businessentities.VdsDynamic",
"org.ovirt.engine.core.common.businessentities.VdsStatic",
"org.ovirt.engine.core.common.utils.Pair",
"org.ovirt.engine.core.utils.ObjectIdentityChecker"
] |
import java.lang.reflect.Field; import java.util.Arrays; import org.ovirt.engine.core.common.businessentities.EditableField; import org.ovirt.engine.core.common.businessentities.EditableOnVdsStatus; import org.ovirt.engine.core.common.businessentities.VdsDynamic; import org.ovirt.engine.core.common.businessentities.VdsStatic; import org.ovirt.engine.core.common.utils.Pair; import org.ovirt.engine.core.utils.ObjectIdentityChecker;
|
import java.lang.reflect.*; import java.util.*; import org.ovirt.engine.core.common.businessentities.*; import org.ovirt.engine.core.common.utils.*; import org.ovirt.engine.core.utils.*;
|
[
"java.lang",
"java.util",
"org.ovirt.engine"
] |
java.lang; java.util; org.ovirt.engine;
| 1,593,962
|
public Map.Entry<String, DatabaseBranch> findWinnerBranch(DatabaseBranches allBranches)
throws Exception {
Entry<String, DatabaseBranch> winnersNameAndBranch = findWinnersNameAndBranch(allBranches);
if (winnersNameAndBranch != null) {
String winnersName = winnersNameAndBranch.getKey();
DatabaseBranch winnersBranch = winnersNameAndBranch.getValue();
if (logger.isLoggable(Level.INFO)) {
logger.log(Level.INFO, "- Winner is " + winnersName + " with branch: ");
for (DatabaseVersionHeader databaseVersionHeader : winnersBranch.getAll()) {
logger.log(Level.INFO, " + " + databaseVersionHeader);
}
}
return winnersNameAndBranch;
}
else {
return null;
}
}
|
Map.Entry<String, DatabaseBranch> function(DatabaseBranches allBranches) throws Exception { Entry<String, DatabaseBranch> winnersNameAndBranch = findWinnersNameAndBranch(allBranches); if (winnersNameAndBranch != null) { String winnersName = winnersNameAndBranch.getKey(); DatabaseBranch winnersBranch = winnersNameAndBranch.getValue(); if (logger.isLoggable(Level.INFO)) { logger.log(Level.INFO, STR + winnersName + STR); for (DatabaseVersionHeader databaseVersionHeader : winnersBranch.getAll()) { logger.log(Level.INFO, STR + databaseVersionHeader); } } return winnersNameAndBranch; } else { return null; } }
|
/**
* Implements the core synchronization algorithm as described {@link DatabaseReconciliator in the class description}.
*
* @param localMachineName Client name of the local machine (required for branch stitching)
* @param localBranch Local branch, created from the local database
* @param unknownRemoteBranches Newly downloaded unknown remote branches (incomplete branches; will be stitched)
* @return Returns the branch of the winning client
*/
|
Implements the core synchronization algorithm as described <code>DatabaseReconciliator in the class description</code>
|
findWinnerBranch
|
{
"repo_name": "syncany/syncany-plugin-gui",
"path": "core/syncany-lib/src/main/java/org/syncany/operations/down/DatabaseReconciliator.java",
"license": "gpl-3.0",
"size": 9095
}
|
[
"java.util.Map",
"java.util.logging.Level",
"org.syncany.database.DatabaseVersionHeader"
] |
import java.util.Map; import java.util.logging.Level; import org.syncany.database.DatabaseVersionHeader;
|
import java.util.*; import java.util.logging.*; import org.syncany.database.*;
|
[
"java.util",
"org.syncany.database"
] |
java.util; org.syncany.database;
| 2,565,870
|
public List<Short> asPathSet() {
return this.aspathSet;
}
|
List<Short> function() { return this.aspathSet; }
|
/**
* Returns list of ASNum in ASpath SET.
*
* @return list of ASNum in ASpath SET
*/
|
Returns list of ASNum in ASpath SET
|
asPathSet
|
{
"repo_name": "donNewtonAlpha/onos",
"path": "protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/types/AsPath.java",
"license": "apache-2.0",
"size": 7238
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 280,943
|
@Override
public List<FacesConfig> getClassloaderFacesConfig(ExternalContext ectx)
{
List<FacesConfig> appConfigResources = new ArrayList<FacesConfig>();
try
{
FacesConfigResourceProvider provider = FacesConfigResourceProviderFactory.
getFacesConfigResourceProviderFactory(ectx).createFacesConfigResourceProvider(ectx);
Collection<URL> facesConfigs = provider.getMetaInfConfigurationResources(ectx);
for (URL url : facesConfigs)
{
if (MyfacesConfig.getCurrentInstance(ectx).isValidateXML())
{
validateFacesConfig(ectx, url);
}
InputStream stream = null;
try
{
stream = openStreamWithoutCache(url);
if (log.isLoggable(Level.INFO))
{
log.info("Reading config : " + url.toExternalForm());
}
appConfigResources.add(getUnmarshaller(ectx).getFacesConfig(stream, url.toExternalForm()));
//getDispenser().feed(getUnmarshaller().getFacesConfig(stream, entry.getKey()));
}
finally
{
if (stream != null)
{
stream.close();
}
}
}
}
catch (Throwable e)
{
throw new FacesException(e);
}
return appConfigResources;
}
|
List<FacesConfig> function(ExternalContext ectx) { List<FacesConfig> appConfigResources = new ArrayList<FacesConfig>(); try { FacesConfigResourceProvider provider = FacesConfigResourceProviderFactory. getFacesConfigResourceProviderFactory(ectx).createFacesConfigResourceProvider(ectx); Collection<URL> facesConfigs = provider.getMetaInfConfigurationResources(ectx); for (URL url : facesConfigs) { if (MyfacesConfig.getCurrentInstance(ectx).isValidateXML()) { validateFacesConfig(ectx, url); } InputStream stream = null; try { stream = openStreamWithoutCache(url); if (log.isLoggable(Level.INFO)) { log.info(STR + url.toExternalForm()); } appConfigResources.add(getUnmarshaller(ectx).getFacesConfig(stream, url.toExternalForm())); } finally { if (stream != null) { stream.close(); } } } } catch (Throwable e) { throw new FacesException(e); } return appConfigResources; }
|
/**
* This method fixes MYFACES-208
*/
|
This method fixes MYFACES-208
|
getClassloaderFacesConfig
|
{
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/config/DefaultFacesConfigurationProvider.java",
"license": "epl-1.0",
"size": 34114
}
|
[
"java.io.InputStream",
"java.util.ArrayList",
"java.util.Collection",
"java.util.List",
"java.util.logging.Level",
"javax.faces.FacesException",
"javax.faces.context.ExternalContext",
"org.apache.myfaces.config.element.FacesConfig",
"org.apache.myfaces.shared.config.MyfacesConfig",
"org.apache.myfaces.spi.FacesConfigResourceProvider",
"org.apache.myfaces.spi.FacesConfigResourceProviderFactory"
] |
import java.io.InputStream; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.logging.Level; import javax.faces.FacesException; import javax.faces.context.ExternalContext; import org.apache.myfaces.config.element.FacesConfig; import org.apache.myfaces.shared.config.MyfacesConfig; import org.apache.myfaces.spi.FacesConfigResourceProvider; import org.apache.myfaces.spi.FacesConfigResourceProviderFactory;
|
import java.io.*; import java.util.*; import java.util.logging.*; import javax.faces.*; import javax.faces.context.*; import org.apache.myfaces.config.element.*; import org.apache.myfaces.shared.config.*; import org.apache.myfaces.spi.*;
|
[
"java.io",
"java.util",
"javax.faces",
"org.apache.myfaces"
] |
java.io; java.util; javax.faces; org.apache.myfaces;
| 1,192,102
|
public static InputStream getFile(String fileName) throws InvalidKeyException, NoSuchAlgorithmException, IOException {
InputStream fileStream = null;
if(fileName == null || fileName.length() == 0) {
throw new IllegalArgumentException("File name cannot be null or empty");
}
//build URL
String strURL = FILE_URI + Uri.encode(fileName);
//sign URL
String signedURL = Utils.sign(strURL);
fileStream = Utils.processCommand(signedURL, "GET");
return fileStream;
}
|
static InputStream function(String fileName) throws InvalidKeyException, NoSuchAlgorithmException, IOException { InputStream fileStream = null; if(fileName == null fileName.length() == 0) { throw new IllegalArgumentException(STR); } String strURL = FILE_URI + Uri.encode(fileName); String signedURL = Utils.sign(strURL); fileStream = Utils.processCommand(signedURL, "GET"); return fileStream; }
|
/**
* Get file from Aspose server
* @param fileName File name
*/
|
Get file from Aspose server
|
getFile
|
{
"repo_name": "asposeforcloud/Aspose_Cloud_SDK_For_Android",
"path": "asposecloudsdk/src/main/java/com/aspose/cloud/sdk/storage/api/Folder.java",
"license": "mit",
"size": 13073
}
|
[
"android.net.Uri",
"com.aspose.cloud.sdk.common.Utils",
"java.io.IOException",
"java.io.InputStream",
"java.security.InvalidKeyException",
"java.security.NoSuchAlgorithmException"
] |
import android.net.Uri; import com.aspose.cloud.sdk.common.Utils; import java.io.IOException; import java.io.InputStream; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException;
|
import android.net.*; import com.aspose.cloud.sdk.common.*; import java.io.*; import java.security.*;
|
[
"android.net",
"com.aspose.cloud",
"java.io",
"java.security"
] |
android.net; com.aspose.cloud; java.io; java.security;
| 2,522,969
|
@Endpoint(
describeByClass = true
)
public static StaticRegexReplace create(Scope scope, Operand<TString> input, String pattern,
String rewrite, Options... options) {
OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StaticRegexReplace");
opBuilder.addInput(input.asOutput());
opBuilder.setAttr("pattern", pattern);
opBuilder.setAttr("rewrite", rewrite);
if (options != null) {
for (Options opts : options) {
if (opts.replaceGlobal != null) {
opBuilder.setAttr("replace_global", opts.replaceGlobal);
}
}
}
return new StaticRegexReplace(opBuilder.build());
}
|
@Endpoint( describeByClass = true ) static StaticRegexReplace function(Scope scope, Operand<TString> input, String pattern, String rewrite, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, STR); opBuilder.addInput(input.asOutput()); opBuilder.setAttr(STR, pattern); opBuilder.setAttr(STR, rewrite); if (options != null) { for (Options opts : options) { if (opts.replaceGlobal != null) { opBuilder.setAttr(STR, opts.replaceGlobal); } } } return new StaticRegexReplace(opBuilder.build()); }
|
/**
* Factory method to create a class wrapping a new StaticRegexReplace operation.
*
* @param scope current scope
* @param input The text to be processed.
* @param pattern The regular expression to match the input.
* @param rewrite The rewrite to be applied to the matched expression.
* @param options carries optional attribute values
* @return a new instance of StaticRegexReplace
*/
|
Factory method to create a class wrapping a new StaticRegexReplace operation
|
create
|
{
"repo_name": "tensorflow/java",
"path": "tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StaticRegexReplace.java",
"license": "apache-2.0",
"size": 5100
}
|
[
"org.tensorflow.Operand",
"org.tensorflow.OperationBuilder",
"org.tensorflow.op.Scope",
"org.tensorflow.op.annotation.Endpoint",
"org.tensorflow.types.TString"
] |
import org.tensorflow.Operand; import org.tensorflow.OperationBuilder; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.types.TString;
|
import org.tensorflow.*; import org.tensorflow.op.*; import org.tensorflow.op.annotation.*; import org.tensorflow.types.*;
|
[
"org.tensorflow",
"org.tensorflow.op",
"org.tensorflow.types"
] |
org.tensorflow; org.tensorflow.op; org.tensorflow.types;
| 2,656,249
|
protected GeneratorDialect getDialect() {
return getContext().getDialect();
}
|
GeneratorDialect function() { return getContext().getDialect(); }
|
/**
* Resolves the current dialect from the context.
*
* @return the dialect of the current generation context
*/
|
Resolves the current dialect from the context
|
getDialect
|
{
"repo_name": "liefke/org.fastnate",
"path": "fastnate-generator/src/main/java/org/fastnate/generator/context/PrimitiveProperty.java",
"license": "apache-2.0",
"size": 6188
}
|
[
"org.fastnate.generator.dialect.GeneratorDialect"
] |
import org.fastnate.generator.dialect.GeneratorDialect;
|
import org.fastnate.generator.dialect.*;
|
[
"org.fastnate.generator"
] |
org.fastnate.generator;
| 1,074,674
|
public static byte[] getResourceAsBytes(final String name) {
try (InputStream is = getResourceAsStream(name)) {
return streamToBytes(is);
} catch (final IOException e) {
throw new AssertionError(e.getMessage(), e);
}
}
|
static byte[] function(final String name) { try (InputStream is = getResourceAsStream(name)) { return streamToBytes(is); } catch (final IOException e) { throw new AssertionError(e.getMessage(), e); } }
|
/**
* Reads a resource as bytes from the context class loader.
*
* @param name
* name of the resource
* @return input stream
*/
|
Reads a resource as bytes from the context class loader
|
getResourceAsBytes
|
{
"repo_name": "trajano/commons-testing",
"path": "src/main/java/net/trajano/commons/testing/ResourceUtil.java",
"license": "epl-1.0",
"size": 6715
}
|
[
"java.io.IOException",
"java.io.InputStream"
] |
import java.io.IOException; import java.io.InputStream;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,254,317
|
@Test
public void testPostWorksheetUnmerge() {
System.out.println("PostWorksheetUnmerge");
String name = "test_cells.xlsx";
String sheetName = "Sheet1";
Integer startRow = 1;
Integer startColumn = 1;
Integer totalRows = 2;
Integer totalColumns = 2;
String storage = "";
String folder = "";
try {
SaaSposeResponse result = cellsApi.PostWorksheetUnmerge(name, sheetName, startRow, startColumn, totalRows, totalColumns, storage, folder);
} catch (ApiException apiException) {
System.out.println("exp:" + apiException.getMessage());
assertNull(apiException);
}
}
|
void function() { System.out.println(STR); String name = STR; String sheetName = STR; Integer startRow = 1; Integer startColumn = 1; Integer totalRows = 2; Integer totalColumns = 2; String storage = STRSTRexp:" + apiException.getMessage()); assertNull(apiException); } }
|
/**
* Test of PostWorksheetUnmerge method, of class CellsApi.
*/
|
Test of PostWorksheetUnmerge method, of class CellsApi
|
testPostWorksheetUnmerge
|
{
"repo_name": "aspose-cells/Aspose.Cells-for-Cloud",
"path": "SDKs/Aspose.Cells-Cloud-SDK-for-Android/Aspose.Cells-Cloud-SDK-Android/src/test/java/com/aspose/cells/api/CellsApiTest.java",
"license": "mit",
"size": 91749
}
|
[
"org.junit.Assert"
] |
import org.junit.Assert;
|
import org.junit.*;
|
[
"org.junit"
] |
org.junit;
| 239,823
|
public static Scheme getSourceScheme(String inputPath) throws IOException {
Path path = new Path(inputPath + "/" + schemeFileName);
FileSystem fs = path.getFileSystem(new Configuration());
try {
FSDataInputStream file = fs.open(path);
ObjectInputStream ois = new ObjectInputStream(file);
Scheme scheme = (Scheme) ois.readObject();
Fields fields = (Fields) ois.readObject();
scheme.setSourceFields(fields);
ois.close();
file.close();
return scheme;
} catch (ClassNotFoundException e) {
throw new IOException("Could not read PyCascading file header: " + inputPath + "/"
+ schemeFileName);
}
}
|
static Scheme function(String inputPath) throws IOException { Path path = new Path(inputPath + "/" + schemeFileName); FileSystem fs = path.getFileSystem(new Configuration()); try { FSDataInputStream file = fs.open(path); ObjectInputStream ois = new ObjectInputStream(file); Scheme scheme = (Scheme) ois.readObject(); Fields fields = (Fields) ois.readObject(); scheme.setSourceFields(fields); ois.close(); file.close(); return scheme; } catch (ClassNotFoundException e) { throw new IOException(STR + inputPath + "/" + schemeFileName); } }
|
/**
* Call this to get the original Cascading scheme that the data was written
* in.
*
* @param inputPath
* The path to where the scheme information was stored (normally the
* same as the path to the data)
* @return The Cascading scheme that was used when the data was written.
* @throws IOException
*/
|
Call this to get the original Cascading scheme that the data was written in
|
getSourceScheme
|
{
"repo_name": "twitter/pycascading",
"path": "java/src/com/twitter/pycascading/MetaScheme.java",
"license": "apache-2.0",
"size": 6808
}
|
[
"java.io.IOException",
"java.io.ObjectInputStream",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.fs.FSDataInputStream",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path"
] |
import java.io.IOException; import java.io.ObjectInputStream; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path;
|
import java.io.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.fs.*;
|
[
"java.io",
"org.apache.hadoop"
] |
java.io; org.apache.hadoop;
| 2,428,201
|
private Element composeSidebar(Element item) throws Exception {
Element result = null;
result = DocumentHelper.createElement(SIDEBAR);
result.addElement(TITLE).addAttribute("inline", "true").setText(
item.attributeValue(TITLE));
if (item.attributeValue("subExiste").equals("true")) {
result.addElement(SUBTITLE).addAttribute("inline", "true").setText(
item.attributeValue(SUBTITLE));
}
String text = item.getText();
Document doc = newJRSTReader(new StringReader(text));
result.appendContent(doc.getRootElement());
return result;
}
|
Element function(Element item) throws Exception { Element result = null; result = DocumentHelper.createElement(SIDEBAR); result.addElement(TITLE).addAttribute(STR, "true").setText( item.attributeValue(TITLE)); if (item.attributeValue(STR).equals("true")) { result.addElement(SUBTITLE).addAttribute(STR, "true").setText( item.attributeValue(SUBTITLE)); } String text = item.getText(); Document doc = newJRSTReader(new StringReader(text)); result.appendContent(doc.getRootElement()); return result; }
|
/**
* <pre>
* .. sidebar:: Title
* :subtitle: If Desired
*
* Body.
* </pre>
*
* @param Element
* @return Element
* @throws Exception
*/
|
<code> .. sidebar:: Title :subtitle: If Desired Body. </code>
|
composeSidebar
|
{
"repo_name": "vorburger/JRst",
"path": "jrst/src/main/java/org/nuiton/jrst/JRSTReader.java",
"license": "lgpl-3.0",
"size": 85804
}
|
[
"java.io.StringReader",
"org.dom4j.Document",
"org.dom4j.DocumentHelper",
"org.dom4j.Element"
] |
import java.io.StringReader; import org.dom4j.Document; import org.dom4j.DocumentHelper; import org.dom4j.Element;
|
import java.io.*; import org.dom4j.*;
|
[
"java.io",
"org.dom4j"
] |
java.io; org.dom4j;
| 250,327
|
@Test
public void testSessionScratchDirs() throws Exception {
// Stop HiveServer2
stopMiniHS2();
HiveConf conf = new HiveConf();
String userName;
Path scratchDirPath;
// Set a custom prefix for hdfs scratch dir path
conf.set("hive.exec.scratchdir", tmpDir + "/hs2");
// Set a scratch dir permission
String fsPermissionStr = "700";
conf.set("hive.scratch.dir.permission", fsPermissionStr);
// Start an instance of HiveServer2 which uses miniMR
startMiniHS2(conf);
// 1. Test with doAs=false
String sessionConf="hive.server2.enable.doAs=false";
userName = System.getProperty("user.name");
Connection conn = getConnection(miniHS2.getJdbcURL(testDbName, sessionConf), userName, "password");
// FS
FileSystem fs = miniHS2.getLocalFS();
FsPermission expectedFSPermission = new FsPermission(HiveConf.getVar(conf,
HiveConf.ConfVars.SCRATCHDIRPERMISSION));
// Verify scratch dir paths and permission
// HDFS scratch dir
scratchDirPath = new Path(HiveConf.getVar(conf, HiveConf.ConfVars.SCRATCHDIR) + "/" + userName);
verifyScratchDir(conf, fs, scratchDirPath, expectedFSPermission, userName, false);
// Local scratch dir
scratchDirPath = new Path(HiveConf.getVar(conf, HiveConf.ConfVars.LOCALSCRATCHDIR));
verifyScratchDir(conf, fs, scratchDirPath, expectedFSPermission, userName, true);
// Downloaded resources dir
scratchDirPath = new Path(HiveConf.getVar(conf, HiveConf.ConfVars.DOWNLOADED_RESOURCES_DIR));
verifyScratchDir(conf, fs, scratchDirPath, expectedFSPermission, userName, true);
conn.close();
// 2. Test with doAs=true
sessionConf="hive.server2.enable.doAs=true";
// Test for user "neo"
userName = "neo";
conn = getConnection(miniHS2.getJdbcURL(testDbName, sessionConf), userName, "the-one");
// Verify scratch dir paths and permission
// HDFS scratch dir
scratchDirPath = new Path(HiveConf.getVar(conf, HiveConf.ConfVars.SCRATCHDIR) + "/" + userName);
verifyScratchDir(conf, fs, scratchDirPath, expectedFSPermission, userName, false);
// Local scratch dir
scratchDirPath = new Path(HiveConf.getVar(conf, HiveConf.ConfVars.LOCALSCRATCHDIR));
verifyScratchDir(conf, fs, scratchDirPath, expectedFSPermission, userName, true);
// Downloaded resources dir
scratchDirPath = new Path(HiveConf.getVar(conf, HiveConf.ConfVars.DOWNLOADED_RESOURCES_DIR));
verifyScratchDir(conf, fs, scratchDirPath, expectedFSPermission, userName, true);
conn.close();
// Restore original state
restoreMiniHS2AndConnections();
}
|
void function() throws Exception { stopMiniHS2(); HiveConf conf = new HiveConf(); String userName; Path scratchDirPath; conf.set(STR, tmpDir + "/hs2"); String fsPermissionStr = "700"; conf.set(STR, fsPermissionStr); startMiniHS2(conf); String sessionConf=STR; userName = System.getProperty(STR); Connection conn = getConnection(miniHS2.getJdbcURL(testDbName, sessionConf), userName, STR); FileSystem fs = miniHS2.getLocalFS(); FsPermission expectedFSPermission = new FsPermission(HiveConf.getVar(conf, HiveConf.ConfVars.SCRATCHDIRPERMISSION)); scratchDirPath = new Path(HiveConf.getVar(conf, HiveConf.ConfVars.SCRATCHDIR) + "/" + userName); verifyScratchDir(conf, fs, scratchDirPath, expectedFSPermission, userName, false); scratchDirPath = new Path(HiveConf.getVar(conf, HiveConf.ConfVars.LOCALSCRATCHDIR)); verifyScratchDir(conf, fs, scratchDirPath, expectedFSPermission, userName, true); scratchDirPath = new Path(HiveConf.getVar(conf, HiveConf.ConfVars.DOWNLOADED_RESOURCES_DIR)); verifyScratchDir(conf, fs, scratchDirPath, expectedFSPermission, userName, true); conn.close(); sessionConf=STR; userName = "neo"; conn = getConnection(miniHS2.getJdbcURL(testDbName, sessionConf), userName, STR); scratchDirPath = new Path(HiveConf.getVar(conf, HiveConf.ConfVars.SCRATCHDIR) + "/" + userName); verifyScratchDir(conf, fs, scratchDirPath, expectedFSPermission, userName, false); scratchDirPath = new Path(HiveConf.getVar(conf, HiveConf.ConfVars.LOCALSCRATCHDIR)); verifyScratchDir(conf, fs, scratchDirPath, expectedFSPermission, userName, true); scratchDirPath = new Path(HiveConf.getVar(conf, HiveConf.ConfVars.DOWNLOADED_RESOURCES_DIR)); verifyScratchDir(conf, fs, scratchDirPath, expectedFSPermission, userName, true); conn.close(); restoreMiniHS2AndConnections(); }
|
/**
* Tests the creation of the 3 scratch dirs: hdfs, local, downloaded resources (which is also local).
* 1. Test with doAs=false: open a new JDBC session and verify the presence of directories/permissions
* 2. Test with doAs=true: open a new JDBC session and verify the presence of directories/permissions
* @throws Exception
*/
|
Tests the creation of the 3 scratch dirs: hdfs, local, downloaded resources (which is also local). 1. Test with doAs=false: open a new JDBC session and verify the presence of directories/permissions 2. Test with doAs=true: open a new JDBC session and verify the presence of directories/permissions
|
testSessionScratchDirs
|
{
"repo_name": "alanfgates/hive",
"path": "itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java",
"license": "apache-2.0",
"size": 64842
}
|
[
"java.sql.Connection",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.fs.permission.FsPermission",
"org.apache.hadoop.hive.conf.HiveConf"
] |
import java.sql.Connection; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.hive.conf.HiveConf;
|
import java.sql.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.fs.permission.*; import org.apache.hadoop.hive.conf.*;
|
[
"java.sql",
"org.apache.hadoop"
] |
java.sql; org.apache.hadoop;
| 1,175,123
|
public void registerCommand(CommandHolder commandHolder) {
try {
commandManager.registerCommand(commandHolder);
} catch (CommandRegistrationException ex) {
getLogger().info("The following errors happened while registering the class " + commandHolder.getClass().toString() + ":");
for (String error : ex.getAllErrors()) {
getLogger().info(error);
}
}
}
|
void function(CommandHolder commandHolder) { try { commandManager.registerCommand(commandHolder); } catch (CommandRegistrationException ex) { getLogger().info(STR + commandHolder.getClass().toString() + ":"); for (String error : ex.getAllErrors()) { getLogger().info(error); } } }
|
/**
* This method is used to register a class implementing the {@link CommandHolder} interface with the {@link CommandManager}.
* It is possible that a method cannot be registered which will disable the method but it will not interfere with the rest of the class.
*
* @param commandHolder a class that provides commands
*/
|
This method is used to register a class implementing the <code>CommandHolder</code> interface with the <code>CommandManager</code>. It is possible that a method cannot be registered which will disable the method but it will not interfere with the rest of the class
|
registerCommand
|
{
"repo_name": "Viciouss/BasePlugin",
"path": "src/main/java/de/doncarnage/minecraft/baseplugin/BasePlugin.java",
"license": "lgpl-3.0",
"size": 11337
}
|
[
"de.doncarnage.minecraft.common.commandhandler.manager.CommandHolder",
"de.doncarnage.minecraft.common.commandhandler.manager.CommandRegistrationException"
] |
import de.doncarnage.minecraft.common.commandhandler.manager.CommandHolder; import de.doncarnage.minecraft.common.commandhandler.manager.CommandRegistrationException;
|
import de.doncarnage.minecraft.common.commandhandler.manager.*;
|
[
"de.doncarnage.minecraft"
] |
de.doncarnage.minecraft;
| 2,800,453
|
public VersionInfo getVersionInfo() {
String versionResponse = sendCommand(new VersionCommand());
return parser.parse(versionResponse, VersionInfo.class);
}
|
VersionInfo function() { String versionResponse = sendCommand(new VersionCommand()); return parser.parse(versionResponse, VersionInfo.class); }
|
/**
* Retrieve the version information of the mower and module. See {@link VersionInfo} for details.
*
* @return - the Version Information including the successful status.
*/
|
Retrieve the version information of the mower and module. See <code>VersionInfo</code> for details
|
getVersionInfo
|
{
"repo_name": "MikeJMajor/openhab2-addons-dlinksmarthome",
"path": "bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/RobonectClient.java",
"license": "epl-1.0",
"size": 12697
}
|
[
"org.openhab.binding.robonect.internal.model.VersionInfo",
"org.openhab.binding.robonect.internal.model.cmd.VersionCommand"
] |
import org.openhab.binding.robonect.internal.model.VersionInfo; import org.openhab.binding.robonect.internal.model.cmd.VersionCommand;
|
import org.openhab.binding.robonect.internal.model.*; import org.openhab.binding.robonect.internal.model.cmd.*;
|
[
"org.openhab.binding"
] |
org.openhab.binding;
| 2,198,361
|
public void setDefaultVirtualKeyboard(VirtualKeyboardInterface vkb){
if(vkb != null){
selectedVirtualKeyboard = vkb.getVirtualKeyboardName();
if(!virtualKeyboards.containsKey(selectedVirtualKeyboard)){
registerVirtualKeyboard(vkb);
}
}else{
selectedVirtualKeyboard = null;
}
}
|
void function(VirtualKeyboardInterface vkb){ if(vkb != null){ selectedVirtualKeyboard = vkb.getVirtualKeyboardName(); if(!virtualKeyboards.containsKey(selectedVirtualKeyboard)){ registerVirtualKeyboard(vkb); } }else{ selectedVirtualKeyboard = null; } }
|
/**
* Sets the default virtual keyboard to be used by the platform
*
* @param vkb a VirtualKeyboard to be used or null to disable the
* VirtualKeyboard
*/
|
Sets the default virtual keyboard to be used by the platform
|
setDefaultVirtualKeyboard
|
{
"repo_name": "jgittings/chainbench",
"path": "LWUIT_1_5/UI/src/com/sun/lwuit/Display.java",
"license": "apache-2.0",
"size": 86759
}
|
[
"com.sun.lwuit.impl.VirtualKeyboardInterface"
] |
import com.sun.lwuit.impl.VirtualKeyboardInterface;
|
import com.sun.lwuit.impl.*;
|
[
"com.sun.lwuit"
] |
com.sun.lwuit;
| 1,863,307
|
public static TProtocolFactory get(SerializationFormat serializationFormat) {
requireNonNull(serializationFormat, "serializationFormat");
if (serializationFormat == ThriftSerializationFormats.BINARY) {
return BINARY;
}
if (serializationFormat == ThriftSerializationFormats.COMPACT) {
return COMPACT;
}
if (serializationFormat == ThriftSerializationFormats.JSON) {
return JSON;
}
if (serializationFormat == ThriftSerializationFormats.TEXT) {
return TEXT;
}
throw new IllegalArgumentException("non-Thrift serializationFormat: " + serializationFormat);
}
|
static TProtocolFactory function(SerializationFormat serializationFormat) { requireNonNull(serializationFormat, STR); if (serializationFormat == ThriftSerializationFormats.BINARY) { return BINARY; } if (serializationFormat == ThriftSerializationFormats.COMPACT) { return COMPACT; } if (serializationFormat == ThriftSerializationFormats.JSON) { return JSON; } if (serializationFormat == ThriftSerializationFormats.TEXT) { return TEXT; } throw new IllegalArgumentException(STR + serializationFormat); }
|
/**
* Returns the {@link TProtocolFactory} for the specified {@link SerializationFormat}.
*
* @throws IllegalArgumentException if the specified {@link SerializationFormat} is not for Thrift
*/
|
Returns the <code>TProtocolFactory</code> for the specified <code>SerializationFormat</code>
|
get
|
{
"repo_name": "imasahiro/armeria",
"path": "thrift/src/main/java/com/linecorp/armeria/common/thrift/ThriftProtocolFactories.java",
"license": "apache-2.0",
"size": 4565
}
|
[
"com.linecorp.armeria.common.SerializationFormat",
"java.util.Objects",
"org.apache.thrift.protocol.TProtocolFactory"
] |
import com.linecorp.armeria.common.SerializationFormat; import java.util.Objects; import org.apache.thrift.protocol.TProtocolFactory;
|
import com.linecorp.armeria.common.*; import java.util.*; import org.apache.thrift.protocol.*;
|
[
"com.linecorp.armeria",
"java.util",
"org.apache.thrift"
] |
com.linecorp.armeria; java.util; org.apache.thrift;
| 2,853,456
|
@Transactional(readOnly = true)
public Page<Marker> listMarkerByMarkers(List<Long> ids, PageRequest pageable)
{
return this.markerRepository.listByMarkers(ids, pageable);
}
|
@Transactional(readOnly = true) Page<Marker> function(List<Long> ids, PageRequest pageable) { return this.markerRepository.listByMarkers(ids, pageable); }
|
/**
* Method to list {@link FonteDados} pageable with filter options
*
* @param filter
* @param pageable
* @return
*/
|
Method to list <code>FonteDados</code> pageable with filter options
|
listMarkerByMarkers
|
{
"repo_name": "haroldoramirez/geocab",
"path": "implementation/solution/src/main/java/br/com/geocab/domain/service/MarkerService.java",
"license": "gpl-2.0",
"size": 15230
}
|
[
"br.com.geocab.domain.entity.marker.Marker",
"java.util.List",
"org.springframework.data.domain.Page",
"org.springframework.data.domain.PageRequest",
"org.springframework.transaction.annotation.Transactional"
] |
import br.com.geocab.domain.entity.marker.Marker; import java.util.List; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.transaction.annotation.Transactional;
|
import br.com.geocab.domain.entity.marker.*; import java.util.*; import org.springframework.data.domain.*; import org.springframework.transaction.annotation.*;
|
[
"br.com.geocab",
"java.util",
"org.springframework.data",
"org.springframework.transaction"
] |
br.com.geocab; java.util; org.springframework.data; org.springframework.transaction;
| 2,752,482
|
private static boolean isPathAuthorized(String resourcePath, String authorizedLocation, Set<String> excludedPaths) {
if (excludedPaths != null) {
for (String excludedFolder : excludedPaths) {
if (resourcePath.startsWith(excludedFolder)) {
return false;
}
}
return true;
}
else if (resourcePath.startsWith(authorizedLocation)) {
return true;
}
else {
return false;
}
}
private WebResourceScanner() {
throw new AssertionError();
}
|
static boolean function(String resourcePath, String authorizedLocation, Set<String> excludedPaths) { if (excludedPaths != null) { for (String excludedFolder : excludedPaths) { if (resourcePath.startsWith(excludedFolder)) { return false; } } return true; } else if (resourcePath.startsWith(authorizedLocation)) { return true; } else { return false; } } private WebResourceScanner() { throw new AssertionError(); }
|
/**
* <p>
* Tests whether the given {@code path} is authorized according to the passed
* list of paths to exclude.
* </p>
*
* @param path
* The path name that must not be present in the list of excluded
* paths.
* @param authorizedLocation
* Current location being scanned by the scanner.
* @param excludedPaths
* List of paths which will be excluded during the classpath
* scanning.
* @return {@code true} if the path is authorized, otherwise {@code false}.
*/
|
Tests whether the given path is authorized according to the passed list of paths to exclude.
|
isPathAuthorized
|
{
"repo_name": "pioto/dandelion",
"path": "dandelion-core/src/main/java/com/github/dandelion/core/util/scanner/WebResourceScanner.java",
"license": "bsd-3-clause",
"size": 10168
}
|
[
"java.util.Set"
] |
import java.util.Set;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 415,242
|
checkState(!mStarted);
// See: b/70518185. It appears start() is being called via onLongPress
// even though we never received an intial handleInterceptedDownEvent
// where we would usually initialize mLastStartedItemPos.
if (mLastStartedItemPos < 0) {
Log.w(TAG, "Illegal state. Can't start without valid mLastStartedItemPos.");
return;
}
// Partner code in MotionInputHandler ensures items
// are selected and range established prior to
// start being called.
// Verify the truth of that statement here
// to make the implicit coupling less of a time bomb.
checkState(mSelectionMgr.isRangeActive());
mLock.checkStopped();
mStarted = true;
mLock.start();
}
|
checkState(!mStarted); if (mLastStartedItemPos < 0) { Log.w(TAG, STR); return; } checkState(mSelectionMgr.isRangeActive()); mLock.checkStopped(); mStarted = true; mLock.start(); }
|
/**
* Explicitly kicks off a gesture multi-select.
*/
|
Explicitly kicks off a gesture multi-select
|
start
|
{
"repo_name": "aosp-mirror/platform_frameworks_support",
"path": "recyclerview-selection/src/main/java/androidx/recyclerview/selection/GestureSelectionHelper.java",
"license": "apache-2.0",
"size": 10517
}
|
[
"android.util.Log",
"androidx.core.util.Preconditions"
] |
import android.util.Log; import androidx.core.util.Preconditions;
|
import android.util.*; import androidx.core.util.*;
|
[
"android.util",
"androidx.core"
] |
android.util; androidx.core;
| 1,562,331
|
public void testDescendingRemove1_NullPointerException() {
try {
ConcurrentNavigableMap c = dmap5();
c.remove(null);
shouldThrow();
} catch (NullPointerException success) {}
}
|
void function() { try { ConcurrentNavigableMap c = dmap5(); c.remove(null); shouldThrow(); } catch (NullPointerException success) {} }
|
/**
* remove(null) throws NPE
*/
|
remove(null) throws NPE
|
testDescendingRemove1_NullPointerException
|
{
"repo_name": "AdmireTheDistance/android_libcore",
"path": "jsr166-tests/src/test/java/jsr166/ConcurrentSkipListSubMapTest.java",
"license": "gpl-2.0",
"size": 42185
}
|
[
"java.util.concurrent.ConcurrentNavigableMap"
] |
import java.util.concurrent.ConcurrentNavigableMap;
|
import java.util.concurrent.*;
|
[
"java.util"
] |
java.util;
| 2,605,834
|
private void addToInvalidates(BlockInfo storedBlock) {
if (!isPopulatingReplQueues()) {
return;
}
StringBuilder datanodes = blockLog.isDebugEnabled()
? new StringBuilder() : null;
for (DatanodeStorageInfo storage : blocksMap.getStorages(storedBlock)) {
if (storage.getState() != State.NORMAL) {
continue;
}
final DatanodeDescriptor node = storage.getDatanodeDescriptor();
final Block b = getBlockOnStorage(storedBlock, storage);
if (b != null) {
invalidateBlocks.add(b, node, false);
if (datanodes != null) {
datanodes.append(node).append(" ");
}
}
}
if (datanodes != null && datanodes.length() != 0) {
blockLog.debug("BLOCK* addToInvalidates: {} {}", storedBlock, datanodes);
}
}
|
void function(BlockInfo storedBlock) { if (!isPopulatingReplQueues()) { return; } StringBuilder datanodes = blockLog.isDebugEnabled() ? new StringBuilder() : null; for (DatanodeStorageInfo storage : blocksMap.getStorages(storedBlock)) { if (storage.getState() != State.NORMAL) { continue; } final DatanodeDescriptor node = storage.getDatanodeDescriptor(); final Block b = getBlockOnStorage(storedBlock, storage); if (b != null) { invalidateBlocks.add(b, node, false); if (datanodes != null) { datanodes.append(node).append(" "); } } } if (datanodes != null && datanodes.length() != 0) { blockLog.debug(STR, storedBlock, datanodes); } }
|
/**
* Adds block to list of blocks which will be invalidated on all its
* datanodes.
*/
|
Adds block to list of blocks which will be invalidated on all its datanodes
|
addToInvalidates
|
{
"repo_name": "dierobotsdie/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java",
"license": "apache-2.0",
"size": 194556
}
|
[
"org.apache.hadoop.hdfs.protocol.Block",
"org.apache.hadoop.hdfs.server.protocol.DatanodeStorage"
] |
import org.apache.hadoop.hdfs.protocol.Block; import org.apache.hadoop.hdfs.server.protocol.DatanodeStorage;
|
import org.apache.hadoop.hdfs.protocol.*; import org.apache.hadoop.hdfs.server.protocol.*;
|
[
"org.apache.hadoop"
] |
org.apache.hadoop;
| 2,519,349
|
protected void processWorkingCopy(NodeRef nodeRef, Form form)
{
// if the node is a working copy ensure that the name field (id present)
// is set to be protected as it can not be edited
if (nodeService.hasAspect(nodeRef, ContentModel.ASPECT_WORKING_COPY))
{
// go through fields looking for name field
for (FieldDefinition fieldDef : form.getFieldDefinitions())
{
if (fieldDef.getName().equals(ContentModel.PROP_NAME.toPrefixString(this.namespaceService)))
{
fieldDef.setProtectedField(true);
if (getLogger().isDebugEnabled())
{
getLogger().debug("Set " + ContentModel.PROP_NAME.toPrefixString(this.namespaceService) +
"field to protected as it is a working copy");
}
break;
}
}
}
}
|
void function(NodeRef nodeRef, Form form) { if (nodeService.hasAspect(nodeRef, ContentModel.ASPECT_WORKING_COPY)) { for (FieldDefinition fieldDef : form.getFieldDefinitions()) { if (fieldDef.getName().equals(ContentModel.PROP_NAME.toPrefixString(this.namespaceService))) { fieldDef.setProtectedField(true); if (getLogger().isDebugEnabled()) { getLogger().debug(STR + ContentModel.PROP_NAME.toPrefixString(this.namespaceService) + STR); } break; } } } }
|
/**
* Determines whether the given node represents a working copy, if it does
* the name field is searched for and set to protected as the name field
* should not be edited for a working copy.
*
* If the node is not a working copy this method has no effect.
*
* @param nodeRef NodeRef of node to check and potentially process
* @param form The generated form
*/
|
Determines whether the given node represents a working copy, if it does the name field is searched for and set to protected as the name field should not be edited for a working copy. If the node is not a working copy this method has no effect
|
processWorkingCopy
|
{
"repo_name": "nguyentienlong/community-edition",
"path": "projects/repository/source/java/org/alfresco/repo/forms/processor/node/NodeFormProcessor.java",
"license": "lgpl-3.0",
"size": 10321
}
|
[
"org.alfresco.model.ContentModel",
"org.alfresco.repo.forms.FieldDefinition",
"org.alfresco.repo.forms.Form",
"org.alfresco.service.cmr.repository.NodeRef"
] |
import org.alfresco.model.ContentModel; import org.alfresco.repo.forms.FieldDefinition; import org.alfresco.repo.forms.Form; import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.model.*; import org.alfresco.repo.forms.*; import org.alfresco.service.cmr.repository.*;
|
[
"org.alfresco.model",
"org.alfresco.repo",
"org.alfresco.service"
] |
org.alfresco.model; org.alfresco.repo; org.alfresco.service;
| 2,260,776
|
return !StringUtils.hasLength(this.message);
}
|
return !StringUtils.hasLength(this.message); }
|
/**
* Return {@code true} if the message is empty.
* @return if the message is empty
*/
|
Return true if the message is empty
|
isEmpty
|
{
"repo_name": "bclozel/spring-boot",
"path": "spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java",
"license": "apache-2.0",
"size": 13144
}
|
[
"org.springframework.util.StringUtils"
] |
import org.springframework.util.StringUtils;
|
import org.springframework.util.*;
|
[
"org.springframework.util"
] |
org.springframework.util;
| 2,718,839
|
public IPasteStatus isValidCopy( ContainerContext context, Module module,
IElementCopy copy )
{
PasteStatus status = new PasteStatus( );
if ( !( copy instanceof ContextCopiedElement ) )
{
status.setPaste( false );
status.setErrors( null );
return status;
}
DesignElement copied = ( (ContextCopiedElement) copy )
.getLocalizedCopy( );
if ( copied == null )
{
status.setPaste( false );
status.setErrors( null );
return status;
}
List<SemanticException> errors = context.checkContainmentContext(
module, copied );
if ( ( errors == null || errors.isEmpty( ) )
&& ( module == null || !module.isReadOnly( ) ) )
{
status.setPaste( true );
status.setErrors( null );
}
else
{
status.setPaste( false );
status.setErrors( errors );
}
return status;
}
|
IPasteStatus function( ContainerContext context, Module module, IElementCopy copy ) { PasteStatus status = new PasteStatus( ); if ( !( copy instanceof ContextCopiedElement ) ) { status.setPaste( false ); status.setErrors( null ); return status; } DesignElement copied = ( (ContextCopiedElement) copy ) .getLocalizedCopy( ); if ( copied == null ) { status.setPaste( false ); status.setErrors( null ); return status; } List<SemanticException> errors = context.checkContainmentContext( module, copied ); if ( ( errors == null errors.isEmpty( ) ) && ( module == null !module.isReadOnly( ) ) ) { status.setPaste( true ); status.setErrors( null ); } else { status.setPaste( false ); status.setErrors( errors ); } return status; }
|
/**
* Checks whether the given copy is valid for pasting. Following cases are
* invalid:
*
* <ul>
* <li>the instance is <code>null</code>.
* <li>the instance does not contain the localized copy.
* </ul>
*
* @param context
* the context of container
* @param module
* the module of the element to paste
* @param copy
* the given copy
*
* @return <code>true</code> is the copy is good for pasting. Otherwise
* <code>false</code>.
*/
|
Checks whether the given copy is valid for pasting. Following cases are invalid: the instance is <code>null</code>. the instance does not contain the localized copy.
|
isValidCopy
|
{
"repo_name": "sguan-actuate/birt",
"path": "model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/util/copy/ContextCopyPasteBasePolicy.java",
"license": "epl-1.0",
"size": 10583
}
|
[
"java.util.List",
"org.eclipse.birt.report.model.api.activity.SemanticException",
"org.eclipse.birt.report.model.api.util.IElementCopy",
"org.eclipse.birt.report.model.api.util.IPasteStatus",
"org.eclipse.birt.report.model.core.ContainerContext",
"org.eclipse.birt.report.model.core.DesignElement",
"org.eclipse.birt.report.model.core.Module"
] |
import java.util.List; import org.eclipse.birt.report.model.api.activity.SemanticException; import org.eclipse.birt.report.model.api.util.IElementCopy; import org.eclipse.birt.report.model.api.util.IPasteStatus; import org.eclipse.birt.report.model.core.ContainerContext; import org.eclipse.birt.report.model.core.DesignElement; import org.eclipse.birt.report.model.core.Module;
|
import java.util.*; import org.eclipse.birt.report.model.api.activity.*; import org.eclipse.birt.report.model.api.util.*; import org.eclipse.birt.report.model.core.*;
|
[
"java.util",
"org.eclipse.birt"
] |
java.util; org.eclipse.birt;
| 1,662,352
|
private InputStream connect(String url) throws IOException {
System.out.println(URL_BASE + url);
URLConnection conn = new URL(URL_BASE + url).openConnection();
conn.setConnectTimeout(CONNECT_TIMEOUT);
conn.setReadTimeout(READ_TIMEOUT);
conn.setRequestProperty("User-Agent", USER_AGENT);
return conn.getInputStream();
}
|
InputStream function(String url) throws IOException { System.out.println(URL_BASE + url); URLConnection conn = new URL(URL_BASE + url).openConnection(); conn.setConnectTimeout(CONNECT_TIMEOUT); conn.setReadTimeout(READ_TIMEOUT); conn.setRequestProperty(STR, USER_AGENT); return conn.getInputStream(); }
|
/**
* Open the connection to the server.
*
* @param url
* the url to connect to
* @return returns the input stream for the connection
* @throws java.io.IOException
* cannot get result
*/
|
Open the connection to the server
|
connect
|
{
"repo_name": "olivermay/geomajas",
"path": "plugin/geomajas-plugin-geocoder/geocoder/src/main/java/org/geomajas/plugin/geocoder/service/YahooPlaceFinderGeocoderService.java",
"license": "agpl-3.0",
"size": 10137
}
|
[
"java.io.IOException",
"java.io.InputStream",
"java.net.URLConnection"
] |
import java.io.IOException; import java.io.InputStream; import java.net.URLConnection;
|
import java.io.*; import java.net.*;
|
[
"java.io",
"java.net"
] |
java.io; java.net;
| 436,098
|
void setLogger(Logger value);
|
void setLogger(Logger value);
|
/**
* Sets the value of the '{@link org.openhab.binding.tinkerforge.internal.model.MBrickd#getLogger <em>Logger</em>}'
* attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @param value the new value of the '<em>Logger</em>' attribute.
* @see #getLogger()
* @generated
*/
|
Sets the value of the '<code>org.openhab.binding.tinkerforge.internal.model.MBrickd#getLogger Logger</code>' attribute.
|
setLogger
|
{
"repo_name": "sedstef/openhab",
"path": "bundles/binding/org.openhab.binding.tinkerforge/src/main/java/org/openhab/binding/tinkerforge/internal/model/MBrickd.java",
"license": "epl-1.0",
"size": 15709
}
|
[
"org.slf4j.Logger"
] |
import org.slf4j.Logger;
|
import org.slf4j.*;
|
[
"org.slf4j"
] |
org.slf4j;
| 2,645,130
|
public void onCommitCompaction(CommitCompactionEvent commitCompactionEvent, Connection dbConn,
SQLGenerator sqlGenerator) throws MetaException {
}
|
void function(CommitCompactionEvent commitCompactionEvent, Connection dbConn, SQLGenerator sqlGenerator) throws MetaException { }
|
/**
* This will be called to commit a compaction transaction.
* @param commitCompactionEvent event to be processed
* @param dbConn jdbc connection to remote meta store db.
* @param sqlGenerator helper class to generate db specific sql string.
* @throws MetaException ex
*/
|
This will be called to commit a compaction transaction
|
onCommitCompaction
|
{
"repo_name": "lirui-apache/hive",
"path": "standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreEventListener.java",
"license": "apache-2.0",
"size": 15223
}
|
[
"java.sql.Connection",
"org.apache.hadoop.hive.metastore.api.MetaException",
"org.apache.hadoop.hive.metastore.events.CommitCompactionEvent",
"org.apache.hadoop.hive.metastore.tools.SQLGenerator"
] |
import java.sql.Connection; import org.apache.hadoop.hive.metastore.api.MetaException; import org.apache.hadoop.hive.metastore.events.CommitCompactionEvent; import org.apache.hadoop.hive.metastore.tools.SQLGenerator;
|
import java.sql.*; import org.apache.hadoop.hive.metastore.api.*; import org.apache.hadoop.hive.metastore.events.*; import org.apache.hadoop.hive.metastore.tools.*;
|
[
"java.sql",
"org.apache.hadoop"
] |
java.sql; org.apache.hadoop;
| 2,498,199
|
assertEquals(new JsStatement().$(null, "#aComponent").chain(
new FadeTo()).render().toString(), "$('#aComponent').fadeTo();");
}
|
assertEquals(new JsStatement().$(null, STR).chain( new FadeTo()).render().toString(), STR); }
|
/**
* Test the javascript generation
*/
|
Test the javascript generation
|
testJavascriptGeneration
|
{
"repo_name": "openengsb-attic/forks-org.odlabs.wiquery",
"path": "src/test/java/org/odlabs/wiquery/core/effects/fading/FadeToTestCase.java",
"license": "mit",
"size": 1692
}
|
[
"org.odlabs.wiquery.core.javascript.JsStatement"
] |
import org.odlabs.wiquery.core.javascript.JsStatement;
|
import org.odlabs.wiquery.core.javascript.*;
|
[
"org.odlabs.wiquery"
] |
org.odlabs.wiquery;
| 251,174
|
@SafeVarargs
final IterableAssert<T> containsInAnyOrder(
SerializableMatcher<? super T>... elementMatchers) {
return satisfies(SerializableMatchers.<T>containsInAnyOrder(elementMatchers));
}
}
public static class SingletonAssert<T> implements Serializable {
private final Pipeline pipeline;
private final CreateActual<?, T> createActual;
private Optional<Coder<T>> coder;
protected SingletonAssert(
CreateActual<?, T> createActual, Pipeline pipeline) {
this.pipeline = pipeline;
this.createActual = createActual;
this.coder = Optional.absent();
}
|
final IterableAssert<T> containsInAnyOrder( SerializableMatcher<? super T>... elementMatchers) { return satisfies(SerializableMatchers.<T>containsInAnyOrder(elementMatchers)); } } public static class SingletonAssert<T> implements Serializable { private final Pipeline pipeline; private final CreateActual<?, T> createActual; private Optional<Coder<T>> coder; protected SingletonAssert( CreateActual<?, T> createActual, Pipeline pipeline) { this.pipeline = pipeline; this.createActual = createActual; this.coder = Optional.absent(); }
|
/**
* Checks that the {@code Iterable} contains elements that match the provided matchers,
* in any order.
*
* <p>Returns this {@code IterableAssert}.
*/
|
Checks that the Iterable contains elements that match the provided matchers, in any order. Returns this IterableAssert
|
containsInAnyOrder
|
{
"repo_name": "Test-Betta-Inc/musical-umbrella",
"path": "sdk/src/main/java/com/google/cloud/dataflow/sdk/testing/DataflowAssert.java",
"license": "apache-2.0",
"size": 27337
}
|
[
"com.google.cloud.dataflow.sdk.Pipeline",
"com.google.cloud.dataflow.sdk.coders.Coder",
"com.google.common.base.Optional",
"java.io.Serializable",
"org.hamcrest.Matchers"
] |
import com.google.cloud.dataflow.sdk.Pipeline; import com.google.cloud.dataflow.sdk.coders.Coder; import com.google.common.base.Optional; import java.io.Serializable; import org.hamcrest.Matchers;
|
import com.google.cloud.dataflow.sdk.*; import com.google.cloud.dataflow.sdk.coders.*; import com.google.common.base.*; import java.io.*; import org.hamcrest.*;
|
[
"com.google.cloud",
"com.google.common",
"java.io",
"org.hamcrest"
] |
com.google.cloud; com.google.common; java.io; org.hamcrest;
| 764,499
|
@Override
public void processWatermark(Watermark mark) throws Exception {
// if we receive a Long.MAX_VALUE watermark we forward it since it is used
// to signal the end of input and to not block watermark progress downstream
if (mark.getTimestamp() == Long.MAX_VALUE && currentWatermark != Long.MAX_VALUE) {
currentWatermark = Long.MAX_VALUE;
output.emitWatermark(mark);
}
}
|
void function(Watermark mark) throws Exception { if (mark.getTimestamp() == Long.MAX_VALUE && currentWatermark != Long.MAX_VALUE) { currentWatermark = Long.MAX_VALUE; output.emitWatermark(mark); } }
|
/**
* Override the base implementation to completely ignore watermarks propagated from
* upstream (we rely only on the {@link AssignerWithPeriodicWatermarks} to emit
* watermarks from here).
*/
|
Override the base implementation to completely ignore watermarks propagated from upstream (we rely only on the <code>AssignerWithPeriodicWatermarks</code> to emit watermarks from here)
|
processWatermark
|
{
"repo_name": "shaoxuan-wang/flink",
"path": "flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/watermarkassigner/MiniBatchAssignerOperator.java",
"license": "apache-2.0",
"size": 3829
}
|
[
"org.apache.flink.streaming.api.watermark.Watermark"
] |
import org.apache.flink.streaming.api.watermark.Watermark;
|
import org.apache.flink.streaming.api.watermark.*;
|
[
"org.apache.flink"
] |
org.apache.flink;
| 988,392
|
@Override
public Enumeration<String> getHeaders(final String name) {
if (headerName.equalsIgnoreCase(name)) {
return Collections.emptyEnumeration();
} else {
return super.getHeaders(name);
}
}
|
Enumeration<String> function(final String name) { if (headerName.equalsIgnoreCase(name)) { return Collections.emptyEnumeration(); } else { return super.getHeaders(name); } }
|
/**
* The default behavior of this method is to return getHeaders(String name)
* on the wrapped request object.
*
* @param name a <code>String</code> specifying the name of a request header
*/
|
The default behavior of this method is to return getHeaders(String name) on the wrapped request object
|
getHeaders
|
{
"repo_name": "Toilal/dropwizard",
"path": "dropwizard-jetty/src/main/java/io/dropwizard/jetty/BiDiGzipFilter.java",
"license": "apache-2.0",
"size": 10312
}
|
[
"java.util.Collections",
"java.util.Enumeration"
] |
import java.util.Collections; import java.util.Enumeration;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,235,115
|
public List<MultiPartitionedInterval> getHaplotypeData(
int chromosome,
Set<String> strainsToAccept);
|
List<MultiPartitionedInterval> function( int chromosome, Set<String> strainsToAccept);
|
/**
* Get the haplotype data
* @param chromosome
* the chromosome
* @param strainsToAccept
* the strains to allow through
* @return
* the list of haplotype blocks given the strain and chromosome
* filters
*/
|
Get the haplotype data
|
getHaplotypeData
|
{
"repo_name": "cgd/haplotype-inference",
"path": "src/java/org/jax/haplotype/data/MultiGroupHaplotypeDataSource.java",
"license": "gpl-3.0",
"size": 2385
}
|
[
"java.util.List",
"java.util.Set",
"org.jax.geneticutil.data.MultiPartitionedInterval"
] |
import java.util.List; import java.util.Set; import org.jax.geneticutil.data.MultiPartitionedInterval;
|
import java.util.*; import org.jax.geneticutil.data.*;
|
[
"java.util",
"org.jax.geneticutil"
] |
java.util; org.jax.geneticutil;
| 2,110,498
|
@Override
public int hashCode() {
return Math.abs(new HashCodeBuilder()
.append(this.major)
.append(this.minor)
.append(this.revision)
.append(this.build)
.toHashCode());
}
|
int function() { return Math.abs(new HashCodeBuilder() .append(this.major) .append(this.minor) .append(this.revision) .append(this.build) .toHashCode()); }
|
/**
* Returns the hash code value of this object.
*
* @return Returns the hash code value of this object.
*/
|
Returns the hash code value of this object
|
hashCode
|
{
"repo_name": "PantherCode/arctic-core",
"path": "src/main/java/org/panthercode/arctic/core/helper/version/Version.java",
"license": "apache-2.0",
"size": 12127
}
|
[
"org.apache.commons.lang3.builder.HashCodeBuilder"
] |
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
import org.apache.commons.lang3.builder.*;
|
[
"org.apache.commons"
] |
org.apache.commons;
| 1,744,811
|
public List<ReceitaIngrediente> selecionarPorReceita(int receitaId) {
return ((ReceitaIngredienteDAO) dao).selecionarPorReceita(receitaId);
}
|
List<ReceitaIngrediente> function(int receitaId) { return ((ReceitaIngredienteDAO) dao).selecionarPorReceita(receitaId); }
|
/**
* Lista de ingredientes anexados na receita
* @param receitaId
* @return
*/
|
Lista de ingredientes anexados na receita
|
selecionarPorReceita
|
{
"repo_name": "Animaleante/TDS171A_Interdisciplinar",
"path": "Java/src/com/tds171a/soboru/models/receitaIngrediente/ReceitaIngredienteModel.java",
"license": "gpl-3.0",
"size": 941
}
|
[
"com.tds171a.soboru.vos.ReceitaIngrediente",
"java.util.List"
] |
import com.tds171a.soboru.vos.ReceitaIngrediente; import java.util.List;
|
import com.tds171a.soboru.vos.*; import java.util.*;
|
[
"com.tds171a.soboru",
"java.util"
] |
com.tds171a.soboru; java.util;
| 1,039,707
|
// Adding new contact
void addContact(Mascotas pets) {
SQLiteDatabase db = this.getWritableDatabase();
ContentValues values = new ContentValues();
values.put(KEY_PROPIETARIO, pets.get_propietario());
values.put(KEY_NOMBRE, pets.get_nombre());
values.put(KEY_APODO, pets.get_apodo());
values.put(KEY_GENERO, pets.get_genero());
values.put(KEY_FECHANACIMIENTO, pets.get_fechaNacimiento());
values.put(KEY_ESPECIE, pets.get_especie());
values.put(KEY_RAZA, pets.get_raza());
values.put(KEY_FOTO, pets.get_foto());
// Inserting Row
db.insert(TABLE_MASCOTAS, null, values);
db.close(); // Closing database connection
}
|
void addContact(Mascotas pets) { SQLiteDatabase db = this.getWritableDatabase(); ContentValues values = new ContentValues(); values.put(KEY_PROPIETARIO, pets.get_propietario()); values.put(KEY_NOMBRE, pets.get_nombre()); values.put(KEY_APODO, pets.get_apodo()); values.put(KEY_GENERO, pets.get_genero()); values.put(KEY_FECHANACIMIENTO, pets.get_fechaNacimiento()); values.put(KEY_ESPECIE, pets.get_especie()); values.put(KEY_RAZA, pets.get_raza()); values.put(KEY_FOTO, pets.get_foto()); db.insert(TABLE_MASCOTAS, null, values); db.close(); }
|
/**
* All CRUD(Create, Read, Update, Delete) Operations
*/
|
All CRUD(Create, Read, Update, Delete) Operations
|
addContact
|
{
"repo_name": "animalCare/AnimalCare",
"path": "src/com/app/animalcare/DatabaseHandler.java",
"license": "gpl-2.0",
"size": 5490
}
|
[
"android.content.ContentValues",
"android.database.sqlite.SQLiteDatabase"
] |
import android.content.ContentValues; import android.database.sqlite.SQLiteDatabase;
|
import android.content.*; import android.database.sqlite.*;
|
[
"android.content",
"android.database"
] |
android.content; android.database;
| 2,401,890
|
private static void consume(final HttpEntity entity) throws IOException {
if (entity == null) {
return;
}
if (entity.isStreaming()) {
InputStream instream = entity.getContent();
if (instream != null) {
instream.close();
}
}
}
|
static void function(final HttpEntity entity) throws IOException { if (entity == null) { return; } if (entity.isStreaming()) { InputStream instream = entity.getContent(); if (instream != null) { instream.close(); } } }
|
/**
* copy from org.apache.http.util.EntityUtils#consume. Android has it's own httpcore
* that doesn't have a consume.
*/
|
copy from org.apache.http.util.EntityUtils#consume. Android has it's own httpcore that doesn't have a consume
|
consume
|
{
"repo_name": "XiaoMi/galaxy-sdk-java",
"path": "galaxy-thrift-api/src/main/java/libthrift091/transport/THttpClient.java",
"license": "apache-2.0",
"size": 10960
}
|
[
"java.io.IOException",
"java.io.InputStream",
"org.apache.http.HttpEntity"
] |
import java.io.IOException; import java.io.InputStream; import org.apache.http.HttpEntity;
|
import java.io.*; import org.apache.http.*;
|
[
"java.io",
"org.apache.http"
] |
java.io; org.apache.http;
| 2,527,815
|
public RegisteredService get(final long id) {
final Map<String, AttributeValue> keys = new HashMap<>();
keys.put(ColumnNames.ID.getName(), new AttributeValue(String.valueOf(id)));
return getRegisteredServiceByKeys(keys);
}
|
RegisteredService function(final long id) { final Map<String, AttributeValue> keys = new HashMap<>(); keys.put(ColumnNames.ID.getName(), new AttributeValue(String.valueOf(id))); return getRegisteredServiceByKeys(keys); }
|
/**
* Get registered service.
*
* @param id the id
* @return the registered service
*/
|
Get registered service
|
get
|
{
"repo_name": "mrluo735/cas-5.1.0",
"path": "support/cas-server-support-dynamodb-service-registry/src/main/java/org/apereo/cas/services/DynamoDbServiceRegistryFacilitator.java",
"license": "apache-2.0",
"size": 10440
}
|
[
"com.amazonaws.services.dynamodbv2.model.AttributeValue",
"java.util.HashMap",
"java.util.Map"
] |
import com.amazonaws.services.dynamodbv2.model.AttributeValue; import java.util.HashMap; import java.util.Map;
|
import com.amazonaws.services.dynamodbv2.model.*; import java.util.*;
|
[
"com.amazonaws.services",
"java.util"
] |
com.amazonaws.services; java.util;
| 1,854,218
|
public void setTimeZone(TimeZone timeZone) {
this.timeZone = timeZone;
}
|
void function(TimeZone timeZone) { this.timeZone = timeZone; }
|
/**
* Set the timezone to be used for Date. If set to <code>null</code> UTC is
* used.
* @param timeZone for created Dates or null to use UTC
*/
|
Set the timezone to be used for Date. If set to <code>null</code> UTC is used
|
setTimeZone
|
{
"repo_name": "asomov/snakeyaml",
"path": "src/main/java/org/yaml/snakeyaml/DumperOptions.java",
"license": "apache-2.0",
"size": 15048
}
|
[
"java.util.TimeZone"
] |
import java.util.TimeZone;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,483,567
|
public void insert(InputStreamWithEncoding data, String id, MultiPayloadAdaptrisMessage m) throws InterlokException
{
if (id == null)
{
id = m.getCurrentPayloadId();
}
try
{
String encoding = defaultIfEmpty(getContentEncoding(), data.encoding);
if (isEmpty(encoding))
{
copyAndClose(data.inputStream, m.getOutputStream(id));
}
else
{
copyAndClose(data.inputStream, m.getWriter(id, encoding));
m.setContentEncoding(id, encoding);
}
}
catch (Exception e)
{
throw ExceptionHelper.wrapCoreException(e);
}
}
|
void function(InputStreamWithEncoding data, String id, MultiPayloadAdaptrisMessage m) throws InterlokException { if (id == null) { id = m.getCurrentPayloadId(); } try { String encoding = defaultIfEmpty(getContentEncoding(), data.encoding); if (isEmpty(encoding)) { copyAndClose(data.inputStream, m.getOutputStream(id)); } else { copyAndClose(data.inputStream, m.getWriter(id, encoding)); m.setContentEncoding(id, encoding); } } catch (Exception e) { throw ExceptionHelper.wrapCoreException(e); } }
|
/**
* Insert the data into the multi-payload message for the given payload ID.
*
* @param data
* The data to insert.
* @param id
* The payload ID.
* @param m
* The multi-payload message.
*/
|
Insert the data into the multi-payload message for the given payload ID
|
insert
|
{
"repo_name": "adaptris/interlok",
"path": "interlok-core/src/main/java/com/adaptris/core/common/MultiPayloadStreamOutputParameter.java",
"license": "apache-2.0",
"size": 2759
}
|
[
"com.adaptris.core.MultiPayloadAdaptrisMessage",
"com.adaptris.core.util.ExceptionHelper",
"com.adaptris.interlok.InterlokException",
"com.adaptris.util.stream.StreamUtil",
"org.apache.commons.lang3.StringUtils"
] |
import com.adaptris.core.MultiPayloadAdaptrisMessage; import com.adaptris.core.util.ExceptionHelper; import com.adaptris.interlok.InterlokException; import com.adaptris.util.stream.StreamUtil; import org.apache.commons.lang3.StringUtils;
|
import com.adaptris.core.*; import com.adaptris.core.util.*; import com.adaptris.interlok.*; import com.adaptris.util.stream.*; import org.apache.commons.lang3.*;
|
[
"com.adaptris.core",
"com.adaptris.interlok",
"com.adaptris.util",
"org.apache.commons"
] |
com.adaptris.core; com.adaptris.interlok; com.adaptris.util; org.apache.commons;
| 557,095
|
public List<Node> values() {
return LessUtils.safeList(values);
}
|
List<Node> function() { return LessUtils.safeList(values); }
|
/**
* Returns the values in the expression.
*/
|
Returns the values in the expression
|
values
|
{
"repo_name": "Squarespace/less-compiler",
"path": "src/main/java/com/squarespace/less/model/Expression.java",
"license": "apache-2.0",
"size": 3687
}
|
[
"com.squarespace.less.core.LessUtils",
"java.util.List"
] |
import com.squarespace.less.core.LessUtils; import java.util.List;
|
import com.squarespace.less.core.*; import java.util.*;
|
[
"com.squarespace.less",
"java.util"
] |
com.squarespace.less; java.util;
| 1,030,486
|
public static boolean exists(String fileName)
{
File fileObj = new File(fileName);
return fileObj.exists();
}
|
static boolean function(String fileName) { File fileObj = new File(fileName); return fileObj.exists(); }
|
/**
* Checks if a file (or folder) exists or not.
* @return true if file exists, false otherwise.
*/
|
Checks if a file (or folder) exists or not
|
exists
|
{
"repo_name": "Carrotlord/MintChime-Editor",
"path": "tools/FileIO.java",
"license": "gpl-3.0",
"size": 14647
}
|
[
"java.io.File"
] |
import java.io.File;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 569,081
|
public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
float f;
float f1;
if (par1IBlockAccess.getBlock(par2 - 1, par3, par4) != this && par1IBlockAccess.getBlock(par2 + 1, par3, par4) != this)
{
f = 0.125F;
f1 = 0.5F;
this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f1, 0.5F + f, 1.0F, 0.5F + f1);
}
else
{
f = 0.5F;
f1 = 0.125F;
this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f1, 0.5F + f, 1.0F, 0.5F + f1);
}
}
|
void function(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { float f; float f1; if (par1IBlockAccess.getBlock(par2 - 1, par3, par4) != this && par1IBlockAccess.getBlock(par2 + 1, par3, par4) != this) { f = 0.125F; f1 = 0.5F; this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f1, 0.5F + f, 1.0F, 0.5F + f1); } else { f = 0.5F; f1 = 0.125F; this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f1, 0.5F + f, 1.0F, 0.5F + f1); } }
|
/**
* Updates the blocks bounds based on its current state. Args: world, x, y, z
*/
|
Updates the blocks bounds based on its current state. Args: world, x, y, z
|
setBlockBoundsBasedOnState
|
{
"repo_name": "OwnAgePau/Soul-Forest",
"path": "src/main/java/com/Mod_Ores/Dimension/FrozenHearth/TeleportBlockFrozenHearth.java",
"license": "lgpl-2.1",
"size": 9689
}
|
[
"net.minecraft.world.IBlockAccess"
] |
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.*;
|
[
"net.minecraft.world"
] |
net.minecraft.world;
| 2,838,514
|
public Observable<ServiceResponse<Void>> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (virtualNetworkName == null) {
throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
|
Observable<ServiceResponse<Void>> function(String resourceGroupName, String virtualNetworkName) { if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (virtualNetworkName == null) { throw new IllegalArgumentException(STR); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); }
|
/**
* Deletes the specified virtual network.
*
* @param resourceGroupName The name of the resource group.
* @param virtualNetworkName The name of the virtual network.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
|
Deletes the specified virtual network
|
beginDeleteWithServiceResponseAsync
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/network/v2020_05_01/implementation/VirtualNetworksInner.java",
"license": "mit",
"size": 90099
}
|
[
"com.microsoft.rest.ServiceResponse"
] |
import com.microsoft.rest.ServiceResponse;
|
import com.microsoft.rest.*;
|
[
"com.microsoft.rest"
] |
com.microsoft.rest;
| 2,866,675
|
protected void onStartClose(int position, boolean right) {
if (swipeListViewListener != null && position != ListView.INVALID_POSITION) {
swipeListViewListener.onStartClose(position, right);
}
}
|
void function(int position, boolean right) { if (swipeListViewListener != null && position != ListView.INVALID_POSITION) { swipeListViewListener.onStartClose(position, right); } }
|
/**
* Start close item
*
* @param position list item
* @param right
*/
|
Start close item
|
onStartClose
|
{
"repo_name": "bboyfeiyu/android-swipelistview",
"path": "swipelistview/src/main/java/com/fortysevendeg/swipelistview/SwipeListView.java",
"license": "apache-2.0",
"size": 20233
}
|
[
"android.widget.ListView"
] |
import android.widget.ListView;
|
import android.widget.*;
|
[
"android.widget"
] |
android.widget;
| 1,965,832
|
private void sendConfig() {
new PostConfigTask(mUrl, mHttpsCertPath, mApiKey, new Gson().toJson(mConfig), null)
.execute();
}
|
void function() { new PostConfigTask(mUrl, mHttpsCertPath, mApiKey, new Gson().toJson(mConfig), null) .execute(); }
|
/**
* Sends current config to Syncthing.
*/
|
Sends current config to Syncthing
|
sendConfig
|
{
"repo_name": "begetan/syncthing-android",
"path": "src/main/java/com/nutomic/syncthingandroid/service/RestApi.java",
"license": "mpl-2.0",
"size": 19060
}
|
[
"com.google.gson.Gson",
"com.nutomic.syncthingandroid.http.PostConfigTask"
] |
import com.google.gson.Gson; import com.nutomic.syncthingandroid.http.PostConfigTask;
|
import com.google.gson.*; import com.nutomic.syncthingandroid.http.*;
|
[
"com.google.gson",
"com.nutomic.syncthingandroid"
] |
com.google.gson; com.nutomic.syncthingandroid;
| 85,459
|
public static Mesh create (boolean isStatic, final Mesh base, final Matrix4[] transformations) {
final VertexAttribute posAttr = base.getVertexAttribute(Usage.Position);
final int offset = posAttr.offset / 4;
final int numComponents = posAttr.numComponents;
final int numVertices = base.getNumVertices();
final int vertexSize = base.getVertexSize() / 4;
final int baseSize = numVertices * vertexSize;
final int numIndices = base.getNumIndices();
final float vertices[] = new float[numVertices * vertexSize * transformations.length];
final short indices[] = new short[numIndices * transformations.length];
base.getIndices(indices);
for (int i = 0; i < transformations.length; i++) {
base.getVertices(0, baseSize, vertices, baseSize * i);
transform(transformations[i], vertices, vertexSize, offset, numComponents, numVertices * i, numVertices);
if (i > 0) for (int j = 0; j < numIndices; j++)
indices[(numIndices * i) + j] = (short)(indices[j] + (numVertices * i));
}
final Mesh result = new Mesh(isStatic, vertices.length / vertexSize, indices.length, base.getVertexAttributes());
result.setVertices(vertices);
result.setIndices(indices);
return result;
}
|
static Mesh function (boolean isStatic, final Mesh base, final Matrix4[] transformations) { final VertexAttribute posAttr = base.getVertexAttribute(Usage.Position); final int offset = posAttr.offset / 4; final int numComponents = posAttr.numComponents; final int numVertices = base.getNumVertices(); final int vertexSize = base.getVertexSize() / 4; final int baseSize = numVertices * vertexSize; final int numIndices = base.getNumIndices(); final float vertices[] = new float[numVertices * vertexSize * transformations.length]; final short indices[] = new short[numIndices * transformations.length]; base.getIndices(indices); for (int i = 0; i < transformations.length; i++) { base.getVertices(0, baseSize, vertices, baseSize * i); transform(transformations[i], vertices, vertexSize, offset, numComponents, numVertices * i, numVertices); if (i > 0) for (int j = 0; j < numIndices; j++) indices[(numIndices * i) + j] = (short)(indices[j] + (numVertices * i)); } final Mesh result = new Mesh(isStatic, vertices.length / vertexSize, indices.length, base.getVertexAttributes()); result.setVertices(vertices); result.setIndices(indices); return result; }
|
/** Create a new Mesh that is a combination of transformations of the supplied base mesh. Not all primitive types, like line
* strip and triangle strip, can be combined.
* @param isStatic whether this mesh is static or not. Allows for internal optimizations.
* @param transformations the transformations to apply to the meshes
* @return the combined mesh */
|
Create a new Mesh that is a combination of transformations of the supplied base mesh. Not all primitive types, like line strip and triangle strip, can be combined
|
create
|
{
"repo_name": "davebaol/libgdx",
"path": "gdx/src/com/badlogic/gdx/graphics/Mesh.java",
"license": "apache-2.0",
"size": 49344
}
|
[
"com.badlogic.gdx.graphics.VertexAttributes",
"com.badlogic.gdx.math.Matrix4"
] |
import com.badlogic.gdx.graphics.VertexAttributes; import com.badlogic.gdx.math.Matrix4;
|
import com.badlogic.gdx.graphics.*; import com.badlogic.gdx.math.*;
|
[
"com.badlogic.gdx"
] |
com.badlogic.gdx;
| 1,069,401
|
protected int channelRead(ReadableByteChannel channel,
ByteBuffer buffer) throws IOException {
int count = (buffer.remaining() <= NIO_BUFFER_LIMIT) ?
channel.read(buffer) : channelIO(channel, null, buffer);
if (count > 0) {
rpcMetrics.receivedBytes.inc(count);
}
return count;
}
/**
* Helper for {@link #channelRead(java.nio.channels.ReadableByteChannel, java.nio.ByteBuffer)}
|
int function(ReadableByteChannel channel, ByteBuffer buffer) throws IOException { int count = (buffer.remaining() <= NIO_BUFFER_LIMIT) ? channel.read(buffer) : channelIO(channel, null, buffer); if (count > 0) { rpcMetrics.receivedBytes.inc(count); } return count; } /** * Helper for {@link #channelRead(java.nio.channels.ReadableByteChannel, java.nio.ByteBuffer)}
|
/**
* This is a wrapper around {@link java.nio.channels.ReadableByteChannel#read(java.nio.ByteBuffer)}.
* If the amount of data is large, it writes to channel in smaller chunks.
* This is to avoid jdk from creating many direct buffers as the size of
* ByteBuffer increases. There should not be any performance degredation.
*
* @param channel writable byte channel to write on
* @param buffer buffer to write
* @return number of bytes written
* @throws java.io.IOException e
* @see java.nio.channels.ReadableByteChannel#read(java.nio.ByteBuffer)
*/
|
This is a wrapper around <code>java.nio.channels.ReadableByteChannel#read(java.nio.ByteBuffer)</code>. If the amount of data is large, it writes to channel in smaller chunks. This is to avoid jdk from creating many direct buffers as the size of ByteBuffer increases. There should not be any performance degredation
|
channelRead
|
{
"repo_name": "ddraj/hbase-trunk-mttr",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/HBaseServer.java",
"license": "apache-2.0",
"size": 81179
}
|
[
"java.io.IOException",
"java.nio.ByteBuffer",
"java.nio.channels.ReadableByteChannel"
] |
import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.ReadableByteChannel;
|
import java.io.*; import java.nio.*; import java.nio.channels.*;
|
[
"java.io",
"java.nio"
] |
java.io; java.nio;
| 1,730,630
|
public void onRewardedVideoLoadFailure(@NonNull String adUnitId, @NonNull MoPubErrorCode errorCode);
|
void function(@NonNull String adUnitId, @NonNull MoPubErrorCode errorCode);
|
/**
* Called when a video fails to load for the given ad unit id. The provided error code will
* give more insight into the reason for the failure to load.
*/
|
Called when a video fails to load for the given ad unit id. The provided error code will give more insight into the reason for the failure to load
|
onRewardedVideoLoadFailure
|
{
"repo_name": "PorkyPixels/Cocos-Helper",
"path": "External Cocos Helper Android Frameworks/Libs/MoPub/mopub-sdk/src/main/java/com/mopub/mobileads/MoPubRewardedVideoListener.java",
"license": "mit",
"size": 1518
}
|
[
"android.support.annotation.NonNull"
] |
import android.support.annotation.NonNull;
|
import android.support.annotation.*;
|
[
"android.support"
] |
android.support;
| 735,059
|
static public Automaton union(Collection<Automaton> l) {
return BasicOperations.union(l);
}
|
static Automaton function(Collection<Automaton> l) { return BasicOperations.union(l); }
|
/**
* See {@link BasicOperations#union(Collection)}.
*/
|
See <code>BasicOperations#union(Collection)</code>
|
union
|
{
"repo_name": "dweiss/dk.brics.automaton",
"path": "src/dk/brics/automaton/Automaton.java",
"license": "bsd-3-clause",
"size": 30356
}
|
[
"java.util.Collection"
] |
import java.util.Collection;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,619,054
|
EAttribute getReaction_Transition();
|
EAttribute getReaction_Transition();
|
/**
* Returns the meta object for the attribute '{@link org.yakindu.sct.model.sexec.Reaction#isTransition <em>Transition</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Transition</em>'.
* @see org.yakindu.sct.model.sexec.Reaction#isTransition()
* @see #getReaction()
* @generated
*/
|
Returns the meta object for the attribute '<code>org.yakindu.sct.model.sexec.Reaction#isTransition Transition</code>'.
|
getReaction_Transition
|
{
"repo_name": "Yakindu/statecharts",
"path": "plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/SexecPackage.java",
"license": "epl-1.0",
"size": 168724
}
|
[
"org.eclipse.emf.ecore.EAttribute"
] |
import org.eclipse.emf.ecore.EAttribute;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 456,167
|
private static int inputPos( Neuron n ) {
int numInputs = 0;
int totalPos = 0;
Iterator connIter = n.getIncomingConns().iterator();
while ( connIter.hasNext() ) {
Connection c = (Connection) connIter.next();
if ( c instanceof Pattern.PatternConnection ) {
Pattern.PatternConnection pc = (Pattern.PatternConnection) c;
++numInputs;
totalPos += pc.getIdx();
}
}
return ( numInputs == 0 ) ? -1 : ( totalPos / numInputs );
}
|
static int function( Neuron n ) { int numInputs = 0; int totalPos = 0; Iterator connIter = n.getIncomingConns().iterator(); while ( connIter.hasNext() ) { Connection c = (Connection) connIter.next(); if ( c instanceof Pattern.PatternConnection ) { Pattern.PatternConnection pc = (Pattern.PatternConnection) c; ++numInputs; totalPos += pc.getIdx(); } } return ( numInputs == 0 ) ? -1 : ( totalPos / numInputs ); }
|
/**
* Calculates position in input layer based on average of position of inputs connected into this
* neuron; i.e., if a this neuron has 2 input connections from input neurons at positions 2 and
* 3, this neurons position is 2.5.
*
* @param n
* @return position of Neuron in input layer, -1 if neuron not in input layer
*/
|
Calculates position in input layer based on average of position of inputs connected into this neuron; i.e., if a this neuron has 2 input connections from input neurons at positions 2 and 3, this neurons position is 2.5
|
inputPos
|
{
"repo_name": "jasoyode/gasneat",
"path": "src/main/java/com/anji/nn/Neuron.java",
"license": "gpl-3.0",
"size": 13239
}
|
[
"java.util.Iterator"
] |
import java.util.Iterator;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,640,559
|
public void onSurfaceDestroyed(SurfaceHolder holder) {
}
|
void function(SurfaceHolder holder) { }
|
/**
* Convenience for {@link SurfaceHolder.Callback#surfaceDestroyed
* SurfaceHolder.Callback.surfaceDestroyed()}.
*/
|
Convenience for <code>SurfaceHolder.Callback#surfaceDestroyed SurfaceHolder.Callback.surfaceDestroyed()</code>
|
onSurfaceDestroyed
|
{
"repo_name": "mateor/PDroidHistory",
"path": "frameworks/base/core/java/android/service/wallpaper/WallpaperService.java",
"license": "gpl-3.0",
"size": 39248
}
|
[
"android.view.SurfaceHolder"
] |
import android.view.SurfaceHolder;
|
import android.view.*;
|
[
"android.view"
] |
android.view;
| 194,560
|
void insert_val(Serializable a_x)
throws InvalidValue, TypeMismatch;
/**
* Insert the wide char (usually UTF-16) value into the enclosed {@link Any}
|
void insert_val(Serializable a_x) throws InvalidValue, TypeMismatch; /** * Insert the wide char (usually UTF-16) value into the enclosed {@link Any}
|
/**
* Insert the value into the enclosed {@link Any} inside this DynAny
*
* @param a_x the value being inserted.
* @throws InvalidValue if the value type does not match the typecode of the
* enclosed {@link Any}.
*/
|
Insert the value into the enclosed <code>Any</code> inside this DynAny
|
insert_val
|
{
"repo_name": "SanDisk-Open-Source/SSD_Dashboard",
"path": "uefi/gcc/gcc-4.6.3/libjava/classpath/org/omg/DynamicAny/DynAnyOperations.java",
"license": "gpl-2.0",
"size": 17564
}
|
[
"java.io.Serializable",
"org.omg.CORBA",
"org.omg.DynamicAny"
] |
import java.io.Serializable; import org.omg.CORBA; import org.omg.DynamicAny;
|
import java.io.*; import org.omg.*;
|
[
"java.io",
"org.omg"
] |
java.io; org.omg;
| 1,610,598
|
public static void copyFile( final File sourceFile, final File destFile ) throws IOException {
int onechar = 0;
if ( sourceFile == null ) {
throw new IOException( "Source file is null - cannot copy." );
}
if ( destFile == null ) {
throw new IOException( "Destination file is null - cannot copy." );
}
if ( sourceFile.compareTo( destFile ) == 0 ) {
throw new IOException( "Cannot copy file '" + sourceFile + "' to itself" );
}
destFile.mkdirs();
if ( destFile.exists() && !destFile.delete() ) {
throw new IOException( "Unable to delete existing destination file '" + destFile + "'. Logged in as " + System.getProperty( "user.name" ) );
}
if ( !sourceFile.exists() ) {
throw new IOException( "Source file '" + sourceFile + "' does not exist. Cannot copy. Logged in as " + System.getProperty( "user.name" ) );
}
final FileOutputStream fout = new FileOutputStream( destFile );
final BufferedOutputStream bout = new BufferedOutputStream( fout );
final FileInputStream fin = new FileInputStream( sourceFile );
final BufferedInputStream bin = new BufferedInputStream( fin );
onechar = bin.read();
while ( onechar != -1 ) {
bout.write( onechar );
onechar = bin.read();
}
bout.flush();
bin.close();
fin.close();
if ( !destFile.exists() ) {
throw new IOException( "File copy failed: destination file '" + destFile + "' does not exist after copy." );
}
// The below test is commented out because it does not
// appear to work correctly under Windows NT and Windows 2000
// if (sourceFile.length() != destFile.length())
// {
// throw new IOException("File copy complete, but source file was " +
// sourceFile.length() + " bytes, destination now " + destFile.length()
// + " bytes.");
// }
}
|
static void function( final File sourceFile, final File destFile ) throws IOException { int onechar = 0; if ( sourceFile == null ) { throw new IOException( STR ); } if ( destFile == null ) { throw new IOException( STR ); } if ( sourceFile.compareTo( destFile ) == 0 ) { throw new IOException( STR + sourceFile + STR ); } destFile.mkdirs(); if ( destFile.exists() && !destFile.delete() ) { throw new IOException( STR + destFile + STR + System.getProperty( STR ) ); } if ( !sourceFile.exists() ) { throw new IOException( STR + sourceFile + STR + System.getProperty( STR ) ); } final FileOutputStream fout = new FileOutputStream( destFile ); final BufferedOutputStream bout = new BufferedOutputStream( fout ); final FileInputStream fin = new FileInputStream( sourceFile ); final BufferedInputStream bin = new BufferedInputStream( fin ); onechar = bin.read(); while ( onechar != -1 ) { bout.write( onechar ); onechar = bin.read(); } bout.flush(); bin.close(); fin.close(); if ( !destFile.exists() ) { throw new IOException( STR + destFile + STR ); } }
|
/**
* Utility method to copy a file from one place to another and delete the
* original.
*
* <p>If we fail, we throw IOException, also reporting what username this
* process is running with to assist System Admins in setting appropriate
* permissions.
*
* @param sourceFile Source file pathname
* @param destFile Destination file pathname
* @throws IOException If the copy fails due to an I/O error
*/
|
Utility method to copy a file from one place to another and delete the original. If we fail, we throw IOException, also reporting what username this process is running with to assist System Admins in setting appropriate permissions
|
copyFile
|
{
"repo_name": "sdcote/commons",
"path": "src/main/java/coyote/commons/FileUtil.java",
"license": "mit",
"size": 61600
}
|
[
"java.io.BufferedInputStream",
"java.io.BufferedOutputStream",
"java.io.File",
"java.io.FileInputStream",
"java.io.FileOutputStream",
"java.io.IOException"
] |
import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 556,472
|
public StringBuilder makeHQL(LoadArguments args) {
StringBuilder hql = new StringBuilder();
MainEntity mainEntity = args.getMainEntity();
hql.append(SELECT).append(VOID).append(mainEntity.getProjection());
addProjectionAttributesToHQL(args, hql);
hql.append(VOID).append(FROM).append(VOID);
hql.append(mainEntity.getTypeName());
hql.append(VOID).append(mainEntity.getAlias()).append(VOID);
addJoinedEntities(args, hql);
addWhereRestrictions(args, hql);
addOrders(args, hql);
return hql;
}
|
StringBuilder function(LoadArguments args) { StringBuilder hql = new StringBuilder(); MainEntity mainEntity = args.getMainEntity(); hql.append(SELECT).append(VOID).append(mainEntity.getProjection()); addProjectionAttributesToHQL(args, hql); hql.append(VOID).append(FROM).append(VOID); hql.append(mainEntity.getTypeName()); hql.append(VOID).append(mainEntity.getAlias()).append(VOID); addJoinedEntities(args, hql); addWhereRestrictions(args, hql); addOrders(args, hql); return hql; }
|
/**
* Construye el HQL que se ejecutara
* @param entityType
* @param splitter
* @param wheres
* @param orders
* @return
*/
|
Construye el HQL que se ejecutara
|
makeHQL
|
{
"repo_name": "llarreta/larretasources",
"path": "Commons/src/main/java/ar/com/larreta/commons/persistence/dao/impl/LoadDAOImpl.java",
"license": "apache-2.0",
"size": 9326
}
|
[
"ar.com.larreta.commons.persistence.dao.args.LoadArguments"
] |
import ar.com.larreta.commons.persistence.dao.args.LoadArguments;
|
import ar.com.larreta.commons.persistence.dao.args.*;
|
[
"ar.com.larreta"
] |
ar.com.larreta;
| 601,539
|
public List<SqlCommand> getCommands() {
return commands;
}
|
List<SqlCommand> function() { return commands; }
|
/**
* Gets the commands.
*
* @return the commands
*/
|
Gets the commands
|
getCommands
|
{
"repo_name": "jvalkeal/spring-cloud-data",
"path": "spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/db/migration/AbstractMigration.java",
"license": "apache-2.0",
"size": 1560
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,776,605
|
public void setAppDicionarioDadoSet(Set<DicionarioDado> appDicionarioDadoSet) {
this.appDicionarioDadoSet = appDicionarioDadoSet;
}
|
void function(Set<DicionarioDado> appDicionarioDadoSet) { this.appDicionarioDadoSet = appDicionarioDadoSet; }
|
/**
* Set the set of the app_dicionario_dado.
*
* @param appDicionarioDadoSet
* The set of app_dicionario_dado
*/
|
Set the set of the app_dicionario_dado
|
setAppDicionarioDadoSet
|
{
"repo_name": "nexusbr/WebThematicMaps_server",
"path": "src/geopixel/model/legacy/dto/Permissao.java",
"license": "lgpl-3.0",
"size": 3559
}
|
[
"java.util.Set"
] |
import java.util.Set;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,826,154
|
public InvocationResult getInvocationResult() {
return _invocationResult;
}
|
InvocationResult function() { return _invocationResult; }
|
/**
* Gets the invocation result of the engine function that produced this result.
*
* @return the invocation result, null if not available
*/
|
Gets the invocation result of the engine function that produced this result
|
getInvocationResult
|
{
"repo_name": "jeorme/OG-Platform",
"path": "projects/OG-Engine/src/main/java/com/opengamma/engine/value/ComputedValueResult.java",
"license": "apache-2.0",
"size": 5320
}
|
[
"com.opengamma.engine.calcnode.InvocationResult"
] |
import com.opengamma.engine.calcnode.InvocationResult;
|
import com.opengamma.engine.calcnode.*;
|
[
"com.opengamma.engine"
] |
com.opengamma.engine;
| 497,625
|
@Override
public Enumeration<Option> listOptions() {
Vector<Option> result = new Vector<Option>();
result.addElement(new Option("\tNumber of clusters.\n" + "\t(default 2).",
"N", 1, "-N <num>"));
result.addElement(new Option(
"\tInitialization method to use.\n\t0 = random, 1 = k-means++, "
+ "2 = canopy, 3 = farthest first.\n\t(default = 0)", "init", 1,
"-init"));
result.addElement(new Option(
"\tUse canopies to reduce the number of distance calculations.", "C", 0,
"-C"));
result
.addElement(new Option(
"\tMaximum number of candidate canopies to retain in memory\n\t"
+ "at any one time when using canopy clustering.\n\t"
+ "T2 distance plus, data characteristics,\n\t"
+ "will determine how many candidate canopies are formed before\n\t"
+ "periodic and final pruning are performed, which might result\n\t"
+ "in exceess memory consumption. This setting avoids large numbers\n\t"
+ "of candidate canopies consuming memory. (default = 100)",
"-max-candidates", 1, "-max-candidates <num>"));
result
.addElement(new Option(
"\tHow often to prune low density canopies when using canopy clustering. \n\t"
+ "(default = every 10,000 training instances)", "periodic-pruning",
1,
"-periodic-pruning <num>"));
result
.addElement(new Option(
"\tMinimum canopy density, when using canopy clustering, below which\n\t"
+ " a canopy will be pruned during periodic pruning. (default = 2 instances)",
"min-density", 1, "-min-density"));
result
.addElement(new Option(
"\tThe T2 distance to use when using canopy clustering. Values < 0 indicate that\n\t"
+ "a heuristic based on attribute std. deviation should be used to set this.\n\t"
+ "(default = -1.0)", "t2", 1, "-t2"));
result
.addElement(new Option(
"\tThe T1 distance to use when using canopy clustering. A value < 0 is taken as a\n\t"
+ "positive multiplier for T2. (default = -1.5)", "t1", 1, "-t1"));
result.addElement(new Option("\tDisplay std. deviations for centroids.\n",
"V", 0, "-V"));
result.addElement(new Option(
"\tDon't replace missing values with mean/mode.\n", "M", 0, "-M"));
result.add(new Option("\tDistance function to use.\n"
+ "\t(default: weka.core.EuclideanDistance)", "A", 1,
"-A <classname and options>"));
result.add(new Option("\tMaximum number of iterations.\n", "I", 1,
"-I <num>"));
result.addElement(new Option("\tPreserve order of instances.\n", "O", 0,
"-O"));
result.addElement(new Option(
"\tEnables faster distance calculations, using cut-off values.\n"
+ "\tDisables the calculation/output of squared errors/distances.\n",
"fast", 0, "-fast"));
result.addElement(new Option("\tNumber of execution slots.\n"
+ "\t(default 1 - i.e. no parallelism)", "num-slots", 1,
"-num-slots <num>"));
result.addAll(Collections.list(super.listOptions()));
return result.elements();
}
|
Enumeration<Option> function() { Vector<Option> result = new Vector<Option>(); result.addElement(new Option(STR + STR, "N", 1, STR)); result.addElement(new Option( STR + STR, "init", 1, "-init")); result.addElement(new Option( STR, "C", 0, "-C")); result .addElement(new Option( STR + STR + STR + STR + STR + STR + STR, STR, 1, STR)); result .addElement(new Option( STR + STR, STR, 1, STR)); result .addElement(new Option( STR + STR, STR, 1, STR)); result .addElement(new Option( STR + STR + STR, "t2", 1, "-t2")); result .addElement(new Option( STR + STR, "t1", 1, "-t1")); result.addElement(new Option(STR, "V", 0, "-V")); result.addElement(new Option( STR, "M", 0, "-M")); result.add(new Option(STR + STR, "A", 1, STR)); result.add(new Option(STR, "I", 1, STR)); result.addElement(new Option(STR, "O", 0, "-O")); result.addElement(new Option( STR + STR, "fast", 0, "-fast")); result.addElement(new Option(STR + STR, STR, 1, STR)); result.addAll(Collections.list(super.listOptions())); return result.elements(); }
|
/**
* Returns an enumeration describing the available options.
*
* @return an enumeration of all the available options.
*/
|
Returns an enumeration describing the available options
|
listOptions
|
{
"repo_name": "mydzigear/weka.kmeanspp.silhouette_score",
"path": "src/weka/clusterers/SimpleKMeans.java",
"license": "gpl-3.0",
"size": 76053
}
|
[
"java.util.Collections",
"java.util.Enumeration",
"java.util.Vector"
] |
import java.util.Collections; import java.util.Enumeration; import java.util.Vector;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,560,628
|
public void onTopicSubscription(String topic, String mqttClientChannelID, String username, AbstractMessage.QOSType qos,
boolean isCleanSession) {
try {
MQTTopicManager.getInstance().addTopicSubscription(topic, mqttClientChannelID, username,
QOSLevel.getQoSFromValue(qos.getValue()), isCleanSession);
} catch (MQTTException e) {
//Will not throw the exception further since the bridge will handle the exceptions in both the realm
final String message = "Error occurred while subscription is initiated for topic : " + topic +
" and session id :" + mqttClientChannelID;
log.error(message, e);
}
}
|
void function(String topic, String mqttClientChannelID, String username, AbstractMessage.QOSType qos, boolean isCleanSession) { try { MQTTopicManager.getInstance().addTopicSubscription(topic, mqttClientChannelID, username, QOSLevel.getQoSFromValue(qos.getValue()), isCleanSession); } catch (MQTTException e) { final String message = STR + topic + STR + mqttClientChannelID; log.error(message, e); } }
|
/**
* This will be triggered each time a subscriber subscribes to a topic, when connecting with Andes
* only one subscription will be indicated per node
* just to ensure that cluster wide the subscriptions are visible.
* The message delivery to the subscribers will be managed through the respective channel
*
* @param topic the name of the topic the subscribed to
* @param mqttClientChannelID the client identification maintained by the MQTT protocol lib
* @param username carbon username of logged user
* @param qos the type of qos the subscription is connected to this can be either MOST_ONE,LEAST_ONE,
* EXACTLY_ONE
* @param isCleanSession whether the subscription is durable
*/
|
This will be triggered each time a subscriber subscribes to a topic, when connecting with Andes only one subscription will be indicated per node just to ensure that cluster wide the subscriptions are visible. The message delivery to the subscribers will be managed through the respective channel
|
onTopicSubscription
|
{
"repo_name": "hastef88/andes",
"path": "modules/andes-core/broker/src/main/java/org/dna/mqtt/wso2/AndesMQTTBridge.java",
"license": "apache-2.0",
"size": 11668
}
|
[
"org.dna.mqtt.moquette.proto.messages.AbstractMessage",
"org.wso2.andes.mqtt.MQTTException",
"org.wso2.andes.mqtt.MQTTopicManager"
] |
import org.dna.mqtt.moquette.proto.messages.AbstractMessage; import org.wso2.andes.mqtt.MQTTException; import org.wso2.andes.mqtt.MQTTopicManager;
|
import org.dna.mqtt.moquette.proto.messages.*; import org.wso2.andes.mqtt.*;
|
[
"org.dna.mqtt",
"org.wso2.andes"
] |
org.dna.mqtt; org.wso2.andes;
| 840,108
|
//TODO: should be renamed getBase() since it also looks
// in containing scopes
public Declaration getMemberOrParameter(Unit unit,
String name,
List<Type> signature,
boolean ellipsis);
|
Declaration function(Unit unit, String name, List<Type> signature, boolean ellipsis);
|
/**
* Resolve an unqualified reference.
*
* @param name the name of the member
* @param signature the signature of the parameter list,
* or null if we have no parameter list
* @param ellipsis true if we are looking for a member
* with a variadic parameter
*
* @return the best matching member
*/
|
Resolve an unqualified reference
|
getMemberOrParameter
|
{
"repo_name": "ceylon/ceylon-model",
"path": "src/com/redhat/ceylon/model/typechecker/model/Scope.java",
"license": "apache-2.0",
"size": 4593
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,527,594
|
@Test
public void retrieveTest() {
Picture picture = dao.retrieve("mypicture");
Assert.assertNotNull(picture);
}
|
void function() { Picture picture = dao.retrieve(STR); Assert.assertNotNull(picture); }
|
/**
* run the test.
*/
|
run the test
|
retrieveTest
|
{
"repo_name": "otaviojava/Easy-Cassandra",
"path": "src/test/java/org/easycassandra/bean/PictureDAOTest.java",
"license": "apache-2.0",
"size": 1115
}
|
[
"junit.framework.Assert",
"org.easycassandra.bean.model.Picture"
] |
import junit.framework.Assert; import org.easycassandra.bean.model.Picture;
|
import junit.framework.*; import org.easycassandra.bean.model.*;
|
[
"junit.framework",
"org.easycassandra.bean"
] |
junit.framework; org.easycassandra.bean;
| 2,135,001
|
protected void inboundDataReceived(ReadableBuffer frame) {
checkNotNull(frame, "frame");
boolean needToCloseFrame = true;
try {
if (statusReported) {
log.log(Level.INFO, "Received data on closed stream");
return;
}
needToCloseFrame = false;
deframe(frame);
} finally {
if (needToCloseFrame) {
frame.close();
}
}
}
|
void function(ReadableBuffer frame) { checkNotNull(frame, "frame"); boolean needToCloseFrame = true; try { if (statusReported) { log.log(Level.INFO, STR); return; } needToCloseFrame = false; deframe(frame); } finally { if (needToCloseFrame) { frame.close(); } } }
|
/**
* Processes the contents of a received data frame from the server.
*
* @param frame the received data frame. Its ownership is transferred to this method.
*/
|
Processes the contents of a received data frame from the server
|
inboundDataReceived
|
{
"repo_name": "dapengzhang0/grpc-java",
"path": "core/src/main/java/io/grpc/internal/AbstractClientStream.java",
"license": "apache-2.0",
"size": 19093
}
|
[
"com.google.common.base.Preconditions",
"java.util.logging.Level"
] |
import com.google.common.base.Preconditions; import java.util.logging.Level;
|
import com.google.common.base.*; import java.util.logging.*;
|
[
"com.google.common",
"java.util"
] |
com.google.common; java.util;
| 1,448,514
|
Stats<Number> stats(int offset, int length);
|
Stats<Number> stats(int offset, int length);
|
/**
* Returns the stats interface over a subrange of this array
* @param offset the offset from start of array
* @param length the number of items from offset
* @return the stats interface over a subrange of this array
*/
|
Returns the stats interface over a subrange of this array
|
stats
|
{
"repo_name": "zavtech/morpheus-core",
"path": "src/main/java/com/zavtech/morpheus/array/Array.java",
"license": "apache-2.0",
"size": 34601
}
|
[
"com.zavtech.morpheus.stats.Stats"
] |
import com.zavtech.morpheus.stats.Stats;
|
import com.zavtech.morpheus.stats.*;
|
[
"com.zavtech.morpheus"
] |
com.zavtech.morpheus;
| 2,219,126
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.