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 ServiceCall head404Async(final ServiceCallback<Void> serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); }
ServiceCall function(final ServiceCallback<Void> serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException(STR); }
/** * Return 404 status code. * * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */
Return 404 status code
head404Async
{ "repo_name": "John-Hart/autorest", "path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/http/implementation/HttpSuccessImpl.java", "license": "mit", "size": 67911 }
[ "com.microsoft.rest.ServiceCall", "com.microsoft.rest.ServiceCallback" ]
import com.microsoft.rest.ServiceCall; import com.microsoft.rest.ServiceCallback;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
2,640,271
public void testUpdatableStream() throws Exception { try { this.stmt.executeUpdate("DROP TABLE IF EXISTS updateStreamTest"); this.stmt .executeUpdate("CREATE TABLE updateStreamTest (keyField INT NOT NULL AUTO_INCREMENT PRIMARY KEY, field1 BLOB)"); int streamLength = 16385; byte[] streamData = new byte[streamLength]; Statement updStmt = this.conn.createStatement( ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); ResultSet updRs = updStmt .executeQuery("SELECT * FROM updateStreamTest"); updRs.moveToInsertRow(); updRs.updateBinaryStream("field1", new ByteArrayInputStream( streamData), streamLength); updRs.insertRow(); } finally { this.stmt.executeUpdate("DROP TABLE IF EXISTS updateStreamTest"); } }
void function() throws Exception { try { this.stmt.executeUpdate(STR); this.stmt .executeUpdate(STR); int streamLength = 16385; byte[] streamData = new byte[streamLength]; Statement updStmt = this.conn.createStatement( ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); ResultSet updRs = updStmt .executeQuery(STR); updRs.moveToInsertRow(); updRs.updateBinaryStream(STR, new ByteArrayInputStream( streamData), streamLength); updRs.insertRow(); } finally { this.stmt.executeUpdate(STR); } }
/** * Tests fix for updatable streams being supported in updatable result sets. * * @throws Exception * if the test fails. */
Tests fix for updatable streams being supported in updatable result sets
testUpdatableStream
{ "repo_name": "hwroitzsch/BikersLifeSaver", "path": "src/AccidentSpotsFinder/lib/mysql-connector-java-5.0.8/src/testsuite/regression/StatementRegressionTest.java", "license": "mit", "size": 120742 }
[ "java.io.ByteArrayInputStream", "java.sql.ResultSet", "java.sql.Statement" ]
import java.io.ByteArrayInputStream; import java.sql.ResultSet; import java.sql.Statement;
import java.io.*; import java.sql.*;
[ "java.io", "java.sql" ]
java.io; java.sql;
1,045,796
private static Object convertJsonValue(String jsonValue) throws JSONException { String jsonString = "{\"value\":" + jsonValue + "}"; JSONObject json = toJson(jsonString); return json.opt("value"); }
static Object function(String jsonValue) throws JSONException { String jsonString = "{\"value\":" + jsonValue + "}"; JSONObject json = toJson(jsonString); return json.opt("value"); }
/** * Convert single JSON-conformant value object * @param jsonValue JSON value * @return Object * @throws JSONException If JSON-parsing of value failed */
Convert single JSON-conformant value object
convertJsonValue
{ "repo_name": "mikibrv/sling", "path": "bundles/extensions/caconfig/impl/src/main/java/org/apache/sling/caconfig/impl/override/OverrideStringParser.java", "license": "apache-2.0", "size": 10882 }
[ "org.apache.sling.commons.json.JSONException", "org.apache.sling.commons.json.JSONObject" ]
import org.apache.sling.commons.json.JSONException; import org.apache.sling.commons.json.JSONObject;
import org.apache.sling.commons.json.*;
[ "org.apache.sling" ]
org.apache.sling;
247,230
public static List<GpxItem> readGpxData( Context context, String path, boolean asLines ) { List<GpxItem> gpxItems = new ArrayList<GpxItem>(); File file = new File(path); GpxParser parser = new GpxParser(path); if (parser.parse()) { List<WayPoint> wayPoints = parser.getWayPoints(); if (wayPoints.size() > 0) { String name = file.getName(); GpxItem item = new GpxItem(); item.setName(name); item.setWidth("2"); //$NON-NLS-1$ item.setVisible(false); item.setColor(ColorUtilities.BLUE.getHex()); //$NON-NLS-1$ item.setData(wayPoints); gpxItems.add(item); } List<TrackSegment> tracks = parser.getTracks(); if (tracks.size() > 0) { for( TrackSegment trackSegment : tracks ) { String name = trackSegment.getName(); GpxItem item = new GpxItem(); item.setName(name); item.setWidth("2"); //$NON-NLS-1$ item.setVisible(false); item.setColor("red"); //$NON-NLS-1$ item.setData(trackSegment); gpxItems.add(item); } } List<Route> routes = parser.getRoutes(); if (routes.size() > 0) { for( Route route : routes ) { String name = route.getName(); GpxItem item = new GpxItem(); item.setName(name); item.setWidth("2"); //$NON-NLS-1$ item.setVisible(false); item.setColor(ColorUtilities.GREEN.getHex()); //$NON-NLS-1$ item.setData(route); gpxItems.add(item); } } } else { GPLog.error("GPXUTILITIES", "ERROR", new RuntimeException()); //$NON-NLS-1$ //$NON-NLS-2$ } return gpxItems; }
static List<GpxItem> function( Context context, String path, boolean asLines ) { List<GpxItem> gpxItems = new ArrayList<GpxItem>(); File file = new File(path); GpxParser parser = new GpxParser(path); if (parser.parse()) { List<WayPoint> wayPoints = parser.getWayPoints(); if (wayPoints.size() > 0) { String name = file.getName(); GpxItem item = new GpxItem(); item.setName(name); item.setWidth("2"); item.setVisible(false); item.setColor(ColorUtilities.BLUE.getHex()); item.setData(wayPoints); gpxItems.add(item); } List<TrackSegment> tracks = parser.getTracks(); if (tracks.size() > 0) { for( TrackSegment trackSegment : tracks ) { String name = trackSegment.getName(); GpxItem item = new GpxItem(); item.setName(name); item.setWidth("2"); item.setVisible(false); item.setColor("red"); item.setData(trackSegment); gpxItems.add(item); } } List<Route> routes = parser.getRoutes(); if (routes.size() > 0) { for( Route route : routes ) { String name = route.getName(); GpxItem item = new GpxItem(); item.setName(name); item.setWidth("2"); item.setVisible(false); item.setColor(ColorUtilities.GREEN.getHex()); item.setData(route); gpxItems.add(item); } } } else { GPLog.error(STR, "ERROR", new RuntimeException()); } return gpxItems; }
/** * Read gpx data. * * @param context the context to use. * @param path the string data. * @param asLines if <code>true</code>, the data are read as lines. * @return list of {@link GpxItem}s. */
Read gpx data
readGpxData
{ "repo_name": "tghoward/geopaparazzi", "path": "geopaparazzilibrary/src/main/java/eu/geopaparazzi/library/gpx/GpxUtilities.java", "license": "gpl-3.0", "size": 6041 }
[ "android.content.Context", "eu.geopaparazzi.library.database.GPLog", "eu.geopaparazzi.library.gpx.parser.GpxParser", "eu.geopaparazzi.library.gpx.parser.WayPoint", "eu.geopaparazzi.library.style.ColorUtilities", "java.io.File", "java.util.ArrayList", "java.util.List" ]
import android.content.Context; import eu.geopaparazzi.library.database.GPLog; import eu.geopaparazzi.library.gpx.parser.GpxParser; import eu.geopaparazzi.library.gpx.parser.WayPoint; import eu.geopaparazzi.library.style.ColorUtilities; import java.io.File; import java.util.ArrayList; import java.util.List;
import android.content.*; import eu.geopaparazzi.library.database.*; import eu.geopaparazzi.library.gpx.parser.*; import eu.geopaparazzi.library.style.*; import java.io.*; import java.util.*;
[ "android.content", "eu.geopaparazzi.library", "java.io", "java.util" ]
android.content; eu.geopaparazzi.library; java.io; java.util;
2,916,370
public void execute() { WasmStack<Object> stack = instance.stack(); if ((stack.peek() instanceof I32) == false) { throw new WasmRuntimeException(UUID.fromString("019f337f-8297-4228-a81f-be816ae3de34"), opcodeName + ": Value2 type is incorrect. Value should be of type " + t1Type); } I32 value2 = (I32) stack.pop(); if ((stack.peek() instanceof I32) == false) { throw new WasmRuntimeException(UUID.fromString("aea63625-b6e3-41da-8d02-c1a39d559d0f"), opcodeName + ": Value1 type is incorrect. Value should be of type " + t2Type); } I32 value1 = (I32) stack.pop(); //If j2 is 0, then the result is undefined. if (value2.integerValue() == 0) { throw new WasmDivideByZeroException( UUID.fromString("900174aa-3a9e-4a3a-b43e-3f5342aa867f"), opcodeName + "Divide by zero is not defined"); } //return the result of dividing j1 by j2, truncated toward zero. I32 result = new I32(Integer.divideUnsigned(value1.integerValue(), value2.integerValue())); stack.push(result); }
void function() { WasmStack<Object> stack = instance.stack(); if ((stack.peek() instanceof I32) == false) { throw new WasmRuntimeException(UUID.fromString(STR), opcodeName + STR + t1Type); } I32 value2 = (I32) stack.pop(); if ((stack.peek() instanceof I32) == false) { throw new WasmRuntimeException(UUID.fromString(STR), opcodeName + STR + t2Type); } I32 value1 = (I32) stack.pop(); if (value2.integerValue() == 0) { throw new WasmDivideByZeroException( UUID.fromString(STR), opcodeName + STR); } I32 result = new I32(Integer.divideUnsigned(value1.integerValue(), value2.integerValue())); stack.push(result); }
/** * Execute the opcode. */
Execute the opcode
execute
{ "repo_name": "fishjd/HappyNewMoonWithReport", "path": "src/main/java/happynewmoonwithreport/opcode/math/I32_div_u.java", "license": "apache-2.0", "size": 3634 }
[ "java.util.UUID" ]
import java.util.UUID;
import java.util.*;
[ "java.util" ]
java.util;
2,252,447
public void expectField(final Collection<Class> annotations, final String name, final Class type) { expected.add(name); expected_annotations.put(name, Sets.newHashSet(annotations)); expected_types.put(name, type); }
void function(final Collection<Class> annotations, final String name, final Class type) { expected.add(name); expected_annotations.put(name, Sets.newHashSet(annotations)); expected_types.put(name, type); }
/** * This method declares that a particular field should be expected. * * @param annotations are the types of the some of the field's annotations. * @param name is the name of the field. * @param type is the type of value stored in the field. */
This method declares that a particular field should be expected
expectField
{ "repo_name": "Mackenzie-High/autumn", "path": "test/execution/ReflectionTester.java", "license": "apache-2.0", "size": 7839 }
[ "com.google.common.collect.Sets", "java.util.Collection" ]
import com.google.common.collect.Sets; import java.util.Collection;
import com.google.common.collect.*; import java.util.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
1,335,223
public Collection getAllContextTags();
Collection function();
/** * Get all prefix tags of nested parsing context * * @return the prefix tags, list of String */
Get all prefix tags of nested parsing context
getAllContextTags
{ "repo_name": "shaolinwu/uimaster", "path": "modules/javacc/src/main/java/org/shaolin/javacc/context/MultipleParsingContext.java", "license": "apache-2.0", "size": 1176 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
1,960,917
public MainScreenView getMainScreen() { return mMainScreen; }
MainScreenView function() { return mMainScreen; }
/** * The view for the main screen. * Unspecified: null */
The view for the main screen. Unspecified: null
getMainScreen
{ "repo_name": "rjwut/ian", "path": "src/main/java/com/walkertribe/ian/world/ArtemisPlayer.java", "license": "mit", "size": 34779 }
[ "com.walkertribe.ian.enums.MainScreenView" ]
import com.walkertribe.ian.enums.MainScreenView;
import com.walkertribe.ian.enums.*;
[ "com.walkertribe.ian" ]
com.walkertribe.ian;
506,546
public void renderFrame(int frameNumber, Bitmap bitmap) { Canvas canvas = new Canvas(bitmap); canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.SRC); // If blending is required, prepare the canvas with the nearest cached frame. int nextIndex; if (!isKeyFrame(frameNumber)) { // Blending is required. nextIndex points to the next index to render onto the canvas. nextIndex = prepareCanvasWithClosestCachedFrame(frameNumber - 1, canvas); } else { // Blending isn't required. Start at the frame we're trying to render. nextIndex = frameNumber; } // Iterate from nextIndex to the frame number just preceding the one we're trying to render // and composite them in order according to the Disposal Method. for (int index = nextIndex; index < frameNumber; index++) { AnimatedDrawableFrameInfo frameInfo = mAnimatedDrawableBackend.getFrameInfo(index); DisposalMethod disposalMethod = frameInfo.disposalMethod; if (disposalMethod == DisposalMethod.DISPOSE_TO_PREVIOUS) { continue; } if (frameInfo.blendOperation == BlendOperation.NO_BLEND) { disposeToBackground(canvas, frameInfo); } mAnimatedDrawableBackend.renderFrame(index, canvas); mCallback.onIntermediateResult(index, bitmap); if (disposalMethod == DisposalMethod.DISPOSE_TO_BACKGROUND) { disposeToBackground(canvas, frameInfo); } } AnimatedDrawableFrameInfo frameInfo = mAnimatedDrawableBackend.getFrameInfo(frameNumber); if (frameInfo.blendOperation == BlendOperation.NO_BLEND) { disposeToBackground(canvas, frameInfo); } // Finally, we render the current frame. We don't dispose it. mAnimatedDrawableBackend.renderFrame(frameNumber, canvas); } private enum FrameNeededResult { REQUIRED, NOT_REQUIRED, SKIP, ABORT }
void function(int frameNumber, Bitmap bitmap) { Canvas canvas = new Canvas(bitmap); canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.SRC); int nextIndex; if (!isKeyFrame(frameNumber)) { nextIndex = prepareCanvasWithClosestCachedFrame(frameNumber - 1, canvas); } else { nextIndex = frameNumber; } for (int index = nextIndex; index < frameNumber; index++) { AnimatedDrawableFrameInfo frameInfo = mAnimatedDrawableBackend.getFrameInfo(index); DisposalMethod disposalMethod = frameInfo.disposalMethod; if (disposalMethod == DisposalMethod.DISPOSE_TO_PREVIOUS) { continue; } if (frameInfo.blendOperation == BlendOperation.NO_BLEND) { disposeToBackground(canvas, frameInfo); } mAnimatedDrawableBackend.renderFrame(index, canvas); mCallback.onIntermediateResult(index, bitmap); if (disposalMethod == DisposalMethod.DISPOSE_TO_BACKGROUND) { disposeToBackground(canvas, frameInfo); } } AnimatedDrawableFrameInfo frameInfo = mAnimatedDrawableBackend.getFrameInfo(frameNumber); if (frameInfo.blendOperation == BlendOperation.NO_BLEND) { disposeToBackground(canvas, frameInfo); } mAnimatedDrawableBackend.renderFrame(frameNumber, canvas); } private enum FrameNeededResult { REQUIRED, NOT_REQUIRED, SKIP, ABORT }
/** * Renders the specified frame. Only should be called on the rendering thread. * * @param frameNumber the frame to render * @param bitmap the bitmap to render into */
Renders the specified frame. Only should be called on the rendering thread
renderFrame
{ "repo_name": "s1rius/fresco", "path": "animated-base/src/main/java/com/facebook/imagepipeline/animated/impl/AnimatedImageCompositor.java", "license": "mit", "size": 9757 }
[ "android.graphics.Bitmap", "android.graphics.Canvas", "android.graphics.Color", "android.graphics.PorterDuff", "com.facebook.imagepipeline.animated.base.AnimatedDrawableFrameInfo" ]
import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.PorterDuff; import com.facebook.imagepipeline.animated.base.AnimatedDrawableFrameInfo;
import android.graphics.*; import com.facebook.imagepipeline.animated.base.*;
[ "android.graphics", "com.facebook.imagepipeline" ]
android.graphics; com.facebook.imagepipeline;
1,200,876
private void doLargeCount() throws DatabaseException { Hashtable dataMap = new Hashtable(); doLargePut(dataMap, N_KEYS);
void function() throws DatabaseException { Hashtable dataMap = new Hashtable(); doLargePut(dataMap, N_KEYS);
/** * Helper routine for above. */
Helper routine for above
doLargeCount
{ "repo_name": "nologic/nabs", "path": "client/trunk/shared/libraries/je-3.2.44/test/com/sleepycat/je/dbi/DbCursorTest.java", "license": "gpl-2.0", "size": 50003 }
[ "com.sleepycat.je.DatabaseException", "java.util.Hashtable" ]
import com.sleepycat.je.DatabaseException; import java.util.Hashtable;
import com.sleepycat.je.*; import java.util.*;
[ "com.sleepycat.je", "java.util" ]
com.sleepycat.je; java.util;
758,907
@Test public void pushTwoFiles() throws Exception { TestSpec tspec = new TestSpec( "AlimarDSM23064_FD", CREDS1); tspec.addFileSpec(new FileSpec( new JGIFileLocation("QC Filtered Raw Data", "6501.2.45840.GCAAGG.adnq.fastq.gz"), "KBaseFile.PairedEndLibrary-2.1", 1L, "f0b44aae6c1714965dd345f368c7927a")); tspec.addFileSpec(new FileSpec( new JGIFileLocation("Raw Data", "6501.2.45840.GCAAGG.fastq.gz"), "KBaseFile.PairedEndLibrary-2.1", 1L, "ff117914a28ffa48b520707e89fa683c")); runTest(tspec); }
void function() throws Exception { TestSpec tspec = new TestSpec( STR, CREDS1); tspec.addFileSpec(new FileSpec( new JGIFileLocation(STR, STR), STR, 1L, STR)); tspec.addFileSpec(new FileSpec( new JGIFileLocation(STR, STR), STR, 1L, STR)); runTest(tspec); }
/** Push two files in different groups simultaneously. * @throws Exception if an exception occurs. */
Push two files in different groups simultaneously
pushTwoFiles
{ "repo_name": "MrCreosote/jgi_kbase_integration_tests", "path": "src/us/kbase/jgiintegration/test/JGIIntegrationTest.java", "license": "mit", "size": 63558 }
[ "us.kbase.jgiintegration.common.JGIFileLocation" ]
import us.kbase.jgiintegration.common.JGIFileLocation;
import us.kbase.jgiintegration.common.*;
[ "us.kbase.jgiintegration" ]
us.kbase.jgiintegration;
233,929
public LedgerRange next() throws IOException; }
LedgerRange function() throws IOException; }
/** * Get the next element. * * @return the next element. * @throws IOException thrown when there is a problem accessing the ledger * metadata store. It is critical that it doesn't return false in the case * in the case it fails to access the ledger metadata store. Otherwise it * will end up deleting all ledgers by accident. */
Get the next element
next
{ "repo_name": "robindh/bookkeeper", "path": "bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/LedgerManager.java", "license": "apache-2.0", "size": 7981 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,984,050
protected EncryptionService getEncryptionService() { return encryptionService != null ? encryptionService : CoreApiServiceLocator.getEncryptionService(); }
EncryptionService function() { return encryptionService != null ? encryptionService : CoreApiServiceLocator.getEncryptionService(); }
/** * Gets the encryptionService attribute. * * @return Returns the encryptionService. */
Gets the encryptionService attribute
getEncryptionService
{ "repo_name": "ua-eas/ksd-kc5.2.1-rice2.3.6-ua", "path": "rice-middleware/kns/src/main/java/org/kuali/rice/kns/lookup/AbstractLookupableHelperServiceImpl.java", "license": "apache-2.0", "size": 70831 }
[ "org.kuali.rice.core.api.CoreApiServiceLocator", "org.kuali.rice.core.api.encryption.EncryptionService" ]
import org.kuali.rice.core.api.CoreApiServiceLocator; import org.kuali.rice.core.api.encryption.EncryptionService;
import org.kuali.rice.core.api.*; import org.kuali.rice.core.api.encryption.*;
[ "org.kuali.rice" ]
org.kuali.rice;
1,320,558
public Object readReference(Type target) { //return getReference(buf.getUnsignedShort()); return getReference(buf.getShort() & 0xffff); }
Object function(Type target) { return getReference(buf.getShort() & 0xffff); }
/** * Reads Reference * * @return Object Read reference to object */
Reads Reference
readReference
{ "repo_name": "cwpenhale/red5-mobileconsole", "path": "red5_server/src/main/java/org/red5/io/amf/Input.java", "license": "apache-2.0", "size": 19582 }
[ "java.lang.reflect.Type" ]
import java.lang.reflect.Type;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
1,920,421
@GET @Path(value = "/{id}") @JacksonFeatures(serializationEnable = { SerializationFeature.INDENT_OUTPUT }) public JobInfo getInfo(@PathParam("id") String id, @QueryParam("crawlId") String crawlId) { return jobManager.get(crawlId, id); }
@Path(value = "/{id}") @JacksonFeatures(serializationEnable = { SerializationFeature.INDENT_OUTPUT }) JobInfo function(@PathParam("id") String id, @QueryParam(STR) String crawlId) { return jobManager.get(crawlId, id); }
/** * Get job info * @param id Job ID * @param crawlId Crawl ID * @return A JSON object of job parameters */
Get job info
getInfo
{ "repo_name": "code4wt/nutch-learning", "path": "src/java/org/apache/nutch/service/resources/JobResource.java", "license": "apache-2.0", "size": 3055 }
[ "com.fasterxml.jackson.databind.SerializationFeature", "com.fasterxml.jackson.jaxrs.annotation.JacksonFeatures", "javax.ws.rs.Path", "javax.ws.rs.PathParam", "javax.ws.rs.QueryParam", "org.apache.nutch.service.model.response.JobInfo" ]
import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.jaxrs.annotation.JacksonFeatures; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.QueryParam; import org.apache.nutch.service.model.response.JobInfo;
import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.jaxrs.annotation.*; import javax.ws.rs.*; import org.apache.nutch.service.model.response.*;
[ "com.fasterxml.jackson", "javax.ws", "org.apache.nutch" ]
com.fasterxml.jackson; javax.ws; org.apache.nutch;
1,370,189
public static List<File> sortInBatch(File file) throws IOException { return sortInBatch(file, defaultcomparator, DEFAULTMAXTEMPFILES, Charset.defaultCharset(), null, false); }
static List<File> function(File file) throws IOException { return sortInBatch(file, defaultcomparator, DEFAULTMAXTEMPFILES, Charset.defaultCharset(), null, false); }
/** * This will simply load the file by blocks of lines, then sort them * in-memory, and write the result to temporary files that have to be * merged later. * * @param file * some flat file * @return a list of temporary flat files * @throws IOException */
This will simply load the file by blocks of lines, then sort them in-memory, and write the result to temporary files that have to be merged later
sortInBatch
{ "repo_name": "wkapil/distributedexternalsort", "path": "src/main/java/com/google/code/externalsorting/ExternalSort.java", "license": "apache-2.0", "size": 34077 }
[ "java.io.File", "java.io.IOException", "java.nio.charset.Charset", "java.util.List" ]
import java.io.File; import java.io.IOException; import java.nio.charset.Charset; import java.util.List;
import java.io.*; import java.nio.charset.*; import java.util.*;
[ "java.io", "java.nio", "java.util" ]
java.io; java.nio; java.util;
2,215,623
EventRegistry.addEventHandler(Identifiers.WORK_WINDOW_CREATING_EVENT, new EventHandler() {
EventRegistry.addEventHandler(Identifiers.WORK_WINDOW_CREATING_EVENT, new EventHandler() {
/** * This methods set up an event listener responsible to add some basic menus * to a work window. */
This methods set up an event listener responsible to add some basic menus to a work window
addEvents
{ "repo_name": "Technikradio/Node2", "path": "src/core/org/technikradio/node/core/MenuCreator.java", "license": "bsd-3-clause", "size": 5155 }
[ "org.technikradio.node.engine.event.EventHandler", "org.technikradio.node.engine.event.EventRegistry" ]
import org.technikradio.node.engine.event.EventHandler; import org.technikradio.node.engine.event.EventRegistry;
import org.technikradio.node.engine.event.*;
[ "org.technikradio.node" ]
org.technikradio.node;
606,843
public static YearMonth of(int year, int month) { YEAR.checkValidValue(year); MONTH_OF_YEAR.checkValidValue(month); return new YearMonth(year, month); } //----------------------------------------------------------------------- /** * Obtains an instance of {@code YearMonth} from a temporal object. * <p> * This obtains a year-month based on the specified temporal. * A {@code TemporalAccessor} represents an arbitrary set of date and time information, * which this factory converts to an instance of {@code YearMonth}. * <p> * The conversion extracts the {@link ChronoField#YEAR YEAR} and * {@link ChronoField#MONTH_OF_YEAR MONTH_OF_YEAR} fields. * The extraction is only permitted if the temporal object has an ISO * chronology, or can be converted to a {@code LocalDate}. * <p> * This method matches the signature of the functional interface {@link TemporalQuery} * allowing it to be used as a query via method reference, {@code YearMonth::from}. * * @param temporal the temporal object to convert, not null * @return the year-month, not null * @throws DateTimeException if unable to convert to a {@code YearMonth}
static YearMonth function(int year, int month) { YEAR.checkValidValue(year); MONTH_OF_YEAR.checkValidValue(month); return new YearMonth(year, month); } /** * Obtains an instance of {@code YearMonth} from a temporal object. * <p> * This obtains a year-month based on the specified temporal. * A {@code TemporalAccessor} represents an arbitrary set of date and time information, * which this factory converts to an instance of {@code YearMonth}. * <p> * The conversion extracts the {@link ChronoField#YEAR YEAR} and * {@link ChronoField#MONTH_OF_YEAR MONTH_OF_YEAR} fields. * The extraction is only permitted if the temporal object has an ISO * chronology, or can be converted to a {@code LocalDate}. * <p> * This method matches the signature of the functional interface {@link TemporalQuery} * allowing it to be used as a query via method reference, {@code YearMonth::from}. * * @param temporal the temporal object to convert, not null * @return the year-month, not null * @throws DateTimeException if unable to convert to a {@code YearMonth}
/** * Obtains an instance of {@code YearMonth} from a year and month. * * @param year the year to represent, from MIN_YEAR to MAX_YEAR * @param month the month-of-year to represent, from 1 (January) to 12 (December) * @return the year-month, not null * @throws DateTimeException if either field value is invalid */
Obtains an instance of YearMonth from a year and month
of
{ "repo_name": "google/desugar_jdk_libs", "path": "src/share/classes/java/time/YearMonth.java", "license": "gpl-2.0", "size": 53945 }
[ "java.time.temporal.ChronoField", "java.time.temporal.TemporalAccessor", "java.time.temporal.TemporalQuery" ]
import java.time.temporal.ChronoField; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalQuery;
import java.time.temporal.*;
[ "java.time" ]
java.time;
2,854,084
public void comboFlags() { initializeFlags(); Integer[] intArray = new Integer[languages.length]; for (int i = 0; i < languages.length; i++) { intArray[i] = new Integer(i); } cbLanguages = new JComboBox(intArray); ComboBoxRenderer renderer = new ComboBoxRenderer(); cbLanguages.setRenderer(renderer); }
void function() { initializeFlags(); Integer[] intArray = new Integer[languages.length]; for (int i = 0; i < languages.length; i++) { intArray[i] = new Integer(i); } cbLanguages = new JComboBox(intArray); ComboBoxRenderer renderer = new ComboBoxRenderer(); cbLanguages.setRenderer(renderer); }
/** * Funkcija popunjava Lanuage comboBox sa adekvatnim slicicama i jezicima */
Funkcija popunjava Lanuage comboBox sa adekvatnim slicicama i jezicima
comboFlags
{ "repo_name": "delicb/Germ", "path": "germ/gui/windows/SettingsWindow.java", "license": "apache-2.0", "size": 27417 }
[ "javax.swing.JComboBox" ]
import javax.swing.JComboBox;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
2,280,528
@Override public void generateMethodPrologue(JavaWriter out, HashMap<String,Object> map) throws IOException { }
void function(JavaWriter out, HashMap<String,Object> map) throws IOException { }
/** * Generates the static class prologue */
Generates the static class prologue
generateMethodPrologue
{ "repo_name": "christianchristensen/resin", "path": "modules/kernel/src/com/caucho/config/gen/NullCallChain.java", "license": "gpl-2.0", "size": 4697 }
[ "com.caucho.java.JavaWriter", "java.io.IOException", "java.util.HashMap" ]
import com.caucho.java.JavaWriter; import java.io.IOException; import java.util.HashMap;
import com.caucho.java.*; import java.io.*; import java.util.*;
[ "com.caucho.java", "java.io", "java.util" ]
com.caucho.java; java.io; java.util;
1,934,930
void addAsAssetSets(List<AssetSet> assetSets) { for (Path assetDir : assetDirs) { AssetSet set = new AssetSet("primary:" + assetDir.toString()); set.addSource(assetDir.toFile()); assetSets.add(set); } }
void addAsAssetSets(List<AssetSet> assetSets) { for (Path assetDir : assetDirs) { AssetSet set = new AssetSet(STR + assetDir.toString()); set.addSource(assetDir.toFile()); assetSets.add(set); } }
/** * Adds all the asset directories as AssetSets. This acts a loose merge * strategy as it does not test for overrides. * @param assetSets A list of asset sets to append to. */
Adds all the asset directories as AssetSets. This acts a loose merge strategy as it does not test for overrides
addAsAssetSets
{ "repo_name": "hhclam/bazel", "path": "src/tools/android/java/com/google/devtools/build/android/UnvalidatedAndroidData.java", "license": "apache-2.0", "size": 5396 }
[ "com.android.ide.common.res2.AssetSet", "java.nio.file.Path", "java.util.List" ]
import com.android.ide.common.res2.AssetSet; import java.nio.file.Path; import java.util.List;
import com.android.ide.common.res2.*; import java.nio.file.*; import java.util.*;
[ "com.android.ide", "java.nio", "java.util" ]
com.android.ide; java.nio; java.util;
650,956
public static Class<?> getMobEffectClass() { try { return getMinecraftClass("MobEffect"); } catch (RuntimeException e) { // It is the second parameter in Packet41MobEffect Class<?> packet = PacketRegistry.getPacketClassFromType(PacketType.Play.Server.ENTITY_EFFECT); Constructor<?> constructor = FuzzyReflection.fromClass(packet).getConstructor( FuzzyMethodContract.newBuilder(). parameterCount(2). parameterExactType(int.class, 0). parameterMatches(getMinecraftObjectMatcher(), 1). build() ); return setMinecraftClass("MobEffect", constructor.getParameterTypes()[1]); } }
static Class<?> function() { try { return getMinecraftClass(STR); } catch (RuntimeException e) { Class<?> packet = PacketRegistry.getPacketClassFromType(PacketType.Play.Server.ENTITY_EFFECT); Constructor<?> constructor = FuzzyReflection.fromClass(packet).getConstructor( FuzzyMethodContract.newBuilder(). parameterCount(2). parameterExactType(int.class, 0). parameterMatches(getMinecraftObjectMatcher(), 1). build() ); return setMinecraftClass(STR, constructor.getParameterTypes()[1]); } }
/** * Retrieve the net.minecraft.server.MobEffect class. * @return The mob effect class. */
Retrieve the net.minecraft.server.MobEffect class
getMobEffectClass
{ "repo_name": "HolodeckOne-Minecraft/ProtocolLib", "path": "modules/API/src/main/java/com/comphenix/protocol/utility/MinecraftReflection.java", "license": "gpl-2.0", "size": 66770 }
[ "com.comphenix.protocol.PacketType", "com.comphenix.protocol.injector.packet.PacketRegistry", "com.comphenix.protocol.reflect.FuzzyReflection", "com.comphenix.protocol.reflect.fuzzy.FuzzyMethodContract", "java.lang.reflect.Constructor", "org.bukkit.Server" ]
import com.comphenix.protocol.PacketType; import com.comphenix.protocol.injector.packet.PacketRegistry; import com.comphenix.protocol.reflect.FuzzyReflection; import com.comphenix.protocol.reflect.fuzzy.FuzzyMethodContract; import java.lang.reflect.Constructor; import org.bukkit.Server;
import com.comphenix.protocol.*; import com.comphenix.protocol.injector.packet.*; import com.comphenix.protocol.reflect.*; import com.comphenix.protocol.reflect.fuzzy.*; import java.lang.reflect.*; import org.bukkit.*;
[ "com.comphenix.protocol", "java.lang", "org.bukkit" ]
com.comphenix.protocol; java.lang; org.bukkit;
2,862,526
public static void convertRgba8888ToHsva8888( ByteBuffer input, ByteBuffer output, int width, int height) { expectInputSize(input, width * height * 4); expectOutputSize(output, width * height * 4); nativeRgba8888ToHsva8888(input, output, width, height); }
static void function( ByteBuffer input, ByteBuffer output, int width, int height) { expectInputSize(input, width * height * 4); expectOutputSize(output, width * height * 4); nativeRgba8888ToHsva8888(input, output, width, height); }
/** * Convert RGBA8888 to HSVA8888. * * The input data is expected to be encoded in 8-bit interleaved RGBA channels. The output * buffer must be large enough to hold the data. The output buffer may be the same as the * input buffer. * * @param input data encoded in RGBA8888. * @param output buffer to hold HSVA8888 data. * @param width the width of the image * @param height the height of the image */
Convert RGBA8888 to HSVA8888. The input data is expected to be encoded in 8-bit interleaved RGBA channels. The output buffer must be large enough to hold the data. The output buffer may be the same as the input buffer
convertRgba8888ToHsva8888
{ "repo_name": "xorware/android_frameworks_base", "path": "tests/Camera2Tests/SmartCamera/SimpleCamera/src/androidx/media/filterfw/ColorSpace.java", "license": "apache-2.0", "size": 5526 }
[ "java.nio.ByteBuffer" ]
import java.nio.ByteBuffer;
import java.nio.*;
[ "java.nio" ]
java.nio;
844,764
public boolean removeHeaderView(View v) { if (mHeaderViewInfos.size() > 0) { boolean result = false; ListAdapter adapter = getAdapter(); if (adapter != null && ((HeaderViewGridAdapter) adapter).removeHeader(v)) { result = true; } removeFixedViewInfo(v, mHeaderViewInfos); return result; } return false; }
boolean function(View v) { if (mHeaderViewInfos.size() > 0) { boolean result = false; ListAdapter adapter = getAdapter(); if (adapter != null && ((HeaderViewGridAdapter) adapter).removeHeader(v)) { result = true; } removeFixedViewInfo(v, mHeaderViewInfos); return result; } return false; }
/** * Removes a previously-added header view. * * @param v The view to remove * @return true if the view was removed, false if the view was not a header * view */
Removes a previously-added header view
removeHeaderView
{ "repo_name": "BottyIvan/-TweetHome", "path": "app/src/main/java/com/botty/launcher/UI/HeaderGridView.java", "license": "gpl-2.0", "size": 16603 }
[ "android.view.View", "android.widget.ListAdapter" ]
import android.view.View; import android.widget.ListAdapter;
import android.view.*; import android.widget.*;
[ "android.view", "android.widget" ]
android.view; android.widget;
1,317,824
public void draw(Graphics2D g2, Rectangle2D plotArea, double angle) { Point2D.Double pt = new Point2D.Double(); pt.setLocation(plotArea.getMinX() + this.rotateX * plotArea.getWidth(), plotArea.getMinY() + this.rotateY * plotArea.getHeight()); draw(g2, plotArea, pt, angle); }
void function(Graphics2D g2, Rectangle2D plotArea, double angle) { Point2D.Double pt = new Point2D.Double(); pt.setLocation(plotArea.getMinX() + this.rotateX * plotArea.getWidth(), plotArea.getMinY() + this.rotateY * plotArea.getHeight()); draw(g2, plotArea, pt, angle); }
/** * Draws the needle. * * @param g2 the graphics device. * @param plotArea the plot area. * @param angle the angle. */
Draws the needle
draw
{ "repo_name": "simon04/jfreechart", "path": "src/main/java/org/jfree/chart/needle/MeterNeedle.java", "license": "lgpl-2.1", "size": 12161 }
[ "java.awt.Graphics2D", "java.awt.geom.Point2D", "java.awt.geom.Rectangle2D" ]
import java.awt.Graphics2D; import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D;
import java.awt.*; import java.awt.geom.*;
[ "java.awt" ]
java.awt;
2,553,821
protected int convertMatchFlags(Element opts) { int flags = 0; String sopts = ((StringProperty) opts).getValue(); for (int i = 0; i < sopts.length(); i++) { char c = sopts.charAt(i); switch (c) { case 'i': flags |= Pattern.CASE_INSENSITIVE; break; case 's': flags |= Pattern.DOTALL; break; case 'm': flags |= Pattern.MULTILINE; break; case 'u': flags |= Pattern.UNICODE_CASE; break; case 'x': flags |= Pattern.COMMENTS; break; default: throw EvaluationException.create(sourceRange, MSG_INVALID_REGEXP_FLAG, c); } } return flags; }
int function(Element opts) { int flags = 0; String sopts = ((StringProperty) opts).getValue(); for (int i = 0; i < sopts.length(); i++) { char c = sopts.charAt(i); switch (c) { case 'i': flags = Pattern.CASE_INSENSITIVE; break; case 's': flags = Pattern.DOTALL; break; case 'm': flags = Pattern.MULTILINE; break; case 'u': flags = Pattern.UNICODE_CASE; break; case 'x': flags = Pattern.COMMENTS; break; default: throw EvaluationException.create(sourceRange, MSG_INVALID_REGEXP_FLAG, c); } } return flags; }
/** * A utility function to convert a string containing match options to the * associated integer with the appropriate bits set. * * @param opts * string containing matching flags * @return integer with appropriate bits set */
A utility function to convert a string containing match options to the associated integer with the appropriate bits set
convertMatchFlags
{ "repo_name": "quattor/pan", "path": "panc/src/main/java/org/quattor/pan/dml/functions/AbstractMatcher.java", "license": "apache-2.0", "size": 3620 }
[ "java.util.regex.Pattern", "org.quattor.pan.dml.data.Element", "org.quattor.pan.dml.data.StringProperty", "org.quattor.pan.exceptions.EvaluationException" ]
import java.util.regex.Pattern; import org.quattor.pan.dml.data.Element; import org.quattor.pan.dml.data.StringProperty; import org.quattor.pan.exceptions.EvaluationException;
import java.util.regex.*; import org.quattor.pan.dml.data.*; import org.quattor.pan.exceptions.*;
[ "java.util", "org.quattor.pan" ]
java.util; org.quattor.pan;
292,077
public void initialize(ControllableActivity activity, ActivityController controller, ActionBar actionBar) { mActivity = activity; mController = controller; mActionBar = actionBar; }
void function(ControllableActivity activity, ActivityController controller, ActionBar actionBar) { mActivity = activity; mController = controller; mActionBar = actionBar; }
/** * Initialize the action bar view. */
Initialize the action bar view
initialize
{ "repo_name": "george-zhang-work/dove", "path": "Reader/src/com/dove/reader/ui/actionbar/ReaderActionBarView.java", "license": "apache-2.0", "size": 1559 }
[ "android.app.ActionBar", "com.dove.reader.ui.interfaces.ActivityController", "com.dove.reader.ui.interfaces.ControllableActivity" ]
import android.app.ActionBar; import com.dove.reader.ui.interfaces.ActivityController; import com.dove.reader.ui.interfaces.ControllableActivity;
import android.app.*; import com.dove.reader.ui.interfaces.*;
[ "android.app", "com.dove.reader" ]
android.app; com.dove.reader;
1,420,399
private static List<Integer> getMaxColumnSizes(List<String[]> resultSet) { List<Integer> maxColumnSizes = new ArrayList<Integer>(); for (int i = 0; i < resultSet.get(0).length; i++) { int maxColumnSize = -1; for (int j = 0; j < resultSet.size(); j++) { if (resultSet.get(j)[i].length() > maxColumnSize) { maxColumnSize = resultSet.get(j)[i].length(); } } maxColumnSizes.add(maxColumnSize); } return maxColumnSizes; }
static List<Integer> function(List<String[]> resultSet) { List<Integer> maxColumnSizes = new ArrayList<Integer>(); for (int i = 0; i < resultSet.get(0).length; i++) { int maxColumnSize = -1; for (int j = 0; j < resultSet.size(); j++) { if (resultSet.get(j)[i].length() > maxColumnSize) { maxColumnSize = resultSet.get(j)[i].length(); } } maxColumnSizes.add(maxColumnSize); } return maxColumnSizes; }
/** * Gets a list of the maximum size for each column. * * @param resultSet the result set to process * @return a list of the maximum size for each column */
Gets a list of the maximum size for each column
getMaxColumnSizes
{ "repo_name": "google-code-export/google-api-dfp-java", "path": "src/com/google/api/ads/dfp/lib/utils/v201311/PqlUtils.java", "license": "apache-2.0", "size": 8177 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,580,765
public void testGetSupportedCipherSuites() throws Exception { SSLServerSocket ssocket = createSSLServerSocket(); String[] supported = ssocket.getSupportedCipherSuites(); assertNotNull(supported); supported[0] = "NOT_SUPPORTED_CIPHER_SUITE"; supported = ssocket.getEnabledCipherSuites(); for (int i=0; i<supported.length; i++) { if ("NOT_SUPPORTED_CIPHER_SUITE".equals(supported[i])) { fail("Modification of the returned result " + "causes the modification of the internal state"); } } }
void function() throws Exception { SSLServerSocket ssocket = createSSLServerSocket(); String[] supported = ssocket.getSupportedCipherSuites(); assertNotNull(supported); supported[0] = STR; supported = ssocket.getEnabledCipherSuites(); for (int i=0; i<supported.length; i++) { if (STR.equals(supported[i])) { fail(STR + STR); } } }
/** * getSupportedCipherSuites() method testing. */
getSupportedCipherSuites() method testing
testGetSupportedCipherSuites
{ "repo_name": "skyHALud/codenameone", "path": "Ports/iOSPort/xmlvm/apache-harmony-6.0-src-r991881/classlib/modules/x-net/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/SSLServerSocketImplTest.java", "license": "gpl-2.0", "size": 23799 }
[ "javax.net.ssl.SSLServerSocket" ]
import javax.net.ssl.SSLServerSocket;
import javax.net.ssl.*;
[ "javax.net" ]
javax.net;
815,050
private static ByteBuffer createModelByteBuffer(ByteBuffer metadataBuffer, byte dataType) { FlatBufferBuilder builder = new FlatBufferBuilder(); // Creates a valid set of quantization parameters. int validQuantization = createQuantizationParameters( builder, new float[] {VALID_SCALE}, new long[] {VALID_ZERO_POINT}); // Creates an invalid set of quantization parameters. int inValidQuantization = createQuantizationParameters(builder, invalidScale, invalidZeroPoint); // Creates an input Tensor with valid quantization parameters. int validTensor = createTensor(builder, validShape, dataType, validQuantization); // Creates an empty input Tensor. Tensor.startTensor(builder); int emptyTensor = Tensor.endTensor(builder); // Creates an input Tensor with invalid quantization parameters. int invalidTensor = createTensor(builder, validShape, dataType, inValidQuantization); // Creates the SubGraph. int[] tensors = new int[6]; tensors[0] = validTensor; tensors[1] = emptyTensor; tensors[2] = invalidTensor; tensors[3] = validTensor; tensors[4] = emptyTensor; tensors[5] = invalidTensor; int subgraphTensors = SubGraph.createTensorsVector(builder, tensors); int subgraphInputs = SubGraph.createInputsVector(builder, new int[] {0, 1, 2}); int subgraphOutputs = SubGraph.createOutputsVector(builder, new int[] {3, 4, 5}); SubGraph.startSubGraph(builder); SubGraph.addTensors(builder, subgraphTensors); SubGraph.addInputs(builder, subgraphInputs); SubGraph.addOutputs(builder, subgraphOutputs); int subgraph = SubGraph.endSubGraph(builder); // Creates the Model. int[] subgraphs = new int[1]; subgraphs[0] = subgraph; int modelSubgraphs = Model.createSubgraphsVector(builder, subgraphs); // Inserts metadataBuffer into the model if it's not null. int modelBuffers = EMPTY_FLATBUFFER_VECTOR; int metadataArray = EMPTY_FLATBUFFER_VECTOR; if (metadataBuffer != null) { int data = Buffer.createDataVector(builder, metadataBuffer); Buffer.startBuffer(builder); Buffer.addData(builder, data); int buffer = Buffer.endBuffer(builder); modelBuffers = Model.createBuffersVector(builder, new int[] {buffer}); int metadataName = builder.createString(ModelInfo.METADATA_FIELD_NAME); Metadata.startMetadata(builder); Metadata.addName(builder, metadataName); Metadata.addBuffer(builder, 0); int metadata = Metadata.endMetadata(builder); metadataArray = Model.createMetadataVector(builder, new int[] {metadata}); } Model.startModel(builder); Model.addSubgraphs(builder, modelSubgraphs); if (modelBuffers != EMPTY_FLATBUFFER_VECTOR && metadataArray != EMPTY_FLATBUFFER_VECTOR) { Model.addBuffers(builder, modelBuffers); Model.addMetadata(builder, metadataArray); } int model = Model.endModel(builder); builder.finish(model, TFLITE_MODEL_IDENTIFIER); return builder.dataBuffer(); }
static ByteBuffer function(ByteBuffer metadataBuffer, byte dataType) { FlatBufferBuilder builder = new FlatBufferBuilder(); int validQuantization = createQuantizationParameters( builder, new float[] {VALID_SCALE}, new long[] {VALID_ZERO_POINT}); int inValidQuantization = createQuantizationParameters(builder, invalidScale, invalidZeroPoint); int validTensor = createTensor(builder, validShape, dataType, validQuantization); Tensor.startTensor(builder); int emptyTensor = Tensor.endTensor(builder); int invalidTensor = createTensor(builder, validShape, dataType, inValidQuantization); int[] tensors = new int[6]; tensors[0] = validTensor; tensors[1] = emptyTensor; tensors[2] = invalidTensor; tensors[3] = validTensor; tensors[4] = emptyTensor; tensors[5] = invalidTensor; int subgraphTensors = SubGraph.createTensorsVector(builder, tensors); int subgraphInputs = SubGraph.createInputsVector(builder, new int[] {0, 1, 2}); int subgraphOutputs = SubGraph.createOutputsVector(builder, new int[] {3, 4, 5}); SubGraph.startSubGraph(builder); SubGraph.addTensors(builder, subgraphTensors); SubGraph.addInputs(builder, subgraphInputs); SubGraph.addOutputs(builder, subgraphOutputs); int subgraph = SubGraph.endSubGraph(builder); int[] subgraphs = new int[1]; subgraphs[0] = subgraph; int modelSubgraphs = Model.createSubgraphsVector(builder, subgraphs); int modelBuffers = EMPTY_FLATBUFFER_VECTOR; int metadataArray = EMPTY_FLATBUFFER_VECTOR; if (metadataBuffer != null) { int data = Buffer.createDataVector(builder, metadataBuffer); Buffer.startBuffer(builder); Buffer.addData(builder, data); int buffer = Buffer.endBuffer(builder); modelBuffers = Model.createBuffersVector(builder, new int[] {buffer}); int metadataName = builder.createString(ModelInfo.METADATA_FIELD_NAME); Metadata.startMetadata(builder); Metadata.addName(builder, metadataName); Metadata.addBuffer(builder, 0); int metadata = Metadata.endMetadata(builder); metadataArray = Model.createMetadataVector(builder, new int[] {metadata}); } Model.startModel(builder); Model.addSubgraphs(builder, modelSubgraphs); if (modelBuffers != EMPTY_FLATBUFFER_VECTOR && metadataArray != EMPTY_FLATBUFFER_VECTOR) { Model.addBuffers(builder, modelBuffers); Model.addMetadata(builder, metadataArray); } int model = Model.endModel(builder); builder.finish(model, TFLITE_MODEL_IDENTIFIER); return builder.dataBuffer(); }
/** * Creates an example model flatbuffer, which contains one subgraph with three inputs and three * output. */
Creates an example model flatbuffer, which contains one subgraph with three inputs and three output
createModelByteBuffer
{ "repo_name": "chromium/chromium", "path": "third_party/tflite_support/src/tensorflow_lite_support/metadata/java/src/javatests/org/tensorflow/lite/support/metadata/MetadataExtractorTest.java", "license": "bsd-3-clause", "size": 47313 }
[ "com.google.flatbuffers.FlatBufferBuilder", "java.nio.ByteBuffer", "org.tensorflow.lite.schema.Buffer", "org.tensorflow.lite.schema.Metadata", "org.tensorflow.lite.schema.Model", "org.tensorflow.lite.schema.SubGraph", "org.tensorflow.lite.schema.Tensor" ]
import com.google.flatbuffers.FlatBufferBuilder; import java.nio.ByteBuffer; import org.tensorflow.lite.schema.Buffer; import org.tensorflow.lite.schema.Metadata; import org.tensorflow.lite.schema.Model; import org.tensorflow.lite.schema.SubGraph; import org.tensorflow.lite.schema.Tensor;
import com.google.flatbuffers.*; import java.nio.*; import org.tensorflow.lite.schema.*;
[ "com.google.flatbuffers", "java.nio", "org.tensorflow.lite" ]
com.google.flatbuffers; java.nio; org.tensorflow.lite;
2,063,351
public void createContentItems(CollectionItem parent, Set<ContentItem> contentItems);
void function(CollectionItem parent, Set<ContentItem> contentItems);
/** * Create new content items in a parent collection. * * @param parent * parent collection of content items. * @param contentItems * content items to create * @throws org.osaf.cosmo.model.CollectionLockedException * if parent CollectionItem is locked */
Create new content items in a parent collection
createContentItems
{ "repo_name": "1and1/cosmo", "path": "cosmo-api/src/main/java/org/unitedinternet/cosmo/service/ContentService.java", "license": "apache-2.0", "size": 14578 }
[ "java.util.Set", "org.unitedinternet.cosmo.model.CollectionItem", "org.unitedinternet.cosmo.model.ContentItem" ]
import java.util.Set; import org.unitedinternet.cosmo.model.CollectionItem; import org.unitedinternet.cosmo.model.ContentItem;
import java.util.*; import org.unitedinternet.cosmo.model.*;
[ "java.util", "org.unitedinternet.cosmo" ]
java.util; org.unitedinternet.cosmo;
1,761,216
public static void setupLogging(Level level) { templateLogger.setLevel(level); templateLogger.info("Log level: " + templateLogger.getLevel()); }
static void function(Level level) { templateLogger.setLevel(level); templateLogger.info(STR + templateLogger.getLevel()); }
/** * Configures "com.google.devtools.build.*" loggers to the given * {@code level}. Note: This code relies on static state. */
Configures "com.google.devtools.build.*" loggers to the given level. Note: This code relies on static state
setupLogging
{ "repo_name": "whuwxl/bazel", "path": "src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java", "license": "apache-2.0", "size": 51481 }
[ "java.util.logging.Level" ]
import java.util.logging.Level;
import java.util.logging.*;
[ "java.util" ]
java.util;
1,226,529
public static double[] calculateCoordFromGPS(Location location, Node node) { final double lat = Math.toRadians(location.getLatitude()); final double lon = Math.toRadians(location.getLongitude()); // calculate the length of the current latitude line with the earth // radius final double radius = 6371004.0; double lonLength = radius * Math.cos(lat); lonLength = lonLength * 2 * Math.PI; final double latLength = radius * 2 * Math.PI; final double[] coord = new double[2]; double test = Math.toRadians(node.getLat()) - lat; coord[1] = latLength * test / (Math.PI * 2); test = (Math.toRadians(node.getLon()) - lon); coord[0] = lonLength * test / (Math.PI * 2); return coord; }
static double[] function(Location location, Node node) { final double lat = Math.toRadians(location.getLatitude()); final double lon = Math.toRadians(location.getLongitude()); final double radius = 6371004.0; double lonLength = radius * Math.cos(lat); lonLength = lonLength * 2 * Math.PI; final double latLength = radius * 2 * Math.PI; final double[] coord = new double[2]; double test = Math.toRadians(node.getLat()) - lat; coord[1] = latLength * test / (Math.PI * 2); test = (Math.toRadians(node.getLon()) - lon); coord[0] = lonLength * test / (Math.PI * 2); return coord; }
/** * transfers GPSPoints to a local Coordinate System * * @param location * @param node * @return coord */
transfers GPSPoints to a local Coordinate System
calculateCoordFromGPS
{ "repo_name": "Data4All/Data4All", "path": "src/main/java/io/github/data4all/util/MathUtil.java", "license": "apache-2.0", "size": 11108 }
[ "android.location.Location", "io.github.data4all.model.data.Node" ]
import android.location.Location; import io.github.data4all.model.data.Node;
import android.location.*; import io.github.data4all.model.data.*;
[ "android.location", "io.github.data4all" ]
android.location; io.github.data4all;
2,818,191
public static Function<ServerWebExchange, ServerWebExchange> withUser(UserDetails userDetails) { return withAuthentication(new UsernamePasswordAuthenticationToken(userDetails, userDetails.getPassword(), userDetails.getAuthorities())); }
static Function<ServerWebExchange, ServerWebExchange> function(UserDetails userDetails) { return withAuthentication(new UsernamePasswordAuthenticationToken(userDetails, userDetails.getPassword(), userDetails.getAuthorities())); }
/** * Updates the ServerWebExchange to use the provided UserDetails to create a UsernamePasswordAuthenticationToken as * the Principal * * @param userDetails the UserDetails to use. * @return the {@link Function<ServerWebExchange, ServerWebExchange>}} to use */
Updates the ServerWebExchange to use the provided UserDetails to create a UsernamePasswordAuthenticationToken as the Principal
withUser
{ "repo_name": "pwheel/spring-security", "path": "test/src/main/java/org/springframework/security/test/web/reactive/server/SecurityExchangeMutators.java", "license": "apache-2.0", "size": 6444 }
[ "java.util.function.Function", "org.springframework.security.authentication.UsernamePasswordAuthenticationToken", "org.springframework.security.core.userdetails.UserDetails", "org.springframework.web.server.ServerWebExchange" ]
import java.util.function.Function; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.web.server.ServerWebExchange;
import java.util.function.*; import org.springframework.security.authentication.*; import org.springframework.security.core.userdetails.*; import org.springframework.web.server.*;
[ "java.util", "org.springframework.security", "org.springframework.web" ]
java.util; org.springframework.security; org.springframework.web;
49,239
private static String get(Properties p, String key, String defaultValue, Set<String> used){ Object cand = p.get(key); String rtn; if (cand == null) { rtn = p.getProperty(key, defaultValue); } else { rtn = cand.toString(); } used.add(key); return rtn; }
static String function(Properties p, String key, String defaultValue, Set<String> used){ Object cand = p.get(key); String rtn; if (cand == null) { rtn = p.getProperty(key, defaultValue); } else { rtn = cand.toString(); } used.add(key); return rtn; }
/** * Helper for parsing properties * @param p The properties object * @param key The key to retrieve * @param defaultValue The default value if the key does not exist * @param used The set of keys we have seen * @return The value of the property at the key */
Helper for parsing properties
get
{ "repo_name": "hbbpb/stanford-corenlp-gv", "path": "src/edu/stanford/nlp/util/logging/RedwoodConfiguration.java", "license": "gpl-2.0", "size": 20326 }
[ "java.util.Properties", "java.util.Set" ]
import java.util.Properties; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
853,787
Map<String, List<String>> getArrayNull() throws ServiceException;
Map<String, List<String>> getArrayNull() throws ServiceException;
/** * Get a null array * * @return the Map&lt;String, List&lt;String&gt;&gt; object if successful. * @throws ServiceException the exception wrapped in ServiceException if failed. */
Get a null array
getArrayNull
{ "repo_name": "BretJohnson/autorest", "path": "AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/bodydictionary/Dictionary.java", "license": "mit", "size": 53782 }
[ "com.microsoft.rest.ServiceException", "java.util.List", "java.util.Map" ]
import com.microsoft.rest.ServiceException; import java.util.List; import java.util.Map;
import com.microsoft.rest.*; import java.util.*;
[ "com.microsoft.rest", "java.util" ]
com.microsoft.rest; java.util;
549,190
public void split(final byte [] tableNameOrRegionName) throws IOException, InterruptedException { split(tableNameOrRegionName, null); }
void function(final byte [] tableNameOrRegionName) throws IOException, InterruptedException { split(tableNameOrRegionName, null); }
/** * Split a table or an individual region. Implicitly finds an optimal split * point. Asynchronous operation. * * @param tableNameOrRegionName table to region to split * @throws IOException if a remote or network exception occurs * @throws InterruptedException */
Split a table or an individual region. Implicitly finds an optimal split point. Asynchronous operation
split
{ "repo_name": "zqxjjj/NobidaBase", "path": "target/hbase-0.94.9/hbase-0.94.9/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java", "license": "apache-2.0", "size": 89778 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,007,235
LineageDTO getLineage(String lineageId);
LineageDTO getLineage(String lineageId);
/** * Gets the lineage with the specified id. * * @param lineageId id * @return lineage */
Gets the lineage with the specified id
getLineage
{ "repo_name": "InspurUSA/nifi", "path": "nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiServiceFacade.java", "license": "apache-2.0", "size": 75521 }
[ "org.apache.nifi.web.api.dto.provenance.lineage.LineageDTO" ]
import org.apache.nifi.web.api.dto.provenance.lineage.LineageDTO;
import org.apache.nifi.web.api.dto.provenance.lineage.*;
[ "org.apache.nifi" ]
org.apache.nifi;
1,815,754
public WXComponent findChildByAttrsRef(WXComponent component, String ref){ if(component.getAttrs() != null && ref.equals(component.getAttrs().get(TemplateDom.ATTRS_KEY_REF))){ return component; } if(component instanceof WXVContainer){ WXVContainer container = (WXVContainer) component; for(int i=0; i<container.getChildCount(); i++){ WXComponent child = findChildByAttrsRef(container.getChild(i), ref); if(child != null){ return child; } } } return null; }
WXComponent function(WXComponent component, String ref){ if(component.getAttrs() != null && ref.equals(component.getAttrs().get(TemplateDom.ATTRS_KEY_REF))){ return component; } if(component instanceof WXVContainer){ WXVContainer container = (WXVContainer) component; for(int i=0; i<container.getChildCount(); i++){ WXComponent child = findChildByAttrsRef(container.getChild(i), ref); if(child != null){ return child; } } } return null; }
/** * find child by ref * */
find child by ref
findChildByAttrsRef
{ "repo_name": "miomin/incubator-weex", "path": "android/sdk/src/main/java/com/taobao/weex/ui/component/list/template/WXRecyclerTemplateList.java", "license": "apache-2.0", "size": 77012 }
[ "com.taobao.weex.ui.component.WXComponent", "com.taobao.weex.ui.component.WXVContainer" ]
import com.taobao.weex.ui.component.WXComponent; import com.taobao.weex.ui.component.WXVContainer;
import com.taobao.weex.ui.component.*;
[ "com.taobao.weex" ]
com.taobao.weex;
2,578,171
private void fillDetailResourceTypes(CmsListItem item, String detailId) { CmsSearchManager searchManager = OpenCms.getSearchManager(); StringBuffer html = new StringBuffer(); String doctypeName = (String)item.get(LIST_COLUMN_NAME); CmsSearchDocumentType docType = searchManager.getDocumentTypeConfig(doctypeName); // output of resource types Iterator<String> itResourcetypes = docType.getResourceTypes().iterator(); html.append("<ul>\n"); while (itResourcetypes.hasNext()) { html.append(" <li>\n").append(" ").append(itResourcetypes.next()).append("\n"); html.append(" </li>"); } html.append("</ul>\n"); item.set(detailId, html.toString()); }
void function(CmsListItem item, String detailId) { CmsSearchManager searchManager = OpenCms.getSearchManager(); StringBuffer html = new StringBuffer(); String doctypeName = (String)item.get(LIST_COLUMN_NAME); CmsSearchDocumentType docType = searchManager.getDocumentTypeConfig(doctypeName); Iterator<String> itResourcetypes = docType.getResourceTypes().iterator(); html.append(STR); while (itResourcetypes.hasNext()) { html.append(STR).append(" ").append(itResourcetypes.next()).append("\n"); html.append(STR); } html.append(STR); item.set(detailId, html.toString()); }
/** * Fills details about resource types of the document type into the given item. <p> * * @param item the list item to fill * @param detailId the id for the detail to fill * */
Fills details about resource types of the document type into the given item.
fillDetailResourceTypes
{ "repo_name": "ggiudetti/opencms-core", "path": "src-modules/org/opencms/workplace/tools/searchindex/CmsDocumentTypeAddList.java", "license": "lgpl-2.1", "size": 21483 }
[ "java.util.Iterator", "org.opencms.main.OpenCms", "org.opencms.search.CmsSearchDocumentType", "org.opencms.search.CmsSearchManager", "org.opencms.workplace.list.CmsListItem" ]
import java.util.Iterator; import org.opencms.main.OpenCms; import org.opencms.search.CmsSearchDocumentType; import org.opencms.search.CmsSearchManager; import org.opencms.workplace.list.CmsListItem;
import java.util.*; import org.opencms.main.*; import org.opencms.search.*; import org.opencms.workplace.list.*;
[ "java.util", "org.opencms.main", "org.opencms.search", "org.opencms.workplace" ]
java.util; org.opencms.main; org.opencms.search; org.opencms.workplace;
1,753,720
public Observable<ServiceResponse<Page<NetworkInterfaceIPConfigurationInner>>> listSinglePageAsync(final String resourceGroupName, final String networkInterfaceName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (networkInterfaceName == null) { throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); }
Observable<ServiceResponse<Page<NetworkInterfaceIPConfigurationInner>>> function(final String resourceGroupName, final String networkInterfaceName) { if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (networkInterfaceName == null) { throw new IllegalArgumentException(STR); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); }
/** * Get all ip configurations in a network interface. * ServiceResponse<PageImpl<NetworkInterfaceIPConfigurationInner>> * @param resourceGroupName The name of the resource group. ServiceResponse<PageImpl<NetworkInterfaceIPConfigurationInner>> * @param networkInterfaceName The name of the network interface. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList&lt;NetworkInterfaceIPConfigurationInner&gt; object wrapped in {@link ServiceResponse} if successful. */
Get all ip configurations in a network interface
listSinglePageAsync
{ "repo_name": "navalev/azure-sdk-for-java", "path": "sdk/network/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/network/v2019_07_01/implementation/NetworkInterfaceIPConfigurationsInner.java", "license": "mit", "size": 23822 }
[ "com.microsoft.azure.Page", "com.microsoft.rest.ServiceResponse" ]
import com.microsoft.azure.Page; import com.microsoft.rest.ServiceResponse;
import com.microsoft.azure.*; import com.microsoft.rest.*;
[ "com.microsoft.azure", "com.microsoft.rest" ]
com.microsoft.azure; com.microsoft.rest;
1,337,797
public LocalizationContext getBundle(String name) { Object localeObj = Config.find(this, Config.FMT_LOCALE); LocalizationContext bundle = null; BundleManager manager = getBundleManager(); if (localeObj instanceof Locale) { Locale locale = (Locale) localeObj; bundle = manager.getBundle(name, locale); } else if (localeObj instanceof String) { Locale locale = getLocale((String) localeObj, null); bundle = manager.getBundle(name, locale); } else { String acceptLanguage = getCauchoRequest().getHeader("Accept-Language"); if (acceptLanguage != null) { String cacheKey = name + acceptLanguage; bundle = manager.getBundle(name, cacheKey, getCauchoRequest().getLocales()); } } if (bundle != null) return bundle; Object fallback = Config.find(this, Config.FMT_FALLBACK_LOCALE); if (fallback instanceof Locale) { Locale locale = (Locale) fallback; bundle = manager.getBundle(name, locale); } else if (fallback instanceof String) { String localeName = (String) fallback; Locale locale = getLocale(localeName, null); bundle = manager.getBundle(name, locale); } if (bundle != null) return bundle; bundle = manager.getBundle(name); if (bundle != null) return bundle; else { return BundleManager.NULL_BUNDLE; } }
LocalizationContext function(String name) { Object localeObj = Config.find(this, Config.FMT_LOCALE); LocalizationContext bundle = null; BundleManager manager = getBundleManager(); if (localeObj instanceof Locale) { Locale locale = (Locale) localeObj; bundle = manager.getBundle(name, locale); } else if (localeObj instanceof String) { Locale locale = getLocale((String) localeObj, null); bundle = manager.getBundle(name, locale); } else { String acceptLanguage = getCauchoRequest().getHeader(STR); if (acceptLanguage != null) { String cacheKey = name + acceptLanguage; bundle = manager.getBundle(name, cacheKey, getCauchoRequest().getLocales()); } } if (bundle != null) return bundle; Object fallback = Config.find(this, Config.FMT_FALLBACK_LOCALE); if (fallback instanceof Locale) { Locale locale = (Locale) fallback; bundle = manager.getBundle(name, locale); } else if (fallback instanceof String) { String localeName = (String) fallback; Locale locale = getLocale(localeName, null); bundle = manager.getBundle(name, locale); } if (bundle != null) return bundle; bundle = manager.getBundle(name); if (bundle != null) return bundle; else { return BundleManager.NULL_BUNDLE; } }
/** * Returns the localized message appropriate for the current context. */
Returns the localized message appropriate for the current context
getBundle
{ "repo_name": "dlitz/resin", "path": "modules/resin/src/com/caucho/jsp/PageContextImpl.java", "license": "gpl-2.0", "size": 53497 }
[ "java.util.Locale", "javax.servlet.jsp.jstl.core.Config", "javax.servlet.jsp.jstl.fmt.LocalizationContext" ]
import java.util.Locale; import javax.servlet.jsp.jstl.core.Config; import javax.servlet.jsp.jstl.fmt.LocalizationContext;
import java.util.*; import javax.servlet.jsp.jstl.core.*; import javax.servlet.jsp.jstl.fmt.*;
[ "java.util", "javax.servlet" ]
java.util; javax.servlet;
905,407
public IDesignElement preWorkForPaste( ContainerContext context, IElementCopy content, Module module ) { ContextCopiedElement copy = null; try { preWorkForElement( (ContextCopiedElement) content, module); copy = (ContextCopiedElement) ( (ContextCopiedElement) content ) .clone( ); postWorkForElement( (ContextCopiedElement) content, module ); postWorkForElement( (ContextCopiedElement) copy, module ); } catch ( CloneNotSupportedException e ) { assert false; return null; } String location = copy.getRootLocation( ); if ( location == null ) return copy.getLocalizedCopy( ); DesignElement copiedElement = copy.getCopy( ); DesignSessionImpl session = module.getSession( ); Module copiedRoot = session.getOpenedModule( location ); if ( copiedRoot == null ) return copy.getLocalizedCopy( ); if ( copiedRoot == module ) return copy.getUnlocalizedCopy( ); String nameSpace = StringUtil.extractNamespace( copiedElement .getExtendsName( ) ); // if the element is extends, element should be validated whether the // localize it or not if ( !StringUtil.isEmpty( nameSpace ) ) { Library lib = module.getLibraryWithNamespace( nameSpace ); if ( lib == null ) return copy.getLocalizedCopy( ); long extendsElementID = copy.getExtendsElementID( ); if ( extendsElementID == DesignElement.NO_ID ) return copy.getLocalizedCopy( ); // gets the location of the library which contains the copied // extends. String libLocation = copy.getLibLocation( ); if ( libLocation == null ) return copy.getLocalizedCopy( ); // validates the location of the library which contains the copied // extends is the same as the location of the library of the target // container if ( !libLocation.equals( lib.getLocation( ) ) ) return copy.getLocalizedCopy( ); Library copiedLib = copiedRoot.getLibraryWithNamespace( nameSpace ); if ( copiedLib == null ) return copy.getLocalizedCopy( ); // validates the location of the newly open library is the same as // the location of the library which contains the extends element. if ( !libLocation.equals( copiedLib.getLocation( ) ) ) return copy.getLocalizedCopy( ); DesignElement libElement = lib.getElementByID( extendsElementID ); if ( libElement == null ) return copy.getLocalizedCopy( ); DesignElement copyLibElement = copiedLib .getElementByID( extendsElementID ); if ( libElement.getDefn( ) != copyLibElement.getDefn( ) ) return copy.getLocalizedCopy( ); } return copy.getCopy( ); }
IDesignElement function( ContainerContext context, IElementCopy content, Module module ) { ContextCopiedElement copy = null; try { preWorkForElement( (ContextCopiedElement) content, module); copy = (ContextCopiedElement) ( (ContextCopiedElement) content ) .clone( ); postWorkForElement( (ContextCopiedElement) content, module ); postWorkForElement( (ContextCopiedElement) copy, module ); } catch ( CloneNotSupportedException e ) { assert false; return null; } String location = copy.getRootLocation( ); if ( location == null ) return copy.getLocalizedCopy( ); DesignElement copiedElement = copy.getCopy( ); DesignSessionImpl session = module.getSession( ); Module copiedRoot = session.getOpenedModule( location ); if ( copiedRoot == null ) return copy.getLocalizedCopy( ); if ( copiedRoot == module ) return copy.getUnlocalizedCopy( ); String nameSpace = StringUtil.extractNamespace( copiedElement .getExtendsName( ) ); if ( !StringUtil.isEmpty( nameSpace ) ) { Library lib = module.getLibraryWithNamespace( nameSpace ); if ( lib == null ) return copy.getLocalizedCopy( ); long extendsElementID = copy.getExtendsElementID( ); if ( extendsElementID == DesignElement.NO_ID ) return copy.getLocalizedCopy( ); String libLocation = copy.getLibLocation( ); if ( libLocation == null ) return copy.getLocalizedCopy( ); if ( !libLocation.equals( lib.getLocation( ) ) ) return copy.getLocalizedCopy( ); Library copiedLib = copiedRoot.getLibraryWithNamespace( nameSpace ); if ( copiedLib == null ) return copy.getLocalizedCopy( ); if ( !libLocation.equals( copiedLib.getLocation( ) ) ) return copy.getLocalizedCopy( ); DesignElement libElement = lib.getElementByID( extendsElementID ); if ( libElement == null ) return copy.getLocalizedCopy( ); DesignElement copyLibElement = copiedLib .getElementByID( extendsElementID ); if ( libElement.getDefn( ) != copyLibElement.getDefn( ) ) return copy.getLocalizedCopy( ); } return copy.getCopy( ); }
/** * Checks whether the <code>content</code> can be pasted. And if * localization is needed, localize property values to <code>content</code>. * * @param context * the place where the content is to pasted * @param content * the content * @param module * the root of the context * @return the element copy that should be added into the context * */
Checks whether the <code>content</code> can be pasted. And if localization is needed, localize property values to <code>content</code>
preWorkForPaste
{ "repo_name": "sguan-actuate/birt", "path": "model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/util/copy/ContextCopyPasteBasePolicy.java", "license": "epl-1.0", "size": 10583 }
[ "org.eclipse.birt.report.model.api.core.IDesignElement", "org.eclipse.birt.report.model.api.util.IElementCopy", "org.eclipse.birt.report.model.api.util.StringUtil", "org.eclipse.birt.report.model.core.ContainerContext", "org.eclipse.birt.report.model.core.DesignElement", "org.eclipse.birt.report.model.core.DesignSessionImpl", "org.eclipse.birt.report.model.core.Module", "org.eclipse.birt.report.model.elements.Library" ]
import org.eclipse.birt.report.model.api.core.IDesignElement; import org.eclipse.birt.report.model.api.util.IElementCopy; import org.eclipse.birt.report.model.api.util.StringUtil; import org.eclipse.birt.report.model.core.ContainerContext; import org.eclipse.birt.report.model.core.DesignElement; import org.eclipse.birt.report.model.core.DesignSessionImpl; import org.eclipse.birt.report.model.core.Module; import org.eclipse.birt.report.model.elements.Library;
import org.eclipse.birt.report.model.api.core.*; import org.eclipse.birt.report.model.api.util.*; import org.eclipse.birt.report.model.core.*; import org.eclipse.birt.report.model.elements.*;
[ "org.eclipse.birt" ]
org.eclipse.birt;
1,662,353
public void setBucketReplicationConfiguration( SetBucketReplicationConfigurationRequest setBucketReplicationConfigurationRequest) throws AmazonServiceException, AmazonClientException;
void function( SetBucketReplicationConfigurationRequest setBucketReplicationConfigurationRequest) throws AmazonServiceException, AmazonClientException;
/** * Sets a replication configuration for the Amazon S3 bucket. * * @param setBucketReplicationConfigurationRequest * The request object containing all the options for setting a * replication configuration for an Amazon S3 bucket. * @throws AmazonServiceException * If any errors occurred in Amazon S3 while processing the * request. * @throws AmazonClientException * If any errors are encountered in the client while making the * request or handling the response. * * @see AmazonS3#setBucketReplicationConfiguration(String, BucketReplicationConfiguration) * @see AmazonS3#getBucketReplicationConfiguration(String) * @see AmazonS3#deleteBucketReplicationConfiguration(String) */
Sets a replication configuration for the Amazon S3 bucket
setBucketReplicationConfiguration
{ "repo_name": "vromero/aws-sdk-java", "path": "aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3.java", "license": "apache-2.0", "size": 189693 }
[ "com.amazonaws.AmazonClientException", "com.amazonaws.AmazonServiceException", "com.amazonaws.services.s3.model.SetBucketReplicationConfigurationRequest" ]
import com.amazonaws.AmazonClientException; import com.amazonaws.AmazonServiceException; import com.amazonaws.services.s3.model.SetBucketReplicationConfigurationRequest;
import com.amazonaws.*; import com.amazonaws.services.s3.model.*;
[ "com.amazonaws", "com.amazonaws.services" ]
com.amazonaws; com.amazonaws.services;
1,370,906
public Call<ResponseBody> getAllWithValuesAsync(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery, final ServiceCallback<Void> serviceCallback) { if (localStringPath == null) { serviceCallback.failure(new ServiceException( new IllegalArgumentException("Parameter localStringPath is required and cannot be null."))); } if (pathItemStringPath == null) { serviceCallback.failure(new ServiceException( new IllegalArgumentException("Parameter pathItemStringPath is required and cannot be null."))); } if (this.client.getGlobalStringPath() == null) { serviceCallback.failure(new ServiceException( new IllegalArgumentException("Parameter this.client.getGlobalStringPath() is required and cannot be null."))); }
Call<ResponseBody> function(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery, final ServiceCallback<Void> serviceCallback) { if (localStringPath == null) { serviceCallback.failure(new ServiceException( new IllegalArgumentException(STR))); } if (pathItemStringPath == null) { serviceCallback.failure(new ServiceException( new IllegalArgumentException(STR))); } if (this.client.getGlobalStringPath() == null) { serviceCallback.failure(new ServiceException( new IllegalArgumentException(STR))); }
/** * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery' * * @param localStringPath should contain value 'localStringPath' * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path * @param localStringQuery should contain value 'localStringQuery' * @param pathItemStringQuery A string value 'pathItemStringQuery' that appears as a query parameter * @param serviceCallback the async ServiceCallback to handle successful and failed responses. */
send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'
getAllWithValuesAsync
{ "repo_name": "BretJohnson/autorest", "path": "AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/url/PathItemsImpl.java", "license": "mit", "size": 19576 }
[ "com.microsoft.rest.ServiceCallback", "com.microsoft.rest.ServiceException", "com.squareup.okhttp.ResponseBody" ]
import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceException; import com.squareup.okhttp.ResponseBody;
import com.microsoft.rest.*; import com.squareup.okhttp.*;
[ "com.microsoft.rest", "com.squareup.okhttp" ]
com.microsoft.rest; com.squareup.okhttp;
539,062
public static WCInputMethodEvent convertToWCInputMethodEvent(InputMethodEvent ie) { List<Integer> underlines = new ArrayList<Integer>(); StringBuilder composed = new StringBuilder(); int pos = 0; // Scan the given composedText to find input method highlight attribute runs. for (InputMethodTextRun run : ie.getComposed()) { String rawText = run.getText(); // Convert highlight information of the attribute run into a // CompositionUnderline. InputMethodHighlight imh = run.getHighlight(); underlines.add(pos); underlines.add(pos + rawText.length()); // WebKit CompostionUnderline supports only two kinds of highlighting // attributes, thin and thick underlines. The SELECTED_CONVERTED // and SELECTED_RAW attributes of JavaFX are mapped to the thick one. underlines.add((imh == InputMethodHighlight.SELECTED_CONVERTED || imh == InputMethodHighlight.SELECTED_RAW) ? 1 : 0); pos += rawText.length(); composed.append(rawText); } int size = underlines.size(); // In case there's no highlight information, create an underline element // for the entire text if (size == 0) { underlines.add(0); underlines.add(pos); underlines.add(0); // thin underline size = underlines.size(); } int[] attributes = new int[size]; for (int i = 0; i < size; i++) { attributes[i] = underlines.get(i); } return new WCInputMethodEvent(ie.getCommitted(), composed.toString(), attributes, ie.getCaretPosition()); }
static WCInputMethodEvent function(InputMethodEvent ie) { List<Integer> underlines = new ArrayList<Integer>(); StringBuilder composed = new StringBuilder(); int pos = 0; for (InputMethodTextRun run : ie.getComposed()) { String rawText = run.getText(); InputMethodHighlight imh = run.getHighlight(); underlines.add(pos); underlines.add(pos + rawText.length()); underlines.add((imh == InputMethodHighlight.SELECTED_CONVERTED imh == InputMethodHighlight.SELECTED_RAW) ? 1 : 0); pos += rawText.length(); composed.append(rawText); } int size = underlines.size(); if (size == 0) { underlines.add(0); underlines.add(pos); underlines.add(0); size = underlines.size(); } int[] attributes = new int[size]; for (int i = 0; i < size; i++) { attributes[i] = underlines.get(i); } return new WCInputMethodEvent(ie.getCommitted(), composed.toString(), attributes, ie.getCaretPosition()); }
/** * Converts the given InputMethodEvent to a WCInputMethodEvent. */
Converts the given InputMethodEvent to a WCInputMethodEvent
convertToWCInputMethodEvent
{ "repo_name": "Debian/openjfx", "path": "modules/web/src/main/java/com/sun/javafx/webkit/InputMethodClientImpl.java", "license": "gpl-2.0", "size": 5870 }
[ "com.sun.webkit.event.WCInputMethodEvent", "java.util.ArrayList", "java.util.List" ]
import com.sun.webkit.event.WCInputMethodEvent; import java.util.ArrayList; import java.util.List;
import com.sun.webkit.event.*; import java.util.*;
[ "com.sun.webkit", "java.util" ]
com.sun.webkit; java.util;
217,888
public static void validatePassword( String password, boolean isOld ) throws SiteException { UIErrorMessages errorsI18N = I18NManager.getErrors(); if( password.isEmpty() ){ if( isOld ) { throw new IncorrectUserDataException( errorsI18N.emptyOldUserPasswordError() ); } else { throw new IncorrectUserDataException( errorsI18N.emptyUserPasswordError() ); } } }
static void function( String password, boolean isOld ) throws SiteException { UIErrorMessages errorsI18N = I18NManager.getErrors(); if( password.isEmpty() ){ if( isOld ) { throw new IncorrectUserDataException( errorsI18N.emptyOldUserPasswordError() ); } else { throw new IncorrectUserDataException( errorsI18N.emptyUserPasswordError() ); } } }
/** * Validates the user data, before sending it to the server * @param password the user password * @param isOld true is it is a message about the old password */
Validates the user data, before sending it to the server
validatePassword
{ "repo_name": "ivan-zapreev/x-cure-chat", "path": "src/com/xcurechat/client/data/UserData.java", "license": "gpl-3.0", "size": 15579 }
[ "com.xcurechat.client.i18n.I18NManager", "com.xcurechat.client.i18n.UIErrorMessages", "com.xcurechat.client.rpc.exceptions.IncorrectUserDataException", "com.xcurechat.client.rpc.exceptions.SiteException" ]
import com.xcurechat.client.i18n.I18NManager; import com.xcurechat.client.i18n.UIErrorMessages; import com.xcurechat.client.rpc.exceptions.IncorrectUserDataException; import com.xcurechat.client.rpc.exceptions.SiteException;
import com.xcurechat.client.i18n.*; import com.xcurechat.client.rpc.exceptions.*;
[ "com.xcurechat.client" ]
com.xcurechat.client;
2,897,920
public void writeModel(BufferedWriter writer) throws IOException { // num_layers=3 // layer_sizes=784 30 10 // w // ... writer.write("num_layers=" + getNumLayers()); writer.newLine(); writer.write("layer_sizes=" + Joiner.on(' ').join(layerSizes)); writer.newLine(); writer.write("w"); writer.newLine(); writer.newLine(); for (NinjaMatrix m : w) { for (int i = 0; i < m.numRows(); i++) { NinjaMatrix row = m.extractVector(true, i); writer.write(Joiner.on(' ').join(Doubles.asList(row.getData()))); writer.newLine(); } writer.newLine(); } }
void function(BufferedWriter writer) throws IOException { writer.write(STR + getNumLayers()); writer.newLine(); writer.write(STR + Joiner.on(' ').join(layerSizes)); writer.newLine(); writer.write("w"); writer.newLine(); writer.newLine(); for (NinjaMatrix m : w) { for (int i = 0; i < m.numRows(); i++) { NinjaMatrix row = m.extractVector(true, i); writer.write(Joiner.on(' ').join(Doubles.asList(row.getData()))); writer.newLine(); } writer.newLine(); } }
/** * Writes a model to a writer. * See README file for model format. * * @param writer the writer * @throws IOException */
Writes a model to a writer. See README file for model format
writeModel
{ "repo_name": "yuval/ninja", "path": "core/src/main/java/com/basistech/ninja/Network.java", "license": "apache-2.0", "size": 14092 }
[ "com.basistech.ninja.ejml.NinjaMatrix", "com.google.common.base.Joiner", "com.google.common.primitives.Doubles", "java.io.BufferedWriter", "java.io.IOException" ]
import com.basistech.ninja.ejml.NinjaMatrix; import com.google.common.base.Joiner; import com.google.common.primitives.Doubles; import java.io.BufferedWriter; import java.io.IOException;
import com.basistech.ninja.ejml.*; import com.google.common.base.*; import com.google.common.primitives.*; import java.io.*;
[ "com.basistech.ninja", "com.google.common", "java.io" ]
com.basistech.ninja; com.google.common; java.io;
2,788,575
byte[] buf = new byte[this.BUFSIZE]; int rbytes = 0; try { InputStream iput = this.sock.getInputStream(); rbytes = iput.read(buf); while (rbytes > -1) { this.oput.write(buf, 0, rbytes); rbytes = iput.read(buf); } this.sock.shutdownInput(); } catch (Exception e) { System.err.println("error: failure receiving data"); } } } private static class Sender implements Runnable { private static final int BUFSIZE = 1024; private Socket sock = null; private InputStream iput = null; public Sender(Socket sock, InputStream in) { this.sock = sock; this.iput = in; }
byte[] buf = new byte[this.BUFSIZE]; int rbytes = 0; try { InputStream iput = this.sock.getInputStream(); rbytes = iput.read(buf); while (rbytes > -1) { this.oput.write(buf, 0, rbytes); rbytes = iput.read(buf); } this.sock.shutdownInput(); } catch (Exception e) { System.err.println(STR); } } } private static class Sender implements Runnable { private static final int BUFSIZE = 1024; private Socket sock = null; private InputStream iput = null; public Sender(Socket sock, InputStream in) { this.sock = sock; this.iput = in; }
/** * Reads data from the socket and then writes that data to the output. * Execution terminates when EOF is reached on the socket. */
Reads data from the socket and then writes that data to the output. Execution terminates when EOF is reached on the socket
run
{ "repo_name": "greydamian/netbat-java", "path": "src/org/greydamian/netbatjava/Netbat.java", "license": "mit", "size": 6922 }
[ "java.io.InputStream", "java.lang.Exception", "java.lang.Runnable", "java.net.Socket" ]
import java.io.InputStream; import java.lang.Exception; import java.lang.Runnable; import java.net.Socket;
import java.io.*; import java.lang.*; import java.net.*;
[ "java.io", "java.lang", "java.net" ]
java.io; java.lang; java.net;
815,902
void objectToData(Object object, DatabaseEntry data);
void objectToData(Object object, DatabaseEntry data);
/** * Extracts the data entry from an entity Object. * * @param object is the source Object. * * @param data is the destination entry buffer. */
Extracts the data entry from an entity Object
objectToData
{ "repo_name": "nologic/nabs", "path": "client/trunk/shared/libraries/je-3.2.44/src/com/sleepycat/bind/EntityBinding.java", "license": "gpl-2.0", "size": 1165 }
[ "com.sleepycat.je.DatabaseEntry" ]
import com.sleepycat.je.DatabaseEntry;
import com.sleepycat.je.*;
[ "com.sleepycat.je" ]
com.sleepycat.je;
1,100,580
@ServiceMethod(returns = ReturnType.SINGLE) Mono<GenericResourceInner> getAsync( String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion);
@ServiceMethod(returns = ReturnType.SINGLE) Mono<GenericResourceInner> getAsync( String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion);
/** * Gets a resource. * * @param resourceGroupName The name of the resource group containing the resource to get. The name is case * insensitive. * @param resourceProviderNamespace The namespace of the resource provider. * @param parentResourcePath The parent resource identity. * @param resourceType The resource type of the resource. * @param resourceName The name of the resource to get. * @param apiVersion The API version to use for the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a resource. */
Gets a resource
getAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourcesClient.java", "license": "mit", "size": 91824 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.resources.fluent.models.GenericResourceInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.resources.fluent.models.GenericResourceInner;
import com.azure.core.annotation.*; import com.azure.resourcemanager.resources.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
2,296,264
public AnnotationType<ElementType<T>> createAnnotation() { return new AnnotationTypeImpl<ElementType<T>>(this, "annotation", childNode); }
AnnotationType<ElementType<T>> function() { return new AnnotationTypeImpl<ElementType<T>>(this, STR, childNode); }
/** * Creates a new <code>annotation</code> element * @return the new created instance of <code>AnnotationType<ElementType<T>></code> */
Creates a new <code>annotation</code> element
createAnnotation
{ "repo_name": "forge/javaee-descriptors", "path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/validationMapping11/ElementTypeImpl.java", "license": "epl-1.0", "size": 7190 }
[ "org.jboss.shrinkwrap.descriptor.api.validationMapping11.AnnotationType", "org.jboss.shrinkwrap.descriptor.api.validationMapping11.ElementType" ]
import org.jboss.shrinkwrap.descriptor.api.validationMapping11.AnnotationType; import org.jboss.shrinkwrap.descriptor.api.validationMapping11.ElementType;
import org.jboss.shrinkwrap.descriptor.api.*;
[ "org.jboss.shrinkwrap" ]
org.jboss.shrinkwrap;
2,831,494
@Override @TargetApi(Build.VERSION_CODES.HONEYCOMB) protected View onCreateView(View parent, String name, AttributeSet attrs) throws ClassNotFoundException { return mCalligraphyFactory.onViewCreated(super.onCreateView(parent, name, attrs), getContext(), attrs); }
@TargetApi(Build.VERSION_CODES.HONEYCOMB) View function(View parent, String name, AttributeSet attrs) throws ClassNotFoundException { return mCalligraphyFactory.onViewCreated(super.onCreateView(parent, name, attrs), getContext(), attrs); }
/** * The LayoutInflater onCreateView is the fourth port of call for LayoutInflation. * BUT only for none CustomViews. */
The LayoutInflater onCreateView is the fourth port of call for LayoutInflation. BUT only for none CustomViews
onCreateView
{ "repo_name": "Alexander--/aria2-android", "path": "mobile/src/main/java/net/sf/aria2/util/CalligraphyContextWrapper.java", "license": "gpl-3.0", "size": 14719 }
[ "android.annotation.TargetApi", "android.os.Build", "android.util.AttributeSet", "android.view.View" ]
import android.annotation.TargetApi; import android.os.Build; import android.util.AttributeSet; import android.view.View;
import android.annotation.*; import android.os.*; import android.util.*; import android.view.*;
[ "android.annotation", "android.os", "android.util", "android.view" ]
android.annotation; android.os; android.util; android.view;
1,852,000
public PhotoList getWithGeoData( Date minUploadDate, Date maxUploadDate, Date minTakenDate, Date maxTakenDate, int privacyFilter, String sort, Set<String> extras, int perPage, int page) throws FlickrException, IOException, JSONException { List<Parameter> parameters = new ArrayList<Parameter>(); parameters.add(new Parameter("method", METHOD_GET_WITH_GEO_DATA)); parameters.add(new Parameter(OAuthInterface.PARAM_OAUTH_CONSUMER_KEY, apiKey)); if (minUploadDate != null) { parameters.add(new Parameter("min_upload_date", minUploadDate.getTime() / 1000L)); } if (maxUploadDate != null) { parameters.add(new Parameter("max_upload_date", maxUploadDate.getTime() / 1000L)); } if (minTakenDate != null) { parameters.add(new Parameter("min_taken_date", minTakenDate.getTime() / 1000L)); } if (maxTakenDate != null) { parameters.add(new Parameter("max_taken_date", maxTakenDate.getTime() / 1000L)); } if (privacyFilter > 0) { parameters.add(new Parameter("privacy_filter", privacyFilter)); } if (sort != null) { parameters.add(new Parameter("sort", sort)); } if (extras != null && !extras.isEmpty()) { parameters.add(new Parameter("extras", StringUtilities.join(extras, ","))); } if (perPage > 0) { parameters.add(new Parameter("per_page", perPage)); } if (page > 0) { parameters.add(new Parameter("page", page)); } OAuthUtils.addOAuthToken(parameters); Response response = transport.postJSON(sharedSecret, parameters); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } return PhotoUtils.createPhotoList(response.getData()); }
PhotoList function( Date minUploadDate, Date maxUploadDate, Date minTakenDate, Date maxTakenDate, int privacyFilter, String sort, Set<String> extras, int perPage, int page) throws FlickrException, IOException, JSONException { List<Parameter> parameters = new ArrayList<Parameter>(); parameters.add(new Parameter(STR, METHOD_GET_WITH_GEO_DATA)); parameters.add(new Parameter(OAuthInterface.PARAM_OAUTH_CONSUMER_KEY, apiKey)); if (minUploadDate != null) { parameters.add(new Parameter(STR, minUploadDate.getTime() / 1000L)); } if (maxUploadDate != null) { parameters.add(new Parameter(STR, maxUploadDate.getTime() / 1000L)); } if (minTakenDate != null) { parameters.add(new Parameter(STR, minTakenDate.getTime() / 1000L)); } if (maxTakenDate != null) { parameters.add(new Parameter(STR, maxTakenDate.getTime() / 1000L)); } if (privacyFilter > 0) { parameters.add(new Parameter(STR, privacyFilter)); } if (sort != null) { parameters.add(new Parameter("sort", sort)); } if (extras != null && !extras.isEmpty()) { parameters.add(new Parameter(STR, StringUtilities.join(extras, ","))); } if (perPage > 0) { parameters.add(new Parameter(STR, perPage)); } if (page > 0) { parameters.add(new Parameter("page", page)); } OAuthUtils.addOAuthToken(parameters); Response response = transport.postJSON(sharedSecret, parameters); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } return PhotoUtils.createPhotoList(response.getData()); }
/** * Returns a list of your geo-tagged photos. * * This method requires authentication with 'read' permission. * * @param minUploadDate Minimum upload date. Photos with an upload date greater than or equal to this value will be returned. Set to null to not specify a date. * @param maxUploadDate Maximum upload date. Photos with an upload date less than or equal to this value will be returned. Set to null to not specify a date. * @param minTakenDate Minimum taken date. Photos with an taken date greater than or equal to this value will be returned. Set to null to not specify a date. * @param maxTakenDate Maximum taken date. Photos with an taken date less than or equal to this value will be returned. Set to null to not specify a date. * @param privacyFilter Return photos only matching a certain privacy level. Valid values are: * <ul> * <li>1 public photos</li> * <li>2 private photos visible to friends</li> * <li>3 private photos visible to family</li> * <li>4 private photos visible to friends & family</li> * <li>5 completely private photos</li> * </ul> * Set to 0 to not specify a privacy Filter. * * @see com.googlecode.flickrjandroid.photos.Extras * @param sort The order in which to sort returned photos. Deafults to date-posted-desc. The possible values are: date-posted-asc, date-posted-desc, date-taken-asc, date-taken-desc, interestingness-desc, and interestingness-asc. * @param extras A set of Strings controlling the extra information to fetch for each returned record. Currently supported fields are: license, date_upload, date_taken, owner_name, icon_server, original_format, last_update, geo. Set to null or an empty set to not specify any extras. * @param perPage Number of photos to return per page. If this argument is 0, it defaults to 100. The maximum allowed value is 500. * @param page The page of results to return. If this argument is 0, it defaults to 1. * @return photos * @throws FlickrException * @throws IOException * @throws JSONException */
Returns a list of your geo-tagged photos. This method requires authentication with 'read' permission
getWithGeoData
{ "repo_name": "0570dev/flickr-glass", "path": "src/com/googlecode/flickrjandroid/photos/PhotosInterface.java", "license": "apache-2.0", "size": 57549 }
[ "com.googlecode.flickrjandroid.FlickrException", "com.googlecode.flickrjandroid.Parameter", "com.googlecode.flickrjandroid.Response", "com.googlecode.flickrjandroid.oauth.OAuthInterface", "com.googlecode.flickrjandroid.oauth.OAuthUtils", "com.googlecode.flickrjandroid.util.StringUtilities", "java.io.IOException", "java.util.ArrayList", "java.util.Date", "java.util.List", "java.util.Set", "org.json.JSONException" ]
import com.googlecode.flickrjandroid.FlickrException; import com.googlecode.flickrjandroid.Parameter; import com.googlecode.flickrjandroid.Response; import com.googlecode.flickrjandroid.oauth.OAuthInterface; import com.googlecode.flickrjandroid.oauth.OAuthUtils; import com.googlecode.flickrjandroid.util.StringUtilities; import java.io.IOException; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Set; import org.json.JSONException;
import com.googlecode.flickrjandroid.*; import com.googlecode.flickrjandroid.oauth.*; import com.googlecode.flickrjandroid.util.*; import java.io.*; import java.util.*; import org.json.*;
[ "com.googlecode.flickrjandroid", "java.io", "java.util", "org.json" ]
com.googlecode.flickrjandroid; java.io; java.util; org.json;
1,101,700
public static Vertex vertexFromJson( final String json, final ElementFactory factory, final GraphSONMode mode, final Set<String> propertyKeys) throws IOException { final OGraphSONUtility graphson = new OGraphSONUtility(mode, factory, propertyKeys, null); return graphson.vertexFromJson(json); }
static Vertex function( final String json, final ElementFactory factory, final GraphSONMode mode, final Set<String> propertyKeys) throws IOException { final OGraphSONUtility graphson = new OGraphSONUtility(mode, factory, propertyKeys, null); return graphson.vertexFromJson(json); }
/** * Reads an individual Vertex from JSON. The vertex must match the accepted GraphSON format. * * @param json a single vertex in GraphSON format as a String. * @param factory the factory responsible for constructing graph elements * @param mode the mode of the GraphSON * @param propertyKeys a list of keys to include on reading of element properties */
Reads an individual Vertex from JSON. The vertex must match the accepted GraphSON format
vertexFromJson
{ "repo_name": "orientechnologies/orientdb", "path": "graphdb/src/main/java/com/orientechnologies/orient/graph/graphml/OGraphSONUtility.java", "license": "apache-2.0", "size": 33157 }
[ "com.tinkerpop.blueprints.Vertex", "com.tinkerpop.blueprints.util.io.graphson.ElementFactory", "com.tinkerpop.blueprints.util.io.graphson.GraphSONMode", "java.io.IOException", "java.util.Set" ]
import com.tinkerpop.blueprints.Vertex; import com.tinkerpop.blueprints.util.io.graphson.ElementFactory; import com.tinkerpop.blueprints.util.io.graphson.GraphSONMode; import java.io.IOException; import java.util.Set;
import com.tinkerpop.blueprints.*; import com.tinkerpop.blueprints.util.io.graphson.*; import java.io.*; import java.util.*;
[ "com.tinkerpop.blueprints", "java.io", "java.util" ]
com.tinkerpop.blueprints; java.io; java.util;
810,184
public void normal() { mHintView.setVisibility(View.VISIBLE); mProgressBar.setVisibility(View.GONE); }
void function() { mHintView.setVisibility(View.VISIBLE); mProgressBar.setVisibility(View.GONE); }
/** * normal status */
normal status
normal
{ "repo_name": "wbhqf3/test", "path": "XListView-ninggl/src/com/ninggl/view/XListViewFooter.java", "license": "gpl-2.0", "size": 4041 }
[ "android.view.View" ]
import android.view.View;
import android.view.*;
[ "android.view" ]
android.view;
231,983
return hashKeys(DEFAULT_EXPECTED_KEYS); } /** * Uses a {@link HashMap} to map keys to value collections, initialized to expect the specified * number of keys. * * @throws IllegalArgumentException if {@code expectedKeys < 0}
return hashKeys(DEFAULT_EXPECTED_KEYS); } /** * Uses a {@link HashMap} to map keys to value collections, initialized to expect the specified * number of keys. * * @throws IllegalArgumentException if {@code expectedKeys < 0}
/** * Uses a {@link HashMap} to map keys to value collections. */
Uses a <code>HashMap</code> to map keys to value collections
hashKeys
{ "repo_name": "paulmartel/voltdb", "path": "third_party/java/src/com/google_voltpatches/common/collect/MultimapBuilder.java", "license": "agpl-3.0", "size": 17469 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
295,085
default Web3jEndpointBuilder topics(List<String> topics) { doSetProperty("topics", topics); return this; }
default Web3jEndpointBuilder topics(List<String> topics) { doSetProperty(STR, topics); return this; }
/** * Topics are order-dependent. Each topic can also be a list of topics. * Specify multiple topics separated by comma. * * The option is a: <code>java.util.List&lt;java.lang.String&gt;</code> * type. * * Group: common */
Topics are order-dependent. Each topic can also be a list of topics. Specify multiple topics separated by comma. The option is a: <code>java.util.List&lt;java.lang.String&gt;</code> type. Group: common
topics
{ "repo_name": "DariusX/camel", "path": "core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Web3jEndpointBuilderFactory.java", "license": "apache-2.0", "size": 51259 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,234,887
EClass getStatementQualifier();
EClass getStatementQualifier();
/** * Returns the meta object for class '{@link org.openhealthtools.mdht.cts2.statement.StatementQualifier <em>Qualifier</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @return the meta object for class '<em>Qualifier</em>'. * @see org.openhealthtools.mdht.cts2.statement.StatementQualifier * @generated */
Returns the meta object for class '<code>org.openhealthtools.mdht.cts2.statement.StatementQualifier Qualifier</code>'.
getStatementQualifier
{ "repo_name": "drbgfc/mdht", "path": "cts2/plugins/org.openhealthtools.mdht.cts2.core/src/org/openhealthtools/mdht/cts2/statement/StatementPackage.java", "license": "epl-1.0", "size": 51348 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,669,856
private synchronized void executeStep(CompetencyExecutionPlanStep step, CompetencyExecutionPlan cep) { if (plansToCancel.contains(cep)) { checkPlanCancelled(cep); return; } // find a competency from the library that can execute this step ArrayList<Competency> competencies = architecture.getCompetencyLibrary().getCompetencies(step.getCompetencyType()); boolean foundSuitableCompetency = false; // check if there are competetencies to realize this step, that have not been tried yet for (Competency competency : competencies) if (!step.getCompetenciesAlreadyTried().contains(competency) && competency.isAvailable() && !competency.isRunning()) { // we found a suitable competency foundSuitableCompetency = true; // remember we have tried it step.getCompetenciesAlreadyTried().add(competency); // flag that we are currently executing this plan step cep.getStepsCurrentlyExecuted().add(step); // also remember that this is one of the competencies currently executing runningCompetencies.put(competency,cep); // get parameters for executing the competency and replace black board / world model variables HashMap<String,String> parameters = replaceVariables(step.getCompetencyParameters()); // assign an execution id to the step step.assignExecutionID(); // request the competency to start competency.requestStartCompetency(parameters,cep,step.getExecutionID()); break; } // since we could not find any suitable competency for this step, we have to consider the whole plan as failed if (!foundSuitableCompetency) planFailed(cep); }
synchronized void function(CompetencyExecutionPlanStep step, CompetencyExecutionPlan cep) { if (plansToCancel.contains(cep)) { checkPlanCancelled(cep); return; } ArrayList<Competency> competencies = architecture.getCompetencyLibrary().getCompetencies(step.getCompetencyType()); boolean foundSuitableCompetency = false; for (Competency competency : competencies) if (!step.getCompetenciesAlreadyTried().contains(competency) && competency.isAvailable() && !competency.isRunning()) { foundSuitableCompetency = true; step.getCompetenciesAlreadyTried().add(competency); cep.getStepsCurrentlyExecuted().add(step); runningCompetencies.put(competency,cep); HashMap<String,String> parameters = replaceVariables(step.getCompetencyParameters()); step.assignExecutionID(); competency.requestStartCompetency(parameters,cep,step.getExecutionID()); break; } if (!foundSuitableCompetency) planFailed(cep); }
/** find a competency for the given step of the given plan and request its execution, * or if this could not be accomplished fail the whole plan */
find a competency for the given step of the given plan and request its execution
executeStep
{ "repo_name": "nurv/lirec", "path": "libs/cmion/cmionMain/src/cmion/level2/CompetencyExecution.java", "license": "gpl-3.0", "size": 20120 }
[ "java.util.ArrayList", "java.util.HashMap" ]
import java.util.ArrayList; import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
1,011,306
@Test public void testRemoveRowByKey() { KeyedObjects2D data = new KeyedObjects2D(); data.setObject("Obj1", "R1", "C1"); data.setObject("Obj2", "R2", "C2"); data.removeRow("R2"); assertEquals(1, data.getRowCount()); assertEquals("Obj1", data.getObject(0, 0)); // try unknown row key try { data.removeRow("XXX"); fail("Should have thrown UnknownKeyException on key that doesn't exist"); } catch (UnknownKeyException e) { assertEquals("Row key (XXX) not recognised.", e.getMessage()); } // try null row key try { data.removeRow(null); fail("Should have thrown IndexOutOfBoundsException on null key"); } catch (IllegalArgumentException e) { assertEquals("Null 'key' argument.", e.getMessage()); } }
void function() { KeyedObjects2D data = new KeyedObjects2D(); data.setObject("Obj1", "R1", "C1"); data.setObject("Obj2", "R2", "C2"); data.removeRow("R2"); assertEquals(1, data.getRowCount()); assertEquals("Obj1", data.getObject(0, 0)); try { data.removeRow("XXX"); fail(STR); } catch (UnknownKeyException e) { assertEquals(STR, e.getMessage()); } try { data.removeRow(null); fail(STR); } catch (IllegalArgumentException e) { assertEquals(STR, e.getMessage()); } }
/** * Some checks for the removeRow(Comparable) method. */
Some checks for the removeRow(Comparable) method
testRemoveRowByKey
{ "repo_name": "akardapolov/ASH-Viewer", "path": "jfreechart-fse/src/test/java/org/jfree/data/KeyedObjects2DTest.java", "license": "gpl-3.0", "size": 12839 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
1,383,868
public static XMLGregorianCalendar getIssueInstant(String timezone) throws ConfigurationException { TimeZone tz = TimeZone.getTimeZone(timezone); DatatypeFactory dtf; try { dtf = newDatatypeFactory(); } catch (DatatypeConfigurationException e) { throw logger.configurationError(e); } GregorianCalendar gc = new GregorianCalendar(tz); XMLGregorianCalendar xgc = dtf.newXMLGregorianCalendar(gc); return xgc; }
static XMLGregorianCalendar function(String timezone) throws ConfigurationException { TimeZone tz = TimeZone.getTimeZone(timezone); DatatypeFactory dtf; try { dtf = newDatatypeFactory(); } catch (DatatypeConfigurationException e) { throw logger.configurationError(e); } GregorianCalendar gc = new GregorianCalendar(tz); XMLGregorianCalendar xgc = dtf.newXMLGregorianCalendar(gc); return xgc; }
/** * Returns a XMLGregorianCalendar in the timezone specified. If the timezone is not valid, then the timezone falls * back to * "GMT" * * @param timezone * * @return * * @throws ConfigurationException */
Returns a XMLGregorianCalendar in the timezone specified. If the timezone is not valid, then the timezone falls back to "GMT"
getIssueInstant
{ "repo_name": "jean-merelis/keycloak", "path": "saml-core/src/main/java/org/keycloak/saml/processing/core/saml/v2/util/XMLTimeUtil.java", "license": "apache-2.0", "size": 7898 }
[ "java.util.GregorianCalendar", "java.util.TimeZone", "javax.xml.datatype.DatatypeConfigurationException", "javax.xml.datatype.DatatypeFactory", "javax.xml.datatype.XMLGregorianCalendar", "org.keycloak.saml.common.exceptions.ConfigurationException" ]
import java.util.GregorianCalendar; import java.util.TimeZone; import javax.xml.datatype.DatatypeConfigurationException; import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.XMLGregorianCalendar; import org.keycloak.saml.common.exceptions.ConfigurationException;
import java.util.*; import javax.xml.datatype.*; import org.keycloak.saml.common.exceptions.*;
[ "java.util", "javax.xml", "org.keycloak.saml" ]
java.util; javax.xml; org.keycloak.saml;
1,492,038
public static void setModified(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) { Base.set(model, instanceResource, MODIFIED, value); }
static void function(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) { Base.set(model, instanceResource, MODIFIED, value); }
/** * Sets a value of property DateModified from an RDF2Go node. First, all * existing values are removed, then this value is added. Cardinality * constraints are not checked, but this method exists only for properties * with no minCardinality or minCardinality == 1. * * @param model * an RDF2Go model * @param resource * an RDF2Go resource * @param value * the value to be set * * [Generated from RDFReactor template rule #set1static] */
Sets a value of property DateModified from an RDF2Go node. First, all existing values are removed, then this value is added. Cardinality constraints are not checked, but this method exists only for properties with no minCardinality or minCardinality == 1
setModified
{ "repo_name": "m0ep/master-thesis", "path": "source/apis/rdf2go/rdf2go-sioc/src/main/java/org/rdfs/sioc/Thing.java", "license": "mit", "size": 317844 }
[ "org.ontoware.rdf2go.model.Model", "org.ontoware.rdfreactor.runtime.Base" ]
import org.ontoware.rdf2go.model.Model; import org.ontoware.rdfreactor.runtime.Base;
import org.ontoware.rdf2go.model.*; import org.ontoware.rdfreactor.runtime.*;
[ "org.ontoware.rdf2go", "org.ontoware.rdfreactor" ]
org.ontoware.rdf2go; org.ontoware.rdfreactor;
1,084,117
List<Member> listMembersRegisteredBeforeOnGroup(Calendar date, MemberGroup group);
List<Member> listMembersRegisteredBeforeOnGroup(Calendar date, MemberGroup group);
/** * Lists members that were changed to the given group (or created on it) before the given date */
Lists members that were changed to the given group (or created on it) before the given date
listMembersRegisteredBeforeOnGroup
{ "repo_name": "mateli/OpenCyclos", "path": "src/main/java/nl/strohalm/cyclos/dao/members/ElementDAO.java", "license": "gpl-2.0", "size": 7308 }
[ "java.util.Calendar", "java.util.List", "nl.strohalm.cyclos.entities.groups.MemberGroup", "nl.strohalm.cyclos.entities.members.Member" ]
import java.util.Calendar; import java.util.List; import nl.strohalm.cyclos.entities.groups.MemberGroup; import nl.strohalm.cyclos.entities.members.Member;
import java.util.*; import nl.strohalm.cyclos.entities.groups.*; import nl.strohalm.cyclos.entities.members.*;
[ "java.util", "nl.strohalm.cyclos" ]
java.util; nl.strohalm.cyclos;
2,731,392
private static boolean contains(Entry[] eSet, Entry e) { for(int i=0; i<eSet.length; i++) { if(equal(eSet[i], e)) return true; } return false; }
static boolean function(Entry[] eSet, Entry e) { for(int i=0; i<eSet.length; i++) { if(equal(eSet[i], e)) return true; } return false; }
/** * Returns <code>true</code> if the <code>Entry</code> parameter * <code>e</code> is an element of the <code>Entry[]</code> array * parameter <code>eSet</code>; returns <code>false</code> otherwise. */
Returns <code>true</code> if the <code>Entry</code> parameter <code>e</code> is an element of the <code>Entry[]</code> array parameter <code>eSet</code>; returns <code>false</code> otherwise
contains
{ "repo_name": "trasukg/river-qa-2.2", "path": "src/com/sun/jini/lookup/entry/LookupAttributes.java", "license": "apache-2.0", "size": 16922 }
[ "net.jini.core.entry.Entry" ]
import net.jini.core.entry.Entry;
import net.jini.core.entry.*;
[ "net.jini.core" ]
net.jini.core;
1,203,856
DateTime getPreviousFireDate(JobId jobId);
DateTime getPreviousFireDate(JobId jobId);
/** * Returns last fire date of job with given ID. * * @param jobId the {@code JobId} of job, not null * @return last fire date of job */
Returns last fire date of job with given ID
getPreviousFireDate
{ "repo_name": "sebbrudzinski/motech", "path": "modules/scheduler/scheduler/src/main/java/org/motechproject/scheduler/service/MotechSchedulerService.java", "license": "bsd-3-clause", "size": 10532 }
[ "org.joda.time.DateTime", "org.motechproject.scheduler.contract.JobId" ]
import org.joda.time.DateTime; import org.motechproject.scheduler.contract.JobId;
import org.joda.time.*; import org.motechproject.scheduler.contract.*;
[ "org.joda.time", "org.motechproject.scheduler" ]
org.joda.time; org.motechproject.scheduler;
1,110,003
public PositionTypeEnum getPositionTypeValue();
PositionTypeEnum function();
/** * Returns the position type for the element * @return the position type */
Returns the position type for the element
getPositionTypeValue
{ "repo_name": "OpenSoftwareSolutions/PDFReporter", "path": "pdfreporter-core/src/org/oss/pdfreporter/engine/JRElement.java", "license": "lgpl-3.0", "size": 6754 }
[ "org.oss.pdfreporter.engine.type.PositionTypeEnum" ]
import org.oss.pdfreporter.engine.type.PositionTypeEnum;
import org.oss.pdfreporter.engine.type.*;
[ "org.oss.pdfreporter" ]
org.oss.pdfreporter;
1,414,540
public static void folderDeleted(Account account, String originalPath) throws ServiceException { folderDeleted(account, originalPath, Provisioning.A_zimbraMailSieveScript, FILTER_RULES_CACHE_KEY); folderDeleted(account, originalPath, Provisioning.A_zimbraMailOutgoingSieveScript, OUTGOING_FILTER_RULES_CACHE_KEY); }
static void function(Account account, String originalPath) throws ServiceException { folderDeleted(account, originalPath, Provisioning.A_zimbraMailSieveScript, FILTER_RULES_CACHE_KEY); folderDeleted(account, originalPath, Provisioning.A_zimbraMailOutgoingSieveScript, OUTGOING_FILTER_RULES_CACHE_KEY); }
/** * When a folder is deleted, disables any filter rules that reference that folder. */
When a folder is deleted, disables any filter rules that reference that folder
folderDeleted
{ "repo_name": "nico01f/z-pec", "path": "ZimbraServer/src/java/com/zimbra/cs/filter/RuleManager.java", "license": "mit", "size": 26875 }
[ "com.zimbra.common.service.ServiceException", "com.zimbra.cs.account.Account", "com.zimbra.cs.account.Provisioning" ]
import com.zimbra.common.service.ServiceException; import com.zimbra.cs.account.Account; import com.zimbra.cs.account.Provisioning;
import com.zimbra.common.service.*; import com.zimbra.cs.account.*;
[ "com.zimbra.common", "com.zimbra.cs" ]
com.zimbra.common; com.zimbra.cs;
2,853,970
public void setColumns(Map<String, Object> columns) { this.columns = columns; }
void function(Map<String, Object> columns) { this.columns = columns; }
/** * Setter de columns. * @param columns the columns to set */
Setter de columns
setColumns
{ "repo_name": "Nonorc/Saladium", "path": "src/main/java/com/github/nonorc/saladium/dbunit/xml/Columns.java", "license": "gpl-3.0", "size": 1354 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
649,432
private void createNewGroup() { groupEditor.clearSelection(); newGroupName.setText(""); selectedGroupFriendlyName = null; populateGroupMembershipList(); populatePrincipalsList(); membersToAdd = new ArrayList<Link>(); membersToRemove = new ArrayList<Link>(); createNewGroupView(); }
void function() { groupEditor.clearSelection(); newGroupName.setText(""); selectedGroupFriendlyName = null; populateGroupMembershipList(); populatePrincipalsList(); membersToAdd = new ArrayList<Link>(); membersToRemove = new ArrayList<Link>(); createNewGroupView(); }
/** * Create a new group */
Create a new group
createNewGroup
{ "repo_name": "gujianxiao/gatewayForMulticom", "path": "javasrc/src/main/org/ndnx/ndn/utils/explorer/GroupManagerGUI.java", "license": "lgpl-2.1", "size": 18030 }
[ "java.util.ArrayList", "org.ndnx.ndn.io.content.Link" ]
import java.util.ArrayList; import org.ndnx.ndn.io.content.Link;
import java.util.*; import org.ndnx.ndn.io.content.*;
[ "java.util", "org.ndnx.ndn" ]
java.util; org.ndnx.ndn;
535,175
@Test public void terminatedEventDebugTargetTerminating() { final DebugTarget target = DebugPackage.eINSTANCE.getDebugFactory().createDebugTarget(); target.setContext(DebugPackage.eINSTANCE.getDebugFactory().createVariable()); target.setName("target"); target.setState(DebugTargetState.TERMINATING); DebugTargetUtils.terminatedReply(target); assertEquals(DebugTargetState.TERMINATED, target.getState()); }
void function() { final DebugTarget target = DebugPackage.eINSTANCE.getDebugFactory().createDebugTarget(); target.setContext(DebugPackage.eINSTANCE.getDebugFactory().createVariable()); target.setName(STR); target.setState(DebugTargetState.TERMINATING); DebugTargetUtils.terminatedReply(target); assertEquals(DebugTargetState.TERMINATED, target.getState()); }
/** * Tests {@link DebugTargetUtils#terminatedReply(DebugTarget)} in {@link DebugTargetState#TERMINATING}. */
Tests <code>DebugTargetUtils#terminatedReply(DebugTarget)</code> in <code>DebugTargetState#TERMINATING</code>
terminatedEventDebugTargetTerminating
{ "repo_name": "SiriusLab/SiriusAnimator", "path": "simulationmodelanimation/tests/org.eclipse.gemoc.dsl.debug.tests/src/org/eclipse/gemoc/dsl/debug/tests/DebugTargetUtilsTests.java", "license": "epl-1.0", "size": 40694 }
[ "org.eclipse.gemoc.dsl.debug.DebugPackage", "org.eclipse.gemoc.dsl.debug.DebugTarget", "org.eclipse.gemoc.dsl.debug.DebugTargetState", "org.eclipse.gemoc.dsl.debug.DebugTargetUtils", "org.junit.Assert" ]
import org.eclipse.gemoc.dsl.debug.DebugPackage; import org.eclipse.gemoc.dsl.debug.DebugTarget; import org.eclipse.gemoc.dsl.debug.DebugTargetState; import org.eclipse.gemoc.dsl.debug.DebugTargetUtils; import org.junit.Assert;
import org.eclipse.gemoc.dsl.debug.*; import org.junit.*;
[ "org.eclipse.gemoc", "org.junit" ]
org.eclipse.gemoc; org.junit;
1,911,303
public CompletableFuture<Long> increment(@Nonnull final R rowKey, @Nonnull final String fieldName, final long amount) { final WrappedHBColumn hbColumn = validateAndGetLongColumn(fieldName); return getHBaseTable() .incrementColumnValue(toBytes(rowKey), hbColumn.familyBytes(), hbColumn.columnBytes(), amount); }
CompletableFuture<Long> function(@Nonnull final R rowKey, @Nonnull final String fieldName, final long amount) { final WrappedHBColumn hbColumn = validateAndGetLongColumn(fieldName); return getHBaseTable() .incrementColumnValue(toBytes(rowKey), hbColumn.familyBytes(), hbColumn.columnBytes(), amount); }
/** * Increments field by specified amount * * @param rowKey Row key of the record whose column needs to be incremented * @param fieldName Field that needs to be incremented (this must be of {@link Long} type) * @param amount Amount by which the HBase column needs to be incremented * @return The new value, post increment */
Increments field by specified amount
increment
{ "repo_name": "flipkart-incubator/hbase-object-mapper", "path": "src/main/java/com/flipkart/hbaseobjectmapper/ReactiveHBDAO.java", "license": "apache-2.0", "size": 34635 }
[ "java.util.concurrent.CompletableFuture", "javax.annotation.Nonnull" ]
import java.util.concurrent.CompletableFuture; import javax.annotation.Nonnull;
import java.util.concurrent.*; import javax.annotation.*;
[ "java.util", "javax.annotation" ]
java.util; javax.annotation;
2,264,558
@Test public void testInfo() { Logger mock = Mockito.mock(Logger.class); FixedLogger logger = new FixedLogger(mock, VTNLogLevel.INFO); assertSame(mock, logger.getLogger()); // isEnabled() Mockito.when(mock.isInfoEnabled()).thenReturn(true).thenReturn(false); assertEquals(true, logger.isEnabled()); assertEquals(false, logger.isEnabled()); Mockito.verify(mock, Mockito.times(2)).isInfoEnabled(); Mockito.reset(mock); // log(Throwable, String, Object[]) Mockito.when(mock.isInfoEnabled()).thenReturn(true).thenReturn(true). thenReturn(false).thenReturn(false).thenReturn(true); IllegalArgumentException iae = new IllegalArgumentException(); String msg = "Illegal argument"; logger.log(iae, msg); Mockito.verify(mock).isInfoEnabled(); Mockito.verify(mock).info(msg, iae); logger.log(iae, "Illegal argument: i=%d, str=%s", 10, "test message"); String formatted = "Illegal argument: i=10, str=test message"; Mockito.verify(mock, Mockito.times(2)).isInfoEnabled(); Mockito.verify(mock).info(msg, iae); Mockito.verify(mock).info(formatted, iae); logger.log(iae, msg); Mockito.verify(mock, Mockito.times(3)).isInfoEnabled(); Mockito.verify(mock).info(msg, iae); Mockito.verify(mock).info(formatted, iae); logger.log(iae, "This should not be logger: %d", 12345); Mockito.verify(mock, Mockito.times(4)).isInfoEnabled(); Mockito.verify(mock).info(msg, iae); Mockito.verify(mock).info(formatted, iae); String msg1 = "Another message"; logger.log((Throwable)null, msg1, (Object[])null); Mockito.verify(mock, Mockito.times(5)).isInfoEnabled(); Mockito.verify(mock).info(msg, iae); Mockito.verify(mock).info(formatted, iae); Mockito.verify(mock).info(msg1); Mockito.reset(mock); // log(String) msg = "This is a log message."; logger.log(msg); Mockito.verify(mock).info(msg); // log(String, Throwable) Exception e = new Exception(); logger.log(msg, e); Mockito.verify(mock).info(msg); Mockito.verify(mock).info(msg, e); // log(String, Object ...) String format = "This a log message: {}, {}, {}"; logger.log(format, 123, "test", 99999999L); Mockito.verify(mock).info(msg); Mockito.verify(mock).info(msg, e); Mockito.verify(mock).info(format, 123, "test", 99999999L); }
void function() { Logger mock = Mockito.mock(Logger.class); FixedLogger logger = new FixedLogger(mock, VTNLogLevel.INFO); assertSame(mock, logger.getLogger()); Mockito.when(mock.isInfoEnabled()).thenReturn(true).thenReturn(false); assertEquals(true, logger.isEnabled()); assertEquals(false, logger.isEnabled()); Mockito.verify(mock, Mockito.times(2)).isInfoEnabled(); Mockito.reset(mock); Mockito.when(mock.isInfoEnabled()).thenReturn(true).thenReturn(true). thenReturn(false).thenReturn(false).thenReturn(true); IllegalArgumentException iae = new IllegalArgumentException(); String msg = STR; logger.log(iae, msg); Mockito.verify(mock).isInfoEnabled(); Mockito.verify(mock).info(msg, iae); logger.log(iae, STR, 10, STR); String formatted = STR; Mockito.verify(mock, Mockito.times(2)).isInfoEnabled(); Mockito.verify(mock).info(msg, iae); Mockito.verify(mock).info(formatted, iae); logger.log(iae, msg); Mockito.verify(mock, Mockito.times(3)).isInfoEnabled(); Mockito.verify(mock).info(msg, iae); Mockito.verify(mock).info(formatted, iae); logger.log(iae, STR, 12345); Mockito.verify(mock, Mockito.times(4)).isInfoEnabled(); Mockito.verify(mock).info(msg, iae); Mockito.verify(mock).info(formatted, iae); String msg1 = STR; logger.log((Throwable)null, msg1, (Object[])null); Mockito.verify(mock, Mockito.times(5)).isInfoEnabled(); Mockito.verify(mock).info(msg, iae); Mockito.verify(mock).info(formatted, iae); Mockito.verify(mock).info(msg1); Mockito.reset(mock); msg = STR; logger.log(msg); Mockito.verify(mock).info(msg); Exception e = new Exception(); logger.log(msg, e); Mockito.verify(mock).info(msg); Mockito.verify(mock).info(msg, e); String format = STR; logger.log(format, 123, "test", 99999999L); Mockito.verify(mock).info(msg); Mockito.verify(mock).info(msg, e); Mockito.verify(mock).info(format, 123, "test", 99999999L); }
/** * Test case for INFO level. */
Test case for INFO level
testInfo
{ "repo_name": "opendaylight/vtn", "path": "manager/implementation/src/test/java/org/opendaylight/vtn/manager/internal/util/log/FixedLoggerTest.java", "license": "epl-1.0", "size": 13882 }
[ "org.mockito.Mockito", "org.slf4j.Logger" ]
import org.mockito.Mockito; import org.slf4j.Logger;
import org.mockito.*; import org.slf4j.*;
[ "org.mockito", "org.slf4j" ]
org.mockito; org.slf4j;
453,959
@Test void doPut() { StepVerifier.create(newControllerOneClient().updateOk("value", "ok")) .assertNext(response -> assertEquals("value=ok", response)) .expectNextCount(0) .verifyComplete(); }
void doPut() { StepVerifier.create(newControllerOneClient().updateOk("value", "ok")) .assertNext(response -> assertEquals(STR, response)) .expectNextCount(0) .verifyComplete(); }
/** * Do put. */
Do put
doPut
{ "repo_name": "bremersee/common", "path": "common-base-webflux/src/test/java/org/bremersee/web/reactive/function/client/proxy/WebClientProxyBuilderTest.java", "license": "apache-2.0", "size": 7150 }
[ "org.junit.jupiter.api.Assertions" ]
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.*;
[ "org.junit.jupiter" ]
org.junit.jupiter;
424,424
public void setTrackedMaster(PositionMaster trackedMaster) { JodaBeanUtils.notNull(trackedMaster, "trackedMaster"); this._trackedMaster = trackedMaster; }
void function(PositionMaster trackedMaster) { JodaBeanUtils.notNull(trackedMaster, STR); this._trackedMaster = trackedMaster; }
/** * Sets the trackedMaster. * @param trackedMaster the new value of the property, not null */
Sets the trackedMaster
setTrackedMaster
{ "repo_name": "McLeodMoores/starling", "path": "projects/component/src/main/java/com/opengamma/component/factory/master/DataTrackingPositionMasterComponentFactory.java", "license": "apache-2.0", "size": 9550 }
[ "com.opengamma.master.position.PositionMaster", "org.joda.beans.JodaBeanUtils" ]
import com.opengamma.master.position.PositionMaster; import org.joda.beans.JodaBeanUtils;
import com.opengamma.master.position.*; import org.joda.beans.*;
[ "com.opengamma.master", "org.joda.beans" ]
com.opengamma.master; org.joda.beans;
2,793,641
public void setModuleObject(Object moduleObject) { if (ObjectUtils.equals(this.moduleObject, moduleObject)) { return; } String toStringProperty = getComponentDescriptor().getToStringProperty(); if (getName() == null && this.moduleObject instanceof IPropertyChangeCapable) { if (toStringProperty != null) { ((IPropertyChangeCapable) this.moduleObject) .removePropertyChangeListener(toStringProperty, this); } else { ((IPropertyChangeCapable) this.moduleObject) .removePropertyChangeListener(this); } } Object oldValue = getModuleObject(); this.moduleObject = moduleObject; if (getName() == null && this.moduleObject instanceof IPropertyChangeCapable) { if (toStringProperty != null) { ((IPropertyChangeCapable) this.moduleObject) .addPropertyChangeListener(toStringProperty, this); } else { ((IPropertyChangeCapable) this.moduleObject) .addPropertyChangeListener(this); } } firePropertyChange(MODULE_OBJECT, oldValue, getModuleObject()); }
void function(Object moduleObject) { if (ObjectUtils.equals(this.moduleObject, moduleObject)) { return; } String toStringProperty = getComponentDescriptor().getToStringProperty(); if (getName() == null && this.moduleObject instanceof IPropertyChangeCapable) { if (toStringProperty != null) { ((IPropertyChangeCapable) this.moduleObject) .removePropertyChangeListener(toStringProperty, this); } else { ((IPropertyChangeCapable) this.moduleObject) .removePropertyChangeListener(this); } } Object oldValue = getModuleObject(); this.moduleObject = moduleObject; if (getName() == null && this.moduleObject instanceof IPropertyChangeCapable) { if (toStringProperty != null) { ((IPropertyChangeCapable) this.moduleObject) .addPropertyChangeListener(toStringProperty, this); } else { ((IPropertyChangeCapable) this.moduleObject) .addPropertyChangeListener(this); } } firePropertyChange(MODULE_OBJECT, oldValue, getModuleObject()); }
/** * Assigns the bean this module manages. The projected view will automatically * reflect this change since a &quot;moduleObject&quot; property change will * be fired. * * @param moduleObject * the projected object. */
Assigns the bean this module manages. The projected view will automatically reflect this change since a &quot;moduleObject&quot; property change will be fired
setModuleObject
{ "repo_name": "maximehamm/jspresso-ce", "path": "application/src/main/java/org/jspresso/framework/application/model/BeanModule.java", "license": "lgpl-3.0", "size": 9824 }
[ "org.jspresso.framework.util.bean.IPropertyChangeCapable", "org.jspresso.framework.util.lang.ObjectUtils" ]
import org.jspresso.framework.util.bean.IPropertyChangeCapable; import org.jspresso.framework.util.lang.ObjectUtils;
import org.jspresso.framework.util.bean.*; import org.jspresso.framework.util.lang.*;
[ "org.jspresso.framework" ]
org.jspresso.framework;
2,694,827
private List<INode> getChildren(INode parent){ if (parent instanceof IGraphicalPropertiesHandler){ return ((IGraphicalPropertiesHandler)parent).initModel(); } else { return parent.getChildren(); } }
List<INode> function(INode parent){ if (parent instanceof IGraphicalPropertiesHandler){ return ((IGraphicalPropertiesHandler)parent).initModel(); } else { return parent.getChildren(); } }
/** * Return a list of children of a model. If the model support it * it will be initialized (this is done for the element that dosen't normally keep * a list of children inside, like table, crosstab and list element). * * @param parent the element * @return list of children of the element */
Return a list of children of a model. If the model support it it will be initialized (this is done for the element that dosen't normally keep a list of children inside, like table, crosstab and list element)
getChildren
{ "repo_name": "OpenSoftwareSolutions/PDFReporter-Studio", "path": "com.jaspersoft.studio/src/com/jaspersoft/studio/model/command/CloseSubeditorsCommand.java", "license": "lgpl-3.0", "size": 5323 }
[ "com.jaspersoft.studio.model.IGraphicalPropertiesHandler", "com.jaspersoft.studio.model.INode", "java.util.List" ]
import com.jaspersoft.studio.model.IGraphicalPropertiesHandler; import com.jaspersoft.studio.model.INode; import java.util.List;
import com.jaspersoft.studio.model.*; import java.util.*;
[ "com.jaspersoft.studio", "java.util" ]
com.jaspersoft.studio; java.util;
981,166
public static void registerDefaultAlgorithms() { algorithmsMap.put( MessageDigestAlgorithm.ALGO_ID_DIGEST_NOT_RECOMMENDED_MD5, new Algorithm("", "MD5", "MessageDigest") ); algorithmsMap.put( MessageDigestAlgorithm.ALGO_ID_DIGEST_RIPEMD160, new Algorithm("", "RIPEMD160", "MessageDigest") ); algorithmsMap.put( MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA1, new Algorithm("", "SHA-1", "MessageDigest") ); algorithmsMap.put( MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA256, new Algorithm("", "SHA-256", "MessageDigest") ); algorithmsMap.put( MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA384, new Algorithm("", "SHA-384", "MessageDigest") ); algorithmsMap.put( MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA512, new Algorithm("", "SHA-512", "MessageDigest") ); algorithmsMap.put( XMLSignature.ALGO_ID_SIGNATURE_DSA, new Algorithm("", "SHA1withDSA", "Signature") ); algorithmsMap.put( XMLSignature.ALGO_ID_SIGNATURE_NOT_RECOMMENDED_RSA_MD5, new Algorithm("", "MD5withRSA", "Signature") ); algorithmsMap.put( XMLSignature.ALGO_ID_SIGNATURE_RSA_RIPEMD160, new Algorithm("", "RIPEMD160withRSA", "Signature") ); algorithmsMap.put( XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA1, new Algorithm("", "SHA1withRSA", "Signature") ); algorithmsMap.put( XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA256, new Algorithm("", "SHA256withRSA", "Signature") ); algorithmsMap.put( XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA384, new Algorithm("", "SHA384withRSA", "Signature") ); algorithmsMap.put( XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA512, new Algorithm("", "SHA512withRSA", "Signature") ); algorithmsMap.put( XMLSignature.ALGO_ID_SIGNATURE_ECDSA_SHA1, new Algorithm("", "SHA1withECDSA", "Signature") ); algorithmsMap.put( XMLSignature.ALGO_ID_SIGNATURE_ECDSA_SHA256, new Algorithm("", "SHA256withECDSA", "Signature") ); algorithmsMap.put( XMLSignature.ALGO_ID_SIGNATURE_ECDSA_SHA384, new Algorithm("", "SHA384withECDSA", "Signature") ); algorithmsMap.put( XMLSignature.ALGO_ID_SIGNATURE_ECDSA_SHA512, new Algorithm("", "SHA512withECDSA", "Signature") ); algorithmsMap.put( XMLSignature.ALGO_ID_MAC_HMAC_NOT_RECOMMENDED_MD5, new Algorithm("", "HmacMD5", "Mac") ); algorithmsMap.put( XMLSignature.ALGO_ID_MAC_HMAC_RIPEMD160, new Algorithm("", "HMACRIPEMD160", "Mac") ); algorithmsMap.put( XMLSignature.ALGO_ID_MAC_HMAC_SHA1, new Algorithm("", "HmacSHA1", "Mac") ); algorithmsMap.put( XMLSignature.ALGO_ID_MAC_HMAC_SHA256, new Algorithm("", "HmacSHA256", "Mac") ); algorithmsMap.put( XMLSignature.ALGO_ID_MAC_HMAC_SHA384, new Algorithm("", "HmacSHA384", "Mac") ); algorithmsMap.put( XMLSignature.ALGO_ID_MAC_HMAC_SHA512, new Algorithm("", "HmacSHA512", "Mac") ); algorithmsMap.put( XMLCipher.TRIPLEDES, new Algorithm("DESede", "DESede/CBC/ISO10126Padding", "BlockEncryption", 192) ); algorithmsMap.put( XMLCipher.AES_128, new Algorithm("AES", "AES/CBC/ISO10126Padding", "BlockEncryption", 128) ); algorithmsMap.put( XMLCipher.AES_192, new Algorithm("AES", "AES/CBC/ISO10126Padding", "BlockEncryption", 192) ); algorithmsMap.put( XMLCipher.AES_256, new Algorithm("AES", "AES/CBC/ISO10126Padding", "BlockEncryption", 256) ); algorithmsMap.put( XMLCipher.AES_128_GCM, new Algorithm("AES", "AES/GCM/NoPadding", "BlockEncryption", 128) ); algorithmsMap.put( XMLCipher.AES_192_GCM, new Algorithm("AES", "AES/GCM/NoPadding", "BlockEncryption", 192) ); algorithmsMap.put( XMLCipher.AES_256_GCM, new Algorithm("AES", "AES/GCM/NoPadding", "BlockEncryption", 256) ); algorithmsMap.put( XMLCipher.RSA_v1dot5, new Algorithm("RSA", "RSA/ECB/PKCS1Padding", "KeyTransport") ); algorithmsMap.put( XMLCipher.RSA_OAEP, new Algorithm("RSA", "RSA/ECB/OAEPPadding", "KeyTransport") ); algorithmsMap.put( XMLCipher.RSA_OAEP_11, new Algorithm("RSA", "RSA/ECB/OAEPPadding", "KeyTransport") ); algorithmsMap.put( XMLCipher.DIFFIE_HELLMAN, new Algorithm("", "", "KeyAgreement") ); algorithmsMap.put( XMLCipher.TRIPLEDES_KeyWrap, new Algorithm("DESede", "DESedeWrap", "SymmetricKeyWrap", 192) ); algorithmsMap.put( XMLCipher.AES_128_KeyWrap, new Algorithm("AES", "AESWrap", "SymmetricKeyWrap", 128) ); algorithmsMap.put( XMLCipher.AES_192_KeyWrap, new Algorithm("AES", "AESWrap", "SymmetricKeyWrap", 192) ); algorithmsMap.put( XMLCipher.AES_256_KeyWrap, new Algorithm("AES", "AESWrap", "SymmetricKeyWrap", 256) ); }
static void function() { algorithmsMap.put( MessageDigestAlgorithm.ALGO_ID_DIGEST_NOT_RECOMMENDED_MD5, new Algorithm(STRMD5STRMessageDigest") ); algorithmsMap.put( MessageDigestAlgorithm.ALGO_ID_DIGEST_RIPEMD160, new Algorithm(STRRIPEMD160STRMessageDigest") ); algorithmsMap.put( MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA1, new Algorithm(STRSHA-1STRMessageDigest") ); algorithmsMap.put( MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA256, new Algorithm(STRSHA-256STRMessageDigest") ); algorithmsMap.put( MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA384, new Algorithm(STRSHA-384STRMessageDigest") ); algorithmsMap.put( MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA512, new Algorithm(STRSHA-512STRMessageDigest") ); algorithmsMap.put( XMLSignature.ALGO_ID_SIGNATURE_DSA, new Algorithm(STRSHA1withDSASTRSignature") ); algorithmsMap.put( XMLSignature.ALGO_ID_SIGNATURE_NOT_RECOMMENDED_RSA_MD5, new Algorithm(STRMD5withRSASTRSignature") ); algorithmsMap.put( XMLSignature.ALGO_ID_SIGNATURE_RSA_RIPEMD160, new Algorithm(STRRIPEMD160withRSASTRSignature") ); algorithmsMap.put( XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA1, new Algorithm(STRSHA1withRSASTRSignature") ); algorithmsMap.put( XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA256, new Algorithm(STRSHA256withRSASTRSignature") ); algorithmsMap.put( XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA384, new Algorithm(STRSHA384withRSASTRSignature") ); algorithmsMap.put( XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA512, new Algorithm(STRSHA512withRSASTRSignature") ); algorithmsMap.put( XMLSignature.ALGO_ID_SIGNATURE_ECDSA_SHA1, new Algorithm(STRSHA1withECDSASTRSignature") ); algorithmsMap.put( XMLSignature.ALGO_ID_SIGNATURE_ECDSA_SHA256, new Algorithm(STRSHA256withECDSASTRSignature") ); algorithmsMap.put( XMLSignature.ALGO_ID_SIGNATURE_ECDSA_SHA384, new Algorithm(STRSHA384withECDSASTRSignature") ); algorithmsMap.put( XMLSignature.ALGO_ID_SIGNATURE_ECDSA_SHA512, new Algorithm(STRSHA512withECDSASTRSignature") ); algorithmsMap.put( XMLSignature.ALGO_ID_MAC_HMAC_NOT_RECOMMENDED_MD5, new Algorithm(STRHmacMD5STRMac") ); algorithmsMap.put( XMLSignature.ALGO_ID_MAC_HMAC_RIPEMD160, new Algorithm(STRHMACRIPEMD160STRMac") ); algorithmsMap.put( XMLSignature.ALGO_ID_MAC_HMAC_SHA1, new Algorithm(STRHmacSHA1STRMac") ); algorithmsMap.put( XMLSignature.ALGO_ID_MAC_HMAC_SHA256, new Algorithm(STRHmacSHA256STRMac") ); algorithmsMap.put( XMLSignature.ALGO_ID_MAC_HMAC_SHA384, new Algorithm(STRHmacSHA384STRMac") ); algorithmsMap.put( XMLSignature.ALGO_ID_MAC_HMAC_SHA512, new Algorithm(STRHmacSHA512STRMacSTRDESedeSTRDESede/CBC/ISO10126PaddingSTRBlockEncryptionSTRAESSTRAES/CBC/ISO10126PaddingSTRBlockEncryptionSTRAESSTRAES/CBC/ISO10126PaddingSTRBlockEncryptionSTRAESSTRAES/CBC/ISO10126PaddingSTRBlockEncryptionSTRAESSTRAES/GCM/NoPaddingSTRBlockEncryptionSTRAESSTRAES/GCM/NoPaddingSTRBlockEncryptionSTRAESSTRAES/GCM/NoPaddingSTRBlockEncryptionSTRRSASTRRSA/ECB/PKCS1PaddingSTRKeyTransportSTRRSASTRRSA/ECB/OAEPPaddingSTRKeyTransportSTRRSASTRRSA/ECB/OAEPPaddingSTRKeyTransport") ); algorithmsMap.put( XMLCipher.DIFFIE_HELLMAN, new Algorithm(STRSTRKeyAgreementSTRDESedeSTRDESedeWrapSTRSymmetricKeyWrapSTRAESSTRAESWrapSTRSymmetricKeyWrapSTRAESSTRAESWrapSTRSymmetricKeyWrapSTRAESSTRAESWrapSTRSymmetricKeyWrap", 256) ); }
/** * This method registers the default algorithms. */
This method registers the default algorithms
registerDefaultAlgorithms
{ "repo_name": "stain/jdk8u", "path": "src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/JCEMapper.java", "license": "gpl-2.0", "size": 12175 }
[ "com.sun.org.apache.xml.internal.security.encryption.XMLCipher", "com.sun.org.apache.xml.internal.security.signature.XMLSignature" ]
import com.sun.org.apache.xml.internal.security.encryption.XMLCipher; import com.sun.org.apache.xml.internal.security.signature.XMLSignature;
import com.sun.org.apache.xml.internal.security.encryption.*; import com.sun.org.apache.xml.internal.security.signature.*;
[ "com.sun.org" ]
com.sun.org;
721,638
public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { return par1ItemStack; }
ItemStack function(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { return par1ItemStack; }
/** * Prevents the item from being consumed on use */
Prevents the item from being consumed on use
onEaten
{ "repo_name": "GhostMonk3408/MidgarCrusade", "path": "src/main/java/fr/toss/FF7Weapons/Artemisbow.java", "license": "lgpl-2.1", "size": 3498 }
[ "net.minecraft.entity.player.EntityPlayer", "net.minecraft.item.ItemStack", "net.minecraft.world.World" ]
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World;
import net.minecraft.entity.player.*; import net.minecraft.item.*; import net.minecraft.world.*;
[ "net.minecraft.entity", "net.minecraft.item", "net.minecraft.world" ]
net.minecraft.entity; net.minecraft.item; net.minecraft.world;
1,701,434
public static void init( long seed ) { generator = new Random( seed ); dataGenerator = new RandomDataGenerator( new Well19937c( seed ) ); } private RandomChooser() { }
static void function( long seed ) { generator = new Random( seed ); dataGenerator = new RandomDataGenerator( new Well19937c( seed ) ); } private RandomChooser() { }
/** * Initialized the random number generator with a given seed. * * @param seed */
Initialized the random number generator with a given seed
init
{ "repo_name": "ppavlidis/baseCode", "path": "src/ubic/basecode/math/RandomChooser.java", "license": "apache-2.0", "size": 5318 }
[ "java.util.Random", "org.apache.commons.math3.random.RandomDataGenerator", "org.apache.commons.math3.random.Well19937c" ]
import java.util.Random; import org.apache.commons.math3.random.RandomDataGenerator; import org.apache.commons.math3.random.Well19937c;
import java.util.*; import org.apache.commons.math3.random.*;
[ "java.util", "org.apache.commons" ]
java.util; org.apache.commons;
1,922,512
private Set search(String attributeName, String attributeValue, String[] attrs) throws CertStoreException { String filter = attributeName + "=" + attributeValue; if (attributeName == null) { filter = null; } DirContext ctx = null; Set set = new HashSet(); try { ctx = connectLDAP(); SearchControls constraints = new SearchControls(); constraints.setSearchScope(SearchControls.SUBTREE_SCOPE); constraints.setCountLimit(0); for (int i = 0; i < attrs.length; i++) { String temp[] = new String[1]; temp[0] = attrs[i]; constraints.setReturningAttributes(temp); String filter2 = "(&(" + filter + ")(" + temp[0] + "=*))"; if (filter == null) { filter2 = "(" + temp[0] + "=*)"; } NamingEnumeration results = ctx.search(params.getBaseDN(), filter2, constraints); while (results.hasMoreElements()) { SearchResult sr = (SearchResult)results.next(); // should only be one attribute in the attribute set with // one // attribute value as byte array NamingEnumeration enumeration = ((Attribute)(sr .getAttributes().getAll().next())).getAll(); while (enumeration.hasMore()) { Object o = enumeration.next(); set.add(o); } } } } catch (Exception e) { throw new CertStoreException( "Error getting results from LDAP directory " + e); } finally { try { if (null != ctx) { ctx.close(); } } catch (Exception e) { } } return set; }
Set function(String attributeName, String attributeValue, String[] attrs) throws CertStoreException { String filter = attributeName + "=" + attributeValue; if (attributeName == null) { filter = null; } DirContext ctx = null; Set set = new HashSet(); try { ctx = connectLDAP(); SearchControls constraints = new SearchControls(); constraints.setSearchScope(SearchControls.SUBTREE_SCOPE); constraints.setCountLimit(0); for (int i = 0; i < attrs.length; i++) { String temp[] = new String[1]; temp[0] = attrs[i]; constraints.setReturningAttributes(temp); String filter2 = "(&(" + filter + ")(" + temp[0] + "=*))"; if (filter == null) { filter2 = "(" + temp[0] + "=*)"; } NamingEnumeration results = ctx.search(params.getBaseDN(), filter2, constraints); while (results.hasMoreElements()) { SearchResult sr = (SearchResult)results.next(); NamingEnumeration enumeration = ((Attribute)(sr .getAttributes().getAll().next())).getAll(); while (enumeration.hasMore()) { Object o = enumeration.next(); set.add(o); } } } } catch (Exception e) { throw new CertStoreException( STR + e); } finally { try { if (null != ctx) { ctx.close(); } } catch (Exception e) { } } return set; }
/** * Returns a Set of byte arrays with the certificate or CRL encodings. * * @param attributeName The attribute name to look for in the LDAP. * @param attributeValue The value the attribute name must have. * @param attrs The attributes in the LDAP which hold the certificate, * certificate pair or CRL in a found entry. * @return Set of byte arrays with the certificate encodings. */
Returns a Set of byte arrays with the certificate or CRL encodings
search
{ "repo_name": "dirtyfilthy/dirtyfilthy-bouncycastle", "path": "net/dirtyfilthy/bouncycastle/jce/provider/X509LDAPCertStoreSpi.java", "license": "mit", "size": 16002 }
[ "java.security.cert.CertStoreException", "java.util.HashSet", "java.util.Set", "javax.naming.NamingEnumeration", "javax.naming.directory.Attribute", "javax.naming.directory.DirContext", "javax.naming.directory.SearchControls", "javax.naming.directory.SearchResult" ]
import java.security.cert.CertStoreException; import java.util.HashSet; import java.util.Set; import javax.naming.NamingEnumeration; import javax.naming.directory.Attribute; import javax.naming.directory.DirContext; import javax.naming.directory.SearchControls; import javax.naming.directory.SearchResult;
import java.security.cert.*; import java.util.*; import javax.naming.*; import javax.naming.directory.*;
[ "java.security", "java.util", "javax.naming" ]
java.security; java.util; javax.naming;
2,094,575
@Override public void addOption(String s) { CircleCADToolState actualState = (CircleCADToolState) _fsm .getPreviousState(); String status = actualState.getName(); if (status == "Circle.CenterPointOr3p") { if (s.equalsIgnoreCase(PluginServices.getText(this, "CircleCADTool.3p"))) { // Opción correcta. } } }
void function(String s) { CircleCADToolState actualState = (CircleCADToolState) _fsm .getPreviousState(); String status = actualState.getName(); if (status == STR) { if (s.equalsIgnoreCase(PluginServices.getText(this, STR))) { } } }
/** * Add a diferent option. * * @param s * Diferent option. */
Add a diferent option
addOption
{ "repo_name": "iCarto/siga", "path": "extCAD/src/com/iver/cit/gvsig/gui/cad/tools/CircleCADTool.java", "license": "gpl-3.0", "size": 6096 }
[ "com.iver.andami.PluginServices", "com.iver.cit.gvsig.gui.cad.tools.smc.CircleCADToolContext" ]
import com.iver.andami.PluginServices; import com.iver.cit.gvsig.gui.cad.tools.smc.CircleCADToolContext;
import com.iver.andami.*; import com.iver.cit.gvsig.gui.cad.tools.smc.*;
[ "com.iver.andami", "com.iver.cit" ]
com.iver.andami; com.iver.cit;
279,533
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) { case REQUEST_CODE_OPENER: if (resultCode == RESULT_OK) { mSelectedFileId = (DriveId) data.getParcelableExtra( OpenFileActivityBuilder.EXTRA_RESPONSE_DRIVE_ID); refresh(); } else { finish(); } break; default: super.onActivityResult(requestCode, resultCode, data); } }
void function(int requestCode, int resultCode, Intent data) { switch (requestCode) { case REQUEST_CODE_OPENER: if (resultCode == RESULT_OK) { mSelectedFileId = (DriveId) data.getParcelableExtra( OpenFileActivityBuilder.EXTRA_RESPONSE_DRIVE_ID); refresh(); } else { finish(); } break; default: super.onActivityResult(requestCode, resultCode, data); } }
/** * Handles response from file picker. */
Handles response from file picker
onActivityResult
{ "repo_name": "jvkops/android-demos", "path": "src/com/google/android/gms/drive/sample/demo/events/ListenChangeEventsForFilesActivity.java", "license": "apache-2.0", "size": 5755 }
[ "android.content.Intent", "com.google.android.gms.drive.DriveId", "com.google.android.gms.drive.OpenFileActivityBuilder" ]
import android.content.Intent; import com.google.android.gms.drive.DriveId; import com.google.android.gms.drive.OpenFileActivityBuilder;
import android.content.*; import com.google.android.gms.drive.*;
[ "android.content", "com.google.android" ]
android.content; com.google.android;
1,364,385
@RequestMapping(CRUDControllerConfig.STD_SAVE_COMMAND) public ModelAndView save(@ModelAttribute("form") BillingInformationForm form, Locale locale) { return doSave(form, locale); }
@RequestMapping(CRUDControllerConfig.STD_SAVE_COMMAND) ModelAndView function(@ModelAttribute("form") BillingInformationForm form, Locale locale) { return doSave(form, locale); }
/** * Saves an entity and returns a refreshed list type page. * * @param form The object containing the values of the entity to be saved. * @param locale The current locale. * @return The list type view. */
Saves an entity and returns a refreshed list type page
save
{ "repo_name": "NCIP/calims", "path": "calims2-webapp/src/java/gov/nih/nci/calims2/ui/administration/customerservice/billinginformation/BillingInformationController.java", "license": "bsd-3-clause", "size": 5160 }
[ "gov.nih.nci.calims2.ui.generic.crud.CRUDControllerConfig", "java.util.Locale", "org.springframework.web.bind.annotation.ModelAttribute", "org.springframework.web.bind.annotation.RequestMapping", "org.springframework.web.servlet.ModelAndView" ]
import gov.nih.nci.calims2.ui.generic.crud.CRUDControllerConfig; import java.util.Locale; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView;
import gov.nih.nci.calims2.ui.generic.crud.*; import java.util.*; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.*;
[ "gov.nih.nci", "java.util", "org.springframework.web" ]
gov.nih.nci; java.util; org.springframework.web;
1,906,999
@Test public void testExecSQLRow4() throws Exception { KettleEnvironment.init(); // // Create a new transformation... // TransMeta transMeta = new TransMeta(); transMeta.setName( "transname" ); // Add the database connections for ( int i = 0; i < databasesXML.length; i++ ) { DatabaseMeta databaseMeta = new DatabaseMeta( databasesXML[i] ); transMeta.addDatabase( databaseMeta ); } DatabaseMeta dbInfo = transMeta.findDatabase( "db" ); PluginRegistry registry = PluginRegistry.getInstance(); // // create an injector step... // String injectorStepname = "injector step"; InjectorMeta im = new InjectorMeta(); // Set the information of the injector. String injectorPid = registry.getPluginId( StepPluginType.class, im ); StepMeta injectorStep = new StepMeta( injectorPid, injectorStepname, im ); transMeta.addStep( injectorStep ); // // create the Exec SQL Row step... // String stepName = "delete from [" + execsqlrow_testtable + "]"; ExecSQLRowMeta execsqlmeta = new ExecSQLRowMeta(); execsqlmeta.setDatabaseMeta( transMeta.findDatabase( "db" ) ); execsqlmeta.setCommitSize( 3 ); execsqlmeta.setSqlFieldName( "SQL" ); String execSqlRowId = registry.getPluginId( StepPluginType.class, execsqlmeta ); StepMeta execSqlRowStep = new StepMeta( execSqlRowId, stepName, execsqlmeta ); execSqlRowStep.setDescription( "Deletes information from table [" + execsqlrow_testtable + "] on database [" + dbInfo + "]" ); transMeta.addStep( execSqlRowStep ); TransHopMeta hi = new TransHopMeta( injectorStep, execSqlRowStep ); transMeta.addTransHop( hi ); // Now execute the transformation... Trans trans = new Trans( transMeta ); trans.prepareExecution( null ); StepInterface si = trans.getStepInterface( stepName, 0 ); RowStepCollector rc = new RowStepCollector(); si.addRowListener( rc ); RowProducer rp = trans.addRowProducer( injectorStepname, 0 ); trans.startThreads(); // add rows List<RowMetaAndData> inputList = createDataRows(); for ( RowMetaAndData rm : inputList ) { rp.putRow( rm.getRowMeta(), rm.getData() ); } rp.finished(); trans.waitUntilFinished(); List<RowMetaAndData> resultRows = rc.getRowsWritten(); List<RowMetaAndData> goldRows = createResultDataRows(); checkRows( goldRows, resultRows ); }
void function() throws Exception { KettleEnvironment.init(); transMeta.setName( STR ); for ( int i = 0; i < databasesXML.length; i++ ) { DatabaseMeta databaseMeta = new DatabaseMeta( databasesXML[i] ); transMeta.addDatabase( databaseMeta ); } DatabaseMeta dbInfo = transMeta.findDatabase( "db" ); PluginRegistry registry = PluginRegistry.getInstance(); InjectorMeta im = new InjectorMeta(); String injectorPid = registry.getPluginId( StepPluginType.class, im ); StepMeta injectorStep = new StepMeta( injectorPid, injectorStepname, im ); transMeta.addStep( injectorStep ); ExecSQLRowMeta execsqlmeta = new ExecSQLRowMeta(); execsqlmeta.setDatabaseMeta( transMeta.findDatabase( "db" ) ); execsqlmeta.setCommitSize( 3 ); execsqlmeta.setSqlFieldName( "SQL" ); String execSqlRowId = registry.getPluginId( StepPluginType.class, execsqlmeta ); StepMeta execSqlRowStep = new StepMeta( execSqlRowId, stepName, execsqlmeta ); execSqlRowStep.setDescription( STR + execsqlrow_testtable + STR + dbInfo + "]" ); transMeta.addStep( execSqlRowStep ); TransHopMeta hi = new TransHopMeta( injectorStep, execSqlRowStep ); transMeta.addTransHop( hi ); Trans trans = new Trans( transMeta ); trans.prepareExecution( null ); StepInterface si = trans.getStepInterface( stepName, 0 ); RowStepCollector rc = new RowStepCollector(); si.addRowListener( rc ); RowProducer rp = trans.addRowProducer( injectorStepname, 0 ); trans.startThreads(); List<RowMetaAndData> inputList = createDataRows(); for ( RowMetaAndData rm : inputList ) { rp.putRow( rm.getRowMeta(), rm.getData() ); } rp.finished(); trans.waitUntilFinished(); List<RowMetaAndData> resultRows = rc.getRowsWritten(); List<RowMetaAndData> goldRows = createResultDataRows(); checkRows( goldRows, resultRows ); }
/** * Basic Test case for Exec SQL Row. This tests a commit size of three (i.e. not autocommit but equal to input row * size) */
Basic Test case for Exec SQL Row. This tests a commit size of three (i.e. not autocommit but equal to input row size)
testExecSQLRow4
{ "repo_name": "kurtwalker/pentaho-kettle", "path": "integration/src/it/java/org/pentaho/di/trans/steps/execsqlrow/ExecSQLRowIT.java", "license": "apache-2.0", "size": 18737 }
[ "java.util.List", "org.pentaho.di.core.KettleEnvironment", "org.pentaho.di.core.RowMetaAndData", "org.pentaho.di.core.database.DatabaseMeta", "org.pentaho.di.core.plugins.PluginRegistry", "org.pentaho.di.core.plugins.StepPluginType", "org.pentaho.di.trans.RowProducer", "org.pentaho.di.trans.RowStepCollector", "org.pentaho.di.trans.Trans", "org.pentaho.di.trans.TransHopMeta", "org.pentaho.di.trans.step.StepInterface", "org.pentaho.di.trans.step.StepMeta", "org.pentaho.di.trans.steps.injector.InjectorMeta" ]
import java.util.List; import org.pentaho.di.core.KettleEnvironment; import org.pentaho.di.core.RowMetaAndData; import org.pentaho.di.core.database.DatabaseMeta; import org.pentaho.di.core.plugins.PluginRegistry; import org.pentaho.di.core.plugins.StepPluginType; import org.pentaho.di.trans.RowProducer; import org.pentaho.di.trans.RowStepCollector; import org.pentaho.di.trans.Trans; import org.pentaho.di.trans.TransHopMeta; import org.pentaho.di.trans.step.StepInterface; import org.pentaho.di.trans.step.StepMeta; import org.pentaho.di.trans.steps.injector.InjectorMeta;
import java.util.*; import org.pentaho.di.core.*; import org.pentaho.di.core.database.*; import org.pentaho.di.core.plugins.*; import org.pentaho.di.trans.*; import org.pentaho.di.trans.step.*; import org.pentaho.di.trans.steps.injector.*;
[ "java.util", "org.pentaho.di" ]
java.util; org.pentaho.di;
2,045,066
public String getNamedUrl(HttpMethod method, String resourceName) { Route route = routeResolver.getNamedRoute(resourceName, method); if (route != null) { return route.getFullPattern(); } return null; }
String function(HttpMethod method, String resourceName) { Route route = routeResolver.getNamedRoute(resourceName, method); if (route != null) { return route.getFullPattern(); } return null; }
/** * Get the named URL for the given HTTP method * * @param method the HTTP method * @param resourceName the name of the route * @return the URL pattern, or null if the name/method does not exist. */
Get the named URL for the given HTTP method
getNamedUrl
{ "repo_name": "Caijiacheng/pig", "path": "lib/lib-restlite/src/main/java/org/restexpress/Request.java", "license": "mit", "size": 19554 }
[ "io.netty.handler.codec.http.HttpMethod", "org.restexpress.route.Route" ]
import io.netty.handler.codec.http.HttpMethod; import org.restexpress.route.Route;
import io.netty.handler.codec.http.*; import org.restexpress.route.*;
[ "io.netty.handler", "org.restexpress.route" ]
io.netty.handler; org.restexpress.route;
887,564
public static Configuration getEnvConfigWithDependencies(StreamExecutionEnvironment env) throws InvocationTargetException, IllegalAccessException, NoSuchMethodException { return PythonDependencyUtils.configurePythonDependencies( env.getCachedFiles(), getEnvironmentConfig(env)); }
static Configuration function(StreamExecutionEnvironment env) throws InvocationTargetException, IllegalAccessException, NoSuchMethodException { return PythonDependencyUtils.configurePythonDependencies( env.getCachedFiles(), getEnvironmentConfig(env)); }
/** * A static method to get the {@link StreamExecutionEnvironment} configuration merged with * python dependency management configurations. */
A static method to get the <code>StreamExecutionEnvironment</code> configuration merged with python dependency management configurations
getEnvConfigWithDependencies
{ "repo_name": "rmetzger/flink", "path": "flink-python/src/main/java/org/apache/flink/python/util/PythonConfigUtil.java", "license": "apache-2.0", "size": 17852 }
[ "java.lang.reflect.InvocationTargetException", "org.apache.flink.configuration.Configuration", "org.apache.flink.streaming.api.environment.StreamExecutionEnvironment" ]
import java.lang.reflect.InvocationTargetException; import org.apache.flink.configuration.Configuration; import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import java.lang.reflect.*; import org.apache.flink.configuration.*; import org.apache.flink.streaming.api.environment.*;
[ "java.lang", "org.apache.flink" ]
java.lang; org.apache.flink;
1,199,000
return ImmutableMap.copyOf(firstNonNull(tags, Collections.<String, String>emptyMap())); }
return ImmutableMap.copyOf(firstNonNull(tags, Collections.<String, String>emptyMap())); }
/** * Copied from InfluxDbWriterFactory * @param tags * @return */
Copied from InfluxDbWriterFactory
initCustomTagsMap
{ "repo_name": "magullo/jmxtrans", "path": "jmxtrans-output/jmxtrans-output-core/src/main/java/com/googlecode/jmxtrans/model/output/StatsDTelegrafWriterFactory.java", "license": "mit", "size": 4732 }
[ "com.google.common.collect.ImmutableMap", "java.util.Collections" ]
import com.google.common.collect.ImmutableMap; import java.util.Collections;
import com.google.common.collect.*; import java.util.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
1,464,182
@Override public List<ReplicaInfo> getFinalizedBlocks(String bpid) { try (AutoCloseableLock lock = datasetLock.acquire()) { final List<ReplicaInfo> finalized = new ArrayList<ReplicaInfo>( volumeMap.size(bpid)); for (ReplicaInfo b : volumeMap.replicas(bpid)) { if (b.getState() == ReplicaState.FINALIZED) { finalized.add(b); } } return finalized; } }
List<ReplicaInfo> function(String bpid) { try (AutoCloseableLock lock = datasetLock.acquire()) { final List<ReplicaInfo> finalized = new ArrayList<ReplicaInfo>( volumeMap.size(bpid)); for (ReplicaInfo b : volumeMap.replicas(bpid)) { if (b.getState() == ReplicaState.FINALIZED) { finalized.add(b); } } return finalized; } }
/** * Gets a list of references to the finalized blocks for the given block pool. * <p> * Callers of this function should call * {@link FsDatasetSpi#acquireDatasetLock} to avoid blocks' status being * changed during list iteration. * </p> * @return a list of references to the finalized blocks for the given block * pool. */
Gets a list of references to the finalized blocks for the given block pool. Callers of this function should call <code>FsDatasetSpi#acquireDatasetLock</code> to avoid blocks' status being changed during list iteration.
getFinalizedBlocks
{ "repo_name": "ronny-macmaster/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java", "license": "apache-2.0", "size": 117788 }
[ "java.util.ArrayList", "java.util.List", "org.apache.hadoop.hdfs.server.common.HdfsServerConstants", "org.apache.hadoop.hdfs.server.datanode.ReplicaInfo", "org.apache.hadoop.util.AutoCloseableLock" ]
import java.util.ArrayList; import java.util.List; import org.apache.hadoop.hdfs.server.common.HdfsServerConstants; import org.apache.hadoop.hdfs.server.datanode.ReplicaInfo; import org.apache.hadoop.util.AutoCloseableLock;
import java.util.*; import org.apache.hadoop.hdfs.server.common.*; import org.apache.hadoop.hdfs.server.datanode.*; import org.apache.hadoop.util.*;
[ "java.util", "org.apache.hadoop" ]
java.util; org.apache.hadoop;
2,362,285
@Override public List<FlightEntity> findByDate(Date from, Date to) { try { Query query = this.entityManager.createQuery("SELECT f " + "FROM FlightEntity f " + "WHERE f.start > :from AND f.start < :to " + "ORDER BY f.start DESC" ); query.setParameter("from", from); query.setParameter("to", to); return query.getResultList(); } catch (HibernateException e) { return new ArrayList(); } }
List<FlightEntity> function(Date from, Date to) { try { Query query = this.entityManager.createQuery(STR + STR + STR + STR ); query.setParameter("from", from); query.setParameter("to", to); return query.getResultList(); } catch (HibernateException e) { return new ArrayList(); } }
/** * Find flights by date of takes off * @param from Date * @param to Date * @return List of Flights */
Find flights by date of takes off
findByDate
{ "repo_name": "raulsuarezdabo/flight", "path": "src/main/java/com/raulsuarezdabo/flight/dao/FlightDAOImpl.java", "license": "mit", "size": 9430 }
[ "com.raulsuarezdabo.flight.entity.FlightEntity", "java.util.ArrayList", "java.util.Date", "java.util.List", "javax.persistence.Query", "org.hibernate.HibernateException" ]
import com.raulsuarezdabo.flight.entity.FlightEntity; import java.util.ArrayList; import java.util.Date; import java.util.List; import javax.persistence.Query; import org.hibernate.HibernateException;
import com.raulsuarezdabo.flight.entity.*; import java.util.*; import javax.persistence.*; import org.hibernate.*;
[ "com.raulsuarezdabo.flight", "java.util", "javax.persistence", "org.hibernate" ]
com.raulsuarezdabo.flight; java.util; javax.persistence; org.hibernate;
1,312,907
EList<Circle> getVisibleTo();
EList<Circle> getVisibleTo();
/** * Returns the value of the '<em><b>Visible To</b></em>' reference list. * The list contents are of type {@link network.Circle}. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Visible To</em>' reference list isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Visible To</em>' reference list. * @see network.NetworkPackage#getPost_VisibleTo() * @model * @generated */
Returns the value of the 'Visible To' reference list. The list contents are of type <code>network.Circle</code>. If the meaning of the 'Visible To' reference list isn't clear, there really should be more of a description here...
getVisibleTo
{ "repo_name": "tht-krisztian/EMF-IncQuery-Examples", "path": "network/network/src/network/Post.java", "license": "epl-1.0", "size": 2857 }
[ "org.eclipse.emf.common.util.EList" ]
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
605,142
private TrimResult dummyProject(int fieldCount, RelNode input) { final RelOptCluster cluster = input.getCluster(); final Mapping mapping = Mappings.create(MappingType.INVERSE_SURJECTION, fieldCount, 1); if (input.getRowType().getFieldCount() == 1) { // Input already has one field (and may in fact be a dummy project we // created for the child). We can't do better. return new TrimResult(input, mapping); } final RexLiteral expr = cluster.getRexBuilder().makeExactLiteral(BigDecimal.ZERO); final RelNode newProject = projectFactory.createProject(input, ImmutableList.<RexNode>of(expr), ImmutableList.of("DUMMY")); return new TrimResult(newProject, mapping); }
TrimResult function(int fieldCount, RelNode input) { final RelOptCluster cluster = input.getCluster(); final Mapping mapping = Mappings.create(MappingType.INVERSE_SURJECTION, fieldCount, 1); if (input.getRowType().getFieldCount() == 1) { return new TrimResult(input, mapping); } final RexLiteral expr = cluster.getRexBuilder().makeExactLiteral(BigDecimal.ZERO); final RelNode newProject = projectFactory.createProject(input, ImmutableList.<RexNode>of(expr), ImmutableList.of("DUMMY")); return new TrimResult(newProject, mapping); }
/** Creates a project with a dummy column, to protect the parts of the system * that cannot handle a relational expression with no columns. * * @param fieldCount Number of fields in the original relational expression * @param input Trimmed input * @return Dummy project, or null if no dummy is required */
Creates a project with a dummy column, to protect the parts of the system that cannot handle a relational expression with no columns
dummyProject
{ "repo_name": "mehant/incubator-calcite", "path": "core/src/main/java/org/apache/calcite/sql2rel/RelFieldTrimmer.java", "license": "apache-2.0", "size": 41128 }
[ "com.google.common.collect.ImmutableList", "java.math.BigDecimal", "org.apache.calcite.plan.RelOptCluster", "org.apache.calcite.rel.RelNode", "org.apache.calcite.rex.RexLiteral", "org.apache.calcite.rex.RexNode", "org.apache.calcite.util.mapping.Mapping", "org.apache.calcite.util.mapping.MappingType", "org.apache.calcite.util.mapping.Mappings" ]
import com.google.common.collect.ImmutableList; import java.math.BigDecimal; import org.apache.calcite.plan.RelOptCluster; import org.apache.calcite.rel.RelNode; import org.apache.calcite.rex.RexLiteral; import org.apache.calcite.rex.RexNode; import org.apache.calcite.util.mapping.Mapping; import org.apache.calcite.util.mapping.MappingType; import org.apache.calcite.util.mapping.Mappings;
import com.google.common.collect.*; import java.math.*; import org.apache.calcite.plan.*; import org.apache.calcite.rel.*; import org.apache.calcite.rex.*; import org.apache.calcite.util.mapping.*;
[ "com.google.common", "java.math", "org.apache.calcite" ]
com.google.common; java.math; org.apache.calcite;
2,367,781
INDArray compress(double[] data);
INDArray compress(double[] data);
/** * This method creates compressed INDArray from Java double array, skipping usual INDArray instantiation routines * Please note: This method compresses input data as vector * * @param data * @return */
This method creates compressed INDArray from Java double array, skipping usual INDArray instantiation routines Please note: This method compresses input data as vector
compress
{ "repo_name": "deeplearning4j/nd4j", "path": "nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/compression/NDArrayCompressor.java", "license": "apache-2.0", "size": 2908 }
[ "org.nd4j.linalg.api.ndarray.INDArray" ]
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.api.ndarray.*;
[ "org.nd4j.linalg" ]
org.nd4j.linalg;
1,469,253
private void checkAlterIntervalConverters() throws SecurityException { SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(new JodaTimePermission("ConverterManager.alterIntervalConverters")); } }
void function() throws SecurityException { SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(new JodaTimePermission(STR)); } }
/** * Checks whether the user has permission 'ConverterManager.alterIntervalConverters'. * * @throws SecurityException if the user does not have the permission */
Checks whether the user has permission 'ConverterManager.alterIntervalConverters'
checkAlterIntervalConverters
{ "repo_name": "wspeirs/sop4j-base", "path": "src/main/java/com/sop4j/base/joda/time/convert/ConverterManager.java", "license": "apache-2.0", "size": 22081 }
[ "com.sop4j.base.joda.time.JodaTimePermission" ]
import com.sop4j.base.joda.time.JodaTimePermission;
import com.sop4j.base.joda.time.*;
[ "com.sop4j.base" ]
com.sop4j.base;
2,407,159
public static void checkNotEmpty(final String name, final Map<?, ?> parameter) { if (parameter == null || parameter.size() == 0) { throw new IllegalArgumentException("Parameter named '" + name + "' should be filled!"); } }
static void function(final String name, final Map<?, ?> parameter) { if (parameter == null parameter.size() == 0) { throw new IllegalArgumentException(STR + name + STR); } }
/** * Assert that this parameter is not empty. It will test for null and also the size of this array. * @param name of parameter * @param parameter itself */
Assert that this parameter is not empty. It will test for null and also the size of this array
checkNotEmpty
{ "repo_name": "droolsjbpm/drools", "path": "drools-verifier/drools-verifier-core/src/main/java/org/drools/verifier/core/util/PortablePreconditions.java", "license": "apache-2.0", "size": 4406 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,890,924
@ServiceMethod(returns = ReturnType.SINGLE) GatewayRouteListResultInner getLearnedRoutes( String resourceGroupName, String virtualNetworkGatewayName, Context context);
@ServiceMethod(returns = ReturnType.SINGLE) GatewayRouteListResultInner getLearnedRoutes( String resourceGroupName, String virtualNetworkGatewayName, Context context);
/** * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from * BGP peers. * * @param resourceGroupName The name of the resource group. * @param virtualNetworkGatewayName The name of the virtual network gateway. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of virtual network gateway routes. */
This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers
getLearnedRoutes
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VirtualNetworkGatewaysClient.java", "license": "mit", "size": 135947 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.util.Context", "com.azure.resourcemanager.network.fluent.models.GatewayRouteListResultInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.util.Context; import com.azure.resourcemanager.network.fluent.models.GatewayRouteListResultInner;
import com.azure.core.annotation.*; import com.azure.core.util.*; import com.azure.resourcemanager.network.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,644,754
@Test public void testCreateDropRole() throws Exception { Connection connection = context.createConnection(ADMIN1); Statement statement = context.createStatement(connection); statement.execute("CREATE ROLE role1"); ResultSet resultSet = statement.executeQuery("SHOW roles"); assertResultSize(resultSet, 1); statement.execute("DROP ROLE role1"); resultSet = statement.executeQuery("SHOW roles"); assertResultSize(resultSet, 0); }
void function() throws Exception { Connection connection = context.createConnection(ADMIN1); Statement statement = context.createStatement(connection); statement.execute(STR); ResultSet resultSet = statement.executeQuery(STR); assertResultSize(resultSet, 1); statement.execute(STR); resultSet = statement.executeQuery(STR); assertResultSize(resultSet, 0); }
/** * Create and Drop role by admin * @throws Exception */
Create and Drop role by admin
testCreateDropRole
{ "repo_name": "intel-hadoop/incubator-sentry", "path": "sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDatabaseProvider.java", "license": "apache-2.0", "size": 90665 }
[ "java.sql.Connection", "java.sql.ResultSet", "java.sql.Statement" ]
import java.sql.Connection; import java.sql.ResultSet; import java.sql.Statement;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,856,787
public FieldDescriptor getFieldDescriptor() { return fieldDescriptor; }
FieldDescriptor function() { return fieldDescriptor; }
/** * Get the fields descriptor this list represents. * @return a field descriptor. */
Get the fields descriptor this list represents
getFieldDescriptor
{ "repo_name": "JoeCarlson/intermine", "path": "intermine/web/main/src/org/intermine/web/logic/results/InlineResultsTable.java", "license": "lgpl-2.1", "size": 15930 }
[ "org.intermine.metadata.FieldDescriptor" ]
import org.intermine.metadata.FieldDescriptor;
import org.intermine.metadata.*;
[ "org.intermine.metadata" ]
org.intermine.metadata;
1,131,879
public ServletContext getServletContext() { if (manager == null) { return null; } Context context = (Context) manager.getContainer(); return context.getServletContext(); }
ServletContext function() { if (manager == null) { return null; } Context context = (Context) manager.getContainer(); return context.getServletContext(); }
/** * Return the ServletContext to which this session belongs. */
Return the ServletContext to which this session belongs
getServletContext
{ "repo_name": "yuyupapa/OpenSource", "path": "apache-tomcat-6.0.48/java/org/apache/catalina/session/StandardSession.java", "license": "apache-2.0", "size": 60890 }
[ "javax.servlet.ServletContext", "org.apache.catalina.Context" ]
import javax.servlet.ServletContext; import org.apache.catalina.Context;
import javax.servlet.*; import org.apache.catalina.*;
[ "javax.servlet", "org.apache.catalina" ]
javax.servlet; org.apache.catalina;
2,654,172
public static ArrayList<Products> getOrderedItems() { return orderedItems; }
static ArrayList<Products> function() { return orderedItems; }
/** * Get the list of ordered items. * * @return list of ordered items */
Get the list of ordered items
getOrderedItems
{ "repo_name": "firstvan/OrderTaker", "path": "model/src/main/java/hu/firstvan/model/Datas.java", "license": "gpl-3.0", "size": 4502 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
2,196,025