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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
// ------------------------------------------------------------------------
protected PlayerState getState(Player player) {
return _state.get(player.getName());
} | PlayerState function(Player player) { return _state.get(player.getName()); } | /**
* Return the {@link PlayerState} for the specified player.
*
* @param player the player.
* @return the {@link PlayerState} for the specified player.
*/ | Return the <code>PlayerState</code> for the specified player | getState | {
"repo_name": "totemo/WingCommander",
"path": "src/io/totemo/wingcommander/WingCommander.java",
"license": "mit",
"size": 14047
} | [
"org.bukkit.entity.Player"
] | import org.bukkit.entity.Player; | import org.bukkit.entity.*; | [
"org.bukkit.entity"
] | org.bukkit.entity; | 1,900,905 |
void removeTileFromQueues(final MapTile mapTile) {
synchronized (mQueueLockObject) {
if (DEBUG_TILE_PROVIDERS) {
Log.d(TAG, "MapTileModuleLayerBase.removeTileFromQueues() on provider: "
+ getName()
+ " for tile: "
... | void removeTileFromQueues(final MapTile mapTile) { synchronized (mQueueLockObject) { if (DEBUG_TILE_PROVIDERS) { Log.d(TAG, STR + getName() + STR + mapTile); } mPending.remove(mapTile); mWorking.remove(mapTile); } } | /**
* Marks a given map tile as neither being downloaded or worked on.
*/ | Marks a given map tile as neither being downloaded or worked on | removeTileFromQueues | {
"repo_name": "RoProducts/rastertheque",
"path": "MapboxLibrary/src/com/mapbox/mapboxsdk/tileprovider/modules/MapTileModuleLayerBase.java",
"license": "gpl-2.0",
"size": 12504
} | [
"android.util.Log",
"com.mapbox.mapboxsdk.tileprovider.MapTile"
] | import android.util.Log; import com.mapbox.mapboxsdk.tileprovider.MapTile; | import android.util.*; import com.mapbox.mapboxsdk.tileprovider.*; | [
"android.util",
"com.mapbox.mapboxsdk"
] | android.util; com.mapbox.mapboxsdk; | 165,682 |
LinkedList<StreamAppDefinition> getAppDefinitions(StreamDefinition streamDefinition); | LinkedList<StreamAppDefinition> getAppDefinitions(StreamDefinition streamDefinition); | /**
* Return the linked list of {@link StreamAppDefinition}s associated with the stream definition.
*
* @param streamDefinition the stream definition
* @return the linked list of stream app definitions
*/ | Return the linked list of <code>StreamAppDefinition</code>s associated with the stream definition | getAppDefinitions | {
"repo_name": "markpollack/spring-cloud-dataflow",
"path": "spring-cloud-dataflow-core/src/main/java/org/springframework/cloud/dataflow/core/StreamDefinitionService.java",
"license": "apache-2.0",
"size": 2511
} | [
"java.util.LinkedList"
] | import java.util.LinkedList; | import java.util.*; | [
"java.util"
] | java.util; | 886,179 |
public SharesGetAccessPolicyHeaders setDateProperty(OffsetDateTime dateProperty) {
if (dateProperty == null) {
this.dateProperty = null;
} else {
this.dateProperty = new DateTimeRfc1123(dateProperty);
}
return this;
} | SharesGetAccessPolicyHeaders function(OffsetDateTime dateProperty) { if (dateProperty == null) { this.dateProperty = null; } else { this.dateProperty = new DateTimeRfc1123(dateProperty); } return this; } | /**
* Set the dateProperty property: The Date property.
*
* @param dateProperty the dateProperty value to set.
* @return the SharesGetAccessPolicyHeaders object itself.
*/ | Set the dateProperty property: The Date property | setDateProperty | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharesGetAccessPolicyHeaders.java",
"license": "mit",
"size": 4377
} | [
"com.azure.core.util.DateTimeRfc1123",
"java.time.OffsetDateTime"
] | import com.azure.core.util.DateTimeRfc1123; import java.time.OffsetDateTime; | import com.azure.core.util.*; import java.time.*; | [
"com.azure.core",
"java.time"
] | com.azure.core; java.time; | 1,392,198 |
@SuppressWarnings("unchecked")
private Resource buildResource(String fullpath, Iterable<Resource> children, ResourceResolver resourceResolver, ResourceProvider<?> provider, String ... properties) {
Resource resource = Mockito.mock(Resource.class);
Mockito.when(resource.getName()).thenReturn(getN... | @SuppressWarnings(STR) Resource function(String fullpath, Iterable<Resource> children, ResourceResolver resourceResolver, ResourceProvider<?> provider, String ... properties) { Resource resource = Mockito.mock(Resource.class); Mockito.when(resource.getName()).thenReturn(getName(fullpath)); Mockito.when(resource.getPath... | /**
* Build a resource with path, children and resource resolver.
* @param fullpath
* @param children
* @param resourceResolver
* @return
*/ | Build a resource with path, children and resource resolver | buildResource | {
"repo_name": "ist-dresden/sling",
"path": "bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/MockedResourceResolverImplTest.java",
"license": "apache-2.0",
"size": 29140
} | [
"org.apache.sling.api.resource.Resource",
"org.apache.sling.api.resource.ResourceMetadata",
"org.apache.sling.api.resource.ResourceResolver",
"org.apache.sling.api.resource.ValueMap",
"org.apache.sling.api.wrappers.ValueMapDecorator",
"org.apache.sling.spi.resource.provider.ResolveContext",
"org.apache.... | import org.apache.sling.api.resource.Resource; import org.apache.sling.api.resource.ResourceMetadata; import org.apache.sling.api.resource.ResourceResolver; import org.apache.sling.api.resource.ValueMap; import org.apache.sling.api.wrappers.ValueMapDecorator; import org.apache.sling.spi.resource.provider.ResolveContext... | import org.apache.sling.api.resource.*; import org.apache.sling.api.wrappers.*; import org.apache.sling.spi.resource.provider.*; import org.mockito.*; | [
"org.apache.sling",
"org.mockito"
] | org.apache.sling; org.mockito; | 2,728,720 |
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public void start(Context context, Fragment fragment, int requestCode) {
fragment.startActivityForResult(getIntent(context), requestCode);
} | @TargetApi(Build.VERSION_CODES.HONEYCOMB) void function(Context context, Fragment fragment, int requestCode) { fragment.startActivityForResult(getIntent(context), requestCode); } | /**
* Send the crop Intent with a custom request code
*
* @param context Context
* @param fragment Fragment to receive result
* @param requestCode requestCode for result
*/ | Send the crop Intent with a custom request code | start | {
"repo_name": "jjz/android-crop",
"path": "crop/src/main/java/com/soundcloud/android/crop/Crop.java",
"license": "apache-2.0",
"size": 8005
} | [
"android.annotation.TargetApi",
"android.app.Fragment",
"android.content.Context",
"android.os.Build"
] | import android.annotation.TargetApi; import android.app.Fragment; import android.content.Context; import android.os.Build; | import android.annotation.*; import android.app.*; import android.content.*; import android.os.*; | [
"android.annotation",
"android.app",
"android.content",
"android.os"
] | android.annotation; android.app; android.content; android.os; | 1,664,146 |
public String toTableId(String tableName) {
Preconditions.checkNotNull(tableName, "Table name cannot be null");
String tablesPrefix = instanceName + TABLE_SEPARATOR;
Preconditions.checkState(tableName.startsWith(tablesPrefix),
"'%s' does not start with '%s'", tableName, tablesPrefix);
String t... | String function(String tableName) { Preconditions.checkNotNull(tableName, STR); String tablesPrefix = instanceName + TABLE_SEPARATOR; Preconditions.checkState(tableName.startsWith(tablesPrefix), STR, tableName, tablesPrefix); String tableId = tableName.substring(tablesPrefix.length()).trim(); Preconditions.checkState(!... | /**
* Transforms a tableName within this instance of the form
* projects/(projectId)/instances/(instanceId)/tables/(tableId) to (tableId).
*
* @param tableName a {@link java.lang.String} object.
* @return a {@link java.lang.String} object.
*/ | Transforms a tableName within this instance of the form projects/(projectId)/instances/(instanceId)/tables/(tableId) to (tableId) | toTableId | {
"repo_name": "rameshdharan/cloud-bigtable-client",
"path": "bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableInstanceName.java",
"license": "apache-2.0",
"size": 4008
} | [
"com.google.common.base.Preconditions"
] | import com.google.common.base.Preconditions; | import com.google.common.base.*; | [
"com.google.common"
] | com.google.common; | 599,709 |
public DataFormat getDataFormat(); | DataFormat function(); | /**
* Method returns the <code>DataFormat</code> of the raw data.
*
* @return dataFormat
*/ | Method returns the <code>DataFormat</code> of the raw data | getDataFormat | {
"repo_name": "SciGaP/DEPRECATED-Cipres-Airavata-POC",
"path": "saminda/cipres-airavata/sdk/src/main/java/org/ngbw/sdk/database/SourceDocument.java",
"license": "apache-2.0",
"size": 2345
} | [
"org.ngbw.sdk.core.types.DataFormat"
] | import org.ngbw.sdk.core.types.DataFormat; | import org.ngbw.sdk.core.types.*; | [
"org.ngbw.sdk"
] | org.ngbw.sdk; | 330,385 |
public void onClick(View view) { //click listener for save button
MediaStore.Images.Media.insertImage(getContentResolver(), bmp, "Intruder", "Image taken when home status was set to away");
Toast.makeText(this, "Image saved", Toast.LENGTH_LONG).show();
} | void function(View view) { MediaStore.Images.Media.insertImage(getContentResolver(), bmp, STR, STR); Toast.makeText(this, STR, Toast.LENGTH_LONG).show(); } | /**
* Displays a message when button is clicked. If user inputs(atleast 1 character, otherwise toast is displayed) and clicks the input to the database.
* Executes asynchronous task, sends name string
*
* @param view
*/ | Displays a message when button is clicked. If user inputs(atleast 1 character, otherwise toast is displayed) and clicks the input to the database. Executes asynchronous task, sends name string | onClick | {
"repo_name": "sahmad8/SmartHomeApp",
"path": "sample/src/main/java/com/ms/square/android/com.saadahmad.smarthome/Intruder.java",
"license": "apache-2.0",
"size": 6681
} | [
"android.provider.MediaStore",
"android.view.View",
"android.widget.Toast"
] | import android.provider.MediaStore; import android.view.View; import android.widget.Toast; | import android.provider.*; import android.view.*; import android.widget.*; | [
"android.provider",
"android.view",
"android.widget"
] | android.provider; android.view; android.widget; | 2,583,121 |
public void doFinal() throws WSSPolicyException {
verifyPolicy();
} | void function() throws WSSPolicyException { verifyPolicy(); } | /**
* the final Policy validation to find a satisfied alternative
*
* @throws PolicyViolationException if no alternative could be satisfied
*/ | the final Policy validation to find a satisfied alternative | doFinal | {
"repo_name": "clibois/wss4j",
"path": "ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/enforcer/PolicyEnforcer.java",
"license": "apache-2.0",
"size": 45741
} | [
"org.apache.wss4j.common.WSSPolicyException"
] | import org.apache.wss4j.common.WSSPolicyException; | import org.apache.wss4j.common.*; | [
"org.apache.wss4j"
] | org.apache.wss4j; | 1,879,248 |
private SosEnvelope getEnvelope(final SosOffering offering) {
return getCache().getEnvelopeForOffering(offering.getOfferingIdentifier());
} | SosEnvelope function(final SosOffering offering) { return getCache().getEnvelopeForOffering(offering.getOfferingIdentifier()); } | /**
* Get the sosEnvelope for the given offering.
*
* @param offering the offering
*
* @return the sosEnvelope (may be <code>null</code>)
*/ | Get the sosEnvelope for the given offering | getEnvelope | {
"repo_name": "USGS-CIDA/SOS",
"path": "hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/procedure/enrich/BoundingBoxEnrichment.java",
"license": "gpl-2.0",
"size": 5452
} | [
"org.n52.sos.ogc.sos.SosEnvelope",
"org.n52.sos.ogc.sos.SosOffering"
] | import org.n52.sos.ogc.sos.SosEnvelope; import org.n52.sos.ogc.sos.SosOffering; | import org.n52.sos.ogc.sos.*; | [
"org.n52.sos"
] | org.n52.sos; | 2,052,221 |
public void drawCell(GC gc, Rectangle rect, int col, int row, Object content, boolean focus, boolean header, boolean clicked, KTableModel model);
| void function(GC gc, Rectangle rect, int col, int row, Object content, boolean focus, boolean header, boolean clicked, KTableModel model); | /**
* This method is called from KTable to draw a table cell.
* <p>
* Note that there are several helper methods that can do specified things
* for you.
*
* @param gc
* The gc to draw on
* @param rect
* The coordinates and size of the cell (add 1 to width and hight
*... | This method is called from KTable to draw a table cell. Note that there are several helper methods that can do specified things for you | drawCell | {
"repo_name": "alastrina123/debrief",
"path": "org.mwc.cmap.NarrativeViewer/src/de/kupzog/ktable/KTableCellRenderer.java",
"license": "epl-1.0",
"size": 2628
} | [
"org.eclipse.swt.graphics.Rectangle"
] | import org.eclipse.swt.graphics.Rectangle; | import org.eclipse.swt.graphics.*; | [
"org.eclipse.swt"
] | org.eclipse.swt; | 232,994 |
public Molecule importAsMolecule() throws MolFormatException {
try {
return MolImporter.importMol(this.getInChI(), INCHI_FORMAT);
} catch (MolFormatException e1) {
LOGGER.warn("Couldn't import chemical %d from inchi. %s", this.getUuid(), e1.getMessage());
}
try {
return MolImporter.i... | Molecule function() throws MolFormatException { try { return MolImporter.importMol(this.getInChI(), INCHI_FORMAT); } catch (MolFormatException e1) { LOGGER.warn(STR, this.getUuid(), e1.getMessage()); } try { return MolImporter.importMol(this.getSmiles(), SMARTS_FORMAT); } catch (MolFormatException e2) { throw new MolFo... | /**
* Tries to import molecule using inchi and smarts.
* Returns empty if neither is possible.
*
* @return The molecule corresponding to this chemical.
*/ | Tries to import molecule using inchi and smarts. Returns empty if neither is possible | importAsMolecule | {
"repo_name": "20n/act",
"path": "reachables/src/main/java/act/shared/Chemical.java",
"license": "gpl-3.0",
"size": 18141
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 859,217 |
public void write(BitOutputStream os) throws IOException {
os.writeRawULong(sampleNumber, SEEKPOINT_SAMPLE_NUMBER_LEN);
os.writeRawULong(streamOffset, SEEKPOINT_STREAM_OFFSET_LEN);
os.writeRawUInt(frameSamples, SEEKPOINT_FRAME_SAMPLES_LEN);
} | void function(BitOutputStream os) throws IOException { os.writeRawULong(sampleNumber, SEEKPOINT_SAMPLE_NUMBER_LEN); os.writeRawULong(streamOffset, SEEKPOINT_STREAM_OFFSET_LEN); os.writeRawUInt(frameSamples, SEEKPOINT_FRAME_SAMPLES_LEN); } | /**
* Write out an individual seek point.
* @param os The output stream
* @throws IOException Thrown if error writing data
*/ | Write out an individual seek point | write | {
"repo_name": "Tobiaswk/ophelia",
"path": "src/org/kc7bfi/jflac/metadata/SeekPoint.java",
"license": "gpl-3.0",
"size": 3860
} | [
"java.io.IOException",
"org.kc7bfi.jflac.io.BitOutputStream"
] | import java.io.IOException; import org.kc7bfi.jflac.io.BitOutputStream; | import java.io.*; import org.kc7bfi.jflac.io.*; | [
"java.io",
"org.kc7bfi.jflac"
] | java.io; org.kc7bfi.jflac; | 231,124 |
public final WebBindingInitializer getWebBindingInitializer() {
return this.webBindingInitializer;
} | final WebBindingInitializer function() { return this.webBindingInitializer; } | /**
* Return the WebBindingInitializer (if any) which will apply pre-configured
* configuration to every DataBinder that this controller uses.
*/ | Return the WebBindingInitializer (if any) which will apply pre-configured configuration to every DataBinder that this controller uses | getWebBindingInitializer | {
"repo_name": "leogoing/spring_jeesite",
"path": "spring-webmvc-4.0/org/springframework/web/servlet/mvc/multiaction/MultiActionController.java",
"license": "apache-2.0",
"size": 25557
} | [
"org.springframework.web.bind.support.WebBindingInitializer"
] | import org.springframework.web.bind.support.WebBindingInitializer; | import org.springframework.web.bind.support.*; | [
"org.springframework.web"
] | org.springframework.web; | 548,327 |
private static RegisterSpec[] dupArray(RegisterSpec[] orig) {
RegisterSpec[] copy = new RegisterSpec[orig.length];
System.arraycopy(orig, 0, copy, 0, orig.length);
return copy;
} | static RegisterSpec[] function(RegisterSpec[] orig) { RegisterSpec[] copy = new RegisterSpec[orig.length]; System.arraycopy(orig, 0, copy, 0, orig.length); return copy; } | /**
* Duplicates a RegisterSpec array.
*
* @param orig {@code non-null;} array to duplicate
* @return {@code non-null;} new instance
*/ | Duplicates a RegisterSpec array | dupArray | {
"repo_name": "nikita36078/J2ME-Loader",
"path": "dexlib/src/main/java/com/android/dx/ssa/SsaRenamer.java",
"license": "apache-2.0",
"size": 23878
} | [
"com.android.dx.rop.code.RegisterSpec"
] | import com.android.dx.rop.code.RegisterSpec; | import com.android.dx.rop.code.*; | [
"com.android.dx"
] | com.android.dx; | 512,286 |
public static void setGcmChannelType(Context context, int type) {
if (getGcmChannelType(context) == type) {
return;
}
SharedPreferences.Editor editor = getPreferences(context).edit();
editor.putInt(GCM_CHANNEL_TYPE_PREF, type);
if (!editor.commit()) {
logger.warning("Failed writing sha... | static void function(Context context, int type) { if (getGcmChannelType(context) == type) { return; } SharedPreferences.Editor editor = getPreferences(context).edit(); editor.putInt(GCM_CHANNEL_TYPE_PREF, type); if (!editor.commit()) { logger.warning(STR); } } | /**
* Sets the GCM channel configuration used.
*
* @param context, the application context.
* @param type, the channel configuration type specified in {@code GcmChannelType}.
*/ | Sets the GCM channel configuration used | setGcmChannelType | {
"repo_name": "Teamxrtc/webrtc-streaming-node",
"path": "third_party/webrtc/src/chromium/src/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidChannelPreferences.java",
"license": "mit",
"size": 7926
} | [
"android.content.Context",
"android.content.SharedPreferences"
] | import android.content.Context; import android.content.SharedPreferences; | import android.content.*; | [
"android.content"
] | android.content; | 2,716,906 |
public Color getColor(String property)
{
Color result = SturesyConstants.UNDEFINEDCOLOR;
String string = _properties.getProperty(property);
if (string != null)
{
result = ParserUtils.parseColor(string);
}
if (result == SturesyConstants.UNDEFINEDCOLOR... | Color function(String property) { Color result = SturesyConstants.UNDEFINEDCOLOR; String string = _properties.getProperty(property); if (string != null) { result = ParserUtils.parseColor(string); } if (result == SturesyConstants.UNDEFINEDCOLOR) { result = Defaults.getInstance().getColor(property); } return result; } | /**
* Returns a Color from the Properties, also checks the Defaults<br>
* Returns {@link Settings#UNDEFINEDCOLOR} if property was nonexistant
*
* @param property
* property key
* @return Color
*/ | Returns a Color from the Properties, also checks the Defaults Returns <code>Settings#UNDEFINEDCOLOR</code> if property was nonexistant | getColor | {
"repo_name": "sturesy/client",
"path": "src/src-main/sturesy/util/Settings.java",
"license": "agpl-3.0",
"size": 9396
} | [
"java.awt.Color"
] | import java.awt.Color; | import java.awt.*; | [
"java.awt"
] | java.awt; | 715,806 |
public long set(long instant, String text, Locale locale) {
throw unsupported();
} | long function(long instant, String text, Locale locale) { throw unsupported(); } | /**
* Always throws UnsupportedOperationException
*
* @throws UnsupportedOperationException
*/ | Always throws UnsupportedOperationException | set | {
"repo_name": "aparo/scalajs-joda",
"path": "src/main/scala/org/joda/time/field/UnsupportedDateTimeField.java",
"license": "apache-2.0",
"size": 14131
} | [
"java.util.Locale"
] | import java.util.Locale; | import java.util.*; | [
"java.util"
] | java.util; | 1,405,995 |
@Test void testOrderGroup() {
// Group by
sql("select 1 from emp group by deptno order by ^empno^")
.fails("Expression 'EMPNO' is not being grouped");
// order by can contain aggregate expressions
sql("select empno from emp "
+ "group by empno, deptno "
+ "order by deptno * su... | @Test void testOrderGroup() { sql(STR) .fails(STR); sql(STR + STR + STR).ok(); sql(STR) .fails(STR); sql(STR).ok(); sql(STR) .fails(STR); sql(STR) .fails(STR); sql(STR).ok(); sql(STR + STR + STR + STR).ok(); sql(STR + STR + STR + STR).ok(); final SqlConformance conformance = fixture().conformance(); sql(STR + STR + STR... | /**
* Tests validation of the ORDER BY clause when GROUP BY is present.
*/ | Tests validation of the ORDER BY clause when GROUP BY is present | testOrderGroup | {
"repo_name": "apache/calcite",
"path": "core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java",
"license": "apache-2.0",
"size": 521238
} | [
"org.apache.calcite.sql.validate.SqlConformance",
"org.junit.jupiter.api.Test"
] | import org.apache.calcite.sql.validate.SqlConformance; import org.junit.jupiter.api.Test; | import org.apache.calcite.sql.validate.*; import org.junit.jupiter.api.*; | [
"org.apache.calcite",
"org.junit.jupiter"
] | org.apache.calcite; org.junit.jupiter; | 196,443 |
EAttribute getPassThroughBill_BillRunType(); | EAttribute getPassThroughBill_BillRunType(); | /**
* Returns the meta object for the attribute '{@link CIM.IEC61970.Informative.MarketOperations.PassThroughBill#getBillRunType <em>Bill Run Type</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Bill Run Type</em>'.
* @see CIM.IEC61970.Informative.Mar... | Returns the meta object for the attribute '<code>CIM.IEC61970.Informative.MarketOperations.PassThroughBill#getBillRunType Bill Run Type</code>'. | getPassThroughBill_BillRunType | {
"repo_name": "georghinkel/ttc2017smartGrids",
"path": "solutions/ModelJoin/src/main/java/CIM/IEC61970/Informative/MarketOperations/MarketOperationsPackage.java",
"license": "mit",
"size": 688294
} | [
"org.eclipse.emf.ecore.EAttribute"
] | import org.eclipse.emf.ecore.EAttribute; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,431,822 |
public String getScaleOptions(CmsObject cms) {
if (m_scaleOptions == null) {
if (m_element.element(NODE_SCALE) != null) {
m_scaleOptions = m_element.element(NODE_SCALE).getText();
}
if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_scaleOptions)) {
... | String function(CmsObject cms) { if (m_scaleOptions == null) { if (m_element.element(NODE_SCALE) != null) { m_scaleOptions = m_element.element(NODE_SCALE).getText(); } if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_scaleOptions)) { m_scaleOptions = getParameterValue(cms, CmsImageScaler.PARAM_SCALE); } } return m_scaleOpti... | /**
* Returns the scale options of the image.<p>
*
* @param cms the current users context
* @return the scale options of the image or an empty String
*/ | Returns the scale options of the image | getScaleOptions | {
"repo_name": "victos/opencms-core",
"path": "src/org/opencms/xml/types/CmsXmlVfsImageValue.java",
"license": "lgpl-2.1",
"size": 13729
} | [
"org.opencms.file.CmsObject",
"org.opencms.loader.CmsImageScaler",
"org.opencms.util.CmsStringUtil"
] | import org.opencms.file.CmsObject; import org.opencms.loader.CmsImageScaler; import org.opencms.util.CmsStringUtil; | import org.opencms.file.*; import org.opencms.loader.*; import org.opencms.util.*; | [
"org.opencms.file",
"org.opencms.loader",
"org.opencms.util"
] | org.opencms.file; org.opencms.loader; org.opencms.util; | 1,338,182 |
public static Collection<File> readDirFiles(String dir) {
Collection<File> ret = new HashSet<>();
File[] files = new File(dir).listFiles();
if (files != null) {
for (File f : files) {
ret.add(f);
}
}
return ret;
} | static Collection<File> function(String dir) { Collection<File> ret = new HashSet<>(); File[] files = new File(dir).listFiles(); if (files != null) { for (File f : files) { ret.add(f); } } return ret; } | /**
* Returns a Collection of files found under the given directory.
*
* @param dir a directory
* @return the Collection of file names
*/ | Returns a Collection of files found under the given directory | readDirFiles | {
"repo_name": "srdo/storm",
"path": "storm-client/src/jvm/org/apache/storm/utils/ConfigUtils.java",
"license": "apache-2.0",
"size": 17187
} | [
"java.io.File",
"java.util.Collection",
"java.util.HashSet"
] | import java.io.File; import java.util.Collection; import java.util.HashSet; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 2,430,363 |
List<String> result = new ArrayList<>(dep);
String temp;
for (int i = 0; i < result.size(); i++) {
if (result.get(i).contains("\\")) {
temp = result.get(i).substring(0, result.get(i).lastIndexOf("\\"));
if (!result.contains(temp)) {
result.... | List<String> result = new ArrayList<>(dep); String temp; for (int i = 0; i < result.size(); i++) { if (result.get(i).contains("\\")) { temp = result.get(i).substring(0, result.get(i).lastIndexOf("\\")); if (!result.contains(temp)) { result.add(temp); } } } return result; } | /**
* Fill list.
*
* @param dep input list.
* @return output list.
*/ | Fill list | fillDeprt | {
"repo_name": "Malamut54/dbobrov",
"path": "chapter_005/src/main/java/ru/job4j/finaltasktcolllite/Department.java",
"license": "apache-2.0",
"size": 2514
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,118,429 |
private Node tryFoldAddConstantString(Node n, Node left, Node right) {
if (left.isString() ||
right.isString()) {
// Add strings.
String leftString = NodeUtil.getStringValue(left);
String rightString = NodeUtil.getStringValue(right);
if (leftString != null && rightString != null) {... | Node function(Node n, Node left, Node right) { if (left.isString() right.isString()) { String leftString = NodeUtil.getStringValue(left); String rightString = NodeUtil.getStringValue(right); if (leftString != null && rightString != null) { Node newStringNode = IR.string(leftString + rightString); n.getParent().replaceC... | /**
* Try to fold an ADD node with constant operands
*/ | Try to fold an ADD node with constant operands | tryFoldAddConstantString | {
"repo_name": "jhiswin/idiil-closure-compiler",
"path": "src/com/google/javascript/jscomp/PeepholeFoldConstants.java",
"license": "apache-2.0",
"size": 43910
} | [
"com.google.javascript.rhino.IR",
"com.google.javascript.rhino.Node"
] | import com.google.javascript.rhino.IR; import com.google.javascript.rhino.Node; | import com.google.javascript.rhino.*; | [
"com.google.javascript"
] | com.google.javascript; | 2,084,914 |
public void setCreateDate(Date createDate); | void function(Date createDate); | /**
* Sets the create date of this payment config.
*
* @param createDate the create date of this payment config
*/ | Sets the create date of this payment config | setCreateDate | {
"repo_name": "openegovplatform/OEPv2",
"path": "oep-core-dossiermgt-portlet/docroot/WEB-INF/service/org/oep/core/dossiermgt/model/PaymentConfigModel.java",
"license": "apache-2.0",
"size": 6352
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 724,836 |
public Document parse( String systemId, boolean root ) throws SAXException, IOException {
systemId = normalizeSystemId(systemId);
if( core.containsKey(systemId) )
// this document has already been parsed. Just ignore.
return core.get(systemId);
InputSource is=null;... | Document function( String systemId, boolean root ) throws SAXException, IOException { systemId = normalizeSystemId(systemId); if( core.containsKey(systemId) ) return core.get(systemId); InputSource is=null; if( entityResolver!=null ) is = entityResolver.resolveEntity(null,systemId); if( is==null ) is = new InputSource(... | /**
* Parses an XML at the given location (
* and XMLs referenced by it) into DOM trees
* and stores them to this forest.
*
* @return the parsed DOM document object.
*/ | Parses an XML at the given location ( and XMLs referenced by it) into DOM trees and stores them to this forest | parse | {
"repo_name": "axDev-JDK/jaxws",
"path": "src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/internalizer/DOMForest.java",
"license": "gpl-2.0",
"size": 20771
} | [
"java.io.IOException",
"org.w3c.dom.Document",
"org.xml.sax.InputSource",
"org.xml.sax.SAXException"
] | import java.io.IOException; import org.w3c.dom.Document; import org.xml.sax.InputSource; import org.xml.sax.SAXException; | import java.io.*; import org.w3c.dom.*; import org.xml.sax.*; | [
"java.io",
"org.w3c.dom",
"org.xml.sax"
] | java.io; org.w3c.dom; org.xml.sax; | 1,067,210 |
protected Check[] getChecks() {
return new Check[] { new ComponentScanPackageCheck() };
}
protected static final class ConfigurationWarningsPostProcessor
implements PriorityOrdered, BeanDefinitionRegistryPostProcessor {
private Check[] checks;
public ConfigurationWarningsPostProcessor(Check[] checks)... | Check[] function() { return new Check[] { new ComponentScanPackageCheck() }; } protected static final class ConfigurationWarningsPostProcessor implements PriorityOrdered, BeanDefinitionRegistryPostProcessor { private Check[] checks; public ConfigurationWarningsPostProcessor(Check[] checks) { this.checks = checks; } | /**
* Returns the checks that should be applied.
* @return the checks to apply
*/ | Returns the checks that should be applied | getChecks | {
"repo_name": "lburgazzoli/spring-boot",
"path": "spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/ConfigurationWarningsApplicationContextInitializer.java",
"license": "apache-2.0",
"size": 7074
} | [
"org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor",
"org.springframework.core.PriorityOrdered"
] | import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor; import org.springframework.core.PriorityOrdered; | import org.springframework.beans.factory.support.*; import org.springframework.core.*; | [
"org.springframework.beans",
"org.springframework.core"
] | org.springframework.beans; org.springframework.core; | 1,187,915 |
protected Survey getSurveyFromRestfulUrl(HttpServletRequest request) {
return getSurveyFromRestfulUrl(request, true);
}
/**
* Load a Survey based on a restful URL, eg., /prefix/123.html, optionally
* asserting ownership of it.
*
* @param request
* {@link HttpServletRequest} | Survey function(HttpServletRequest request) { return getSurveyFromRestfulUrl(request, true); } /** * Load a Survey based on a restful URL, eg., /prefix/123.html, optionally * asserting ownership of it. * * @param request * {@link HttpServletRequest} | /**
* Load a Survey based on a restful URL, eg., /prefix/123.html, and assert
* ownership of it.
*
* @param request
* @return
*/ | Load a Survey based on a restful URL, eg., /prefix/123.html, and assert ownership of it | getSurveyFromRestfulUrl | {
"repo_name": "onlyasurvey/OAS_workspace",
"path": "OnlyASurveyRoot/OnlyASurveyWeb/src/main/java/com/oas/controller/AbstractOASController.java",
"license": "agpl-3.0",
"size": 19535
} | [
"com.oas.model.Survey",
"javax.servlet.http.HttpServletRequest"
] | import com.oas.model.Survey; import javax.servlet.http.HttpServletRequest; | import com.oas.model.*; import javax.servlet.http.*; | [
"com.oas.model",
"javax.servlet"
] | com.oas.model; javax.servlet; | 2,020,624 |
public static Date truncDate(final Date date, final int truncateLevel) {
return truncDate(date, GENERAL_TIMEZONE, truncateLevel);
} | static Date function(final Date date, final int truncateLevel) { return truncDate(date, GENERAL_TIMEZONE, truncateLevel); } | /**
* Truncates the date assuming it's in the {@link #GENERAL_TIMEZONE}.
*
* @param date
* the date to be truncated
* @param truncateLevel
* one of:
* <ul>
* <li>{@link Calendar#YEAR}</li>
* <li>{@link Calendar#MONTH}</li>
* <li>{@li... | Truncates the date assuming it's in the <code>#GENERAL_TIMEZONE</code> | truncDate | {
"repo_name": "pmeisen/gen-misc",
"path": "src/net/meisen/general/genmisc/types/Dates.java",
"license": "mit",
"size": 14415
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 551,292 |
Task getLink(); | Task getLink(); | /**
* The link task.
*/ | The link task | getLink | {
"repo_name": "gstevey/gradle",
"path": "subprojects/testing-native/src/main/java/org/gradle/nativeplatform/test/NativeTestSuiteBinarySpec.java",
"license": "apache-2.0",
"size": 2068
} | [
"org.gradle.api.Task"
] | import org.gradle.api.Task; | import org.gradle.api.*; | [
"org.gradle.api"
] | org.gradle.api; | 1,448,865 |
private boolean readyPlayer(String file) {
if (playMode()) {
switch (this.state) {
case MEDIA_NONE:
if (this.player == null) {
this.player = new MediaPlayer();
}
try {
this... | boolean function(String file) { if (playMode()) { switch (this.state) { case MEDIA_NONE: if (this.player == null) { this.player = new MediaPlayer(); } try { this.loadAudioFile(file); } catch (Exception e) { sendErrorStatus(MEDIA_ERR_ABORTED); } return false; case MEDIA_LOADING: Log.d(LOG_TAG, STR + STATE.MEDIA_STARTING... | /**
* attempts to initialize the media player for playback
* @param file the file to play
* @return false if player not ready, reports if in wrong mode or state
*/ | attempts to initialize the media player for playback | readyPlayer | {
"repo_name": "krishlakshmanan/cordova-plugin-media",
"path": "src/android/AudioPlayer.java",
"license": "apache-2.0",
"size": 21299
} | [
"android.media.MediaPlayer",
"android.util.Log"
] | import android.media.MediaPlayer; import android.util.Log; | import android.media.*; import android.util.*; | [
"android.media",
"android.util"
] | android.media; android.util; | 1,985,589 |
public void waitTableDisabled(byte[] table, long timeoutMillis)
throws InterruptedException, IOException {
waitTableDisabled(TableName.valueOf(table), timeoutMillis);
} | void function(byte[] table, long timeoutMillis) throws InterruptedException, IOException { waitTableDisabled(TableName.valueOf(table), timeoutMillis); } | /**
* Waits for a table to be 'disabled'. Disabled means that table is set as 'disabled'
* @param table Table to wait on.
* @param timeoutMillis Time to wait on it being marked disabled.
*/ | Waits for a table to be 'disabled'. Disabled means that table is set as 'disabled' | waitTableDisabled | {
"repo_name": "mahak/hbase",
"path": "hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtil.java",
"license": "apache-2.0",
"size": 151013
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 404,274 |
public CurrentWeather getWeatherFromOWM(String cityName) throws IOException, JSONException {
OpenWeatherMap owm = new OpenWeatherMap(Units.METRIC, Language.GERMAN,
cm.configuration.getProperty("owm_api_code"));
CurrentWeather cwd = owm.currentWeatherByCityName(cityName);
if (cwd.getCityName() == null) {
... | CurrentWeather function(String cityName) throws IOException, JSONException { OpenWeatherMap owm = new OpenWeatherMap(Units.METRIC, Language.GERMAN, cm.configuration.getProperty(STR)); CurrentWeather cwd = owm.currentWeatherByCityName(cityName); if (cwd.getCityName() == null) { System.exit(-1); } System.out.println(STR ... | /**
* Gets the weather from the openweathermap pages
*
* @return
* @throws IOException
* @throws JSONException
*/ | Gets the weather from the openweathermap pages | getWeatherFromOWM | {
"repo_name": "Konry/openweathermapparser",
"path": "src/OpenWeatherParser.java",
"license": "gpl-2.0",
"size": 8858
} | [
"java.io.IOException",
"net.aksingh.owmjapis.CurrentWeather",
"net.aksingh.owmjapis.OpenWeatherMap",
"org.json.JSONException"
] | import java.io.IOException; import net.aksingh.owmjapis.CurrentWeather; import net.aksingh.owmjapis.OpenWeatherMap; import org.json.JSONException; | import java.io.*; import net.aksingh.owmjapis.*; import org.json.*; | [
"java.io",
"net.aksingh.owmjapis",
"org.json"
] | java.io; net.aksingh.owmjapis; org.json; | 53,154 |
@SuppressWarnings("unchecked")
public void verifyUnmodifiable(final Set<E> set) {
try {
set.add((E) "value");
fail("Expecting UnsupportedOperationException.");
} catch (final UnsupportedOperationException e) {
// expected
}
try {
se... | @SuppressWarnings(STR) void function(final Set<E> set) { try { set.add((E) "value"); fail(STR); } catch (final UnsupportedOperationException e) { } try { set.addAll(new TreeSet<E>()); fail(STR); } catch (final UnsupportedOperationException e) { } try { set.clear(); fail(STR); } catch (final UnsupportedOperationExceptio... | /**
* Verifies that a set is not modifiable
*/ | Verifies that a set is not modifiable | verifyUnmodifiable | {
"repo_name": "AffogatoLang/Moka",
"path": "lib/Apache_Commons_Collections/src/test/java/org/apache/commons/collections4/set/UnmodifiableNavigableSetTest.java",
"license": "bsd-3-clause",
"size": 5968
} | [
"java.util.Set",
"java.util.TreeSet"
] | import java.util.Set; import java.util.TreeSet; | import java.util.*; | [
"java.util"
] | java.util; | 219,194 |
private void printMetricsStats(ControlPlaneMonitorService service, NodeId nodeId,
Set<ControlMetricType> typeSet, String resName, DeviceId did) {
if (resName == null && did == null) {
typeSet.forEach(s -> {
ControlLoadSnapshot cls = service.getL... | void function(ControlPlaneMonitorService service, NodeId nodeId, Set<ControlMetricType> typeSet, String resName, DeviceId did) { if (resName == null && did == null) { typeSet.forEach(s -> { ControlLoadSnapshot cls = service.getLoadSync(nodeId, s, Optional.empty()); printControlLoadSnapshot(s, cls); }); } else if (resNa... | /**
* Prints control plane metric statistic information.
*
* @param service monitor service
* @param nodeId node identifier
* @param typeSet control metric type
* @param resName resource name
* @param did device identifier
*/ | Prints control plane metric statistic information | printMetricsStats | {
"repo_name": "gkatsikas/onos",
"path": "apps/cpman/app/src/main/java/org/onosproject/cpman/cli/ControlMetricsStatsListCommand.java",
"license": "apache-2.0",
"size": 6742
} | [
"java.util.Optional",
"java.util.Set",
"org.onosproject.cluster.NodeId",
"org.onosproject.cpman.ControlLoadSnapshot",
"org.onosproject.cpman.ControlMetricType",
"org.onosproject.cpman.ControlPlaneMonitorService",
"org.onosproject.net.DeviceId"
] | import java.util.Optional; import java.util.Set; import org.onosproject.cluster.NodeId; import org.onosproject.cpman.ControlLoadSnapshot; import org.onosproject.cpman.ControlMetricType; import org.onosproject.cpman.ControlPlaneMonitorService; import org.onosproject.net.DeviceId; | import java.util.*; import org.onosproject.cluster.*; import org.onosproject.cpman.*; import org.onosproject.net.*; | [
"java.util",
"org.onosproject.cluster",
"org.onosproject.cpman",
"org.onosproject.net"
] | java.util; org.onosproject.cluster; org.onosproject.cpman; org.onosproject.net; | 2,551,605 |
public String[] listSubRegionPaths(boolean recursive) {
String[] subRegionPathsArr = new String[0];
Collection<RegionMXBean> proxies = mapOfProxy.values();
// Need to go through all proxies as different proxies could have different sub-regions
if (proxies != null && !proxies.isEmpty()) {
So... | String[] function(boolean recursive) { String[] subRegionPathsArr = new String[0]; Collection<RegionMXBean> proxies = mapOfProxy.values(); if (proxies != null && !proxies.isEmpty()) { SortedSet<String> subRegionPaths = new TreeSet<String>(); for (RegionMXBean regionMXBean : proxies) { String[] listSubRegionPaths = regi... | /**
* Lists the sub regions of the GemFire {@link Region} represented by this
* {@link DistributedRegionMXBean}. If <code>recursive</code> is
* <code>true</code>, will return sub-regions by traversing recursively.
*
* @param recursive
* if <code>true</code>, recursively traverses to find sub... | Lists the sub regions of the GemFire <code>Region</code> represented by this <code>DistributedRegionMXBean</code>. If <code>recursive</code> is <code>true</code>, will return sub-regions by traversing recursively | listSubRegionPaths | {
"repo_name": "SnappyDataInc/snappy-store",
"path": "gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/beans/DistributedRegionBridge.java",
"license": "apache-2.0",
"size": 17045
} | [
"com.gemstone.gemfire.management.RegionMXBean",
"java.util.Arrays",
"java.util.Collection",
"java.util.SortedSet",
"java.util.TreeSet"
] | import com.gemstone.gemfire.management.RegionMXBean; import java.util.Arrays; import java.util.Collection; import java.util.SortedSet; import java.util.TreeSet; | import com.gemstone.gemfire.management.*; import java.util.*; | [
"com.gemstone.gemfire",
"java.util"
] | com.gemstone.gemfire; java.util; | 55,942 |
public Map<String, BeanData> getBeanMap() {
return beanMap;
} | Map<String, BeanData> function() { return beanMap; } | /**
* Returns bean map used in this session.
*/ | Returns bean map used in this session | getBeanMap | {
"repo_name": "007slm/jodd",
"path": "jodd-petite/src/main/java/jodd/petite/scope/SessionScope.java",
"license": "bsd-3-clause",
"size": 4164
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 77,585 |
@Nullable
public WorkbookFunctionResult post() throws ClientException {
return send(HttpMethod.POST, body);
} | WorkbookFunctionResult function() throws ClientException { return send(HttpMethod.POST, body); } | /**
* Invokes the method and returns the result
* @return result of the method invocation
* @throws ClientException an exception occurs if there was an error while the request was sent
*/ | Invokes the method and returns the result | post | {
"repo_name": "microsoftgraph/msgraph-sdk-java",
"path": "src/main/java/com/microsoft/graph/requests/WorkbookFunctionsNetworkDays_IntlRequest.java",
"license": "mit",
"size": 3065
} | [
"com.microsoft.graph.core.ClientException",
"com.microsoft.graph.http.HttpMethod",
"com.microsoft.graph.models.WorkbookFunctionResult"
] | import com.microsoft.graph.core.ClientException; import com.microsoft.graph.http.HttpMethod; import com.microsoft.graph.models.WorkbookFunctionResult; | import com.microsoft.graph.core.*; import com.microsoft.graph.http.*; import com.microsoft.graph.models.*; | [
"com.microsoft.graph"
] | com.microsoft.graph; | 2,862,250 |
private Stack<NetNode> joinNodes (ProgressListener progressListener, double[][] mat, NetNode netNodes, int num_nodes) throws CanceledException {
//System.err.println("joinNodes");
final Stack<NetNode> joins=new Stack<>();
int num_active = num_nodes;
int num_clusters = num_nodes;
... | Stack<NetNode> function (ProgressListener progressListener, double[][] mat, NetNode netNodes, int num_nodes) throws CanceledException { final Stack<NetNode> joins=new Stack<>(); int num_active = num_nodes; int num_clusters = num_nodes; while (num_active > 3) { if (num_active == 4 && num_clusters == 2) { final NetNode p... | /**
* Agglomerates the nodes
*/ | Agglomerates the nodes | joinNodes | {
"repo_name": "danielhuson/megan-ce",
"path": "src/megan/clusteranalysis/nnet/NeighborNet.java",
"license": "gpl-3.0",
"size": 17608
} | [
"java.util.Objects",
"java.util.Stack"
] | import java.util.Objects; import java.util.Stack; | import java.util.*; | [
"java.util"
] | java.util; | 2,265,900 |
public static void initCipher(Cipher cipher, int mode, SecretKey secretKey) {
initCipher(cipher, mode, secretKey, null);
} | static void function(Cipher cipher, int mode, SecretKey secretKey) { initCipher(cipher, mode, secretKey, null); } | /**
* Initializes the Cipher for use.
*/ | Initializes the Cipher for use | initCipher | {
"repo_name": "SanjayUser/SpringSecurityPro",
"path": "crypto/src/main/java/org/springframework/security/crypto/encrypt/CipherUtils.java",
"license": "apache-2.0",
"size": 4359
} | [
"javax.crypto.Cipher",
"javax.crypto.SecretKey"
] | import javax.crypto.Cipher; import javax.crypto.SecretKey; | import javax.crypto.*; | [
"javax.crypto"
] | javax.crypto; | 210,256 |
void writeColumns(HTableInterface htable, Object rowKey, Map<String, Object> columns, String columnFamilyName)
throws IOException;
| void writeColumns(HTableInterface htable, Object rowKey, Map<String, Object> columns, String columnFamilyName) throws IOException; | /**
* Writes columns data to HBase table, supplied as a map in Key/ value pair;
* key and value representing column name and value respectively.
*
* @param htable
* the htable
* @param rowKey
* the row key
* @param columns
* the col... | Writes columns data to HBase table, supplied as a map in Key/ value pair; key and value representing column name and value respectively | writeColumns | {
"repo_name": "ravisund/Kundera",
"path": "src/kundera-hbase/kundera-hbase/src/main/java/com/impetus/client/hbase/Writer.java",
"license": "apache-2.0",
"size": 5782
} | [
"java.io.IOException",
"java.util.Map",
"org.apache.hadoop.hbase.client.HTableInterface"
] | import java.io.IOException; import java.util.Map; import org.apache.hadoop.hbase.client.HTableInterface; | import java.io.*; import java.util.*; import org.apache.hadoop.hbase.client.*; | [
"java.io",
"java.util",
"org.apache.hadoop"
] | java.io; java.util; org.apache.hadoop; | 799,632 |
public List<Long> listSubscribers(long subscriptionId) {
Subscription sub = this.subscriptionsById.get(subscriptionId);
if (sub != null) {
return sub.getSubscribers().stream().map(Subscriber::getWampSessionId)
.collect(Collectors.toList());
}
return Collections.emptyList();
}
| List<Long> function(long subscriptionId) { Subscription sub = this.subscriptionsById.get(subscriptionId); if (sub != null) { return sub.getSubscribers().stream().map(Subscriber::getWampSessionId) .collect(Collectors.toList()); } return Collections.emptyList(); } | /**
* Returns a list of session IDs for sessions currently attached to the subscription.
*
* @param subscriptionId the id of the subscription
* @return the list of session IDs attached to the subscription
*/ | Returns a list of session IDs for sessions currently attached to the subscription | listSubscribers | {
"repo_name": "ralscha/wamp2spring",
"path": "wamp2spring-core/src/main/java/ch/rasc/wamp2spring/pubsub/SubscriptionRegistry.java",
"license": "apache-2.0",
"size": 11251
} | [
"java.util.Collections",
"java.util.List",
"java.util.stream.Collectors"
] | import java.util.Collections; import java.util.List; import java.util.stream.Collectors; | import java.util.*; import java.util.stream.*; | [
"java.util"
] | java.util; | 2,066,715 |
@ApiModelProperty(value = "")
public String getN() {
return n;
} | @ApiModelProperty(value = "") String function() { return n; } | /**
* Get n
* @return n
**/ | Get n | getN | {
"repo_name": "NiclasMolby/Provider-Server",
"path": "src/gen/java/io/swagger/model/PublicKey.java",
"license": "apache-2.0",
"size": 2965
} | [
"io.swagger.annotations.ApiModelProperty"
] | import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.*; | [
"io.swagger.annotations"
] | io.swagger.annotations; | 613,930 |
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<InstanceFailoverGroupInner> forceFailoverAllowDataLossAsync(
String resourceGroupName, String locationName, String failoverGroupName, Context context) {
return beginForceFailoverAllowDataLossAsync(resourceGroupName, locationName, failoverG... | @ServiceMethod(returns = ReturnType.SINGLE) Mono<InstanceFailoverGroupInner> function( String resourceGroupName, String locationName, String failoverGroupName, Context context) { return beginForceFailoverAllowDataLossAsync(resourceGroupName, locationName, failoverGroupName, context) .last() .flatMap(this.client::getLro... | /**
* Fails over from the current primary managed instance to this managed instance. This operation might result in
* data loss.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the por... | Fails over from the current primary managed instance to this managed instance. This operation might result in data loss | forceFailoverAllowDataLossAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-sql/src/main/java/com/azure/resourcemanager/sql/implementation/InstanceFailoverGroupsClientImpl.java",
"license": "mit",
"size": 89588
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.util.Context",
"com.azure.resourcemanager.sql.fluent.models.InstanceFailoverGroupInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.util.Context; import com.azure.resourcemanager.sql.fluent.models.InstanceFailoverGroupInner; | import com.azure.core.annotation.*; import com.azure.core.util.*; import com.azure.resourcemanager.sql.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 1,738,305 |
@SeededTest
public void testNextFloatIs24BitProduct(RandomSeed randomSeed) {
final long seed = randomSeed.getSeedAsLong();
final UniformRandomProvider rng1 = MiddleSquareWeylSequence.newInstance(seed);
final UniformRandomProvider rng2 = MiddleSquareWeylSequence.newInstance(seed);
for (int i = 0; i <... | void function(RandomSeed randomSeed) { final long seed = randomSeed.getSeedAsLong(); final UniformRandomProvider rng1 = MiddleSquareWeylSequence.newInstance(seed); final UniformRandomProvider rng2 = MiddleSquareWeylSequence.newInstance(seed); for (int i = 0; i < 200; i++) { Assertions.assertEquals((rng1.nextInt() >>> 8... | /**
* Check the float is the upper 24-bits from the int value multiplied by a constant.
*/ | Check the float is the upper 24-bits from the int value multiplied by a constant | testNextFloatIs24BitProduct | {
"repo_name": "aherbert/GDSC-Core",
"path": "src/test/java/uk/ac/sussex/gdsc/core/utils/rng/MiddleSquareWeylSequenceTest.java",
"license": "gpl-3.0",
"size": 16028
} | [
"org.apache.commons.rng.UniformRandomProvider",
"org.junit.jupiter.api.Assertions",
"uk.ac.sussex.gdsc.test.junit5.RandomSeed"
] | import org.apache.commons.rng.UniformRandomProvider; import org.junit.jupiter.api.Assertions; import uk.ac.sussex.gdsc.test.junit5.RandomSeed; | import org.apache.commons.rng.*; import org.junit.jupiter.api.*; import uk.ac.sussex.gdsc.test.junit5.*; | [
"org.apache.commons",
"org.junit.jupiter",
"uk.ac.sussex"
] | org.apache.commons; org.junit.jupiter; uk.ac.sussex; | 2,565,916 |
public void setCalendar(final Calendar c) {
if (c == null) {
setDate(null);
}
final Calendar oldCalendar = calendar;
calendar = c;
yearChooser.setYear(c.get(Calendar.YEAR));
monthChooser.setMonth(c.get(Calendar.MONTH));
dayChooser.setDay(c.get(Calendar.DATE));
... | void function(final Calendar c) { if (c == null) { setDate(null); } final Calendar oldCalendar = calendar; calendar = c; yearChooser.setYear(c.get(Calendar.YEAR)); monthChooser.setMonth(c.get(Calendar.MONTH)); dayChooser.setDay(c.get(Calendar.DATE)); if(timeChooser != null) timeChooser.setCalendar(calendar); fireProper... | /**
* Sets the calendar property. This is a bound property.
*
* @param c
* the new calendar
* @throws NullPointerException
* - if c is null;
* @see #getCalendar
*/ | Sets the calendar property. This is a bound property | setCalendar | {
"repo_name": "freeplane/freeplane",
"path": "freeplane/src/main/java/org/freeplane/core/ui/components/calendar/JCalendar.java",
"license": "gpl-2.0",
"size": 17605
} | [
"java.util.Calendar"
] | import java.util.Calendar; | import java.util.*; | [
"java.util"
] | java.util; | 94,514 |
public default void addNewUri(CrawleableUri uri, Node newUri) {
if (newUri.isURI()) {
addNewUri(uri, newUri.getURI());
}
}
| default void function(CrawleableUri uri, Node newUri) { if (newUri.isURI()) { addNewUri(uri, newUri.getURI()); } } | /**
* Adds the given new URI to the list of URIs collected for the given URI.
*
* @param uri
* The URI from which the given new URI has been collected.
* @param newUri
* The new URI that has been collected.
*/ | Adds the given new URI to the list of URIs collected for the given URI | addNewUri | {
"repo_name": "AKSW/Squirrel",
"path": "squirrel.worker/src/main/java/org/dice_research/squirrel/collect/UriCollector.java",
"license": "lgpl-3.0",
"size": 3492
} | [
"org.apache.jena.graph.Node",
"org.dice_research.squirrel.data.uri.CrawleableUri"
] | import org.apache.jena.graph.Node; import org.dice_research.squirrel.data.uri.CrawleableUri; | import org.apache.jena.graph.*; import org.dice_research.squirrel.data.uri.*; | [
"org.apache.jena",
"org.dice_research.squirrel"
] | org.apache.jena; org.dice_research.squirrel; | 2,180,565 |
public Observable<ServiceResponse<Page<USqlSchema>>> listSchemasNextSinglePageAsync(final String nextPageLink) {
if (nextPageLink == null) {
throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
} | Observable<ServiceResponse<Page<USqlSchema>>> function(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException(STR); } | /**
* Retrieves the list of schemas from the Data Lake Analytics catalog.
*
ServiceResponse<PageImpl<USqlSchema>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the Page... | Retrieves the list of schemas from the Data Lake Analytics catalog | listSchemasNextSinglePageAsync | {
"repo_name": "jianghaolu/azure-sdk-for-java",
"path": "azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/implementation/CatalogsImpl.java",
"license": "mit",
"size": 683869
} | [
"com.microsoft.azure.Page",
"com.microsoft.azure.management.datalake.analytics.models.USqlSchema",
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.azure.Page; import com.microsoft.azure.management.datalake.analytics.models.USqlSchema; import com.microsoft.rest.ServiceResponse; | import com.microsoft.azure.*; import com.microsoft.azure.management.datalake.analytics.models.*; import com.microsoft.rest.*; | [
"com.microsoft.azure",
"com.microsoft.rest"
] | com.microsoft.azure; com.microsoft.rest; | 2,801,305 |
public boolean isTransient(Folder folder) {
if (folder == null)
return true;
else return folder.isNew();
}
| boolean function(Folder folder) { if (folder == null) return true; else return folder.isNew(); } | /**
* Determines whether or not the specified folder is transient,
* i.e. has not been saved to the database.
*
* @param folder The Folder being checked for transience.
*
* @return true if the specified folder is transient (or null),
* false otherwise.
*/ | Determines whether or not the specified folder is transient, i.e. has not been saved to the database | isTransient | {
"repo_name": "cianfrocco-lab/COSMIC-CryoEM-Gateway",
"path": "gateway_config/portal/src/main/java/org/ngbw/web/controllers/FolderController.java",
"license": "gpl-3.0",
"size": 26068
} | [
"org.ngbw.sdk.database.Folder"
] | import org.ngbw.sdk.database.Folder; | import org.ngbw.sdk.database.*; | [
"org.ngbw.sdk"
] | org.ngbw.sdk; | 1,345,353 |
public void testAppendConsistencyMultithreaded() throws Exception {
final AtomicBoolean stop = new AtomicBoolean();
final AtomicInteger chunksCtr = new AtomicInteger(); // How many chunks were written.
final AtomicReference<Exception> err = new AtomicReference<>();
igfs.create(FILE... | void function() throws Exception { final AtomicBoolean stop = new AtomicBoolean(); final AtomicInteger chunksCtr = new AtomicInteger(); final AtomicReference<Exception> err = new AtomicReference<>(); igfs.create(FILE, false).close(); int threadCnt = 50; | /**
* Ensure append consistency when multiple threads writes to the same file.
*
* @throws Exception If failed.
*/ | Ensure append consistency when multiple threads writes to the same file | testAppendConsistencyMultithreaded | {
"repo_name": "agura/incubator-ignite",
"path": "modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java",
"license": "apache-2.0",
"size": 103094
} | [
"java.util.concurrent.atomic.AtomicBoolean",
"java.util.concurrent.atomic.AtomicInteger",
"java.util.concurrent.atomic.AtomicReference"
] | import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; | import java.util.concurrent.atomic.*; | [
"java.util"
] | java.util; | 1,594,123 |
private boolean usesTable(
RelOptTable table,
Set<RelOptTable> usedTables,
Graphs.FrozenGraph<List<String>, DefaultEdge> usesGraph) {
for (RelOptTable queryTable : usedTables) {
if (usesGraph.getShortestPath(
table.getQualifiedName(),
queryTable.getQualifiedName()) != n... | boolean function( RelOptTable table, Set<RelOptTable> usedTables, Graphs.FrozenGraph<List<String>, DefaultEdge> usesGraph) { for (RelOptTable queryTable : usedTables) { if (usesGraph.getShortestPath( table.getQualifiedName(), queryTable.getQualifiedName()) != null) { return true; } } return false; } | /**
* Returns whether {@code table} uses one or more of the tables in
* {@code usedTables}.
*/ | Returns whether table uses one or more of the tables in usedTables | usesTable | {
"repo_name": "jinfengni/incubator-optiq",
"path": "core/src/main/java/org/apache/calcite/plan/volcano/VolcanoPlanner.java",
"license": "apache-2.0",
"size": 64454
} | [
"java.util.List",
"java.util.Set",
"org.apache.calcite.plan.RelOptTable",
"org.apache.calcite.util.graph.DefaultEdge",
"org.apache.calcite.util.graph.Graphs"
] | import java.util.List; import java.util.Set; import org.apache.calcite.plan.RelOptTable; import org.apache.calcite.util.graph.DefaultEdge; import org.apache.calcite.util.graph.Graphs; | import java.util.*; import org.apache.calcite.plan.*; import org.apache.calcite.util.graph.*; | [
"java.util",
"org.apache.calcite"
] | java.util; org.apache.calcite; | 2,229,554 |
private boolean resume(VirtualMachineLocation location)
{
log_.debug(String.format("Resuming virtual machine %s", location.getVirtualMachineId()));
if (!repository_.checkVirtualMachineStatus(location, VirtualMachineStatus.PAUSED))
{
return false;
}
... | boolean function(VirtualMachineLocation location) { log_.debug(String.format(STR, location.getVirtualMachineId())); if (!repository_.checkVirtualMachineStatus(location, VirtualMachineStatus.PAUSED)) { return false; } NetworkAddress localController = repository_.getLocalControllerControlDataAddress(location); if (localC... | /**
* Resume a virtual machine.
*
* @param location The virtual machine location
* @return true if everything ok, false otherwise
*/ | Resume a virtual machine | resume | {
"repo_name": "snoozesoftware/snoozenode",
"path": "src/main/java/org/inria/myriads/snoozenode/groupmanager/virtualmachinemanager/VirtualMachineManager.java",
"license": "gpl-2.0",
"size": 18530
} | [
"org.inria.myriads.snoozecommon.communication.NetworkAddress",
"org.inria.myriads.snoozecommon.communication.rest.CommunicatorFactory",
"org.inria.myriads.snoozecommon.communication.rest.api.LocalControllerAPI",
"org.inria.myriads.snoozecommon.communication.virtualcluster.status.VirtualMachineStatus",
"org.... | import org.inria.myriads.snoozecommon.communication.NetworkAddress; import org.inria.myriads.snoozecommon.communication.rest.CommunicatorFactory; import org.inria.myriads.snoozecommon.communication.rest.api.LocalControllerAPI; import org.inria.myriads.snoozecommon.communication.virtualcluster.status.VirtualMachineStatu... | import org.inria.myriads.snoozecommon.communication.*; import org.inria.myriads.snoozecommon.communication.rest.*; import org.inria.myriads.snoozecommon.communication.rest.api.*; import org.inria.myriads.snoozecommon.communication.virtualcluster.status.*; import org.inria.myriads.snoozecommon.communication.virtualclust... | [
"org.inria.myriads"
] | org.inria.myriads; | 292,888 |
public void removeDocuments(String search){
Session session = openSession();
try {
Database db = session.getDatabase(StringCache.EMPTY, Const.WEBSOCKET_PATH);
DocumentCollection col = db.search(search);
if(col!=null && col.getCount() > 0){
col.removeAll(true);
}
//cleanup
col.recycle()... | void function(String search){ Session session = openSession(); try { Database db = session.getDatabase(StringCache.EMPTY, Const.WEBSOCKET_PATH); DocumentCollection col = db.search(search); if(col!=null && col.getCount() > 0){ col.removeAll(true); } col.recycle(); db.recycle(); } catch (NotesException e) { LOG.log(Level... | /**
* Removes the documents.
*
* @param search the search
*/ | Removes the documents | removeDocuments | {
"repo_name": "mwambler/xockets.io",
"path": "com.tc.websocket/src/com/tc/websocket/runners/NotesOperation.java",
"license": "apache-2.0",
"size": 2512
} | [
"com.tc.utils.StringCache",
"com.tc.websocket.Const",
"java.util.logging.Level"
] | import com.tc.utils.StringCache; import com.tc.websocket.Const; import java.util.logging.Level; | import com.tc.utils.*; import com.tc.websocket.*; import java.util.logging.*; | [
"com.tc.utils",
"com.tc.websocket",
"java.util"
] | com.tc.utils; com.tc.websocket; java.util; | 2,309,352 |
private void paint(int brushObject, int penObject, Shape shape, Graphics2D g2d) {
if ( brushObject >= 0 ) {
Paint paint = getStoredPaint(currentStore, brushObject);
if (!((firstEffectivePaint) && (paint.equals(Color.white)))) {
setBrushPaint( currentStore, g2d, brushO... | void function(int brushObject, int penObject, Shape shape, Graphics2D g2d) { if ( brushObject >= 0 ) { Paint paint = getStoredPaint(currentStore, brushObject); if (!((firstEffectivePaint) && (paint.equals(Color.white)))) { setBrushPaint( currentStore, g2d, brushObject ); g2d.fill(shape); firstEffectivePaint = false; } ... | /** Draw or / and fill the Shape, depending on the pen or brush Objects selected.
*/ | Draw or / and fill the Shape, depending on the pen or brush Objects selected | paint | {
"repo_name": "Groostav/CMPT880-term-project",
"path": "intruder/benchs/batik/batik-1.7/sources/org/apache/batik/transcoder/wmf/tosvg/WMFPainter.java",
"license": "apache-2.0",
"size": 52810
} | [
"java.awt.Color",
"java.awt.Graphics2D",
"java.awt.Paint",
"java.awt.Shape"
] | import java.awt.Color; import java.awt.Graphics2D; import java.awt.Paint; import java.awt.Shape; | import java.awt.*; | [
"java.awt"
] | java.awt; | 1,283,537 |
public static int getSequenceIndex(int index, int length, Location loc)
throws EvalException {
int actualIndex = index;
if (actualIndex < 0) {
actualIndex += length;
}
if (actualIndex < 0 || actualIndex >= length) {
throw new EvalException(loc, "Index out of range (index is "
... | static int function(int index, int length, Location loc) throws EvalException { int actualIndex = index; if (actualIndex < 0) { actualIndex += length; } if (actualIndex < 0 actualIndex >= length) { throw new EvalException(loc, STR + index + STR + length + STR); } return actualIndex; } | /**
* Resolves a positive or negative index to an index in the range [0, length), or throws
* EvalException if it is out-of-range. If the index is negative, it counts backward from
* length.
*/ | Resolves a positive or negative index to an index in the range [0, length), or throws EvalException if it is out-of-range. If the index is negative, it counts backward from length | getSequenceIndex | {
"repo_name": "zhexuany/bazel",
"path": "src/main/java/com/google/devtools/build/lib/syntax/EvalUtils.java",
"license": "apache-2.0",
"size": 20686
} | [
"com.google.devtools.build.lib.events.Location"
] | import com.google.devtools.build.lib.events.Location; | import com.google.devtools.build.lib.events.*; | [
"com.google.devtools"
] | com.google.devtools; | 639,213 |
public void testProcessValueSame() throws EventTypeException, EncodingException, InvalidTriggerDataException {
// initial measurement read 10 minutes ago
EasyMock.expect(measurementManager.getMeasurement(MEASUREMENT_ID)).andReturn(measurement);
MetricValue initialValue = new MetricV... | void function() throws EventTypeException, EncodingException, InvalidTriggerDataException { EasyMock.expect(measurementManager.getMeasurement(MEASUREMENT_ID)).andReturn(measurement); MetricValue initialValue = new MetricValue(10d, System.currentTimeMillis() - (10 * 60 * 1000l)); EasyMock.expect(dataManager.getLastHisto... | /**
* Verifies that a measurement with the same value as the last one stored
* will not fire the trigger
* @throws EventTypeException
* @throws InvalidTriggerDataException
* @throws EncodingException
*/ | Verifies that a measurement with the same value as the last one stored will not fire the trigger | testProcessValueSame | {
"repo_name": "cc14514/hq6",
"path": "hq-server/src/test/java/org/hyperic/hq/bizapp/server/trigger/conditional/ValueChangeTriggerTest.java",
"license": "unlicense",
"size": 14357
} | [
"org.easymock.EasyMock",
"org.hyperic.hq.events.EventTypeException",
"org.hyperic.hq.events.InvalidTriggerDataException",
"org.hyperic.hq.events.TriggerNotFiredEvent",
"org.hyperic.hq.measurement.ext.MeasurementEvent",
"org.hyperic.hq.product.MetricValue",
"org.hyperic.util.config.EncodingException"
] | import org.easymock.EasyMock; import org.hyperic.hq.events.EventTypeException; import org.hyperic.hq.events.InvalidTriggerDataException; import org.hyperic.hq.events.TriggerNotFiredEvent; import org.hyperic.hq.measurement.ext.MeasurementEvent; import org.hyperic.hq.product.MetricValue; import org.hyperic.util.config.En... | import org.easymock.*; import org.hyperic.hq.events.*; import org.hyperic.hq.measurement.ext.*; import org.hyperic.hq.product.*; import org.hyperic.util.config.*; | [
"org.easymock",
"org.hyperic.hq",
"org.hyperic.util"
] | org.easymock; org.hyperic.hq; org.hyperic.util; | 2,494,228 |
public FieldInfoBuilder docString(String docString) {
this.docString = requireNonNull(docString, "docString");
return this;
} | FieldInfoBuilder function(String docString) { this.docString = requireNonNull(docString, STR); return this; } | /**
* Sets the documentation string of the field.
*/ | Sets the documentation string of the field | docString | {
"repo_name": "line/armeria",
"path": "core/src/main/java/com/linecorp/armeria/server/docs/FieldInfoBuilder.java",
"license": "apache-2.0",
"size": 3784
} | [
"java.util.Objects"
] | import java.util.Objects; | import java.util.*; | [
"java.util"
] | java.util; | 2,151,003 |
@SuppressWarnings("unchecked")
public Relation search(String name)
{
assert rootNode != null;
assert name != null;
for (Enumeration<Relation> children = rootNode.breadthFirstEnumeration() ; children.hasMoreElements() ;)
{
... | @SuppressWarnings(STR) Relation function(String name) { assert rootNode != null; assert name != null; for (Enumeration<Relation> children = rootNode.breadthFirstEnumeration() ; children.hasMoreElements() ;) { Relation child = children.nextElement(); if(name.equals(child.getName())) { return child; } } return new Relati... | /**
* Do a breadth-first search of the database tree
* to find the first tree node that contains
* the given actor's name.
*
* If no relationship is found then return a Relation
* that will indicate no relationship to the target actor.
*
... | Do a breadth-first search of the database tree to find the first tree node that contains the given actor's name. If no relationship is found then return a Relation that will indicate no relationship to the target actor | search | {
"repo_name": "p473lr/i-urge-mafia-gear",
"path": "HP Code Wars Team/src/y2008/prob14.java",
"license": "apache-2.0",
"size": 11326
} | [
"java.util.Enumeration"
] | import java.util.Enumeration; | import java.util.*; | [
"java.util"
] | java.util; | 2,397,923 |
public int getMetaFromState(IBlockState state)
{
return this.getAge(state);
} | int function(IBlockState state) { return this.getAge(state); } | /**
* Convert the BlockState into the correct metadata value
*/ | Convert the BlockState into the correct metadata value | getMetaFromState | {
"repo_name": "SuperUnitato/UnLonely",
"path": "build/tmp/recompileMc/sources/net/minecraft/block/BlockCrops.java",
"license": "lgpl-2.1",
"size": 9040
} | [
"net.minecraft.block.state.IBlockState"
] | import net.minecraft.block.state.IBlockState; | import net.minecraft.block.state.*; | [
"net.minecraft.block"
] | net.minecraft.block; | 1,168,565 |
@Test void testMergeUnionMixed() {
final String sql = "select * from emp where deptno = 10\n"
+ "union\n"
+ "select * from emp where deptno = 20\n"
+ "union all\n"
+ "select * from emp where deptno = 30\n";
sql(sql)
.withRule(CoreRules.UNION_MERGE)
.checkUnchang... | @Test void testMergeUnionMixed() { final String sql = STR + STR + STR + STR + STR; sql(sql) .withRule(CoreRules.UNION_MERGE) .checkUnchanged(); } | /** Tests that {@link UnionMergeRule} does nothing if its arguments have
* different {@code ALL} settings. */ | Tests that <code>UnionMergeRule</code> does nothing if its arguments have | testMergeUnionMixed | {
"repo_name": "datametica/calcite",
"path": "core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java",
"license": "apache-2.0",
"size": 264929
} | [
"org.apache.calcite.rel.rules.CoreRules",
"org.junit.jupiter.api.Test"
] | import org.apache.calcite.rel.rules.CoreRules; import org.junit.jupiter.api.Test; | import org.apache.calcite.rel.rules.*; import org.junit.jupiter.api.*; | [
"org.apache.calcite",
"org.junit.jupiter"
] | org.apache.calcite; org.junit.jupiter; | 166,851 |
public void disableAndroidSync(Account account) {
synchronized (mCachedSettings) {
mCachedSettings.setSyncAutomatically(account, false);
}
notifyObserversIfAccountSettingsChanged();
} | void function(Account account) { synchronized (mCachedSettings) { mCachedSettings.setSyncAutomatically(account, false); } notifyObserversIfAccountSettingsChanged(); } | /**
* Disables Android Chrome sync
*
* @param account the account to disable Chrome sync on
*/ | Disables Android Chrome sync | disableAndroidSync | {
"repo_name": "DirtyUnicorns/android_external_chromium-org",
"path": "sync/android/java/src/org/chromium/sync/notifier/SyncStatusHelper.java",
"license": "bsd-3-clause",
"size": 17420
} | [
"android.accounts.Account"
] | import android.accounts.Account; | import android.accounts.*; | [
"android.accounts"
] | android.accounts; | 1,376,281 |
public String getRemoteParentId(Metadata gtasksMetadata) {
String parent = null;
if (gtasksMetadata.containsNonNullValue(GtasksMetadata.PARENT_TASK)) {
long parentId = gtasksMetadata.getValue(GtasksMetadata.PARENT_TASK);
Metadata parentMetadata = getTaskMetadata(parentId);
... | String function(Metadata gtasksMetadata) { String parent = null; if (gtasksMetadata.containsNonNullValue(GtasksMetadata.PARENT_TASK)) { long parentId = gtasksMetadata.getValue(GtasksMetadata.PARENT_TASK); Metadata parentMetadata = getTaskMetadata(parentId); if (parentMetadata != null && parentMetadata.containsNonNullVa... | /**
* Gets the remote id string of the parent task
* @param gtasksMetadata
* @return
*/ | Gets the remote id string of the parent task | getRemoteParentId | {
"repo_name": "michaltakac/astrid",
"path": "astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksMetadataService.java",
"license": "gpl-3.0",
"size": 8475
} | [
"android.text.TextUtils",
"com.todoroo.astrid.data.Metadata"
] | import android.text.TextUtils; import com.todoroo.astrid.data.Metadata; | import android.text.*; import com.todoroo.astrid.data.*; | [
"android.text",
"com.todoroo.astrid"
] | android.text; com.todoroo.astrid; | 1,891,555 |
public static void link(String src, String dest) throws IOException {
copy(src,dest);
}
| static void function(String src, String dest) throws IOException { copy(src,dest); } | /**
* Link the source file in the destination.
* <P>
* Java does not support file links and this method should be implemented with the
* help of JNI.
* This problems should be fixed in the incoming JDK7.
* <P>
* In this version the link is replaced by a copy.
*
* TODO: Implement this method with JNI... | Link the source file in the destination. Java does not support file links and this method should be implemented with the help of JNI. This problems should be fixed in the incoming JDK7. In this version the link is replaced by a copy | link | {
"repo_name": "jbarriosc/ACSUFRO",
"path": "LGPL/CommonSoftware/acsGUIs/acsEclipseUtils/src/alma/acs/eclipse/utils/jar/FileHelper.java",
"license": "lgpl-2.1",
"size": 3699
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 922,895 |
@Test
public void testLong2Short() {
try {
Message message = senderSession.createMessage();
// store a value that can't be converted to short
message.setLongProperty("prop", 127L);
message.getShortProperty("prop");
Assert.fail("sec. 3.5.4 The unmarked cases [of T... | void function() { try { Message message = senderSession.createMessage(); message.setLongProperty("prop", 127L); message.getShortProperty("prop"); Assert.fail(STR); } catch (MessageFormatException e) { } catch (JMSException e) { fail(e); } } | /**
* if a property is set as a <code>long</code>,
* to get is as a <code>short</code> throws a <code>javax.jms.MessageFormatException</code>.
*/ | if a property is set as a <code>long</code>, to get is as a <code>short</code> throws a <code>javax.jms.MessageFormatException</code> | testLong2Short | {
"repo_name": "cshannon/activemq-artemis",
"path": "tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/properties/MessagePropertyConversionTest.java",
"license": "apache-2.0",
"size": 43771
} | [
"javax.jms.JMSException",
"javax.jms.Message",
"javax.jms.MessageFormatException",
"org.junit.Assert"
] | import javax.jms.JMSException; import javax.jms.Message; import javax.jms.MessageFormatException; import org.junit.Assert; | import javax.jms.*; import org.junit.*; | [
"javax.jms",
"org.junit"
] | javax.jms; org.junit; | 11,439 |
public MessageFormat getFormatLocalizedResource()
{
return myFormatLocalizedResource;
} | MessageFormat function() { return myFormatLocalizedResource; } | /**
* Get formatLocalizedResource.
*
* @return the formatLocalizedResource
* @since 0-SNAPSHOT
*/ | Get formatLocalizedResource | getFormatLocalizedResource | {
"repo_name": "sporniket/game",
"path": "sporniket-game-papi/src/main/java/com/sporniket/libre/game/papi/resource/ResourceNameProviderSound.java",
"license": "lgpl-3.0",
"size": 3691
} | [
"java.text.MessageFormat"
] | import java.text.MessageFormat; | import java.text.*; | [
"java.text"
] | java.text; | 1,672,911 |
public static void autoDomainAxis(ChartPanel myChart) {
XYPlot plot = (XYPlot) myChart.getChart().getPlot();
NumberAxis axis = (NumberAxis) plot.getDomainAxis();
// trick. Otherwise auto range will fail sometimes
axis.setRange(axis.getRange());
axis.setAutoRangeIncludesZero(false);
myChart.res... | static void function(ChartPanel myChart) { XYPlot plot = (XYPlot) myChart.getChart().getPlot(); NumberAxis axis = (NumberAxis) plot.getDomainAxis(); axis.setRange(axis.getRange()); axis.setAutoRangeIncludesZero(false); myChart.restoreAutoDomainBounds(); } | /**
* Auto range the range axis
*
* @param myChart
*/ | Auto range the range axis | autoDomainAxis | {
"repo_name": "tomas-pluskal/mzmine3",
"path": "src/main/java/io/github/mzmine/gui/chartbasics/ChartLogics.java",
"license": "gpl-2.0",
"size": 27467
} | [
"org.jfree.chart.ChartPanel",
"org.jfree.chart.axis.NumberAxis",
"org.jfree.chart.plot.XYPlot"
] | import org.jfree.chart.ChartPanel; import org.jfree.chart.axis.NumberAxis; import org.jfree.chart.plot.XYPlot; | import org.jfree.chart.*; import org.jfree.chart.axis.*; import org.jfree.chart.plot.*; | [
"org.jfree.chart"
] | org.jfree.chart; | 423,348 |
private OMARDAO getDAOForObject(RegistryObjectType ro, ServerRequestContext context) throws RegistryException {
OMARDAO dao = null;
try {
String bindingClassName = ro.getClass().getName();
String daoClassName = bindingClassName.substring(bindingClassName.lastIndexOf('.'... | OMARDAO function(RegistryObjectType ro, ServerRequestContext context) throws RegistryException { OMARDAO dao = null; try { String bindingClassName = ro.getClass().getName(); String daoClassName = bindingClassName.substring(bindingClassName.lastIndexOf('.') + 1, bindingClassName.length() - 4); Class daoClazz = Class.for... | /**
* Given a Binding object returns the OMARDAO for that object.
*
*/ | Given a Binding object returns the OMARDAO for that object | getDAOForObject | {
"repo_name": "kef/hieos",
"path": "src/omar/src/org/freebxml/omar/server/persistence/rdb/SQLPersistenceManagerImpl.java",
"license": "apache-2.0",
"size": 42960
} | [
"java.lang.reflect.Constructor",
"javax.xml.registry.RegistryException",
"org.freebxml.omar.server.common.ServerRequestContext",
"org.oasis.ebxml.registry.bindings.rim.RegistryObjectType"
] | import java.lang.reflect.Constructor; import javax.xml.registry.RegistryException; import org.freebxml.omar.server.common.ServerRequestContext; import org.oasis.ebxml.registry.bindings.rim.RegistryObjectType; | import java.lang.reflect.*; import javax.xml.registry.*; import org.freebxml.omar.server.common.*; import org.oasis.ebxml.registry.bindings.rim.*; | [
"java.lang",
"javax.xml",
"org.freebxml.omar",
"org.oasis.ebxml"
] | java.lang; javax.xml; org.freebxml.omar; org.oasis.ebxml; | 816,752 |
public ClassInfoList getAssignableTo(final ClassInfo superclassOrInterface) {
if (superclassOrInterface == null) {
throw new IllegalArgumentException("assignableToClass parameter cannot be null");
}
// Get subclasses and implementing classes for assignableFromClass
final ... | ClassInfoList function(final ClassInfo superclassOrInterface) { if (superclassOrInterface == null) { throw new IllegalArgumentException(STR); } final Set<ClassInfo> allAssignableFromClasses = new HashSet<>(); if (superclassOrInterface.isStandardClass()) { allAssignableFromClasses.addAll(superclassOrInterface.getSubclas... | /**
* Filter this {@link ClassInfoList} to include only classes that are assignable to the requested class,
* assignableToClass (i.e. where assignableToClass is a superclass or implemented interface of the list
* element).
*
* @param superclassOrInterface
* the superclass or in... | Filter this <code>ClassInfoList</code> to include only classes that are assignable to the requested class, assignableToClass (i.e. where assignableToClass is a superclass or implemented interface of the list element) | getAssignableTo | {
"repo_name": "classgraph/classgraph",
"path": "src/main/java/io/github/classgraph/ClassInfoList.java",
"license": "mit",
"size": 41245
} | [
"java.util.HashSet",
"java.util.Set"
] | import java.util.HashSet; import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 30,485 |
public void removeWithDelete(Codelet co)
{
this.listInterpreters.remove(co);
if(codeRack!=null)
codeRack.destroyCodelet(co);
}
| void function(Codelet co) { this.listInterpreters.remove(co); if(codeRack!=null) codeRack.destroyCodelet(co); } | /**
* Removes the given codelet from this proxy and destroys it in code rack.
* @param co
*/ | Removes the given codelet from this proxy and destroys it in code rack | removeWithDelete | {
"repo_name": "rgudwin/cst",
"path": "src/main/java/br/unicamp/cst/perception/PerceptionProxy.java",
"license": "lgpl-3.0",
"size": 2345
} | [
"br.unicamp.cst.core.entities.Codelet"
] | import br.unicamp.cst.core.entities.Codelet; | import br.unicamp.cst.core.entities.*; | [
"br.unicamp.cst"
] | br.unicamp.cst; | 641,734 |
public Viewer getViewer() {
return currentViewer;
} | Viewer function() { return currentViewer; } | /**
* This returns the viewer as required by the {@link IViewerProvider} interface.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This returns the viewer as required by the <code>IViewerProvider</code> interface. | getViewer | {
"repo_name": "ObeoNetwork/EAST-ADL-Designer",
"path": "plugins/org.obeonetwork.dsl.eastadl.editor/src/org/obeonetwork/dsl/east_adl/requirements/presentation/RequirementsEditor.java",
"license": "epl-1.0",
"size": 56816
} | [
"org.eclipse.jface.viewers.Viewer"
] | import org.eclipse.jface.viewers.Viewer; | import org.eclipse.jface.viewers.*; | [
"org.eclipse.jface"
] | org.eclipse.jface; | 813,944 |
void createTemporaryQueue(String address, RoutingType routingType, String queueName, String filter) throws ActiveMQException; | void createTemporaryQueue(String address, RoutingType routingType, String queueName, String filter) throws ActiveMQException; | /**
* Creates a <em>temporary</em> queue with a filter.
*
* @param address the queue will be bound to this address
* @param routingType the delivery mode for this queue, MULTICAST or ANYCAST
* @param queueName the name of the queue
* @param filter only messages which match this filter will ... | Creates a temporary queue with a filter | createTemporaryQueue | {
"repo_name": "willr3/activemq-artemis",
"path": "artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientSession.java",
"license": "apache-2.0",
"size": 41343
} | [
"org.apache.activemq.artemis.api.core.ActiveMQException",
"org.apache.activemq.artemis.core.server.RoutingType"
] | import org.apache.activemq.artemis.api.core.ActiveMQException; import org.apache.activemq.artemis.core.server.RoutingType; | import org.apache.activemq.artemis.api.core.*; import org.apache.activemq.artemis.core.server.*; | [
"org.apache.activemq"
] | org.apache.activemq; | 1,943,103 |
@VisibleForTesting // productionVisibility = Visibility.PRIVATE
public void preparePackageLoading(
PathPackageLocator pkgLocator,
PackageCacheOptions packageCacheOptions,
SkylarkSemanticsOptions skylarkSemanticsOptions,
String defaultsPackageContents,
UUID commandId,
Map<String, ... | @VisibleForTesting void function( PathPackageLocator pkgLocator, PackageCacheOptions packageCacheOptions, SkylarkSemanticsOptions skylarkSemanticsOptions, String defaultsPackageContents, UUID commandId, Map<String, String> clientEnv, Map<String, String> actionEnv, TimestampGranularityMonitor tsgm) { Preconditions.check... | /**
* Prepares the evaluator for loading.
*
* <p>MUST be run before every incremental build.
*/ | Prepares the evaluator for loading. MUST be run before every incremental build | preparePackageLoading | {
"repo_name": "variac/bazel",
"path": "src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java",
"license": "apache-2.0",
"size": 96878
} | [
"com.google.common.annotations.VisibleForTesting",
"com.google.devtools.build.lib.pkgcache.PackageCacheOptions",
"com.google.devtools.build.lib.pkgcache.PathPackageLocator",
"com.google.devtools.build.lib.syntax.SkylarkSemanticsOptions",
"com.google.devtools.build.lib.util.Preconditions",
"com.google.devt... | import com.google.common.annotations.VisibleForTesting; import com.google.devtools.build.lib.pkgcache.PackageCacheOptions; import com.google.devtools.build.lib.pkgcache.PathPackageLocator; import com.google.devtools.build.lib.syntax.SkylarkSemanticsOptions; import com.google.devtools.build.lib.util.Preconditions; impor... | import com.google.common.annotations.*; import com.google.devtools.build.lib.pkgcache.*; import com.google.devtools.build.lib.syntax.*; import com.google.devtools.build.lib.util.*; import com.google.devtools.build.lib.util.io.*; import java.util.*; | [
"com.google.common",
"com.google.devtools",
"java.util"
] | com.google.common; com.google.devtools; java.util; | 2,383,828 |
public static synchronized void persistInstallStatus(List<UpdateCenterJob> installingPlugins) {
File installingPluginsFile = getInstallingPluginsFile();
if(installingPlugins == null || installingPlugins.isEmpty()) {
installingPluginsFile.delete();
return;
}
LOGGER.fine("Writing install state to: " + ... | static synchronized void function(List<UpdateCenterJob> installingPlugins) { File installingPluginsFile = getInstallingPluginsFile(); if(installingPlugins == null installingPlugins.isEmpty()) { installingPluginsFile.delete(); return; } LOGGER.fine(STR + installingPluginsFile.getAbsolutePath()); Map<String,String> statu... | /**
* Persists a list of installing plugins; this is used in the case Jenkins fails mid-installation and needs to be restarted
* @param installingPlugins
*/ | Persists a list of installing plugins; this is used in the case Jenkins fails mid-installation and needs to be restarted | persistInstallStatus | {
"repo_name": "stephenc/jenkins",
"path": "core/src/main/java/jenkins/install/InstallUtil.java",
"license": "mit",
"size": 14929
} | [
"com.thoughtworks.xstream.XStream",
"hudson.model.UpdateCenter",
"java.io.File",
"java.io.IOException",
"java.util.HashMap",
"java.util.List",
"java.util.Map",
"org.apache.commons.io.FileUtils"
] | import com.thoughtworks.xstream.XStream; import hudson.model.UpdateCenter; import java.io.File; import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.commons.io.FileUtils; | import com.thoughtworks.xstream.*; import hudson.model.*; import java.io.*; import java.util.*; import org.apache.commons.io.*; | [
"com.thoughtworks.xstream",
"hudson.model",
"java.io",
"java.util",
"org.apache.commons"
] | com.thoughtworks.xstream; hudson.model; java.io; java.util; org.apache.commons; | 884,920 |
public static Map<String, String> getVideoInfo(String youTubeId) throws IOException
{
final Map<String, String> retval = new HashMap<String, String>();
getVideoInfo(youTubeId, retval);
return retval;
} | static Map<String, String> function(String youTubeId) throws IOException { final Map<String, String> retval = new HashMap<String, String>(); getVideoInfo(youTubeId, retval); return retval; } | /**
* Gets all parameters we can figure out about this youTubeId by scraping YouTube.
* The URL for the underlying video will have the key "location".
* @param youTubeId A YouTube ID
* @return A map with all parameters as key-value pairs.
* @throws IOException if we have networking troubles
*/ | Gets all parameters we can figure out about this youTubeId by scraping YouTube. The URL for the underlying video will have the key "location" | getVideoInfo | {
"repo_name": "artclarke/xuggle-utils",
"path": "src/main/java/com/xuggle/utils/net/YouTube.java",
"license": "gpl-3.0",
"size": 5531
} | [
"java.io.IOException",
"java.util.HashMap",
"java.util.Map"
] | import java.io.IOException; import java.util.HashMap; import java.util.Map; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 2,282,741 |
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<RouteFilterInner>, RouteFilterInner> beginCreateOrUpdate(
String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters); | @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller<PollResult<RouteFilterInner>, RouteFilterInner> beginCreateOrUpdate( String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters); | /**
* Creates or updates a route filter in a specified resource group.
*
* @param resourceGroupName The name of the resource group.
* @param routeFilterName The name of the route filter.
* @param routeFilterParameters Parameters supplied to the create or update route filter operation.
* @t... | Creates or updates a route filter in a specified resource group | beginCreateOrUpdate | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/RouteFiltersClient.java",
"license": "mit",
"size": 23978
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.management.polling.PollResult",
"com.azure.core.util.polling.SyncPoller",
"com.azure.resourcemanager.network.fluent.models.RouteFilterInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.management.polling.PollResult; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.network.fluent.models.RouteFilterInner; | import com.azure.core.annotation.*; import com.azure.core.management.polling.*; import com.azure.core.util.polling.*; import com.azure.resourcemanager.network.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 2,399,692 |
public void addEdge(int sourceId, int sourceLabel, String label, int targetId, int targetLabel) {
setEdges(ArrayUtils.addAll(getEdges(), sourceId, sourceLabel, targetId, targetLabel));
setEdgeLabels(ArrayUtils.add(getEdgeLabels(), label));
} | void function(int sourceId, int sourceLabel, String label, int targetId, int targetLabel) { setEdges(ArrayUtils.addAll(getEdges(), sourceId, sourceLabel, targetId, targetLabel)); setEdgeLabels(ArrayUtils.add(getEdgeLabels(), label)); } | /**
* Convenience method to add an edge.
* @param sourceId source vertex id
* @param sourceLabel source vertex label
* @param label edge label
* @param targetId target vertex id
* @param targetLabel target vertex label
*/ | Convenience method to add an edge | addEdge | {
"repo_name": "rostam/gradoop",
"path": "gradoop-flink/src/main/java/org/gradoop/flink/algorithms/fsm/dimspan/tuples/LabeledGraphIntString.java",
"license": "apache-2.0",
"size": 3928
} | [
"org.apache.commons.lang3.ArrayUtils"
] | import org.apache.commons.lang3.ArrayUtils; | import org.apache.commons.lang3.*; | [
"org.apache.commons"
] | org.apache.commons; | 1,757,899 |
private static IPath[] decodePatterns(NamedNodeMap nodeMap, String tag) {
String sequence = removeAttribute(tag, nodeMap);
if (!sequence.equals("")) { //$NON-NLS-1$
char[][] patterns = CharOperation.splitOn('|', sequence.toCharArray());
int patternCount;
if ((patt... | static IPath[] function(NamedNodeMap nodeMap, String tag) { String sequence = removeAttribute(tag, nodeMap); if (!sequence.equals("")) { char[][] patterns = CharOperation.splitOn(' ', sequence.toCharArray()); int patternCount; if ((patternCount = patterns.length) > 0) { IPath[] paths = new IPath[patternCount]; int inde... | /**
* Decode some element tag containing a sequence of patterns into IPath[]
*/ | Decode some element tag containing a sequence of patterns into IPath[] | decodePatterns | {
"repo_name": "kaloyan-raev/che",
"path": "plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/core/ClasspathEntry.java",
"license": "epl-1.0",
"size": 107536
} | [
"org.eclipse.core.runtime.IPath",
"org.eclipse.core.runtime.Path",
"org.eclipse.jdt.core.compiler.CharOperation",
"org.w3c.dom.NamedNodeMap"
] | import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; import org.eclipse.jdt.core.compiler.CharOperation; import org.w3c.dom.NamedNodeMap; | import org.eclipse.core.runtime.*; import org.eclipse.jdt.core.compiler.*; import org.w3c.dom.*; | [
"org.eclipse.core",
"org.eclipse.jdt",
"org.w3c.dom"
] | org.eclipse.core; org.eclipse.jdt; org.w3c.dom; | 1,528,413 |
public Configuration getConfiguration() {
return config;
} | Configuration function() { return config; } | /**
* Get the configuration.
*
* @return the configuration; never null
*/ | Get the configuration | getConfiguration | {
"repo_name": "rhauch/debezium-proto",
"path": "debezium/src/main/java/org/debezium/driver/DbzNode.java",
"license": "apache-2.0",
"size": 21353
} | [
"org.debezium.Configuration"
] | import org.debezium.Configuration; | import org.debezium.*; | [
"org.debezium"
] | org.debezium; | 843,924 |
public float getLength(Pointable pointable) {
return pointable.length();
} | float function(Pointable pointable) { return pointable.length(); } | /**
* passes the length of a pointable though.
*
* @param pointable
* @return
*/ | passes the length of a pointable though | getLength | {
"repo_name": "manorius/Processing",
"path": "libraries/LeapMotionP5/src/com/onformative/leap/LeapMotionP5.java",
"license": "mit",
"size": 31364
} | [
"com.leapmotion.leap.Pointable"
] | import com.leapmotion.leap.Pointable; | import com.leapmotion.leap.*; | [
"com.leapmotion.leap"
] | com.leapmotion.leap; | 2,183,965 |
static public double angle(Point p1, Point p2) {
// from p2 to p1
if (p1.equals(p2))
return -Math.PI / 2.; // point up by default
double x1 = p1.x;
double x2 = p2.x;
double y1 = p1.y;
double y2 = p2.y;
double d = Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
double a = Math.acos((x1... | static double function(Point p1, Point p2) { if (p1.equals(p2)) return -Math.PI / 2.; double x1 = p1.x; double x2 = p2.x; double y1 = p1.y; double y2 = p2.y; double d = Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); double a = Math.acos((x1 - x2) / d); return (y1 >= y2) ? a : -a; } | /**
* Return the angle of the vector joining two points.
*/ | Return the angle of the vector joining two points | angle | {
"repo_name": "alternativeTime/GlycanBuilderVaadin7Version",
"path": "glycanbuilderv/src/ac/uk/icl/dell/vaadin/glycanbuilder/Geometry.java",
"license": "gpl-3.0",
"size": 10974
} | [
"java.awt.Point"
] | import java.awt.Point; | import java.awt.*; | [
"java.awt"
] | java.awt; | 733,563 |
@Test
public void testAutoRemovalConcurrency() throws InterruptedException {
final NotificationMessageDeliveryAutoRemovalService nSvc = services.getNotificationMessageDeliveryAutoRemovalService();
services.getNotificationMessageDeliveryResolverService().resolveNotificationMessageDeliveries(); | void function() throws InterruptedException { final NotificationMessageDeliveryAutoRemovalService nSvc = services.getNotificationMessageDeliveryAutoRemovalService(); services.getNotificationMessageDeliveryResolverService().resolveNotificationMessageDeliveries(); | /**
* Test concurrent auto-removal of message deliveries
*/ | Test concurrent auto-removal of message deliveries | testAutoRemovalConcurrency | {
"repo_name": "ua-eas/ua-rice-2.1.9",
"path": "it/ken/src/test/java/org/kuali/rice/ken/services/impl/NotificationMessageDeliveryAutoRemovalServiceImplTest.java",
"license": "apache-2.0",
"size": 4515
} | [
"org.kuali.rice.ken.service.NotificationMessageDeliveryAutoRemovalService"
] | import org.kuali.rice.ken.service.NotificationMessageDeliveryAutoRemovalService; | import org.kuali.rice.ken.service.*; | [
"org.kuali.rice"
] | org.kuali.rice; | 1,011,563 |
public Future<HttpResponse> listScheduled(String toEmail,
ObjectResponseCallback<MessageSchedule[]> callback) {
return getClient().execute(MESSAGE_LIST_SCHEDULED,
mapParams("to", toEmail), callback);
}
| Future<HttpResponse> function(String toEmail, ObjectResponseCallback<MessageSchedule[]> callback) { return getClient().execute(MESSAGE_LIST_SCHEDULED, mapParams("to", toEmail), callback); } | /**
* Queries your scheduled emails by sender or recipient, or both.
* @param toEmail an optional recipient address to restrict results to
* @param callback
* @return
*/ | Queries your scheduled emails by sender or recipient, or both | listScheduled | {
"repo_name": "JobHive/saki-monkey",
"path": "src/main/java/com/jobhive/sakimonkey/api/async/MessageAsyncApi.java",
"license": "apache-2.0",
"size": 11450
} | [
"com.jobhive.sakimonkey.api.async.callback.ObjectResponseCallback",
"com.jobhive.sakimonkey.data.response.MessageSchedule",
"java.util.concurrent.Future",
"org.apache.http.HttpResponse"
] | import com.jobhive.sakimonkey.api.async.callback.ObjectResponseCallback; import com.jobhive.sakimonkey.data.response.MessageSchedule; import java.util.concurrent.Future; import org.apache.http.HttpResponse; | import com.jobhive.sakimonkey.api.async.callback.*; import com.jobhive.sakimonkey.data.response.*; import java.util.concurrent.*; import org.apache.http.*; | [
"com.jobhive.sakimonkey",
"java.util",
"org.apache.http"
] | com.jobhive.sakimonkey; java.util; org.apache.http; | 2,123,310 |
public InputStream endRequest(String path) {
throw new UnsupportedOperationException();
} | InputStream function(String path) { throw new UnsupportedOperationException(); } | /**
* Operation not supported
*/ | Operation not supported | endRequest | {
"repo_name": "minhhai2209/VersionOne.SDK.Java.APIClient",
"path": "src/main/java/com/versionone/apiclient/FileAPIConnector.java",
"license": "bsd-3-clause",
"size": 4842
} | [
"java.io.InputStream"
] | import java.io.InputStream; | import java.io.*; | [
"java.io"
] | java.io; | 2,882,229 |
private ICloseableIterator<IBindingSet> doNonBigdataMockIVServiceCall(
final ServiceCall<IBindingSet> serviceCall,
final IBindingSet left[]) throws Exception {
return serviceCall.call(left);
}
... | ICloseableIterator<IBindingSet> function( final ServiceCall<IBindingSet> serviceCall, final IBindingSet left[]) throws Exception { return serviceCall.call(left); } } } private static class ServiceCallChunk { public final BigdataURI serviceURI; public final ServiceCall<?> serviceCall; private IBindingSet[] chunk; privat... | /**
* Service call against a (non sesame based) external endpoint.
*
* @param serviceCall
* The object which will make the service call.
* @param left
* The source solutions.
*
... | Service call against a (non sesame based) external endpoint | doNonBigdataMockIVServiceCall | {
"repo_name": "rac021/blazegraph_1_5_3_cluster_2_nodes",
"path": "bigdata/src/java/com/bigdata/bop/controller/ServiceCallJoin.java",
"license": "gpl-2.0",
"size": 35781
} | [
"com.bigdata.bop.IBindingSet",
"com.bigdata.rdf.model.BigdataURI",
"com.bigdata.rdf.sparql.ast.service.ServiceCall",
"java.util.LinkedList",
"java.util.List"
] | import com.bigdata.bop.IBindingSet; import com.bigdata.rdf.model.BigdataURI; import com.bigdata.rdf.sparql.ast.service.ServiceCall; import java.util.LinkedList; import java.util.List; | import com.bigdata.bop.*; import com.bigdata.rdf.model.*; import com.bigdata.rdf.sparql.ast.service.*; import java.util.*; | [
"com.bigdata.bop",
"com.bigdata.rdf",
"java.util"
] | com.bigdata.bop; com.bigdata.rdf; java.util; | 758,927 |
public static String doubleToString(double value, String format)
{
return new DecimalFormat(format).format(value);
} | static String function(double value, String format) { return new DecimalFormat(format).format(value); } | /**
* Converts a double to a string.
*
* @param value
* @param format
* The format, e.g. #.00
* @return
*/ | Converts a double to a string | doubleToString | {
"repo_name": "fraunhoferfokus/fokus-upnp",
"path": "upnp-utils/src/main/java/de/fraunhofer/fokus/upnp/util/StringHelper.java",
"license": "gpl-3.0",
"size": 19922
} | [
"java.text.DecimalFormat"
] | import java.text.DecimalFormat; | import java.text.*; | [
"java.text"
] | java.text; | 1,827,196 |
void addSelectionListener(Listener listener) {
eventList.add(listener);
} | void addSelectionListener(Listener listener) { eventList.add(listener); } | /**
* Adds a selection event listener. The toolbar generates events when it
* selects an item in the history table
*
* @param listener
* the listener that will receive the event
*/ | Adds a selection event listener. The toolbar generates events when it selects an item in the history table | addSelectionListener | {
"repo_name": "blizzy78/egit",
"path": "org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FindToolbar.java",
"license": "epl-1.0",
"size": 18430
} | [
"org.eclipse.swt.widgets.Listener"
] | import org.eclipse.swt.widgets.Listener; | import org.eclipse.swt.widgets.*; | [
"org.eclipse.swt"
] | org.eclipse.swt; | 2,023,467 |
public static String[] toStringArray(Collection<String> collection) {
if (collection == null) {
return null;
}
return collection.toArray(new String[collection.size()]);
} | static String[] function(Collection<String> collection) { if (collection == null) { return null; } return collection.toArray(new String[collection.size()]); } | /**
* Copy the given Collection into a String array.
* The Collection must contain String elements only.
* @param collection the Collection to copy
* @return the String array (<code>null</code> if the passed-in
* Collection was <code>null</code>)
*/ | Copy the given Collection into a String array. The Collection must contain String elements only | toStringArray | {
"repo_name": "fernandocamargoti/JavaMagazineRESTfulAPI",
"path": "src/main/java/br/com/devmedia/javamagazine/restfulapi/util/StringUtils.java",
"license": "apache-2.0",
"size": 10402
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 10,094 |
@FIXVersion(introduced = "4.4")
public void setFinancingDetails() {
throw new UnsupportedOperationException(getUnsupportedTagMessage());
} | @FIXVersion(introduced = "4.4") void function() { throw new UnsupportedOperationException(getUnsupportedTagMessage()); } | /**
* Sets the FinancingDetails component class to the proper implementation.
*/ | Sets the FinancingDetails component class to the proper implementation | setFinancingDetails | {
"repo_name": "marvisan/HadesFIX",
"path": "Model/src/main/java/net/hades/fix/message/group/QuoteRequestRejectGroup.java",
"license": "gpl-3.0",
"size": 50378
} | [
"net.hades.fix.message.anno.FIXVersion"
] | import net.hades.fix.message.anno.FIXVersion; | import net.hades.fix.message.anno.*; | [
"net.hades.fix"
] | net.hades.fix; | 1,896,642 |
public void setCampaignNegativeSites(CampaignNegativeSites campaignNegativeSites) {
this.campaignNegativeSites = campaignNegativeSites;
}
private String campaignName; | void function(CampaignNegativeSites campaignNegativeSites) { this.campaignNegativeSites = campaignNegativeSites; } private String campaignName; | /**
* Sets the CampaignNegativeSites Data Object of the Campaign Management Service.
* A subset of CampaignNegativeSites properties are available in the
* Campaign Negative Site record.
*
* <p>
* For more information, see Campaign Negative Site at
* <a href="http://go.microsoft.com/fw... | Sets the CampaignNegativeSites Data Object of the Campaign Management Service. A subset of CampaignNegativeSites properties are available in the Campaign Negative Site record. For more information, see Campaign Negative Site at HREF | setCampaignNegativeSites | {
"repo_name": "shyTNT/BingAds-Java-SDK",
"path": "src/main/java/com/microsoft/bingads/bulk/entities/BulkCampaignNegativeSites.java",
"license": "mit",
"size": 6300
} | [
"com.microsoft.bingads.campaignmanagement.CampaignNegativeSites"
] | import com.microsoft.bingads.campaignmanagement.CampaignNegativeSites; | import com.microsoft.bingads.campaignmanagement.*; | [
"com.microsoft.bingads"
] | com.microsoft.bingads; | 362,981 |
public static AnalysisEngineDescription configure(String relationshipNamespace)
throws UIMAException, IOException {
return RelationshipPatternLineWriter.configure(relationshipNamespace, null, null, true, false,
0);
} | static AnalysisEngineDescription function(String relationshipNamespace) throws UIMAException, IOException { return RelationshipPatternLineWriter.configure(relationshipNamespace, null, null, true, false, 0); } | /**
* Configure a default CAS consumer descriptor for a pipeline. This consumer will print to
* STDOUT, using the system's default encoding, and will print patterns of any size.
*
* @param relationshipNamespace the namespace of the annotated relationships
* @return a configured AE description
* @thro... | Configure a default CAS consumer descriptor for a pipeline. This consumer will print to STDOUT, using the system's default encoding, and will print patterns of any size | configure | {
"repo_name": "fnl/txtfnnl",
"path": "txtfnnl-wrappers/src/main/java/txtfnnl/uima/collection/RelationshipPatternLineWriter.java",
"license": "apache-2.0",
"size": 31164
} | [
"java.io.IOException",
"org.apache.uima.UIMAException",
"org.apache.uima.analysis_engine.AnalysisEngineDescription"
] | import java.io.IOException; import org.apache.uima.UIMAException; import org.apache.uima.analysis_engine.AnalysisEngineDescription; | import java.io.*; import org.apache.uima.*; import org.apache.uima.analysis_engine.*; | [
"java.io",
"org.apache.uima"
] | java.io; org.apache.uima; | 386,618 |
public static void main(String args[]) throws Exception {
try {
Configuration c = HBaseConfiguration.create();
TestHRegionServerBulkLoad test = new TestHRegionServerBulkLoad();
test.setConf(c);
test.runAtomicBulkloadTest(TableName.valueOf("atomicTableTest"), 5 * 60 * 1000, 50);
} final... | static void function(String args[]) throws Exception { try { Configuration c = HBaseConfiguration.create(); TestHRegionServerBulkLoad test = new TestHRegionServerBulkLoad(); test.setConf(c); test.runAtomicBulkloadTest(TableName.valueOf(STR), 5 * 60 * 1000, 50); } finally { System.exit(0); } } | /**
* Run test on an HBase instance for 5 minutes. This assumes that the table
* under test only has a single region.
*/ | Run test on an HBase instance for 5 minutes. This assumes that the table under test only has a single region | main | {
"repo_name": "Guavus/hbase",
"path": "hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java",
"license": "apache-2.0",
"size": 14540
} | [
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.hbase.HBaseConfiguration",
"org.apache.hadoop.hbase.TableName"
] | import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.TableName; | import org.apache.hadoop.conf.*; import org.apache.hadoop.hbase.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 1,848,280 |
public static Bound from(ValueProvider<String> tableSpec) {
return new Bound().from(tableSpec);
} | static Bound function(ValueProvider<String> tableSpec) { return new Bound().from(tableSpec); } | /**
* Same as {@code from(String)}, but with a {@link ValueProvider}.
*/ | Same as from(String), but with a <code>ValueProvider</code> | from | {
"repo_name": "jasonkuster/beam",
"path": "sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryIO.java",
"license": "apache-2.0",
"size": 122807
} | [
"org.apache.beam.sdk.options.ValueProvider"
] | import org.apache.beam.sdk.options.ValueProvider; | import org.apache.beam.sdk.options.*; | [
"org.apache.beam"
] | org.apache.beam; | 1,750,066 |
public Thread getWaitingThread() {
return waitingThread;
}
public static class ExitCodeException extends IOException {
private final int exitCode;
public ExitCodeException(int exitCode, String message) {
super(message);
this.exitCode = exitCode;
} | Thread function() { return waitingThread; } public static class ExitCodeException extends IOException { private final int exitCode; public ExitCodeException(int exitCode, String message) { super(message); this.exitCode = exitCode; } | /** get the thread that is waiting on this instance of <code>Shell</code>.
* @return the thread that ran runCommand() that spawned this shell
* or null if no thread is waiting for this shell to complete
*/ | get the thread that is waiting on this instance of <code>Shell</code> | getWaitingThread | {
"repo_name": "lukmajercak/hadoop",
"path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java",
"license": "apache-2.0",
"size": 46520
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,802,445 |
public Message requestASCIILightingDeviceDescription(int deviceNumber) {
if (deviceNumber < 1 || deviceNumber > 192) {
throw new IllegalArgumentException("device number must be between 1 - 192");
}
String fullCommand = sd_CMD_REQUEST_STRING_DESCRIPTIONS + "07" + String.format("%03d", deviceNumber);
se... | Message function(int deviceNumber) { if (deviceNumber < 1 deviceNumber > 192) { throw new IllegalArgumentException(STR); } String fullCommand = sd_CMD_REQUEST_STRING_DESCRIPTIONS + "07" + String.format("%03d", deviceNumber); sendCommand(fullCommand); try { return readMessages(SD_REPLY_STRING_DESCRIPTIONS_REPORT_DATA); ... | /**
* <quote>
*
* 4.19.1 Request ASCII Lighting Device Description (sd)
*
* 4.19.2 Reply With ASCII String Text Descriptions (SD)
*
* </quote>
*
* @param deviceNumber
* @return message of type ReplyReadInsteonLightingDeviceData
*/ | 4.19.1 Request ASCII Lighting Device Description (sd) 4.19.2 Reply With ASCII String Text Descriptions (SD) | requestASCIILightingDeviceDescription | {
"repo_name": "cdhesse/ElkM1API",
"path": "src/com/elkm1api/ElkM1Controller.java",
"license": "apache-2.0",
"size": 32257
} | [
"com.elkm1api.messages.Message",
"java.io.IOException"
] | import com.elkm1api.messages.Message; import java.io.IOException; | import com.elkm1api.messages.*; import java.io.*; | [
"com.elkm1api.messages",
"java.io"
] | com.elkm1api.messages; java.io; | 2,786,251 |
public ZipBuilder addEntry(final String name, final String comment, final byte[] bytes) throws IOException {
final ZipEntry entry = new ZipEntry(name);
if(isNotBlank(comment)){
entry.setComment(comment);
}
return(addEntry(entry,bytes));
}
| ZipBuilder function(final String name, final String comment, final byte[] bytes) throws IOException { final ZipEntry entry = new ZipEntry(name); if(isNotBlank(comment)){ entry.setComment(comment); } return(addEntry(entry,bytes)); } | /**
* Used to add an entry with the given parameters.
*
* @param name the entry name
* @param comment the entry comment
* @param bytes the entry data
* @return a reference to the builder
* @throws IOException if there is a problem writing the entry data
*/ | Used to add an entry with the given parameters | addEntry | {
"repo_name": "cjstehno/codeperks",
"path": "src/main/java/com/stehno/codeperks/io/zip/ZipBuilder.java",
"license": "apache-2.0",
"size": 6091
} | [
"java.io.IOException",
"java.util.zip.ZipEntry"
] | import java.io.IOException; import java.util.zip.ZipEntry; | import java.io.*; import java.util.zip.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 2,307,108 |
protected String selectMode ( boolean isAutoIncrement, Map modes ) {
if ( isAutoIncrement )
return (String) modes.get( MODE_AUTOINCR );
else
return (String) modes.get( MODE_OTHERS );
}
protected boolean honourAutoIncrement() { return true; } | String function ( boolean isAutoIncrement, Map modes ) { if ( isAutoIncrement ) return (String) modes.get( MODE_AUTOINCR ); else return (String) modes.get( MODE_OTHERS ); } protected boolean honourAutoIncrement() { return true; } | /**
* determine which mode to use as default mode
* here: INSERT
* highly specific to operation INSERT / UPDATE / DELETE / SELECT
*/ | determine which mode to use as default mode here: INSERT highly specific to operation INSERT / UPDATE / DELETE / SELECT | selectMode | {
"repo_name": "apache/cocoon",
"path": "blocks/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/acting/modular/DatabaseAddAction.java",
"license": "apache-2.0",
"size": 12857
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,424,514 |
void publishTaskState(String taskName, Map stateSnapshot, ScheduledTaskStatisticsImpl statsSnapshot,
ScheduledTaskResult result) {
if (logger.isFinestEnabled()) {
log(FINEST, "Publishing state, to replicas. State: " + stateSnapshot);
}
Operation op = ne... | void publishTaskState(String taskName, Map stateSnapshot, ScheduledTaskStatisticsImpl statsSnapshot, ScheduledTaskResult result) { if (logger.isFinestEnabled()) { log(FINEST, STR + stateSnapshot); } Operation op = new SyncStateOperation(getName(), taskName, stateSnapshot, statsSnapshot, result); createInvocationBuilder... | /**
* State is published after every run.
* When replicas get promoted, they start with the latest state.
*/ | State is published after every run. When replicas get promoted, they start with the latest state | publishTaskState | {
"repo_name": "mdogan/hazelcast",
"path": "hazelcast/src/main/java/com/hazelcast/scheduledexecutor/impl/ScheduledExecutorContainer.java",
"license": "apache-2.0",
"size": 19980
} | [
"com.hazelcast.scheduledexecutor.impl.operations.SyncStateOperation",
"com.hazelcast.spi.impl.operationservice.Operation",
"java.util.Map"
] | import com.hazelcast.scheduledexecutor.impl.operations.SyncStateOperation; import com.hazelcast.spi.impl.operationservice.Operation; import java.util.Map; | import com.hazelcast.scheduledexecutor.impl.operations.*; import com.hazelcast.spi.impl.operationservice.*; import java.util.*; | [
"com.hazelcast.scheduledexecutor",
"com.hazelcast.spi",
"java.util"
] | com.hazelcast.scheduledexecutor; com.hazelcast.spi; java.util; | 1,694,652 |
Batch analyzeBatch(Context context, Class<?> batchClass); | Batch analyzeBatch(Context context, Class<?> batchClass); | /**
* Analyzes batch class.
* @param context the current context
* @param batchClass the target batch class
* @return the analyzed element
* @throws DiagnosticException if the target batch class is not valid
*/ | Analyzes batch class | analyzeBatch | {
"repo_name": "akirakw/asakusafw-compiler",
"path": "compiler-project/core/src/main/java/com/asakusafw/lang/compiler/core/ClassAnalyzer.java",
"license": "apache-2.0",
"size": 3560
} | [
"com.asakusafw.lang.compiler.model.graph.Batch"
] | import com.asakusafw.lang.compiler.model.graph.Batch; | import com.asakusafw.lang.compiler.model.graph.*; | [
"com.asakusafw.lang"
] | com.asakusafw.lang; | 2,598,755 |
public COSObject getObjectByType( COSName type ) throws IOException
{
for( COSObject object : objectPool.values() )
{
COSBase realObject = object.getObject();
if( realObject instanceof COSDictionary )
{
try
{
... | COSObject function( COSName type ) throws IOException { for( COSObject object : objectPool.values() ) { COSBase realObject = object.getObject(); if( realObject instanceof COSDictionary ) { try { COSDictionary dic = (COSDictionary)realObject; COSBase typeItem = dic.getItem(COSName.TYPE); if (typeItem instanceof COSName)... | /**
* This will get the first dictionary object by type.
*
* @param type The type of the object.
*
* @return This will return an object with the specified type.
* @throws IOException If there is an error getting the object
*/ | This will get the first dictionary object by type | getObjectByType | {
"repo_name": "BezrukovM/veraPDF-pdfbox",
"path": "pdfbox/src/main/java/org/apache/pdfbox/cos/COSDocument.java",
"license": "apache-2.0",
"size": 21965
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 949,655 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.