method stringlengths 13 441k | clean_method stringlengths 7 313k | doc stringlengths 17 17.3k | comment stringlengths 3 1.42k | method_name stringlengths 1 273 | extra dict | imports list | imports_info stringlengths 19 34.8k | cluster_imports_info stringlengths 15 3.66k | libraries list | libraries_info stringlengths 6 661 | id int64 0 2.92M |
|---|---|---|---|---|---|---|---|---|---|---|---|
public static void readFully(Reader input, char[] buffer) throws IOException {
readFully(input, buffer, 0, buffer.length);
} | static void function(Reader input, char[] buffer) throws IOException { readFully(input, buffer, 0, buffer.length); } | /**
* Read the requested number of characters or fail if there are not enough left.
* <p>
* This allows for the possibility that {@link Reader#read(char[], int, int)} may
* not read as many characters as requested (most likely because of reaching EOF).
*
* @param input where to read input... | Read the requested number of characters or fail if there are not enough left. This allows for the possibility that <code>Reader#read(char[], int, int)</code> may not read as many characters as requested (most likely because of reaching EOF) | readFully | {
"repo_name": "trivium-io/trivium-core",
"path": "src/io/trivium/dep/org/apache/commons/io/IOUtils.java",
"license": "apache-2.0",
"size": 97969
} | [
"java.io.IOException",
"java.io.Reader"
] | import java.io.IOException; import java.io.Reader; | import java.io.*; | [
"java.io"
] | java.io; | 2,665,254 |
public void setRaw(RawDataFile raw) {
this.raw = raw;
this.rawIndex = 0;
if (raw != null) {
for (int i = 0; i < allRaw.length; i++) {
if (raw.equals(allRaw[i])) {
rawIndex = i;
break;
}
}
}
lbRawName.setText(raw == null ? "" : raw.getN... | void function(RawDataFile raw) { this.raw = raw; this.rawIndex = 0; if (raw != null) { for (int i = 0; i < allRaw.length; i++) { if (raw.equals(allRaw[i])) { rawIndex = i; break; } } } lbRawName.setText(raw == null ? STR(STR) "); updateAllCharts(); } | /**
* set raw data file and update
*
* @param raw
*/ | set raw data file and update | setRaw | {
"repo_name": "du-lab/mzmine2",
"path": "src/main/java/net/sf/mzmine/modules/visualization/spectra/multimsms/MultiMSMSWindow.java",
"license": "gpl-2.0",
"size": 15490
} | [
"net.sf.mzmine.datamodel.RawDataFile"
] | import net.sf.mzmine.datamodel.RawDataFile; | import net.sf.mzmine.datamodel.*; | [
"net.sf.mzmine"
] | net.sf.mzmine; | 2,026,915 |
public RedisTransaction scan(String cursor, ScanOptions options, Handler<AsyncResult<String>> handler) {
delegate.scan(cursor, options, handler);
return this;
} | RedisTransaction function(String cursor, ScanOptions options, Handler<AsyncResult<String>> handler) { delegate.scan(cursor, options, handler); return this; } | /**
* Incrementally iterate the keys space
* @param cursor Cursor id
* @param options Scan options
* @param handler Handler for the result of this call.
* @return
*/ | Incrementally iterate the keys space | scan | {
"repo_name": "brianjcj/vertx-redis-client",
"path": "src/main/generated/io/vertx/rxjava/redis/RedisTransaction.java",
"license": "apache-2.0",
"size": 184983
} | [
"io.vertx.core.AsyncResult",
"io.vertx.core.Handler",
"io.vertx.redis.op.ScanOptions"
] | import io.vertx.core.AsyncResult; import io.vertx.core.Handler; import io.vertx.redis.op.ScanOptions; | import io.vertx.core.*; import io.vertx.redis.op.*; | [
"io.vertx.core",
"io.vertx.redis"
] | io.vertx.core; io.vertx.redis; | 638,745 |
public void removeWindow(Activity activity) {
removeWindow(activity.getWindow().getDecorView());
} | void function(Activity activity) { removeWindow(activity.getWindow().getDecorView()); } | /**
* Invoke this method to unregister a view hierarchy.
*
* @param activity The activity whose view hierarchy/window to unregister
*
* @see #addWindow(Activity)
* @see #removeWindow(View)
*/ | Invoke this method to unregister a view hierarchy | removeWindow | {
"repo_name": "SPECURE/ratel-nettest",
"path": "RMBTAndroid/src/at/alladin/rmbt/android/main/ViewServer.java",
"license": "apache-2.0",
"size": 27156
} | [
"android.app.Activity"
] | import android.app.Activity; | import android.app.*; | [
"android.app"
] | android.app; | 2,913,168 |
@Test
public void whenArrayFalseFirstBracketCLose() {
FourthQuestion check = new FourthQuestion();
boolean result = check.checkArray(new String[]{")", "(", ")", "("});
assertThat(result, is(false));
} | void function() { FourthQuestion check = new FourthQuestion(); boolean result = check.checkArray(new String[]{")", "(", ")", "("}); assertThat(result, is(false)); } | /**
* When array false. First bracket is close.
*/ | When array false. First bracket is close | whenArrayFalseFirstBracketCLose | {
"repo_name": "anton415/Job4j",
"path": "Intern/Part_2_OOP_Control_questions/src/test/java/ru/aserdyuchenko/start/FourthQuestionTest.java",
"license": "apache-2.0",
"size": 1805
} | [
"org.hamcrest.core.Is",
"org.junit.Assert"
] | import org.hamcrest.core.Is; import org.junit.Assert; | import org.hamcrest.core.*; import org.junit.*; | [
"org.hamcrest.core",
"org.junit"
] | org.hamcrest.core; org.junit; | 1,268,011 |
public static NabuccoPropertyDescriptor getPropertyDescriptor(String propertyName) {
return PropertyCache.getInstance().retrieve(SequenceRs.class).getProperty(propertyName);
}
| static NabuccoPropertyDescriptor function(String propertyName) { return PropertyCache.getInstance().retrieve(SequenceRs.class).getProperty(propertyName); } | /**
* Getter for the PropertyDescriptor.
*
* @param propertyName the String.
* @return the NabuccoPropertyDescriptor.
*/ | Getter for the PropertyDescriptor | getPropertyDescriptor | {
"repo_name": "NABUCCO/org.nabucco.framework.setup",
"path": "org.nabucco.framework.setup.facade.message/src/main/gen/org/nabucco/framework/setup/facade/message/sequence/SequenceRs.java",
"license": "epl-1.0",
"size": 5453
} | [
"org.nabucco.framework.base.facade.datatype.property.NabuccoPropertyDescriptor",
"org.nabucco.framework.base.facade.datatype.property.PropertyCache"
] | import org.nabucco.framework.base.facade.datatype.property.NabuccoPropertyDescriptor; import org.nabucco.framework.base.facade.datatype.property.PropertyCache; | import org.nabucco.framework.base.facade.datatype.property.*; | [
"org.nabucco.framework"
] | org.nabucco.framework; | 1,868,287 |
private QName nextQName() {
// Consume prefix or identifier
final String maybePrefix = nextIdentifier();
if (!allCharactersConsumed() && COLON == currentChar()) {
// previous token is prefix
skipCurrentChar();
return codec.createQName(maybePrefix, nextIden... | QName function() { final String maybePrefix = nextIdentifier(); if (!allCharactersConsumed() && COLON == currentChar()) { skipCurrentChar(); return codec.createQName(maybePrefix, nextIdentifier()); } return codec.createQName(lastModule, maybePrefix); } | /**
* Returns following QName and sets offset to end of QName.
*
* @return following QName.
*/ | Returns following QName and sets offset to end of QName | nextQName | {
"repo_name": "opendaylight/yangtools",
"path": "data/yang-data-util/src/main/java/org/opendaylight/yangtools/yang/data/util/XpathStringParsingPathArgumentBuilder.java",
"license": "epl-1.0",
"size": 11383
} | [
"org.opendaylight.yangtools.yang.common.QName"
] | import org.opendaylight.yangtools.yang.common.QName; | import org.opendaylight.yangtools.yang.common.*; | [
"org.opendaylight.yangtools"
] | org.opendaylight.yangtools; | 2,179,993 |
private static <T extends Writable> byte[] serializeWritable(T writable) throws IOException {
Preconditions.checkArgument(writable != null);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
DataOutputStream outputStream = new DataOutputStream(byteArrayOutputStream);
writable.write(... | static <T extends Writable> byte[] function(T writable) throws IOException { Preconditions.checkArgument(writable != null); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); DataOutputStream outputStream = new DataOutputStream(byteArrayOutputStream); writable.write(outputStream); return byteArr... | /**
* Serialize writable byte[].
*
* @param <T> the type parameter
* @param writable the writable
* @return the byte [ ]
* @throws IOException the io exception
*/ | Serialize writable byte[] | serializeWritable | {
"repo_name": "hequn8128/flink",
"path": "flink-connectors/flink-connector-hbase/src/main/java/org/apache/flink/connector/hbase/util/HBaseConfigurationUtil.java",
"license": "apache-2.0",
"size": 3325
} | [
"java.io.ByteArrayOutputStream",
"java.io.DataOutputStream",
"java.io.IOException",
"org.apache.flink.util.Preconditions",
"org.apache.hadoop.io.Writable"
] | import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.IOException; import org.apache.flink.util.Preconditions; import org.apache.hadoop.io.Writable; | import java.io.*; import org.apache.flink.util.*; import org.apache.hadoop.io.*; | [
"java.io",
"org.apache.flink",
"org.apache.hadoop"
] | java.io; org.apache.flink; org.apache.hadoop; | 1,553,424 |
public IgniteConfiguration setFailoverSpi(FailoverSpi... failSpi) {
this.failSpi = failSpi;
return this;
} | IgniteConfiguration function(FailoverSpi... failSpi) { this.failSpi = failSpi; return this; } | /**
* Sets fully configured instance of {@link FailoverSpi}.
*
* @param failSpi Fully configured instance of {@link FailoverSpi} or
* {@code null} if no SPI provided.
* @see IgniteConfiguration#getFailoverSpi()
* @return {@code this} for chaining.
*/ | Sets fully configured instance of <code>FailoverSpi</code> | setFailoverSpi | {
"repo_name": "apacheignite/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java",
"license": "apache-2.0",
"size": 83343
} | [
"org.apache.ignite.spi.failover.FailoverSpi"
] | import org.apache.ignite.spi.failover.FailoverSpi; | import org.apache.ignite.spi.failover.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 2,722,663 |
private void generateRandomIP() {
try {
Random random = new Random();
InetAddress net = InetAddress.getByName(accessCfg.getProperty("network.ip.network"));
InetAddress subnet = InetAddress.getByName(accessCfg.getProperty("network.ip.subnet"));
byte[] myIPb = new byte[4];
byte[] netb = net.getAddres... | void function() { try { Random random = new Random(); InetAddress net = InetAddress.getByName(accessCfg.getProperty(STR)); InetAddress subnet = InetAddress.getByName(accessCfg.getProperty(STR)); byte[] myIPb = new byte[4]; byte[] netb = net.getAddress(); byte[] subnetb = subnet.getAddress(); for (int i = 0; i < 4; i++)... | /**
* Create an random IP address for the virtual network adapter.
*/ | Create an random IP address for the virtual network adapter | generateRandomIP | {
"repo_name": "naemr/p2pvpn",
"path": "p2pvpn/src/org/p2pvpn/gui/MainControl.java",
"license": "gpl-3.0",
"size": 13538
} | [
"java.net.InetAddress",
"java.net.UnknownHostException",
"java.util.Random",
"java.util.logging.Level",
"java.util.logging.Logger"
] | import java.net.InetAddress; import java.net.UnknownHostException; import java.util.Random; import java.util.logging.Level; import java.util.logging.Logger; | import java.net.*; import java.util.*; import java.util.logging.*; | [
"java.net",
"java.util"
] | java.net; java.util; | 2,786,502 |
public Vector list_drugs(String searchexpr,Hashtable tags){
Vector params = new Vector();
params.addElement(searchexpr);
//params.addElement(tags);
//Vector vec = (Vector) callWebservice("list_drugs",params);
Vector vec = (Vector) callWebservice("list_search_element",... | Vector function(String searchexpr,Hashtable tags){ Vector params = new Vector(); params.addElement(searchexpr); Vector vec = (Vector) callWebservice(STR,params); return vec; } | /**returns basic identifiers of all drugs, drug products and drug classes available in the database which names match searchexpr, and which other criteria match the constraints in tags
*
*@param searchexpr (Partial) name of a drug (generic, brand name, composite drug) Case insensitive, partial match possibl... | returns basic identifiers of all drugs, drug products and drug classes available in the database which names match searchexpr, and which other criteria match the constraints in tags | list_drugs | {
"repo_name": "scoophealth/oscar",
"path": "src/main/java/oscar/oscarRx/util/RxDrugRef.java",
"license": "gpl-2.0",
"size": 32945
} | [
"java.util.Hashtable",
"java.util.Vector"
] | import java.util.Hashtable; import java.util.Vector; | import java.util.*; | [
"java.util"
] | java.util; | 283,900 |
// Since setting and then getting time and this method might be called
// by multiple threads need to synchronize.
synchronized (calendar) {
// Get seconds into day
calendar.setTimeInMillis(epochTime);
return calendar.get(Calendar.HOUR_OF_DAY) * 60 * 60 +
calendar.get(Calendar.MINUTE) * 60 ... | synchronized (calendar) { calendar.setTimeInMillis(epochTime); return calendar.get(Calendar.HOUR_OF_DAY) * 60 * 60 + calendar.get(Calendar.MINUTE) * 60 + calendar.get(Calendar.SECOND); } } | /**
* Converts the epoch time into number of seconds into the day.
*
* @param epochTime
* @return seconds into the day
*/ | Converts the epoch time into number of seconds into the day | getSecondsIntoDay | {
"repo_name": "sheldonabrown/core",
"path": "transitime/src/main/java/org/transitime/utils/Time.java",
"license": "gpl-3.0",
"size": 28522
} | [
"java.util.Calendar"
] | import java.util.Calendar; | import java.util.*; | [
"java.util"
] | java.util; | 1,412,112 |
public MetaProperty<CurveExtrapolator> extrapolatorRight() {
return extrapolatorRight;
} | MetaProperty<CurveExtrapolator> function() { return extrapolatorRight; } | /**
* The meta-property for the {@code extrapolatorRight} property.
* @return the meta-property, not null
*/ | The meta-property for the extrapolatorRight property | extrapolatorRight | {
"repo_name": "OpenGamma/Strata",
"path": "modules/market/src/main/java/com/opengamma/strata/market/curve/InterpolatedNodalCurve.java",
"license": "apache-2.0",
"size": 30544
} | [
"com.opengamma.strata.market.curve.interpolator.CurveExtrapolator",
"org.joda.beans.MetaProperty"
] | import com.opengamma.strata.market.curve.interpolator.CurveExtrapolator; import org.joda.beans.MetaProperty; | import com.opengamma.strata.market.curve.interpolator.*; import org.joda.beans.*; | [
"com.opengamma.strata",
"org.joda.beans"
] | com.opengamma.strata; org.joda.beans; | 1,280,867 |
public ValueBuilder convertTo(Class<?> type) {
Expression newExp = ExpressionBuilder.convertToExpression(expression, type);
return new ValueBuilder(newExp);
} | ValueBuilder function(Class<?> type) { Expression newExp = ExpressionBuilder.convertToExpression(expression, type); return new ValueBuilder(newExp); } | /**
* Converts the current value to the given type using the registered type
* converters
*
* @param type the type to convert the value to
* @return the current builder
*/ | Converts the current value to the given type using the registered type converters | convertTo | {
"repo_name": "shuliangtao/apache-camel-2.13.0-src",
"path": "camel-core/src/main/java/org/apache/camel/builder/ValueBuilder.java",
"license": "apache-2.0",
"size": 10276
} | [
"org.apache.camel.Expression"
] | import org.apache.camel.Expression; | import org.apache.camel.*; | [
"org.apache.camel"
] | org.apache.camel; | 2,303,067 |
// This is also used by LookAndFeelCommand
public static LookAndFeelInfo[] getAllLAFs() {
UIManager.LookAndFeelInfo lafs[] = UIManager.getInstalledLookAndFeels();
int i = lafs.length;
UIManager.LookAndFeelInfo lafsAll[] = new UIManager.LookAndFeelInfo[i+2];
System.arraycopy(lafs,... | static LookAndFeelInfo[] function() { UIManager.LookAndFeelInfo lafs[] = UIManager.getInstalledLookAndFeels(); int i = lafs.length; UIManager.LookAndFeelInfo lafsAll[] = new UIManager.LookAndFeelInfo[i+2]; System.arraycopy(lafs, 0, lafsAll, 0, i); lafsAll[i++]=new UIManager.LookAndFeelInfo(CROSS_PLATFORM_LAF,UIManager.... | /**
* Get a list of all installed LAFs plus CrossPlatform and System.
*
* @return The list of available {@link LookAndFeelInfo}s
*/ | Get a list of all installed LAFs plus CrossPlatform and System | getAllLAFs | {
"repo_name": "ubikfsabbe/jmeter",
"path": "src/core/org/apache/jmeter/gui/util/JMeterMenuBar.java",
"license": "apache-2.0",
"size": 31344
} | [
"javax.swing.UIManager"
] | import javax.swing.UIManager; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 961,068 |
public FiringSequence checkWord(List<String> word) {
return checkWord(pn.getInitialMarking(), word, 0, getLabels());
} | FiringSequence function(List<String> word) { return checkWord(pn.getInitialMarking(), word, 0, getLabels()); } | /**
* Check if the given word is in the Petri net's prefix language.
* @param word The word that should be checked.
* @return A fire sequence which is activated in the Petri net's initial state and which produces the given
* word.
*/ | Check if the given word is in the Petri net's prefix language | checkWord | {
"repo_name": "CvO-Theory/apt",
"path": "src/module/uniol/apt/analysis/language/WordInLanguage.java",
"license": "gpl-2.0",
"size": 4333
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 804,518 |
public void stop() {
checkNotNull(controller, "Cannot stop Crawljax if you haven't started it");
controller.stop();
} | void function() { checkNotNull(controller, STR); controller.stop(); } | /**
* Stops Crawljax. It will try to shutdown gracefully and run the {@link PostCrawlingPlugin}s.
*/ | Stops Crawljax. It will try to shutdown gracefully and run the <code>PostCrawlingPlugin</code>s | stop | {
"repo_name": "mmayorivera/crawljax",
"path": "core/src/main/java/com/crawljax/core/CrawljaxRunner.java",
"license": "apache-2.0",
"size": 1574
} | [
"com.google.common.base.Preconditions"
] | import com.google.common.base.Preconditions; | import com.google.common.base.*; | [
"com.google.common"
] | com.google.common; | 73,762 |
synchronized int recycle(byte[] array) {
Preconditions.checkNotNull(array);
Preconditions.checkArgument(array.length == byteArrayLength);
if (LOG.isDebugEnabled()) {
DEBUG_MESSAGE.get().append(", ").append(this);
}
notify();
numAllocated--;
if (numAllocated < 0) {
... | synchronized int recycle(byte[] array) { Preconditions.checkNotNull(array); Preconditions.checkArgument(array.length == byteArrayLength); if (LOG.isDebugEnabled()) { DEBUG_MESSAGE.get().append(STR).append(this); } notify(); numAllocated--; if (numAllocated < 0) { numAllocated = 0; } if (freeQueue.size() < maxAllocated ... | /**
* Recycle the given byte array, which must have the same length as the
* array length managed by this object.
*
* The byte array may or may not be allocated
* by the {@link FixedLengthManager#allocate()} method.
*/ | Recycle the given byte array, which must have the same length as the array length managed by this object. The byte array may or may not be allocated by the <code>FixedLengthManager#allocate()</code> method | recycle | {
"repo_name": "JingchengDu/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/util/ByteArrayManager.java",
"license": "apache-2.0",
"size": 13263
} | [
"org.apache.hadoop.util.Preconditions"
] | import org.apache.hadoop.util.Preconditions; | import org.apache.hadoop.util.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 1,637,626 |
private void waitForOutstandingRequest() throws IOException {
if (outstandingRequest == null) {
return;
} | void function() throws IOException { if (outstandingRequest == null) { return; } | /**
* Waits for the current outstanding request retrying it with exponential backoff if it fails.
*
* @throws ClosedByInterruptException if request was interrupted
* @throws IOException In the event of FileNotFoundException, MalformedURLException
* @throws RetriesExhaustedException if exceeding the numbe... | Waits for the current outstanding request retrying it with exponential backoff if it fails | waitForOutstandingRequest | {
"repo_name": "aozarov/appengine-gcs-client",
"path": "java/src/main/java/com/google/appengine/tools/cloudstorage/GcsOutputChannelImpl.java",
"license": "apache-2.0",
"size": 11131
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 887,314 |
public AzureKeyVaultSecretReference accountKey() {
return this.accountKey;
} | AzureKeyVaultSecretReference function() { return this.accountKey; } | /**
* Get the accountKey property: The Azure key vault secret reference of accountKey in connection string.
*
* @return the accountKey value.
*/ | Get the accountKey property: The Azure key vault secret reference of accountKey in connection string | accountKey | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/AzureStorageLinkedServiceTypeProperties.java",
"license": "mit",
"size": 6196
} | [
"com.azure.resourcemanager.datafactory.models.AzureKeyVaultSecretReference"
] | import com.azure.resourcemanager.datafactory.models.AzureKeyVaultSecretReference; | import com.azure.resourcemanager.datafactory.models.*; | [
"com.azure.resourcemanager"
] | com.azure.resourcemanager; | 2,828,775 |
@Test
public void testExistJobMessages() {
ExecutionMessageDirector messageDirector = ExecutionMessageDirector.getInstance();
messageDirector.initialize(TEST_BUNDLE_NAME);
String updateClusterMessage = messageDirector.getJobMessage(VdcActionType.UpdateCluster);
assertTrue(UPDATE... | void function() { ExecutionMessageDirector messageDirector = ExecutionMessageDirector.getInstance(); messageDirector.initialize(TEST_BUNDLE_NAME); String updateClusterMessage = messageDirector.getJobMessage(VdcActionType.UpdateCluster); assertTrue(UPDATE_CLUSTER_CLUSTERS_MESSAGE.equals(updateClusterMessage)); } | /**
* Verifies the correct message is retrieved by an existing key
*/ | Verifies the correct message is retrieved by an existing key | testExistJobMessages | {
"repo_name": "OpenUniversity/ovirt-engine",
"path": "backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dal/job/ExecutionMessageDirectorTest.java",
"license": "apache-2.0",
"size": 4122
} | [
"org.junit.Assert",
"org.ovirt.engine.core.common.action.VdcActionType"
] | import org.junit.Assert; import org.ovirt.engine.core.common.action.VdcActionType; | import org.junit.*; import org.ovirt.engine.core.common.action.*; | [
"org.junit",
"org.ovirt.engine"
] | org.junit; org.ovirt.engine; | 1,072,925 |
public Map<String, ExecutionStatus> getTrackingStatus(){
return trackingMap;
}
| Map<String, ExecutionStatus> function(){ return trackingMap; } | /**
* Return job vs execution tracking status map.
* @return
*/ | Return job vs execution tracking status map | getTrackingStatus | {
"repo_name": "capitalone/Hydrograph",
"path": "hydrograph.ui/hydrograph.ui.graph/src/main/java/hydrograph/ui/graph/execution/tracking/replay/ViewExecutionHistoryUtility.java",
"license": "apache-2.0",
"size": 11569
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,091,106 |
public static int decode(byte[] src, int srcOffset, BigInteger[] valueRef) throws CorruptEncodingException {
byte[][] bytesRef = new byte[1][];
int amt = decode(src, srcOffset, bytesRef);
valueRef[0] = (bytesRef[0] == null) ? null : new BigInteger(bytesRef[0]);
return amt;
} | static int function(byte[] src, int srcOffset, BigInteger[] valueRef) throws CorruptEncodingException { byte[][] bytesRef = new byte[1][]; int amt = decode(src, srcOffset, bytesRef); valueRef[0] = (bytesRef[0] == null) ? null : new BigInteger(bytesRef[0]); return amt; } | /**
* Decodes a BigInteger.
*
* @param src source of encoded data
* @param srcOffset offset into encoded data
* @param valueRef decoded BigInteger is stored in element 0, which may be
* null
* @return amount of bytes read from source
* @throws CorruptEncodingException if source ... | Decodes a BigInteger | decode | {
"repo_name": "sdgdsffdsfff/tddl",
"path": "tddl-executor/src/main/java/com/taobao/tddl/executor/codec/DataDecoder.java",
"license": "apache-2.0",
"size": 24876
} | [
"java.math.BigInteger"
] | import java.math.BigInteger; | import java.math.*; | [
"java.math"
] | java.math; | 1,808,784 |
public void readFile(File inputFile) throws IOException {
CSVParser csvParser = CSVParser.parse(inputFile, charset, csvFormat);
recordList = csvParser.getRecords();
}
| void function(File inputFile) throws IOException { CSVParser csvParser = CSVParser.parse(inputFile, charset, csvFormat); recordList = csvParser.getRecords(); } | /** read CSV file into recordList.
* this can be reprocessed to create either HTMLTable or TDV.
*
* @param inputFile
* @throws IOException
*/ | read CSV file into recordList. this can be reprocessed to create either HTMLTable or TDV | readFile | {
"repo_name": "ContentMine/norma",
"path": "src/main/java/org/xmlcml/norma/table/CSVTransformer.java",
"license": "apache-2.0",
"size": 4183
} | [
"java.io.File",
"java.io.IOException",
"org.apache.commons.csv.CSVParser"
] | import java.io.File; import java.io.IOException; import org.apache.commons.csv.CSVParser; | import java.io.*; import org.apache.commons.csv.*; | [
"java.io",
"org.apache.commons"
] | java.io; org.apache.commons; | 847,801 |
@Override
public Object getObject(String parameterName) throws SQLException {
return getObject(getIndexForName(parameterName));
} | Object function(String parameterName) throws SQLException { return getObject(getIndexForName(parameterName)); } | /**
* Returns a column value as a Java object. The data is
* de-serialized into a Java object (on the client side).
*
* @param parameterName the parameter name
* @return the value or null
* @throws SQLException if the column is not found or if this object is
* closed
... | Returns a column value as a Java object. The data is de-serialized into a Java object (on the client side) | getObject | {
"repo_name": "paulnguyen/data",
"path": "sqldbs/h2java/src/main/org/h2/jdbc/JdbcCallableStatement.java",
"license": "apache-2.0",
"size": 53148
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,506,696 |
public static String readTextFile(DataInputStream is) throws IOException {
byte[] dataBuf = new byte[is.available()];
is.readFully(dataBuf);
String str = new String(dataBuf,"US-ASCII");
return str;
} | static String function(DataInputStream is) throws IOException { byte[] dataBuf = new byte[is.available()]; is.readFully(dataBuf); String str = new String(dataBuf,STR); return str; } | /**
* Read file as text file return string
* @param is DataInputStream
* @return String
* @throws IOException
*/ | Read file as text file return string | readTextFile | {
"repo_name": "tuomount/JHeroes",
"path": "src/org/jheroes/utilities/StreamUtilities.java",
"license": "gpl-2.0",
"size": 2227
} | [
"java.io.DataInputStream",
"java.io.IOException"
] | import java.io.DataInputStream; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,626,766 |
public static String selectFolder(String prompt){
String selectedFolder = null;
Frame frame = (sketchApplet == null) ? null : sketchApplet.frame;
if (PApplet.platform == MACOSX && PApplet.useNativeSelect != false) {
FileDialog fileDialog =
new FileDialog(frame, prompt, FileDialog.LOAD);
System.setPr... | static String function(String prompt){ String selectedFolder = null; Frame frame = (sketchApplet == null) ? null : sketchApplet.frame; if (PApplet.platform == MACOSX && PApplet.useNativeSelect != false) { FileDialog fileDialog = new FileDialog(frame, prompt, FileDialog.LOAD); System.setProperty(STR, "true"); fileDialog... | /**
* Select a folder from the local file system.
*
* @param prompt the frame text for the chooser
* @return the absolute path name for the selected folder, or null if action
* cancelled.
*/ | Select a folder from the local file system | selectFolder | {
"repo_name": "chcbaram/Processing_RokitDrone",
"path": "libraries/GameControlPlus/src/org/gamecontrolplus/gui/M4P.java",
"license": "mit",
"size": 25419
} | [
"java.awt.FileDialog",
"java.awt.Frame",
"java.io.File",
"java.io.IOException",
"javax.swing.JFileChooser"
] | import java.awt.FileDialog; import java.awt.Frame; import java.io.File; import java.io.IOException; import javax.swing.JFileChooser; | import java.awt.*; import java.io.*; import javax.swing.*; | [
"java.awt",
"java.io",
"javax.swing"
] | java.awt; java.io; javax.swing; | 1,510,019 |
public MapDatabaseHandler getMapHandler( MapTable mapTable ) throws Exception {
MapDatabaseHandler mapDatabaseHandler = mapTablesMap.get(mapTable);
return mapDatabaseHandler;
} | MapDatabaseHandler function( MapTable mapTable ) throws Exception { MapDatabaseHandler mapDatabaseHandler = mapTablesMap.get(mapTable); return mapDatabaseHandler; } | /**
* Get the {@link MapDatabaseHandler} for a given {@link MapTable}.
*
* @param mapTable the table.
* @return the handler.
* @throws Exception if something went wrong.
*/ | Get the <code>MapDatabaseHandler</code> for a given <code>MapTable</code> | getMapHandler | {
"repo_name": "GitHubDroid/geodroid_master_update",
"path": "geodroidmapsforge/src/eu/geopaparazzi/mapsforge/mapsdirmanager/maps/MapDatabasesManager.java",
"license": "gpl-3.0",
"size": 6613
} | [
"eu.geopaparazzi.mapsforge.mapsdirmanager.maps.tiles.MapDatabaseHandler",
"eu.geopaparazzi.mapsforge.mapsdirmanager.maps.tiles.MapTable"
] | import eu.geopaparazzi.mapsforge.mapsdirmanager.maps.tiles.MapDatabaseHandler; import eu.geopaparazzi.mapsforge.mapsdirmanager.maps.tiles.MapTable; | import eu.geopaparazzi.mapsforge.mapsdirmanager.maps.tiles.*; | [
"eu.geopaparazzi.mapsforge"
] | eu.geopaparazzi.mapsforge; | 500,304 |
private ReplicationConnection getTestReplicationConnectionNoSlaves(String masterHost) throws Exception {
Properties props = getPropertiesFromTestsuiteUrl();
List<String> masterHosts = new ArrayList<String>();
masterHosts.add(masterHost);
List<String> slaveHosts = new ArrayList<String... | ReplicationConnection function(String masterHost) throws Exception { Properties props = getPropertiesFromTestsuiteUrl(); List<String> masterHosts = new ArrayList<String>(); masterHosts.add(masterHost); List<String> slaveHosts = new ArrayList<String>(); ReplicationConnection replConn = new ReplicationConnection(props, p... | /**
* Internal method for tests to get a replcation connection with a
* single master host to the test URL.
*/ | Internal method for tests to get a replcation connection with a single master host to the test URL | getTestReplicationConnectionNoSlaves | {
"repo_name": "richardgutkowski/ansible-roles",
"path": "stash/files/mysql-connector-java-5.1.35/src/testsuite/regression/ConnectionRegressionTest.java",
"license": "mit",
"size": 333108
} | [
"com.mysql.jdbc.ReplicationConnection",
"java.util.ArrayList",
"java.util.List",
"java.util.Properties"
] | import com.mysql.jdbc.ReplicationConnection; import java.util.ArrayList; import java.util.List; import java.util.Properties; | import com.mysql.jdbc.*; import java.util.*; | [
"com.mysql.jdbc",
"java.util"
] | com.mysql.jdbc; java.util; | 391,921 |
public static NodesInfoRequest nodesInfoRequest(String... nodesIds) {
return new NodesInfoRequest(nodesIds);
} | static NodesInfoRequest function(String... nodesIds) { return new NodesInfoRequest(nodesIds); } | /**
* Creates a nodes info request against one or more nodes. Pass <tt>null</tt> or an empty array for all nodes.
*
* @param nodesIds The nodes ids to get the status for
* @return The nodes info request
* @see org.elasticsearch.client.ClusterAdminClient#nodesStats(org.elasticsearch.action.admin... | Creates a nodes info request against one or more nodes. Pass null or an empty array for all nodes | nodesInfoRequest | {
"repo_name": "zhengxgs/elasticsearch-2.4.1",
"path": "core/src/main/java/org/elasticsearch/client/Requests.java",
"license": "apache-2.0",
"size": 22516
} | [
"org.elasticsearch.action.admin.cluster.node.info.NodesInfoRequest"
] | import org.elasticsearch.action.admin.cluster.node.info.NodesInfoRequest; | import org.elasticsearch.action.admin.cluster.node.info.*; | [
"org.elasticsearch.action"
] | org.elasticsearch.action; | 882,590 |
final protected byte[] getInclusiveLowerBound() {
final byte[] fromKey;
if (this.fromKey != null) {
fromKey = this.fromKey;
} else {
IndexMetadata md = getIndex().getIndexMetadata();
LocalPartitionMetadata pmd = md.getPartitionMetadata();
... | final byte[] function() { final byte[] fromKey; if (this.fromKey != null) { fromKey = this.fromKey; } else { IndexMetadata md = getIndex().getIndexMetadata(); LocalPartitionMetadata pmd = md.getPartitionMetadata(); if (pmd != null) { fromKey = pmd.getLeftSeparatorKey(); } else { fromKey = null; } } return fromKey; } | /**
* The optional inclusive lower bound. If the <i>fromKey</i> constraint was
* specified when the {@link ITupleCursor} was created, then that value is
* returned. Otherwise, if the index is an index partition then the
* {@link LocalPartitionMetadata#getLeftSeparatorKey()} is returned.
* Final... | The optional inclusive lower bound. If the fromKey constraint was specified when the <code>ITupleCursor</code> was created, then that value is returned. Otherwise, if the index is an index partition then the <code>LocalPartitionMetadata#getLeftSeparatorKey()</code> is returned. Finally, <code>null</code> is returned if... | getInclusiveLowerBound | {
"repo_name": "rac021/blazegraph_1_5_3_cluster_2_nodes",
"path": "bigdata/src/java/com/bigdata/btree/AbstractBTreeTupleCursor.java",
"license": "gpl-2.0",
"size": 68628
} | [
"com.bigdata.mdi.LocalPartitionMetadata"
] | import com.bigdata.mdi.LocalPartitionMetadata; | import com.bigdata.mdi.*; | [
"com.bigdata.mdi"
] | com.bigdata.mdi; | 2,227,147 |
@Test
public void testGetRangeBounds() {
XYSeriesCollection dataset = new XYSeriesCollection();
// when the dataset contains no series, we expect the value range to
// be null
assertNull(dataset.getRangeBounds(false));
assertNull(dataset.getRangeBounds(true));
... | void function() { XYSeriesCollection dataset = new XYSeriesCollection(); assertNull(dataset.getRangeBounds(false)); assertNull(dataset.getRangeBounds(true)); XYSeries series = new XYSeries("S1"); dataset.addSeries(series); assertNull(dataset.getRangeBounds(false)); assertNull(dataset.getRangeBounds(true)); series.add(1... | /**
* Some checks for the getRangeBounds() method.
*/ | Some checks for the getRangeBounds() method | testGetRangeBounds | {
"repo_name": "akardapolov/ASH-Viewer",
"path": "jfreechart-fse/src/test/java/org/jfree/data/xy/XYSeriesCollectionTest.java",
"license": "gpl-3.0",
"size": 18282
} | [
"org.jfree.data.Range",
"org.junit.Assert"
] | import org.jfree.data.Range; import org.junit.Assert; | import org.jfree.data.*; import org.junit.*; | [
"org.jfree.data",
"org.junit"
] | org.jfree.data; org.junit; | 30,940 |
public void setComment(String comment) {
Preconditions.checkNotNull(comment);
this.comment = comment;
} | void function(String comment) { Preconditions.checkNotNull(comment); this.comment = comment; } | /**
* setzt den Kommentar
*
* @param comment Kommentar
*/ | setzt den Kommentar | setComment | {
"repo_name": "agent4788/SHC_Application_Framework",
"path": "SHC_Application_Server/src/main/java/de/rpi_controlcenter/AppServer/Model/Data/Automation/AbstractAutomationElement.java",
"license": "gpl-3.0",
"size": 1434
} | [
"com.google.common.base.Preconditions"
] | import com.google.common.base.Preconditions; | import com.google.common.base.*; | [
"com.google.common"
] | com.google.common; | 14,038 |
boolean shouldDisplaySearchEngineIcon() {
boolean showIconWhenFocused = mUrlHasFocus && mShowStatusIconWhenUrlFocused;
boolean showIconOnNTP = mProfileSupplier.get() != null
&& UrlUtilities.isCanonicalizedNTPUrl(mLocationBarDataProvider.getCurrentUrl())
&& !mLocationB... | boolean shouldDisplaySearchEngineIcon() { boolean showIconWhenFocused = mUrlHasFocus && mShowStatusIconWhenUrlFocused; boolean showIconOnNTP = mProfileSupplier.get() != null && UrlUtilities.isCanonicalizedNTPUrl(mLocationBarDataProvider.getCurrentUrl()) && !mLocationBarDataProvider.isLoading() && !mIsTablet && (mUrlHas... | /**
* Returns whether the search engine icon should be displayed in the current context. This is
* independent from alpha/visibility.
*/ | Returns whether the search engine icon should be displayed in the current context. This is independent from alpha/visibility | shouldDisplaySearchEngineIcon | {
"repo_name": "scheib/chromium",
"path": "chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/status/StatusMediator.java",
"license": "bsd-3-clause",
"size": 31100
} | [
"org.chromium.components.embedder_support.util.UrlUtilities"
] | import org.chromium.components.embedder_support.util.UrlUtilities; | import org.chromium.components.embedder_support.util.*; | [
"org.chromium.components"
] | org.chromium.components; | 2,505,110 |
private long[] toPrimitiveArray(List<Long> l) {
long[] toReturn = new long[l.size()];
for (int i = 0; i < l.size(); i++) {
toReturn[i] = l.get(i);
}
return toReturn;
} | long[] function(List<Long> l) { long[] toReturn = new long[l.size()]; for (int i = 0; i < l.size(); i++) { toReturn[i] = l.get(i); } return toReturn; } | /**
* Coverts a list to a primitive array.
* @param l The list of <code>Long</code> to convert.
* @return A primitive array of type <code>long[]</code> with the values from
* </code>l</code>.
*/ | Coverts a list to a primitive array | toPrimitiveArray | {
"repo_name": "mtbc/bioformats",
"path": "components/scifio/src/loci/formats/tiff/TiffSaver.java",
"license": "gpl-2.0",
"size": 32423
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 190,385 |
void bridgeDetected(InetAddress addr, String id, int version); | void bridgeDetected(InetAddress addr, String id, int version); | /**
* A Milight bridge got detected
*
* @param addr The IP address
* @param id The bridge ID
* @param version The bridge version (either 3 or 6)
*/ | A Milight bridge got detected | bridgeDetected | {
"repo_name": "openhab/openhab2",
"path": "bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/discovery/DiscoveryResultListener.java",
"license": "epl-1.0",
"size": 921
} | [
"java.net.InetAddress"
] | import java.net.InetAddress; | import java.net.*; | [
"java.net"
] | java.net; | 1,541,781 |
public void deleteAnnotation(final UUID annotationId) throws ServiceException {
try {
annotationQueries.deleteAnnotation(annotationId);
}
catch(DataAccessException e) {
throw new ServiceException(e);
}
} | void function(final UUID annotationId) throws ServiceException { try { annotationQueries.deleteAnnotation(annotationId); } catch(DataAccessException e) { throw new ServiceException(e); } } | /**
* Deletes an annotation.
*
* @param annotationId The id of the annotation to delete.
* @throws ServiceException if an error occurs
*/ | Deletes an annotation | deleteAnnotation | {
"repo_name": "HaiJiaoXinHeng/server-1",
"path": "src/org/ohmage/service/UserAnnotationServices.java",
"license": "apache-2.0",
"size": 10102
} | [
"org.ohmage.exception.DataAccessException",
"org.ohmage.exception.ServiceException"
] | import org.ohmage.exception.DataAccessException; import org.ohmage.exception.ServiceException; | import org.ohmage.exception.*; | [
"org.ohmage.exception"
] | org.ohmage.exception; | 823,260 |
public void encode(ImageOutputStream o, IIOMetadata streamMetadata,
IIOImage image, ImageWriteParam param) throws IOException
{
int size;
int value;
int j;
int rowCount;
int rowIndex;
int lastRowIndex;
int[] bitmap;
size = (infoHeader.biWidth * infoHeader.biHeigh... | void function(ImageOutputStream o, IIOMetadata streamMetadata, IIOImage image, ImageWriteParam param) throws IOException { int size; int value; int j; int rowCount; int rowIndex; int lastRowIndex; int[] bitmap; size = (infoHeader.biWidth * infoHeader.biHeight) - 1; rowCount = 1; rowIndex = size - infoHeader.biWidth; la... | /**
* The image encoder.
*
* @param o - the image output stream
* @param streamMetadata - metadata associated with this stream, or
* null
* @param image - an IIOImage containing image data.
* @param param - image writing parameters, or null
* @exception IOException if a write error occurs
*/ | The image encoder | encode | {
"repo_name": "SanDisk-Open-Source/SSD_Dashboard",
"path": "uefi/gcc/gcc-4.6.3/libjava/classpath/gnu/javax/imageio/bmp/EncodeRLE4.java",
"license": "gpl-2.0",
"size": 8694
} | [
"java.awt.image.BufferedImage",
"java.awt.image.PixelGrabber",
"java.io.IOException",
"java.nio.ByteBuffer",
"javax.imageio.IIOImage",
"javax.imageio.ImageWriteParam",
"javax.imageio.metadata.IIOMetadata",
"javax.imageio.stream.ImageOutputStream"
] | import java.awt.image.BufferedImage; import java.awt.image.PixelGrabber; import java.io.IOException; import java.nio.ByteBuffer; import javax.imageio.IIOImage; import javax.imageio.ImageWriteParam; import javax.imageio.metadata.IIOMetadata; import javax.imageio.stream.ImageOutputStream; | import java.awt.image.*; import java.io.*; import java.nio.*; import javax.imageio.*; import javax.imageio.metadata.*; import javax.imageio.stream.*; | [
"java.awt",
"java.io",
"java.nio",
"javax.imageio"
] | java.awt; java.io; java.nio; javax.imageio; | 2,572,295 |
public static <T> List<T> rotate(final List<T> list, int distance) {
if (list.isEmpty()) {
return list;
}
int d = distance % list.size();
if (d < 0) {
d += list.size();
}
if (d == 0) {
return list;
}
return new Ro... | static <T> List<T> function(final List<T> list, int distance) { if (list.isEmpty()) { return list; } int d = distance % list.size(); if (d < 0) { d += list.size(); } if (d == 0) { return list; } return new RotatedList<>(list, d); } | /**
* Return a rotated view of the given list with the given distance.
*/ | Return a rotated view of the given list with the given distance | rotate | {
"repo_name": "fred84/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/common/util/CollectionUtils.java",
"license": "apache-2.0",
"size": 11799
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,670,249 |
private static void createGetTableTypesResults() {
TResultRow row = new TResultRow();
row.colVals = Lists.newArrayList();
row.colVals.add(createTColumnValue("TABLE"));
GET_TABLE_TYPES_RESULTS.add(row);
} | static void function() { TResultRow row = new TResultRow(); row.colVals = Lists.newArrayList(); row.colVals.add(createTColumnValue("TABLE")); GET_TABLE_TYPES_RESULTS.add(row); } | /**
* Fills the GET_TYPEINFO_RESULTS with "TABLE".
*/ | Fills the GET_TYPEINFO_RESULTS with "TABLE" | createGetTableTypesResults | {
"repo_name": "ImpalaToGo/ImpalaToGo",
"path": "fe/src/main/java/com/cloudera/impala/service/MetadataOp.java",
"license": "apache-2.0",
"size": 26117
} | [
"com.cloudera.impala.thrift.TResultRow",
"com.google.common.collect.Lists"
] | import com.cloudera.impala.thrift.TResultRow; import com.google.common.collect.Lists; | import com.cloudera.impala.thrift.*; import com.google.common.collect.*; | [
"com.cloudera.impala",
"com.google.common"
] | com.cloudera.impala; com.google.common; | 618,406 |
public Builder setFields(Field... fields) {
this.fields = Lists.newArrayList(fields);
return this;
} | Builder function(Field... fields) { this.fields = Lists.newArrayList(fields); return this; } | /**
* Sets table's schema fields.
*/ | Sets table's schema fields | setFields | {
"repo_name": "jabubake/google-cloud-java",
"path": "google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Schema.java",
"license": "apache-2.0",
"size": 5342
} | [
"com.google.common.collect.Lists"
] | import com.google.common.collect.Lists; | import com.google.common.collect.*; | [
"com.google.common"
] | com.google.common; | 1,728,186 |
public void processIQPacket(Data data) throws NotConnectedException, InterruptedException {
inputStream.dataPacketListener.processStanza(data);
} | void function(Data data) throws NotConnectedException, InterruptedException { inputStream.dataPacketListener.processStanza(data); } | /**
* Process IQ stanza.
* @param data
* @throws NotConnectedException
* @throws InterruptedException
*/ | Process IQ stanza | processIQPacket | {
"repo_name": "esl/Smack",
"path": "smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamSession.java",
"license": "apache-2.0",
"size": 29879
} | [
"org.jivesoftware.smack.SmackException",
"org.jivesoftware.smackx.bytestreams.ibb.packet.Data"
] | import org.jivesoftware.smack.SmackException; import org.jivesoftware.smackx.bytestreams.ibb.packet.Data; | import org.jivesoftware.smack.*; import org.jivesoftware.smackx.bytestreams.ibb.packet.*; | [
"org.jivesoftware.smack",
"org.jivesoftware.smackx"
] | org.jivesoftware.smack; org.jivesoftware.smackx; | 316,428 |
boolean deleteDir(Path dir) throws IOException {
IOException lastIOE = null;
int i = 0;
do {
try {
return fs.delete(dir, true);
} catch (IOException ioe) {
lastIOE = ioe;
if (!fs.exists(dir)) return true;
// dir is there, retry deleting after some time.
... | boolean deleteDir(Path dir) throws IOException { IOException lastIOE = null; int i = 0; do { try { return fs.delete(dir, true); } catch (IOException ioe) { lastIOE = ioe; if (!fs.exists(dir)) return true; sleepBeforeRetry(STR, i+1); } } while (++i <= hdfsClientRetriesNumber); throw new IOException(STR, lastIOE); } | /**
* Deletes a directory. Assumes the user has already checked for this directory existence.
* @param dir
* @return true if the directory is deleted.
* @throws IOException
*/ | Deletes a directory. Assumes the user has already checked for this directory existence | deleteDir | {
"repo_name": "mapr/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java",
"license": "apache-2.0",
"size": 40687
} | [
"java.io.IOException",
"org.apache.hadoop.fs.Path"
] | import java.io.IOException; import org.apache.hadoop.fs.Path; | import java.io.*; import org.apache.hadoop.fs.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 1,009,663 |
@Deprecated
protected List<String> filterPurchaseOrderDocumentNumbersByAppDocStatus(List<String> lookupDocNumbers, String... appDocStatus) {
List<String> purchaseOrderDocNumbers = new ArrayList<String>();
List<String> appDocStatusList = Arrays.asList(appDocStatus);
for (String docNum... | List<String> function(List<String> lookupDocNumbers, String... appDocStatus) { List<String> purchaseOrderDocNumbers = new ArrayList<String>(); List<String> appDocStatusList = Arrays.asList(appDocStatus); for (String docNumber : lookupDocNumbers) { if(appDocStatusList.contains(financialSystemDocumentService.findByDocume... | /**
* Query appDocStatus using financialSystemDocumentService and filter against the provided status list
*
* @param lookupDocNumbers
* @param appDocStatus
* @return List<String> purchaseOrderDocumentNumbers
*/ | Query appDocStatus using financialSystemDocumentService and filter against the provided status list | filterPurchaseOrderDocumentNumbersByAppDocStatus | {
"repo_name": "ua-eas/ua-kfs-5.3",
"path": "work/src/org/kuali/kfs/module/purap/document/service/impl/PurchaseOrderServiceImpl.java",
"license": "agpl-3.0",
"size": 129962
} | [
"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; | 232,281 |
MongoDBEntityContext readPreference(ReadPreferenceType readPreference); | MongoDBEntityContext readPreference(ReadPreferenceType readPreference); | /**
* Defines the type of <a href="http://docs.mongodb.org/manual/core/read-preference/">read preference</a> to be
* applied when performing read operations against the datastore.
*
* @param readPreference the read preference type
* @return this context, allowing for further fluent API invocations
*/ | Defines the type of read preference to be applied when performing read operations against the datastore | readPreference | {
"repo_name": "DavideD/hibernate-ogm",
"path": "mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/options/navigation/MongoDBEntityContext.java",
"license": "lgpl-2.1",
"size": 3604
} | [
"org.hibernate.ogm.datastore.mongodb.options.ReadPreferenceType"
] | import org.hibernate.ogm.datastore.mongodb.options.ReadPreferenceType; | import org.hibernate.ogm.datastore.mongodb.options.*; | [
"org.hibernate.ogm"
] | org.hibernate.ogm; | 2,440,590 |
public Adapter createAdapter(Notifier target) {
return (Adapter)modelSwitch.doSwitch((EObject)target);
} | Adapter function(Notifier target) { return (Adapter)modelSwitch.doSwitch((EObject)target); } | /**
* Creates an adapter for the <code>target</code>.
* @param target the object to adapt.
* @return the adapter for the <code>target</code>.
*/ | Creates an adapter for the <code>target</code> | createAdapter | {
"repo_name": "debabratahazra/DS",
"path": "designstudio/components/domain/core/com.odcgroup.mdf.ecore/src/main/java/com/odcgroup/mdf/ecore/util/MdfAdapterFactory.java",
"license": "epl-1.0",
"size": 13679
} | [
"org.eclipse.emf.common.notify.Adapter",
"org.eclipse.emf.common.notify.Notifier",
"org.eclipse.emf.ecore.EObject"
] | import org.eclipse.emf.common.notify.Adapter; import org.eclipse.emf.common.notify.Notifier; import org.eclipse.emf.ecore.EObject; | import org.eclipse.emf.common.notify.*; import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,030,227 |
public com.google.iam.admin.v1.QueryGrantableRolesResponse queryGrantableRoles(com.google.iam.admin.v1.QueryGrantableRolesRequest request) {
return blockingUnaryCall(
getChannel(), METHOD_QUERY_GRANTABLE_ROLES, getCallOptions(), request);
}
}
public static final class IAMFutureStub exten... | com.google.iam.admin.v1.QueryGrantableRolesResponse function(com.google.iam.admin.v1.QueryGrantableRolesRequest request) { return blockingUnaryCall( getChannel(), METHOD_QUERY_GRANTABLE_ROLES, getCallOptions(), request); } } public static final class IAMFutureStub extends io.grpc.stub.AbstractStub<IAMFutureStub> { priv... | /**
* <pre>
* Queries roles that can be granted on a particular resource.
* A role is grantable if it can be used as the role in a binding for a policy
* for that resource.
* </pre>
*/ | <code> Queries roles that can be granted on a particular resource. A role is grantable if it can be used as the role in a binding for a policy for that resource. </code> | queryGrantableRoles | {
"repo_name": "speedycontrol/googleapis",
"path": "output/com/google/iam/admin/v1/IAMGrpc.java",
"license": "apache-2.0",
"size": 52051
} | [
"io.grpc.stub.ClientCalls"
] | import io.grpc.stub.ClientCalls; | import io.grpc.stub.*; | [
"io.grpc.stub"
] | io.grpc.stub; | 601,816 |
public Inventory queryInventory(boolean querySkuDetails, List<String> moreItemSkus,
List<String> moreSubsSkus) throws IabException {
checkNotDisposed();
checkSetupDone("queryInventory");
try {
Inventory inv = new Inventory();
in... | Inventory function(boolean querySkuDetails, List<String> moreItemSkus, List<String> moreSubsSkus) throws IabException { checkNotDisposed(); checkSetupDone(STR); try { Inventory inv = new Inventory(); int r = queryPurchases(inv, ITEM_TYPE_INAPP); if (r != BILLING_RESPONSE_RESULT_OK) { throw new IabException(r, STR); } i... | /**
* Queries the inventory. This will query all owned items from the server, as well as
* information on additional skus, if specified. This method may block or take long to execute.
* Do not call from a UI thread. For that, use the non-blocking version {@link #refreshInventoryAsync}.
*
* @par... | Queries the inventory. This will query all owned items from the server, as well as information on additional skus, if specified. This method may block or take long to execute. Do not call from a UI thread. For that, use the non-blocking version <code>#refreshInventoryAsync</code> | queryInventory | {
"repo_name": "sannysanoff/CodenameOne",
"path": "Ports/Android/src/com/codename1/payments/v3/IabHelper.java",
"license": "gpl-2.0",
"size": 44421
} | [
"android.os.RemoteException",
"java.util.List",
"org.json.JSONException"
] | import android.os.RemoteException; import java.util.List; import org.json.JSONException; | import android.os.*; import java.util.*; import org.json.*; | [
"android.os",
"java.util",
"org.json"
] | android.os; java.util; org.json; | 346,584 |
private String scrollId() {
scrollId = randomSimpleString(random(), 1, 10); // Empty strings get special behavior we don't want
return scrollId;
} | String function() { scrollId = randomSimpleString(random(), 1, 10); return scrollId; } | /**
* Generates a random scrollId and registers it so that when the test
* finishes we check that it was cleared. Subsequent calls reregister a new
* random scroll id so it is checked instead.
*/ | Generates a random scrollId and registers it so that when the test finishes we check that it was cleared. Subsequent calls reregister a new random scroll id so it is checked instead | scrollId | {
"repo_name": "sreeramjayan/elasticsearch",
"path": "modules/reindex/src/test/java/org/elasticsearch/index/reindex/AsyncBulkByScrollActionTests.java",
"license": "apache-2.0",
"size": 41424
} | [
"org.apache.lucene.util.TestUtil"
] | import org.apache.lucene.util.TestUtil; | import org.apache.lucene.util.*; | [
"org.apache.lucene"
] | org.apache.lucene; | 371,293 |
protected Class<? extends Page> getSignUpVerifyPageClass() {
return RegisterPage.class;
} | Class<? extends Page> function() { return RegisterPage.class; } | /**
* For subclassing if required.
*/ | For subclassing if required | getSignUpVerifyPageClass | {
"repo_name": "kidaa/isis",
"path": "core/viewer-wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/pages/PageClassListDefault.java",
"license": "apache-2.0",
"size": 4947
} | [
"org.apache.isis.viewer.wicket.ui.pages.accmngt.register.RegisterPage",
"org.apache.wicket.Page"
] | import org.apache.isis.viewer.wicket.ui.pages.accmngt.register.RegisterPage; import org.apache.wicket.Page; | import org.apache.isis.viewer.wicket.ui.pages.accmngt.register.*; import org.apache.wicket.*; | [
"org.apache.isis",
"org.apache.wicket"
] | org.apache.isis; org.apache.wicket; | 793,283 |
public boolean is_custom_cross_hair_cursor() {
return this.custom_cursor != null;
}
private class ColorTableListener implements TableModelListener { | boolean function() { return this.custom_cursor != null; } private class ColorTableListener implements TableModelListener { | /**
* If the result is true, the custom crosshair cursor will be used in
* display. Otherwise the standard Cursor will be used. Using the custom
* cursor may slow down the display performance a lot.
*/ | If the result is true, the custom crosshair cursor will be used in display. Otherwise the standard Cursor will be used. Using the custom cursor may slow down the display performance a lot | is_custom_cross_hair_cursor | {
"repo_name": "rbuj/FreeRouting",
"path": "src/main/java/net/freerouting/freeroute/BoardPanel.java",
"license": "gpl-3.0",
"size": 17808
} | [
"javax.swing.event.TableModelListener"
] | import javax.swing.event.TableModelListener; | import javax.swing.event.*; | [
"javax.swing"
] | javax.swing; | 1,615,974 |
public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listRegionalByResourceGroupSinglePageAsync(final String resourceGroupName, final String location, final String filter, final Integer top) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter t... | Observable<ServiceResponse<Page<EventSubscriptionInner>>> function(final String resourceGroupName, final String location, final String filter, final Integer top) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); } if (resourceGroupName == null) { throw new IllegalArgumentException(S... | /**
* List all regional event subscriptions under an Azure subscription and resource group.
* List all event subscriptions from the given location under a specific Azure subscription and resource group.
*
ServiceResponse<PageImpl<EventSubscriptionInner>> * @param resourceGroupName The name of the res... | List all regional event subscriptions under an Azure subscription and resource group. List all event subscriptions from the given location under a specific Azure subscription and resource group | listRegionalByResourceGroupSinglePageAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/eventgrid/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_06_01/implementation/EventSubscriptionsInner.java",
"license": "mit",
"size": 345238
} | [
"com.microsoft.azure.Page",
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.azure.Page; import com.microsoft.rest.ServiceResponse; | import com.microsoft.azure.*; import com.microsoft.rest.*; | [
"com.microsoft.azure",
"com.microsoft.rest"
] | com.microsoft.azure; com.microsoft.rest; | 1,321,234 |
public void testWriteFileWithCueSheet()
{
Exception exceptionCaught = null;
try
{
File testFile = AbstractTestCase.copyAudioToTmp("test3.flac", new File("testWriteWithCueSheet.flac"));
AudioFile f = AudioFileIO.read(testFile);
FlacInfoReader infoReader... | void function() { Exception exceptionCaught = null; try { File testFile = AbstractTestCase.copyAudioToTmp(STR, new File(STR)); AudioFile f = AudioFileIO.read(testFile); FlacInfoReader infoReader = new FlacInfoReader(); assertEquals(5, infoReader.countMetaBlocks(f.getFile())); f.getTag().setField(FieldKey.ALBUM,"BLOCK")... | /**
* Test Writing file that contains cuesheet
*/ | Test Writing file that contains cuesheet | testWriteFileWithCueSheet | {
"repo_name": "nhminus/jaudiotagger-androidpatch",
"path": "srctest/org/jaudiotagger/tag/flac/FlacWriteTest.java",
"license": "lgpl-2.1",
"size": 17196
} | [
"java.io.File",
"org.jaudiotagger.AbstractTestCase",
"org.jaudiotagger.audio.AudioFile",
"org.jaudiotagger.audio.AudioFileIO",
"org.jaudiotagger.audio.flac.FlacInfoReader",
"org.jaudiotagger.tag.FieldKey"
] | import java.io.File; import org.jaudiotagger.AbstractTestCase; import org.jaudiotagger.audio.AudioFile; import org.jaudiotagger.audio.AudioFileIO; import org.jaudiotagger.audio.flac.FlacInfoReader; import org.jaudiotagger.tag.FieldKey; | import java.io.*; import org.jaudiotagger.*; import org.jaudiotagger.audio.*; import org.jaudiotagger.audio.flac.*; import org.jaudiotagger.tag.*; | [
"java.io",
"org.jaudiotagger",
"org.jaudiotagger.audio",
"org.jaudiotagger.tag"
] | java.io; org.jaudiotagger; org.jaudiotagger.audio; org.jaudiotagger.tag; | 1,429,039 |
public static RegistryEntry getValue(String branch, String entry, short type) throws RegistryException, IOException, InterruptedException {
String[] cmd = new String[] { "reg", "query", cleanBrunch(branch), "/v", entry };
RegistryEntry[] rst = filter(executeQuery(cmd), branch, type);
if (rst.length == 1) {
... | static RegistryEntry function(String branch, String entry, short type) throws RegistryException, IOException, InterruptedException { String[] cmd = new String[] { "reg", "query", cleanBrunch(branch), "/v", entry }; RegistryEntry[] rst = filter(executeQuery(cmd), branch, type); if (rst.length == 1) { return rst[0]; } re... | /**
* gets a single value form the registry
*
* @param branch brach to get value from
* @param entry entry to get
* @param type type of the registry entry to get
* @return registry entry or null of not exist
* @throws RegistryException
* @throws IOException
* @throws Interr... | gets a single value form the registry | getValue | {
"repo_name": "jzuijlek/Lucee",
"path": "core/src/main/java/lucee/runtime/registry/RegistryQuery.java",
"license": "lgpl-2.1",
"size": 7071
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,356,801 |
boolean updateGameResult (GameResult gameResult); | boolean updateGameResult (GameResult gameResult); | /**
* This method updates a GameResult
*
* @param gameResult
* @return
*/ | This method updates a GameResult | updateGameResult | {
"repo_name": "barrett-chris/BubbleCount",
"path": "app/src/main/java/ca/chrisbarrett/bubblecount/dao/GameResultDao.java",
"license": "mit",
"size": 1444
} | [
"ca.chrisbarrett.bubblecount.dao.model.GameResult"
] | import ca.chrisbarrett.bubblecount.dao.model.GameResult; | import ca.chrisbarrett.bubblecount.dao.model.*; | [
"ca.chrisbarrett.bubblecount"
] | ca.chrisbarrett.bubblecount; | 2,329,470 |
public void addOrUpdateRepository(ISVNRepositoryLocation repository) throws SVNException {
// Check the cache for an equivalent instance and if there is one, just update the cache
SVNRepositoryLocation existingLocation = (SVNRepositoryLocation)repositories.get(repository.getLocation());
if (... | void function(ISVNRepositoryLocation repository) throws SVNException { SVNRepositoryLocation existingLocation = (SVNRepositoryLocation)repositories.get(repository.getLocation()); if (existingLocation != null) { SVNProviderPlugin.getPlugin().getRepositoryResourcesManager().repositoryModified(repository); ((SVNRepository... | /**
* Add the repository to the receiver's list of known repositories or update it.
* Doing this will enable password caching accross platform invokations.
*/ | Add the repository to the receiver's list of known repositories or update it. Doing this will enable password caching accross platform invokations | addOrUpdateRepository | {
"repo_name": "apicloudcom/APICloud-Studio",
"path": "org.tigris.subversion.subclipse.core/src/org/tigris/subversion/subclipse/core/repo/SVNRepositories.java",
"license": "gpl-3.0",
"size": 14939
} | [
"org.tigris.subversion.subclipse.core.ISVNRepositoryLocation",
"org.tigris.subversion.subclipse.core.SVNException",
"org.tigris.subversion.subclipse.core.SVNProviderPlugin"
] | import org.tigris.subversion.subclipse.core.ISVNRepositoryLocation; import org.tigris.subversion.subclipse.core.SVNException; import org.tigris.subversion.subclipse.core.SVNProviderPlugin; | import org.tigris.subversion.subclipse.core.*; | [
"org.tigris.subversion"
] | org.tigris.subversion; | 2,472,894 |
@SuppressWarnings("unchecked")
private <E extends Element> E save(E element, final ActivationMail activationMail, final WhenSaving when, final boolean forceChangePassword) {
validate(element, when, false);
// Store the custom values on a saparate collection
final Collection<?> values = (... | @SuppressWarnings(STR) <E extends Element> E function(E element, final ActivationMail activationMail, final WhenSaving when, final boolean forceChangePassword) { validate(element, when, false); final Collection<?> values = (Collection<?>) PropertyHelper.get(element, STR); PropertyHelper.set(element, STR, null); final b... | /**
* Saves the given element
*/ | Saves the given element | save | {
"repo_name": "robertoandrade/cyclos",
"path": "src/nl/strohalm/cyclos/services/elements/ElementServiceImpl.java",
"license": "gpl-2.0",
"size": 100264
} | [
"java.util.ArrayList",
"java.util.Calendar",
"java.util.Collection",
"java.util.List",
"nl.strohalm.cyclos.access.AdminMemberPermission",
"nl.strohalm.cyclos.access.BrokerPermission",
"nl.strohalm.cyclos.access.MemberPermission",
"nl.strohalm.cyclos.entities.access.Channel",
"nl.strohalm.cyclos.enti... | import java.util.ArrayList; import java.util.Calendar; import java.util.Collection; import java.util.List; import nl.strohalm.cyclos.access.AdminMemberPermission; import nl.strohalm.cyclos.access.BrokerPermission; import nl.strohalm.cyclos.access.MemberPermission; import nl.strohalm.cyclos.entities.access.Channel; impo... | import java.util.*; import nl.strohalm.cyclos.access.*; import nl.strohalm.cyclos.entities.access.*; import nl.strohalm.cyclos.entities.accounts.*; import nl.strohalm.cyclos.entities.exceptions.*; import nl.strohalm.cyclos.entities.groups.*; import nl.strohalm.cyclos.entities.members.*; import nl.strohalm.cyclos.entiti... | [
"java.util",
"nl.strohalm.cyclos",
"org.apache.commons"
] | java.util; nl.strohalm.cyclos; org.apache.commons; | 1,474,266 |
private void updateQuotaForPath(String path) {
Counts c = new Counts();
getCounts(path, c);
StatsTrack strack = new StatsTrack();
strack.setBytes(c.bytes);
strack.setCount(c.count);
String statPath = Quotas.quotaZookeeper + path + "/" + Quotas.statNode;
DataNo... | void function(String path) { Counts c = new Counts(); getCounts(path, c); StatsTrack strack = new StatsTrack(); strack.setBytes(c.bytes); strack.setCount(c.count); String statPath = Quotas.quotaZookeeper + path + "/" + Quotas.statNode; DataNode node = getNode(statPath); if (node == null) { LOG.warn(STR + statPath); ret... | /**
* update the quota for the given path
*
* @param path
* the path to be used
*/ | update the quota for the given path | updateQuotaForPath | {
"repo_name": "ervinyang/tutorial_zookeeper",
"path": "zookeeper-trunk/src/java/main/org/apache/zookeeper/server/DataTree.java",
"license": "mit",
"size": 51720
} | [
"org.apache.zookeeper.Quotas",
"org.apache.zookeeper.StatsTrack"
] | import org.apache.zookeeper.Quotas; import org.apache.zookeeper.StatsTrack; | import org.apache.zookeeper.*; | [
"org.apache.zookeeper"
] | org.apache.zookeeper; | 2,463,288 |
Promise<CLIOutputResponse> propertySet(Path project, String propertyName, String propertyValues, Depth depth, boolean force, Path path); | Promise<CLIOutputResponse> propertySet(Path project, String propertyName, String propertyValues, Depth depth, boolean force, Path path); | /**
* Set specified property to a path or a target.
*
* @param project
* the project path
* @param propertyName
* the property name
* @param propertyValues
* the property value
* @param depth
* the depth
* @param force
* ... | Set specified property to a path or a target | propertySet | {
"repo_name": "slemeur/che",
"path": "plugins/plugin-svn/che-plugin-svn-ext-ide/src/main/java/org/eclipse/che/plugin/svn/ide/SubversionClientService.java",
"license": "epl-1.0",
"size": 10512
} | [
"org.eclipse.che.api.promises.client.Promise",
"org.eclipse.che.ide.resource.Path",
"org.eclipse.che.plugin.svn.shared.CLIOutputResponse",
"org.eclipse.che.plugin.svn.shared.Depth"
] | import org.eclipse.che.api.promises.client.Promise; import org.eclipse.che.ide.resource.Path; import org.eclipse.che.plugin.svn.shared.CLIOutputResponse; import org.eclipse.che.plugin.svn.shared.Depth; | import org.eclipse.che.api.promises.client.*; import org.eclipse.che.ide.resource.*; import org.eclipse.che.plugin.svn.shared.*; | [
"org.eclipse.che"
] | org.eclipse.che; | 370,870 |
static void writeVersion0(final Map<TopicPartition, Long> offsets, final File file) throws IOException {
final FileOutputStream fileOutputStream = new FileOutputStream(file);
try (final BufferedWriter writer = new BufferedWriter(
new OutputStreamWriter(fileOutputStream, StandardCharsets.... | static void writeVersion0(final Map<TopicPartition, Long> offsets, final File file) throws IOException { final FileOutputStream fileOutputStream = new FileOutputStream(file); try (final BufferedWriter writer = new BufferedWriter( new OutputStreamWriter(fileOutputStream, StandardCharsets.UTF_8))) { writeIntLine(writer, ... | /**
* Write all the offsets following the version 0 format without any verification (eg enforcing offsets >= 0)
*/ | Write all the offsets following the version 0 format without any verification (eg enforcing offsets >= 0) | writeVersion0 | {
"repo_name": "guozhangwang/kafka",
"path": "streams/src/test/java/org/apache/kafka/streams/state/internals/OffsetCheckpointTest.java",
"license": "apache-2.0",
"size": 7259
} | [
"java.io.BufferedWriter",
"java.io.File",
"java.io.FileOutputStream",
"java.io.IOException",
"java.io.OutputStreamWriter",
"java.nio.charset.StandardCharsets",
"java.util.Map",
"org.apache.kafka.common.TopicPartition",
"org.apache.kafka.streams.state.internals.OffsetCheckpoint"
] | import java.io.BufferedWriter; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.nio.charset.StandardCharsets; import java.util.Map; import org.apache.kafka.common.TopicPartition; import org.apache.kafka.streams.state.internals.OffsetCheckpo... | import java.io.*; import java.nio.charset.*; import java.util.*; import org.apache.kafka.common.*; import org.apache.kafka.streams.state.internals.*; | [
"java.io",
"java.nio",
"java.util",
"org.apache.kafka"
] | java.io; java.nio; java.util; org.apache.kafka; | 2,777,510 |
private SecurityHolder initSecurity() {
// Setup the PermissionCollection for this web app context
// based on the permissions configured for the root of the
// web app context directory, then add a file read permission
// for that directory.
Policy policy = Policy.getPolicy... | SecurityHolder function() { Policy policy = Policy.getPolicy(); CodeSource source = null; PermissionCollection permissions = null; if( policy != null ) { try { String docBase = context.getRealPath("/"); if( docBase == null ) { docBase = options.getScratchDir().toString(); } String codeBase = docBase; if (!codeBase.ends... | /**
* Method used to initialize SecurityManager data.
*/ | Method used to initialize SecurityManager data | initSecurity | {
"repo_name": "undertow-io/jastow",
"path": "src/main/java/org/apache/jasper/compiler/JspRuntimeContext.java",
"license": "apache-2.0",
"size": 21695
} | [
"java.io.File",
"java.io.FilePermission",
"java.security.CodeSource",
"java.security.Permission",
"java.security.PermissionCollection",
"java.security.Policy",
"java.security.cert.Certificate",
"java.util.Enumeration",
"org.apache.jasper.Constants",
"org.apache.jasper.JasperMessages"
] | import java.io.File; import java.io.FilePermission; import java.security.CodeSource; import java.security.Permission; import java.security.PermissionCollection; import java.security.Policy; import java.security.cert.Certificate; import java.util.Enumeration; import org.apache.jasper.Constants; import org.apache.jasper.... | import java.io.*; import java.security.*; import java.security.cert.*; import java.util.*; import org.apache.jasper.*; | [
"java.io",
"java.security",
"java.util",
"org.apache.jasper"
] | java.io; java.security; java.util; org.apache.jasper; | 12,361 |
DisplayMetrics dm = new DisplayMetrics();
WindowManager windowManager = (WindowManager) context
.getSystemService(Context.WINDOW_SERVICE);
windowManager.getDefaultDisplay().getMetrics(dm);
//LogUtils.debug("screen width=" + dm.widthPixels + "px, screen height=" + dm.heightPixels
... | DisplayMetrics dm = new DisplayMetrics(); WindowManager windowManager = (WindowManager) context .getSystemService(Context.WINDOW_SERVICE); windowManager.getDefaultDisplay().getMetrics(dm); return dm; } | /**
* Display metrics display metrics.
*
* @param context the context
* @return the display metrics
*/ | Display metrics display metrics | displayMetrics | {
"repo_name": "florent37/ViewAnimator",
"path": "sample2/src/main/java/cn/qqtheme/AnimatorSample/ScreenUtils.java",
"license": "apache-2.0",
"size": 2890
} | [
"android.content.Context",
"android.util.DisplayMetrics",
"android.view.WindowManager"
] | import android.content.Context; import android.util.DisplayMetrics; import android.view.WindowManager; | import android.content.*; import android.util.*; import android.view.*; | [
"android.content",
"android.util",
"android.view"
] | android.content; android.util; android.view; | 909,163 |
public void setEndValue(double value) {
this.endValue = value;
notifyListeners(new MarkerChangeEvent(this));
}
| void function(double value) { this.endValue = value; notifyListeners(new MarkerChangeEvent(this)); } | /**
* Sets the end value for the marker and sends a
* {@link MarkerChangeEvent} to all registered listeners.
*
* @param value the value.
*
* @since 1.0.3
*/ | Sets the end value for the marker and sends a <code>MarkerChangeEvent</code> to all registered listeners | setEndValue | {
"repo_name": "ilyessou/jfreechart",
"path": "source/org/jfree/chart/plot/IntervalMarker.java",
"license": "lgpl-2.1",
"size": 7551
} | [
"org.jfree.chart.event.MarkerChangeEvent"
] | import org.jfree.chart.event.MarkerChangeEvent; | import org.jfree.chart.event.*; | [
"org.jfree.chart"
] | org.jfree.chart; | 863,233 |
private void addTextareaToUI(FieldInstance f, TableLayout tl)
{
TableRow.LayoutParams layout = new TableRow.LayoutParams();
layout.span = 2;
TableRow tr = new TableRow(this.context);
tr.setPadding(0, 0, 0, this.defaultPaddingInPixels / 2);
TableRow tr2 = new TableRow(this.context);
tr2.setPadding(0, 0,... | void function(FieldInstance f, TableLayout tl) { TableRow.LayoutParams layout = new TableRow.LayoutParams(); layout.span = 2; TableRow tr = new TableRow(this.context); tr.setPadding(0, 0, 0, this.defaultPaddingInPixels / 2); TableRow tr2 = new TableRow(this.context); tr2.setPadding(0, 0, 0, this.defaultPaddingInPixels)... | /**
* Insert a textarea in the UI
*
* @param f The {@link FieldInstance} of interest
* @param tl The {@code TableLayout} where to include the new field
*/ | Insert a textarea in the UI | addTextareaToUI | {
"repo_name": "focusnet/focus-app-android",
"path": "focus-mobile/src/main/java/eu/focusnet/app/ui/fragment/widget/FormWidgetFragment.java",
"license": "mit",
"size": 10414
} | [
"android.view.Gravity",
"android.view.inputmethod.EditorInfo",
"android.widget.EditText",
"android.widget.TableLayout",
"android.widget.TableRow",
"android.widget.TextView",
"eu.focusnet.app.model.widgets.fields.FieldInstance"
] | import android.view.Gravity; import android.view.inputmethod.EditorInfo; import android.widget.EditText; import android.widget.TableLayout; import android.widget.TableRow; import android.widget.TextView; import eu.focusnet.app.model.widgets.fields.FieldInstance; | import android.view.*; import android.view.inputmethod.*; import android.widget.*; import eu.focusnet.app.model.widgets.fields.*; | [
"android.view",
"android.widget",
"eu.focusnet.app"
] | android.view; android.widget; eu.focusnet.app; | 2,158,620 |
@Deprecated
Observable<OperationStatus> deleteAsync(UUID appId, DeletePermissionsOptionalParameter deleteOptionalParameter); | Observable<OperationStatus> deleteAsync(UUID appId, DeletePermissionsOptionalParameter deleteOptionalParameter); | /**
* Removes a user from the allowed list of users to access this LUIS application. Users are removed using their
* email address.
*
* @param appId The application ID.
* @param deleteOptionalParameter the object representing the optional parameters to be set before calling this API
* @t... | Removes a user from the allowed list of users to access this LUIS application. Users are removed using their email address | deleteAsync | {
"repo_name": "navalev/azure-sdk-for-java",
"path": "sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/Permissions.java",
"license": "mit",
"size": 11885
} | [
"com.microsoft.azure.cognitiveservices.language.luis.authoring.models.DeletePermissionsOptionalParameter",
"com.microsoft.azure.cognitiveservices.language.luis.authoring.models.OperationStatus"
] | import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.DeletePermissionsOptionalParameter; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.OperationStatus; | import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 1,382,412 |
@ControllerAction
public Object launch(Object attributes)
{
if (!containsMap(attributes))
{
return IBrowserNotificationConstants.JSON_ERROR;
}
Map<String, String> attrMap = (Map<String, String>) ((Object[]) attributes)[0];
// We expect a project name and a launch mode.
IProject project = getProject... | Object function(Object attributes) { if (!containsMap(attributes)) { return IBrowserNotificationConstants.JSON_ERROR; } Map<String, String> attrMap = (Map<String, String>) ((Object[]) attributes)[0]; IProject project = getProject(attrMap.get(ATTR_PROJECT)); if (project == null) { return IBrowserNotificationConstants.JS... | /**
* Launch a project in a given mode with the specified type.
*
* @param attributes
* Contains the project name, mode of launching, and launcher ID retrieved from the
* {@link #getLaunchTypes(Object)} call.
*/ | Launch a project in a given mode with the specified type | launch | {
"repo_name": "HossainKhademian/Studio3",
"path": "plugins/com.aptana.portal.ui/src/com/aptana/portal/ui/dispatch/actionControllers/LaunchActionController.java",
"license": "gpl-3.0",
"size": 9625
} | [
"com.aptana.core.logging.IdeLog",
"com.aptana.core.util.StringUtil",
"com.aptana.portal.ui.PortalUIPlugin",
"com.aptana.portal.ui.dispatch.IBrowserNotificationConstants",
"java.util.List",
"java.util.Map",
"org.eclipse.core.resources.IProject",
"org.eclipse.debug.internal.ui.DebugUIPlugin",
"org.ecl... | import com.aptana.core.logging.IdeLog; import com.aptana.core.util.StringUtil; import com.aptana.portal.ui.PortalUIPlugin; import com.aptana.portal.ui.dispatch.IBrowserNotificationConstants; import java.util.List; import java.util.Map; import org.eclipse.core.resources.IProject; import org.eclipse.debug.internal.ui.Deb... | import com.aptana.core.logging.*; import com.aptana.core.util.*; import com.aptana.portal.ui.*; import com.aptana.portal.ui.dispatch.*; import java.util.*; import org.eclipse.core.resources.*; import org.eclipse.debug.internal.ui.*; import org.eclipse.debug.internal.ui.contextlaunching.*; import org.eclipse.jface.viewe... | [
"com.aptana.core",
"com.aptana.portal",
"java.util",
"org.eclipse.core",
"org.eclipse.debug",
"org.eclipse.jface"
] | com.aptana.core; com.aptana.portal; java.util; org.eclipse.core; org.eclipse.debug; org.eclipse.jface; | 2,166,809 |
public static void importOperands(final CConnection connection, final int rawModuleId,
final int moduleId) throws SQLException {
final String query =
"INSERT INTO " + CTableNames.OPERANDS_TABLE + " SELECT " + moduleId
+ ", address, expression_tree_id, position " + " FROM ex_" + rawModuleId +... | static void function(final CConnection connection, final int rawModuleId, final int moduleId) throws SQLException { final String query = STR + CTableNames.OPERANDS_TABLE + STR + moduleId + STR + STR + rawModuleId + STR; connection.executeUpdate(query, true); } | /**
* Imports the operands table.
*
* @param connection Connection to the SQL database.
* @param rawModuleId ID of the raw module from which to import the data.
* @param moduleId ID of the BinNavi module where the data is imported to.
* @throws SQLException Thrown if the data could not be imported.
... | Imports the operands table | importOperands | {
"repo_name": "paran0ids0ul/binnavi",
"path": "src/main/java/com/google/security/zynamics/binnavi/Database/PostgreSQL/PostgreSQLDataImporter.java",
"license": "apache-2.0",
"size": 13826
} | [
"com.google.security.zynamics.binnavi.Database",
"java.sql.SQLException"
] | import com.google.security.zynamics.binnavi.Database; import java.sql.SQLException; | import com.google.security.zynamics.binnavi.*; import java.sql.*; | [
"com.google.security",
"java.sql"
] | com.google.security; java.sql; | 646,133 |
Call<ResponseBody> getLongAsync(final ServiceCallback<LongWrapper> serviceCallback); | Call<ResponseBody> getLongAsync(final ServiceCallback<LongWrapper> serviceCallback); | /**
* Get complex types with long properties
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link Call} object
*/ | Get complex types with long properties | getLongAsync | {
"repo_name": "BretJohnson/autorest",
"path": "AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/bodycomplex/Primitive.java",
"license": "mit",
"size": 17621
} | [
"com.microsoft.rest.ServiceCallback",
"com.squareup.okhttp.ResponseBody"
] | import com.microsoft.rest.ServiceCallback; import com.squareup.okhttp.ResponseBody; | import com.microsoft.rest.*; import com.squareup.okhttp.*; | [
"com.microsoft.rest",
"com.squareup.okhttp"
] | com.microsoft.rest; com.squareup.okhttp; | 1,167,150 |
public void setAxisLabelGap(double gap) {
this.axisLabelGap = gap;
notifyListeners(new PlotChangeEvent(this));
} | void function(double gap) { this.axisLabelGap = gap; notifyListeners(new PlotChangeEvent(this)); } | /**
* Sets the axis label gap and sends a {@link PlotChangeEvent} to all
* registered listeners.
*
* @param gap the gap.
*
* @see #getAxisLabelGap()
*/ | Sets the axis label gap and sends a <code>PlotChangeEvent</code> to all registered listeners | setAxisLabelGap | {
"repo_name": "opensim-org/opensim-gui",
"path": "Gui/opensim/jfreechart/src/org/jfree/chart/plot/SpiderWebPlot.java",
"license": "apache-2.0",
"size": 54845
} | [
"org.jfree.chart.event.PlotChangeEvent"
] | import org.jfree.chart.event.PlotChangeEvent; | import org.jfree.chart.event.*; | [
"org.jfree.chart"
] | org.jfree.chart; | 1,659,834 |
public static void v(String tag, String msg, Object... args) {
if (sLevel > LEVEL_VERBOSE) {
return;
}
if (args.length > 0) {
msg = String.format(msg, args);
}
Log.v(tag, msg);
} | static functionoid v(String tag, String msg, Object... args) { if (sLevel > LEVEL_VERBOSE) { return; } if (args.length > 0) { msg = String.format(msg, args); } Log.v(tag, msg); } | /**
* Send a VERBOSE log message.
*
* @param tag
* @param msg
* @param args
*/ | Send a VERBOSE log message | v | {
"repo_name": "liu-xiao-dong/JD-Test",
"path": "common/src/main/java/com/sxjs/common/widget/pulltorefresh/util/PtrCLog.java",
"license": "apache-2.0",
"size": 6155
} | [
"android.util.Log"
] | import android.util.Log; | import android.util.*; | [
"android.util"
] | android.util; | 481,830 |
@Test
public void testHLogRecordReader() throws Exception {
HLog log = HLogFactory.createHLog(fs, hbaseDir, logName, conf);
byte [] value = Bytes.toBytes("value");
WALEdit edit = new WALEdit();
edit.add(new KeyValue(rowName, family, Bytes.toBytes("1"),
System.currentTimeMillis(), value));
... | void function() throws Exception { HLog log = HLogFactory.createHLog(fs, hbaseDir, logName, conf); byte [] value = Bytes.toBytes("value"); WALEdit edit = new WALEdit(); edit.add(new KeyValue(rowName, family, Bytes.toBytes("1"), System.currentTimeMillis(), value)); log.append(info, tableName, edit, System.currentTimeMil... | /**
* Test basic functionality
* @throws Exception
*/ | Test basic functionality | testHLogRecordReader | {
"repo_name": "francisliu/hbase_namespace",
"path": "hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHLogRecordReader.java",
"license": "apache-2.0",
"size": 8779
} | [
"java.util.List",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.hbase.KeyValue",
"org.apache.hadoop.hbase.regionserver.wal.HLog",
"org.apache.hadoop.hbase.regionserver.wal.HLogFactory",
"org.apache.hadoop.hbase.regionserver.wal.WALEdit",
"org.apache.hadoop.hbase.util.Bytes",
"org.apache.h... | import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.regionserver.wal.HLog; import org.apache.hadoop.hbase.regionserver.wal.HLogFactory; import org.apache.hadoop.hbase.regionserver.wal.WALEdit; import org.apache.hadoop.hbase.util.Byt... | import java.util.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.regionserver.wal.*; import org.apache.hadoop.hbase.util.*; import org.apache.hadoop.mapreduce.*; import org.junit.*; | [
"java.util",
"org.apache.hadoop",
"org.junit"
] | java.util; org.apache.hadoop; org.junit; | 2,390,767 |
public String getContentAsString() throws IOException;
| String function() throws IOException; | /**
* Gets the content of the connection as a string
*
* @return a string representing the content of the connection
*
* @throws IOException
*/ | Gets the content of the connection as a string | getContentAsString | {
"repo_name": "appnativa/rare",
"path": "source/rare/core/com/appnativa/rare/net/iURLConnection.java",
"license": "gpl-3.0",
"size": 6499
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,184,075 |
@Test
public void testAppliesQuoting_quoteWhenNeeded() {
CsvWriteOption options = CsvWriteOption.of(QuoteApplyRule.QUOTES_IF_NECESSARY);
AbstractCsvWriter<List<String>> instance = createWriter(CsvProperties.DEFAULT, options);
assertFalse(instance.appliesQuoting("abc", 0, 0));
assertTrue(instance.app... | void function() { CsvWriteOption options = CsvWriteOption.of(QuoteApplyRule.QUOTES_IF_NECESSARY); AbstractCsvWriter<List<String>> instance = createWriter(CsvProperties.DEFAULT, options); assertFalse(instance.appliesQuoting("abcSTRa\"bcSTRa,bcSTRa\nbcSTRa\rbc", 0, 0)); } | /**
* Test of appliesQuoting method, of class AbstractCsvWriter.
*/ | Test of appliesQuoting method, of class AbstractCsvWriter | testAppliesQuoting_quoteWhenNeeded | {
"repo_name": "kohii/smoothcsv-rw",
"path": "src/test/java/com/smoothcsv/csv/writer/AbstractCsvWriterTest.java",
"license": "apache-2.0",
"size": 6328
} | [
"com.smoothcsv.csv.prop.CsvProperties",
"com.smoothcsv.csv.prop.QuoteApplyRule",
"java.util.List",
"org.junit.Assert"
] | import com.smoothcsv.csv.prop.CsvProperties; import com.smoothcsv.csv.prop.QuoteApplyRule; import java.util.List; import org.junit.Assert; | import com.smoothcsv.csv.prop.*; import java.util.*; import org.junit.*; | [
"com.smoothcsv.csv",
"java.util",
"org.junit"
] | com.smoothcsv.csv; java.util; org.junit; | 1,755,279 |
private int transferBlocks( Block blocks[],
DatanodeInfo xferTargets[][],
String targetStorageIDs[][]
) throws IOException {
for(int i = 0; i < blocks.length; i++) {
DatanodeInfo blockTargets[] = xferTargets... | int function( Block blocks[], DatanodeInfo xferTargets[][], String targetStorageIDs[][] ) throws IOException { for(int i = 0; i < blocks.length; i++) { DatanodeInfo blockTargets[] = xferTargets[i]; for(int t = 0; t < blockTargets.length; t++) { DatanodeInfo dnInfo = blockTargets[t]; String targetStorageID = targetStora... | /**
* Transfer blocks to another data-node.
* Just report on behalf of the other data-node
* that the blocks have been received.
*/ | Transfer blocks to another data-node. Just report on behalf of the other data-node that the blocks have been received | transferBlocks | {
"repo_name": "jaypatil/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/NNThroughputBenchmark.java",
"license": "gpl-3.0",
"size": 54468
} | [
"java.io.IOException",
"java.util.List",
"org.apache.hadoop.hdfs.DFSConfigKeys",
"org.apache.hadoop.hdfs.protocol.Block",
"org.apache.hadoop.hdfs.protocol.DatanodeInfo",
"org.apache.hadoop.hdfs.security.token.block.ExportedBlockKeys",
"org.apache.hadoop.hdfs.server.datanode.DataStorage",
"org.apache.h... | import java.io.IOException; import java.util.List; import org.apache.hadoop.hdfs.DFSConfigKeys; import org.apache.hadoop.hdfs.protocol.Block; import org.apache.hadoop.hdfs.protocol.DatanodeInfo; import org.apache.hadoop.hdfs.security.token.block.ExportedBlockKeys; import org.apache.hadoop.hdfs.server.datanode.DataStora... | import java.io.*; import java.util.*; import org.apache.hadoop.hdfs.*; import org.apache.hadoop.hdfs.protocol.*; import org.apache.hadoop.hdfs.security.token.block.*; import org.apache.hadoop.hdfs.server.datanode.*; import org.apache.hadoop.hdfs.server.protocol.*; import org.apache.hadoop.util.*; | [
"java.io",
"java.util",
"org.apache.hadoop"
] | java.io; java.util; org.apache.hadoop; | 1,713,180 |
public mountlist MOUNTPROC_DUMP_1() throws OncRpcException {
XdrVoid args$ = XdrVoid.XDR_VOID;
mountlist result$ = new mountlist();
client.call(mount.MOUNTPROC_DUMP_1, mount.MOUNTVERS, args$, result$);
return result$;
} | mountlist function() throws OncRpcException { XdrVoid args$ = XdrVoid.XDR_VOID; mountlist result$ = new mountlist(); client.call(mount.MOUNTPROC_DUMP_1, mount.MOUNTVERS, args$, result$); return result$; } | /**
* Call remote procedure MOUNTPROC_DUMP_1.
*
* @return Result from remote procedure call (of type mountlist).
* @throws OncRpcException
* if an ONC/RPC error occurs.
*/ | Call remote procedure MOUNTPROC_DUMP_1 | MOUNTPROC_DUMP_1 | {
"repo_name": "SnakeDoc/GuestVM",
"path": "guestvm~guestvm/com.oracle.max.ve.nfsserver/src/org/openthinclient/mountd/tea/mountClient.java",
"license": "bsd-3-clause",
"size": 9176
} | [
"org.acplt.oncrpc.OncRpcException",
"org.acplt.oncrpc.XdrVoid"
] | import org.acplt.oncrpc.OncRpcException; import org.acplt.oncrpc.XdrVoid; | import org.acplt.oncrpc.*; | [
"org.acplt.oncrpc"
] | org.acplt.oncrpc; | 759,843 |
protected Date getUntilDate() {
return until;
}
| Date function() { return until; } | /**
* Gets the until date
* @return the until date
*/ | Gets the until date | getUntilDate | {
"repo_name": "openmrs/openmrs-module-usagestatistics",
"path": "omod/src/main/java/org/openmrs/module/usagestatistics/web/view/chart/AbstractChartView.java",
"license": "mpl-2.0",
"size": 3930
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 1,518,525 |
public void loadAndListQuests() {
int[] selection = {Quests.SELECT_OPEN, Quests.SELECT_COMPLETED_UNCLAIMED,
Quests.SELECT_ACCEPTED};
com.google.android.gms.common.api.PendingResult<Quests.LoadQuestsResult> pr =
Games.Quests.load(mGoogleApiClient, selection,
... | void function() { int[] selection = {Quests.SELECT_OPEN, Quests.SELECT_COMPLETED_UNCLAIMED, Quests.SELECT_ACCEPTED}; com.google.android.gms.common.api.PendingResult<Quests.LoadQuestsResult> pr = Games.Quests.load(mGoogleApiClient, selection, Quests.SORT_ORDER_ENDING_SOON_FIRST, true); pr.setResultCallback(qc); } class ... | /**
* List all of the quests for this app.
*/ | List all of the quests for this app | loadAndListQuests | {
"repo_name": "JumSSang/android-basic-samples",
"path": "BasicSamples/TrivialQuest2/src/main/java/com/google/example/games/tq2/MainActivity.java",
"license": "apache-2.0",
"size": 15495
} | [
"com.google.android.gms.common.api.ResultCallback",
"com.google.android.gms.games.Games",
"com.google.android.gms.games.quest.Quests"
] | import com.google.android.gms.common.api.ResultCallback; import com.google.android.gms.games.Games; import com.google.android.gms.games.quest.Quests; | import com.google.android.gms.common.api.*; import com.google.android.gms.games.*; import com.google.android.gms.games.quest.*; | [
"com.google.android"
] | com.google.android; | 1,721,539 |
@ServiceMethod(returns = ReturnType.SINGLE)
Response<Map<String, Object>> createRefHomeRealmDiscoveryPoliciesWithResponse(
String servicePrincipalId, Map<String, Object> body, Context context); | @ServiceMethod(returns = ReturnType.SINGLE) Response<Map<String, Object>> createRefHomeRealmDiscoveryPoliciesWithResponse( String servicePrincipalId, Map<String, Object> body, Context context); | /**
* Create new navigation property ref to homeRealmDiscoveryPolicies for servicePrincipals.
*
* @param servicePrincipalId key: id of servicePrincipal.
* @param body New navigation property ref value.
* @param context The context to associate with this operation.
* @throws IllegalArgument... | Create new navigation property ref to homeRealmDiscoveryPolicies for servicePrincipals | createRefHomeRealmDiscoveryPoliciesWithResponse | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ServicePrincipalsClient.java",
"license": "mit",
"size": 228379
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.core.util.Context",
"java.util.Map"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import java.util.Map; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import java.util.*; | [
"com.azure.core",
"java.util"
] | com.azure.core; java.util; | 107,195 |
private static int blendColors(int color1, int color2, float ratio) {
final float inverseRation = 1f - ratio;
float r = (Color.red(color1) * ratio) + (Color.red(color2) * inverseRation);
float g = (Color.green(color1) * ratio) + (Color.green(color2) * inverseRation);
float b = (Color... | static int function(int color1, int color2, float ratio) { final float inverseRation = 1f - ratio; float r = (Color.red(color1) * ratio) + (Color.red(color2) * inverseRation); float g = (Color.green(color1) * ratio) + (Color.green(color2) * inverseRation); float b = (Color.blue(color1) * ratio) + (Color.blue(color2) * ... | /**
* Blend {@code color1} and {@code color2} using the given ratio.
*
* @param ratio of which to blend. 1.0 will return {@code color1}, 0.5 will give an even blend,
* 0.0 will return {@code color2}.
*/ | Blend color1 and color2 using the given ratio | blendColors | {
"repo_name": "CfABrigadePhiladelphia/Cycle-Philly-Android",
"path": "CyclePhillyAndroid/src/main/java/org/phillyopen/mytracks/cyclephilly/tab/SlidingTabStrip.java",
"license": "gpl-3.0",
"size": 8026
} | [
"android.graphics.Color"
] | import android.graphics.Color; | import android.graphics.*; | [
"android.graphics"
] | android.graphics; | 1,203,525 |
List<String> complete(CommandSource src, CommandArgs args, CommandContext context, Completer original); | List<String> complete(CommandSource src, CommandArgs args, CommandContext context, Completer original); | /**
* Fetch completions for command arguments.
*
* @param src The source requesting tab completions
* @param args The arguments currently provided
* @param context The context to store state in
* @param original The original completer
* @return Any relevant completions
*/ | Fetch completions for command arguments | complete | {
"repo_name": "LanternPowered/LanternServer",
"path": "src/main/java/org/lanternpowered/server/command/element/DelegateCompleter.java",
"license": "mit",
"size": 1052
} | [
"java.util.List",
"org.spongepowered.api.command.CommandSource",
"org.spongepowered.api.command.args.CommandArgs",
"org.spongepowered.api.command.args.CommandContext"
] | import java.util.List; import org.spongepowered.api.command.CommandSource; import org.spongepowered.api.command.args.CommandArgs; import org.spongepowered.api.command.args.CommandContext; | import java.util.*; import org.spongepowered.api.command.*; import org.spongepowered.api.command.args.*; | [
"java.util",
"org.spongepowered.api"
] | java.util; org.spongepowered.api; | 1,683,745 |
Label label = event.getTargetComponent();
float textWidth = label.getTextState().getTextWidth();
label.getSize().x = textWidth;
} | Label label = event.getTargetComponent(); float textWidth = label.getTextState().getTextWidth(); label.getSize().x = textWidth; } | /**
* Used to handle {@link LabelContentChangeEvent} event.
*
* @param event event to handle.
*/ | Used to handle <code>LabelContentChangeEvent</code> event | process | {
"repo_name": "LiquidEngine/legui",
"path": "src/main/java/org/liquidengine/legui/component/misc/listener/label/UpdateLabelWidthListener.java",
"license": "bsd-3-clause",
"size": 757
} | [
"org.liquidengine.legui.component.Label"
] | import org.liquidengine.legui.component.Label; | import org.liquidengine.legui.component.*; | [
"org.liquidengine.legui"
] | org.liquidengine.legui; | 1,799,726 |
public RegularFieldDisplayParams getFieldDisplayParams()
{
return fieldDisplayParams;
} | RegularFieldDisplayParams function() { return fieldDisplayParams; } | /**
* Get the value of fieldDisplayParams
*
* @return the value of fieldDisplayParams
*/ | Get the value of fieldDisplayParams | getFieldDisplayParams | {
"repo_name": "IcmVis/VisNow-Pro",
"path": "src/pl/edu/icm/visnow/geometries/objects/RegularFieldGeometry.java",
"license": "gpl-3.0",
"size": 14334
} | [
"pl.edu.icm.visnow.geometries.parameters.RegularFieldDisplayParams"
] | import pl.edu.icm.visnow.geometries.parameters.RegularFieldDisplayParams; | import pl.edu.icm.visnow.geometries.parameters.*; | [
"pl.edu.icm"
] | pl.edu.icm; | 571,454 |
MetricsQuery startDate(Date startTime); | MetricsQuery startDate(Date startTime); | /**
* Restrict to data collected after the given date
*/ | Restrict to data collected after the given date | startDate | {
"repo_name": "rainerh/camunda-bpm-platform",
"path": "engine/src/main/java/org/camunda/bpm/engine/management/MetricsQuery.java",
"license": "apache-2.0",
"size": 1169
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 2,519,461 |
if (this.students.length <= this.numStudents) { //No space left
this.students = Arrays.copyOf(this.students, numStudents + 1);
}
this.students[numStudents] = student;
this.numStudents++;
} | if (this.students.length <= this.numStudents) { this.students = Arrays.copyOf(this.students, numStudents + 1); } this.students[numStudents] = student; this.numStudents++; } | /**
* Add a student to the SIS.
*
* @param student The student to add.
*/ | Add a student to the SIS | addStudent | {
"repo_name": "Deliquescence/cse230",
"path": "source/edu/oakland/production/SIS.java",
"license": "mit",
"size": 880
} | [
"java.util.Arrays"
] | import java.util.Arrays; | import java.util.*; | [
"java.util"
] | java.util; | 2,766,346 |
public static BufferedImage[][] split(BufferedImage img, int width, int height) {
if (img.getWidth() > 0) {
int d0 = (img.getHeight() + height - 1) / height;
int d1 = (img.getWidth() + width - 1) / width;
BufferedImage[][] result = new BufferedImage[d0][d1];
int y = 0;
for (BufferedImage[] ba ... | static BufferedImage[][] function(BufferedImage img, int width, int height) { if (img.getWidth() > 0) { int d0 = (img.getHeight() + height - 1) / height; int d1 = (img.getWidth() + width - 1) / width; BufferedImage[][] result = new BufferedImage[d0][d1]; int y = 0; for (BufferedImage[] ba : result) { int x = 0; int y2 ... | /**
* Split the image into equally sized sub-images.
* @param img the image to split
* @param width the split width in pixels
* @param height the split height in pixels
* @return the array of array images, the first dimension are the image rows
*/ | Split the image into equally sized sub-images | split | {
"repo_name": "p-smith/open-ig",
"path": "src/hu/openig/utils/ImageUtils.java",
"license": "lgpl-3.0",
"size": 5209
} | [
"java.awt.image.BufferedImage"
] | import java.awt.image.BufferedImage; | import java.awt.image.*; | [
"java.awt"
] | java.awt; | 2,516,769 |
EReference getComposedMachine__Includes(); | EReference getComposedMachine__Includes(); | /**
* Returns the meta object for the containment reference list '{@link ComposedMachine.ComposedMachine_#getIncludes <em>Includes</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference list '<em>Includes</em>'.
* @see ComposedMachine.ComposedMachine_... | Returns the meta object for the containment reference list '<code>ComposedMachine.ComposedMachine_#getIncludes Includes</code>'. | getComposedMachine__Includes | {
"repo_name": "andyed2003/teamwork",
"path": "ComposedMachineEMF/ac.soton.composedmachine.emf/src/ComposedMachine/ComposedMachinePackage.java",
"license": "epl-1.0",
"size": 29636
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 578,178 |
public static ArrayList<int[]> findIndicesInSection(String theDoc, String theWord, int startSection, int endSection) {
ArrayList<int[]> theIndices = new ArrayList<int[]>();
int j;
int start;
int end;
String spaces=" ";
theDoc = theDoc.replaceAll("\\p{Cf}", " ");
theWord = theWord.replaceAll("\\.", "\\\... | static ArrayList<int[]> function(String theDoc, String theWord, int startSection, int endSection) { ArrayList<int[]> theIndices = new ArrayList<int[]>(); int j; int start; int end; String spaces=" "; theDoc = theDoc.replaceAll(STR, " "); theWord = theWord.replaceAll("\\.", "\\\\."); try { while (true) { Pattern wordToF... | /**
* Finds indices of the words in LinkedList<String> theList in the String theDoc within the given section
* @param theDoc
* @param theWord
* @param startSection
* @param endSection
* @return
*/ | Finds indices of the words in LinkedList theList in the String theDoc within the given section | findIndicesInSection | {
"repo_name": "jbdatko/pes",
"path": "anonymouth/src/edu/drexel/psal/anonymouth/utils/IndexFinder.java",
"license": "gpl-3.0",
"size": 10094
} | [
"edu.drexel.psal.jstylo.generics.Logger",
"java.util.ArrayList",
"java.util.regex.Matcher",
"java.util.regex.Pattern"
] | import edu.drexel.psal.jstylo.generics.Logger; import java.util.ArrayList; import java.util.regex.Matcher; import java.util.regex.Pattern; | import edu.drexel.psal.jstylo.generics.*; import java.util.*; import java.util.regex.*; | [
"edu.drexel.psal",
"java.util"
] | edu.drexel.psal; java.util; | 2,337,989 |
public void validate(Object object, Errors errors) {
HouseholdDTO household = (HouseholdDTO) object;
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "householdName", "field.required",
"Household name must not be empty");
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "... | void function(Object object, Errors errors) { HouseholdDTO household = (HouseholdDTO) object; ValidationUtils.rejectIfEmptyOrWhitespace(errors, STR, STR, STR); ValidationUtils.rejectIfEmptyOrWhitespace(errors, STR, STR, STR); ValidationUtils.rejectIfEmptyOrWhitespace(errors, STR, STR, STR); ValidationUtils.rejectIfEmpt... | /**
* validates the data
* @param object the household to validate
* @param errors the errors
*/ | validates the data | validate | {
"repo_name": "jackcmeyer/SmartSync",
"path": "smartsync-household-service/src/main/java/com/smartsync/validator/HouseholdValidator.java",
"license": "mit",
"size": 2047
} | [
"com.smartsync.dto.HouseholdDTO",
"org.springframework.validation.Errors",
"org.springframework.validation.ValidationUtils"
] | import com.smartsync.dto.HouseholdDTO; import org.springframework.validation.Errors; import org.springframework.validation.ValidationUtils; | import com.smartsync.dto.*; import org.springframework.validation.*; | [
"com.smartsync.dto",
"org.springframework.validation"
] | com.smartsync.dto; org.springframework.validation; | 94,103 |
public static ims.clinical.vo.SurgicalAuditPreOpChecksTheatreNurseVo insert(DomainObjectMap map, ims.clinical.vo.SurgicalAuditPreOpChecksTheatreNurseVo valueObject, ims.clinical.domain.objects.SurgicalAuditPreOpChecksTheatreNurse domainObject)
{
if (null == domainObject)
{
return valueObject;
}
if... | static ims.clinical.vo.SurgicalAuditPreOpChecksTheatreNurseVo function(DomainObjectMap map, ims.clinical.vo.SurgicalAuditPreOpChecksTheatreNurseVo valueObject, ims.clinical.domain.objects.SurgicalAuditPreOpChecksTheatreNurse domainObject) { if (null == domainObject) { return valueObject; } if (null == map) { map = new ... | /**
* Update the ValueObject with the Domain Object.
* @param map DomainObjectMap of DomainObjects to already created ValueObjects.
* @param valueObject to be updated
* @param domainObject ims.clinical.domain.objects.SurgicalAuditPreOpChecksTheatreNurse
*/ | Update the ValueObject with the Domain Object | insert | {
"repo_name": "open-health-hub/openMAXIMS",
"path": "openmaxims_workspace/ValueObjects/src/ims/clinical/vo/domain/SurgicalAuditPreOpChecksTheatreNurseVoAssembler.java",
"license": "agpl-3.0",
"size": 26058
} | [
"org.hibernate.proxy.HibernateProxy"
] | import org.hibernate.proxy.HibernateProxy; | import org.hibernate.proxy.*; | [
"org.hibernate.proxy"
] | org.hibernate.proxy; | 1,453,324 |
public void insertRandomData() {
long start_time = System.nanoTime();
logger.info("Process for insert data into Group is running");
for (int i = 0; i < getMaxInserts(); i++) {
try {
MariaDBConnection
.executeStatement(createInsert(MariaDBC... | void function() { long start_time = System.nanoTime(); logger.info(STR); for (int i = 0; i < getMaxInserts(); i++) { try { MariaDBConnection .executeStatement(createInsert(MariaDBConnection .getConn())); } catch (SQLException e) { e.printStackTrace(); } } long end_time = System.nanoTime(); logger.info(STR + ((end_time ... | /**
* This method insert random data into database structure.
*
* This method overrides an existing method.
*
* @see com.m4gik.common.Insertion#insertRandomData()
*/ | This method insert random data into database structure. This method overrides an existing method | insertRandomData | {
"repo_name": "aleksandersmierciak/Qt-DbWorkbench",
"path": "MariaDB/MariaDB Java WorkBench/databaseinsertion/src/main/java/com/m4gik/common/Group.java",
"license": "gpl-3.0",
"size": 7516
} | [
"com.m4gik.database.MariaDBConnection",
"java.sql.SQLException"
] | import com.m4gik.database.MariaDBConnection; import java.sql.SQLException; | import com.m4gik.database.*; import java.sql.*; | [
"com.m4gik.database",
"java.sql"
] | com.m4gik.database; java.sql; | 2,043,237 |
Response<User> getWithResponse(
String resourceGroupName, String labName, String name, String expand, Context context); | Response<User> getWithResponse( String resourceGroupName, String labName, String name, String expand, Context context); | /**
* Get user profile.
*
* @param resourceGroupName The name of the resource group.
* @param labName The name of the lab.
* @param name The name of the user profile.
* @param expand Specify the $expand query. Example: 'properties($select=identity)'.
* @param context The context to as... | Get user profile | getWithResponse | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Users.java",
"license": "mit",
"size": 7298
} | [
"com.azure.core.http.rest.Response",
"com.azure.core.util.Context"
] | import com.azure.core.http.rest.Response; import com.azure.core.util.Context; | import com.azure.core.http.rest.*; import com.azure.core.util.*; | [
"com.azure.core"
] | com.azure.core; | 905,314 |
@Override
public int hashCode() {
return new HashCodeBuilder()
.append(identifier)
.append(displayName)
.append(inviteCode)
.append(inviteURL)
.append(homeURL)
.append(regURL)
.toHashCode();
} | int function() { return new HashCodeBuilder() .append(identifier) .append(displayName) .append(inviteCode) .append(inviteURL) .append(homeURL) .append(regURL) .toHashCode(); } | /**
* HashCode Implementation using apache-lang
*/ | HashCode Implementation using apache-lang | hashCode | {
"repo_name": "RespectNetwork/csp-provisioning-application",
"path": "src/main/java/net/respectnetwork/csp/application/csp/CSP.java",
"license": "mit",
"size": 3036
} | [
"org.apache.commons.lang.builder.HashCodeBuilder"
] | import org.apache.commons.lang.builder.HashCodeBuilder; | import org.apache.commons.lang.builder.*; | [
"org.apache.commons"
] | org.apache.commons; | 885,306 |
void setSpawnTransform(Transform<World> transform);
}
interface Finish extends SleepingEvent {} | void setSpawnTransform(Transform<World> transform); } interface Finish extends SleepingEvent {} | /**
* Sets the new spawn transform of the human leaving the bed.
*
* <p>If spawn {@link #isSpawnSet()} was not infact set by this event,
* this does not override the return value. The given spawn should be
* a valid location.</p>
*
* @param transform The ne... | Sets the new spawn transform of the human leaving the bed. If spawn <code>#isSpawnSet()</code> was not infact set by this event, this does not override the return value. The given spawn should be a valid location | setSpawnTransform | {
"repo_name": "JBYoshi/SpongeAPI",
"path": "src/main/java/org/spongepowered/api/event/action/SleepingEvent.java",
"license": "mit",
"size": 3383
} | [
"org.spongepowered.api.entity.Transform",
"org.spongepowered.api.world.World"
] | import org.spongepowered.api.entity.Transform; import org.spongepowered.api.world.World; | import org.spongepowered.api.entity.*; import org.spongepowered.api.world.*; | [
"org.spongepowered.api"
] | org.spongepowered.api; | 1,757,095 |
private void addFilesToExistingZip(ZipFileWriter zipFileWriter, String[] files) throws FileNotFoundException, IOException
{
byte[] buf = new byte[1024];
// Compress the files
for (int i = 0; i < files.length; i++)
{
File file = new File(files[i]);
InputStream in ... | void function(ZipFileWriter zipFileWriter, String[] files) throws FileNotFoundException, IOException { byte[] buf = new byte[1024]; for (int i = 0; i < files.length; i++) { File file = new File(files[i]); InputStream in = new FileInputStream(files[i]); zipFileWriter.startFile(files[i], file.lastModified()); zipFileWrit... | /**
* Add files to an existing zip file.
* @param zipFile is the existing zip file
* @param files is an array of files that we want to add to the existing zip file
* @throw if something goes wrong an exception is thrown.
*/ | Add files to an existing zip file | addFilesToExistingZip | {
"repo_name": "mwjmurphy/Axel-Framework",
"path": "axel-common/src/main/java/org/xmlactions/common/zip/ZipFileExtras.java",
"license": "apache-2.0",
"size": 7107
} | [
"java.io.File",
"java.io.FileInputStream",
"java.io.FileNotFoundException",
"java.io.IOException",
"java.io.InputStream"
] | import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; | import java.io.*; | [
"java.io"
] | java.io; | 848,508 |
public Timestamp getCreated();
public static final String COLUMNNAME_CreatedBy = "CreatedBy"; | Timestamp function(); public static final String COLUMNNAME_CreatedBy = STR; | /** Get Created.
* Date this record was created
*/ | Get Created. Date this record was created | getCreated | {
"repo_name": "klst-com/metasfresh",
"path": "de.metas.adempiere.adempiere/base/src/main/java-gen/org/compiere/model/I_W_Advertisement.java",
"license": "gpl-2.0",
"size": 10201
} | [
"java.sql.Timestamp"
] | import java.sql.Timestamp; | import java.sql.*; | [
"java.sql"
] | java.sql; | 399,248 |
Bucket updateBucketState(Experiment.ID experimentID, Bucket.Label bucketLabel, Bucket.State desiredState,
UserInfo user); | Bucket updateBucketState(Experiment.ID experimentID, Bucket.Label bucketLabel, Bucket.State desiredState, UserInfo user); | /**
* Updates a bucket's state by updating the specified metadata in the database.
*
* @param experimentID the unique experiment id
* @param bucketLabel the unique bucket id
* @param desiredState the desired state
* @param user the {@link UserInfo} who updated the state
* @re... | Updates a bucket's state by updating the specified metadata in the database | updateBucketState | {
"repo_name": "intuit/wasabi",
"path": "modules/experiment/src/main/java/com/intuit/wasabi/experiment/Buckets.java",
"license": "apache-2.0",
"size": 6625
} | [
"com.intuit.wasabi.authenticationobjects.UserInfo",
"com.intuit.wasabi.experimentobjects.Bucket",
"com.intuit.wasabi.experimentobjects.Experiment"
] | import com.intuit.wasabi.authenticationobjects.UserInfo; import com.intuit.wasabi.experimentobjects.Bucket; import com.intuit.wasabi.experimentobjects.Experiment; | import com.intuit.wasabi.authenticationobjects.*; import com.intuit.wasabi.experimentobjects.*; | [
"com.intuit.wasabi"
] | com.intuit.wasabi; | 2,617,940 |
public static ReactiveSocket fromServerConnection(
DuplexConnection connection,
ConnectionSetupHandler connectionHandler,
LeaseGovernor leaseGovernor,
Consumer<Throwable> errorConsumer
) {
return new ReactiveSocket(connection, true, null, null, connectionHandler,
... | static ReactiveSocket function( DuplexConnection connection, ConnectionSetupHandler connectionHandler, LeaseGovernor leaseGovernor, Consumer<Throwable> errorConsumer ) { return new ReactiveSocket(connection, true, null, null, connectionHandler, leaseGovernor, errorConsumer); } | /**
* Create a ReactiveSocket from a server-side {@link DuplexConnection}.
* <p>
* A server-side connection is one that accepted the connection from a
* client and will define the ReactiveSocket behaviors via the
* {@link ConnectionSetupPayload} that define mime-types, leasing behavior
* a... | Create a ReactiveSocket from a server-side <code>DuplexConnection</code>. A server-side connection is one that accepted the connection from a client and will define the ReactiveSocket behaviors via the <code>ConnectionSetupPayload</code> that define mime-types, leasing behavior and other connection-level details | fromServerConnection | {
"repo_name": "stevegury/reactivesocket-java",
"path": "src/main/java/io/reactivesocket/ReactiveSocket.java",
"license": "apache-2.0",
"size": 18965
} | [
"java.util.function.Consumer"
] | import java.util.function.Consumer; | import java.util.function.*; | [
"java.util"
] | java.util; | 2,458,220 |
public int determineInputFieldCount() {
int result = 0;
for (final AnalystField field : this.script.getNormalize()
.getNormalizedFields()) {
if (field.isInput() && !field.isIgnored()) {
result++;
}
}
return result;
} | int function() { int result = 0; for (final AnalystField field : this.script.getNormalize() .getNormalizedFields()) { if (field.isInput() && !field.isIgnored()) { result++; } } return result; } | /**
* Determine the input field count, the fields are higher-level
* than columns.
* <p/>
* @return The input field count.
*/ | Determine the input field count, the fields are higher-level than columns. | determineInputFieldCount | {
"repo_name": "ladygagapowerbot/bachelor-thesis-implementation",
"path": "lib/Encog/src/main/java/org/encog/app/analyst/EncogAnalyst.java",
"license": "mit",
"size": 25071
} | [
"org.encog.app.analyst.script.normalize.AnalystField"
] | import org.encog.app.analyst.script.normalize.AnalystField; | import org.encog.app.analyst.script.normalize.*; | [
"org.encog.app"
] | org.encog.app; | 2,571,381 |
public static <M extends Map<?, ?>> boolean isNotEmpty(M map) {
return !isEmpty(map);
} | static <M extends Map<?, ?>> boolean function(M map) { return !isEmpty(map); } | /**
* Returns if the given {@code map} is not {@code null} and not empty.
*
* @param map
* The map to test.
* @return {@code true} if the given {@code map} is not {@code null} and not {@code empty}.
*/ | Returns if the given map is not null and not empty | isNotEmpty | {
"repo_name": "Raphcal/sigmah",
"path": "src/main/java/org/sigmah/client/util/ClientUtils.java",
"license": "gpl-3.0",
"size": 51847
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 142,039 |
private static void setStatusBarIcon(Context context, boolean enabled) {
Intent alarmChanged = new Intent("android.intent.action.ALARM_CHANGED");
alarmChanged.putExtra("alarmSet", enabled);
context.sendBroadcast(alarmChanged);
} | static void function(Context context, boolean enabled) { Intent alarmChanged = new Intent(STR); alarmChanged.putExtra(STR, enabled); context.sendBroadcast(alarmChanged); } | /**
* Tells the StatusBar whether the alarm is enabled or disabled
*/ | Tells the StatusBar whether the alarm is enabled or disabled | setStatusBarIcon | {
"repo_name": "nordfalk/EsperantoRadio",
"path": "app/src/main/java/dk/dr/radio/vaekning/Alarms.java",
"license": "gpl-3.0",
"size": 10243
} | [
"android.content.Context",
"android.content.Intent"
] | import android.content.Context; import android.content.Intent; | import android.content.*; | [
"android.content"
] | android.content; | 720,355 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.