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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Builder addProperty(String name, SchemaOrgType value); | Builder addProperty(String name, SchemaOrgType value); | /**
* Add a value to property.
*
* @param name The property name.
* @param value The value of the property.
*/ | Add a value to property | addProperty | {
"repo_name": "google/schemaorg-java",
"path": "src/main/java/com/google/schemaorg/core/DownloadAction.java",
"license": "apache-2.0",
"size": 9000
} | [
"com.google.schemaorg.SchemaOrgType"
] | import com.google.schemaorg.SchemaOrgType; | import com.google.schemaorg.*; | [
"com.google.schemaorg"
] | com.google.schemaorg; | 915,888 |
public long getNodeCardinality(NodeId nodeId, ApplicationId applicationId,
String tag) throws InvalidAllocationTagsQueryException {
readLock.lock();
try {
if (nodeId == null) {
throw new InvalidAllocationTagsQueryException(
"Must specify nodeId/tag to query cardinality");
... | long function(NodeId nodeId, ApplicationId applicationId, String tag) throws InvalidAllocationTagsQueryException { readLock.lock(); try { if (nodeId == null) { throw new InvalidAllocationTagsQueryException( STR); } TypeToCountedTags mapping; if (applicationId != null) { mapping = perAppNodeMappings.get(applicationId); ... | /**
* Get Node cardinality for a specific tag.
* When applicationId is null, method returns aggregated cardinality
*
* @param nodeId nodeId, required.
* @param applicationId applicationId. When null is specified, return
* aggregated cardinality among all nodes.
* @param ... | Get Node cardinality for a specific tag. When applicationId is null, method returns aggregated cardinality | getNodeCardinality | {
"repo_name": "apurtell/hadoop",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/constraint/AllocationTagsManager.java",
"license": "apache-2.0",
"size": 23953
} | [
"org.apache.hadoop.yarn.api.records.ApplicationId",
"org.apache.hadoop.yarn.api.records.NodeId"
] | import org.apache.hadoop.yarn.api.records.ApplicationId; import org.apache.hadoop.yarn.api.records.NodeId; | import org.apache.hadoop.yarn.api.records.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 950,072 |
Collection<ClusterNode> cacheAffinityNodes(@Nullable String cacheName, final long topVer) {
return filter(topVer, affCacheNodes.get(cacheName));
} | Collection<ClusterNode> cacheAffinityNodes(@Nullable String cacheName, final long topVer) { return filter(topVer, affCacheNodes.get(cacheName)); } | /**
* Gets all nodes that have cache with given name and should participate in affinity calculation. With
* partitioned cache nodes with near-only cache do not participate in affinity node calculation.
*
* @param cacheName Cache name.
* @param topVer Topology version.
... | Gets all nodes that have cache with given name and should participate in affinity calculation. With partitioned cache nodes with near-only cache do not participate in affinity node calculation | cacheAffinityNodes | {
"repo_name": "agoncharuk/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java",
"license": "apache-2.0",
"size": 104025
} | [
"java.util.Collection",
"org.apache.ignite.cluster.ClusterNode",
"org.jetbrains.annotations.Nullable"
] | import java.util.Collection; import org.apache.ignite.cluster.ClusterNode; import org.jetbrains.annotations.Nullable; | import java.util.*; import org.apache.ignite.cluster.*; import org.jetbrains.annotations.*; | [
"java.util",
"org.apache.ignite",
"org.jetbrains.annotations"
] | java.util; org.apache.ignite; org.jetbrains.annotations; | 1,709,229 |
@SuppressWarnings("unused")
private void summariseMDHTSubclasses()
{
for (Enumeration<String> en = mdhtSubClasses.keys(); en.hasMoreElements();)
{
String classKey = en.nextElement();
Hashtable<EClass,String> subs = mdhtSubClasses.get(classKey);
trace(classKey + ": " + subs.size());
}
}
... | @SuppressWarnings(STR) void function() { for (Enumeration<String> en = mdhtSubClasses.keys(); en.hasMoreElements();) { String classKey = en.nextElement(); Hashtable<EClass,String> subs = mdhtSubClasses.get(classKey); trace(classKey + STR + subs.size()); } } | /**
* write a summary of how many subclasses there are for each CDA class
*/ | write a summary of how many subclasses there are for each CDA class | summariseMDHTSubclasses | {
"repo_name": "openmapsoftware/mappingtools",
"path": "openmap-mapper-health/src/main/java/com/openMap1/mapper/health/actions/ImportMDHTModel.java",
"license": "epl-1.0",
"size": 93111
} | [
"java.util.Enumeration",
"java.util.Hashtable",
"org.eclipse.emf.ecore.EClass"
] | import java.util.Enumeration; import java.util.Hashtable; import org.eclipse.emf.ecore.EClass; | import java.util.*; import org.eclipse.emf.ecore.*; | [
"java.util",
"org.eclipse.emf"
] | java.util; org.eclipse.emf; | 2,105,682 |
public void testClassID()
{
ClassID clsidTest = new ClassID(
new byte[] {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10}
, 0
);
Assert.assertEquals(clsidTest.toString().toUpperCase(Locale.... | void function() { ClassID clsidTest = new ClassID( new byte[] {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10} , 0 ); Assert.assertEquals(clsidTest.toString().toUpperCase(Locale.ROOT), STR ); } | /**
* <p>Tests the {@link PropertySet} methods. The test file has two
* property set: the first one is a {@link SummaryInformation},
* the second one is a {@link DocumentSummaryInformation}.</p>
*/ | Tests the <code>PropertySet</code> methods. The test file has two property set: the first one is a <code>SummaryInformation</code>, the second one is a <code>DocumentSummaryInformation</code> | testClassID | {
"repo_name": "lvweiwolf/poi-3.16",
"path": "src/testcases/org/apache/poi/hpsf/basic/TestClassID.java",
"license": "apache-2.0",
"size": 4243
} | [
"java.util.Locale",
"junit.framework.Assert",
"org.apache.poi.hpsf.ClassID"
] | import java.util.Locale; import junit.framework.Assert; import org.apache.poi.hpsf.ClassID; | import java.util.*; import junit.framework.*; import org.apache.poi.hpsf.*; | [
"java.util",
"junit.framework",
"org.apache.poi"
] | java.util; junit.framework; org.apache.poi; | 898,438 |
@Test
public void matchIcmpTypeTest() {
Criterion criterion = Criteria.matchIcmpType((byte) 250);
ObjectNode result = criterionCodec.encode(criterion, context);
assertThat(result, matchesCriterion(criterion));
} | void function() { Criterion criterion = Criteria.matchIcmpType((byte) 250); ObjectNode result = criterionCodec.encode(criterion, context); assertThat(result, matchesCriterion(criterion)); } | /**
* Tests ICMP type criterion.
*/ | Tests ICMP type criterion | matchIcmpTypeTest | {
"repo_name": "sdnwiselab/onos",
"path": "core/common/src/test/java/org/onosproject/codec/impl/CriterionCodecTest.java",
"license": "apache-2.0",
"size": 14744
} | [
"com.fasterxml.jackson.databind.node.ObjectNode",
"org.hamcrest.MatcherAssert",
"org.onosproject.codec.impl.CriterionJsonMatcher",
"org.onosproject.net.flow.criteria.Criteria",
"org.onosproject.net.flow.criteria.Criterion"
] | import com.fasterxml.jackson.databind.node.ObjectNode; import org.hamcrest.MatcherAssert; import org.onosproject.codec.impl.CriterionJsonMatcher; import org.onosproject.net.flow.criteria.Criteria; import org.onosproject.net.flow.criteria.Criterion; | import com.fasterxml.jackson.databind.node.*; import org.hamcrest.*; import org.onosproject.codec.impl.*; import org.onosproject.net.flow.criteria.*; | [
"com.fasterxml.jackson",
"org.hamcrest",
"org.onosproject.codec",
"org.onosproject.net"
] | com.fasterxml.jackson; org.hamcrest; org.onosproject.codec; org.onosproject.net; | 2,576,404 |
@Override
public void onConnectionFailed(ConnectionResult result) {
updateConnectButtonState();
// Most of the time, the connection will fail with a user resolvable
// result. We can store
// that in our mConnectionResult property ready to be used when the user
// clicks the
// sign-in button.
if (re... | void function(ConnectionResult result) { updateConnectButtonState(); if (result.hasResolution()) { mConnectionResult = result; if (mAutoResolveOnFail) { startResolution(); } } } | /**
* Connection failed for some reason (called by PlusClient) Try and resolve
* the result. Failure here is usually not an indication of a serious error,
* just that the user's input is needed.
*
* @see #onActivityResult(int, int, Intent)
*/ | Connection failed for some reason (called by PlusClient) Try and resolve the result. Failure here is usually not an indication of a serious error, just that the user's input is needed | onConnectionFailed | {
"repo_name": "llanox/EasyVote",
"path": "EasyVote/src/com/llanox/mobile/easyvote/activities/PlusBaseActivity.java",
"license": "apache-2.0",
"size": 10673
} | [
"com.google.android.gms.common.ConnectionResult"
] | import com.google.android.gms.common.ConnectionResult; | import com.google.android.gms.common.*; | [
"com.google.android"
] | com.google.android; | 564,372 |
public void notifyPostedLocked(StatusBarNotification sbn, StatusBarNotification oldSbn) {
// Lazily initialized snapshots of the notification.
TrimCache trimCache = new TrimCache(sbn);
for (final ManagedServiceInfo info : mServices) {
boolean sbnVisible = isV... | void function(StatusBarNotification sbn, StatusBarNotification oldSbn) { TrimCache trimCache = new TrimCache(sbn); for (final ManagedServiceInfo info : mServices) { boolean sbnVisible = isVisibleToListener(sbn, info); boolean oldSbnVisible = oldSbn != null ? isVisibleToListener(oldSbn, info) : false; if (!oldSbnVisible... | /**
* asynchronously notify all listeners about a new notification
*
* <p>
* Also takes care of removing a notification that has been visible to a listener before,
* but isn't anymore.
*/ | asynchronously notify all listeners about a new notification Also takes care of removing a notification that has been visible to a listener before, but isn't anymore | notifyPostedLocked | {
"repo_name": "xorware/android_frameworks_base",
"path": "services/core/java/com/android/server/notification/NotificationManagerService.java",
"license": "apache-2.0",
"size": 194113
} | [
"android.service.notification.NotificationRankingUpdate",
"android.service.notification.StatusBarNotification",
"com.android.server.notification.ManagedServices"
] | import android.service.notification.NotificationRankingUpdate; import android.service.notification.StatusBarNotification; import com.android.server.notification.ManagedServices; | import android.service.notification.*; import com.android.server.notification.*; | [
"android.service",
"com.android.server"
] | android.service; com.android.server; | 348,452 |
@Test
public void testHeapMemoryPropertyWithoutUnit() throws Exception {
final String[] args = new String[] { "-yjm", "1024", "-ytm", "2048" };
final FlinkYarnSessionCli flinkYarnSessionCli = createFlinkYarnSessionCli();
final CommandLine commandLine = flinkYarnSessionCli.parseCommandLineOptions(args, false)... | void function() throws Exception { final String[] args = new String[] { "-yjm", "1024", "-ytm", "2048" }; final FlinkYarnSessionCli flinkYarnSessionCli = createFlinkYarnSessionCli(); final CommandLine commandLine = flinkYarnSessionCli.parseCommandLineOptions(args, false); final Configuration executorConfig = flinkYarnS... | /**
* Tests the specifying heap memory without unit for job manager and task manager.
*/ | Tests the specifying heap memory without unit for job manager and task manager | testHeapMemoryPropertyWithoutUnit | {
"repo_name": "bowenli86/flink",
"path": "flink-yarn/src/test/java/org/apache/flink/yarn/FlinkYarnSessionCliTest.java",
"license": "apache-2.0",
"size": 23408
} | [
"org.apache.commons.cli.CommandLine",
"org.apache.flink.client.deployment.ClusterClientFactory",
"org.apache.flink.client.deployment.ClusterSpecification",
"org.apache.flink.configuration.Configuration",
"org.apache.flink.yarn.cli.FlinkYarnSessionCli",
"org.apache.hadoop.yarn.api.records.ApplicationId",
... | import org.apache.commons.cli.CommandLine; import org.apache.flink.client.deployment.ClusterClientFactory; import org.apache.flink.client.deployment.ClusterSpecification; import org.apache.flink.configuration.Configuration; import org.apache.flink.yarn.cli.FlinkYarnSessionCli; import org.apache.hadoop.yarn.api.records.... | import org.apache.commons.cli.*; import org.apache.flink.client.deployment.*; import org.apache.flink.configuration.*; import org.apache.flink.yarn.cli.*; import org.apache.hadoop.yarn.api.records.*; import org.hamcrest.*; import org.junit.*; | [
"org.apache.commons",
"org.apache.flink",
"org.apache.hadoop",
"org.hamcrest",
"org.junit"
] | org.apache.commons; org.apache.flink; org.apache.hadoop; org.hamcrest; org.junit; | 1,552,579 |
public void register(FormItem formComp) {
if(!hasRootForm){
throw new AssertionError("first ensure that the layout container knows about its rootform!!");
}
// set the formtranslator, and parent
Translator itemTranslator = formComp.getTranslator();
if(formComp.getTranslator()!=null && itemTranslator ins... | void function(FormItem formComp) { if(!hasRootForm){ throw new AssertionError(STR); } Translator itemTranslator = formComp.getTranslator(); if(formComp.getTranslator()!=null && itemTranslator instanceof PackageTranslator){ PackageTranslator itemPt = (PackageTranslator)itemTranslator; itemTranslator = PackageTranslator.... | /**
* register only, does not addsubcomponents, does not expose formItem in the velocity.
* In 99% of the cases you should use an addXX method instead.
* @param formComp
*/ | register only, does not addsubcomponents, does not expose formItem in the velocity. In 99% of the cases you should use an addXX method instead | register | {
"repo_name": "stevenhva/InfoLearn_OpenOLAT",
"path": "src/main/java/org/olat/core/gui/components/form/flexible/impl/FormLayoutContainer.java",
"license": "apache-2.0",
"size": 20429
} | [
"org.olat.core.gui.GUIInterna",
"org.olat.core.gui.components.form.flexible.FormItem",
"org.olat.core.gui.translator.PackageTranslator",
"org.olat.core.gui.translator.Translator"
] | import org.olat.core.gui.GUIInterna; import org.olat.core.gui.components.form.flexible.FormItem; import org.olat.core.gui.translator.PackageTranslator; import org.olat.core.gui.translator.Translator; | import org.olat.core.gui.*; import org.olat.core.gui.components.form.flexible.*; import org.olat.core.gui.translator.*; | [
"org.olat.core"
] | org.olat.core; | 1,412,660 |
@Test
public void testPutCacheValueIdempotent() throws IOException {
repositoryCache.put(downloadedFileSha256, downloadedFile, KeyType.SHA256);
repositoryCache.put(downloadedFileSha256, downloadedFile, KeyType.SHA256);
Path cacheEntry = KeyType.SHA256.getCachePath(contentAddressableCachePath).getChild(... | void function() throws IOException { repositoryCache.put(downloadedFileSha256, downloadedFile, KeyType.SHA256); repositoryCache.put(downloadedFileSha256, downloadedFile, KeyType.SHA256); Path cacheEntry = KeyType.SHA256.getCachePath(contentAddressableCachePath).getChild(downloadedFileSha256); Path cacheValue = cacheEnt... | /**
* Test that the put method is idempotent, i.e. two successive put calls
* should not affect the final state in the cache.
*/ | Test that the put method is idempotent, i.e. two successive put calls should not affect the final state in the cache | testPutCacheValueIdempotent | {
"repo_name": "damienmg/bazel",
"path": "src/test/java/com/google/devtools/build/lib/bazel/repository/cache/RepositoryCacheTest.java",
"license": "apache-2.0",
"size": 6881
} | [
"com.google.common.truth.Truth",
"com.google.devtools.build.lib.bazel.repository.cache.RepositoryCache",
"com.google.devtools.build.lib.vfs.FileSystemUtils",
"com.google.devtools.build.lib.vfs.Path",
"java.io.IOException",
"java.nio.charset.Charset"
] | import com.google.common.truth.Truth; import com.google.devtools.build.lib.bazel.repository.cache.RepositoryCache; import com.google.devtools.build.lib.vfs.FileSystemUtils; import com.google.devtools.build.lib.vfs.Path; import java.io.IOException; import java.nio.charset.Charset; | import com.google.common.truth.*; import com.google.devtools.build.lib.bazel.repository.cache.*; import com.google.devtools.build.lib.vfs.*; import java.io.*; import java.nio.charset.*; | [
"com.google.common",
"com.google.devtools",
"java.io",
"java.nio"
] | com.google.common; com.google.devtools; java.io; java.nio; | 1,171,445 |
public EntityPersister getEntityPersister(String entityName) throws MappingException; | EntityPersister function(String entityName) throws MappingException; | /**
* Get the persister for the named entity
*
* @param entityName The name of the entity for which to retrieve the persister.
* @return The persister
* @throws MappingException Indicates persister could not be found with that name.
*/ | Get the persister for the named entity | getEntityPersister | {
"repo_name": "codeApeFromChina/resource",
"path": "frame_packages/java_libs/hibernate-distribution-3.6.10.Final/project/hibernate-core/src/main/java/org/hibernate/engine/SessionFactoryImplementor.java",
"license": "unlicense",
"size": 8320
} | [
"org.hibernate.MappingException",
"org.hibernate.persister.entity.EntityPersister"
] | import org.hibernate.MappingException; import org.hibernate.persister.entity.EntityPersister; | import org.hibernate.*; import org.hibernate.persister.entity.*; | [
"org.hibernate",
"org.hibernate.persister"
] | org.hibernate; org.hibernate.persister; | 1,518,647 |
private Component makeDialogComponents()
{
JPanel dialogPanel = new JPanel();
dialogPanel.setLayout(new BorderLayout());
// main panel with a box layout
JPanel mainPanel = new JPanel();
mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
// Label at top
JLabel introLabel = new JLabel(I18... | Component function() { JPanel dialogPanel = new JPanel(); dialogPanel.setLayout(new BorderLayout()); JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS)); JLabel introLabel = new JLabel(I18nManager.getText(STR) + ":"); introLabel.setBorder(BorderFactory.createEmptyBorder(5, 5... | /**
* Make the dialog components
* @return the GUI components for the dialog
*/ | Make the dialog components | makeDialogComponents | {
"repo_name": "activityworkshop/GpsPrune",
"path": "src/tim/prune/function/estimate/LearnParameters.java",
"license": "gpl-2.0",
"size": 17369
} | [
"java.awt.BorderLayout",
"java.awt.Component",
"javax.swing.BorderFactory",
"javax.swing.Box",
"javax.swing.BoxLayout",
"javax.swing.JLabel",
"javax.swing.JPanel"
] | import java.awt.BorderLayout; import java.awt.Component; import javax.swing.BorderFactory; import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.JLabel; import javax.swing.JPanel; | import java.awt.*; import javax.swing.*; | [
"java.awt",
"javax.swing"
] | java.awt; javax.swing; | 357,539 |
private static EventCountLimitDTO fromEventCountLimitToDTO(EventCountLimit eventCountLimit) {
EventCountLimitDTO dto = new EventCountLimitDTO();
dto.setTimeUnit(eventCountLimit.getTimeUnit());
dto.setUnitTime(eventCountLimit.getUnitTime());
dto.setEventCount(eventCountLimit.getEvent... | static EventCountLimitDTO function(EventCountLimit eventCountLimit) { EventCountLimitDTO dto = new EventCountLimitDTO(); dto.setTimeUnit(eventCountLimit.getTimeUnit()); dto.setUnitTime(eventCountLimit.getUnitTime()); dto.setEventCount(eventCountLimit.getEventCount()); return dto; } | /**
* Converts a Event Count Limit model object into a Event Count Limit DTO object.
*
* @param eventCountLimit Event Count Limit model object
* @return Event Count Limit DTO object derived from model
*/ | Converts a Event Count Limit model object into a Event Count Limit DTO object | fromEventCountLimitToDTO | {
"repo_name": "tharikaGitHub/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.internal.service/src/main/java/org/wso2/carbon/apimgt/internal/service/utils/SubscriptionValidationDataUtil.java",
"license": "apache-2.0",
"size": 24506
} | [
"org.wso2.carbon.apimgt.api.model.policy.EventCountLimit",
"org.wso2.carbon.apimgt.internal.service.dto.EventCountLimitDTO"
] | import org.wso2.carbon.apimgt.api.model.policy.EventCountLimit; import org.wso2.carbon.apimgt.internal.service.dto.EventCountLimitDTO; | import org.wso2.carbon.apimgt.api.model.policy.*; import org.wso2.carbon.apimgt.internal.service.dto.*; | [
"org.wso2.carbon"
] | org.wso2.carbon; | 602,956 |
@Test
@ExpectedFFDC(repeatAction = RepeatOnErrorEE8.ID_FAIL,
value = { "com.ibm.ejs.container.EJBConfigurationException", "com.ibm.ws.container.service.state.StateChangeException" })
@ExpectedFFDC(repeatAction = RepeatOnErrorEE9.ID_FAIL,
value = { "com.ibm.ejs.container.E... | @ExpectedFFDC(repeatAction = RepeatOnErrorEE8.ID_FAIL, value = { STR, STR }) @ExpectedFFDC(repeatAction = RepeatOnErrorEE9.ID_FAIL, value = { STR, STR }) void function() throws Exception { testHelper(24, STR, false); } | /**
* Has local:ejb in component-id
*/ | Has local:ejb in component-id | testNamespaceInComponentId | {
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.ejbcontainer.bindings_fat/fat/src/com/ibm/ws/ejbcontainer/bindings/fat/tests/BndErrorTest.java",
"license": "epl-1.0",
"size": 18010
} | [
"com.ibm.ws.ejbcontainer.bindings.fat.tests.repeataction.RepeatOnErrorEE8",
"com.ibm.ws.ejbcontainer.bindings.fat.tests.repeataction.RepeatOnErrorEE9"
] | import com.ibm.ws.ejbcontainer.bindings.fat.tests.repeataction.RepeatOnErrorEE8; import com.ibm.ws.ejbcontainer.bindings.fat.tests.repeataction.RepeatOnErrorEE9; | import com.ibm.ws.ejbcontainer.bindings.fat.tests.repeataction.*; | [
"com.ibm.ws"
] | com.ibm.ws; | 2,875,961 |
if (input == null || input.size() < 2) {
warn("invalid input tuple: "+input, PigWarning.UDF_WARNING_1);
return null;
}
try {
String str = (String)input.get(0);
String search = (String)input.get(1);
int fromIndex = 0;
if (input.size(... | if (input == null input.size() < 2) { warn(STR+input, PigWarning.UDF_WARNING_1); return null; } try { String str = (String)input.get(0); String search = (String)input.get(1); int fromIndex = 0; if (input.size() >=3) fromIndex = (Integer)input.get(2); return str.indexOf(search, fromIndex); } catch(Exception e){ warn(STR... | /**
* Method invoked on every tuple during foreach evaluation
* @param input tuple; first column is assumed to have the column to convert
* the second column is the string we search for
* the third is an optional column from where to start the search
* @e... | Method invoked on every tuple during foreach evaluation | exec | {
"repo_name": "netxillon/pig",
"path": "src/org/apache/pig/builtin/INDEXOF.java",
"license": "apache-2.0",
"size": 2789
} | [
"org.apache.pig.PigWarning"
] | import org.apache.pig.PigWarning; | import org.apache.pig.*; | [
"org.apache.pig"
] | org.apache.pig; | 20,798 |
RobotName getRobotName() {
return robotName;
} | RobotName getRobotName() { return robotName; } | /**
* Returns the name of this robot.
*/ | Returns the name of this robot | getRobotName | {
"repo_name": "gburd/wave",
"path": "src/org/waveprotocol/box/server/robots/passive/Robot.java",
"license": "apache-2.0",
"size": 10918
} | [
"com.google.wave.api.robot.RobotName"
] | import com.google.wave.api.robot.RobotName; | import com.google.wave.api.robot.*; | [
"com.google.wave"
] | com.google.wave; | 321,329 |
public void makeFlickable(Spatial s, MultiTouchElement movingElement,
float deceleration) {
this.makeFlickable(s, s, movingElement, deceleration);
}
| void function(Spatial s, MultiTouchElement movingElement, float deceleration) { this.makeFlickable(s, s, movingElement, deceleration); } | /**
* Make flickable.
*
* @param s
* the s
* @param movingElement
* the moving element
* @param deceleration
* the deceleration
*/ | Make flickable | makeFlickable | {
"repo_name": "synergynet/synergynet2.5",
"path": "synergynet2.5/src/main/java/synergynetframework/jme/cursorsystem/flicksystem/FlickSystem.java",
"license": "bsd-3-clause",
"size": 6531
} | [
"com.jme.scene.Spatial"
] | import com.jme.scene.Spatial; | import com.jme.scene.*; | [
"com.jme.scene"
] | com.jme.scene; | 1,432,586 |
public void setTraits ( Map traits ) {
if ( traits != null ) {
this.traits = new TreeMap<Integer, Object>( traits );
} else {
this.traits = null;
}
} | void function ( Map traits ) { if ( traits != null ) { this.traits = new TreeMap<Integer, Object>( traits ); } else { this.traits = null; } } | /**
* Set traits on this area, copying from an existing traits map.
*
* @param traits the map of traits
*/ | Set traits on this area, copying from an existing traits map | setTraits | {
"repo_name": "Distrotech/fop",
"path": "src/java/org/apache/fop/area/Area.java",
"license": "apache-2.0",
"size": 12869
} | [
"java.util.Map",
"java.util.TreeMap"
] | import java.util.Map; import java.util.TreeMap; | import java.util.*; | [
"java.util"
] | java.util; | 2,855,088 |
@ThreadConfined(UI)
public void onHostDestroy(Activity activity) {
if (activity == mCurrentActivity) {
onHostDestroy();
}
} | @ThreadConfined(UI) void function(Activity activity) { if (activity == mCurrentActivity) { onHostDestroy(); } } | /**
* Call this from {@link Activity#onDestroy()}. This notifies any listening modules so they can do
* any necessary cleanup. If the activity being destroyed is not the current activity, no modules
* are notified.
*
* @param activity the activity being destroyed
*/ | Call this from <code>Activity#onDestroy()</code>. This notifies any listening modules so they can do any necessary cleanup. If the activity being destroyed is not the current activity, no modules are notified | onHostDestroy | {
"repo_name": "negativetwelve/react-native",
"path": "ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java",
"license": "bsd-3-clause",
"size": 41684
} | [
"android.app.Activity",
"com.facebook.infer.annotation.ThreadConfined"
] | import android.app.Activity; import com.facebook.infer.annotation.ThreadConfined; | import android.app.*; import com.facebook.infer.annotation.*; | [
"android.app",
"com.facebook.infer"
] | android.app; com.facebook.infer; | 1,109,430 |
public void testLogHTTPRequest() throws ValidationException, IOException, AuthenticationException {
System.out.println("logHTTPRequest");
String[] ignore = {"password","ssn","ccn"};
MockHttpServletRequest request = new MockHttpServletRequest();
MockHttpServletResponse response = ... | void function() throws ValidationException, IOException, AuthenticationException { System.out.println(STR); String[] ignore = {STR,"ssn","ccn"}; MockHttpServletRequest request = new MockHttpServletRequest(); MockHttpServletResponse response = new MockHttpServletResponse(); ESAPI.httpUtilities().setCurrentHTTP(request, ... | /**
* Test of logHTTPRequest method, of class org.owasp.esapi.Logger.
*
* @throws ValidationException
* the validation exception
* @throws IOException
* Signals that an I/O exception has occurred.
* @throws AuthenticationException
* th... | Test of logHTTPRequest method, of class org.owasp.esapi.Logger | testLogHTTPRequest | {
"repo_name": "Letractively/owasp-esapi-java",
"path": "src/test/java/org/owasp/esapi/reference/JavaLoggerTest.java",
"license": "bsd-3-clause",
"size": 10937
} | [
"java.io.IOException",
"java.util.Arrays",
"org.owasp.esapi.ESAPI",
"org.owasp.esapi.Logger",
"org.owasp.esapi.errors.AuthenticationException",
"org.owasp.esapi.errors.ValidationException",
"org.owasp.esapi.http.MockHttpServletRequest",
"org.owasp.esapi.http.MockHttpServletResponse"
] | import java.io.IOException; import java.util.Arrays; import org.owasp.esapi.ESAPI; import org.owasp.esapi.Logger; import org.owasp.esapi.errors.AuthenticationException; import org.owasp.esapi.errors.ValidationException; import org.owasp.esapi.http.MockHttpServletRequest; import org.owasp.esapi.http.MockHttpServletRespo... | import java.io.*; import java.util.*; import org.owasp.esapi.*; import org.owasp.esapi.errors.*; import org.owasp.esapi.http.*; | [
"java.io",
"java.util",
"org.owasp.esapi"
] | java.io; java.util; org.owasp.esapi; | 1,399,537 |
public Enumeration listOptions() {
Vector result;
Enumeration enm;
result = new Vector();
enm = super.listOptions();
while (enm.hasMoreElements())
result.addElement(enm.nextElement());
result.addElement(new Option(
"\tThe minimum threshold. (default -Double.MAX_VALUE)",
"mi... | Enumeration function() { Vector result; Enumeration enm; result = new Vector(); enm = super.listOptions(); while (enm.hasMoreElements()) result.addElement(enm.nextElement()); result.addElement(new Option( STR, "min", 1, STR)); result.addElement(new Option( STR + STR, STR, 1, STR)); result.addElement(new Option( STR, "m... | /**
* 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": "goddesss/DataModeling",
"path": "src/weka/filters/unsupervised/attribute/NumericCleaner.java",
"license": "gpl-2.0",
"size": 22405
} | [
"java.util.Enumeration",
"java.util.Vector"
] | import java.util.Enumeration; import java.util.Vector; | import java.util.*; | [
"java.util"
] | java.util; | 488,772 |
protected int computeBatchSize(int numBatchedArgs) throws SQLException {
synchronized (checkClosed().getConnectionMutex()) {
long[] combinedValues = computeMaxParameterSetSizeAndBatchSize(numBatchedArgs);
long maxSizeOfParameterSet = combinedValues[0];
long sizeOfEntireB... | int function(int numBatchedArgs) throws SQLException { synchronized (checkClosed().getConnectionMutex()) { long[] combinedValues = computeMaxParameterSetSizeAndBatchSize(numBatchedArgs); long maxSizeOfParameterSet = combinedValues[0]; long sizeOfEntireBatch = combinedValues[1]; int maxAllowedPacket = this.connection.ge... | /**
* Computes the optimum number of batched parameter lists to send
* without overflowing max_allowed_packet.
*
* @param numBatchedArgs
* @throws SQLException
*/ | Computes the optimum number of batched parameter lists to send without overflowing max_allowed_packet | computeBatchSize | {
"repo_name": "swankjesse/mysql-connector-j",
"path": "src/com/mysql/jdbc/PreparedStatement.java",
"license": "gpl-2.0",
"size": 198268
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,904,645 |
void setConfiguration(T arrayType, WorkspaceConfiguration configuration); | void setConfiguration(T arrayType, WorkspaceConfiguration configuration); | /**
* Set the workspace configuration for the specified array type
*
* @param arrayType Type of array to set the configuration for
* @param configuration Configuration for the specified array type
*/ | Set the workspace configuration for the specified array type | setConfiguration | {
"repo_name": "deeplearning4j/deeplearning4j",
"path": "nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/workspace/WorkspaceMgr.java",
"license": "apache-2.0",
"size": 11008
} | [
"org.nd4j.linalg.api.memory.conf.WorkspaceConfiguration"
] | import org.nd4j.linalg.api.memory.conf.WorkspaceConfiguration; | import org.nd4j.linalg.api.memory.conf.*; | [
"org.nd4j.linalg"
] | org.nd4j.linalg; | 1,593,826 |
protected Constructor<?> getConstructor() {
return mConstr;
} | Constructor<?> function() { return mConstr; } | /**
* let subclasses get at the constructor
*/ | let subclasses get at the constructor | getConstructor | {
"repo_name": "ncso/openmarker",
"path": "src/main/java/openmarker/tea/engine/MergedContextSource.java",
"license": "apache-2.0",
"size": 5323
} | [
"java.lang.reflect.Constructor"
] | import java.lang.reflect.Constructor; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 2,146,193 |
public Builder extractUrls(Page page) {
for (Section section : page.getSections()) {
extractUrlsInSection(section.getContent());
}
return this;
} | Builder function(Page page) { for (Section section : page.getSections()) { extractUrlsInSection(section.getContent()); } return this; } | /**
* Extracts all img src URLs, section by section.
*
* @param page the input page
*/ | Extracts all img src URLs, section by section | extractUrls | {
"repo_name": "reproio/apps-android-wikipedia",
"path": "wikipedia/src/main/java/org/wikipedia/savedpages/ImageUrlMap.java",
"license": "apache-2.0",
"size": 4640
} | [
"org.wikipedia.page.Page",
"org.wikipedia.page.Section"
] | import org.wikipedia.page.Page; import org.wikipedia.page.Section; | import org.wikipedia.page.*; | [
"org.wikipedia.page"
] | org.wikipedia.page; | 1,304,368 |
public void testConnect_IllegalStateException() throws IOException {
assertFalse(this.channel1.isConnected());
this.channel1.connect(datagramSocket1Address);
assertTrue(this.channel1.isConnected());
// connect after connected.
try {
this.channel1.connect(datagramS... | void function() throws IOException { assertFalse(this.channel1.isConnected()); this.channel1.connect(datagramSocket1Address); assertTrue(this.channel1.isConnected()); try { this.channel1.connect(datagramSocket1Address); fail(STR); } catch (IllegalStateException e) { } } | /**
* Test method for 'DatagramChannelImpl.connect(SocketAddress)'
*/ | Test method for 'DatagramChannelImpl.connect(SocketAddress)' | testConnect_IllegalStateException | {
"repo_name": "AdmireTheDistance/android_libcore",
"path": "harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/DatagramChannelTest.java",
"license": "gpl-2.0",
"size": 88836
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,454,828 |
public LongArray getArray() {
assert(longArray != null);
return longArray;
} | LongArray function() { assert(longArray != null); return longArray; } | /**
* Returns the underline long[] of longArray.
*/ | Returns the underline long[] of longArray | getArray | {
"repo_name": "maropu/spark",
"path": "core/src/main/java/org/apache/spark/unsafe/map/BytesToBytesMap.java",
"license": "apache-2.0",
"size": 34229
} | [
"org.apache.spark.unsafe.array.LongArray"
] | import org.apache.spark.unsafe.array.LongArray; | import org.apache.spark.unsafe.array.*; | [
"org.apache.spark"
] | org.apache.spark; | 1,497,352 |
public synchronized void loadRemote(URI uri) throws IOException {
this._loadRemote(uri);
} | synchronized void function(URI uri) throws IOException { this._loadRemote(uri); } | /**
* Load the pci.ids file from the specified remote location. Any existing database contents will
* be removed before loading the new database file. During the load process the database will
* not be accessible.
*
* @param uri Remote location of the pci.ids file
* @throws IOException if ... | Load the pci.ids file from the specified remote location. Any existing database contents will be removed before loading the new database file. During the load process the database will not be accessible | loadRemote | {
"repo_name": "marandus/pci-ids",
"path": "src/main/java/com/github/marandus/pciid/service/PciIdsDatabase.java",
"license": "apache-2.0",
"size": 16404
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 322,488 |
public void afterPropertiesSet() {
String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
com.liferay.util.service.ServiceProps.get(
"value.object.listener.com.mpwc.model.ContactoStatus")));
if (listenerClassNames.length > 0) {
try {
List<ModelListener<ContactoStatus>> listenersL... | void function() { String[] listenerClassNames = StringUtil.split(GetterUtil.getString( com.liferay.util.service.ServiceProps.get( STR))); if (listenerClassNames.length > 0) { try { List<ModelListener<ContactoStatus>> listenersList = new ArrayList<ModelListener<ContactoStatus>>(); for (String listenerClassName : listene... | /**
* Initializes the contacto status persistence.
*/ | Initializes the contacto status persistence | afterPropertiesSet | {
"repo_name": "rsicart/mpwc",
"path": "docroot/WEB-INF/src/com/mpwc/service/persistence/ContactoStatusPersistenceImpl.java",
"license": "bsd-3-clause",
"size": 31675
} | [
"com.liferay.portal.kernel.util.GetterUtil",
"com.liferay.portal.kernel.util.InstanceFactory",
"com.liferay.portal.kernel.util.StringUtil",
"com.liferay.portal.model.ModelListener",
"com.mpwc.model.ContactoStatus",
"java.util.ArrayList",
"java.util.List"
] | import com.liferay.portal.kernel.util.GetterUtil; import com.liferay.portal.kernel.util.InstanceFactory; import com.liferay.portal.kernel.util.StringUtil; import com.liferay.portal.model.ModelListener; import com.mpwc.model.ContactoStatus; import java.util.ArrayList; import java.util.List; | import com.liferay.portal.kernel.util.*; import com.liferay.portal.model.*; import com.mpwc.model.*; import java.util.*; | [
"com.liferay.portal",
"com.mpwc.model",
"java.util"
] | com.liferay.portal; com.mpwc.model; java.util; | 934,269 |
public void setSuccessfullyPredictedColumns(Set<Column> columns) {
this.successfullyPredictedColumns = columns;
} | void function(Set<Column> columns) { this.successfullyPredictedColumns = columns; } | /**
* Sets the {@link Set} of columns successfully predicted from t - 1.
* @param columns
*/ | Sets the <code>Set</code> of columns successfully predicted from t - 1 | setSuccessfullyPredictedColumns | {
"repo_name": "hgulcan/badr_htm",
"path": "src/main/java/org/numenta/nupic/Connections.java",
"license": "agpl-3.0",
"size": 51299
} | [
"java.util.Set",
"org.numenta.nupic.model.Column"
] | import java.util.Set; import org.numenta.nupic.model.Column; | import java.util.*; import org.numenta.nupic.model.*; | [
"java.util",
"org.numenta.nupic"
] | java.util; org.numenta.nupic; | 2,106,867 |
public OffsetDateTime autoUpdateEta() {
return this.autoUpdateEta;
} | OffsetDateTime function() { return this.autoUpdateEta; } | /**
* Get the autoUpdateEta property: The estimated time when the self-hosted integration runtime will be updated.
*
* @return the autoUpdateEta value.
*/ | Get the autoUpdateEta property: The estimated time when the self-hosted integration runtime will be updated | autoUpdateEta | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SelfHostedIntegrationRuntimeStatusTypeProperties.java",
"license": "mit",
"size": 12180
} | [
"java.time.OffsetDateTime"
] | import java.time.OffsetDateTime; | import java.time.*; | [
"java.time"
] | java.time; | 1,631,169 |
@Metadata(defaultValue = "1", label = "advanced",
description = "Specify the limit for the number of consumers that are allowed to be idle at any given time.")
public void setIdleConsumerLimit(int idleConsumerLimit) {
getConfiguration().setIdleConsumerLimit(idleConsumerLimit);
} | @Metadata(defaultValue = "1", label = STR, description = STR) void function(int idleConsumerLimit) { getConfiguration().setIdleConsumerLimit(idleConsumerLimit); } | /**
* Specify the limit for the number of consumers that are allowed to be idle at any given time.
*/ | Specify the limit for the number of consumers that are allowed to be idle at any given time | setIdleConsumerLimit | {
"repo_name": "veithen/camel",
"path": "components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java",
"license": "apache-2.0",
"size": 74797
} | [
"org.apache.camel.spi.Metadata"
] | import org.apache.camel.spi.Metadata; | import org.apache.camel.spi.*; | [
"org.apache.camel"
] | org.apache.camel; | 1,574,815 |
public ArrayList<MapLayer> getLayersOrdered() {
ArrayList<Float> a = new ArrayList<Float>();
ArrayList<MapLayer> results = new ArrayList<MapLayer>();
for (Enumeration<Float> e = G.layers.keys(); e.hasMoreElements(); ) {
a.add((Float) e.nextElement());
}
Collections.sort(a);
... | ArrayList<MapLayer> function() { ArrayList<Float> a = new ArrayList<Float>(); ArrayList<MapLayer> results = new ArrayList<MapLayer>(); for (Enumeration<Float> e = G.layers.keys(); e.hasMoreElements(); ) { a.add((Float) e.nextElement()); } Collections.sort(a); for (Float i : a) { if (G.layers.get(i) != null) results.add... | /**
* Returns the layer objects ordered by decreasing 'size'.
* @return An ArrayList of Map Layers.
*/ | Returns the layer objects ordered by decreasing 'size' | getLayersOrdered | {
"repo_name": "lbouma/Cyclopath",
"path": "android/src/org/cyclopath/android/MapSurface.java",
"license": "apache-2.0",
"size": 48472
} | [
"java.util.ArrayList",
"java.util.Collections",
"java.util.Enumeration",
"org.cyclopath.android.items.MapLayer"
] | import java.util.ArrayList; import java.util.Collections; import java.util.Enumeration; import org.cyclopath.android.items.MapLayer; | import java.util.*; import org.cyclopath.android.items.*; | [
"java.util",
"org.cyclopath.android"
] | java.util; org.cyclopath.android; | 983,618 |
public static List<CssMetaData<? extends Styleable, ?>> getClassCssMetaData() {
return new ArrayList<>();
} | static List<CssMetaData<? extends Styleable, ?>> function() { return new ArrayList<>(); } | /**
* This methods need to be provided in any class extending a {@link StyleableAdditionBase}. The sole purpose of the method in the {@link StyleableAdditionBase} is to provide an recommendation
* for the name to use, as such this method will only return an empty {@link ArrayList}.
*
* @return an em... | This methods need to be provided in any class extending a <code>StyleableAdditionBase</code>. The sole purpose of the method in the <code>StyleableAdditionBase</code> is to provide an recommendation for the name to use, as such this method will only return an empty <code>ArrayList</code> | getClassCssMetaData | {
"repo_name": "Xyanid/styleableFX",
"path": "src/main/java/de/saxsys/styleablefx/core/StyleableAdditionBase.java",
"license": "apache-2.0",
"size": 4721
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,771,976 |
public static Expression languageExpression(final String language, final String expression) {
return new ExpressionAdapter() {
private Expression expr;
private Predicate pred; | static Expression function(final String language, final String expression) { return new ExpressionAdapter() { private Expression expr; private Predicate pred; | /**
* Returns an expression for evaluating the expression/predicate using the given language
*
* @param expression the expression or predicate
* @return an expression object which will evaluate the expression/predicate using the given language
*/ | Returns an expression for evaluating the expression/predicate using the given language | languageExpression | {
"repo_name": "nicolaferraro/camel",
"path": "core/camel-support/src/main/java/org/apache/camel/support/builder/ExpressionBuilder.java",
"license": "apache-2.0",
"size": 63316
} | [
"org.apache.camel.Expression",
"org.apache.camel.Predicate",
"org.apache.camel.support.ExpressionAdapter"
] | import org.apache.camel.Expression; import org.apache.camel.Predicate; import org.apache.camel.support.ExpressionAdapter; | import org.apache.camel.*; import org.apache.camel.support.*; | [
"org.apache.camel"
] | org.apache.camel; | 1,312,533 |
public static GANSS_AssistData fromPerAligned(byte[] encodedBytes) {
GANSS_AssistData result = new GANSS_AssistData();
result.decodePerAligned(new BitStreamReader(encodedBytes));
return result;
} | static GANSS_AssistData function(byte[] encodedBytes) { GANSS_AssistData result = new GANSS_AssistData(); result.decodePerAligned(new BitStreamReader(encodedBytes)); return result; } | /**
* Creates a new GANSS_AssistData from encoded stream.
*/ | Creates a new GANSS_AssistData from encoded stream | fromPerAligned | {
"repo_name": "google/supl-client",
"path": "src/main/java/com/google/location/suplclient/asn1/supl2/rrlp_components/GANSS_AssistData.java",
"license": "apache-2.0",
"size": 6289
} | [
"com.google.location.suplclient.asn1.base.BitStreamReader"
] | import com.google.location.suplclient.asn1.base.BitStreamReader; | import com.google.location.suplclient.asn1.base.*; | [
"com.google.location"
] | com.google.location; | 257,556 |
public void seekToEnd(TopicPartition... partitions) {
acquire();
try {
Collection<TopicPartition> parts = partitions.length == 0 ? this.subscriptions.assignedPartitions()
: Arrays.asList(partitions);
for (TopicPartition tp : parts) {
log.de... | void function(TopicPartition... partitions) { acquire(); try { Collection<TopicPartition> parts = partitions.length == 0 ? this.subscriptions.assignedPartitions() : Arrays.asList(partitions); for (TopicPartition tp : parts) { log.debug(STR, tp); subscriptions.needOffsetReset(tp, OffsetResetStrategy.LATEST); } } finally... | /**
* Seek to the last offset for each of the given partitions
*/ | Seek to the last offset for each of the given partitions | seekToEnd | {
"repo_name": "pubnub/kafka",
"path": "clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java",
"license": "apache-2.0",
"size": 59400
} | [
"java.util.Arrays",
"java.util.Collection",
"org.apache.kafka.common.TopicPartition"
] | import java.util.Arrays; import java.util.Collection; import org.apache.kafka.common.TopicPartition; | import java.util.*; import org.apache.kafka.common.*; | [
"java.util",
"org.apache.kafka"
] | java.util; org.apache.kafka; | 1,619,646 |
public static <T extends Closeable> CloseableReference<T> of(T closable) {
if (closable == null) {
return null;
} else {
return new CloseableReference(closable, DEFAULT_CLOSEABLE_RELEASER);
}
}
| static <T extends Closeable> CloseableReference<T> function(T closable) { if (closable == null) { return null; } else { return new CloseableReference(closable, DEFAULT_CLOSEABLE_RELEASER); } } | /**
* Constructs a CloseableReference.
* <p/>
* <p>Returns null if the parameter is null.
*/ | Constructs a CloseableReference. Returns null if the parameter is null | of | {
"repo_name": "onesubone/dolphin",
"path": "lib-java/src/main/java/org/dolphin/lib/references/CloseableReference.java",
"license": "apache-2.0",
"size": 5507
} | [
"java.io.Closeable"
] | import java.io.Closeable; | import java.io.*; | [
"java.io"
] | java.io; | 1,113,887 |
public final PointF getCenter() {
int mX = getWidth()/2;
int mY = getHeight()/2;
return viewToSourceCoord(mX, mY);
} | final PointF function() { int mX = getWidth()/2; int mY = getHeight()/2; return viewToSourceCoord(mX, mY); } | /**
* Returns the source point at the center of the view.
*/ | Returns the source point at the center of the view | getCenter | {
"repo_name": "edovino/subsampling-scale-image-view",
"path": "library/src/com/davemorrissey/labs/subscaleview/SubsamplingScaleImageView.java",
"license": "apache-2.0",
"size": 121079
} | [
"android.graphics.PointF"
] | import android.graphics.PointF; | import android.graphics.*; | [
"android.graphics"
] | android.graphics; | 2,534,835 |
injector = Guice.createInjector(Modules.override(
new InMemoryDefaultTestModule()).with(new MockModule()));
injector.getInstance(GuiceJpaInitializer.class);
injector.injectMembers(this);
OrmTestHelper helper = injector.getInstance(OrmTestHelper.class);
helper.createStack(stackId);
cluster... | injector = Guice.createInjector(Modules.override( new InMemoryDefaultTestModule()).with(new MockModule())); injector.getInstance(GuiceJpaInitializer.class); injector.injectMembers(this); OrmTestHelper helper = injector.getInstance(OrmTestHelper.class); helper.createStack(stackId); clusters.addCluster("c1", stackId); cl... | /**
* Creates 1 host and add it to the cluster.
*
* @throws Exception
*/ | Creates 1 host and add it to the cluster | setup | {
"repo_name": "arenadata/ambari",
"path": "ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ServiceComponentHostConcurrentWriteDeadlockTest.java",
"license": "apache-2.0",
"size": 9446
} | [
"com.google.inject.Guice",
"com.google.inject.util.Modules",
"java.util.Arrays",
"java.util.HashMap",
"java.util.HashSet",
"java.util.Map",
"org.apache.ambari.server.orm.GuiceJpaInitializer",
"org.apache.ambari.server.orm.InMemoryDefaultTestModule",
"org.apache.ambari.server.orm.OrmTestHelper",
"o... | import com.google.inject.Guice; import com.google.inject.util.Modules; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import org.apache.ambari.server.orm.GuiceJpaInitializer; import org.apache.ambari.server.orm.InMemoryDefaultTestModule; import org.apache.ambari.serve... | import com.google.inject.*; import com.google.inject.util.*; import java.util.*; import org.apache.ambari.server.orm.*; import org.apache.ambari.server.state.*; | [
"com.google.inject",
"java.util",
"org.apache.ambari"
] | com.google.inject; java.util; org.apache.ambari; | 2,607,904 |
public void disconnectFromDatabase() throws SQLException{
if( this.connection != null ){
this.connection.close();
}
}
| void function() throws SQLException{ if( this.connection != null ){ this.connection.close(); } } | /**
* This method disconnects from the database.
* @throws SQLException connection failure
*/ | This method disconnects from the database | disconnectFromDatabase | {
"repo_name": "sandorsarkany/unideb",
"path": "src/main/java/data/DataConnection.java",
"license": "apache-2.0",
"size": 1515
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,641,443 |
@Test
public void testHorizontalBlur_1_fractionalKernel() {
// we don't really use the source in this unit test
ARGBPixels srcImage = new ARGBPixels(1, 1);
ARGBPixels dstImage = new ARGBPixels(5, 5);
// @formatter:off
int[] dstPixelsCopy = new int[] {
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 9,... | void function() { ARGBPixels srcImage = new ARGBPixels(1, 1); ARGBPixels dstImage = new ARGBPixels(5, 5); int[] dstPixelsCopy = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; int[] dstPixels = dstImage.getPixels(); System.arraycopy(dstPixelsCopy, 0, dstPixels, 0, dstPixelsCopy.... | /**
* A variation of the testHorizontalBlur_7 that uses 1 row and a fractional
* kernel.
*/ | A variation of the testHorizontalBlur_7 that uses 1 row and a fractional kernel | testHorizontalBlur_1_fractionalKernel | {
"repo_name": "mickleness/pumpernickel",
"path": "src/test/java/com/pump/image/shadow/BoxShadowRendererTest.java",
"license": "mit",
"size": 56851
} | [
"java.awt.Color"
] | import java.awt.Color; | import java.awt.*; | [
"java.awt"
] | java.awt; | 1,688,470 |
@Test
public void testGlobalAndUrlNotMatchesPattern() {
String expectedDescription = "With this awesome plugin, I control the description! Bwuhuhuhaha!";
String expectedKeywords = "Breathtaking, Riveting, Two Thumbs Up!";
String expectedAuthor = "Peter Ciuffetti";
String indexReplaceProperty = " me... | void function() { String expectedDescription = STR; String expectedKeywords = STR; String expectedAuthor = STR; String indexReplaceProperty = STR + STR + STR + STR; Configuration conf = NutchConfiguration.create(); conf.set( STR, STR); conf.set(INDEX_REPLACE_PROPERTY, indexReplaceProperty); conf.set(STR, STR); conf.set... | /**
* Test a global pattern match for description and URL pattern match for
* keywords and author.
*
* Only the global match should be triggered.
*/ | Test a global pattern match for description and URL pattern match for keywords and author. Only the global match should be triggered | testGlobalAndUrlNotMatchesPattern | {
"repo_name": "code4wt/nutch-learning",
"path": "src/plugin/index-replace/src/test/org/apache/nutch/indexer/replace/TestIndexReplace.java",
"license": "apache-2.0",
"size": 19393
} | [
"org.apache.hadoop.conf.Configuration",
"org.apache.nutch.indexer.NutchDocument",
"org.apache.nutch.util.NutchConfiguration",
"org.junit.Assert"
] | import org.apache.hadoop.conf.Configuration; import org.apache.nutch.indexer.NutchDocument; import org.apache.nutch.util.NutchConfiguration; import org.junit.Assert; | import org.apache.hadoop.conf.*; import org.apache.nutch.indexer.*; import org.apache.nutch.util.*; import org.junit.*; | [
"org.apache.hadoop",
"org.apache.nutch",
"org.junit"
] | org.apache.hadoop; org.apache.nutch; org.junit; | 128,821 |
public ResponseStatus handshake(Session session) throws IOException {
long time = System.currentTimeMillis() / 1000;
String auth = md5(session.getSecret() + time);
String url = String
.format("%s?hs=true&p=1.2.1&c=%s&v=%s&u=%s&t=%s&a=%s&api_key=%s&sk=%s", handshakeUrl, clientId,
clientVersion, u... | ResponseStatus function(Session session) throws IOException { long time = System.currentTimeMillis() / 1000; String auth = md5(session.getSecret() + time); String url = String .format(STR, handshakeUrl, clientId, clientVersion, user, time, auth, session.getApiKey(), session.getKey()); return performHandshake(url); } | /**
* Performs a web-service handshake.
*
* @param session An authenticated Session.
* @return the status of the operation
* @throws IOException on I/O errors
* @see net.sourceforge.subsonic.lastfm.Authenticator
*/ | Performs a web-service handshake | handshake | {
"repo_name": "MadMarty/madsonic-server-5.0",
"path": "madsonic-lastfm-java/src/main/java/net/sourceforge/subsonic/lastfm/scrobble/Scrobbler.java",
"license": "gpl-3.0",
"size": 12257
} | [
"java.io.IOException",
"net.sourceforge.subsonic.lastfm.Session",
"net.sourceforge.subsonic.util.StringUtilities"
] | import java.io.IOException; import net.sourceforge.subsonic.lastfm.Session; import net.sourceforge.subsonic.util.StringUtilities; | import java.io.*; import net.sourceforge.subsonic.lastfm.*; import net.sourceforge.subsonic.util.*; | [
"java.io",
"net.sourceforge.subsonic"
] | java.io; net.sourceforge.subsonic; | 2,685,266 |
public PaletteDrawer getDrawer() {
return (PaletteDrawer) getPaletteEntry();
}
/**
* Convenience method to get the DrawerFigure for the model drawer.
*
* @return The DrawerFigure created in {@link #createFigure()} | PaletteDrawer function() { return (PaletteDrawer) getPaletteEntry(); } /** * Convenience method to get the DrawerFigure for the model drawer. * * @return The DrawerFigure created in {@link #createFigure()} | /**
* Convenience method that provides access to the PaletteDrawer that is the
* model.
*
* @return The model PaletteDrawer
*/ | Convenience method that provides access to the PaletteDrawer that is the model | getDrawer | {
"repo_name": "ghillairet/gef-gwt",
"path": "src/main/java/org/eclipse/gef/internal/ui/palette/editparts/DrawerEditPart.java",
"license": "epl-1.0",
"size": 9093
} | [
"org.eclipse.gef.palette.PaletteDrawer"
] | import org.eclipse.gef.palette.PaletteDrawer; | import org.eclipse.gef.palette.*; | [
"org.eclipse.gef"
] | org.eclipse.gef; | 1,338,795 |
@UiThreadTest
@MediumTest
@Feature({"Browser", "Main"})
public void testDataUrl() {
Spannable url = new SpannableStringBuilder(
"data:text/plain;charset=utf-8;base64,VGVzdCBVUkw=");
OmniboxUrlEmphasizer.emphasizeUrl(url, mResources, mProfile,
ConnectionSec... | @Feature({STR, "Main"}) void function() { Spannable url = new SpannableStringBuilder( STR); OmniboxUrlEmphasizer.emphasizeUrl(url, mResources, mProfile, ConnectionSecurityHelperSecurityLevel.NONE, true, true, true); EmphasizedUrlSpanHelper[] spans = EmphasizedUrlSpanHelper.getSpansForEmphasizedUrl(url); assertEquals(ST... | /**
* Verify that a 'data:' URL is colored correctly by
* OmniboxUrlEmphasizer.emphasizeUrl().
*/ | Verify that a 'data:' URL is colored correctly by OmniboxUrlEmphasizer.emphasizeUrl() | testDataUrl | {
"repo_name": "guorendong/iridium-browser-ubuntu",
"path": "chrome/android/javatests_shell/src/org/chromium/chrome/browser/omnibox/OmniboxUrlEmphasizerTest.java",
"license": "bsd-3-clause",
"size": 17742
} | [
"android.text.Spannable",
"android.text.SpannableStringBuilder",
"org.chromium.base.test.util.Feature",
"org.chromium.chrome.browser.ssl.ConnectionSecurityHelperSecurityLevel"
] | import android.text.Spannable; import android.text.SpannableStringBuilder; import org.chromium.base.test.util.Feature; import org.chromium.chrome.browser.ssl.ConnectionSecurityHelperSecurityLevel; | import android.text.*; import org.chromium.base.test.util.*; import org.chromium.chrome.browser.ssl.*; | [
"android.text",
"org.chromium.base",
"org.chromium.chrome"
] | android.text; org.chromium.base; org.chromium.chrome; | 1,043,802 |
@Test
public void testBadFailureRequestContextWithThreadIsolatedAsynchronousObservable() {
RequestContextTestResults results = testRequestContextOnBadFailure(ExecutionIsolationStrategy.THREAD, Schedulers.newThread());
assertFalse(results.isContextInitialized.get()); // it won't have request con... | void function() { RequestContextTestResults results = testRequestContextOnBadFailure(ExecutionIsolationStrategy.THREAD, Schedulers.newThread()); assertFalse(results.isContextInitialized.get()); assertTrue(results.originThread.get().getName().startsWith(STR)); assertTrue(results.isContextInitializedObserveOn.get()); ass... | /**
* Async Observable and thread isolation. User provided thread [RxNetThread] executes Observable and then [RxComputation] observes the onNext calls.
*
* NOTE: RequestContext will NOT exist on that thread.
*
* An async Observable running on its own thread will not have access to the request... | Async Observable and thread isolation. User provided thread [RxNetThread] executes Observable and then [RxComputation] observes the onNext calls. An async Observable running on its own thread will not have access to the request context unless the user manages the context | testBadFailureRequestContextWithThreadIsolatedAsynchronousObservable | {
"repo_name": "sasrin/Hystrix",
"path": "hystrix-core/src/test/java/com/netflix/hystrix/HystrixObservableCommandTest.java",
"license": "apache-2.0",
"size": 272384
} | [
"com.netflix.hystrix.HystrixCommandProperties",
"org.junit.Assert"
] | import com.netflix.hystrix.HystrixCommandProperties; import org.junit.Assert; | import com.netflix.hystrix.*; import org.junit.*; | [
"com.netflix.hystrix",
"org.junit"
] | com.netflix.hystrix; org.junit; | 2,069,804 |
public boolean isInstanceOf(ObjectName name, String className)
throws InstanceNotFoundException {
return mbsInterceptor.isInstanceOf(cloneObjectName(name), className);
} | boolean function(ObjectName name, String className) throws InstanceNotFoundException { return mbsInterceptor.isInstanceOf(cloneObjectName(name), className); } | /**
* Returns true if the MBean specified is an instance of the specified
* class, false otherwise.
*
* @param name The <CODE>ObjectName</CODE> of the MBean.
* @param className The name of the class.
*
* @return true if the MBean specified is an instance of the specified
* cl... | Returns true if the MBean specified is an instance of the specified class, false otherwise | isInstanceOf | {
"repo_name": "wangsongpeng/jdk-src",
"path": "src/main/java/com/sun/jmx/mbeanserver/JmxMBeanServer.java",
"license": "apache-2.0",
"size": 65635
} | [
"javax.management.InstanceNotFoundException",
"javax.management.ObjectName"
] | import javax.management.InstanceNotFoundException; import javax.management.ObjectName; | import javax.management.*; | [
"javax.management"
] | javax.management; | 1,621,794 |
public void setMask(InetAddress mask) {
this.mask = mask;
} | void function(InetAddress mask) { this.mask = mask; } | /**
* Set the sub-network's mask of the static route.
* @param mask The mask (InetAddress) to be set
*/ | Set the sub-network's mask of the static route | setMask | {
"repo_name": "xiaohanz/softcontroller",
"path": "opendaylight/forwarding/staticrouting/src/main/java/org/opendaylight/controller/forwarding/staticrouting/StaticRoute.java",
"license": "epl-1.0",
"size": 10149
} | [
"java.net.InetAddress"
] | import java.net.InetAddress; | import java.net.*; | [
"java.net"
] | java.net; | 952,821 |
@Override
public void hyperlinkUpdate(HyperlinkEvent e) {
if (parserForTip!=null && parserForTip.getHyperlinkListener()!=null) {
parserForTip.getHyperlinkListener().linkClicked(textArea, e);
}
}
| void function(HyperlinkEvent e) { if (parserForTip!=null && parserForTip.getHyperlinkListener()!=null) { parserForTip.getHyperlinkListener().linkClicked(textArea, e); } } | /**
* Called when the user clicks a hyperlink in a
* {@link org.fife.ui.rsyntaxtextarea.focusabletip.FocusableTip}.
*
* @param e The event.
*/ | Called when the user clicks a hyperlink in a <code>org.fife.ui.rsyntaxtextarea.focusabletip.FocusableTip</code> | hyperlinkUpdate | {
"repo_name": "Thecarisma/powertext",
"path": "Power Text/src/com/power/text/ui/pteditor/ParserManager.java",
"license": "gpl-3.0",
"size": 22597
} | [
"javax.swing.event.HyperlinkEvent"
] | import javax.swing.event.HyperlinkEvent; | import javax.swing.event.*; | [
"javax.swing"
] | javax.swing; | 62,161 |
public FunctionScoreQueryBuilder boostMode(CombineFunction combineFunction) {
if (combineFunction == null) {
throw new IllegalArgumentException("[" + NAME + "] requires 'boost_mode' field");
}
this.boostMode = combineFunction;
return this;
} | FunctionScoreQueryBuilder function(CombineFunction combineFunction) { if (combineFunction == null) { throw new IllegalArgumentException("[" + NAME + STR); } this.boostMode = combineFunction; return this; } | /**
* Boost mode defines how the combined result of score functions will influence the final score together with the sub query score.
* @see CombineFunction
*/ | Boost mode defines how the combined result of score functions will influence the final score together with the sub query score | boostMode | {
"repo_name": "clintongormley/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/index/query/functionscore/FunctionScoreQueryBuilder.java",
"license": "apache-2.0",
"size": 30057
} | [
"org.elasticsearch.common.lucene.search.function.CombineFunction"
] | import org.elasticsearch.common.lucene.search.function.CombineFunction; | import org.elasticsearch.common.lucene.search.function.*; | [
"org.elasticsearch.common"
] | org.elasticsearch.common; | 2,221,754 |
public void selectionChanged(SelectionChangedEvent event) {
// Remove any menu items for old selection.
//
if (createChildMenuManager != null) {
depopulateManager(createChildMenuManager, createChildActions);
}
if (createSiblingMenuManager != null) {
depopulateManager(createSiblingMenuManager, ... | void function(SelectionChangedEvent event) { if (createChildMenuManager != null) { depopulateManager(createChildMenuManager, createChildActions); } if (createSiblingMenuManager != null) { depopulateManager(createSiblingMenuManager, createSiblingActions); } Collection newChildDescriptors = null; Collection newSiblingDes... | /**
* This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
* handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
* that can be added to the selected object and updating the menus accordingly.
* <!-- begin-user-doc -->
* <!-- ... | This implements <code>org.eclipse.jface.viewers.ISelectionChangedListener</code>, handling <code>org.eclipse.jface.viewers.SelectionChangedEvent</code>s by querying for the children and siblings that can be added to the selected object and updating the menus accordingly. | selectionChanged | {
"repo_name": "TristanFAURE/oclCheckTool",
"path": "plugins/org.topcased.checktool.xsdrules.editor/src/org/topcased/checktool/xsdrules/xsdRules/presentation/XsdRulesActionBarContributor.java",
"license": "epl-1.0",
"size": 14687
} | [
"java.util.Collection",
"org.eclipse.emf.edit.domain.EditingDomain",
"org.eclipse.emf.edit.domain.IEditingDomainProvider",
"org.eclipse.jface.viewers.ISelection",
"org.eclipse.jface.viewers.IStructuredSelection",
"org.eclipse.jface.viewers.SelectionChangedEvent"
] | import java.util.Collection; import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.edit.domain.IEditingDomainProvider; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.SelectionChangedEvent; | import java.util.*; import org.eclipse.emf.edit.domain.*; import org.eclipse.jface.viewers.*; | [
"java.util",
"org.eclipse.emf",
"org.eclipse.jface"
] | java.util; org.eclipse.emf; org.eclipse.jface; | 2,904,591 |
void addSink(IDecisionVariable sink) {
sinks.add(sink);
} | void addSink(IDecisionVariable sink) { sinks.add(sink); } | /**
* Adds a non ReplaySink of the pipeline.
* @param sink A non ReplaySink of the pipeline.
*/ | Adds a non ReplaySink of the pipeline | addSink | {
"repo_name": "QualiMaster/QM-EASyProducer",
"path": "QualiMaster.Extension/src/eu/qualimaster/easy/extension/internal/PipelineContentsContainer.java",
"license": "apache-2.0",
"size": 17931
} | [
"net.ssehub.easy.varModel.confModel.IDecisionVariable"
] | import net.ssehub.easy.varModel.confModel.IDecisionVariable; | import net.ssehub.easy.*; | [
"net.ssehub.easy"
] | net.ssehub.easy; | 291,119 |
@Override
public boolean acquireTieLock() {
// We're tied for the latest copy of the data. try to get the distributed lock.
holdingTieLock = distributedLockService.lock("PERSISTENCE_" + regionPath, 0, -1);
if (!holdingTieLock) {
if (logger.isDebugEnabled(LogMarker.PERSIST_ADVISOR_VERBOSE)) {
... | boolean function() { holdingTieLock = distributedLockService.lock(STR + regionPath, 0, -1); if (!holdingTieLock) { if (logger.isDebugEnabled(LogMarker.PERSIST_ADVISOR_VERBOSE)) { logger.debug(LogMarker.PERSIST_ADVISOR_VERBOSE, STR, shortDiskStoreId(), regionPath); } } return holdingTieLock; } | /**
* Try to acquire the distributed lock which members must grab for in the case of a tie. Whoever
* gets the lock initializes first.
*/ | Try to acquire the distributed lock which members must grab for in the case of a tie. Whoever gets the lock initializes first | acquireTieLock | {
"repo_name": "pdxrunner/geode",
"path": "geode-core/src/main/java/org/apache/geode/internal/cache/persistence/PersistenceAdvisorImpl.java",
"license": "apache-2.0",
"size": 50779
} | [
"org.apache.geode.internal.logging.log4j.LogMarker"
] | import org.apache.geode.internal.logging.log4j.LogMarker; | import org.apache.geode.internal.logging.log4j.*; | [
"org.apache.geode"
] | org.apache.geode; | 2,136,425 |
//-----------------------------------------------------------------------
public DayCount getDayCount() {
return dayCount;
} | DayCount function() { return dayCount; } | /**
* Gets the day count.
* <p>
* If the x-value of the curve represents time as a year fraction, the day count
* can be specified to define how the year fraction is calculated.
* @return the value of the property, not null
*/ | Gets the day count. If the x-value of the curve represents time as a year fraction, the day count can be specified to define how the year fraction is calculated | getDayCount | {
"repo_name": "OpenGamma/Strata",
"path": "modules/market/src/main/java/com/opengamma/strata/market/curve/IsdaCreditCurveDefinition.java",
"license": "apache-2.0",
"size": 21518
} | [
"com.opengamma.strata.basics.date.DayCount"
] | import com.opengamma.strata.basics.date.DayCount; | import com.opengamma.strata.basics.date.*; | [
"com.opengamma.strata"
] | com.opengamma.strata; | 1,840,288 |
public final void init(AlgorithmParameterSpec params)
throws InvalidAlgorithmParameterException {
spiImpl.engineInit(params, RANDOM);//new SecureRandom());
} | final void function(AlgorithmParameterSpec params) throws InvalidAlgorithmParameterException { spiImpl.engineInit(params, RANDOM); } | /**
* Initializes this {@code KeyGenerator} instance with the specified
* algorithm parameters.
*
* @param params
* the parameters for the key generation algorithm.
* @throws InvalidAlgorithmParameterException
* if the parameters cannot be used to initialize thi... | Initializes this KeyGenerator instance with the specified algorithm parameters | init | {
"repo_name": "s20121035/rk3288_android5.1_repo",
"path": "libcore/luni/src/main/java/javax/crypto/KeyGenerator.java",
"license": "gpl-3.0",
"size": 8675
} | [
"java.security.InvalidAlgorithmParameterException",
"java.security.spec.AlgorithmParameterSpec"
] | import java.security.InvalidAlgorithmParameterException; import java.security.spec.AlgorithmParameterSpec; | import java.security.*; import java.security.spec.*; | [
"java.security"
] | java.security; | 1,073,172 |
public ServerSocket getServerToServerSocket() {
return serverToServerSocket;
} | ServerSocket function() { return serverToServerSocket; } | /**
* Gets serverToServerSocket.
*
* @return Value of serverToServerSocket.
*/ | Gets serverToServerSocket | getServerToServerSocket | {
"repo_name": "suparngp/AOSProject2",
"path": "src/main/java/server/network/ServerToServerChannel.java",
"license": "mit",
"size": 2661
} | [
"java.net.ServerSocket"
] | import java.net.ServerSocket; | import java.net.*; | [
"java.net"
] | java.net; | 1,679,378 |
boolean tableHasData(String tableName) throws SQLException; | boolean tableHasData(String tableName) throws SQLException; | /**
* Verify if table has any data
* @param tableName
* @return
* @throws SQLException
*/ | Verify if table has any data | tableHasData | {
"repo_name": "alexryndin/ambari",
"path": "ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessor.java",
"license": "apache-2.0",
"size": 25011
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 911,102 |
public static void broadcast(String message, String permission) {
for (Player online : getPlayers()) {
if (permission != null && !online.hasPermission(permission)) {
continue;
}
online.sendMessage(message);
}
String consoleMsg = message;
consoleMsg = consoleMsg.replaceAll("§l", "");
co... | static void function(String message, String permission) { for (Player online : getPlayers()) { if (permission != null && !online.hasPermission(permission)) { continue; } online.sendMessage(message); } String consoleMsg = message; consoleMsg = consoleMsg.replaceAll("§l", STR§o", STR§r", STR§m", STR§nSTR"); Bukkit.getLog... | /**
* Broadcasts a message to everyone online with a specific permission.
*
* @param message the message.
* @param permission the permission.
*/ | Broadcasts a message to everyone online with a specific permission | broadcast | {
"repo_name": "LeonTG77/KillReveal",
"path": "src/com/leontg77/killreveal/Utils.java",
"license": "gpl-2.0",
"size": 1737
} | [
"org.bukkit.Bukkit",
"org.bukkit.entity.Player"
] | import org.bukkit.Bukkit; import org.bukkit.entity.Player; | import org.bukkit.*; import org.bukkit.entity.*; | [
"org.bukkit",
"org.bukkit.entity"
] | org.bukkit; org.bukkit.entity; | 1,859,758 |
@tags.Stack
@tags.Array
@tags.DynamicProgramming
public int maximalRectangle(boolean[][] matrix) {
if (matrix == null || matrix.length == 0 || matrix[0].length == 0) {
return 0;
}
int m = matrix.length, n = matrix[0].length;
int[] histogram = new int[n];
... | @tags.Stack @tags.Array @tags.DynamicProgramming int function(boolean[][] matrix) { if (matrix == null matrix.length == 0 matrix[0].length == 0) { return 0; } int m = matrix.length, n = matrix[0].length; int[] histogram = new int[n]; int max = 0; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { histogram[j] ... | /**
* Maximal Rectangle.
*
* Given a 2D boolean matrix filled with False and True, find the largest
* rectangle containing all True and return its area.
*
* Example: Given a matrix:
* [[1,1,0,0,1],[0,1,0,0,1],[0,0,1,1,1],[0,0,1,1,1],[0,0,0,0,1]] return 6.
*/ | Maximal Rectangle. Given a 2D boolean matrix filled with False and True, find the largest rectangle containing all True and return its area. Example: Given a matrix: [[1,1,0,0,1],[0,1,0,0,1],[0,0,1,1,1],[0,0,1,1,1],[0,0,0,0,1]] return 6 | maximalRectangle | {
"repo_name": "guangchl/problems",
"path": "lxxtcode/categories/DataStructure.java",
"license": "mit",
"size": 85601
} | [
"java.util.Stack"
] | import java.util.Stack; | import java.util.*; | [
"java.util"
] | java.util; | 1,467,397 |
synchronized long write(int b, long pos)
throws IOException, StandardException {
isValidPostion(pos);
updateCount++;
if (isBytes) {
if (pos < bufferSize) {
byte [] bytes = {(byte) b};
updateData(bytes, 0, 1, pos);
return... | synchronized long write(int b, long pos) throws IOException, StandardException { isValidPostion(pos); updateCount++; if (isBytes) { if (pos < bufferSize) { byte [] bytes = {(byte) b}; updateData(bytes, 0, 1, pos); return pos + 1; } else { init(dataBytes, pos); } } tmpFile.seek(pos); tmpFile.write(b); return tmpFile.get... | /**
* Writes one byte.
* @param b byte
* @param pos
* @return new position
* @throws IOException if writing to the LOB file fails
* @throws StandardException if encrypting/decrypting the LOB file fails
*/ | Writes one byte | write | {
"repo_name": "apache/derby",
"path": "java/org.apache.derby.engine/org/apache/derby/impl/jdbc/LOBStreamControl.java",
"license": "apache-2.0",
"size": 25440
} | [
"java.io.IOException",
"org.apache.derby.shared.common.error.StandardException"
] | import java.io.IOException; import org.apache.derby.shared.common.error.StandardException; | import java.io.*; import org.apache.derby.shared.common.error.*; | [
"java.io",
"org.apache.derby"
] | java.io; org.apache.derby; | 2,544,626 |
void queuePacket(DFSPacket packet) {
synchronized (dataQueue) {
if (packet == null) return;
packet.addTraceParent(Trace.currentSpan());
dataQueue.addLast(packet);
lastQueuedSeqno = packet.getSeqno();
if (DFSClient.LOG.isDebugEnabled()) {
DFSClient.LOG.debug("Queued packet " +... | void queuePacket(DFSPacket packet) { synchronized (dataQueue) { if (packet == null) return; packet.addTraceParent(Trace.currentSpan()); dataQueue.addLast(packet); lastQueuedSeqno = packet.getSeqno(); if (DFSClient.LOG.isDebugEnabled()) { DFSClient.LOG.debug(STR + packet.getSeqno()); } dataQueue.notifyAll(); } } | /**
* Put a packet to the data queue
*
* @param packet the packet to be put into the data queued
*/ | Put a packet to the data queue | queuePacket | {
"repo_name": "jth/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java",
"license": "apache-2.0",
"size": 64924
} | [
"org.apache.htrace.Trace"
] | import org.apache.htrace.Trace; | import org.apache.htrace.*; | [
"org.apache.htrace"
] | org.apache.htrace; | 1,720,401 |
public void setPlotOutlinePaint(Paint paint) {
if (paint == null) {
throw new IllegalArgumentException("Null 'paint' argument.");
}
this.plotOutlinePaint = paint;
}
| void function(Paint paint) { if (paint == null) { throw new IllegalArgumentException(STR); } this.plotOutlinePaint = paint; } | /**
* Sets the plot outline paint.
*
* @param paint the paint (<code>null</code> not permitted).
*
* @see #getPlotOutlinePaint()
*/ | Sets the plot outline paint | setPlotOutlinePaint | {
"repo_name": "apetresc/JFreeChart",
"path": "src/main/java/org/jfree/chart/StandardChartTheme.java",
"license": "lgpl-2.1",
"size": 61509
} | [
"java.awt.Paint"
] | import java.awt.Paint; | import java.awt.*; | [
"java.awt"
] | java.awt; | 1,007,593 |
private void storeVarForVertices(GRBVar var, int v1, int v2, int t1, int t2){
// Add edge var to vertex time map, outgoing first
long vtId = getVertexTimeId(v1, t1);
Vector<GRBVar> varVec = vertexTimeOutVarVectorMap.get(vtId);
if(varVec == null){
varVec = new Vector<GRBVar>();
vertexTimeOutVarVectorMap... | void function(GRBVar var, int v1, int v2, int t1, int t2){ long vtId = getVertexTimeId(v1, t1); Vector<GRBVar> varVec = vertexTimeOutVarVectorMap.get(vtId); if(varVec == null){ varVec = new Vector<GRBVar>(); vertexTimeOutVarVectorMap.put(vtId, varVec); } varVec.add(var); vtId = getVertexTimeId(v2, t2); varVec = vertexT... | /**
* Store edge var for head and tail vertices
* @param var
* @param v1
* @param v2
* @param t1
* @param t2
*/ | Store edge var for head and tail vertices | storeVarForVertices | {
"repo_name": "rutgers-arc-lab/microMVP",
"path": "python/projects/multipath/ILP/MultiagentGraphSolverGurobiTotalTime.java",
"license": "bsd-3-clause",
"size": 14992
} | [
"java.util.Vector"
] | import java.util.Vector; | import java.util.*; | [
"java.util"
] | java.util; | 1,612,205 |
private static String convertKey(String oldKey)
throws IllegalArgumentException {
if (!oldKey.startsWith(KEY_PREFIX)) {
return oldKey;
}
String key = oldKey.substring(KEY_PREFIX.length());
return key.substring(0, 4) + Utils.DASH + key.substring(4);
} | static String function(String oldKey) throws IllegalArgumentException { if (!oldKey.startsWith(KEY_PREFIX)) { return oldKey; } String key = oldKey.substring(KEY_PREFIX.length()); return key.substring(0, 4) + Utils.DASH + key.substring(4); } | /**
* The method convert old key format to new format. For e.g. this method
* converts old key dataStore_004cb70c8f87d78f04da41e7547cb434094089ea to
* 004c-b70c8f87d78f04da41e7547cb434094089ea.
*/ | The method convert old key format to new format. For e.g. this method converts old key dataStore_004cb70c8f87d78f04da41e7547cb434094089ea to 004c-b70c8f87d78f04da41e7547cb434094089ea | convertKey | {
"repo_name": "afilimonov/jackrabbit",
"path": "jackrabbit-aws-ext/src/main/java/org/apache/jackrabbit/aws/ext/ds/S3Backend.java",
"license": "apache-2.0",
"size": 38601
} | [
"org.apache.jackrabbit.aws.ext.Utils"
] | import org.apache.jackrabbit.aws.ext.Utils; | import org.apache.jackrabbit.aws.ext.*; | [
"org.apache.jackrabbit"
] | org.apache.jackrabbit; | 2,779,647 |
@VisibleForTesting
@Nullable
File getLatestApkFile(Context context) {
String latestKnowVersion = BuildConfig.VERSION_NAME;
File apk = null;
File[] versionsFolders = getApksFoldersList(context);
if (versionsFolders != null) {
for (File versionFolder : versionsFold... | File getLatestApkFile(Context context) { String latestKnowVersion = BuildConfig.VERSION_NAME; File apk = null; File[] versionsFolders = getApksFoldersList(context); if (versionsFolders != null) { for (File versionFolder : versionsFolders) { File[] apks = versionFolder.listFiles(); String currentFolderVersionName = vers... | /**
* Check for the latest downloaded version. If old versions are found, delete them.
* The APK corresponding to the installed version will also be deleted, if found,
* in order to perform a cleanup after an upgrade.
* Apks are placed inside [external storage storage]/apk/[version]/
*
* @... | Check for the latest downloaded version. If old versions are found, delete them. The APK corresponding to the installed version will also be deleted, if found, in order to perform a cleanup after an upgrade. Apks are placed inside [external storage storage]/apk/[version] | getLatestApkFile | {
"repo_name": "akvo/akvo-flow-mobile",
"path": "app/src/main/java/org/akvo/flow/util/files/ApkFileBrowser.java",
"license": "gpl-3.0",
"size": 4841
} | [
"android.content.Context",
"java.io.File",
"org.akvo.flow.BuildConfig",
"org.akvo.flow.util.FileUtil"
] | import android.content.Context; import java.io.File; import org.akvo.flow.BuildConfig; import org.akvo.flow.util.FileUtil; | import android.content.*; import java.io.*; import org.akvo.flow.*; import org.akvo.flow.util.*; | [
"android.content",
"java.io",
"org.akvo.flow"
] | android.content; java.io; org.akvo.flow; | 468,858 |
protected List<ITuple> synchronousMultiQuery(ITuple query, ITuple answerTemplate) throws TupleSpaceException{
space.out(query);
ITuple [] answer = space.rdg(answerTemplate); //listen for answer using template
if (answer==null){
space.rd(answerTemplate); //block until there is *one* answer
answer = s... | List<ITuple> function(ITuple query, ITuple answerTemplate) throws TupleSpaceException{ space.out(query); ITuple [] answer = space.rdg(answerTemplate); if (answer==null){ space.rd(answerTemplate); answer = space.rdg(answerTemplate); } if (answer==null){ LOG.error(STR); return new ArrayList<ITuple>(); } return Arrays.asL... | /**
* Method to do synchronous queries on the tuple space -- output query, wait for answer
* this one should be used to retrieve multiple answers
* @param query a tuple defining the query
* @param answerTemplate a tuple template defining the answer
* @return the tuple found to match the answer tuple
... | Method to do synchronous queries on the tuple space -- output query, wait for answer this one should be used to retrieve multiple answers | synchronousMultiQuery | {
"repo_name": "ntartania/polyester",
"path": "polyester/src/polyester/AbstractWorker.java",
"license": "gpl-2.0",
"size": 17890
} | [
"java.util.ArrayList",
"java.util.Arrays",
"java.util.List"
] | import java.util.ArrayList; import java.util.Arrays; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 270,352 |
private void updateLocation(boolean force) {
// Log.d(LOG_TAG, "Location about to update");
// Ensure location providers are enabled
if(!locationManager.isProviderEnabled(locationProvider)){
NudgeActivity.handleError(NudgeActivity.ErrorCode.LOCATION_PROVIDER_ERROR);
return;
}
Intent i;
if(force){
... | void function(boolean force) { if(!locationManager.isProviderEnabled(locationProvider)){ NudgeActivity.handleError(NudgeActivity.ErrorCode.LOCATION_PROVIDER_ERROR); return; } Intent i; if(force){ i = new Intent(FORCE_LOCATION_UPDATED_INTENT); } else{ i = new Intent(LOCATION_UPDATED_INTENT); } PendingIntent pi = Pending... | /**
* If the user's location has changed, update it and schedule another check for an appropriate time.
* @param force boolean determining whether a location update should be forced
*/ | If the user's location has changed, update it and schedule another check for an appropriate time | updateLocation | {
"repo_name": "norseboar/nudge",
"path": "src/com/norseboar/mobile/nudge/NudgeActivity.java",
"license": "apache-2.0",
"size": 18394
} | [
"android.app.PendingIntent",
"android.content.Intent",
"android.location.Criteria"
] | import android.app.PendingIntent; import android.content.Intent; import android.location.Criteria; | import android.app.*; import android.content.*; import android.location.*; | [
"android.app",
"android.content",
"android.location"
] | android.app; android.content; android.location; | 2,774,155 |
private void writeAttribute(java.lang.String namespace,java.lang.String attName,
java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{
if (namespace.equals(""))
{
x... | void function(java.lang.String namespace,java.lang.String attName, java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ if (namespace.equals("")) { xmlWriter.writeAttribute(attName,attValue); } else { registerPrefix(xmlWriter, namespace); xmlWriter.writeAttri... | /**
* Util method to write an attribute without the ns prefix
*/ | Util method to write an attribute without the ns prefix | writeAttribute | {
"repo_name": "arunasujith/wso2-axis2",
"path": "modules/adb/src/org/apache/axis2/databinding/types/xsd/String.java",
"license": "apache-2.0",
"size": 20842
} | [
"javax.xml.stream.XMLStreamWriter"
] | import javax.xml.stream.XMLStreamWriter; | import javax.xml.stream.*; | [
"javax.xml"
] | javax.xml; | 1,265,999 |
public void getQueue(TextChannel channel) {
if (!checkConnection(channel))
return;
GuildMusicManager musicManager = getGuildAudioPlayer(channel.getGuild());
BlockingQueue<AudioTrack> queue = musicManager.scheduler.getQueue();
if (queue.isEmpty()) {
DiscordMessage.e... | void function(TextChannel channel) { if (!checkConnection(channel)) return; GuildMusicManager musicManager = getGuildAudioPlayer(channel.getGuild()); BlockingQueue<AudioTrack> queue = musicManager.scheduler.getQueue(); if (queue.isEmpty()) { DiscordMessage.embedProblem(channel.getJDA().getSelfUser(), STR); return; } St... | /**
* Displays the queue of the music player.
*
* @param channel
*/ | Displays the queue of the music player | getQueue | {
"repo_name": "GitPaulo/Nissan",
"path": "nissan/src/main/java/music/MusicHandler.java",
"license": "gpl-3.0",
"size": 19059
} | [
"com.sedmelluq.discord.lavaplayer.track.AudioTrack",
"java.util.StringJoiner",
"java.util.concurrent.BlockingQueue",
"net.dv8tion.jda.core.entities.MessageEmbed",
"net.dv8tion.jda.core.entities.TextChannel"
] | import com.sedmelluq.discord.lavaplayer.track.AudioTrack; import java.util.StringJoiner; import java.util.concurrent.BlockingQueue; import net.dv8tion.jda.core.entities.MessageEmbed; import net.dv8tion.jda.core.entities.TextChannel; | import com.sedmelluq.discord.lavaplayer.track.*; import java.util.*; import java.util.concurrent.*; import net.dv8tion.jda.core.entities.*; | [
"com.sedmelluq.discord",
"java.util",
"net.dv8tion.jda"
] | com.sedmelluq.discord; java.util; net.dv8tion.jda; | 1,259,571 |
public Set<FabulaElement> explainElements();
| Set<FabulaElement> function(); | /**
* Explain the fabula elements that the interfaced class produced
*
* @return a set of fabula elements produced by the interfaced class
*/ | Explain the fabula elements that the interfaced class produced | explainElements | {
"repo_name": "TeamSPoon/virtstoryteller",
"path": "src/vs/IExplainable.java",
"license": "gpl-3.0",
"size": 2059
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 1,980,736 |
//#ifdef JAVA4
public synchronized void setTime(String parameterName,
Time x) throws SQLException {
setTime(findParameterIndex(parameterName), x);
}
//#endif JAVA4 | synchronized void function(String parameterName, Time x) throws SQLException { setTime(findParameterIndex(parameterName), x); } | /**
* <!-- start generic documentation -->
*
* Sets the designated parameter to the given <code>java.sql.Time</code> value.
* The driver converts this
* to an SQL <code>TIME</code> value when it sends it to the database.
*
* <!-- end generic documentation -->
*
* <!-- start ... | Sets the designated parameter to the given <code>java.sql.Time</code> value. The driver converts this to an SQL <code>TIME</code> value when it sends it to the database. HSQLDB-Specific Information: HSQLDB supports this feature. | setTime | {
"repo_name": "ThangBK2009/android-source-browsing.platform--external--hsqldb",
"path": "src/org/hsqldb/jdbc/JDBCCallableStatement.java",
"license": "bsd-3-clause",
"size": 188340
} | [
"java.sql.SQLException",
"java.sql.Time"
] | import java.sql.SQLException; import java.sql.Time; | import java.sql.*; | [
"java.sql"
] | java.sql; | 858,417 |
public static void main(String[] argv) {
Debug.init();
ArgParser ap = new ArgParser("SLOC");
if (argv.length == 0) {
ap.bail("Counts ';' and '}' to sum up Source Lines Of Code\nUsage: java com.bbn.openmap.util.wanderer.SLOC <dir>", false);
}
ap.parse(argv);
String[] d... | static void function(String[] argv) { Debug.init(); ArgParser ap = new ArgParser("SLOC"); if (argv.length == 0) { ap.bail(STR, false); } ap.parse(argv); String[] dirs = argv; SLOC sloc = new SLOC(); Wanderer wanderer = new Wanderer(sloc); int runningTotal = 0; for (int i = 0; i < dirs.length; i++) { sloc.setSLOC(0); wa... | /**
* Given a set of files or directories, parade through them to change their
* case.
*
* @param argv paths to files or directories, use -h to get a usage
* statement.
*/ | Given a set of files or directories, parade through them to change their case | main | {
"repo_name": "d2fn/passage",
"path": "src/main/java/com/bbn/openmap/util/wanderer/SLOC.java",
"license": "mit",
"size": 3287
} | [
"com.bbn.openmap.util.ArgParser",
"com.bbn.openmap.util.Debug",
"java.io.File"
] | import com.bbn.openmap.util.ArgParser; import com.bbn.openmap.util.Debug; import java.io.File; | import com.bbn.openmap.util.*; import java.io.*; | [
"com.bbn.openmap",
"java.io"
] | com.bbn.openmap; java.io; | 101,676 |
void execute(RestTestExecutionContext executionContext) throws IOException; | void execute(RestTestExecutionContext executionContext) throws IOException; | /**
* Executes the section passing in the execution context
*/ | Executes the section passing in the execution context | execute | {
"repo_name": "martinstuga/elasticsearch",
"path": "test/framework/src/main/java/org/elasticsearch/test/rest/section/ExecutableSection.java",
"license": "apache-2.0",
"size": 1209
} | [
"java.io.IOException",
"org.elasticsearch.test.rest.RestTestExecutionContext"
] | import java.io.IOException; import org.elasticsearch.test.rest.RestTestExecutionContext; | import java.io.*; import org.elasticsearch.test.rest.*; | [
"java.io",
"org.elasticsearch.test"
] | java.io; org.elasticsearch.test; | 2,716,745 |
@MXBeanDescription("Zk Root Path.")
public String getZkRootPath(); | @MXBeanDescription(STR) String function(); | /**
* Gets root path in ZooKeeper cluster Zk client uses to put data to.
*
* @return Zk Root Path.
*/ | Gets root path in ZooKeeper cluster Zk client uses to put data to | getZkRootPath | {
"repo_name": "irudyak/ignite",
"path": "modules/zookeeper/src/main/java/org/apache/ignite/spi/discovery/zk/ZookeeperDiscoverySpiMBean.java",
"license": "apache-2.0",
"size": 2263
} | [
"org.apache.ignite.mxbean.MXBeanDescription"
] | import org.apache.ignite.mxbean.MXBeanDescription; | import org.apache.ignite.mxbean.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 799,823 |
Set<ICodeType> allowedExternalTypes(); | Set<ICodeType> allowedExternalTypes(); | /**
* Return a set of other types that could embed this
* type impl. For example, JS should return a Set
* contains an HTML impl. If no other type is allowed
* to embed this type, then an empty set shall
* be returned
*
* @return true if this type allows external type
*/ | Return a set of other types that could embed this type impl. For example, JS should return a Set contains an HTML impl. If no other type is allowed to embed this type, then an empty set shall be returned | allowedExternalTypes | {
"repo_name": "greenlaw110/Rythm",
"path": "src/main/java/org/rythmengine/extension/ICodeType.java",
"license": "apache-2.0",
"size": 8100
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 80,211 |
public void deleteLocalizedContent(String attributeFQN, String localeCode) throws Exception
{
MozuClient client = com.mozu.api.clients.commerce.catalog.admin.attributedefinition.attributes.AttributeLocalizedContentClient.deleteLocalizedContentClient( attributeFQN, localeCode);
client.setContext(_apiContext);
... | void function(String attributeFQN, String localeCode) throws Exception { MozuClient client = com.mozu.api.clients.commerce.catalog.admin.attributedefinition.attributes.AttributeLocalizedContentClient.deleteLocalizedContentClient( attributeFQN, localeCode); client.setContext(_apiContext); client.executeRequest(); client... | /**
*
* <p><pre><code>
* AttributeLocalizedContent attributelocalizedcontent = new AttributeLocalizedContent();
* attributelocalizedcontent.deleteLocalizedContent( attributeFQN, localeCode);
* </code></pre></p>
* @param attributeFQN
* @param localeCode Language used for the entity. Currently, only "en-... | <code><code> AttributeLocalizedContent attributelocalizedcontent = new AttributeLocalizedContent(); attributelocalizedcontent.deleteLocalizedContent( attributeFQN, localeCode); </code></code> | deleteLocalizedContent | {
"repo_name": "eileenzhuang1/mozu-java",
"path": "mozu-java-core/src/main/java/com/mozu/api/resources/commerce/catalog/admin/attributedefinition/attributes/AttributeLocalizedContentResource.java",
"license": "mit",
"size": 10484
} | [
"com.mozu.api.MozuClient"
] | import com.mozu.api.MozuClient; | import com.mozu.api.*; | [
"com.mozu.api"
] | com.mozu.api; | 2,878,476 |
private void muleAction(MuleType muleType) {
shop = mule.getGameManager().getShop();
player = mule.getGameManager().getCurrentPlayer();
// Shop can only sell MULEs to the player, not buy them back
shop.sellMule(player, muleType);
mule.getGameManager().setLabels();
} | void function(MuleType muleType) { shop = mule.getGameManager().getShop(); player = mule.getGameManager().getCurrentPlayer(); shop.sellMule(player, muleType); mule.getGameManager().setLabels(); } | /**
* Attempt to sell the given MuleType to the current player.
* @param muleType MuleType to sell
*/ | Attempt to sell the given MuleType to the current player | muleAction | {
"repo_name": "MountainRange/MULE",
"path": "src/main/java/io/github/mountainrange/mule/controllers/StoreController.java",
"license": "gpl-3.0",
"size": 3779
} | [
"io.github.mountainrange.mule.enums.MuleType"
] | import io.github.mountainrange.mule.enums.MuleType; | import io.github.mountainrange.mule.enums.*; | [
"io.github.mountainrange"
] | io.github.mountainrange; | 269,297 |
public Image getImage(String imageResourceName) {
return getImageIcon(imageResourceName).getImage();
} | Image function(String imageResourceName) { return getImageIcon(imageResourceName).getImage(); } | /**
* Liefert ein Icon als Image, welches ggf. zuvor geladen wird.
*/ | Liefert ein Icon als Image, welches ggf. zuvor geladen wird | getImage | {
"repo_name": "udamken/PswGen",
"path": "PswGenCore/src/main/java/de/dknapps/pswgencore/util/ImageHelper.java",
"license": "apache-2.0",
"size": 2274
} | [
"java.awt.Image"
] | import java.awt.Image; | import java.awt.*; | [
"java.awt"
] | java.awt; | 282,628 |
public Object clone() throws CloneNotSupportedException {
ScatterRenderer clone = (ScatterRenderer) super.clone();
clone.seriesShapesFilled
= (BooleanList) this.seriesShapesFilled.clone();
return clone;
}
| Object function() throws CloneNotSupportedException { ScatterRenderer clone = (ScatterRenderer) super.clone(); clone.seriesShapesFilled = (BooleanList) this.seriesShapesFilled.clone(); return clone; } | /**
* Returns an independent copy of the renderer.
*
* @return A clone.
*
* @throws CloneNotSupportedException should not happen.
*/ | Returns an independent copy of the renderer | clone | {
"repo_name": "apetresc/JFreeChart",
"path": "src/main/java/org/jfree/chart/renderer/category/ScatterRenderer.java",
"license": "lgpl-2.1",
"size": 19486
} | [
"org.jfree.util.BooleanList"
] | import org.jfree.util.BooleanList; | import org.jfree.util.*; | [
"org.jfree.util"
] | org.jfree.util; | 2,234,498 |
public void createZip(
Collection<Path> pathsToIncludeInZip,
File out,
ImmutableMap<Path, String> additionalFileContents) throws IOException {
Preconditions.checkState(!Iterables.isEmpty(pathsToIncludeInZip));
try (CustomZipOutputStream zip = ZipOutputStreams.newOutputStream(out)) {
fo... | void function( Collection<Path> pathsToIncludeInZip, File out, ImmutableMap<Path, String> additionalFileContents) throws IOException { Preconditions.checkState(!Iterables.isEmpty(pathsToIncludeInZip)); try (CustomZipOutputStream zip = ZipOutputStreams.newOutputStream(out)) { for (Path path : pathsToIncludeInZip) { bool... | /**
* Similar to {@link #createZip(Collection, File)}, but also takes a list of additional files to
* write in the zip, including their contents, as a map.
*/ | Similar to <code>#createZip(Collection, File)</code>, but also takes a list of additional files to write in the zip, including their contents, as a map | createZip | {
"repo_name": "MarkRunWu/buck",
"path": "src/com/facebook/buck/io/ProjectFilesystem.java",
"license": "apache-2.0",
"size": 31690
} | [
"com.facebook.buck.zip.CustomZipEntry",
"com.facebook.buck.zip.CustomZipOutputStream",
"com.facebook.buck.zip.ZipOutputStreams",
"com.google.common.base.Charsets",
"com.google.common.base.Preconditions",
"com.google.common.collect.ImmutableMap",
"com.google.common.collect.Iterables",
"com.google.commo... | import com.facebook.buck.zip.CustomZipEntry; import com.facebook.buck.zip.CustomZipOutputStream; import com.facebook.buck.zip.ZipOutputStreams; import com.google.common.base.Charsets; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Iterables; ... | import com.facebook.buck.zip.*; import com.google.common.base.*; import com.google.common.collect.*; import com.google.common.io.*; import java.io.*; import java.nio.file.*; import java.nio.file.attribute.*; import java.util.*; | [
"com.facebook.buck",
"com.google.common",
"java.io",
"java.nio",
"java.util"
] | com.facebook.buck; com.google.common; java.io; java.nio; java.util; | 1,895,223 |
public static void processEnumExit(TreeWalkListener listener, GeneratedYangParser.EnumStatementContext ctx) {
// Check for stack to be non empty.
checkStackIsNotEmpty(listener, MISSING_HOLDER, ENUM_DATA, ctx.string().getText(), EXIT);
Parsable tmpEnumNode = listener.getParsedDataStack().pe... | static void function(TreeWalkListener listener, GeneratedYangParser.EnumStatementContext ctx) { checkStackIsNotEmpty(listener, MISSING_HOLDER, ENUM_DATA, ctx.string().getText(), EXIT); Parsable tmpEnumNode = listener.getParsedDataStack().peek(); if (tmpEnumNode instanceof YangEnum) { listener.getParsedDataStack().pop()... | /**
* It is called when parser exits from grammar rule (enum), it perform
* validations and update the data model tree.
*
* @param listener Listener's object
* @param ctx context object of the grammar rule
*/ | It is called when parser exits from grammar rule (enum), it perform validations and update the data model tree | processEnumExit | {
"repo_name": "lsinfo3/onos",
"path": "utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/EnumListener.java",
"license": "apache-2.0",
"size": 9802
} | [
"org.onosproject.yangutils.datamodel.YangEnum",
"org.onosproject.yangutils.datamodel.YangEnumeration",
"org.onosproject.yangutils.datamodel.exceptions.DataModelException",
"org.onosproject.yangutils.parser.Parsable",
"org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser",
"org.onosproject.yan... | import org.onosproject.yangutils.datamodel.YangEnum; import org.onosproject.yangutils.datamodel.YangEnumeration; import org.onosproject.yangutils.datamodel.exceptions.DataModelException; import org.onosproject.yangutils.parser.Parsable; import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser; import or... | import org.onosproject.yangutils.datamodel.*; import org.onosproject.yangutils.datamodel.exceptions.*; import org.onosproject.yangutils.parser.*; import org.onosproject.yangutils.parser.antlrgencode.*; import org.onosproject.yangutils.parser.exceptions.*; import org.onosproject.yangutils.parser.impl.*; import org.onosp... | [
"org.onosproject.yangutils"
] | org.onosproject.yangutils; | 1,505,895 |
public EReference getTransaction_PricingStructure() {
return (EReference)getTransaction().getEStructuralFeatures().get(0);
} | EReference function() { return (EReference)getTransaction().getEStructuralFeatures().get(0); } | /**
* Returns the meta object for the reference '{@link CIM15.IEC61968.PaymentMetering.Transaction#getPricingStructure <em>Pricing Structure</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference '<em>Pricing Structure</em>'.
* @see CIM15.IEC61968.PaymentMetering... | Returns the meta object for the reference '<code>CIM15.IEC61968.PaymentMetering.Transaction#getPricingStructure Pricing Structure</code>'. | getTransaction_PricingStructure | {
"repo_name": "SES-fortiss/SmartGridCoSimulation",
"path": "core/cim15/src/CIM15/IEC61968/PaymentMetering/PaymentMeteringPackage.java",
"license": "apache-2.0",
"size": 290630
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,148,436 |
RootPanel.get("datePickerFloatingExample").add(createFloatingDatePickerExample());
RootPanel.get("datePickerFixedExample").add(createFixedDatePickerExample());
RootPanel.get("defaultMethodsExample").add(createMethodsExample());
} | RootPanel.get(STR).add(createFloatingDatePickerExample()); RootPanel.get(STR).add(createFixedDatePickerExample()); RootPanel.get(STR).add(createMethodsExample()); } | /**
* This is the entry point method.
*/ | This is the entry point method | onModuleLoad | {
"repo_name": "eqlbin/gwt-dropdown-month-datepicker",
"path": "example/src/main/java/ru/eqlbin/gwt/datepicker/example/client/DropdownMonthDatePickerExample.java",
"license": "mit",
"size": 7262
} | [
"com.google.gwt.user.client.ui.RootPanel"
] | import com.google.gwt.user.client.ui.RootPanel; | import com.google.gwt.user.client.ui.*; | [
"com.google.gwt"
] | com.google.gwt; | 997,725 |
@Deprecated
@CheckResult
public FutureTarget<File> downloadOnly(int width, int height) {
return getDownloadOnlyRequest().submit(width, height);
} | FutureTarget<File> function(int width, int height) { return getDownloadOnlyRequest().submit(width, height); } | /**
* Loads the original unmodified data into the cache and returns a
* {@link java.util.concurrent.Future} that can be used to retrieve the cache File containing the
* data.
*
* @param width The width in pixels to use to fetch the data.
* @param height The height in pixels to use to fetch the data.
... | Loads the original unmodified data into the cache and returns a <code>java.util.concurrent.Future</code> that can be used to retrieve the cache File containing the data | downloadOnly | {
"repo_name": "weiwenqiang/GitHub",
"path": "expert/glide/library/src/main/java/com/bumptech/glide/RequestBuilder.java",
"license": "apache-2.0",
"size": 39695
} | [
"com.bumptech.glide.request.FutureTarget",
"java.io.File"
] | import com.bumptech.glide.request.FutureTarget; import java.io.File; | import com.bumptech.glide.request.*; import java.io.*; | [
"com.bumptech.glide",
"java.io"
] | com.bumptech.glide; java.io; | 634,001 |
public void quit() {
mStopped = true;
if (DEBUG) Log.d(TAG, "quit");
} | void function() { mStopped = true; if (DEBUG) Log.d(TAG, "quit"); } | /**
* Graceful shutdown of background reader thread (called from master).
*/ | Graceful shutdown of background reader thread (called from master) | quit | {
"repo_name": "ColonelCheese/wheely.test",
"path": "libs-sources/Autobahn/Autobahn/src/de/tavendo/autobahn/WebSocketReader.java",
"license": "apache-2.0",
"size": 23910
} | [
"android.util.Log"
] | import android.util.Log; | import android.util.*; | [
"android.util"
] | android.util; | 2,697,953 |
@Test
public void invalidQueryParserError() throws Exception {
createPrepareStmt("BLAH BLAH", true, ErrorType.PARSE);
} | void function() throws Exception { createPrepareStmt(STR, true, ErrorType.PARSE); } | /**
* Pass an invalid query to the create prepare statement request and expect a parser failure.
* @throws Exception
*/ | Pass an invalid query to the create prepare statement request and expect a parser failure | invalidQueryParserError | {
"repo_name": "bitblender/drill",
"path": "exec/java-exec/src/test/java/org/apache/drill/exec/work/prepare/TestPreparedStatementProvider.java",
"license": "apache-2.0",
"size": 5575
} | [
"org.apache.drill.exec.proto.UserBitShared"
] | import org.apache.drill.exec.proto.UserBitShared; | import org.apache.drill.exec.proto.*; | [
"org.apache.drill"
] | org.apache.drill; | 995,550 |
public Transporter executeQuery(Transporter query)
{
return handleByMode();
} | Transporter function(Transporter query) { return handleByMode(); } | /**
* A remote query after serialization is executed locally.
*/ | A remote query after serialization is executed locally | executeQuery | {
"repo_name": "RallySoftware/eclipselink.runtime",
"path": "foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/remote/rmi/IIOP/RMIRemoteSessionControllerDispatcherForTestingExceptions.java",
"license": "epl-1.0",
"size": 14196
} | [
"org.eclipse.persistence.internal.sessions.remote.Transporter"
] | import org.eclipse.persistence.internal.sessions.remote.Transporter; | import org.eclipse.persistence.internal.sessions.remote.*; | [
"org.eclipse.persistence"
] | org.eclipse.persistence; | 1,076,368 |
protected Collection<DeathBan> getBans() {
return activeBans.values();
} | Collection<DeathBan> function() { return activeBans.values(); } | /**
* Get a collection of active DeathBans.
*
* @return All active deathbans
*/ | Get a collection of active DeathBans | getBans | {
"repo_name": "EasyMFnE/FactionsDB",
"path": "src/main/java/net/easymfne/factionsdb/FactionsDB.java",
"license": "gpl-3.0",
"size": 12516
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 689,376 |
public List<Processor> getProcessors() {
return compoundProcessor.getProcessors();
} | List<Processor> function() { return compoundProcessor.getProcessors(); } | /**
* Unmodifiable list containing each processor that operates on the data.
*/ | Unmodifiable list containing each processor that operates on the data | getProcessors | {
"repo_name": "diendt/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/ingest/core/Pipeline.java",
"license": "apache-2.0",
"size": 5431
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,425,662 |
private void sort (float[] values, int count) {
int lower = 0;
int upper = count - 1;
IntArray stack = quicksortStack;
stack.add(lower);
stack.add(upper - 1);
while (stack.size > 0) {
upper = stack.pop();
lower = stack.pop();
if (upper <= lower) continue;
int i = quicksortPartition(... | void function (float[] values, int count) { int lower = 0; int upper = count - 1; IntArray stack = quicksortStack; stack.add(lower); stack.add(upper - 1); while (stack.size > 0) { upper = stack.pop(); lower = stack.pop(); if (upper <= lower) continue; int i = quicksortPartition(values, lower, upper); if (i - lower > up... | /** Sorts x,y pairs of values by the x value, then the y value.
* @param count Number of indices, must be even. */ | Sorts x,y pairs of values by the x value, then the y value | sort | {
"repo_name": "etyllica/abby",
"path": "src/main/java/com/badlogic/gdx/math/ConvexHull.java",
"license": "lgpl-3.0",
"size": 9562
} | [
"com.badlogic.gdx.utils.IntArray"
] | import com.badlogic.gdx.utils.IntArray; | import com.badlogic.gdx.utils.*; | [
"com.badlogic.gdx"
] | com.badlogic.gdx; | 1,362,461 |
public boolean processAddAbstractBusinessRules(ProposalDevelopmentDocument document,
ProposalAbstract proposalAbstract); | boolean function(ProposalDevelopmentDocument document, ProposalAbstract proposalAbstract); | /**
* Determines the legality of adding an abstract to the
* given proposal development document.
*
* @param document the proposal development document.
* @param proposalAbstract the abstract to be added to the document.
* @return true if the addition is valid; otherwise false.
*/ | Determines the legality of adding an abstract to the given proposal development document | processAddAbstractBusinessRules | {
"repo_name": "blackcathacker/kc.preclean",
"path": "coeus-code/src/main/java/org/kuali/coeus/propdev/impl/abstrct/AbstractsRule.java",
"license": "apache-2.0",
"size": 1559
} | [
"org.kuali.coeus.propdev.impl.abstrct.ProposalAbstract",
"org.kuali.coeus.propdev.impl.core.ProposalDevelopmentDocument"
] | import org.kuali.coeus.propdev.impl.abstrct.ProposalAbstract; import org.kuali.coeus.propdev.impl.core.ProposalDevelopmentDocument; | import org.kuali.coeus.propdev.impl.abstrct.*; import org.kuali.coeus.propdev.impl.core.*; | [
"org.kuali.coeus"
] | org.kuali.coeus; | 583,222 |
final String getterName = new StringBuilder().append("get").append(propertyName.substring(0, 1).toUpperCase()).append(propertyName.substring(1)).toString();
final String isserName = new StringBuilder().append("is").append(propertyName.substring(0, 1).toUpperCase()).append(propertyName.substring(1)).toString();
... | final String getterName = new StringBuilder().append("get").append(propertyName.substring(0, 1).toUpperCase()).append(propertyName.substring(1)).toString(); final String isserName = new StringBuilder().append("is").append(propertyName.substring(0, 1).toUpperCase()).append(propertyName.substring(1)).toString(); Method g... | /** Get a property of an object.
* @param object Object of which to get a property as String.
* @param propertyName Name of the property to get.
* @return Value of <var>propertyName</var> of <var>object</var> as String.
* @see #setPropertyFromString(Object, String, String)
*/ | Get a property of an object | getPropertyAsString | {
"repo_name": "christianhujer/japi",
"path": "historic/historic/src/app/net/sf/japi/lang/Properties.java",
"license": "lgpl-3.0",
"size": 5312
} | [
"java.lang.reflect.InvocationTargetException",
"java.lang.reflect.Method"
] | import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 270,699 |
public LitleRFRFileResponse sendToLitleStream() throws LitleBatchException{
try {
communication.sendLitleBatchFileToIBC(requestFile, responseFile, properties);
LitleRFRFileResponse retObj = new LitleRFRFileResponse(responseFile);
return retObj;
} catch (IOExcepti... | LitleRFRFileResponse function() throws LitleBatchException{ try { communication.sendLitleBatchFileToIBC(requestFile, responseFile, properties); LitleRFRFileResponse retObj = new LitleRFRFileResponse(responseFile); return retObj; } catch (IOException e) { throw new LitleBatchException(STR + this.properties.getProperty(S... | /**
* Sends the RFR File via the streaming method.
* @return An RFR Response File
* @throws LitleBatchException
*/ | Sends the RFR File via the streaming method | sendToLitleStream | {
"repo_name": "robertsmieja/litle-sdk-for-java",
"path": "src/main/java/com/litle/sdk/LitleRFRFileRequest.java",
"license": "mit",
"size": 10045
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,251,449 |
SignalProcessingStage<T> filter(Predicate<T> predicate); | SignalProcessingStage<T> filter(Predicate<T> predicate); | /**
* Allows propagation of the signal if the given Predicate matches.
*/ | Allows propagation of the signal if the given Predicate matches | filter | {
"repo_name": "cloudwall/libcwfincore",
"path": "cwfinjava/src/main/java/cloudwall/infra/reactive/SignalProcessingStage.java",
"license": "apache-2.0",
"size": 2695
} | [
"java.util.function.Predicate"
] | import java.util.function.Predicate; | import java.util.function.*; | [
"java.util"
] | java.util; | 917,838 |
public void addSelectedUsers(ActionEvent event)
{
UIGenericPicker picker = (UIGenericPicker) event.getComponent().findComponent("picker");
String[] results = picker.getSelectedResults();
if (results != null)
{
for (int i = 0; i < results.length; i++)
{
... | void function(ActionEvent event) { UIGenericPicker picker = (UIGenericPicker) event.getComponent().findComponent(STR); String[] results = picker.getSelectedResults(); if (results != null) { for (int i = 0; i < results.length; i++) { String authority = results[i]; boolean foundExisting = false; for (int n = 0; n < this.... | /**
* Add the selected User to the list for adding to a Group
*/ | Add the selected User to the list for adding to a Group | addSelectedUsers | {
"repo_name": "Alfresco/community-edition",
"path": "projects/web-client/source/java/org/alfresco/web/bean/groups/AddUsersDialog.java",
"license": "lgpl-3.0",
"size": 12280
} | [
"javax.faces.event.ActionEvent",
"org.alfresco.model.ContentModel",
"org.alfresco.service.cmr.repository.NodeRef",
"org.alfresco.web.bean.groups.GroupsDialog",
"org.alfresco.web.ui.common.component.UIGenericPicker"
] | import javax.faces.event.ActionEvent; import org.alfresco.model.ContentModel; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.web.bean.groups.GroupsDialog; import org.alfresco.web.ui.common.component.UIGenericPicker; | import javax.faces.event.*; import org.alfresco.model.*; import org.alfresco.service.cmr.repository.*; import org.alfresco.web.bean.groups.*; import org.alfresco.web.ui.common.component.*; | [
"javax.faces",
"org.alfresco.model",
"org.alfresco.service",
"org.alfresco.web"
] | javax.faces; org.alfresco.model; org.alfresco.service; org.alfresco.web; | 2,447,526 |
EReference getunit_ImplementationSect(); | EReference getunit_ImplementationSect(); | /**
* Returns the meta object for the containment reference '{@link org.xtext.example.delphi.delphi.unit#getImplementationSect <em>Implementation Sect</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference '<em>Implementation Sect</em>'.
* @see org.x... | Returns the meta object for the containment reference '<code>org.xtext.example.delphi.delphi.unit#getImplementationSect Implementation Sect</code>'. | getunit_ImplementationSect | {
"repo_name": "adolfosbh/cs2as",
"path": "org.xtext.example.delphi/src-gen/org/xtext/example/delphi/delphi/DelphiPackage.java",
"license": "epl-1.0",
"size": 434880
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 416,088 |
public static BiPredicate<IExpr, IExpr> isBinaryFalse(IExpr expr) {
return new IsBinaryFalse(expr, EvalEngine.get());
} | static BiPredicate<IExpr, IExpr> function(IExpr expr) { return new IsBinaryFalse(expr, EvalEngine.get()); } | /**
* Check if the evaluation of the <code>expr</code> object gives <code>False</code>. A <code>
* IsBinaryFalse</code> predicate will be returned.
*
* @param expr
* @return a <code>java.util.function.BiPredicate</code> predicate of two arguments.
*/ | Check if the evaluation of the <code>expr</code> object gives <code>False</code>. A <code> IsBinaryFalse</code> predicate will be returned | isBinaryFalse | {
"repo_name": "axkr/symja_android_library",
"path": "symja_android_library/matheclipse-core/src/main/java/org/matheclipse/core/generic/Predicates.java",
"license": "gpl-3.0",
"size": 9421
} | [
"java.util.function.BiPredicate",
"org.matheclipse.core.eval.EvalEngine",
"org.matheclipse.core.interfaces.IExpr"
] | import java.util.function.BiPredicate; import org.matheclipse.core.eval.EvalEngine; import org.matheclipse.core.interfaces.IExpr; | import java.util.function.*; import org.matheclipse.core.eval.*; import org.matheclipse.core.interfaces.*; | [
"java.util",
"org.matheclipse.core"
] | java.util; org.matheclipse.core; | 691,521 |
private void testGetSuccess(int blobSize, GetBlobOptions options) throws Exception {
router = getNonBlockingRouter();
setOperationParams(blobSize, options);
String blobId = router.putBlob(putBlobProperties, putUserMetadata, putChannel).get();
getBlobAndCompareContent(blobId);
// Test GetBlobInfoOp... | void function(int blobSize, GetBlobOptions options) throws Exception { router = getNonBlockingRouter(); setOperationParams(blobSize, options); String blobId = router.putBlob(putBlobProperties, putUserMetadata, putChannel).get(); getBlobAndCompareContent(blobId); this.options = new GetBlobOptionsBuilder().operationType(... | /**
* Test a get request.
* @param blobSize the size of the blob to put/get.
* @param options the {@link GetBlobOptions} for the get request.
*/ | Test a get request | testGetSuccess | {
"repo_name": "xiahome/ambry",
"path": "ambry-router/src/test/java/com.github.ambry.router/GetManagerTest.java",
"license": "apache-2.0",
"size": 16653
} | [
"com.github.ambry.messageformat.BlobInfo"
] | import com.github.ambry.messageformat.BlobInfo; | import com.github.ambry.messageformat.*; | [
"com.github.ambry"
] | com.github.ambry; | 1,440,970 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.