method stringlengths 13 441k | clean_method stringlengths 7 313k | doc stringlengths 17 17.3k | comment stringlengths 3 1.42k | method_name stringlengths 1 273 | extra dict | imports list | imports_info stringlengths 19 34.8k | cluster_imports_info stringlengths 15 3.66k | libraries list | libraries_info stringlengths 6 661 | id int64 0 2.92M |
|---|---|---|---|---|---|---|---|---|---|---|---|
public void setCells(Cell[] cells) {
this.cells = cells;
} | void function(Cell[] cells) { this.cells = cells; } | /**
* Sets the flat array of cells
* @param cells
*/ | Sets the flat array of cells | setCells | {
"repo_name": "hgulcan/badr_htm",
"path": "src/main/java/org/numenta/nupic/Connections.java",
"license": "agpl-3.0",
"size": 51299
} | [
"org.numenta.nupic.model.Cell"
] | import org.numenta.nupic.model.Cell; | import org.numenta.nupic.model.*; | [
"org.numenta.nupic"
] | org.numenta.nupic; | 2,106,843 |
public static <E> ListIterator<E> unmodifiableListIterator(final ListIterator<E> listIterator) {
return UnmodifiableListIterator.umodifiableListIterator(listIterator);
} | static <E> ListIterator<E> function(final ListIterator<E> listIterator) { return UnmodifiableListIterator.umodifiableListIterator(listIterator); } | /**
* Gets an immutable version of a {@link ListIterator}. The returned object
* will always throw an {@link UnsupportedOperationException} for
* the {@link Iterator#remove}, {@link ListIterator#add} and
* {@link ListIterator#set} methods.
*
* @param <E> the element type
* @param lis... | Gets an immutable version of a <code>ListIterator</code>. The returned object will always throw an <code>UnsupportedOperationException</code> for the <code>Iterator#remove</code>, <code>ListIterator#add</code> and <code>ListIterator#set</code> methods | unmodifiableListIterator | {
"repo_name": "krivachy/compgs03_mutation_testing",
"path": "src/main/java/org/apache/commons/collections4/IteratorUtils.java",
"license": "apache-2.0",
"size": 45184
} | [
"java.util.ListIterator",
"org.apache.commons.collections4.iterators.UnmodifiableListIterator"
] | import java.util.ListIterator; import org.apache.commons.collections4.iterators.UnmodifiableListIterator; | import java.util.*; import org.apache.commons.collections4.iterators.*; | [
"java.util",
"org.apache.commons"
] | java.util; org.apache.commons; | 1,606,789 |
public ItemStack getCraftingResult(InventoryCrafting p_77572_1_)
{
int var2 = 0;
ItemStack var3 = null;
for (int var4 = 0; var4 < p_77572_1_.getSizeInventory(); ++var4)
{
ItemStack var5 = p_77572_1_.getStackInSlot(var4);
if (var5 != null)
{
... | ItemStack function(InventoryCrafting p_77572_1_) { int var2 = 0; ItemStack var3 = null; for (int var4 = 0; var4 < p_77572_1_.getSizeInventory(); ++var4) { ItemStack var5 = p_77572_1_.getStackInSlot(var4); if (var5 != null) { if (var5.getItem() == Items.filled_map) { if (var3 != null) { return null; } var3 = var5; } els... | /**
* Returns an Item that is the result of this recipe
*/ | Returns an Item that is the result of this recipe | getCraftingResult | {
"repo_name": "Hexeption/Youtube-Hacked-Client-1.8",
"path": "minecraft/net/minecraft/item/crafting/RecipesMapCloning.java",
"license": "mit",
"size": 3192
} | [
"net.minecraft.init.Items",
"net.minecraft.inventory.InventoryCrafting",
"net.minecraft.item.ItemStack"
] | import net.minecraft.init.Items; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; | import net.minecraft.init.*; import net.minecraft.inventory.*; import net.minecraft.item.*; | [
"net.minecraft.init",
"net.minecraft.inventory",
"net.minecraft.item"
] | net.minecraft.init; net.minecraft.inventory; net.minecraft.item; | 1,898,575 |
public static CommonTransitions createTimeline(Image animation) {
CommonTransitions t = new CommonTransitions(TYPE_TIMELINE);
t.timeline = animation;
t.transitionType = TYPE_TIMELINE;
return t;
} | static CommonTransitions function(Image animation) { CommonTransitions t = new CommonTransitions(TYPE_TIMELINE); t.timeline = animation; t.transitionType = TYPE_TIMELINE; return t; } | /**
* Creates a transition using an animated image object (e.g. timeline object) as an
* alpha mask between the source/target
*
* @param animation the image object to execute
* @return a transition object
*/ | Creates a transition using an animated image object (e.g. timeline object) as an alpha mask between the source/target | createTimeline | {
"repo_name": "shannah/cn1",
"path": "CodenameOne/src/com/codename1/ui/animations/CommonTransitions.java",
"license": "gpl-2.0",
"size": 50343
} | [
"com.codename1.ui.Image"
] | import com.codename1.ui.Image; | import com.codename1.ui.*; | [
"com.codename1.ui"
] | com.codename1.ui; | 644,413 |
@Override
public ImageS getNextImage() throws ImageShapeException {
// we calculate emitter count first so it corresponds with the beginning
// of the frame rather than end of the frame
emitterHistory.add(microscope.getOnEmitterCount());
ImageS pixels = microscope.simulateFr... | ImageS function() throws ImageShapeException { emitterHistory.add(microscope.getOnEmitterCount()); ImageS pixels = microscope.simulateFrame(); stack.concatenate(pixels); return pixels; } | /**
* Generates a new image and adds it to the internal stack.
* @return newly generated image
*/ | Generates a new image and adds it to the internal stack | getNextImage | {
"repo_name": "MStefko/STEADIER-SAILOR",
"path": "src/main/java/ch/epfl/leb/sass/simulator/internal/DefaultSimulator.java",
"license": "gpl-3.0",
"size": 14153
} | [
"ch.epfl.leb.sass.utils.images.ImageS",
"ch.epfl.leb.sass.utils.images.ImageShapeException"
] | import ch.epfl.leb.sass.utils.images.ImageS; import ch.epfl.leb.sass.utils.images.ImageShapeException; | import ch.epfl.leb.sass.utils.images.*; | [
"ch.epfl.leb"
] | ch.epfl.leb; | 769,552 |
public synchronized @NotNull String getSourceFilePath(int tabIndex) {
// Throws exception if tabIndex is out of valid range
checkRange(tabIndex, 0, tabsData.size());
return tabsData.get(tabIndex).sourceFilePath;
} | synchronized @NotNull String function(int tabIndex) { checkRange(tabIndex, 0, tabsData.size()); return tabsData.get(tabIndex).sourceFilePath; } | /**
* Returns the source file path in the specified tab.
*
* @param tabIndex the index of the tab with source file path to return
*
* @return the source file path in the specified tab
*
* @throws IndexOutOfBoundsException if the index is out of range
* (index < 0 || index >= coun... | Returns the source file path in the specified tab | getSourceFilePath | {
"repo_name": "dmtolpeko/sqlines",
"path": "sqlines-studio-java/src/main/java/com/sqlines/studio/model/tabsdata/ObservableTabsData.java",
"license": "apache-2.0",
"size": 23316
} | [
"org.jetbrains.annotations.NotNull"
] | import org.jetbrains.annotations.NotNull; | import org.jetbrains.annotations.*; | [
"org.jetbrains.annotations"
] | org.jetbrains.annotations; | 1,432 |
public boolean awaitClose(long timeout, TimeUnit timeUnit) throws InterruptedException {
return indicesService.awaitClose(timeout, timeUnit);
} | boolean function(long timeout, TimeUnit timeUnit) throws InterruptedException { return indicesService.awaitClose(timeout, timeUnit); } | /**
* Wait for the node to be effectively closed.
* @see IndicesService#awaitClose(long, TimeUnit)
*/ | Wait for the node to be effectively closed | awaitClose | {
"repo_name": "coding0011/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/node/NodeService.java",
"license": "apache-2.0",
"size": 7290
} | [
"java.util.concurrent.TimeUnit"
] | import java.util.concurrent.TimeUnit; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 2,044,491 |
public Packet createGrayscaleImage(ByteBuffer buffer, int width, int height) {
if (width * height != buffer.capacity()) {
throw new RuntimeException(
"The size of the buffer should be: " + width * height + " but is " + buffer.capacity());
}
return Packet.create(
nativeCreateGraysca... | Packet function(ByteBuffer buffer, int width, int height) { if (width * height != buffer.capacity()) { throw new RuntimeException( STR + width * height + STR + buffer.capacity()); } return Packet.create( nativeCreateGrayscaleImage(mediapipeGraph.getNativeHandle(), buffer, width, height)); } | /**
* Creates a 1 channel ImageFrame packet from an U8 buffer.
*
* <p>Use {@link ByteBuffer#allocateDirect} when allocating the buffer.
*/ | Creates a 1 channel ImageFrame packet from an U8 buffer. Use <code>ByteBuffer#allocateDirect</code> when allocating the buffer | createGrayscaleImage | {
"repo_name": "google/mediapipe",
"path": "mediapipe/java/com/google/mediapipe/framework/PacketCreator.java",
"license": "apache-2.0",
"size": 17320
} | [
"java.nio.ByteBuffer"
] | import java.nio.ByteBuffer; | import java.nio.*; | [
"java.nio"
] | java.nio; | 1,245,823 |
protected void onBarrier(int channelIndex) throws IOException {
if (!blockedChannels[channelIndex]) {
blockedChannels[channelIndex] = true;
numBarriersReceived++;
if (LOG.isDebugEnabled()) {
LOG.debug("{}: Received barrier from channel {}.", taskName, channelIndex);
}
}
else {
throw new IO... | void function(int channelIndex) throws IOException { if (!blockedChannels[channelIndex]) { blockedChannels[channelIndex] = true; numBarriersReceived++; if (LOG.isDebugEnabled()) { LOG.debug(STR, taskName, channelIndex); } } else { throw new IOException(STR + channelIndex); } } | /**
* Blocks the given channel index, from which a barrier has been received.
*
* @param channelIndex The channel index to block.
*/ | Blocks the given channel index, from which a barrier has been received | onBarrier | {
"repo_name": "bowenli86/flink",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/CheckpointBarrierAligner.java",
"license": "apache-2.0",
"size": 10739
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 113,275 |
@Override
public MultiLevelImage createImage(final Mask mask) {
return VectorDataMultiLevelImage.createMask(getVectorData(mask), mask);
} | MultiLevelImage function(final Mask mask) { return VectorDataMultiLevelImage.createMask(getVectorData(mask), mask); } | /**
* Creates the image.
*
* @param mask The mask which requests creation of its image.
*
* @return The image.
*/ | Creates the image | createImage | {
"repo_name": "arraydev/snap-engine",
"path": "snap-core/src/main/java/org/esa/snap/framework/datamodel/Mask.java",
"license": "gpl-3.0",
"size": 25078
} | [
"com.bc.ceres.glevel.MultiLevelImage"
] | import com.bc.ceres.glevel.MultiLevelImage; | import com.bc.ceres.glevel.*; | [
"com.bc.ceres"
] | com.bc.ceres; | 2,755,625 |
public static DateTime convertDateToDateTime(Date date) {
// Get year, javaMonth, date
Calendar calendar = Calendar.getInstance();
calendar.clear();
calendar.setTime(date);
int year = calendar.get(Calendar.YEAR);
int javaMonth = calendar.get(Calendar.MONTH);
... | static DateTime function(Date date) { Calendar calendar = Calendar.getInstance(); calendar.clear(); calendar.setTime(date); int year = calendar.get(Calendar.YEAR); int javaMonth = calendar.get(Calendar.MONTH); int day = calendar.get(Calendar.DATE); return new DateTime(year, javaMonth + 1, day, 0, 0, 0, 0); } | /**
* Get the DateTime from Date, with hour and min is 0
*
* @param date
* @return
*/ | Get the DateTime from Date, with hour and min is 0 | convertDateToDateTime | {
"repo_name": "benoitletondor/EasyBudget",
"path": "Android/EasyBudget/caldroid/src/main/java/com/roomorama/caldroid/CalendarHelper.java",
"license": "apache-2.0",
"size": 5856
} | [
"java.util.Calendar",
"java.util.Date"
] | import java.util.Calendar; import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 827,812 |
@Test
@SuppressWarnings("unchecked")
public void testValueStateNullUpdate() throws Exception {
// precondition: LongSerializer must fail on null value. this way the test would fail
// later if null values where actually stored in the state instead of acting as clear()
try {
LongSerializer.INSTANCE.seriali... | @SuppressWarnings(STR) void function() throws Exception { try { LongSerializer.INSTANCE.serialize(null, new DataOutputViewStreamWrapper(new ByteArrayOutputStream())); fail(STR); } catch (NullPointerException e) { } CheckpointStreamFactory streamFactory = createStreamFactory(); AbstractKeyedStateBackend<Integer> backend... | /**
* This test verifies that passing {@code null} to {@link ValueState#update(Object)} acts
* the same as {@link ValueState#clear()}.
*
* @throws Exception
*/ | This test verifies that passing null to <code>ValueState#update(Object)</code> acts the same as <code>ValueState#clear()</code> | testValueStateNullUpdate | {
"repo_name": "zohar-mizrahi/flink",
"path": "flink-runtime/src/test/java/org/apache/flink/runtime/state/StateBackendTestBase.java",
"license": "apache-2.0",
"size": 101791
} | [
"org.apache.commons.io.output.ByteArrayOutputStream",
"org.apache.flink.api.common.state.ValueState",
"org.apache.flink.api.common.state.ValueStateDescriptor",
"org.apache.flink.api.common.typeutils.base.IntSerializer",
"org.apache.flink.api.common.typeutils.base.LongSerializer",
"org.apache.flink.core.me... | import org.apache.commons.io.output.ByteArrayOutputStream; import org.apache.flink.api.common.state.ValueState; import org.apache.flink.api.common.state.ValueStateDescriptor; import org.apache.flink.api.common.typeutils.base.IntSerializer; import org.apache.flink.api.common.typeutils.base.LongSerializer; import org.apa... | import org.apache.commons.io.output.*; import org.apache.flink.api.common.state.*; import org.apache.flink.api.common.typeutils.base.*; import org.apache.flink.core.memory.*; import org.apache.flink.runtime.checkpoint.*; import org.apache.flink.util.*; import org.junit.*; | [
"org.apache.commons",
"org.apache.flink",
"org.junit"
] | org.apache.commons; org.apache.flink; org.junit; | 2,887,727 |
void addAll(Iterator<? extends Statement> statement)
throws ModelRuntimeException;
| void addAll(Iterator<? extends Statement> statement) throws ModelRuntimeException; | /**
* For each statement in the iterator, this method creates a Model named
* statement.getContextURI if needed. Then the statement (s,p,o) is inserted
* into that model.
*
* @param statement
* @throws ModelRuntimeException
* if any internal (I/O related) exception occurs
*/ | For each statement in the iterator, this method creates a Model named statement.getContextURI if needed. Then the statement (s,p,o) is inserted into that model | addAll | {
"repo_name": "semweb4j/semweb4j",
"path": "org.semweb4j.rdf2go.api/src/main/java/org/ontoware/rdf2go/model/ModelSetAddRemove.java",
"license": "bsd-2-clause",
"size": 5676
} | [
"java.util.Iterator",
"org.ontoware.rdf2go.exception.ModelRuntimeException"
] | import java.util.Iterator; import org.ontoware.rdf2go.exception.ModelRuntimeException; | import java.util.*; import org.ontoware.rdf2go.exception.*; | [
"java.util",
"org.ontoware.rdf2go"
] | java.util; org.ontoware.rdf2go; | 732,564 |
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
if (choiceLimits.length != choiceFormats.length) {
throw new InvalidObjectException(
"limits and format arrays of different length.");
}
}
... | void function(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); if (choiceLimits.length != choiceFormats.length) { throw new InvalidObjectException( STR); } } private double[] choiceLimits; private String[] choiceFormats; static final long SIGN = 0x8000000000000000L; static fina... | /**
* After reading an object from the input stream, do a simple verification
* to maintain class invariants.
* @throws InvalidObjectException if the objects read from the stream is invalid.
*/ | After reading an object from the input stream, do a simple verification to maintain class invariants | readObject | {
"repo_name": "openjdk/jdk7u",
"path": "jdk/src/share/classes/java/text/ChoiceFormat.java",
"license": "gpl-2.0",
"size": 23840
} | [
"java.io.IOException",
"java.io.InvalidObjectException",
"java.io.ObjectInputStream"
] | import java.io.IOException; import java.io.InvalidObjectException; import java.io.ObjectInputStream; | import java.io.*; | [
"java.io"
] | java.io; | 2,224,387 |
public void writeExternal( ObjectOutput out )
throws IOException
{
out.writeObject( _comparator );
//serializer is not persistent from 2.0
// out.writeObject( _keySerializer );
// out.writeObject( _valueSerializer );
out.writeInt( _height );
out.wri... | void function( ObjectOutput out ) throws IOException { out.writeObject( _comparator ); out.writeInt( _height ); out.writeLong( _root ); out.writeInt( _pageSize ); out.writeInt( _entries ); } static class EmptyBrowser<K,V> implements TupleBrowser<K,V> { @SuppressWarnings(STR) static TupleBrowser INSTANCE = new EmptyBrow... | /**
* Implement Externalizable interface.
*/ | Implement Externalizable interface | writeExternal | {
"repo_name": "fusesource/jdbm",
"path": "src/main/jdbm/btree/BTree.java",
"license": "apache-2.0",
"size": 20431
} | [
"java.io.IOException",
"java.io.ObjectOutput",
"jdbm.helper.TupleBrowser"
] | import java.io.IOException; import java.io.ObjectOutput; import jdbm.helper.TupleBrowser; | import java.io.*; import jdbm.helper.*; | [
"java.io",
"jdbm.helper"
] | java.io; jdbm.helper; | 1,255,161 |
private void updateRefPointTimestamp() {
if (!mTriggerTimestampUpdateNow && haveValidRefPoint()
&& elapsedNsec(mLastTimestampUpdateNsec) <= TIMESTAMP_UPDATE_PERIOD) {
// not time for an update yet
return;
}
long newNanoTimeAtFramePos0 = getNewFramePos... | void function() { if (!mTriggerTimestampUpdateNow && haveValidRefPoint() && elapsedNsec(mLastTimestampUpdateNsec) <= TIMESTAMP_UPDATE_PERIOD) { return; } long newNanoTimeAtFramePos0 = getNewFramePos0Timestamp(); if (newNanoTimeAtFramePos0 == NO_TIMESTAMP) { return; } long prevRefNanoTimeAtFramePos0 = mRefNanoTimeAtFram... | /**
* Update the reference timestamp used for interpolation.
*/ | Update the reference timestamp used for interpolation | updateRefPointTimestamp | {
"repo_name": "chromium/chromium",
"path": "chromecast/media/cma/backend/android/java/src/org/chromium/chromecast/cma/backend/android/AudioSinkAudioTrackImpl.java",
"license": "bsd-3-clause",
"size": 36295
} | [
"org.chromium.base.Log"
] | import org.chromium.base.Log; | import org.chromium.base.*; | [
"org.chromium.base"
] | org.chromium.base; | 1,681,360 |
public void writePacketData(PacketBuffer data) throws IOException
{
data.writeBlockPos(this.field_179725_b);
data.writeByte(this.placedBlockDirection);
data.writeItemStackToBuffer(this.stack);
data.writeByte((int)(this.facingX * 16.0F));
data.writeByte((int)(this.facingY ... | void function(PacketBuffer data) throws IOException { data.writeBlockPos(this.field_179725_b); data.writeByte(this.placedBlockDirection); data.writeItemStackToBuffer(this.stack); data.writeByte((int)(this.facingX * 16.0F)); data.writeByte((int)(this.facingY * 16.0F)); data.writeByte((int)(this.facingZ * 16.0F)); } | /**
* Writes the raw packet data to the data stream.
*/ | Writes the raw packet data to the data stream | writePacketData | {
"repo_name": "Hexeption/Youtube-Hacked-Client-1.8",
"path": "minecraft/net/minecraft/network/play/client/C08PacketPlayerBlockPlacement.java",
"license": "mit",
"size": 3424
} | [
"java.io.IOException",
"net.minecraft.network.PacketBuffer"
] | import java.io.IOException; import net.minecraft.network.PacketBuffer; | import java.io.*; import net.minecraft.network.*; | [
"java.io",
"net.minecraft.network"
] | java.io; net.minecraft.network; | 1,805,684 |
public Context getInitialContext(Hashtable env)
{
Log.debug("InitialContextFactory.getInitialContext()");
Context ctx = new localContextRoot(env);
if(Log.isDebugEnabled())Log.debug("Created initial context delegate for local namespace:"+ctx);
return ctx;
} | Context function(Hashtable env) { Log.debug(STR); Context ctx = new localContextRoot(env); if(Log.isDebugEnabled())Log.debug(STR+ctx); return ctx; } | /**
* Get Context that has access to default Namespace.
* This method won't be called if a name URL beginning
* with java: is passed to an InitialContext.
*
* @see org.mortbay.naming.java.javaURLContextFactory
* @param env a <code>Hashtable</code> value
* @return a <code>Context</code... | Get Context that has access to default Namespace. This method won't be called if a name URL beginning with java: is passed to an InitialContext | getInitialContext | {
"repo_name": "napcs/qedserver",
"path": "jetty/modules/naming/src/main/java/org/mortbay/naming/InitialContextFactory.java",
"license": "mit",
"size": 2774
} | [
"java.util.Hashtable",
"javax.naming.Context",
"org.mortbay.log.Log",
"org.mortbay.naming.local.localContextRoot"
] | import java.util.Hashtable; import javax.naming.Context; import org.mortbay.log.Log; import org.mortbay.naming.local.localContextRoot; | import java.util.*; import javax.naming.*; import org.mortbay.log.*; import org.mortbay.naming.local.*; | [
"java.util",
"javax.naming",
"org.mortbay.log",
"org.mortbay.naming"
] | java.util; javax.naming; org.mortbay.log; org.mortbay.naming; | 1,969,284 |
@Override
public float getProgress()
throws IOException, InterruptedException
{
return isFinished ? 1 : 0;
} | float function() throws IOException, InterruptedException { return isFinished ? 1 : 0; } | /**
* Rather than calculating progress, we just keep it simple
*/ | Rather than calculating progress, we just keep it simple | getProgress | {
"repo_name": "cotdp/com-cotdp-hadoop",
"path": "src/main/java/com/cotdp/hadoop/ZipFileRecordReader.java",
"license": "apache-2.0",
"size": 5183
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 727,551 |
public static boolean isTargetRectInFrameRect(@NonNull Rect target, @NonNull Rect frame) {
// parent
float x11 = frame.left;
float y11 = frame.top;
float x12 = frame.left + frame.right;
float y12 = frame.top + frame.bottom;
// child
float x21 = target.left;
... | static boolean function(@NonNull Rect target, @NonNull Rect frame) { float x11 = frame.left; float y11 = frame.top; float x12 = frame.left + frame.right; float y12 = frame.top + frame.bottom; float x21 = target.left; float y21 = target.top; float x22 = target.left + target.right; float y22 = target.top + target.bottom;... | /**
* Function that checks to see if a target rect is inside a frame rect
*
* @param target the child target
* @param frame the parent frame
* @return true or false
*/ | Function that checks to see if a target rect is inside a frame rect | isTargetRectInFrameRect | {
"repo_name": "SuperAwesomeLTD/sa-mobile-sdk-android",
"path": "superawesome-base/src/main/java/tv/superawesome/lib/sautils/SAUtils.java",
"license": "lgpl-3.0",
"size": 18852
} | [
"android.graphics.Rect",
"androidx.annotation.NonNull"
] | import android.graphics.Rect; import androidx.annotation.NonNull; | import android.graphics.*; import androidx.annotation.*; | [
"android.graphics",
"androidx.annotation"
] | android.graphics; androidx.annotation; | 2,905,058 |
@Override
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs,
String sortOrder) {
// Here's the switch statement that, given a URI, will determine what kind of request it is,
// and query the database accordingly.
Cursor ret... | Cursor function(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { Cursor retCursor; switch (sUriMatcher.match(uri)) { case TARGET: { retCursor = mOpenHelper.getReadableDatabase().query( ScoreContract.TargetEntry.TABLE_NAME, projection, selection, selectionArgs, null, null, sort... | /**
* Opens a query against the weather or location table using the given selection.
* @param uri uri
* @param projection columns for result
* @param selection columns for where clause
* @param selectionArgs values for where clause
* @param sortOrder order of the result
* @return A cu... | Opens a query against the weather or location table using the given selection | query | {
"repo_name": "kherb64/IPSCScorer",
"path": "app/src/main/java/kherb64/android/ipscscorer/data/ScoreProvider.java",
"license": "mit",
"size": 8038
} | [
"android.database.Cursor",
"android.net.Uri"
] | import android.database.Cursor; import android.net.Uri; | import android.database.*; import android.net.*; | [
"android.database",
"android.net"
] | android.database; android.net; | 1,338,720 |
private void verifyFailure(String wsdlLocation, String catalogFile) {
URL url = getURLFromLocation(wsdlLocation);
try{
OASISCatalogManager catalogManager = new OASISCatalogManager();
catalogManager.setCatalogFiles(getURLFromLocation(catalogFile).toString());
WSDL4JWrapper w... | void function(String wsdlLocation, String catalogFile) { URL url = getURLFromLocation(wsdlLocation); try{ OASISCatalogManager catalogManager = new OASISCatalogManager(); catalogManager.setCatalogFiles(getURLFromLocation(catalogFile).toString()); WSDL4JWrapper w4j = new WSDL4JWrapper(url, catalogManager, false, 0); w4j.... | /**
* Ensure that the test case is valid by failing in the absence of a needed
* catalog entry.
*/ | Ensure that the test case is valid by failing in the absence of a needed catalog entry | verifyFailure | {
"repo_name": "apache/axis2-java",
"path": "modules/jaxws/test/org/apache/axis2/jaxws/catalog/MultiRedirectionCatalogTest.java",
"license": "apache-2.0",
"size": 5110
} | [
"javax.wsdl.WSDLException",
"org.apache.axis2.jaxws.catalog.impl.OASISCatalogManager",
"org.apache.axis2.jaxws.util.WSDL4JWrapper"
] | import javax.wsdl.WSDLException; import org.apache.axis2.jaxws.catalog.impl.OASISCatalogManager; import org.apache.axis2.jaxws.util.WSDL4JWrapper; | import javax.wsdl.*; import org.apache.axis2.jaxws.catalog.impl.*; import org.apache.axis2.jaxws.util.*; | [
"javax.wsdl",
"org.apache.axis2"
] | javax.wsdl; org.apache.axis2; | 151,369 |
void registerVocabulary(Vocabulary vocabulary);
| void registerVocabulary(Vocabulary vocabulary); | /**
* Registers the specified vocabulary with this registry.
*
* @param vocabulary the vocabulary to register.
* @throws IllegalArgumentException if given {@code vocabulary} is {@code null}.
* @throws IllegalStateException if given {@code vocabulary} is already registered.
*/ | Registers the specified vocabulary with this registry | registerVocabulary | {
"repo_name": "i49/pulp",
"path": "pulp-api/src/main/java/com/github/i49/pulp/api/metadata/TermRegistry.java",
"license": "apache-2.0",
"size": 6402
} | [
"com.github.i49.pulp.api.vocabularies.Vocabulary"
] | import com.github.i49.pulp.api.vocabularies.Vocabulary; | import com.github.i49.pulp.api.vocabularies.*; | [
"com.github.i49"
] | com.github.i49; | 490,052 |
public void onRefresh(final PullToRefreshBase<V> refreshView);
}
public static interface OnRefreshListener2<V extends View> {
// TODO These methods need renaming to START/END rather than DOWN/UP | void function(final PullToRefreshBase<V> refreshView); } public static interface OnRefreshListener2<V extends View> { | /**
* onRefresh will be called for both a Pull from start, and Pull from
* end
*/ | onRefresh will be called for both a Pull from start, and Pull from end | onRefresh | {
"repo_name": "BarryLiu/MyAndroid",
"path": "Weather/src/com/juhe/weather/swiperefresh/PullToRefreshBase.java",
"license": "epl-1.0",
"size": 46785
} | [
"android.view.View"
] | import android.view.View; | import android.view.*; | [
"android.view"
] | android.view; | 54,208 |
public Fact evaluate(Pattern pattern) {
return
preEvaluate(pattern).
evaluating(pattern).
postEvaluate(pattern);
} | Fact function(Pattern pattern) { return preEvaluate(pattern). evaluating(pattern). postEvaluate(pattern); } | /**
* <code>evaluate</code> the pattern and return callee.
* function <code>evaluate</code> will run those functions, <code>preEvaluate</code>,
* <code>evaluating</code> and <code>postEvaluate</code>.
* @param pattern the pattern be evaluated.
* @return the instance of callee.
*/ | <code>evaluate</code> the pattern and return callee. function <code>evaluate</code> will run those functions, <code>preEvaluate</code>, <code>evaluating</code> and <code>postEvaluate</code> | evaluate | {
"repo_name": "yetisno/RuleEngine",
"path": "RuleEngineCore/src/main/java/org/yetiz/service/rulengine/core/fact/Fact.java",
"license": "mit",
"size": 2299
} | [
"org.yetiz.service.rulengine.core.pattern.Pattern"
] | import org.yetiz.service.rulengine.core.pattern.Pattern; | import org.yetiz.service.rulengine.core.pattern.*; | [
"org.yetiz.service"
] | org.yetiz.service; | 2,149,267 |
public YieldAndDiscountCurve getCurve(final String name) {
for (final Entry<String, YieldAndDiscountCurve> entry : _issuerCurvesNames.entrySet()) {
if (entry.getKey().equals(name)) {
return entry.getValue();
}
}
throw new IllegalArgumentException("Could not get curve for " + name);
} | YieldAndDiscountCurve function(final String name) { for (final Entry<String, YieldAndDiscountCurve> entry : _issuerCurvesNames.entrySet()) { if (entry.getKey().equals(name)) { return entry.getValue(); } } throw new IllegalArgumentException(STR + name); } | /**
* Gets the curve(with a name) for an issuer .
* @param name The name
* @return The curve, null if not found
*/ | Gets the curve(with a name) for an issuer | getCurve | {
"repo_name": "jeorme/OG-Platform",
"path": "projects/OG-Analytics/src/main/java/com/opengamma/analytics/financial/provider/description/inflation/InflationIssuerProviderDiscount.java",
"license": "apache-2.0",
"size": 24111
} | [
"com.opengamma.analytics.financial.model.interestrate.curve.YieldAndDiscountCurve",
"java.util.Map"
] | import com.opengamma.analytics.financial.model.interestrate.curve.YieldAndDiscountCurve; import java.util.Map; | import com.opengamma.analytics.financial.model.interestrate.curve.*; import java.util.*; | [
"com.opengamma.analytics",
"java.util"
] | com.opengamma.analytics; java.util; | 149,654 |
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<IntegrationAccountSchemaInner> getWithResponse(
String resourceGroupName, String integrationAccountName, String schemaName, Context context) {
return getWithResponseAsync(resourceGroupName, integrationAccountName, schemaName, context).b... | @ServiceMethod(returns = ReturnType.SINGLE) Response<IntegrationAccountSchemaInner> function( String resourceGroupName, String integrationAccountName, String schemaName, Context context) { return getWithResponseAsync(resourceGroupName, integrationAccountName, schemaName, context).block(); } | /**
* Gets an integration account schema.
*
* @param resourceGroupName The resource group name.
* @param integrationAccountName The integration account name.
* @param schemaName The integration account schema name.
* @param context The context to associate with this operation.
* @thro... | Gets an integration account schema | getWithResponse | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/logic/azure-resourcemanager-logic/src/main/java/com/azure/resourcemanager/logic/implementation/IntegrationAccountSchemasClientImpl.java",
"license": "mit",
"size": 56746
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.core.util.Context",
"com.azure.resourcemanager.logic.fluent.models.IntegrationAccountSchemaInner"
] | 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 com.azure.resourcemanager.logic.fluent.models.IntegrationAccountSchemaInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.logic.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 1,444,726 |
public void drawGlyphVector(GlyphVector gv, float x, float y)
{
out.println("% drawGlyphVector");
Shape s = gv.getOutline();
drawStringShape(AffineTransform.getTranslateInstance(x, y)
.createTransformedShape(s));
} | void function(GlyphVector gv, float x, float y) { out.println(STR); Shape s = gv.getOutline(); drawStringShape(AffineTransform.getTranslateInstance(x, y) .createTransformedShape(s)); } | /** Renders the text of the specified GlyphVector using the
Graphics2D context's rendering attributes. */ | Renders the text of the specified GlyphVector using the | drawGlyphVector | {
"repo_name": "taciano-perez/JamVM-PH",
"path": "src/classpath/gnu/java/awt/print/PostScriptGraphics2D.java",
"license": "gpl-2.0",
"size": 37494
} | [
"java.awt.Shape",
"java.awt.font.GlyphVector",
"java.awt.geom.AffineTransform"
] | import java.awt.Shape; import java.awt.font.GlyphVector; import java.awt.geom.AffineTransform; | import java.awt.*; import java.awt.font.*; import java.awt.geom.*; | [
"java.awt"
] | java.awt; | 1,206,258 |
void bind(SocketAddress address, IoHandler handler) throws IOException; | void bind(SocketAddress address, IoHandler handler) throws IOException; | /**
* Binds to the specified <code>address</code> and handles incoming
* connections with the specified <code>handler</code>.
*
* @throws IOException if failed to bind
*/ | Binds to the specified <code>address</code> and handles incoming connections with the specified <code>handler</code> | bind | {
"repo_name": "mksmbrtsh/LLRPexplorer",
"path": "src/org/apache/mina/common/IoAcceptor.java",
"license": "apache-2.0",
"size": 3530
} | [
"java.io.IOException",
"java.net.SocketAddress"
] | import java.io.IOException; import java.net.SocketAddress; | import java.io.*; import java.net.*; | [
"java.io",
"java.net"
] | java.io; java.net; | 1,141,777 |
public ImageAgent getImageAgent( Context context )
{
return ( ImageAgent.getInstance( context ) );
} | ImageAgent function( Context context ) { return ( ImageAgent.getInstance( context ) ); } | /*****************************************************
*
* Returns an instance of the image loader.
*
*****************************************************/ | Returns an instance of the image loader | getImageAgent | {
"repo_name": "bearprada/Android-Print-SDK",
"path": "KitePrintSDK/src/main/java/ly/kite/KiteSDK.java",
"license": "mit",
"size": 26068
} | [
"android.content.Context",
"ly.kite.util.ImageAgent"
] | import android.content.Context; import ly.kite.util.ImageAgent; | import android.content.*; import ly.kite.util.*; | [
"android.content",
"ly.kite.util"
] | android.content; ly.kite.util; | 261,306 |
private void findLocation( final Glyph glyph) {
// Compute a rectangle that includes glyph's margin
final int x = 0;
final int y = 0;
final int w = glyph.margin.left + ((int) glyph.width) + glyph.margin.right;
final int h = glyph.margin.top + ((int) glyph.height) + glyph.mar... | void function( final Glyph glyph) { final int x = 0; final int y = 0; final int w = glyph.margin.left + ((int) glyph.width) + glyph.margin.right; final int h = glyph.margin.top + ((int) glyph.height) + glyph.margin.bottom; final Rect rect = new Rect(x, y, w, h, new TextData(glyph)); packer.add(rect); glyph.location = r... | /**
* Finds a location in the backing store for a glyph.
*
* @param glyph Glyph being uploaded, assumed not null
*/ | Finds a location in the backing store for a glyph | findLocation | {
"repo_name": "jedwards1211/breakout",
"path": "andork-jogl-gl2es2-swing/src/jogamp/opengl/util/awt/text/GlyphCache.java",
"license": "gpl-2.0",
"size": 23757
} | [
"com.jogamp.opengl.util.packrect.Rect"
] | import com.jogamp.opengl.util.packrect.Rect; | import com.jogamp.opengl.util.packrect.*; | [
"com.jogamp.opengl"
] | com.jogamp.opengl; | 322,070 |
private String buildBellsString(NodeList list, long finishTime) {
StringBuilder bellsList = new StringBuilder();
for (int i = 0; i < list.getLength(); i++) {
Element element = (Element) list.item(i);
String timeStr = xu.findAttributeText(element, R.string.xml2attrName_bell_t... | String function(NodeList list, long finishTime) { StringBuilder bellsList = new StringBuilder(); for (int i = 0; i < list.getLength(); i++) { Element element = (Element) list.item(i); String timeStr = xu.findAttributeText(element, R.string.xml2attrName_bell_time); long time; if (timeStr == null) continue; if (timeStr.e... | /**
* Builds a string describing a list of bells
* @param list a list of <bell> {@link Element}s
* @return the completed string e.g. "bells at 01:00, 06:00, 07:00"
*/ | Builds a string describing a list of bells | buildBellsString | {
"repo_name": "czlee/debatekeeper-old",
"path": "src/net/czlee/debatekeeper/debateformat/DebateFormatInfoForSchema2.java",
"license": "gpl-3.0",
"size": 14107
} | [
"net.czlee.debatekeeper.debateformat.XmlUtilities",
"org.w3c.dom.Element",
"org.w3c.dom.NodeList"
] | import net.czlee.debatekeeper.debateformat.XmlUtilities; import org.w3c.dom.Element; import org.w3c.dom.NodeList; | import net.czlee.debatekeeper.debateformat.*; import org.w3c.dom.*; | [
"net.czlee.debatekeeper",
"org.w3c.dom"
] | net.czlee.debatekeeper; org.w3c.dom; | 7,959 |
public static String getModulePath( HttpServletRequest request )
{
return getModulePathForRelativeURI( InternalUtils.getDecodedServletPath( request ) );
} | static String function( HttpServletRequest request ) { return getModulePathForRelativeURI( InternalUtils.getDecodedServletPath( request ) ); } | /**
* Get the Struts module path for the current request URI. This is the parent directory,
* relative to the web application root, of the file referenced by the request URI.
*
* @param request the current HttpServletRequest.
*/ | Get the Struts module path for the current request URI. This is the parent directory, relative to the web application root, of the file referenced by the request URI | getModulePath | {
"repo_name": "moparisthebest/beehive",
"path": "beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java",
"license": "apache-2.0",
"size": 80113
} | [
"javax.servlet.http.HttpServletRequest",
"org.apache.beehive.netui.pageflow.internal.InternalUtils"
] | import javax.servlet.http.HttpServletRequest; import org.apache.beehive.netui.pageflow.internal.InternalUtils; | import javax.servlet.http.*; import org.apache.beehive.netui.pageflow.internal.*; | [
"javax.servlet",
"org.apache.beehive"
] | javax.servlet; org.apache.beehive; | 1,122,103 |
private static PathFragment trimTail(PathFragment path, PathFragment tail) {
return path.subFragment(0, path.segmentCount() - tail.segmentCount());
} | static PathFragment function(PathFragment path, PathFragment tail) { return path.subFragment(0, path.segmentCount() - tail.segmentCount()); } | /**
* Returns the root-part of a given path by trimming off the end specified by
* a given tail. Assumes that the tail is known to match, and simply relies on
* the segment lengths.
*/ | Returns the root-part of a given path by trimming off the end specified by a given tail. Assumes that the tail is known to match, and simply relies on the segment lengths | trimTail | {
"repo_name": "variac/bazel",
"path": "src/main/java/com/google/devtools/build/lib/actions/Artifact.java",
"license": "apache-2.0",
"size": 34252
} | [
"com.google.devtools.build.lib.vfs.PathFragment"
] | import com.google.devtools.build.lib.vfs.PathFragment; | import com.google.devtools.build.lib.vfs.*; | [
"com.google.devtools"
] | com.google.devtools; | 2,600,835 |
@SuppressWarnings("unchecked")
public static <E> E[] newArray(Class<E> elementType, int length) {
E[] array = (E[])Array.newInstance(elementType, length);
try {
for (int index = 0; index < length; ++index)
array[index] = elementType.getConstructor().newInstance();
... | @SuppressWarnings(STR) static <E> E[] function(Class<E> elementType, int length) { E[] array = (E[])Array.newInstance(elementType, length); try { for (int index = 0; index < length; ++index) array[index] = elementType.getConstructor().newInstance(); } catch (RuntimeException e) {throw e;} catch (Exception e) {throw new... | /**
* Returns a new array of <b>elementType</b>.<br>
*
* Store a new object of <b>elementType</b> for all of the elements of the array.
*
* @param <E> the type of the element of the array
* @param elementType the type of the element of the array
* @param length the length of the array... | Returns a new array of elementType. Store a new object of elementType for all of the elements of the array | newArray | {
"repo_name": "MasatoKokubo/Lightsleep",
"path": "src/main/java/org/lightsleep/helper/Utils.java",
"license": "mit",
"size": 23971
} | [
"java.lang.reflect.Array"
] | import java.lang.reflect.Array; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 2,197,996 |
public static WriteOption resource(MonitoredResource resource) {
return new WriteOption(OptionType.RESOURCE, resource);
} | static WriteOption function(MonitoredResource resource) { return new WriteOption(OptionType.RESOURCE, resource); } | /**
* Returns an option to specify a default monitored resource (see {@link
* LogEntry#getResource()}) for those log entries that do not specify their own resource.
*/ | Returns an option to specify a default monitored resource (see <code>LogEntry#getResource()</code>) for those log entries that do not specify their own resource | resource | {
"repo_name": "googleapis/java-logging",
"path": "google-cloud-logging/src/main/java/com/google/cloud/logging/Logging.java",
"license": "apache-2.0",
"size": 44547
} | [
"com.google.cloud.MonitoredResource"
] | import com.google.cloud.MonitoredResource; | import com.google.cloud.*; | [
"com.google.cloud"
] | com.google.cloud; | 2,605,406 |
@WebMethod
@WebResult(name = "rval", targetNamespace = "https://www.google.com/apis/ads/publisher/v201311")
@RequestWrapper(localName = "updateRateCardCustomizations", targetNamespace = "https://www.google.com/apis/ads/publisher/v201311", className = "com.google.api.ads.dfp.jaxws.v201311.RateCardCustomizati... | @WebResult(name = "rval", targetNamespace = STRupdateRateCardCustomizationsSTRhttps: @ResponseWrapper(localName = "updateRateCardCustomizationsResponseSTRhttps: List<RateCardCustomization> function( @WebParam(name = "rateCardCustomizationsSTRhttps: List<RateCardCustomization> rateCardCustomizations) throws ApiException... | /**
*
* Updates the specified {@link RateCardCustomization} objects.
*
* @param rateCardCustomizations the rate card customizations to be updated
* @return the updated rate card customizations
*
*
* @param rateCardCustomizations
* @r... | Updates the specified <code>RateCardCustomization</code> objects | updateRateCardCustomizations | {
"repo_name": "nafae/developer",
"path": "modules/dfp_appengine/src/main/java/com/google/api/ads/dfp/jaxws/v201311/RateCardCustomizationServiceInterface.java",
"license": "apache-2.0",
"size": 12066
} | [
"java.util.List",
"javax.jws.WebParam",
"javax.jws.WebResult",
"javax.xml.ws.ResponseWrapper"
] | import java.util.List; import javax.jws.WebParam; import javax.jws.WebResult; import javax.xml.ws.ResponseWrapper; | import java.util.*; import javax.jws.*; import javax.xml.ws.*; | [
"java.util",
"javax.jws",
"javax.xml"
] | java.util; javax.jws; javax.xml; | 1,207,861 |
List<HistoryDto> makeHistoryDtos(); | List<HistoryDto> makeHistoryDtos(); | /**
* Make history dtos.
*
* @return the list
*/ | Make history dtos | makeHistoryDtos | {
"repo_name": "OBHITA/Consent2Share",
"path": "DS4P/consent2share/service/src/main/java/gov/samhsa/consent2share/service/audit/AuditService.java",
"license": "bsd-3-clause",
"size": 3904
} | [
"gov.samhsa.consent2share.service.dto.HistoryDto",
"java.util.List"
] | import gov.samhsa.consent2share.service.dto.HistoryDto; import java.util.List; | import gov.samhsa.consent2share.service.dto.*; import java.util.*; | [
"gov.samhsa.consent2share",
"java.util"
] | gov.samhsa.consent2share; java.util; | 1,104,272 |
protected void validateCustomPageProperties(Properties customProperties) throws IOException {
// Default validation rules
if (customProperties != null && !customProperties.isEmpty()) {
if (customProperties.size()>MAX_PROPLIMIT) {
throw new IOException("Too many custom properties. You are addi... | void function(Properties customProperties) throws IOException { if (customProperties != null && !customProperties.isEmpty()) { if (customProperties.size()>MAX_PROPLIMIT) { throw new IOException(STR+customProperties.size()+STR+MAX_PROPLIMIT); } Enumeration propertyNames = customProperties.propertyNames(); while (propert... | /**
* Default validation, validates that key and value is ASCII <code>StringUtils.isAsciiPrintable()</code> and within lengths set up in jspwiki-custom.properties.
* This can be overwritten by custom FileSystemProviders to validate additional properties
* See https://issues.apache.org/jira/browse/JSPWIKI... | Default validation, validates that key and value is ASCII <code>StringUtils.isAsciiPrintable()</code> and within lengths set up in jspwiki-custom.properties. This can be overwritten by custom FileSystemProviders to validate additional properties See HREF | validateCustomPageProperties | {
"repo_name": "tateshitah/jspwiki",
"path": "jspwiki-war/src/main/java/org/apache/wiki/providers/AbstractFileProvider.java",
"license": "apache-2.0",
"size": 20851
} | [
"java.io.FilenameFilter",
"java.io.IOException",
"java.util.Enumeration",
"java.util.Properties",
"org.apache.commons.lang.StringUtils"
] | import java.io.FilenameFilter; import java.io.IOException; import java.util.Enumeration; import java.util.Properties; import org.apache.commons.lang.StringUtils; | import java.io.*; import java.util.*; import org.apache.commons.lang.*; | [
"java.io",
"java.util",
"org.apache.commons"
] | java.io; java.util; org.apache.commons; | 2,788,889 |
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jScrollPane2 = new javax.swing.JScrollPane();
jTableStorage = new javax.swing.JTable();
jScrollPane1 = new javax.swing.JScrollPane... | @SuppressWarnings(STR) void function() { jScrollPane2 = new javax.swing.JScrollPane(); jTableStorage = new javax.swing.JTable(); jScrollPane1 = new javax.swing.JScrollPane(); jTableQueue = new javax.swing.JTable(); jScrollPane3 = new javax.swing.JScrollPane(); jListLog = new javax.swing.JList(); setTitle(STR); jTableSt... | /** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/ | This method is called from within the constructor to initialize the form. always regenerated by the Form Editor | initComponents | {
"repo_name": "mru00/jade_agents",
"path": "src/coop/StorageAgentGUI.java",
"license": "lgpl-2.1",
"size": 6710
} | [
"javax.swing.table.DefaultTableModel"
] | import javax.swing.table.DefaultTableModel; | import javax.swing.table.*; | [
"javax.swing"
] | javax.swing; | 2,759,799 |
// [TARGET getDataset(String, DatasetOption...)]
// [VARIABLE "my_dataset"]
public Dataset getDataset(String datasetName) {
// [START getDataset]
Dataset dataset = bigquery.getDataset(datasetName);
// [END getDataset]
return dataset;
} | Dataset function(String datasetName) { Dataset dataset = bigquery.getDataset(datasetName); return dataset; } | /**
* Example of getting a dataset.
*/ | Example of getting a dataset | getDataset | {
"repo_name": "mbrukman/gcloud-java",
"path": "google-cloud-examples/src/main/java/com/google/cloud/examples/bigquery/snippets/BigQuerySnippets.java",
"license": "apache-2.0",
"size": 21428
} | [
"com.google.cloud.bigquery.Dataset"
] | import com.google.cloud.bigquery.Dataset; | import com.google.cloud.bigquery.*; | [
"com.google.cloud"
] | com.google.cloud; | 2,204,341 |
boolean checkPermission(Credentials cred); | boolean checkPermission(Credentials cred); | /**
* Checks that client has the specified permission.
* @param cred
*
* @return true if it has, throw {@link SecurityException} otherwise with specified error message
*/ | Checks that client has the specified permission | checkPermission | {
"repo_name": "laurianed/scheduling",
"path": "common/common-client/src/main/java/org/ow2/proactive/jmx/PermissionChecker.java",
"license": "agpl-3.0",
"size": 1405
} | [
"org.ow2.proactive.authentication.crypto.Credentials"
] | import org.ow2.proactive.authentication.crypto.Credentials; | import org.ow2.proactive.authentication.crypto.*; | [
"org.ow2.proactive"
] | org.ow2.proactive; | 2,835,611 |
ApplicationContext context = new ClassPathXmlApplicationContext("classpath:kafka/context-data-producer.xml");
MessageSender messageSender = (MessageSender) context.getBean("messageSender");
ReactorRef ref = ReactorRef.create(Digger.class);
ref.setMessageSender(messageSender);
System.out.println("ref cr... | ApplicationContext context = new ClassPathXmlApplicationContext(STR); MessageSender messageSender = (MessageSender) context.getBean(STR); ReactorRef ref = ReactorRef.create(Digger.class); ref.setMessageSender(messageSender); System.out.println(STR + ref.getId() +"," + ref); for (int i = 0; i < 3 ; i++) { String msg = "... | /**
* Reactor produce demo.
* Create prototype(multiple instances) reactor and send message to them.
* @param args
*/ | Reactor produce demo. Create prototype(multiple instances) reactor and send message to them | main | {
"repo_name": "KoperGroup/koper",
"path": "koper-reactor/src/test/java/koper/reactor/demo/ProducerApp.java",
"license": "apache-2.0",
"size": 2095
} | [
"org.springframework.context.ApplicationContext",
"org.springframework.context.support.ClassPathXmlApplicationContext"
] | import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; | import org.springframework.context.*; import org.springframework.context.support.*; | [
"org.springframework.context"
] | org.springframework.context; | 745,393 |
@MethodSubstitution(value = "decryptBlock", isStatic = false)
static void decryptBlockWithOriginalKey(Object rcvr, byte[] in, int inOffset, byte[] out, int outOffset) {
crypt(rcvr, in, inOffset, out, outOffset, false, true);
} | @MethodSubstitution(value = STR, isStatic = false) static void decryptBlockWithOriginalKey(Object rcvr, byte[] in, int inOffset, byte[] out, int outOffset) { crypt(rcvr, in, inOffset, out, outOffset, false, true); } | /**
* Variation for platforms (e.g. SPARC) that need do key expansion in stubs due to compatibility
* issues between Java key expansion and hardware crypto instructions.
*/ | Variation for platforms (e.g. SPARC) that need do key expansion in stubs due to compatibility issues between Java key expansion and hardware crypto instructions | decryptBlockWithOriginalKey | {
"repo_name": "YouDiSN/OpenJDK-Research",
"path": "jdk9/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AESCryptSubstitutions.java",
"license": "gpl-2.0",
"size": 7837
} | [
"org.graalvm.compiler.api.replacements.MethodSubstitution"
] | import org.graalvm.compiler.api.replacements.MethodSubstitution; | import org.graalvm.compiler.api.replacements.*; | [
"org.graalvm.compiler"
] | org.graalvm.compiler; | 2,036,493 |
public MDCAdapter getMDCA() {
// note that this method is invoked only from within the static initializer of
// the org.slf4j.MDC class.
return new BasicMDCAdapter();
} | MDCAdapter function() { return new BasicMDCAdapter(); } | /**
* Currently this method always returns an instance of
* {@link BasicMDCAdapter}.
*/ | Currently this method always returns an instance of <code>BasicMDCAdapter</code> | getMDCA | {
"repo_name": "FranckW/projet1_opl",
"path": "server/lib/slf4j-1.7.21/slf4j-jdk14/src/main/java/org/slf4j/impl/StaticMDCBinder.java",
"license": "mit",
"size": 2245
} | [
"org.slf4j.helpers.BasicMDCAdapter",
"org.slf4j.spi.MDCAdapter"
] | import org.slf4j.helpers.BasicMDCAdapter; import org.slf4j.spi.MDCAdapter; | import org.slf4j.helpers.*; import org.slf4j.spi.*; | [
"org.slf4j.helpers",
"org.slf4j.spi"
] | org.slf4j.helpers; org.slf4j.spi; | 1,739,887 |
public static void join (StringBuilder builder, String sep, Collection<?> values)
{
boolean first = true;
for (Object o : values)
{
if (first)
first = false;
else
builder.append (sep);
builder.append ("" + o);
}
} | static void function (StringBuilder builder, String sep, Collection<?> values) { boolean first = true; for (Object o : values) { if (first) first = false; else builder.append (sep); builder.append ("" + o); } } | /**
* Join collection into and append to a StringBuilder, with a separator between.
* Useful if you want to join strings and append to an existing StringBuilder.
* @param builder StringBuilder you want to append to. This variable will be modified.
* @param sep Separator between strings
* @param values collect... | Join collection into and append to a StringBuilder, with a separator between. Useful if you want to join strings and append to an existing StringBuilder | join | {
"repo_name": "christopher-johnson/cyto-rdf",
"path": "helixsoft-commons/nl.helixsoft.util/src/nl/helixsoft/util/StringUtils.java",
"license": "gpl-2.0",
"size": 17559
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 81,060 |
private static int skipPatternWhiteSpace(String text, int pos) {
while (pos < text.length()) {
int c = UTF16.charAt(text, pos);
if (!PatternProps.isWhiteSpace(c)) {
break;
}
pos += UTF16.getCharCount(c);
}
return pos;
} | static int function(String text, int pos) { while (pos < text.length()) { int c = UTF16.charAt(text, pos); if (!PatternProps.isWhiteSpace(c)) { break; } pos += UTF16.getCharCount(c); } return pos; } | /**
* Skips over a run of zero or more Pattern_White_Space characters at pos in text.
*/ | Skips over a run of zero or more Pattern_White_Space characters at pos in text | skipPatternWhiteSpace | {
"repo_name": "google/j2objc",
"path": "jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DecimalFormat.java",
"license": "apache-2.0",
"size": 264947
} | [
"android.icu.impl.PatternProps"
] | import android.icu.impl.PatternProps; | import android.icu.impl.*; | [
"android.icu"
] | android.icu; | 977,907 |
public static ObservableList<CssParser.ParseError> getErrors() {
return errors;
}
////////////////////////////////////////////////////////////////////////////
//
// Classes and routines for mapping styles to a Node
//
/////////////////////////////////////////////////////////////////... | static ObservableList<CssParser.ParseError> function() { return errors; } private static List<String> cacheMapKey; static class CacheContainer { | /**
* Errors that may have occurred during css processing.
* This list is null until errorsProperty() is called and is used
* internally to figure out whether or not anyone is interested in
* receiving CssError.
* Not meant for general use - call errorsProperty() instead.
* @return
*... | Errors that may have occurred during css processing. This list is null until errorsProperty() is called and is used internally to figure out whether or not anyone is interested in receiving CssError. Not meant for general use - call errorsProperty() instead | getErrors | {
"repo_name": "teamfx/openjfx-9-dev-rt",
"path": "modules/javafx.graphics/src/main/java/com/sun/javafx/css/StyleManager.java",
"license": "gpl-2.0",
"size": 90363
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,261,924 |
public ResourceMetadataModel loadResourceMetadata(Integer resourceId);
| ResourceMetadataModel function(Integer resourceId); | /**
* Load a ResourceMetadataModel based on the resourceId.
*
* @param resourceId
* @return
*/ | Load a ResourceMetadataModel based on the resourceId | loadResourceMetadata | {
"repo_name": "Canadensys/canadensys-explorer",
"path": "src/main/java/net/canadensys/dataportal/occurrence/OccurrenceService.java",
"license": "mit",
"size": 1890
} | [
"net.canadensys.dataportal.occurrence.model.ResourceMetadataModel"
] | import net.canadensys.dataportal.occurrence.model.ResourceMetadataModel; | import net.canadensys.dataportal.occurrence.model.*; | [
"net.canadensys.dataportal"
] | net.canadensys.dataportal; | 1,109,856 |
@Override
protected void validateAndSet (Options options,
String option, Object value)
throws IllegalConfigOptionException
{
if (option.equals ("router.coalesce-delay"))
{
if (value.equals (0))
value = 1;
else if (value.equals (1))
... | void function (Options options, String option, Object value) throws IllegalConfigOptionException { if (option.equals (STR)) { if (value.equals (0)) value = 1; else if (value.equals (1)) value = 0; } option = legacyToNew (option); if (validate (option, value) == null) set (options, option, value); } | /**
* Override validation to add legacy support and to simply not
* include invalid options rather than explode violently. Also
* removes auto value conversion.
*/ | Override validation to add legacy support and to simply not include invalid options rather than explode violently. Also removes auto value conversion | validateAndSet | {
"repo_name": "luv/avis_zmqprx",
"path": "server/src/main/org/avis/router/ClientConnectionOptionSet.java",
"license": "gpl-3.0",
"size": 3711
} | [
"org.avis.config.Options",
"org.avis.util.IllegalConfigOptionException"
] | import org.avis.config.Options; import org.avis.util.IllegalConfigOptionException; | import org.avis.config.*; import org.avis.util.*; | [
"org.avis.config",
"org.avis.util"
] | org.avis.config; org.avis.util; | 2,836,154 |
public Map<String, Object> getSourceAsMap() throws ElasticsearchParseException {
return getResult.sourceAsMap();
} | Map<String, Object> function() throws ElasticsearchParseException { return getResult.sourceAsMap(); } | /**
* The source of the document (As a map).
*/ | The source of the document (As a map) | getSourceAsMap | {
"repo_name": "GlenRSmith/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/action/get/GetResponse.java",
"license": "apache-2.0",
"size": 6553
} | [
"java.util.Map",
"org.elasticsearch.ElasticsearchParseException"
] | import java.util.Map; import org.elasticsearch.ElasticsearchParseException; | import java.util.*; import org.elasticsearch.*; | [
"java.util",
"org.elasticsearch"
] | java.util; org.elasticsearch; | 1,686,019 |
try {
transactionRecord.loadTransactions();
transactionRecord.close();
generateInvoice();
System.out.println("INVOICE PRINTED:");
System.out.print(Invoice);
logInvoice();
} catch (IOException e) {
System.err.println("**** " + e)... | try { transactionRecord.loadTransactions(); transactionRecord.close(); generateInvoice(); System.out.println(STR); System.out.print(Invoice); logInvoice(); } catch (IOException e) { System.err.println(STR + e); } } | /**
* Load transactions and print an invoice
*/ | Load transactions and print an invoice | manage | {
"repo_name": "code-potato/POST",
"path": "POST_Beta/src/post/Manager.java",
"license": "gpl-2.0",
"size": 5548
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,479,287 |
public static String toAddressString(InetAddress ip) {
return toAddressString(ip, false);
} | static String function(InetAddress ip) { return toAddressString(ip, false); } | /**
* Returns the {@link String} representation of an {@link InetAddress}.
* <ul>
* <li>Inet4Address results are identical to {@link InetAddress#getHostAddress()}</li>
* <li>Inet6Address results adhere to
* <a href="http://tools.ietf.org/html/rfc5952#section-4">rfc 5952 section 4</a></li>
... | Returns the <code>String</code> representation of an <code>InetAddress</code>. Inet4Address results are identical to <code>InetAddress#getHostAddress()</code> Inet6Address results adhere to rfc 5952 section 4 The output does not include Scope ID | toAddressString | {
"repo_name": "blucas/netty",
"path": "common/src/main/java/io/netty/util/NetUtil.java",
"license": "apache-2.0",
"size": 46158
} | [
"java.net.InetAddress"
] | import java.net.InetAddress; | import java.net.*; | [
"java.net"
] | java.net; | 608,817 |
Map<String, Cookie> getResponseCookiesInternal() {
return responseCookies;
} | Map<String, Cookie> getResponseCookiesInternal() { return responseCookies; } | /**
* For internal use only
*
* @return The response cookies, or null if they have not been set yet
*/ | For internal use only | getResponseCookiesInternal | {
"repo_name": "biddyweb/undertow",
"path": "core/src/main/java/io/undertow/server/HttpServerExchange.java",
"license": "apache-2.0",
"size": 81449
} | [
"io.undertow.server.handlers.Cookie",
"java.util.Map"
] | import io.undertow.server.handlers.Cookie; import java.util.Map; | import io.undertow.server.handlers.*; import java.util.*; | [
"io.undertow.server",
"java.util"
] | io.undertow.server; java.util; | 2,726,982 |
public List<Field> getFieldWhere(int tag, char subfield, String equalsThis) {
List<Field> ret = new ArrayList<Field>();
int sz = fields.size() - 1;
for (int idx = 0; idx <= sz; idx++) {
Field f = fields.get(idx);
if (f.getTag() == tag) {
for (String va... | List<Field> function(int tag, char subfield, String equalsThis) { List<Field> ret = new ArrayList<Field>(); int sz = fields.size() - 1; for (int idx = 0; idx <= sz; idx++) { Field f = fields.get(idx); if (f.getTag() == tag) { for (String value : f.getSubfieldValues(subfield)) { if (value.equals(equalsThis)) { ret.add(f... | /**
* gets all occurrences of a field in the record that has a value in a subfield.
*
* @param tag the field tag
* @param subfield the subfield code
* @param equalsThis the value to compare to
* @return all occurrences of a field in the record, or an empty List
*/ | gets all occurrences of a field in the record that has a value in a subfield | getFieldWhere | {
"repo_name": "repoxIST/repoxLight",
"path": "repox-core/src/main/java/pt/utl/ist/marc/Record.java",
"license": "gpl-3.0",
"size": 25425
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,323,266 |
public final ListTasksResponse updateByQueryRethrottle(RethrottleRequest rethrottleRequest, RequestOptions options) throws IOException {
return performRequestAndParseEntity(rethrottleRequest, RequestConverters::rethrottleUpdateByQuery, options,
ListTasksResponse::fromXContent, emptySet());
... | final ListTasksResponse function(RethrottleRequest rethrottleRequest, RequestOptions options) throws IOException { return performRequestAndParseEntity(rethrottleRequest, RequestConverters::rethrottleUpdateByQuery, options, ListTasksResponse::fromXContent, emptySet()); } | /**
* Executes a update by query rethrottle request.
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html">
* Update By Query API on elastic.co</a>
* @param rethrottleRequest the request
* @param options the request options (e.g. headers),... | Executes a update by query rethrottle request. See Update By Query API on elastic.co | updateByQueryRethrottle | {
"repo_name": "robin13/elasticsearch",
"path": "client/rest-high-level/src/main/java/org/elasticsearch/client/RestHighLevelClient.java",
"license": "apache-2.0",
"size": 121051
} | [
"java.io.IOException",
"java.util.Collections",
"org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse"
] | import java.io.IOException; import java.util.Collections; import org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse; | import java.io.*; import java.util.*; import org.elasticsearch.action.admin.cluster.node.tasks.list.*; | [
"java.io",
"java.util",
"org.elasticsearch.action"
] | java.io; java.util; org.elasticsearch.action; | 80,419 |
public Iterator<ModInteger> iterator() {
return new ModIntegerIterator(this);
}
}
class ModIntegerIterator implements Iterator<ModInteger> {
java.math.BigInteger curr;
final ModIntegerRing ring;
public ModIntegerIterator(ModIntegerRing fac) {
curr = java.math.BigI... | Iterator<ModInteger> function() { return new ModIntegerIterator(this); } } class ModIntegerIterator implements Iterator<ModInteger> { java.math.BigInteger curr; final ModIntegerRing ring; public ModIntegerIterator(ModIntegerRing fac) { curr = java.math.BigInteger.ZERO; ring = fac; } | /**
* Get a ModInteger iterator.
*
* @return a iterator over all modular integers in this ring.
*/ | Get a ModInteger iterator | iterator | {
"repo_name": "redberry-cas/core",
"path": "src/main/java/cc/redberry/core/transformations/factor/jasfactor/edu/jas/arith/ModIntegerRing.java",
"license": "gpl-2.0",
"size": 9217
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 2,244,810 |
private TrustManager getVeryTrustingTrustManager() {
return new X509TrustManager() { | TrustManager function() { return new X509TrustManager() { | /**
* Create a trust manager which is not too concerned about validating
* certificates.
*
* @return a trusting trust manager
*/ | Create a trust manager which is not too concerned about validating certificates | getVeryTrustingTrustManager | {
"repo_name": "watou/openhab",
"path": "bundles/io/org.openhab.io.transport.mqtt/src/main/java/org/openhab/io/transport/mqtt/internal/MqttBrokerConnection.java",
"license": "epl-1.0",
"size": 20258
} | [
"javax.net.ssl.TrustManager",
"javax.net.ssl.X509TrustManager"
] | import javax.net.ssl.TrustManager; import javax.net.ssl.X509TrustManager; | import javax.net.ssl.*; | [
"javax.net"
] | javax.net; | 2,737,349 |
public static String getFileName(String ID) {
if (File.separatorChar == '/') {
return ID;
}
return ID.replace('/', File.separatorChar);
} | static String function(String ID) { if (File.separatorChar == '/') { return ID; } return ID.replace('/', File.separatorChar); } | /**
* Converts the given time zone ID to a platform dependent path
* name. For example, "America/Los_Angeles" is converted to
* "America\Los_Angeles" on Win32.
* @return a modified ID replacing '/' with {@link
* java.io.File#separatorChar File.separatorChar} if needed.
*/ | Converts the given time zone ID to a platform dependent path name. For example, "America/Los_Angeles" is converted to "America\Los_Angeles" on Win32 | getFileName | {
"repo_name": "TheTypoMaster/Scaper",
"path": "openjdk/jdk/src/share/classes/sun/util/calendar/ZoneInfoFile.java",
"license": "gpl-2.0",
"size": 35574
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 1,862,189 |
@Nullable
public static Boolean extractHook(IHopper dest)
{
Pair<IItemHandler, Object> itemHandlerResult = getItemHandler(dest, EnumFacing.UP);
if (itemHandlerResult == null)
return null;
IItemHandler handler = itemHandlerResult.getKey();
for (int i = 0; i < han... | static Boolean function(IHopper dest) { Pair<IItemHandler, Object> itemHandlerResult = getItemHandler(dest, EnumFacing.UP); if (itemHandlerResult == null) return null; IItemHandler handler = itemHandlerResult.getKey(); for (int i = 0; i < handler.getSlots(); i++) { ItemStack extractItem = handler.extractItem(i, 1, true... | /**
* Copied from TileEntityHopper#captureDroppedItems and added capability support
* @return Null if we did nothing {no IItemHandler}, True if we moved an item, False if we moved no items
*/ | Copied from TileEntityHopper#captureDroppedItems and added capability support | extractHook | {
"repo_name": "Severed-Infinity/technium",
"path": "build/tmp/recompileMc/sources/net/minecraftforge/items/VanillaInventoryCodeHooks.java",
"license": "gpl-3.0",
"size": 10468
} | [
"net.minecraft.item.ItemStack",
"net.minecraft.tileentity.IHopper",
"net.minecraft.util.EnumFacing",
"org.apache.commons.lang3.tuple.Pair"
] | import net.minecraft.item.ItemStack; import net.minecraft.tileentity.IHopper; import net.minecraft.util.EnumFacing; import org.apache.commons.lang3.tuple.Pair; | import net.minecraft.item.*; import net.minecraft.tileentity.*; import net.minecraft.util.*; import org.apache.commons.lang3.tuple.*; | [
"net.minecraft.item",
"net.minecraft.tileentity",
"net.minecraft.util",
"org.apache.commons"
] | net.minecraft.item; net.minecraft.tileentity; net.minecraft.util; org.apache.commons; | 1,473,656 |
private static Class<?> getRawType(final ParameterizedType parameterizedType) {
final Type rawType = parameterizedType.getRawType();
// check if raw type is a Class object
// not currently necessary, but since the return type is Type instead of
// Class, there's enough reason to bel... | static Class<?> function(final ParameterizedType parameterizedType) { final Type rawType = parameterizedType.getRawType(); if (!(rawType instanceof Class<?>)) { throw new IllegalStateException(STR + rawType); } return (Class<?>) rawType; } | /**
* <p>Transforms the passed in type to a {@link Class} object. Type-checking method of convenience.</p>
*
* @param parameterizedType the type to be converted
* @return the corresponding {@code Class} object
* @throws IllegalStateException if the conversion fails
*/ | Transforms the passed in type to a <code>Class</code> object. Type-checking method of convenience | getRawType | {
"repo_name": "rikles/commons-lang",
"path": "src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java",
"license": "apache-2.0",
"size": 70048
} | [
"java.lang.reflect.ParameterizedType",
"java.lang.reflect.Type"
] | import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 2,126,470 |
public static Path getTempAppendDir(String tableName) {
String timeId = DATE_FORM.format(new Date(System.currentTimeMillis()));
String tempDir = TEMP_IMPORT_ROOT + Path.SEPARATOR + timeId + tableName;
return new Path(tempDir);
} | static Path function(String tableName) { String timeId = DATE_FORM.format(new Date(System.currentTimeMillis())); String tempDir = TEMP_IMPORT_ROOT + Path.SEPARATOR + timeId + tableName; return new Path(tempDir); } | /**
* Creates a unique path object inside the sqoop temporary directory.
*
* @param tableName
* @return a path pointing to the temporary directory
*/ | Creates a unique path object inside the sqoop temporary directory | getTempAppendDir | {
"repo_name": "cloudbow/sqoop-couchbase-pass-fix",
"path": "src/java/org/apache/sqoop/util/AppendUtils.java",
"license": "apache-2.0",
"size": 9432
} | [
"java.util.Date",
"org.apache.hadoop.fs.Path"
] | import java.util.Date; import org.apache.hadoop.fs.Path; | import java.util.*; import org.apache.hadoop.fs.*; | [
"java.util",
"org.apache.hadoop"
] | java.util; org.apache.hadoop; | 1,984,862 |
public JSONObject handleListConfigs(MapReduceXml xml) {
JSONObject retValue = new JSONObject();
JSONArray configArray = new JSONArray();
Set<String> names = xml.getConfigurationNames();
for (String name : names) {
String configXml = xml.getTemplateAsXmlString(name);
ConfigurationTemplatePr... | JSONObject function(MapReduceXml xml) { JSONObject retValue = new JSONObject(); JSONArray configArray = new JSONArray(); Set<String> names = xml.getConfigurationNames(); for (String name : names) { String configXml = xml.getTemplateAsXmlString(name); ConfigurationTemplatePreprocessor preprocessor = new ConfigurationTem... | /**
* Handle the list_configs AJAX command.
*/ | Handle the list_configs AJAX command | handleListConfigs | {
"repo_name": "bradseefeld/AppEngine-MapReduce",
"path": "src/com/google/appengine/tools/mapreduce/MapReduceServlet.java",
"license": "apache-2.0",
"size": 40228
} | [
"java.util.Set",
"org.json.JSONArray",
"org.json.JSONException",
"org.json.JSONObject"
] | import java.util.Set; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; | import java.util.*; import org.json.*; | [
"java.util",
"org.json"
] | java.util; org.json; | 232,848 |
@Exported
public String getUrl() {
// first look for the manifest entry. This is new in maven-hpi-plugin 1.30
String url = manifest.getMainAttributes().getValue("Url");
if(url!=null) return url;
// fallback to update center metadata
UpdateSite.Plugin ui = getInfo();... | String function() { String url = manifest.getMainAttributes().getValue("Url"); if(url!=null) return url; UpdateSite.Plugin ui = getInfo(); if(ui!=null) return ui.wiki; return null; } | /**
* Gets the URL that shows more information about this plugin.
* @return
* null if this information is unavailable.
* @since 1.283
*/ | Gets the URL that shows more information about this plugin | getUrl | {
"repo_name": "jpbriend/jenkins",
"path": "core/src/main/java/hudson/PluginWrapper.java",
"license": "mit",
"size": 28184
} | [
"hudson.model.UpdateSite"
] | import hudson.model.UpdateSite; | import hudson.model.*; | [
"hudson.model"
] | hudson.model; | 2,868,668 |
private void toggleBottomSheetVisibility(boolean collapse, boolean animate) {
if (!mediaManager.getQueueReloading() && mediaManager.getQueue().isEmpty()) {
multiSheetView.hide(collapse, false);
} else if (MiniPlayerLockManager.getInstance().canShowMiniPlayer()) {
multiSheetVi... | void function(boolean collapse, boolean animate) { if (!mediaManager.getQueueReloading() && mediaManager.getQueue().isEmpty()) { multiSheetView.hide(collapse, false); } else if (MiniPlayerLockManager.getInstance().canShowMiniPlayer()) { multiSheetView.unhide(animate); } } | /**
* Hide/show the bottom sheet, depending on whether the queue is empty.
*/ | Hide/show the bottom sheet, depending on whether the queue is empty | toggleBottomSheetVisibility | {
"repo_name": "timusus/Shuttle",
"path": "app/src/main/java/com/simplecity/amp_library/ui/screens/main/MainController.java",
"license": "gpl-3.0",
"size": 14610
} | [
"com.simplecity.amp_library.ui.screens.drawer.MiniPlayerLockManager"
] | import com.simplecity.amp_library.ui.screens.drawer.MiniPlayerLockManager; | import com.simplecity.amp_library.ui.screens.drawer.*; | [
"com.simplecity.amp_library"
] | com.simplecity.amp_library; | 1,698,801 |
@Override
protected TestEnvironment createTestEnvironment
(TestParameters Param, PrintWriter log) {
XInterface oObj = null;
Object oInterface = null ;
//now get the OButtonControl
try {
oInterface = Param.getMSF().createInstance
("com.sun.... | TestEnvironment function (TestParameters Param, PrintWriter log) { XInterface oObj = null; Object oInterface = null ; try { oInterface = Param.getMSF().createInstance (STR) ; } catch (com.sun.star.uno.Exception e) { log.println(STR); e.printStackTrace(log); throw new StatusException(STR, e ); } if (oInterface == null) ... | /**
* Creating a Testenvironment for the interfaces to be tested.
* Creates an instance of the service
* <code>com.sun.star.comp.framework.PathSettings</code>.
*/ | Creating a Testenvironment for the interfaces to be tested. Creates an instance of the service <code>com.sun.star.comp.framework.PathSettings</code> | createTestEnvironment | {
"repo_name": "Limezero/libreoffice",
"path": "qadevOOo/tests/java/mod/_fwl/PathSettings.java",
"license": "gpl-3.0",
"size": 5248
} | [
"com.sun.star.uno.XInterface",
"java.io.PrintWriter",
"java.util.HashSet",
"java.util.Set"
] | import com.sun.star.uno.XInterface; import java.io.PrintWriter; import java.util.HashSet; import java.util.Set; | import com.sun.star.uno.*; import java.io.*; import java.util.*; | [
"com.sun.star",
"java.io",
"java.util"
] | com.sun.star; java.io; java.util; | 2,870,402 |
@ServiceMethod(returns = ReturnType.SINGLE)
EndpointInner update(
String resourceGroupName,
String profileName,
String endpointType,
String endpointName,
EndpointInner parameters); | @ServiceMethod(returns = ReturnType.SINGLE) EndpointInner update( String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters); | /**
* Update a Traffic Manager endpoint.
*
* @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be updated.
* @param profileName The name of the Traffic Manager profile.
* @param endpointType The type of the Traffic Manager endpoint to be updated.... | Update a Traffic Manager endpoint | update | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-trafficmanager/src/main/java/com/azure/resourcemanager/trafficmanager/fluent/EndpointsClient.java",
"license": "mit",
"size": 17588
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.resourcemanager.trafficmanager.fluent.models.EndpointInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.trafficmanager.fluent.models.EndpointInner; | import com.azure.core.annotation.*; import com.azure.resourcemanager.trafficmanager.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 2,074,628 |
public static BigDecimal divide(BigDecimal left, Long right, MathContext mathContext) {
return divide(left, right == null ? null : BigDecimal.valueOf(right), mathContext);
} | static BigDecimal function(BigDecimal left, Long right, MathContext mathContext) { return divide(left, right == null ? null : BigDecimal.valueOf(right), mathContext); } | /**
* Calculates the quotient of {@code left} and {@code right}.
* @param left The dividend.
* @param right The divisor.
* @param mathContext The {@link MathContext} for the operation.
* @return The result of {@code left / right}.
*/ | Calculates the quotient of left and right | divide | {
"repo_name": "gmulders/abacus",
"path": "abacus-core/src/main/java/org/gertje/abacus/runtime/expression/ArithmeticOperation.java",
"license": "apache-2.0",
"size": 10892
} | [
"java.math.BigDecimal",
"java.math.MathContext"
] | import java.math.BigDecimal; import java.math.MathContext; | import java.math.*; | [
"java.math"
] | java.math; | 2,703,803 |
void send(PDU pdu)
throws IOException; | void send(PDU pdu) throws IOException; | /**
* Sends a PDU to the client.
* @param pdu the PDU to send
*/ | Sends a PDU to the client | send | {
"repo_name": "eSDK/esdk_sms",
"path": "source/esdk_sms_openapi_smpp_v34/src/main/java/com/huawei/esdk/tcp/base/ISession.java",
"license": "apache-2.0",
"size": 1700
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,133,386 |
@Test
public void testGetAccessTokenExtractor_1() throws Exception {
InstagramApi fixture = new InstagramApi();
AccessTokenExtractor result = fixture.getAccessTokenExtractor();
// add additional test code here
assertNotNull(result);
} | void function() throws Exception { InstagramApi fixture = new InstagramApi(); AccessTokenExtractor result = fixture.getAccessTokenExtractor(); assertNotNull(result); } | /**
* Run the AccessTokenExtractor getAccessTokenExtractor() method test.
*
* @throws Exception
*
*
*/ | Run the AccessTokenExtractor getAccessTokenExtractor() method test | testGetAccessTokenExtractor_1 | {
"repo_name": "zauberlabs/jInstagram",
"path": "src/test/java/org/jinstagram/auth/InstagramApiTest.java",
"license": "mit",
"size": 3505
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 72,991 |
public void registerRecyclerView(final RecyclerView recyclerView, final RecyclerView.OnScrollListener onScrollListener) {
if (recyclerView != null) {
scrollViewList.add(recyclerView); //add to the scrollable list
yOffsets.put(recyclerView, recyclerView.getScrollY()); //save the initi... | void function(final RecyclerView recyclerView, final RecyclerView.OnScrollListener onScrollListener) { if (recyclerView != null) { scrollViewList.add(recyclerView); yOffsets.put(recyclerView, recyclerView.getScrollY()); recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { boolean firstZeroPassed; | /**
* Register a RecyclerView to the current MaterialViewPagerAnimator
* Listen to RecyclerView.OnScrollListener so give to $[onScrollListener] your RecyclerView.OnScrollListener if you already use one
* For loadmore or anything else
*
* @param recyclerView the scrollable
* @param onSc... | Register a RecyclerView to the current MaterialViewPagerAnimator Listen to RecyclerView.OnScrollListener so give to $[onScrollListener] your RecyclerView.OnScrollListener if you already use one For loadmore or anything else | registerRecyclerView | {
"repo_name": "Endika/MaterialViewPager",
"path": "materialviewpager/src/main/java/com/github/florent37/materialviewpager/MaterialViewPagerAnimator.java",
"license": "apache-2.0",
"size": 25708
} | [
"android.support.v7.widget.RecyclerView"
] | import android.support.v7.widget.RecyclerView; | import android.support.v7.widget.*; | [
"android.support"
] | android.support; | 1,853,809 |
public List<GeneralLedgerPendingEntry> getPendingLedgerEntriesForSufficientFundsChecking(); | List<GeneralLedgerPendingEntry> function(); | /**
* This method will return only PLEs that should be checked for SF. Normally this will be all PLEs, but some docs (such as BA)
* have additional requirements.
*
* @return a list of sufficientfundsitems that do not have sufficient funds. It returns an empty list if there is sufficient
* funds... | This method will return only PLEs that should be checked for SF. Normally this will be all PLEs, but some docs (such as BA) have additional requirements | getPendingLedgerEntriesForSufficientFundsChecking | {
"repo_name": "quikkian-ua-devops/will-financials",
"path": "kfs-core/src/main/java/org/kuali/kfs/sys/document/GeneralLedgerPostingDocument.java",
"license": "agpl-3.0",
"size": 3138
} | [
"java.util.List",
"org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntry"
] | import java.util.List; import org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntry; | import java.util.*; import org.kuali.kfs.sys.businessobject.*; | [
"java.util",
"org.kuali.kfs"
] | java.util; org.kuali.kfs; | 1,978,585 |
public void setNotificationBackgroundColor(@ColorInt int color) {
this.notificationBackgroundColor = color;
updateNotifications(true, UPDATE_ALL_NOTIFICATIONS);
} | void function(@ColorInt int color) { this.notificationBackgroundColor = color; updateNotifications(true, UPDATE_ALL_NOTIFICATIONS); } | /**
* Set notification background color
*
* @param color int
*/ | Set notification background color | setNotificationBackgroundColor | {
"repo_name": "xyj222310/smarthome",
"path": "smartsocket2/app/src/main/java/com/xieyingjie/smartsocket/navigation/AHBottomNavigation.java",
"license": "apache-2.0",
"size": 42239
} | [
"android.support.annotation.ColorInt"
] | import android.support.annotation.ColorInt; | import android.support.annotation.*; | [
"android.support"
] | android.support; | 2,494,398 |
AsyncProcessorAwaitManager getAsyncProcessorAwaitManager(); | AsyncProcessorAwaitManager getAsyncProcessorAwaitManager(); | /**
* Gets the {@link org.apache.camel.AsyncProcessor} await manager.
*
* @return the manager
*/ | Gets the <code>org.apache.camel.AsyncProcessor</code> await manager | getAsyncProcessorAwaitManager | {
"repo_name": "lasombra/camel",
"path": "camel-core/src/main/java/org/apache/camel/CamelContext.java",
"license": "apache-2.0",
"size": 63018
} | [
"org.apache.camel.spi.AsyncProcessorAwaitManager"
] | import org.apache.camel.spi.AsyncProcessorAwaitManager; | import org.apache.camel.spi.*; | [
"org.apache.camel"
] | org.apache.camel; | 320,049 |
public void reverseContent() {
Collections.reverse(content);
} | void function() { Collections.reverse(content); } | /**
* Reverses the content linked list
*/ | Reverses the content linked list | reverseContent | {
"repo_name": "rokn/Count_Words_2015",
"path": "testing/drools-master/drools-compiler/src/main/java/org/drools/compiler/lang/DroolsSentence.java",
"license": "mit",
"size": 3296
} | [
"java.util.Collections"
] | import java.util.Collections; | import java.util.*; | [
"java.util"
] | java.util; | 1,270,990 |
public void registerAsHandler() {
MinecraftForge.EVENT_BUS.register(this);
} | void function() { MinecraftForge.EVENT_BUS.register(this); } | /**
* The enchantment should provide its own event handler. This method registers it with Minecraft Forge.
*/ | The enchantment should provide its own event handler. This method registers it with Minecraft Forge | registerAsHandler | {
"repo_name": "ZeroPointMC/GlobalTweaks",
"path": "zeropoint/minecraft/core/ench/BasicEnchantment.java",
"license": "gpl-2.0",
"size": 2560
} | [
"net.minecraftforge.common.MinecraftForge"
] | import net.minecraftforge.common.MinecraftForge; | import net.minecraftforge.common.*; | [
"net.minecraftforge.common"
] | net.minecraftforge.common; | 2,039,876 |
public URL getURL() throws IOException {
URL url = null;
if ( this.clazz != null ) {
url = this.clazz.getResource( this.path );
}
if ( url == null ) {
url = this.classLoader.getResource( this.path );
}
if ( url == null ) {
throw n... | URL function() throws IOException { URL url = null; if ( this.clazz != null ) { url = this.clazz.getResource( this.path ); } if ( url == null ) { url = this.classLoader.getResource( this.path ); } if ( url == null ) { throw new FileNotFoundException( "'" + this.path + STR ); } return url; } | /**
* This implementation returns a URL for the underlying class path resource.
* @see java.lang.ClassLoader#getResource(String)
* @see java.lang.Class#getResource(String)
*/ | This implementation returns a URL for the underlying class path resource | getURL | {
"repo_name": "psiroky/drools",
"path": "drools-core/src/main/java/org/drools/io/impl/ClassPathResource.java",
"license": "apache-2.0",
"size": 9205
} | [
"java.io.FileNotFoundException",
"java.io.IOException"
] | import java.io.FileNotFoundException; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,388,982 |
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<ApplicationInner> list(String tenantId, String filter, Context context); | @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable<ApplicationInner> list(String tenantId, String filter, Context context); | /**
* Gets a list of deleted applications in the directory.
*
* @param tenantId The tenant ID.
* @param filter The filter to apply to the operation.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
... | Gets a list of deleted applications in the directory | list | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/DeletedApplicationsClient.java",
"license": "mit",
"size": 8842
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.PagedIterable",
"com.azure.core.util.Context",
"com.azure.resourcemanager.authorization.fluent.models.ApplicationInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.resourcemanager.authorization.fluent.models.ApplicationInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.authorization.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 892,671 |
public static HRegion createHRegion(final HRegionInfo info, final Path rootDir,
final Configuration conf,
final HTableDescriptor hTableDescriptor,
final HLog hlog)
throws IOException {
LOG.info(... | static HRegion function(final HRegionInfo info, final Path rootDir, final Configuration conf, final HTableDescriptor hTableDescriptor, final HLog hlog) throws IOException { LOG.info(STR + info.getTableNameAsString() + STR + hTableDescriptor + STR + rootDir + STR + info.getTableNameAsString()); Path tableDir = HTableDes... | /**
* Convenience method creating new HRegions. Used by createTable.
* The {@link HLog} for the created region needs to be closed explicitly.
* Use {@link HRegion#getLog()} to get access.
*
* @param info Info for region to create.
* @param rootDir Root directory for HBase instance
* @param conf
... | Convenience method creating new HRegions. Used by createTable. The <code>HLog</code> for the created region needs to be closed explicitly. Use <code>HRegion#getLog()</code> to get access | createHRegion | {
"repo_name": "ay65535/hbase-0.94.0",
"path": "src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java",
"license": "apache-2.0",
"size": 178035
} | [
"java.io.IOException",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.hbase.HConstants",
"org.apache.hadoop.hbase.HRegionInfo",
"org.apache.hadoop.hbase.HTableDescriptor",
"org.apache.hadoop.hbase.regionserver.wal.HLog"
] | import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.region... | import java.io.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.regionserver.wal.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 152,998 |
public static DatabaseEntry copy(DatabaseEntry from) {
return new DatabaseEntry(getByteArray(from));
} | static DatabaseEntry function(DatabaseEntry from) { return new DatabaseEntry(getByteArray(from)); } | /**
* Returns a copy of an entry.
*/ | Returns a copy of an entry | copy | {
"repo_name": "apavlo/h-store",
"path": "third_party/cpp/berkeleydb/lang/java/src/com/sleepycat/util/keyrange/KeyRange.java",
"license": "gpl-3.0",
"size": 9946
} | [
"com.sleepycat.db.DatabaseEntry"
] | import com.sleepycat.db.DatabaseEntry; | import com.sleepycat.db.*; | [
"com.sleepycat.db"
] | com.sleepycat.db; | 2,111,925 |
public long getDefaultLockTimeout() {
return defaultLockTimeout;
}
/**
* Creates and returns the configured workspace locking strategy.
*
* @return the configured {@link ISMLocking} | long function() { return defaultLockTimeout; } /** * Creates and returns the configured workspace locking strategy. * * @return the configured {@link ISMLocking} | /**
* Returns the default lock timeout in number of seconds or
* <code>Long.MAX_VALUE</code> when not specified.
*
* @return default lock timeout in number of seconds or
* <code>Long.MAX_VALUE</code> when not specified
*/ | Returns the default lock timeout in number of seconds or <code>Long.MAX_VALUE</code> when not specified | getDefaultLockTimeout | {
"repo_name": "tripodsan/jackrabbit",
"path": "jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/WorkspaceConfig.java",
"license": "apache-2.0",
"size": 9349
} | [
"org.apache.jackrabbit.core.state.ISMLocking"
] | import org.apache.jackrabbit.core.state.ISMLocking; | import org.apache.jackrabbit.core.state.*; | [
"org.apache.jackrabbit"
] | org.apache.jackrabbit; | 1,548,580 |
public static String[] getAllPluginNames(String module, Class intfc)
{
try
{
String iname = intfc.getName();
configureNamedPlugin(module, iname);
String prefix = iname + SEP;
ArrayList<String> result = new ArrayList<String>();
for (Str... | static String[] function(String module, Class intfc) { try { String iname = intfc.getName(); configureNamedPlugin(module, iname); String prefix = iname + SEP; ArrayList<String> result = new ArrayList<String>(); for (String key : namedPluginClasses.keySet()) { if (key.startsWith(prefix)) { result.add(key.substring(prefi... | /**
* Returns all of the names under which a named plugin implementing
* the interface intface can be requested (with getNamedPlugin()).
* The array is empty if there are no matches. Use this to populate
* a menu of plugins for interactive selection, or to document what
* the possible choices ... | Returns all of the names under which a named plugin implementing the interface intface can be requested (with getNamedPlugin()). The array is empty if there are no matches. Use this to populate a menu of plugins for interactive selection, or to document what the possible choices are. | getAllPluginNames | {
"repo_name": "rnathanday/dryad-repo",
"path": "dspace-api/src/main/java/org/dspace/core/PluginManager.java",
"license": "bsd-3-clause",
"size": 37564
} | [
"java.util.ArrayList"
] | import java.util.ArrayList; | import java.util.*; | [
"java.util"
] | java.util; | 185,374 |
public byte[] getBytes( String name ) throws BirtException; | byte[] function( String name ) throws BirtException; | /**
* Returns the value of a bound column as the byte[] data type. Currently it
* is only a dummy implementation.
*
* @param name
* of bound column
* @return value of bound column
* @throws BirtException
*/ | Returns the value of a bound column as the byte[] data type. Currently it is only a dummy implementation | getBytes | {
"repo_name": "Charling-Huang/birt",
"path": "engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/extension/IQueryResultSet.java",
"license": "epl-1.0",
"size": 5915
} | [
"org.eclipse.birt.core.exception.BirtException"
] | import org.eclipse.birt.core.exception.BirtException; | import org.eclipse.birt.core.exception.*; | [
"org.eclipse.birt"
] | org.eclipse.birt; | 2,707,020 |
public SimpleDateFormat getFormatter() {
return formatter;
} | SimpleDateFormat function() { return formatter; } | /**
* Allows us to define a date format for the display of dates/times
* @return the defined formatter
*/ | Allows us to define a date format for the display of dates/times | getFormatter | {
"repo_name": "JrmyDev/CodenameOne",
"path": "CodenameOne/src/com/codename1/ui/spinner/Picker.java",
"license": "gpl-2.0",
"size": 19356
} | [
"com.codename1.l10n.SimpleDateFormat"
] | import com.codename1.l10n.SimpleDateFormat; | import com.codename1.l10n.*; | [
"com.codename1.l10n"
] | com.codename1.l10n; | 210,689 |
void validateGetStatusRequest(GetStatusRequest request); | void validateGetStatusRequest(GetStatusRequest request); | /**
* Validates get status request using Java Bean Validation.
*
* @param request get status request
* @throws ConstraintViolationException if request is invalid
*/ | Validates get status request using Java Bean Validation | validateGetStatusRequest | {
"repo_name": "google/framework-for-osdu",
"path": "osdu-r2/os-workflow/workflow-core/src/main/java/org/opengroup/osdu/workflow/provider/interfaces/IValidationService.java",
"license": "apache-2.0",
"size": 1698
} | [
"org.opengroup.osdu.workflow.model.GetStatusRequest"
] | import org.opengroup.osdu.workflow.model.GetStatusRequest; | import org.opengroup.osdu.workflow.model.*; | [
"org.opengroup.osdu"
] | org.opengroup.osdu; | 2,638,942 |
//-----------------------------------------------------------------------
public DoubleArray getShiftAmounts() {
return shiftAmounts;
} | DoubleArray function() { return shiftAmounts; } | /**
* Gets the amount by which the y-values are shifted.
* @return the value of the property, not null
*/ | Gets the amount by which the y-values are shifted | getShiftAmounts | {
"repo_name": "jmptrader/Strata",
"path": "modules/market/src/main/java/com/opengamma/strata/market/curve/CurveParallelShifts.java",
"license": "apache-2.0",
"size": 12193
} | [
"com.opengamma.strata.collect.array.DoubleArray"
] | import com.opengamma.strata.collect.array.DoubleArray; | import com.opengamma.strata.collect.array.*; | [
"com.opengamma.strata"
] | com.opengamma.strata; | 414,302 |
@Override
public void onBackPressed() {
super.onBackPressed();
Intent intent = new Intent(this, home.class);
startActivity(intent);
finish();
} | void function() { super.onBackPressed(); Intent intent = new Intent(this, home.class); startActivity(intent); finish(); } | /**
* Take care of popping the fragment back stack or finishing the activity
* as appropriate.
*/ | Take care of popping the fragment back stack or finishing the activity as appropriate | onBackPressed | {
"repo_name": "torn2537/AnimationJava",
"path": "app/src/main/java/com/example/john/project1/Quiz_Result.java",
"license": "mit",
"size": 1539
} | [
"android.content.Intent"
] | import android.content.Intent; | import android.content.*; | [
"android.content"
] | android.content; | 1,863,939 |
private static <V> Map<String, V> match(final String regularExpression, final Map<String, V> map,
final FilterType type) {
// if the properties map is empty, no need to invoke filter mechanism
if (map.isEmpty()) {
return map;
}
final Pattern pattern = Pattern.... | static <V> Map<String, V> function(final String regularExpression, final Map<String, V> map, final FilterType type) { if (map.isEmpty()) { return map; } final Pattern pattern = Pattern.compile(regularExpression); final Set<Entry<String, V>> entrySet = map.entrySet(); final Supplier<Stream<Entry<String, V>>> streamSuppl... | /**
* Filters out the keys from the provided {@link Map} instance
*
* @param regularExpression
* the regular expression to match
* @param map
* the {@link Map} instance to filter
* @param type
* the associated type that signifies either to retain ... | Filters out the keys from the provided <code>Map</code> instance | match | {
"repo_name": "gavinying/kura",
"path": "kura/org.eclipse.kura.wire.component.provider/src/main/java/org/eclipse/kura/internal/wire/regexfilter/RegexFilter.java",
"license": "epl-1.0",
"size": 12416
} | [
"java.util.Collections",
"java.util.Map",
"java.util.Set",
"java.util.function.Supplier",
"java.util.regex.Pattern",
"java.util.stream.Stream"
] | import java.util.Collections; import java.util.Map; import java.util.Set; import java.util.function.Supplier; import java.util.regex.Pattern; import java.util.stream.Stream; | import java.util.*; import java.util.function.*; import java.util.regex.*; import java.util.stream.*; | [
"java.util"
] | java.util; | 1,078,045 |
@Override
public int hashCode() {
return Objects.hash(this.typeArguments);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* Returns a {@code TypeArguments} instance that excludes all package names that are equal to {@code "java.lang"} from {@cod... | int function() { return Objects.hash(this.typeArguments); } /** * Returns a {@code TypeArguments} instance that excludes all package names that are equal to {@code STR} from {@code typeArguments}. * <p> * If {@code typeArguments} is {@code null}, a {@code NullPointerException} will be thrown. * <p> * Calling this metho... | /**
* Returns a hash code for this {@code TypeArguments} instance.
*
* @return a hash code for this {@code TypeArguments} instance
*/ | Returns a hash code for this TypeArguments instance | hashCode | {
"repo_name": "macroing/CEL4J",
"path": "src/main/java/org/macroing/cel4j/java/binary/classfile/signature/TypeArguments.java",
"license": "gpl-3.0",
"size": 10038
} | [
"java.util.Objects"
] | import java.util.Objects; | import java.util.*; | [
"java.util"
] | java.util; | 1,670,585 |
LinkedList<String> copy = new LinkedList<>(nameComponents);
// Don't edit the original object.
copy.removeFirst();
return copy;
} | LinkedList<String> copy = new LinkedList<>(nameComponents); copy.removeFirst(); return copy; } | /**
* Returns the language-formatted method name components.
*
* <p>For example: "myapi.foo.get" to ["Foo", "Get"]
*/ | Returns the language-formatted method name components. For example: "myapi.foo.get" to ["Foo", "Get"] | getMethodNameComponents | {
"repo_name": "saicheems/toolkit",
"path": "src/main/java/com/google/api/codegen/discovery/config/TypeNameGenerator.java",
"license": "apache-2.0",
"size": 4961
} | [
"java.util.LinkedList"
] | import java.util.LinkedList; | import java.util.*; | [
"java.util"
] | java.util; | 2,055,832 |
public void setWorker(float requestsPerSecond, @Nullable Integer sliceId) {
if (isWorker()) {
throw new IllegalStateException("This task is already a worker");
}
if (isLeader()) {
throw new IllegalStateException("This task is already a leader for other slice subtasks"... | void function(float requestsPerSecond, @Nullable Integer sliceId) { if (isWorker()) { throw new IllegalStateException(STR); } if (isLeader()) { throw new IllegalStateException(STR); } workerState = new WorkerBulkByScrollTaskState(this, sliceId, requestsPerSecond); if (isCancelled()) { workerState.handleCancel(); } } | /**
* Sets this task to be a worker task that performs search requests
* @param requestsPerSecond How many search requests per second this task should make
* @param sliceId If this is is a sliced task, which slice number this task corresponds to. Null if not sliced.
*/ | Sets this task to be a worker task that performs search requests | setWorker | {
"repo_name": "s1monw/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/index/reindex/BulkByScrollTask.java",
"license": "apache-2.0",
"size": 24016
} | [
"org.elasticsearch.common.Nullable"
] | import org.elasticsearch.common.Nullable; | import org.elasticsearch.common.*; | [
"org.elasticsearch.common"
] | org.elasticsearch.common; | 984,668 |
NativeToolChainInternal getForPlatform(NativeLanguage sourceLanguage, NativePlatformInternal targetMachine); | NativeToolChainInternal getForPlatform(NativeLanguage sourceLanguage, NativePlatformInternal targetMachine); | /**
* Selects the tool chain that can build binaries from the given source language that can run on the target machine.
*/ | Selects the tool chain that can build binaries from the given source language that can run on the target machine | getForPlatform | {
"repo_name": "robinverduijn/gradle",
"path": "subprojects/platform-native/src/main/java/org/gradle/nativeplatform/toolchain/internal/NativeToolChainRegistryInternal.java",
"license": "apache-2.0",
"size": 1530
} | [
"org.gradle.nativeplatform.platform.internal.NativePlatformInternal"
] | import org.gradle.nativeplatform.platform.internal.NativePlatformInternal; | import org.gradle.nativeplatform.platform.internal.*; | [
"org.gradle.nativeplatform"
] | org.gradle.nativeplatform; | 1,948,901 |
public Source resolve( String href, String base )
throws TransformerException
{
InputStream in = classLoader.getResourceAsStream(href);
return (Source)(new StreamSource(in));
}
} | Source function( String href, String base ) throws TransformerException { InputStream in = classLoader.getResourceAsStream(href); return (Source)(new StreamSource(in)); } } | /**
** Resolve XSLT pathnames invoked within stylesheet (e.g. xsl:import)
** using ClassLoader.
**
** @param href href attribute of XSLT file
** @param base base URI in affect when href attribute encountered
** @return Source object for requested XSLT file
... | Resolve XSLT pathnames invoked within stylesheet (e.g. xsl:import) using ClassLoader. @param href href attribute of XSLT file @param base base URI in affect when href attribute encountered @return Source object for requested XSLT file | resolve | {
"repo_name": "OpenCollabZA/sakai",
"path": "calendar/calendar-impl/impl/src/java/org/sakaiproject/calendar/impl/PDFExportService.java",
"license": "apache-2.0",
"size": 61583
} | [
"java.io.InputStream",
"javax.xml.transform.Source",
"javax.xml.transform.TransformerException",
"javax.xml.transform.stream.StreamSource"
] | import java.io.InputStream; import javax.xml.transform.Source; import javax.xml.transform.TransformerException; import javax.xml.transform.stream.StreamSource; | import java.io.*; import javax.xml.transform.*; import javax.xml.transform.stream.*; | [
"java.io",
"javax.xml"
] | java.io; javax.xml; | 2,053,820 |
public IDataset getCoating_roughness(); | IDataset function(); | /**
* <p>
* <b>Type:</b> NX_FLOAT
* <b>Units:</b> NX_LENGTH
* </p>
*
* @return the value.
*/ | Type: NX_FLOAT Units: NX_LENGTH | getCoating_roughness | {
"repo_name": "willrogers/dawnsci",
"path": "org.eclipse.dawnsci.nexus/src/org/eclipse/dawnsci/nexus/NXgrating.java",
"license": "epl-1.0",
"size": 4507
} | [
"org.eclipse.dawnsci.analysis.api.dataset.IDataset"
] | import org.eclipse.dawnsci.analysis.api.dataset.IDataset; | import org.eclipse.dawnsci.analysis.api.dataset.*; | [
"org.eclipse.dawnsci"
] | org.eclipse.dawnsci; | 2,595,822 |
public double nextDouble() throws IOException {
int p = peeked;
if (p == PEEKED_NONE) {
p = doPeek();
}
if (p == PEEKED_LONG) {
peeked = PEEKED_NONE;
pathIndices[stackSize - 1]++;
return (double) peekedLong;
}
if (p == PEEKED_NUMBER) {
peekedString = new String(... | double function() throws IOException { int p = peeked; if (p == PEEKED_NONE) { p = doPeek(); } if (p == PEEKED_LONG) { peeked = PEEKED_NONE; pathIndices[stackSize - 1]++; return (double) peekedLong; } if (p == PEEKED_NUMBER) { peekedString = new String(buffer, pos, peekedNumberLength); pos += peekedNumberLength; } else... | /**
* Returns the {@link com.google.gson.stream.JsonToken#NUMBER double} value of the next token,
* consuming it. If the next token is a string, this method will attempt to
* parse it as a double using {@link Double#parseDouble(String)}.
*
* @throws IllegalStateException if the next token is not a litera... | Returns the <code>com.google.gson.stream.JsonToken#NUMBER double</code> value of the next token, consuming it. If the next token is a string, this method will attempt to parse it as a double using <code>Double#parseDouble(String)</code> | nextDouble | {
"repo_name": "MyJojoX/MyJojoXUtils",
"path": "MyJojoXUtils/gson/com/google/gson/stream/JsonReader.java",
"license": "mit",
"size": 51192
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,810,274 |
public Reason reason() {
return this.reason;
} | Reason function() { return this.reason; } | /**
* Get gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable is false. Possible values include: 'AccountNameInvalid', 'AlreadyExists'.
*
* @return the reason value
*/ | Get gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable is false. Possible values include: 'AccountNameInvalid', 'AlreadyExists' | reason | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/CheckNameAvailabilityResultInner.java",
"license": "mit",
"size": 2272
} | [
"com.microsoft.azure.management.storage.v2019_04_01.Reason"
] | import com.microsoft.azure.management.storage.v2019_04_01.Reason; | import com.microsoft.azure.management.storage.v2019_04_01.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 2,818,820 |
public Set<String> getAllSuperAdminRoles() {
String superAdminGroups = null;
Set<String> allSuperAdminRoles = null;
try {
ApplicationConfigProperties applicationConfigProperties = ApplicationConfigProperties.getApplicationConfigProperties();
superAdminGroups = applicationConfigProperties.getProperty(USER... | Set<String> function() { String superAdminGroups = null; Set<String> allSuperAdminRoles = null; try { ApplicationConfigProperties applicationConfigProperties = ApplicationConfigProperties.getApplicationConfigProperties(); superAdminGroups = applicationConfigProperties.getProperty(USER_SUPER_ADMIN); allSuperAdminRoles =... | /**
* This method is used to return set of string of all super admin roles.
*
* @return Set<{@link String}> if result is found else return null
*/ | This method is used to return set of string of all super admin roles | getAllSuperAdminRoles | {
"repo_name": "kuzavas/ephesoft",
"path": "dcma-user-connectivity/src/main/java/com/ephesoft/dcma/user/service/UserConnectivityServiceImpl.java",
"license": "agpl-3.0",
"size": 12158
} | [
"com.ephesoft.dcma.util.ApplicationConfigProperties",
"java.io.IOException",
"java.util.Set"
] | import com.ephesoft.dcma.util.ApplicationConfigProperties; import java.io.IOException; import java.util.Set; | import com.ephesoft.dcma.util.*; import java.io.*; import java.util.*; | [
"com.ephesoft.dcma",
"java.io",
"java.util"
] | com.ephesoft.dcma; java.io; java.util; | 1,155,597 |
private void validateMinorVersion(Path path, int minorVersion) {
if (minorVersion < MIN_MINOR_VERSION ||
minorVersion > MAX_MINOR_VERSION) {
String msg = "Minor version for path " + path +
" is expected to be between " +
MIN_MINOR_VERSION + " and " + MAX_MINOR_... | void function(Path path, int minorVersion) { if (minorVersion < MIN_MINOR_VERSION minorVersion > MAX_MINOR_VERSION) { String msg = STR + path + STR + MIN_MINOR_VERSION + STR + MAX_MINOR_VERSION + STR + minorVersion; LOG.error(msg); throw new RuntimeException(msg); } } | /**
* Validates that the minor version is within acceptable limits.
* Otherwise throws an Runtime exception
*/ | Validates that the minor version is within acceptable limits. Otherwise throws an Runtime exception | validateMinorVersion | {
"repo_name": "matteobertozzi/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java",
"license": "apache-2.0",
"size": 40242
} | [
"org.apache.hadoop.fs.Path"
] | import org.apache.hadoop.fs.Path; | import org.apache.hadoop.fs.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 2,266,434 |
public GSSCredential createCredential (GSSName name,
int lifetime,
Oid mech,
int usage)
throws GSSException {
checkMechanism(mech);
if (name != null) {
if (name.isAnonymous()) {
return new GlobusGSSCredentialImpl();
} else {
throw new GSSException(GSSException.UNAVAILABL... | GSSCredential function (GSSName name, int lifetime, Oid mech, int usage) throws GSSException { checkMechanism(mech); if (name != null) { if (name.isAnonymous()) { return new GlobusGSSCredentialImpl(); } else { throw new GSSException(GSSException.UNAVAILABLE); } } GlobusCredential cred = null; Subject subject = JaasSubj... | /** Acquires GSI GSS credentials. First, it tries to find the credentials
* in the private credential set of the current JAAS Subject. If the
* Subject is not set or credentials are not found in the Subject, it
* tries to get a default user credential (usually an user proxy file)
*
* @param li... | Acquires GSI GSS credentials. First, it tries to find the credentials in the private credential set of the current JAAS Subject. If the Subject is not set or credentials are not found in the Subject, it tries to get a default user credential (usually an user proxy file) | createCredential | {
"repo_name": "NCIP/cagrid2-wsrf",
"path": "wsrf-jglobus/src/main/java/org/globus/gsi/gssapi/GlobusGSSManagerImpl.java",
"license": "bsd-3-clause",
"size": 11262
} | [
"java.util.Iterator",
"java.util.Set",
"javax.security.auth.Subject",
"org.globus.gsi.GlobusCredential",
"org.globus.gsi.GlobusCredentialException",
"org.globus.gsi.jaas.JaasSubject",
"org.ietf.jgss.GSSCredential",
"org.ietf.jgss.GSSException",
"org.ietf.jgss.GSSName",
"org.ietf.jgss.Oid"
] | import java.util.Iterator; import java.util.Set; import javax.security.auth.Subject; import org.globus.gsi.GlobusCredential; import org.globus.gsi.GlobusCredentialException; import org.globus.gsi.jaas.JaasSubject; import org.ietf.jgss.GSSCredential; import org.ietf.jgss.GSSException; import org.ietf.jgss.GSSName; impor... | import java.util.*; import javax.security.auth.*; import org.globus.gsi.*; import org.globus.gsi.jaas.*; import org.ietf.jgss.*; | [
"java.util",
"javax.security",
"org.globus.gsi",
"org.ietf.jgss"
] | java.util; javax.security; org.globus.gsi; org.ietf.jgss; | 1,171,388 |
RestResult result = RestResultFactory.getJsonRestResult();
CommonReferenceOperator object = commonReferenceOperatorRepository.findByDomain(domain);
if (object != null) {
result.setCode(HttpResponseCodes.SC_OK);
result.setBody(createJsonText(new Participant(object.getId(), object... | RestResult result = RestResultFactory.getJsonRestResult(); CommonReferenceOperator object = commonReferenceOperatorRepository.findByDomain(domain); if (object != null) { result.setCode(HttpResponseCodes.SC_OK); result.setBody(createJsonText(new Participant(object.getId(), object.getDomain()))); } else { result.setCode(... | /**
* Try and retrieve an {@link CommonReferenceOperator} with the given domain name, returning it in a {@Link RestResult}.
*
* @param domain a {@link String} containing the domain name of the {@link CommonReferenceOperator} to be retrieved.
* @return a {@Link RestResult}
*/ | Try and retrieve an <code>CommonReferenceOperator</code> with the given domain name, returning it in a RestResult | findCommonReferenceOperator | {
"repo_name": "USEF-Foundation/ri.usef.energy",
"path": "usef-build/usef-workflow/usef-dso/src/main/java/energy/usef/dso/service/business/DistributionSystemOperatorTopologyBusinessService.java",
"license": "apache-2.0",
"size": 21055
} | [
"energy.usef.core.rest.Participant",
"energy.usef.core.rest.RestResult",
"energy.usef.core.rest.RestResultFactory",
"energy.usef.dso.model.CommonReferenceOperator",
"energy.usef.dso.model.SynchronisationCongestionPoint",
"org.jboss.resteasy.util.HttpResponseCodes"
] | import energy.usef.core.rest.Participant; import energy.usef.core.rest.RestResult; import energy.usef.core.rest.RestResultFactory; import energy.usef.dso.model.CommonReferenceOperator; import energy.usef.dso.model.SynchronisationCongestionPoint; import org.jboss.resteasy.util.HttpResponseCodes; | import energy.usef.core.rest.*; import energy.usef.dso.model.*; import org.jboss.resteasy.util.*; | [
"energy.usef.core",
"energy.usef.dso",
"org.jboss.resteasy"
] | energy.usef.core; energy.usef.dso; org.jboss.resteasy; | 2,706,908 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.