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
|
|---|---|---|---|---|---|---|---|---|---|---|---|
EReference getLanguageUnit_Contents();
|
EReference getLanguageUnit_Contents();
|
/**
* Returns the meta object for the containment reference '{@link de.uni_hildesheim.sse.vilBuildLanguage.LanguageUnit#getContents <em>Contents</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference '<em>Contents</em>'.
* @see de.uni_hildesheim.sse.vilBuildLanguage.LanguageUnit#getContents()
* @see #getLanguageUnit()
* @generated
*/
|
Returns the meta object for the containment reference '<code>de.uni_hildesheim.sse.vilBuildLanguage.LanguageUnit#getContents Contents</code>'.
|
getLanguageUnit_Contents
|
{
"repo_name": "SSEHUB/EASyProducer",
"path": "Plugins/Instantiation/de.uni_hildesheim.sse.vil.buildlang/src-gen/de/uni_hildesheim/sse/vilBuildLanguage/VilBuildLanguagePackage.java",
"license": "apache-2.0",
"size": 96951
}
|
[
"org.eclipse.emf.ecore.EReference"
] |
import org.eclipse.emf.ecore.EReference;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 1,434,407
|
@GET(JOBS_URL_SUFFIX)
Call<JsonNode> getJobs(
@Query("id") final String id,
@Query("name") final String name,
@Query("user") final String user,
@Query("status") final Set<String> statuses,
@Query("tag") final Set<String> tags,
@Query("clusterName") final String clusterName,
@Query("clusterId") final String clusterId,
@Query("commandName") final String commandName,
@Query("commandId") final String commandId,
@Query("minStarted") final Long minStarted,
@Query("maxStarted") final Long maxStarted,
@Query("minFinished") final Long minFinished,
@Query("maxFinished") final Long maxFinished
);
|
@GET(JOBS_URL_SUFFIX) Call<JsonNode> getJobs( @Query("id") final String id, @Query("name") final String name, @Query("user") final String user, @Query(STR) final Set<String> statuses, @Query("tag") final Set<String> tags, @Query(STR) final String clusterName, @Query(STR) final String clusterId, @Query(STR) final String commandName, @Query(STR) final String commandId, @Query(STR) final Long minStarted, @Query(STR) final Long maxStarted, @Query(STR) final Long minFinished, @Query(STR) final Long maxFinished );
|
/**
* Method to get all jobs from Genie.
*
* @param id id for job
* @param name name of job (can be a SQL-style pattern such as HIVE%)
* @param user user who submitted job
* @param statuses statuses of jobs to find
* @param tags tags for the job
* @param clusterName the name of the cluster
* @param clusterId the id of the cluster
* @param commandName the name of the command run by the job
* @param commandId the id of the command run by the job
* @param minStarted The time which the job had to start after in order to be return (inclusive)
* @param maxStarted The time which the job had to start before in order to be returned (exclusive)
* @param minFinished The time which the job had to finish after in order to be return (inclusive)
* @param maxFinished The time which the job had to finish before in order to be returned (exclusive)
*
* @return A callable object.
*/
|
Method to get all jobs from Genie
|
getJobs
|
{
"repo_name": "ajoymajumdar/genie",
"path": "genie-client/src/main/java/com/netflix/genie/client/apis/JobService.java",
"license": "apache-2.0",
"size": 6795
}
|
[
"com.fasterxml.jackson.databind.JsonNode",
"java.util.Set"
] |
import com.fasterxml.jackson.databind.JsonNode; import java.util.Set;
|
import com.fasterxml.jackson.databind.*; import java.util.*;
|
[
"com.fasterxml.jackson",
"java.util"
] |
com.fasterxml.jackson; java.util;
| 2,585,324
|
@Test
public void testToDot() {
BDDProvider<String> provider = factory.getProvider();
BDD<String> a = provider.get("a");
BDD<String> b = provider.get("b");
BDD<String> c = provider.get("c");
BDD<String> ref1 = a.not().and(b.not()).and(c.not());
String dot = BDDs.toDot(ref1);
Assert.assertTrue(!dot.isEmpty());
}
|
void function() { BDDProvider<String> provider = factory.getProvider(); BDD<String> a = provider.get("a"); BDD<String> b = provider.get("b"); BDD<String> c = provider.get("c"); BDD<String> ref1 = a.not().and(b.not()).and(c.not()); String dot = BDDs.toDot(ref1); Assert.assertTrue(!dot.isEmpty()); }
|
/**
* Tests the {@link BDDs#toDot(BDD)} method.
*/
|
Tests the <code>BDDs#toDot(BDD)</code> method
|
testToDot
|
{
"repo_name": "felixreimann/jreliability",
"path": "src/test/java/org/jreliability/bdd/AbstractBDDOperatorTest.java",
"license": "lgpl-3.0",
"size": 19205
}
|
[
"org.junit.Assert"
] |
import org.junit.Assert;
|
import org.junit.*;
|
[
"org.junit"
] |
org.junit;
| 220,794
|
public void run(){
if (isRunning){
return;
}
now = System.currentTimeMillis();
if (lastRan != 0 && (now - lastRan) < cleanupFrequency) {
return;
}
lastRan = now;
isRunning = true;
try {
FileStatus[] historyFiles = DONEDIR_FS.listStatus(DONE);
if (historyFiles != null) {
for (FileStatus f : historyFiles) {
if (now - f.getModificationTime() > maxAgeOfHistoryFiles) {
DONEDIR_FS.delete(f.getPath(), true);
LOG.info("Deleting old history file : " + f.getPath());
}
}
}
//walking over the map to purge entries from jobHistoryFileMap
synchronized (jobHistoryFileMap) {
Iterator<Entry<JobID, MovedFileInfo>> it =
jobHistoryFileMap.entrySet().iterator();
while (it.hasNext()) {
MovedFileInfo info = it.next().getValue();
if (now - info.timestamp > maxAgeOfHistoryFiles) {
it.remove();
} else {
//since entries are in sorted timestamp order, no more entries
//are required to be checked
break;
}
}
}
} catch (IOException ie) {
LOG.info("Error cleaning up history directory" +
StringUtils.stringifyException(ie));
}
isRunning = false;
}
|
void function(){ if (isRunning){ return; } now = System.currentTimeMillis(); if (lastRan != 0 && (now - lastRan) < cleanupFrequency) { return; } lastRan = now; isRunning = true; try { FileStatus[] historyFiles = DONEDIR_FS.listStatus(DONE); if (historyFiles != null) { for (FileStatus f : historyFiles) { if (now - f.getModificationTime() > maxAgeOfHistoryFiles) { DONEDIR_FS.delete(f.getPath(), true); LOG.info(STR + f.getPath()); } } } synchronized (jobHistoryFileMap) { Iterator<Entry<JobID, MovedFileInfo>> it = jobHistoryFileMap.entrySet().iterator(); while (it.hasNext()) { MovedFileInfo info = it.next().getValue(); if (now - info.timestamp > maxAgeOfHistoryFiles) { it.remove(); } else { break; } } } } catch (IOException ie) { LOG.info(STR + StringUtils.stringifyException(ie)); } isRunning = false; }
|
/**
* Cleans up history data.
*/
|
Cleans up history data
|
run
|
{
"repo_name": "Shmuma/hadoop",
"path": "src/mapred/org/apache/hadoop/mapred/JobHistory.java",
"license": "apache-2.0",
"size": 81904
}
|
[
"java.io.IOException",
"java.util.Iterator",
"java.util.Map",
"org.apache.hadoop.fs.FileStatus",
"org.apache.hadoop.util.StringUtils"
] |
import java.io.IOException; import java.util.Iterator; import java.util.Map; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.util.StringUtils;
|
import java.io.*; import java.util.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.util.*;
|
[
"java.io",
"java.util",
"org.apache.hadoop"
] |
java.io; java.util; org.apache.hadoop;
| 1,255,514
|
private boolean canExecuteIacucProtocolTask(String userId, IacucProtocolDocument doc, String taskName) {
IacucProtocolTask task = new IacucProtocolTask(taskName, doc.getIacucProtocol());
TaskAuthorizationService taskAuthenticationService = KcServiceLocator.getService(TaskAuthorizationService.class);
return taskAuthenticationService.isAuthorized(userId, task);
}
|
boolean function(String userId, IacucProtocolDocument doc, String taskName) { IacucProtocolTask task = new IacucProtocolTask(taskName, doc.getIacucProtocol()); TaskAuthorizationService taskAuthenticationService = KcServiceLocator.getService(TaskAuthorizationService.class); return taskAuthenticationService.isAuthorized(userId, task); }
|
/**
* Does the user have permission to execute the given task for a Iacuc Protocol?
* @param userId the user's userId
* @param doc the Iacuc Protocol document
* @param taskName the name of the task
* @return true if has permission; otherwise false
*/
|
Does the user have permission to execute the given task for a Iacuc Protocol
|
canExecuteIacucProtocolTask
|
{
"repo_name": "mukadder/kc",
"path": "coeus-impl/src/main/java/org/kuali/kra/iacuc/auth/IacucProtocolDocumentAuthorizer.java",
"license": "agpl-3.0",
"size": 8649
}
|
[
"org.kuali.coeus.common.framework.auth.task.TaskAuthorizationService",
"org.kuali.coeus.sys.framework.service.KcServiceLocator",
"org.kuali.kra.iacuc.IacucProtocolDocument"
] |
import org.kuali.coeus.common.framework.auth.task.TaskAuthorizationService; import org.kuali.coeus.sys.framework.service.KcServiceLocator; import org.kuali.kra.iacuc.IacucProtocolDocument;
|
import org.kuali.coeus.common.framework.auth.task.*; import org.kuali.coeus.sys.framework.service.*; import org.kuali.kra.iacuc.*;
|
[
"org.kuali.coeus",
"org.kuali.kra"
] |
org.kuali.coeus; org.kuali.kra;
| 693,124
|
DateTime getApplicationDocumentStatusDate();
|
DateTime getApplicationDocumentStatusDate();
|
/**
* Retrieve the last application document status transition date. The Application Document Status date is
* the date the application document status last transitioned.
* @return the application document status date
*/
|
Retrieve the last application document status transition date. The Application Document Status date is the date the application document status last transitioned
|
getApplicationDocumentStatusDate
|
{
"repo_name": "geothomasp/kualico-rice-kc",
"path": "rice-middleware/kew/api/src/main/java/org/kuali/rice/kew/api/document/DocumentContract.java",
"license": "apache-2.0",
"size": 3701
}
|
[
"org.joda.time.DateTime"
] |
import org.joda.time.DateTime;
|
import org.joda.time.*;
|
[
"org.joda.time"
] |
org.joda.time;
| 1,570,897
|
public Node getFormsNode()
throws TransformerException
{
return getExecutor().getNode(FORMS_XPATH);
}
|
Node function() throws TransformerException { return getExecutor().getNode(FORMS_XPATH); }
|
/**
* Get the <code><grant:Forms></code> Node.
*
* @return A DOM Node representing the <code><grant:Forms></code>
* tag in the XML document.
*/
|
Get the <code><grant:Forms></code> Node
|
getFormsNode
|
{
"repo_name": "kuali/kc-s2sgen",
"path": "coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/hash/GrantApplicationXpath.java",
"license": "agpl-3.0",
"size": 7586
}
|
[
"javax.xml.transform.TransformerException",
"org.w3c.dom.Node"
] |
import javax.xml.transform.TransformerException; import org.w3c.dom.Node;
|
import javax.xml.transform.*; import org.w3c.dom.*;
|
[
"javax.xml",
"org.w3c.dom"
] |
javax.xml; org.w3c.dom;
| 2,639,297
|
public static Map mapComponentAttributes(Collection collection, UIComponent component)
{
Map attributeMap = new HashMap();
if (collection == null)
return attributeMap;
String[] attributeNames = new String[collection.size()];
Object[] objs = collection.toArray();
for (int i = 0; i < objs.length; i++)
{
attributeNames[i] = (String) objs[i];
}
return mapComponentAttributes(attributeNames, component);
}
|
static Map function(Collection collection, UIComponent component) { Map attributeMap = new HashMap(); if (collection == null) return attributeMap; String[] attributeNames = new String[collection.size()]; Object[] objs = collection.toArray(); for (int i = 0; i < objs.length; i++) { attributeNames[i] = (String) objs[i]; } return mapComponentAttributes(attributeNames, component); }
|
/**
* Get a Map of String key/value pairs from a UIComponent for all attributes
* keys in a collection
*
* @param collection
* @param component
* @return Map of String key/value pairs from a UIComponent for all keys in
* a collection
*/
|
Get a Map of String key/value pairs from a UIComponent for all attributes keys in a collection
|
mapComponentAttributes
|
{
"repo_name": "OpenCollabZA/sakai",
"path": "jsf2/jsf2-widgets/src/java/org/sakaiproject/jsf2/util/RendererUtil.java",
"license": "apache-2.0",
"size": 17712
}
|
[
"java.util.Collection",
"java.util.HashMap",
"java.util.Map",
"javax.faces.component.UIComponent"
] |
import java.util.Collection; import java.util.HashMap; import java.util.Map; import javax.faces.component.UIComponent;
|
import java.util.*; import javax.faces.component.*;
|
[
"java.util",
"javax.faces"
] |
java.util; javax.faces;
| 1,932,675
|
private static void setImageViewScaleTypeMatrix(ImageView imageView) {
if (null != imageView) {
if (imageView instanceof PhotoView) {
} else {
imageView.setScaleType(ScaleType.MATRIX);
}
}
}
private WeakReference<ImageView> mImageView;
private ViewTreeObserver mViewTreeObserver;
// Gesture Detectors
private GestureDetector mGestureDetector;
private VersionedGestureDetector mScaleDragDetector;
// These are set so we don't keep allocating them on the heap
private final Matrix mBaseMatrix = new Matrix();
private final Matrix mDrawMatrix = new Matrix();
private final Matrix mSuppMatrix = new Matrix();
private final RectF mDisplayRect = new RectF();
private final float[] mMatrixValues = new float[9];
// Listeners
private OnMatrixChangedListener mMatrixChangeListener;
private OnPhotoTapListener mPhotoTapListener;
private OnViewTapListener mViewTapListener;
private OnLongClickListener mLongClickListener;
private int mIvTop, mIvRight, mIvBottom, mIvLeft;
private FlingRunnable mCurrentFlingRunnable;
private int mScrollEdge = EDGE_BOTH;
private boolean mZoomEnabled;
private ScaleType mScaleType = ScaleType.FIT_CENTER;
public PhotoViewAttacher(ImageView imageView) {
mImageView = new WeakReference<ImageView>(imageView);
imageView.setOnTouchListener(this);
mViewTreeObserver = imageView.getViewTreeObserver();
mViewTreeObserver.addOnGlobalLayoutListener(this);
// Make sure we using MATRIX Scale Type
setImageViewScaleTypeMatrix(imageView);
if (!imageView.isInEditMode()) {
// Create Gesture Detectors...
mScaleDragDetector = VersionedGestureDetector.newInstance(
imageView.getContext(), this);
mGestureDetector = new GestureDetector(imageView.getContext(),
new GestureDetector.SimpleOnGestureListener() {
|
static void function(ImageView imageView) { if (null != imageView) { if (imageView instanceof PhotoView) { } else { imageView.setScaleType(ScaleType.MATRIX); } } } WeakReference<ImageView> mImageView; private ViewTreeObserver mViewTreeObserver; private GestureDetector mGestureDetector; private VersionedGestureDetector mScaleDragDetector; private final Matrix mBaseMatrix = new Matrix(); private final Matrix mDrawMatrix = new Matrix(); private final Matrix mSuppMatrix = new Matrix(); private final RectF mDisplayRect = new RectF(); private final float[] mMatrixValues = new float[9]; private OnMatrixChangedListener mMatrixChangeListener; private OnPhotoTapListener mPhotoTapListener; private OnViewTapListener mViewTapListener; private OnLongClickListener mLongClickListener; private int mIvTop, mIvRight, mIvBottom, mIvLeft; private FlingRunnable mCurrentFlingRunnable; private int mScrollEdge = EDGE_BOTH; private boolean mZoomEnabled; private ScaleType mScaleType = ScaleType.FIT_CENTER; public PhotoViewAttacher(ImageView imageView) { mImageView = new WeakReference<ImageView>(imageView); imageView.setOnTouchListener(this); mViewTreeObserver = imageView.getViewTreeObserver(); mViewTreeObserver.addOnGlobalLayoutListener(this); function(imageView); if (!imageView.isInEditMode()) { mScaleDragDetector = VersionedGestureDetector.newInstance( imageView.getContext(), this); mGestureDetector = new GestureDetector(imageView.getContext(), new GestureDetector.SimpleOnGestureListener() {
|
/**
* Set's the ImageView's ScaleType to Matrix.
*/
|
Set's the ImageView's ScaleType to Matrix
|
setImageViewScaleTypeMatrix
|
{
"repo_name": "KouChengjian/EKaxin",
"path": "EKaxin/src/com/chenghui/ekaxin/view/photo/zoom/PhotoViewAttacher.java",
"license": "gpl-2.0",
"size": 26184
}
|
[
"android.graphics.Matrix",
"android.graphics.RectF",
"android.view.GestureDetector",
"android.view.View",
"android.view.ViewTreeObserver",
"android.widget.ImageView",
"java.lang.ref.WeakReference"
] |
import android.graphics.Matrix; import android.graphics.RectF; import android.view.GestureDetector; import android.view.View; import android.view.ViewTreeObserver; import android.widget.ImageView; import java.lang.ref.WeakReference;
|
import android.graphics.*; import android.view.*; import android.widget.*; import java.lang.ref.*;
|
[
"android.graphics",
"android.view",
"android.widget",
"java.lang"
] |
android.graphics; android.view; android.widget; java.lang;
| 1,178,696
|
@SuppressWarnings("ConstantConditions")
@NonNull
public Set<String> loadDefEmpty(@Nullable Set<String> defaultValue) {
return load(defaultValue);
}
|
@SuppressWarnings(STR) Set<String> function(@Nullable Set<String> defaultValue) { return load(defaultValue); }
|
/**
* Loads stored value set or default empty set.
*
* @return Returns value set or default empty set.
*
* @see #load(Set)
*/
|
Loads stored value set or default empty set
|
loadDefEmpty
|
{
"repo_name": "FRIST008/NixLibrary",
"path": "NixPref/src/main/java/com/frist008/nixpref/keys/NixListPrefKey.java",
"license": "mit",
"size": 2848
}
|
[
"android.support.annotation.Nullable",
"java.util.Set"
] |
import android.support.annotation.Nullable; import java.util.Set;
|
import android.support.annotation.*; import java.util.*;
|
[
"android.support",
"java.util"
] |
android.support; java.util;
| 1,268,784
|
ZonedDateTime getAuthenticationDate();
|
ZonedDateTime getAuthenticationDate();
|
/**
* Method to retrieve the timestamp of when this Authentication object was
* created.
*
* @return the date/time the authentication occurred.
*/
|
Method to retrieve the timestamp of when this Authentication object was created
|
getAuthenticationDate
|
{
"repo_name": "zhoffice/cas",
"path": "cas-server-core-api-authentication/src/main/java/org/apereo/cas/authentication/Authentication.java",
"license": "apache-2.0",
"size": 2736
}
|
[
"java.time.ZonedDateTime"
] |
import java.time.ZonedDateTime;
|
import java.time.*;
|
[
"java.time"
] |
java.time;
| 618,876
|
@ServiceMethod(returns = ReturnType.SINGLE)
public BackupResourceConfigResourceInner get(String vaultName, String resourceGroupName) {
return getAsync(vaultName, resourceGroupName).block();
}
|
@ServiceMethod(returns = ReturnType.SINGLE) BackupResourceConfigResourceInner function(String vaultName, String resourceGroupName) { return getAsync(vaultName, resourceGroupName).block(); }
|
/**
* Fetches resource storage config.
*
* @param vaultName The name of the recovery services vault.
* @param resourceGroupName The name of the resource group where the recovery services vault is present.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the resource storage details.
*/
|
Fetches resource storage config
|
get
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceStorageConfigsNonCrrsClientImpl.java",
"license": "mit",
"size": 28975
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceConfigResourceInner"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceConfigResourceInner;
|
import com.azure.core.annotation.*; import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 865,924
|
private static void processGroupClause(AST ast, Query q, String modelPackage,
Iterator<?> iterator) {
do {
q.addToGroupBy(processNewQueryNode(ast, q, modelPackage, iterator));
ast = ast.getNextSibling();
} while (ast != null);
}
|
static void function(AST ast, Query q, String modelPackage, Iterator<?> iterator) { do { q.addToGroupBy(processNewQueryNode(ast, q, modelPackage, iterator)); ast = ast.getNextSibling(); } while (ast != null); }
|
/**
* Processes an AST node that describes a GROUP BY clause.
*
* @param ast an AST node to process
* @param modelPackage the package for unqualified class names
* @param iterator an iterator through the list of parameters of the IqlQuery
*/
|
Processes an AST node that describes a GROUP BY clause
|
processGroupClause
|
{
"repo_name": "drhee/toxoMine",
"path": "intermine/objectstore/main/src/org/intermine/objectstore/query/iql/IqlQueryParser.java",
"license": "lgpl-2.1",
"size": 72368
}
|
[
"java.util.Iterator",
"org.intermine.objectstore.query.Query"
] |
import java.util.Iterator; import org.intermine.objectstore.query.Query;
|
import java.util.*; import org.intermine.objectstore.query.*;
|
[
"java.util",
"org.intermine.objectstore"
] |
java.util; org.intermine.objectstore;
| 1,018,510
|
public double impliedVolatility(final InterestRateFutureOptionPremiumSecurity security, final YieldCurveWithBlackCubeBundle blackData) {
ArgumentChecker.notNull(security, "security");
ArgumentChecker.notNull(blackData, "blackData");
return blackData.getVolatility(security.getExpirationTime(), security.getStrike());
}
|
double function(final InterestRateFutureOptionPremiumSecurity security, final YieldCurveWithBlackCubeBundle blackData) { ArgumentChecker.notNull(security, STR); ArgumentChecker.notNull(blackData, STR); return blackData.getVolatility(security.getExpirationTime(), security.getStrike()); }
|
/**
* Interpolates and returns the option's implied volatility
* The future price is computed without convexity adjustment.
* @param security The future option security.
* @param blackData The curve and Black volatility data.
* @return Lognormal Implied Volatility.
*/
|
Interpolates and returns the option's implied volatility The future price is computed without convexity adjustment
|
impliedVolatility
|
{
"repo_name": "jeorme/OG-Platform",
"path": "projects/OG-Analytics/src/main/java/com/opengamma/analytics/financial/interestrate/future/method/InterestRateFutureOptionPremiumSecurityBlackSurfaceMethod.java",
"license": "apache-2.0",
"size": 14634
}
|
[
"com.opengamma.analytics.financial.interestrate.future.derivative.InterestRateFutureOptionPremiumSecurity",
"com.opengamma.analytics.financial.model.option.definition.YieldCurveWithBlackCubeBundle",
"com.opengamma.util.ArgumentChecker"
] |
import com.opengamma.analytics.financial.interestrate.future.derivative.InterestRateFutureOptionPremiumSecurity; import com.opengamma.analytics.financial.model.option.definition.YieldCurveWithBlackCubeBundle; import com.opengamma.util.ArgumentChecker;
|
import com.opengamma.analytics.financial.interestrate.future.derivative.*; import com.opengamma.analytics.financial.model.option.definition.*; import com.opengamma.util.*;
|
[
"com.opengamma.analytics",
"com.opengamma.util"
] |
com.opengamma.analytics; com.opengamma.util;
| 1,863,769
|
public void addKeyMapping(IgniteTxKey key, ClusterNode node) {
GridDistributedTxMapping m = mappings.get(node.id());
if (m == null)
mappings.put(m = new GridDistributedTxMapping(node));
IgniteTxEntry txEntry = entry(key);
assert txEntry != null;
txEntry.nodeId(node.id());
m.add(txEntry);
if (log.isDebugEnabled())
log.debug("Added mappings to transaction [locId=" + cctx.localNodeId() + ", key=" + key + ", node=" + node +
", tx=" + this + ']');
}
|
void function(IgniteTxKey key, ClusterNode node) { GridDistributedTxMapping m = mappings.get(node.id()); if (m == null) mappings.put(m = new GridDistributedTxMapping(node)); IgniteTxEntry txEntry = entry(key); assert txEntry != null; txEntry.nodeId(node.id()); m.add(txEntry); if (log.isDebugEnabled()) log.debug(STR + cctx.localNodeId() + STR + key + STR + node + STR + this + ']'); }
|
/**
* Adds key mapping to dht mapping.
*
* @param key Key to add.
* @param node Node this key mapped to.
*/
|
Adds key mapping to dht mapping
|
addKeyMapping
|
{
"repo_name": "mcherkasov/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java",
"license": "apache-2.0",
"size": 142305
}
|
[
"org.apache.ignite.cluster.ClusterNode",
"org.apache.ignite.internal.processors.cache.distributed.GridDistributedTxMapping",
"org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry",
"org.apache.ignite.internal.processors.cache.transactions.IgniteTxKey"
] |
import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.internal.processors.cache.distributed.GridDistributedTxMapping; import org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry; import org.apache.ignite.internal.processors.cache.transactions.IgniteTxKey;
|
import org.apache.ignite.cluster.*; import org.apache.ignite.internal.processors.cache.distributed.*; import org.apache.ignite.internal.processors.cache.transactions.*;
|
[
"org.apache.ignite"
] |
org.apache.ignite;
| 2,586,886
|
public TwitterAuthConfig getAuthConfig() {
return TwitterCore.getInstance().getAuthConfig();
}
|
TwitterAuthConfig function() { return TwitterCore.getInstance().getAuthConfig(); }
|
/**
* Exposes the AuthConfig used in this instance of Digits kit
*/
|
Exposes the AuthConfig used in this instance of Digits kit
|
getAuthConfig
|
{
"repo_name": "jnbt/digits-android",
"path": "digits/src/main/java/com/digits/sdk/android/Digits.java",
"license": "apache-2.0",
"size": 9791
}
|
[
"com.twitter.sdk.android.core.TwitterAuthConfig",
"com.twitter.sdk.android.core.TwitterCore"
] |
import com.twitter.sdk.android.core.TwitterAuthConfig; import com.twitter.sdk.android.core.TwitterCore;
|
import com.twitter.sdk.android.core.*;
|
[
"com.twitter.sdk"
] |
com.twitter.sdk;
| 1,827,464
|
public static void executeAjaxLazyLoadPanel(final BaseWicketTester wt)
{
executeAjaxLazyLoadPanel(wt, wt.getLastRenderedPage());
}
|
static void function(final BaseWicketTester wt) { executeAjaxLazyLoadPanel(wt, wt.getLastRenderedPage()); }
|
/**
* Triggers loading of all {@link AjaxLazyLoadPanel}'s content in the last rendered page.
*
* @param wt
* the tester
*/
|
Triggers loading of all <code>AjaxLazyLoadPanel</code>'s content in the last rendered page
|
executeAjaxLazyLoadPanel
|
{
"repo_name": "mosoft521/wicket",
"path": "wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxLazyLoadPanelTester.java",
"license": "apache-2.0",
"size": 2894
}
|
[
"org.apache.wicket.util.tester.BaseWicketTester"
] |
import org.apache.wicket.util.tester.BaseWicketTester;
|
import org.apache.wicket.util.tester.*;
|
[
"org.apache.wicket"
] |
org.apache.wicket;
| 2,031,878
|
public ConstraintBuilder search( String table,
String propertyName,
String searchExpression ) {
return setConstraint(new FullTextSearch(selector(table), propertyName, searchExpression));
}
|
ConstraintBuilder function( String table, String propertyName, String searchExpression ) { return setConstraint(new FullTextSearch(selector(table), propertyName, searchExpression)); }
|
/**
* Define a constraint clause that the node within the named table have a value for the named property that satisfies the
* full-text search expression.
*
* @param table the name of the table; may not be null and must refer to a valid name or alias of a table appearing in the
* FROM clause
* @param propertyName the name of the property to be searched
* @param searchExpression the full-text search expression
* @return the constraint builder that was used to create this clause; never null
*/
|
Define a constraint clause that the node within the named table have a value for the named property that satisfies the full-text search expression
|
search
|
{
"repo_name": "vhalbert/modeshape",
"path": "modeshape-jcr/src/main/java/org/modeshape/jcr/query/QueryBuilder.java",
"license": "apache-2.0",
"size": 126740
}
|
[
"org.modeshape.jcr.query.model.FullTextSearch"
] |
import org.modeshape.jcr.query.model.FullTextSearch;
|
import org.modeshape.jcr.query.model.*;
|
[
"org.modeshape.jcr"
] |
org.modeshape.jcr;
| 1,939,191
|
//@PDA jdbc40
public void setURL(int parameterIndex, URL x) throws SQLException
{
validateStatement();
statement_.setURL(parameterIndex, x);
}
|
void function(int parameterIndex, URL x) throws SQLException { validateStatement(); statement_.setURL(parameterIndex, x); }
|
/**
* Sets the designated parameter to the given <code>java.net.URL</code> value.
* The driver converts this to an SQL <code>DATALINK</code> value
* when it sends it to the database.
*
* @param parameterIndex the first parameter is 1, the second is 2, ...
* @param x the <code>java.net.URL</code> object to be set
* @exception SQLException if a database access error occurs or
* this method is called on a closed <code>PreparedStatement</code>
* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
*/
|
Sets the designated parameter to the given <code>java.net.URL</code> value. The driver converts this to an SQL <code>DATALINK</code> value when it sends it to the database
|
setURL
|
{
"repo_name": "devjunix/libjt400-java",
"path": "src/com/ibm/as400/access/AS400JDBCRowSet.java",
"license": "epl-1.0",
"size": 312119
}
|
[
"java.sql.SQLException"
] |
import java.sql.SQLException;
|
import java.sql.*;
|
[
"java.sql"
] |
java.sql;
| 1,759,625
|
@PlatformDesktop
@PlatformHTML5
default Promise<Void> setIcon(FilePath filePath)
{
return new Promise<>((resolve, reject) -> setIcon(filePath, () -> resolve.invoke(null), reject));
}
|
@PlatformHTML5 default Promise<Void> setIcon(FilePath filePath) { return new Promise<>((resolve, reject) -> setIcon(filePath, () -> resolve.invoke(null), reject)); }
|
/**
* Sets the icon of the display. Must point to an image (PNG, BMP, JPEG are supported). For HTML5, use a .ICO file.
*
* @param filePath The file path to the image.
*
* @return A void {@link Promise} that wraps the callbacks.
*/
|
Sets the icon of the display. Must point to an image (PNG, BMP, JPEG are supported). For HTML5, use a .ICO file
|
setIcon
|
{
"repo_name": "sriharshachilakapati/SilenceEngine",
"path": "silenceengine/src/main/java/com/shc/silenceengine/core/IDisplayDevice.java",
"license": "mit",
"size": 11230
}
|
[
"com.shc.silenceengine.annotations.PlatformHTML5",
"com.shc.silenceengine.io.FilePath",
"com.shc.silenceengine.utils.functional.Promise"
] |
import com.shc.silenceengine.annotations.PlatformHTML5; import com.shc.silenceengine.io.FilePath; import com.shc.silenceengine.utils.functional.Promise;
|
import com.shc.silenceengine.annotations.*; import com.shc.silenceengine.io.*; import com.shc.silenceengine.utils.functional.*;
|
[
"com.shc.silenceengine"
] |
com.shc.silenceengine;
| 522,449
|
public ExportRecurrencePeriod withFrom(OffsetDateTime from) {
this.from = from;
return this;
}
|
ExportRecurrencePeriod function(OffsetDateTime from) { this.from = from; return this; }
|
/**
* Set the from property: The start date of recurrence.
*
* @param from the from value to set.
* @return the ExportRecurrencePeriod object itself.
*/
|
Set the from property: The start date of recurrence
|
withFrom
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportRecurrencePeriod.java",
"license": "mit",
"size": 2234
}
|
[
"java.time.OffsetDateTime"
] |
import java.time.OffsetDateTime;
|
import java.time.*;
|
[
"java.time"
] |
java.time;
| 432,442
|
public static void setTraceImpl(TraceImpl traceable)
{
Trace.traceable = traceable;
Trace.out = traceable.getPrintStream();
}
|
static void function(TraceImpl traceable) { Trace.traceable = traceable; Trace.out = traceable.getPrintStream(); }
|
/**
* Register your traceable here, if you indend to trace this sourcecode
* you may call set with null if you do not want to trace
*/
|
Register your traceable here, if you indend to trace this sourcecode you may call set with null if you do not want to trace
|
setTraceImpl
|
{
"repo_name": "akardapolov/ASH-Viewer",
"path": "egantt/src/main/java/com/egantt/util/Trace.java",
"license": "gpl-3.0",
"size": 965
}
|
[
"com.egantt.util.trace.TraceImpl"
] |
import com.egantt.util.trace.TraceImpl;
|
import com.egantt.util.trace.*;
|
[
"com.egantt.util"
] |
com.egantt.util;
| 2,575,136
|
@SuppressWarnings("all")
public static boolean release(ClassFileTransformer classFileTransformer) {
try {
@SuppressWarnings("unchecked")
Map<ClassFileTransformer, ?> classFileTransformers = (Map<ClassFileTransformer, ?>) ClassLoader.getSystemClassLoader()
.loadClass(LambdaFactory.class.getName())
.getField(FIELD_NAME)
.get(null);
synchronized (classFileTransformers) {
return classFileTransformers.remove(classFileTransformer) != null && classFileTransformers.isEmpty();
}
} catch (RuntimeException exception) {
throw exception;
} catch (Exception exception) {
throw new IllegalStateException("Could not release class file transformer", exception);
}
}
|
@SuppressWarnings("all") static boolean function(ClassFileTransformer classFileTransformer) { try { @SuppressWarnings(STR) Map<ClassFileTransformer, ?> classFileTransformers = (Map<ClassFileTransformer, ?>) ClassLoader.getSystemClassLoader() .loadClass(LambdaFactory.class.getName()) .getField(FIELD_NAME) .get(null); synchronized (classFileTransformers) { return classFileTransformers.remove(classFileTransformer) != null && classFileTransformers.isEmpty(); } } catch (RuntimeException exception) { throw exception; } catch (Exception exception) { throw new IllegalStateException(STR, exception); } }
|
/**
* Releases a class file transformer.
*
* @param classFileTransformer The class file transformer to release.
* @return {@code true} if the removed transformer was the last class file transformer registered. This indicates that the {@code LambdaMetafactory} must
* be instrumented to no longer delegate to this alternative factory.
*/
|
Releases a class file transformer
|
release
|
{
"repo_name": "mches/byte-buddy",
"path": "byte-buddy-dep/src/main/java/net/bytebuddy/agent/builder/LambdaFactory.java",
"license": "apache-2.0",
"size": 11240
}
|
[
"java.lang.instrument.ClassFileTransformer",
"java.util.Map"
] |
import java.lang.instrument.ClassFileTransformer; import java.util.Map;
|
import java.lang.instrument.*; import java.util.*;
|
[
"java.lang",
"java.util"
] |
java.lang; java.util;
| 362,200
|
public static void guiLogin(Wiki wiki)
{
String[] b = showLoginScreen("Login");
wiki.setMaxLag(-1);
try
{
wiki.login(b[0], b[1].toCharArray());
}
catch(Throwable e)
{
JOptionPane.showMessageDialog(null, "Username/Password did not match or we encountered a network issue. Program will now exit.");
System.exit(1);
}
wiki.setThrottle(5);
}
|
static void function(Wiki wiki) { String[] b = showLoginScreen("Login"); wiki.setMaxLag(-1); try { wiki.login(b[0], b[1].toCharArray()); } catch(Throwable e) { JOptionPane.showMessageDialog(null, STR); System.exit(1); } wiki.setThrottle(5); }
|
/**
* Login with loginAndSetPrefs(), but using a GUI. Throttle auto-set to 6 edits/min.
*
* @param wiki Wiki object to perform changes on
*
* @see #loginAndSetPrefs(Wiki, String, char[])
*
*/
|
Login with loginAndSetPrefs(), but using a GUI. Throttle auto-set to 6 edits/min
|
guiLogin
|
{
"repo_name": "Hunsu/WikiBot",
"path": "WikiBot/src/main/java/org/wikiutils/LoginUtils.java",
"license": "gpl-3.0",
"size": 2830
}
|
[
"javax.swing.JOptionPane",
"org.wikipedia.Wiki"
] |
import javax.swing.JOptionPane; import org.wikipedia.Wiki;
|
import javax.swing.*; import org.wikipedia.*;
|
[
"javax.swing",
"org.wikipedia"
] |
javax.swing; org.wikipedia;
| 118,703
|
protected void writeToStdOut(String message) {
try {
FileUtil.appendContent(stdOutFile, message, "UTF-8");
} catch (Exception e) {
log.error(e, e);
}
}
/**
* Writing message to stderr. {@code start} method should be called before use this. @see
* {@link #warn}, {@link #error}
|
void function(String message) { try { FileUtil.appendContent(stdOutFile, message, "UTF-8"); } catch (Exception e) { log.error(e, e); } } /** * Writing message to stderr. {@code start} method should be called before use this. * {@link #warn}, {@link #error}
|
/**
* Writing message to stdout. {@code start} method should be called before use this.
*
* @param message
*/
|
Writing message to stdout. start method should be called before use this
|
writeToStdOut
|
{
"repo_name": "MAGCruise/magcruise-core",
"path": "src/main/java/org/magcruise/gaming/manager/process/ExternalGameProcess.java",
"license": "mit",
"size": 7197
}
|
[
"jp.go.nict.langrid.commons.io.FileUtil"
] |
import jp.go.nict.langrid.commons.io.FileUtil;
|
import jp.go.nict.langrid.commons.io.*;
|
[
"jp.go.nict"
] |
jp.go.nict;
| 355,116
|
@Override
public void setLong(String parameterName, long x) throws SQLException {
setLong(getIndexForName(parameterName), x);
}
|
void function(String parameterName, long x) throws SQLException { setLong(getIndexForName(parameterName), x); }
|
/**
* Sets the value of a parameter.
*
* @param parameterName the parameter name
* @param x the value
* @throws SQLException if this object is closed
*/
|
Sets the value of a parameter
|
setLong
|
{
"repo_name": "paulnguyen/data",
"path": "sqldbs/h2java/src/main/org/h2/jdbc/JdbcCallableStatement.java",
"license": "apache-2.0",
"size": 53148
}
|
[
"java.sql.SQLException"
] |
import java.sql.SQLException;
|
import java.sql.*;
|
[
"java.sql"
] |
java.sql;
| 2,506,740
|
@SimpleProperty(category = PropertyCategory.APPEARANCE,
description = "The requested screen orientation, specified as a text value. " +
"Commonly used values are " +
"landscape, portrait, sensor, user and unspecified. " +
"See the Android developer documentation for ActivityInfo.Screen_Orientation for the " +
"complete list of possible settings.")
public String ScreenOrientation() {
switch (getRequestedOrientation()) {
case ActivityInfo.SCREEN_ORIENTATION_BEHIND:
return "behind";
case ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE:
return "landscape";
case ActivityInfo.SCREEN_ORIENTATION_NOSENSOR:
return "nosensor";
case ActivityInfo.SCREEN_ORIENTATION_PORTRAIT:
return "portrait";
case ActivityInfo.SCREEN_ORIENTATION_SENSOR:
return "sensor";
case ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED:
return "unspecified";
case ActivityInfo.SCREEN_ORIENTATION_USER:
return "user";
case 10: // ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR
return "fullSensor";
case 8: // ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE
return "reverseLandscape";
case 9: // ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT
return "reversePortrait";
case 6: // ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE
return "sensorLandscape";
case 7: // ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT
return "sensorPortrait";
}
return "unspecified";
}
|
@SimpleProperty(category = PropertyCategory.APPEARANCE, description = STR + STR + STR + STR + STR) String function() { switch (getRequestedOrientation()) { case ActivityInfo.SCREEN_ORIENTATION_BEHIND: return STR; case ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE: return STR; case ActivityInfo.SCREEN_ORIENTATION_NOSENSOR: return STR; case ActivityInfo.SCREEN_ORIENTATION_PORTRAIT: return STR; case ActivityInfo.SCREEN_ORIENTATION_SENSOR: return STR; case ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED: return STR; case ActivityInfo.SCREEN_ORIENTATION_USER: return "user"; case 10: return STR; case 8: return STR; case 9: return STR; case 6: return STR; case 7: return STR; } return STR; }
|
/**
* The requested screen orientation. Commonly used values are
unspecified (-1), landscape (0), portrait (1), sensor (4), and user (2). " +
"See the Android developer documentation for ActivityInfo.Screen_Orientation for the " +
"complete list of possible settings.
*
* ScreenOrientation property getter method.
*
* @return screen orientation
*/
|
The requested screen orientation. Commonly used values are ScreenOrientation property getter method
|
ScreenOrientation
|
{
"repo_name": "bitsecure/appinventor1-sources",
"path": "appinventor/components/src/com/google/appinventor/components/runtime/Form.java",
"license": "apache-2.0",
"size": 58771
}
|
[
"android.content.pm.ActivityInfo",
"com.google.appinventor.components.annotations.PropertyCategory",
"com.google.appinventor.components.annotations.SimpleProperty"
] |
import android.content.pm.ActivityInfo; import com.google.appinventor.components.annotations.PropertyCategory; import com.google.appinventor.components.annotations.SimpleProperty;
|
import android.content.pm.*; import com.google.appinventor.components.annotations.*;
|
[
"android.content",
"com.google.appinventor"
] |
android.content; com.google.appinventor;
| 2,443,056
|
public void test_6363() throws SQLException {
Statement s = createStatement();
s.execute("create table d6363(a int, b char)");
s.execute("insert into d6363 values (1, 'a'), (2, 'b'), (3, 'a'), "
+ "(4, 'b'), (5, 'a'), (6, 'b')");
JDBC.assertFullResultSet(s.executeQuery(
"select a, ((b = 'a' or b = 'b') and a < 4), "
+ "((b = 'a' or b = 'c' or b = 'b') and a < 4), "
+ "((b = 'a' or (b = 'c' or b = 'b')) and a < 4), "
+ "((b = 'a' or b in ('c', 'b')) and a < 4), "
+ "(a < 4 and (b = 'a' or b = 'b')) "
+ "from d6363 order by a"),
new String[][] {
{ "1", "true", "true", "true", "true", "true" },
{ "2", "true", "true", "true", "true", "true" },
{ "3", "true", "true", "true", "true", "true" },
{ "4", "false", "false", "false", "false", "false" },
{ "5", "false", "false", "false", "false", "false" },
{ "6", "false", "false", "false", "false", "false" },
});
JDBC.assertFullResultSet(s.executeQuery(
"select a, b, "
+ "case when ((b = 'a' or b = 'b') and a < 4) "
+ "then 'x' else '-' end, "
+ "case when (a < 4 and (b = 'a' or b = 'b')) "
+ "then 'y' else '-' end "
+ "from d6363 order by a"),
new String[][] {
{ "1", "a", "x", "y" },
{ "2", "b", "x", "y" },
{ "3", "a", "x", "y" },
{ "4", "b", "-", "-" },
{ "5", "a", "-", "-" },
{ "6", "b", "-", "-" },
});
}
///////////////////////////////////////////////////////////////////////////////////
//
// SQL ROUTINES
//
///////////////////////////////////////////////////////////////////////////////////
|
void function() throws SQLException { Statement s = createStatement(); s.execute(STR); s.execute(STR + STR); JDBC.assertFullResultSet(s.executeQuery( STR + STR + STR + STR + STR + STR), new String[][] { { "1", "true", "true", "true", "true", "true" }, { "2", "true", "true", "true", "true", "true" }, { "3", "true", "true", "true", "true", "true" }, { "4", "false", "false", "false", "false", "false" }, { "5", "false", "false", "false", "false", "false" }, { "6", "false", "false", "false", "false", "false" }, }); JDBC.assertFullResultSet(s.executeQuery( STR + STR + STR + STR + STR + STR), new String[][] { { "1", "a", "x", "y" }, { "2", "b", "x", "y" }, { "3", "a", "x", "y" }, { "4", "b", "-", "-" }, { "5", "a", "-", "-" }, { "6", "b", "-", "-" }, }); }
|
/**
* Some BOOLEAN expressions used to be transformed to non-equivalent
* IN lists. Verify that they now return the correct results.
* Regression test case for DERBY-6363.
*/
|
Some BOOLEAN expressions used to be transformed to non-equivalent IN lists. Verify that they now return the correct results. Regression test case for DERBY-6363
|
test_6363
|
{
"repo_name": "kavin256/Derby",
"path": "java/testing/org/apache/derbyTesting/functionTests/tests/lang/BooleanValuesTest.java",
"license": "apache-2.0",
"size": 73417
}
|
[
"java.sql.SQLException",
"java.sql.Statement",
"org.apache.derbyTesting.junit.JDBC"
] |
import java.sql.SQLException; import java.sql.Statement; import org.apache.derbyTesting.junit.JDBC;
|
import java.sql.*; import org.apache.*;
|
[
"java.sql",
"org.apache"
] |
java.sql; org.apache;
| 680,667
|
private void sendNotification(String messageBody, Bitmap image) {
Intent intent = new Intent(this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 , intent,
PendingIntent.FLAG_ONE_SHOT);
Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
.setLargeIcon(image)
.setSmallIcon(R.drawable.new_noti)
.setContentTitle("FCM Message")
.setContentText(messageBody)
.setStyle(new NotificationCompat.BigPictureStyle()
.bigPicture(image))
.setAutoCancel(true)
.setSound(defaultSoundUri)
.setContentIntent(pendingIntent);
NotificationManager notificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(0 , notificationBuilder.build());
}
|
void function(String messageBody, Bitmap image) { Intent intent = new Intent(this, MainActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 , intent, PendingIntent.FLAG_ONE_SHOT); Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this) .setLargeIcon(image) .setSmallIcon(R.drawable.new_noti) .setContentTitle(STR) .setContentText(messageBody) .setStyle(new NotificationCompat.BigPictureStyle() .bigPicture(image)) .setAutoCancel(true) .setSound(defaultSoundUri) .setContentIntent(pendingIntent); NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.notify(0 , notificationBuilder.build()); }
|
/**
* Create and show a simple notification containing the received FCM message.
*
* @param messageBody FCM message body received.
*/
|
Create and show a simple notification containing the received FCM message
|
sendNotification
|
{
"repo_name": "bablumon/EasyJobsMain",
"path": "app/src/main/java/me/toptas/jobseasy/main/MyFirebaseMessagingService.java",
"license": "apache-2.0",
"size": 3783
}
|
[
"android.app.NotificationManager",
"android.app.PendingIntent",
"android.content.Context",
"android.content.Intent",
"android.graphics.Bitmap",
"android.media.RingtoneManager",
"android.net.Uri",
"android.support.v4.app.NotificationCompat"
] |
import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.media.RingtoneManager; import android.net.Uri; import android.support.v4.app.NotificationCompat;
|
import android.app.*; import android.content.*; import android.graphics.*; import android.media.*; import android.net.*; import android.support.v4.app.*;
|
[
"android.app",
"android.content",
"android.graphics",
"android.media",
"android.net",
"android.support"
] |
android.app; android.content; android.graphics; android.media; android.net; android.support;
| 2,134,727
|
public void toggleDrawerUse(boolean useDrawer) {
Log.d(TAG, "toggleDrawerUse " + String.valueOf(useDrawer));
mDrawerToggle.setDrawerIndicatorEnabled(useDrawer);
if (useDrawer) {
((MainActivity) getActivity()).getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_menu_white_24dp);
} else {
((MainActivity) getActivity()).getSupportActionBar().setHomeAsUpIndicator(null);
}
}
|
void function(boolean useDrawer) { Log.d(TAG, STR + String.valueOf(useDrawer)); mDrawerToggle.setDrawerIndicatorEnabled(useDrawer); if (useDrawer) { ((MainActivity) getActivity()).getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_menu_white_24dp); } else { ((MainActivity) getActivity()).getSupportActionBar().setHomeAsUpIndicator(null); } }
|
/**
* Enable/Disable the icon being used by the drawer.
*
* @param useDrawer whether or not to use the icon.
*/
|
Enable/Disable the icon being used by the drawer
|
toggleDrawerUse
|
{
"repo_name": "potray/Pacts",
"path": "app/src/main/java/es/potrayarrick/pacts/NavigationDrawerFragment.java",
"license": "gpl-2.0",
"size": 11231
}
|
[
"android.util.Log"
] |
import android.util.Log;
|
import android.util.*;
|
[
"android.util"
] |
android.util;
| 2,813,374
|
public static MCAFile read(File file) throws IOException {
return read(file, LoadFlags.ALL_DATA);
}
|
static MCAFile function(File file) throws IOException { return read(file, LoadFlags.ALL_DATA); }
|
/**
* Reads an MCA file and loads all of its chunks.
* @param file The file to read the data from.
* @return An in-memory representation of the MCA file with decompressed chunk data.
* @throws IOException if something during deserialization goes wrong.
* */
|
Reads an MCA file and loads all of its chunks
|
read
|
{
"repo_name": "Querz/NBT",
"path": "src/main/java/net/querz/mca/MCAUtil.java",
"license": "mit",
"size": 8127
}
|
[
"java.io.File",
"java.io.IOException"
] |
import java.io.File; import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,291,555
|
// Are we configured to select Locale automatically?
LOG.trace("retrieve config...");
ModuleConfig moduleConfig = actionCtx.getModuleConfig();
if (!moduleConfig.getControllerConfig().getLocale()) {
if (LOG.isDebugEnabled()) {
LOG.debug("module is not configured for a specific locale; " + "nothing to do");
}
return (false);
}
// Retrieve and cache appropriate Locale for this request
Locale locale = getLocale(actionCtx);
if (LOG.isDebugEnabled()) {
LOG.debug("set context locale to " + locale);
}
actionCtx.setLocale(locale);
return (false);
}
// ------------------------------------------------------- Protected Methods
|
LOG.trace(STR); ModuleConfig moduleConfig = actionCtx.getModuleConfig(); if (!moduleConfig.getControllerConfig().getLocale()) { if (LOG.isDebugEnabled()) { LOG.debug(STR + STR); } return (false); } Locale locale = getLocale(actionCtx); if (LOG.isDebugEnabled()) { LOG.debug(STR + locale); } actionCtx.setLocale(locale); return (false); }
|
/**
* <p>
* Select the <code>Locale</code> to be used for this request.
* </p>
*
* @param actionCtx
* The <code>Context</code> for the current request
* @return <code>false</code> so that processing continues
* @throws Exception
* if thrown by the Action class
*/
|
Select the <code>Locale</code> to be used for this request.
|
execute
|
{
"repo_name": "jreadstone/zsyproject",
"path": "src/org/g4studio/core/mvc/xstruts/chain/commands/AbstractSelectLocale.java",
"license": "gpl-2.0",
"size": 2187
}
|
[
"java.util.Locale",
"org.g4studio.core.mvc.xstruts.config.ModuleConfig"
] |
import java.util.Locale; import org.g4studio.core.mvc.xstruts.config.ModuleConfig;
|
import java.util.*; import org.g4studio.core.mvc.xstruts.config.*;
|
[
"java.util",
"org.g4studio.core"
] |
java.util; org.g4studio.core;
| 2,002,530
|
public static WritableRandomIter createWritable(WritableRenderedImage im, Rectangle bounds) {
if (bounds == null) {
bounds = new Rectangle(im.getMinX(), im.getMinY(), im.getWidth(), im.getHeight());
}
return new WritableRandomIterFallback(im, bounds);
}
|
static WritableRandomIter function(WritableRenderedImage im, Rectangle bounds) { if (bounds == null) { bounds = new Rectangle(im.getMinX(), im.getMinY(), im.getWidth(), im.getHeight()); } return new WritableRandomIterFallback(im, bounds); }
|
/**
* Constructs and returns an instance of WritableRandomIter suitable for iterating over the given bounding rectangle within the given
* WritableRenderedImage source. If the bounds parameter is null, the entire image will be used.
*
* @param im a WritableRenderedImage source.
* @param bounds the bounding Rectangle for the iterator, or null.
* @return a WritableRandomIter allowing read/write access to the source.
*/
|
Constructs and returns an instance of WritableRandomIter suitable for iterating over the given bounding rectangle within the given WritableRenderedImage source. If the bounds parameter is null, the entire image will be used
|
createWritable
|
{
"repo_name": "simboss/jai-ext",
"path": "jt-iterators/src/main/java/it/geosolutions/jaiext/iterators/RandomIterFactory.java",
"license": "apache-2.0",
"size": 6439
}
|
[
"com.sun.media.jai.iterator.WritableRandomIterFallback",
"java.awt.Rectangle",
"java.awt.image.WritableRenderedImage",
"javax.media.jai.iterator.WritableRandomIter"
] |
import com.sun.media.jai.iterator.WritableRandomIterFallback; import java.awt.Rectangle; import java.awt.image.WritableRenderedImage; import javax.media.jai.iterator.WritableRandomIter;
|
import com.sun.media.jai.iterator.*; import java.awt.*; import java.awt.image.*; import javax.media.jai.iterator.*;
|
[
"com.sun.media",
"java.awt",
"javax.media"
] |
com.sun.media; java.awt; javax.media;
| 2,556,611
|
public ArrayList<DataNode> getDataNodes() {
ArrayList<DataNode> list = new ArrayList<DataNode>();
for (int i = 0; i < dataNodes.size(); i++) {
DataNode node = dataNodes.get(i).datanode;
list.add(node);
}
return list;
}
|
ArrayList<DataNode> function() { ArrayList<DataNode> list = new ArrayList<DataNode>(); for (int i = 0; i < dataNodes.size(); i++) { DataNode node = dataNodes.get(i).datanode; list.add(node); } return list; }
|
/**
* Gets a list of the started DataNodes. May be empty.
*/
|
Gets a list of the started DataNodes. May be empty
|
getDataNodes
|
{
"repo_name": "simbadzina/hadoop-fcfs",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java",
"license": "apache-2.0",
"size": 101960
}
|
[
"java.util.ArrayList",
"org.apache.hadoop.hdfs.server.datanode.DataNode"
] |
import java.util.ArrayList; import org.apache.hadoop.hdfs.server.datanode.DataNode;
|
import java.util.*; import org.apache.hadoop.hdfs.server.datanode.*;
|
[
"java.util",
"org.apache.hadoop"
] |
java.util; org.apache.hadoop;
| 2,364,421
|
@Override
public void stop() throws CqClosedException, CqException {
boolean isStopped = false;
synchronized (this.cqState) {
if (this.isClosed()) {
throw new CqClosedException(
LocalizedStrings.CqQueryImpl_CQ_IS_CLOSED_CQNAME_0.toLocalizedString(this.cqName));
}
if (!(this.isRunning())) {
throw new IllegalStateException(
LocalizedStrings.CqQueryImpl_CQ_IS_NOT_IN_RUNNING_STATE_STOP_CQ_DOES_NOT_APPLY_CQNAME_0
.toLocalizedString(this.cqName));
}
Exception exception = null;
try {
if (this.proxyCache != null) {
if (this.proxyCache.isClosed()) {
throw proxyCache.getCacheClosedException("Cache is closed for this user.");
}
UserAttributes.userAttributes.set(this.proxyCache.getUserAttributes());
}
cqProxy.stop(this);
isStopped = true;
} catch (Exception e) {
exception = e;
} finally {
UserAttributes.userAttributes.set(null);
}
if (cqProxy == null || isStopped) {
// Change state and stats on the client side
this.cqState.setState(CqStateImpl.STOPPED);
this.cqService.stats().incCqsStopped();
this.cqService.stats().decCqsActive();
if (logger.isDebugEnabled()) {
logger.debug("Successfully stopped the CQ. {}", cqName);
}
} else {
// Hasn't able to send stop request to any server.
if (exception != null) {
throw new CqException(
LocalizedStrings.CqQueryImpl_FAILED_TO_STOP_THE_CQ_CQNAME_0_ERROR_FROM_LAST_SERVER_1
.toLocalizedString(this.cqName, exception.getLocalizedMessage()),
exception.getCause());
} else {
throw new CqException(
LocalizedStrings.CqQueryImpl_FAILED_TO_STOP_THE_CQ_CQNAME_0_THE_SERVER_ENDPOINTS_ON_WHICH_THIS_CQ_WAS_REGISTERED_WERE_NOT_FOUND
.toLocalizedString(this.cqName));
}
}
}
}
|
void function() throws CqClosedException, CqException { boolean isStopped = false; synchronized (this.cqState) { if (this.isClosed()) { throw new CqClosedException( LocalizedStrings.CqQueryImpl_CQ_IS_CLOSED_CQNAME_0.toLocalizedString(this.cqName)); } if (!(this.isRunning())) { throw new IllegalStateException( LocalizedStrings.CqQueryImpl_CQ_IS_NOT_IN_RUNNING_STATE_STOP_CQ_DOES_NOT_APPLY_CQNAME_0 .toLocalizedString(this.cqName)); } Exception exception = null; try { if (this.proxyCache != null) { if (this.proxyCache.isClosed()) { throw proxyCache.getCacheClosedException(STR); } UserAttributes.userAttributes.set(this.proxyCache.getUserAttributes()); } cqProxy.stop(this); isStopped = true; } catch (Exception e) { exception = e; } finally { UserAttributes.userAttributes.set(null); } if (cqProxy == null isStopped) { this.cqState.setState(CqStateImpl.STOPPED); this.cqService.stats().incCqsStopped(); this.cqService.stats().decCqsActive(); if (logger.isDebugEnabled()) { logger.debug(STR, cqName); } } else { if (exception != null) { throw new CqException( LocalizedStrings.CqQueryImpl_FAILED_TO_STOP_THE_CQ_CQNAME_0_ERROR_FROM_LAST_SERVER_1 .toLocalizedString(this.cqName, exception.getLocalizedMessage()), exception.getCause()); } else { throw new CqException( LocalizedStrings.CqQueryImpl_FAILED_TO_STOP_THE_CQ_CQNAME_0_THE_SERVER_ENDPOINTS_ON_WHICH_THIS_CQ_WAS_REGISTERED_WERE_NOT_FOUND .toLocalizedString(this.cqName)); } } } }
|
/**
* Stop or pause executing the query.
*/
|
Stop or pause executing the query
|
stop
|
{
"repo_name": "smanvi-pivotal/geode",
"path": "geode-cq/src/main/java/org/apache/geode/cache/query/internal/cq/ClientCQImpl.java",
"license": "apache-2.0",
"size": 21827
}
|
[
"org.apache.geode.cache.client.internal.UserAttributes",
"org.apache.geode.cache.query.CqClosedException",
"org.apache.geode.cache.query.CqException",
"org.apache.geode.cache.query.internal.CqStateImpl",
"org.apache.geode.internal.i18n.LocalizedStrings"
] |
import org.apache.geode.cache.client.internal.UserAttributes; import org.apache.geode.cache.query.CqClosedException; import org.apache.geode.cache.query.CqException; import org.apache.geode.cache.query.internal.CqStateImpl; import org.apache.geode.internal.i18n.LocalizedStrings;
|
import org.apache.geode.cache.client.internal.*; import org.apache.geode.cache.query.*; import org.apache.geode.cache.query.internal.*; import org.apache.geode.internal.i18n.*;
|
[
"org.apache.geode"
] |
org.apache.geode;
| 1,425,616
|
public static boolean compareDeclarations(Method first, Method second) {
if (first.getReturnType() != second.getReturnType()) {
return false;
}
return compareSignatures(first, second);
}
|
static boolean function(Method first, Method second) { if (first.getReturnType() != second.getReturnType()) { return false; } return compareSignatures(first, second); }
|
/**
* Compares method declarations: signature and return types.
*/
|
Compares method declarations: signature and return types
|
compareDeclarations
|
{
"repo_name": "mtakaki/jodd",
"path": "jodd-core/src/main/java/jodd/util/ReflectUtil.java",
"license": "bsd-2-clause",
"size": 40780
}
|
[
"java.lang.reflect.Method"
] |
import java.lang.reflect.Method;
|
import java.lang.reflect.*;
|
[
"java.lang"
] |
java.lang;
| 1,523,632
|
protected IFigure setupContentPane(IFigure nodeShape) {
return nodeShape; // use nodeShape itself as contentPane
}
|
IFigure function(IFigure nodeShape) { return nodeShape; }
|
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
*
* @param nodeShape instance of generated figure class
* @generated
*/
|
Default implementation treats passed figure as content pane. Respects layout one may have set for generated figure
|
setupContentPane
|
{
"repo_name": "prabushi/devstudio-tooling-esb",
"path": "plugins/org.wso2.developerstudio.eclipse.gmf.esb.diagram/src/org/wso2/developerstudio/eclipse/gmf/esb/diagram/edit/parts/CloudConnectorOperationInputConnectorEditPart.java",
"license": "apache-2.0",
"size": 13976
}
|
[
"org.eclipse.draw2d.IFigure"
] |
import org.eclipse.draw2d.IFigure;
|
import org.eclipse.draw2d.*;
|
[
"org.eclipse.draw2d"
] |
org.eclipse.draw2d;
| 2,689,397
|
protected HashMap<String, Integer> getWordList() {
return words;
}
|
HashMap<String, Integer> function() { return words; }
|
/**
* Get the word list.
*
* @return the word list
*/
|
Get the word list
|
getWordList
|
{
"repo_name": "miloszpiglas/h2mod",
"path": "src/main/org/h2/fulltext/FullTextSettings.java",
"license": "mpl-2.0",
"size": 5942
}
|
[
"java.util.HashMap"
] |
import java.util.HashMap;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,086,138
|
@RequestMapping(value = "/savescorecardservicebackend", method = RequestMethod.POST)
public void savescorecardservicebackend(
@RequestParam("ccdaFile") MultipartFile ccdaFile,
HttpServletResponse response) {
handlePureBackendCall(ccdaFile, response, SaveReportType.MATCH_UI, scorecardProcessor);
}
|
@RequestMapping(value = STR, method = RequestMethod.POST) void function( @RequestParam(STR) MultipartFile ccdaFile, HttpServletResponse response) { handlePureBackendCall(ccdaFile, response, SaveReportType.MATCH_UI, scorecardProcessor); }
|
/**
* A single service to handle a pure back-end implementation of the
* scorecard which streams back a PDF report.
* This does not require the completed JSON up-front, it creates it from the file sent.
*
* @param ccdaFile
* The C-CDA XML file intended to be scored
*/
|
A single service to handle a pure back-end implementation of the scorecard which streams back a PDF report. This does not require the completed JSON up-front, it creates it from the file sent
|
savescorecardservicebackend
|
{
"repo_name": "siteadmin/CCDA-Score-CARD",
"path": "src/main/java/org/sitenv/service/ccda/smartscorecard/controller/SaveReportController.java",
"license": "bsd-2-clause",
"size": 59669
}
|
[
"javax.servlet.http.HttpServletResponse",
"org.springframework.web.bind.annotation.RequestMapping",
"org.springframework.web.bind.annotation.RequestMethod",
"org.springframework.web.bind.annotation.RequestParam",
"org.springframework.web.multipart.MultipartFile"
] |
import javax.servlet.http.HttpServletResponse; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.multipart.MultipartFile;
|
import javax.servlet.http.*; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.*;
|
[
"javax.servlet",
"org.springframework.web"
] |
javax.servlet; org.springframework.web;
| 316,144
|
public TransactionIntegration getTransactionIntegration();
|
TransactionIntegration function();
|
/**
* Get the transaction integration
* @return The value
*/
|
Get the transaction integration
|
getTransactionIntegration
|
{
"repo_name": "jandsu/ironjacamar",
"path": "core/src/main/java/org/ironjacamar/core/connectionmanager/TransactionalConnectionManager.java",
"license": "epl-1.0",
"size": 1405
}
|
[
"org.ironjacamar.core.spi.transaction.TransactionIntegration"
] |
import org.ironjacamar.core.spi.transaction.TransactionIntegration;
|
import org.ironjacamar.core.spi.transaction.*;
|
[
"org.ironjacamar.core"
] |
org.ironjacamar.core;
| 572,740
|
public static String getCommaDelimitedString( Collection<?> elements )
{
final StringBuilder builder = new StringBuilder();
if ( elements != null && !elements.isEmpty() )
{
for ( Object element : elements )
{
builder.append( element.toString() ).append( DELIMITER );
}
return builder.substring( 0, builder.length() - DELIMITER.length() );
}
return builder.toString();
}
|
static String function( Collection<?> elements ) { final StringBuilder builder = new StringBuilder(); if ( elements != null && !elements.isEmpty() ) { for ( Object element : elements ) { builder.append( element.toString() ).append( DELIMITER ); } return builder.substring( 0, builder.length() - DELIMITER.length() ); } return builder.toString(); }
|
/**
* Transforms a collection of Integers into a comma delimited String. If the
* given collection of elements are null or is empty, an empty String is
* returned.
*
* @param elements the collection of Integers
* @return a comma delimited String.
*/
|
Transforms a collection of Integers into a comma delimited String. If the given collection of elements are null or is empty, an empty String is returned
|
getCommaDelimitedString
|
{
"repo_name": "vietnguyen/dhis2-core",
"path": "dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/TextUtils.java",
"license": "bsd-3-clause",
"size": 20833
}
|
[
"java.util.Collection"
] |
import java.util.Collection;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,307,526
|
public Date getNominalTime() {
return nominalTime;
}
|
Date function() { return nominalTime; }
|
/**
* Get nominal time
*
* @return nominal time
*/
|
Get nominal time
|
getNominalTime
|
{
"repo_name": "terrancesnyder/oozie-hadoop2",
"path": "client/src/main/java/org/apache/oozie/client/event/message/SLAMessage.java",
"license": "apache-2.0",
"size": 9345
}
|
[
"java.util.Date"
] |
import java.util.Date;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 807,785
|
private ArrayList<E> toArrayList() {
ArrayList<E> list = new ArrayList<>();
for (Node<E> p = first(); p != null; p = succ(p)) {
E item = p.item;
if (item != null)
list.add(item);
}
return list;
}
public FastConcurrentDirectDeque() {
head = tail = new Node<>(null);
}
public FastConcurrentDirectDeque(Collection<? extends E> c) {
// Copy c into a private chain of Nodes
Node<E> h = null, t = null;
for (E e : c) {
checkNotNull(e);
Node<E> newNode = new Node<>(e);
if (h == null)
h = t = newNode;
else {
t.lazySetNext(newNode);
newNode.lazySetPrev(t);
t = newNode;
}
}
initHeadTail(h, t);
}
|
ArrayList<E> function() { ArrayList<E> list = new ArrayList<>(); for (Node<E> p = first(); p != null; p = succ(p)) { E item = p.item; if (item != null) list.add(item); } return list; } public FastConcurrentDirectDeque() { head = tail = new Node<>(null); } public FastConcurrentDirectDeque(Collection<? extends E> c) { Node<E> h = null, t = null; for (E e : c) { checkNotNull(e); Node<E> newNode = new Node<>(e); if (h == null) h = t = newNode; else { t.lazySetNext(newNode); newNode.lazySetPrev(t); t = newNode; } } initHeadTail(h, t); }
|
/**
* Creates an array list and fills it with elements of this list.
* Used by toArray.
*
* @return the arrayList
*/
|
Creates an array list and fills it with elements of this list. Used by toArray
|
toArrayList
|
{
"repo_name": "aradchykov/undertow",
"path": "core/src/main/java/io/undertow/util/FastConcurrentDirectDeque.java",
"license": "apache-2.0",
"size": 54894
}
|
[
"java.util.ArrayList",
"java.util.Collection"
] |
import java.util.ArrayList; import java.util.Collection;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,742,597
|
Test selectByPrimaryKey(Integer id);
|
Test selectByPrimaryKey(Integer id);
|
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table test
*
* @mbggenerated
*/
|
This method was generated by MyBatis Generator. This method corresponds to the database table test
|
selectByPrimaryKey
|
{
"repo_name": "sulinixl/server-boilerplate",
"path": "server-dao/src/main/java/com/boilerplate/server/dao/TestMapper.java",
"license": "mit",
"size": 2544
}
|
[
"com.boilerplate.server.model.Test"
] |
import com.boilerplate.server.model.Test;
|
import com.boilerplate.server.model.*;
|
[
"com.boilerplate.server"
] |
com.boilerplate.server;
| 2,714,860
|
public String suspend(ProtocolForm protocolForm) throws Exception;
|
String function(ProtocolForm protocolForm) throws Exception;
|
/**
* This method is to suspend a protocol
* @param protocolForm
* @return
* @throws Exception
*/
|
This method is to suspend a protocol
|
suspend
|
{
"repo_name": "vivantech/kc_fixes",
"path": "src/main/java/org/kuali/kra/irb/actions/IrbProtocolActionRequestService.java",
"license": "apache-2.0",
"size": 17752
}
|
[
"org.kuali.kra.irb.ProtocolForm"
] |
import org.kuali.kra.irb.ProtocolForm;
|
import org.kuali.kra.irb.*;
|
[
"org.kuali.kra"
] |
org.kuali.kra;
| 2,654,127
|
// Local Declarations
ArrayList<Entry> template = new ArrayList<Entry>();
ArrayList<Entry> template2 = new ArrayList<Entry>();
Entry column1 = new Entry();
Entry column2 = new Entry();
Entry column3 = new Entry();
Entry column4 = new Entry();
Entry column5 = new Entry();
Entry column6 = new Entry();
Entry testColumn1, testColumn2, testColumn3 = null;
// This test will verify a legal use of table component, append a row
// template,
// and set values. It will assert if they are correct.
// create new tableComponent
tableComponent = new TableComponent();
// set tableComponent values for name, id, description
tableComponent.setName("Table 1");
tableComponent.setId(1);
tableComponent.setDescription("This is a table that contains entries.");
// Set row template - gather columns to table
column1.setName("Column1");
column1.setId(1);
column1.setDescription("I am Column1!");
column1.setValue("Over 9000!");
column2.setName("Column2");
column2.setId(2);
column2.setDescription("I am Column2!");
column2.setValue("Under 9000!");
column3.setName("Column3");
column3.setId(3);
column3.setDescription("I am Column3!");
column3.setValue("At 9000!");
column3.setTag("HI!");
// Add columns to template arraylist
template.add(column1);
template.add(column2);
template.add(column3);
// Add template to tableComponent
tableComponent.setRowTemplate(template);
template = null;
// check current status
// check table
assertEquals("Table 1", tableComponent.getName());
assertEquals(1, tableComponent.getId());
assertEquals("This is a table that contains entries.",
tableComponent.getDescription());
// check row template, its entries, and columns
template = tableComponent.getRowTemplate();
assertNotNull(template);
// Get columns
testColumn1 = template.get(0);
testColumn2 = template.get(1);
testColumn3 = template.get(2);
// check test Columns
assertEquals(column1.getName(), testColumn1.getName());
assertEquals(column1.getId(), testColumn1.getId());
assertEquals(column1.getDescription(), testColumn1.getDescription());
assertEquals(column1.getValue(), testColumn1.getValue());
assertEquals(column2.getName(), testColumn2.getName());
assertEquals(column2.getId(), testColumn2.getId());
assertEquals(column2.getDescription(), testColumn2.getDescription());
assertEquals(column2.getValue(), testColumn2.getValue());
assertEquals(column3.getName(), testColumn3.getName());
assertEquals(column3.getId(), testColumn3.getId());
assertEquals(column3.getDescription(), testColumn3.getDescription());
assertEquals(column3.getValue(), testColumn3.getValue());
// check column names
assertEquals(testColumn1.getName(), tableComponent.getColumnNames()
.get(0));
assertEquals(testColumn2.getName(), tableComponent.getColumnNames()
.get(1));
assertEquals(testColumn3.getName(), tableComponent.getColumnNames()
.get(2));
// Test that only one template can be made
column4.setName("Column4");
column4.setId(4);
column4.setDescription("I am Column4!");
column4.setValue("Goku");
column5.setName("Column5");
column5.setId(5);
column5.setDescription("I am Column5!");
column5.setValue("is");
column6.setName("Column6");
column6.setId(6);
column6.setDescription("I am Column6!");
column6.setValue("Kakarrot");
template2.add(column4);
template2.add(column5);
template2.add(column6);
// insert template2 into pre-existing tableComponent
tableComponent.setRowTemplate(template2);
// check column names - they don't change
assertEquals(column1.getName(), tableComponent.getColumnNames().get(0));
assertEquals(column2.getName(), tableComponent.getColumnNames().get(1));
assertEquals(column3.getName(), tableComponent.getColumnNames().get(2));
// Test for nulleries
// test for setTableComponent
tableComponent.setRowTemplate(null);
tableComponent.setDescription(null);
tableComponent.setName(null);
// check - not null These should not be null since they were already
// set.
assertNotNull(tableComponent.getDescription());
assertNotNull(tableComponent.getName());
assertNotNull(tableComponent.getRowTemplate());
// This is to check to make sure rowEdits are not being made on a
// template
// or columnNames
ArrayList<String> tempArray = new ArrayList<String>();
ArrayList<Entry> tArray = new ArrayList<Entry>();
// check columnNames
tempArray = tableComponent.getColumnNames();
// Modify the arrayList
tempArray.add("NewColumn!");
// check arraylist, see that it is still the same size and does not
// contain new content
assertEquals(3, tableComponent.getColumnNames().size());
// check column names - they don't change
assertEquals(column1.getName(), tableComponent.getColumnNames().get(0));
assertEquals(column2.getName(), tableComponent.getColumnNames().get(1));
assertEquals(column3.getName(), tableComponent.getColumnNames().get(2));
// check rowTemplate
tArray = tableComponent.getRowTemplate();
// Modify the arrayList
tArray.add(column4);
// Check arraylist, see that it is still the same size and does not
// contain new content
assertEquals(3, tableComponent.getRowTemplate().size());
// check test Columns with other columns (to verify no change was made)
assertEquals(column1.getName(), testColumn1.getName());
assertEquals(column1.getId(), testColumn1.getId());
assertEquals(column1.getDescription(), testColumn1.getDescription());
assertEquals(column1.getValue(), testColumn1.getValue());
assertEquals(column2.getName(), testColumn2.getName());
assertEquals(column2.getId(), testColumn2.getId());
assertEquals(column2.getDescription(), testColumn2.getDescription());
assertEquals(column2.getValue(), testColumn2.getValue());
assertEquals(column3.getName(), testColumn3.getName());
assertEquals(column3.getId(), testColumn3.getId());
assertEquals(column3.getDescription(), testColumn3.getDescription());
assertEquals(column3.getValue(), testColumn3.getValue());
}
|
ArrayList<Entry> template = new ArrayList<Entry>(); ArrayList<Entry> template2 = new ArrayList<Entry>(); Entry column1 = new Entry(); Entry column2 = new Entry(); Entry column3 = new Entry(); Entry column4 = new Entry(); Entry column5 = new Entry(); Entry column6 = new Entry(); Entry testColumn1, testColumn2, testColumn3 = null; tableComponent = new TableComponent(); tableComponent.setName(STR); tableComponent.setId(1); tableComponent.setDescription(STR); column1.setName(STR); column1.setId(1); column1.setDescription(STR); column1.setValue(STR); column2.setName(STR); column2.setId(2); column2.setDescription(STR); column2.setValue(STR); column3.setName(STR); column3.setId(3); column3.setDescription(STR); column3.setValue(STR); column3.setTag("HI!"); template.add(column1); template.add(column2); template.add(column3); tableComponent.setRowTemplate(template); template = null; assertEquals(STR, tableComponent.getName()); assertEquals(1, tableComponent.getId()); assertEquals(STR, tableComponent.getDescription()); template = tableComponent.getRowTemplate(); assertNotNull(template); testColumn1 = template.get(0); testColumn2 = template.get(1); testColumn3 = template.get(2); assertEquals(column1.getName(), testColumn1.getName()); assertEquals(column1.getId(), testColumn1.getId()); assertEquals(column1.getDescription(), testColumn1.getDescription()); assertEquals(column1.getValue(), testColumn1.getValue()); assertEquals(column2.getName(), testColumn2.getName()); assertEquals(column2.getId(), testColumn2.getId()); assertEquals(column2.getDescription(), testColumn2.getDescription()); assertEquals(column2.getValue(), testColumn2.getValue()); assertEquals(column3.getName(), testColumn3.getName()); assertEquals(column3.getId(), testColumn3.getId()); assertEquals(column3.getDescription(), testColumn3.getDescription()); assertEquals(column3.getValue(), testColumn3.getValue()); assertEquals(testColumn1.getName(), tableComponent.getColumnNames() .get(0)); assertEquals(testColumn2.getName(), tableComponent.getColumnNames() .get(1)); assertEquals(testColumn3.getName(), tableComponent.getColumnNames() .get(2)); column4.setName(STR); column4.setId(4); column4.setDescription(STR); column4.setValue("Goku"); column5.setName(STR); column5.setId(5); column5.setDescription(STR); column5.setValue("is"); column6.setName(STR); column6.setId(6); column6.setDescription(STR); column6.setValue(STR); template2.add(column4); template2.add(column5); template2.add(column6); tableComponent.setRowTemplate(template2); assertEquals(column1.getName(), tableComponent.getColumnNames().get(0)); assertEquals(column2.getName(), tableComponent.getColumnNames().get(1)); assertEquals(column3.getName(), tableComponent.getColumnNames().get(2)); tableComponent.setRowTemplate(null); tableComponent.setDescription(null); tableComponent.setName(null); assertNotNull(tableComponent.getDescription()); assertNotNull(tableComponent.getName()); assertNotNull(tableComponent.getRowTemplate()); ArrayList<String> tempArray = new ArrayList<String>(); ArrayList<Entry> tArray = new ArrayList<Entry>(); tempArray = tableComponent.getColumnNames(); tempArray.add(STR); assertEquals(3, tableComponent.getColumnNames().size()); assertEquals(column1.getName(), tableComponent.getColumnNames().get(0)); assertEquals(column2.getName(), tableComponent.getColumnNames().get(1)); assertEquals(column3.getName(), tableComponent.getColumnNames().get(2)); tArray = tableComponent.getRowTemplate(); tArray.add(column4); assertEquals(3, tableComponent.getRowTemplate().size()); assertEquals(column1.getName(), testColumn1.getName()); assertEquals(column1.getId(), testColumn1.getId()); assertEquals(column1.getDescription(), testColumn1.getDescription()); assertEquals(column1.getValue(), testColumn1.getValue()); assertEquals(column2.getName(), testColumn2.getName()); assertEquals(column2.getId(), testColumn2.getId()); assertEquals(column2.getDescription(), testColumn2.getDescription()); assertEquals(column2.getValue(), testColumn2.getValue()); assertEquals(column3.getName(), testColumn3.getName()); assertEquals(column3.getId(), testColumn3.getId()); assertEquals(column3.getDescription(), testColumn3.getDescription()); assertEquals(column3.getValue(), testColumn3.getValue()); }
|
/**
* <p>
* This operation checks the TableComponent to make sure that setting the
* Row Template can only be done once and that the Row Template can be
* retrieved, but not manipulated. It also checks the name, id and
* description of the TableComponent.
* </p>
*
*/
|
This operation checks the TableComponent to make sure that setting the Row Template can only be done once and that the Row Template can be retrieved, but not manipulated. It also checks the name, id and description of the TableComponent.
|
checkConstruction
|
{
"repo_name": "gorindn/ice",
"path": "tests/org.eclipse.ice.viz.service.test/src/org/eclipse/ice/viz/service/datastructures/test/TableComponentTester.java",
"license": "epl-1.0",
"size": 33463
}
|
[
"java.util.ArrayList",
"org.eclipse.ice.datastructures.form.Entry",
"org.eclipse.ice.datastructures.form.TableComponent",
"org.junit.Assert"
] |
import java.util.ArrayList; import org.eclipse.ice.datastructures.form.Entry; import org.eclipse.ice.datastructures.form.TableComponent; import org.junit.Assert;
|
import java.util.*; import org.eclipse.ice.datastructures.form.*; import org.junit.*;
|
[
"java.util",
"org.eclipse.ice",
"org.junit"
] |
java.util; org.eclipse.ice; org.junit;
| 1,191,023
|
@Override
public JMenuItem getVisualizeMenuItem(ArrayList<Prediction> preds,
Attribute classAtt) {
final ArrayList<Prediction> finalPreds = preds;
final Attribute finalClassAtt = classAtt;
|
JMenuItem function(ArrayList<Prediction> preds, Attribute classAtt) { final ArrayList<Prediction> finalPreds = preds; final Attribute finalClassAtt = classAtt;
|
/**
* Get a JMenu or JMenuItem which contain action listeners that perform the
* visualization, using some but not necessarily all of the data. Exceptions
* thrown because of changes in Weka since compilation need to be caught by
* the implementer.
*
* @see NoClassDefFoundError
* @see IncompatibleClassChangeError
*
* @param preds predictions
* @param classAtt class attribute
* @return menuitem for opening visualization(s), or null to indicate no
* visualization is applicable for the input
*/
|
Get a JMenu or JMenuItem which contain action listeners that perform the visualization, using some but not necessarily all of the data. Exceptions thrown because of changes in Weka since compilation need to be caught by the implementer
|
getVisualizeMenuItem
|
{
"repo_name": "sistorm/weka",
"path": "WekaExample/src/wekaexamples/gui/visualize/plugins/PredictionError.java",
"license": "gpl-3.0",
"size": 6069
}
|
[
"java.util.ArrayList",
"javax.swing.JMenuItem"
] |
import java.util.ArrayList; import javax.swing.JMenuItem;
|
import java.util.*; import javax.swing.*;
|
[
"java.util",
"javax.swing"
] |
java.util; javax.swing;
| 1,882,920
|
public void testRemoveAll() {
for (int i = 1; i < SIZE; ++i) {
ArrayDeque q = populatedDeque(SIZE);
ArrayDeque p = populatedDeque(i);
assertTrue(q.removeAll(p));
assertEquals(SIZE - i, q.size());
for (int j = 0; j < i; ++j) {
assertFalse(q.contains(p.removeFirst()));
}
}
}
|
void function() { for (int i = 1; i < SIZE; ++i) { ArrayDeque q = populatedDeque(SIZE); ArrayDeque p = populatedDeque(i); assertTrue(q.removeAll(p)); assertEquals(SIZE - i, q.size()); for (int j = 0; j < i; ++j) { assertFalse(q.contains(p.removeFirst())); } } }
|
/**
* removeAll(c) removes only those elements of c and reports true if changed
*/
|
removeAll(c) removes only those elements of c and reports true if changed
|
testRemoveAll
|
{
"repo_name": "debian-pkg-android-tools/android-platform-libcore",
"path": "jsr166-tests/src/test/java/jsr166/ArrayDequeTest.java",
"license": "gpl-2.0",
"size": 26167
}
|
[
"java.util.ArrayDeque"
] |
import java.util.ArrayDeque;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,709,621
|
@NotNull
@ObjectiveCName("setRawUpdatesHandler:")
public ConfigurationBuilder setRawUpdatesHandler(RawUpdatesHandler rawUpdatesHandler) {
this.rawUpdatesHandler = rawUpdatesHandler;
return this;
}
|
@ObjectiveCName(STR) ConfigurationBuilder function(RawUpdatesHandler rawUpdatesHandler) { this.rawUpdatesHandler = rawUpdatesHandler; return this; }
|
/**
* Setting raw updates handler
*
* @param rawUpdatesHandler raw updates handler
* @return this
*/
|
Setting raw updates handler
|
setRawUpdatesHandler
|
{
"repo_name": "EaglesoftZJ/actor-platform",
"path": "actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/ConfigurationBuilder.java",
"license": "agpl-3.0",
"size": 13074
}
|
[
"com.google.j2objc.annotations.ObjectiveCName"
] |
import com.google.j2objc.annotations.ObjectiveCName;
|
import com.google.j2objc.annotations.*;
|
[
"com.google.j2objc"
] |
com.google.j2objc;
| 234,361
|
@SafeVarargs
public static <T> Set<T> asSet(T... values) {
final Set<T> result = new HashSet<>(values.length);
for (T value : values) result.add(value);
return result;
}
|
static <T> Set<T> function(T... values) { final Set<T> result = new HashSet<>(values.length); for (T value : values) result.add(value); return result; }
|
/**
* Returns a new Set of the values specified
* @param values the values to create a new Set from
* @param <T> the element type
* @return the newly created set
*/
|
Returns a new Set of the values specified
|
asSet
|
{
"repo_name": "zavtech/morpheus-core",
"path": "src/main/java/com/zavtech/morpheus/util/Collect.java",
"license": "apache-2.0",
"size": 8505
}
|
[
"java.util.HashSet",
"java.util.Set"
] |
import java.util.HashSet; import java.util.Set;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 820,336
|
private static void shutdownApplicationSupportServices(ShutdownEvent.ShutdownType shutdownType) {
// Shutdown non-managed services
if (hardwareWalletService.isPresent()) {
hardwareWalletService.get().stopAndWait();
// Need a fresh instance for correct restart
hardwareWalletService = Optional.absent();
}
// Allow graceful shutdown in the correct order
if (configurationService != null) {
configurationService.shutdownNow(shutdownType);
}
if (environmentCheckingService != null) {
environmentCheckingService.shutdownNow(shutdownType);
}
if (applicationEventService != null) {
applicationEventService.shutdownNow(shutdownType);
}
if (paymentProtocolService != null) {
paymentProtocolService.shutdownNow(shutdownType);
}
// Be judicious when clearing references since it leads to complex behaviour during shutdown
}
|
static void function(ShutdownEvent.ShutdownType shutdownType) { if (hardwareWalletService.isPresent()) { hardwareWalletService.get().stopAndWait(); hardwareWalletService = Optional.absent(); } if (configurationService != null) { configurationService.shutdownNow(shutdownType); } if (environmentCheckingService != null) { environmentCheckingService.shutdownNow(shutdownType); } if (applicationEventService != null) { applicationEventService.shutdownNow(shutdownType); } if (paymentProtocolService != null) { paymentProtocolService.shutdownNow(shutdownType); } }
|
/**
* <p>Shutdown all application support services (non-optional)</p>
* <ul>
* <li>Hardware wallet service</li>
* </ul>
*
* @param shutdownType The shutdown type providing context
*/
|
Shutdown all application support services (non-optional) Hardware wallet service
|
shutdownApplicationSupportServices
|
{
"repo_name": "oscarguindzberg/multibit-hd",
"path": "mbhd-core/src/main/java/org/multibit/hd/core/services/CoreServices.java",
"license": "mit",
"size": 20718
}
|
[
"com.google.common.base.Optional",
"org.multibit.hd.core.events.ShutdownEvent"
] |
import com.google.common.base.Optional; import org.multibit.hd.core.events.ShutdownEvent;
|
import com.google.common.base.*; import org.multibit.hd.core.events.*;
|
[
"com.google.common",
"org.multibit.hd"
] |
com.google.common; org.multibit.hd;
| 2,140,329
|
public Node get(UUID uuid) {
if (uuid == null) {
throw new NullPointerException("\"uuid\" can't to be null");
}
Optional<Node> o_node = nodes.stream().filter(n -> {
return n.equalsThisUUID(uuid);
}).findFirst();
if (o_node.isPresent() == false) {
return null;
}
Node n = o_node.get();
if (n.isOpenSocket() == false) {
remove(n);
return null;
}
return n;
}
|
Node function(UUID uuid) { if (uuid == null) { throw new NullPointerException("\"uuid\STR); } Optional<Node> o_node = nodes.stream().filter(n -> { return n.equalsThisUUID(uuid); }).findFirst(); if (o_node.isPresent() == false) { return null; } Node n = o_node.get(); if (n.isOpenSocket() == false) { remove(n); return null; } return n; }
|
/**
* Check if node is already open, else close it.
* @return null if empty
*/
|
Check if node is already open, else close it
|
get
|
{
"repo_name": "hdsdi3g/EmbeddedDirectDatabase",
"path": "src/hd3gtv/embddb/network/PoolManager.java",
"license": "lgpl-3.0",
"size": 21289
}
|
[
"java.util.Optional"
] |
import java.util.Optional;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 960,314
|
public CSVFormat getFormat() {
return format;
}
|
CSVFormat function() { return format; }
|
/**
* Gets the CSV format before applying any changes.
* It cannot be {@code null}, the default one is {@link org.apache.commons.csv.CSVFormat#DEFAULT}.
*
* @return CSV format
*/
|
Gets the CSV format before applying any changes. It cannot be null, the default one is <code>org.apache.commons.csv.CSVFormat#DEFAULT</code>
|
getFormat
|
{
"repo_name": "logzio/camel",
"path": "components/camel-csv/src/main/java/org/apache/camel/dataformat/csv/CsvDataFormat.java",
"license": "apache-2.0",
"size": 22971
}
|
[
"org.apache.commons.csv.CSVFormat"
] |
import org.apache.commons.csv.CSVFormat;
|
import org.apache.commons.csv.*;
|
[
"org.apache.commons"
] |
org.apache.commons;
| 2,008,474
|
@Test
public void testMultipleCodomainTestNotFromRESaveAfterEach() throws Exception {
Image image = mmFactory.createImage(ModelMockFactory.SIZE_X,
ModelMockFactory.SIZE_Y, ModelMockFactory.SIZE_Z,
ModelMockFactory.SIZE_T,
ModelMockFactory.DEFAULT_CHANNELS_NUMBER);
image = (Image) iUpdate.saveAndReturnObject(image);
Pixels pixels = image.getPrimaryPixels();
long id = pixels.getId().getValue();
IRenderingSettingsPrx prx = factory.getRenderingSettingsService();
// Pixels first
prx.setOriginalSettingsInSet(Pixels.class.getName(),
Arrays.asList(pixels.getId().getValue()));
RenderingDef def = factory.getPixelsService().retrieveRndSettings(id);
List<ChannelBinding> channels = def.copyWaveRendering();
for (int k = 0; k < channels.size(); k++) {
ChannelBinding c = channels.get(k);
ReverseIntensityContext ctx = new ReverseIntensityContextI();
ctx.setReverse(omero.rtypes.rbool(true));
c.addCodomainMapContext(ctx);
def = (RenderingDef) iUpdate.saveAndReturnObject(def);
}
def = (RenderingDef) iUpdate.saveAndReturnObject(def);
}
|
void function() throws Exception { Image image = mmFactory.createImage(ModelMockFactory.SIZE_X, ModelMockFactory.SIZE_Y, ModelMockFactory.SIZE_Z, ModelMockFactory.SIZE_T, ModelMockFactory.DEFAULT_CHANNELS_NUMBER); image = (Image) iUpdate.saveAndReturnObject(image); Pixels pixels = image.getPrimaryPixels(); long id = pixels.getId().getValue(); IRenderingSettingsPrx prx = factory.getRenderingSettingsService(); prx.setOriginalSettingsInSet(Pixels.class.getName(), Arrays.asList(pixels.getId().getValue())); RenderingDef def = factory.getPixelsService().retrieveRndSettings(id); List<ChannelBinding> channels = def.copyWaveRendering(); for (int k = 0; k < channels.size(); k++) { ChannelBinding c = channels.get(k); ReverseIntensityContext ctx = new ReverseIntensityContextI(); ctx.setReverse(omero.rtypes.rbool(true)); c.addCodomainMapContext(ctx); def = (RenderingDef) iUpdate.saveAndReturnObject(def); } def = (RenderingDef) iUpdate.saveAndReturnObject(def); }
|
/**
* Tests to rendering settings with multiple codomain can be saved
* This test does not use the rendering engine but directly the update
* service.
* @throws Exception
* Thrown if an error occurred.
*/
|
Tests to rendering settings with multiple codomain can be saved This test does not use the rendering engine but directly the update service
|
testMultipleCodomainTestNotFromRESaveAfterEach
|
{
"repo_name": "dpwrussell/openmicroscopy",
"path": "components/tools/OmeroJava/test/integration/RenderingEngineTest.java",
"license": "gpl-2.0",
"size": 131845
}
|
[
"java.util.Arrays",
"java.util.List"
] |
import java.util.Arrays; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,807,662
|
StringBuffer bootPathString = new StringBuffer();
// Add boot class path directory if needed
if (this.evalTargetPath != null && TARGET_HAS_FILE_SYSTEM) {
bootPathString.append(this.evalTargetPath);
bootPathString.append(File.separatorChar);
bootPathString.append(BOOT_CLASSPATH_DIRECTORY);
}
return bootPathString.toString();
}
|
StringBuffer bootPathString = new StringBuffer(); if (this.evalTargetPath != null && TARGET_HAS_FILE_SYSTEM) { bootPathString.append(this.evalTargetPath); bootPathString.append(File.separatorChar); bootPathString.append(BOOT_CLASSPATH_DIRECTORY); } return bootPathString.toString(); }
|
/**
* Builds the actual boot class path that is going to be passed to the VM.
*/
|
Builds the actual boot class path that is going to be passed to the VM
|
buildBootClassPath
|
{
"repo_name": "Niky4000/UsefulUtils",
"path": "projects/others/eclipse-platform-parent/eclipse.jdt.core-master/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/JRockitVMLauncher.java",
"license": "gpl-3.0",
"size": 5689
}
|
[
"java.io.File"
] |
import java.io.File;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 587,986
|
public MultipleCurrencyAmount presentValue(
final CouponIborSpread coupon,
final MulticurveProviderInterface multicurves,
final ForwardRateProvider<IborIndex> forwardRateProvider) {
ArgumentChecker.notNull(coupon, "coupon");
ArgumentChecker.notNull(multicurves, "multicurves");
ArgumentChecker.notNull(forwardRateProvider, "forwardRateProvider");
final double forward = forwardRateProvider.getRate(
multicurves,
coupon,
coupon.getFixingPeriodStartTime(),
coupon.getFixingPeriodEndTime(),
coupon.getFixingAccrualFactor());
final double df = multicurves.getDiscountFactor(coupon.getCurrency(), coupon.getPaymentTime());
final double value = (coupon.getNotional() * coupon.getPaymentYearFraction() * forward + coupon.getSpreadAmount()) * df;
return MultipleCurrencyAmount.of(coupon.getCurrency(), value);
}
|
MultipleCurrencyAmount function( final CouponIborSpread coupon, final MulticurveProviderInterface multicurves, final ForwardRateProvider<IborIndex> forwardRateProvider) { ArgumentChecker.notNull(coupon, STR); ArgumentChecker.notNull(multicurves, STR); ArgumentChecker.notNull(forwardRateProvider, STR); final double forward = forwardRateProvider.getRate( multicurves, coupon, coupon.getFixingPeriodStartTime(), coupon.getFixingPeriodEndTime(), coupon.getFixingAccrualFactor()); final double df = multicurves.getDiscountFactor(coupon.getCurrency(), coupon.getPaymentTime()); final double value = (coupon.getNotional() * coupon.getPaymentYearFraction() * forward + coupon.getSpreadAmount()) * df; return MultipleCurrencyAmount.of(coupon.getCurrency(), value); }
|
/**
* Compute the present value of a Ibor coupon with spread using a specific forward rate provider by discounting.
*
* @param coupon
* The coupon.
* @param multicurves
* The multi-curve provider.
* @param forwardRateProvider
* The forward rate provider.
* @return The present value.
*/
|
Compute the present value of a Ibor coupon with spread using a specific forward rate provider by discounting
|
presentValue
|
{
"repo_name": "McLeodMoores/starling",
"path": "projects/analytics/src/main/java/com/opengamma/analytics/financial/interestrate/payments/provider/CouponIborSpreadDiscountingMethod.java",
"license": "apache-2.0",
"size": 8843
}
|
[
"com.opengamma.analytics.financial.instrument.index.IborIndex",
"com.opengamma.analytics.financial.interestrate.payments.derivative.CouponIborSpread",
"com.opengamma.analytics.financial.provider.description.interestrate.MulticurveProviderInterface",
"com.opengamma.util.ArgumentChecker",
"com.opengamma.util.money.MultipleCurrencyAmount"
] |
import com.opengamma.analytics.financial.instrument.index.IborIndex; import com.opengamma.analytics.financial.interestrate.payments.derivative.CouponIborSpread; import com.opengamma.analytics.financial.provider.description.interestrate.MulticurveProviderInterface; import com.opengamma.util.ArgumentChecker; import com.opengamma.util.money.MultipleCurrencyAmount;
|
import com.opengamma.analytics.financial.instrument.index.*; import com.opengamma.analytics.financial.interestrate.payments.derivative.*; import com.opengamma.analytics.financial.provider.description.interestrate.*; import com.opengamma.util.*; import com.opengamma.util.money.*;
|
[
"com.opengamma.analytics",
"com.opengamma.util"
] |
com.opengamma.analytics; com.opengamma.util;
| 1,377,522
|
public static String[] qAnalyze(final String q, final Analyzer analyzer) throws IOException
{
// create an arrayList on each query and let gc works
ArrayList<String> terms = new ArrayList<String>();
// what should mean null here ?
if (q == null || "".equals(q.trim())) return null;
TokenStream ts = analyzer.tokenStream(AlixReuseStrategy.QUERY, q); // keep punctuation to group terms
CharTermAttribute token = ts.addAttribute(CharTermAttribute.class);
// not generic for other analyzers but may become interesting for a query parser
// CharsLemAtt lem = ts.addAttribute(CharsLemAtt.class);
// FlagsAttribute flags = ts.addAttribute(FlagsAttribute.class);
ts.reset();
try {
while (ts.incrementToken()) {
// a negation term
if (token.charAt(0) == '-') continue;
String word;
if (token.charAt(0) == '+') {
word = token.subSequence(1, token.length()).toString();
}
else {
word = token.toString();
}
if (",".equals(word) || ";".equals(word)) {
// terms.add(null);
continue;
}
terms.add(word);
}
ts.end();
}
finally {
ts.close();
}
return terms.toArray(new String[terms.size()]);
}
|
static String[] function(final String q, final Analyzer analyzer) throws IOException { ArrayList<String> terms = new ArrayList<String>(); if (q == null STR,STR;".equals(word)) { continue; } terms.add(word); } ts.end(); } finally { ts.close(); } return terms.toArray(new String[terms.size()]); }
|
/**
* Analyze a query according to the current analyzer of this base ; return terms
*
* @param q
* @param fieldName
* @return
* @throws IOException
*/
|
Analyze a query according to the current analyzer of this base ; return terms
|
qAnalyze
|
{
"repo_name": "oeuvres/Alix",
"path": "java/alix/lucene/Alix.java",
"license": "apache-2.0",
"size": 28376
}
|
[
"java.io.IOException",
"java.util.ArrayList",
"org.apache.lucene.analysis.Analyzer"
] |
import java.io.IOException; import java.util.ArrayList; import org.apache.lucene.analysis.Analyzer;
|
import java.io.*; import java.util.*; import org.apache.lucene.analysis.*;
|
[
"java.io",
"java.util",
"org.apache.lucene"
] |
java.io; java.util; org.apache.lucene;
| 882,019
|
String type = null;
String property = data.getAttributeString("property");
if ("application".equalsIgnoreCase(property)) {
type = "javax.servlet.ServletContext";
} else if ("config".equalsIgnoreCase(property)) {
type = "javax.servlet.ServletConfig";
} else if ("request".equalsIgnoreCase(property)) {
type = "javax.servlet.ServletRequest";
} else if ("response".equalsIgnoreCase(property)) {
type = "javax.servlet.ServletResponse";
} else if ("session".equalsIgnoreCase(property)) {
type = "javax.servlet.http.HttpSession";
} else {
type = "java.lang.Object";
}
return new VariableInfo[] {
new VariableInfo(data.getAttributeString("id"), type, true,
VariableInfo.AT_BEGIN)
};
}
|
String type = null; String property = data.getAttributeString(STR); if (STR.equalsIgnoreCase(property)) { type = STR; } else if (STR.equalsIgnoreCase(property)) { type = STR; } else if (STR.equalsIgnoreCase(property)) { type = STR; } else if (STR.equalsIgnoreCase(property)) { type = STR; } else if (STR.equalsIgnoreCase(property)) { type = STR; } else { type = STR; } return new VariableInfo[] { new VariableInfo(data.getAttributeString("id"), type, true, VariableInfo.AT_BEGIN) }; }
|
/**
* Return information about the scripting variables to be created.
*/
|
Return information about the scripting variables to be created
|
getVariableInfo
|
{
"repo_name": "lbndev/sonarqube",
"path": "tests/upgrade/projects/struts-1.3.9-diet/taglib/src/main/java/org/apache/struts/taglib/bean/PageTei.java",
"license": "lgpl-3.0",
"size": 2340
}
|
[
"javax.servlet.jsp.tagext.VariableInfo"
] |
import javax.servlet.jsp.tagext.VariableInfo;
|
import javax.servlet.jsp.tagext.*;
|
[
"javax.servlet"
] |
javax.servlet;
| 1,686,012
|
//-------------------------------------------------------------------------
@Override
public UniqueId getParentNodeId() {
return _parentNodeId;
}
|
UniqueId function() { return _parentNodeId; }
|
/**
* Gets the unique identifier of the parent node, null if this is a root node.
*
* @return the unique identifier, null if root node
*/
|
Gets the unique identifier of the parent node, null if this is a root node
|
getParentNodeId
|
{
"repo_name": "McLeodMoores/starling",
"path": "projects/core/src/main/java/com/opengamma/core/position/impl/SimplePortfolioNode.java",
"license": "apache-2.0",
"size": 14221
}
|
[
"com.opengamma.id.UniqueId"
] |
import com.opengamma.id.UniqueId;
|
import com.opengamma.id.*;
|
[
"com.opengamma.id"
] |
com.opengamma.id;
| 2,512,080
|
@Test
public void connectSSLWithValidationProperCertString() throws SQLException, IOException {
Properties info = new Properties();
info.setProperty("ssl", "true");
info.setProperty("sslfactory", "org.postgresql.ssl.SingleCertValidatingFactory");
info.setProperty("sslfactoryarg", getGoodServerCert());
testConnect(info, true);
}
|
void function() throws SQLException, IOException { Properties info = new Properties(); info.setProperty("ssl", "true"); info.setProperty(STR, STR); info.setProperty(STR, getGoodServerCert()); testConnect(info, true); }
|
/**
* Connect using SSL and attempt to validate the server's certificate against the proper pre
* shared certificate. The certificate is specified as a String (eg. the "----- BEGIN CERTIFICATE
* ----- ... etc").
*/
|
Connect using SSL and attempt to validate the server's certificate against the proper pre shared certificate. The certificate is specified as a String (eg. the "----- BEGIN CERTIFICATE ----- ... etc")
|
connectSSLWithValidationProperCertString
|
{
"repo_name": "golovnin/pgjdbc",
"path": "pgjdbc/src/test/java/org/postgresql/test/ssl/SingleCertValidatingFactoryTestSuite.java",
"license": "bsd-2-clause",
"size": 13596
}
|
[
"java.io.IOException",
"java.sql.SQLException",
"java.util.Properties"
] |
import java.io.IOException; import java.sql.SQLException; import java.util.Properties;
|
import java.io.*; import java.sql.*; import java.util.*;
|
[
"java.io",
"java.sql",
"java.util"
] |
java.io; java.sql; java.util;
| 100,048
|
ConfigGroup getConfigGroupsById(Long configId);
|
ConfigGroup getConfigGroupsById(Long configId);
|
/**
* Find config group by config group id
* @param configId id of config group to return
* @return config group
*/
|
Find config group by config group id
|
getConfigGroupsById
|
{
"repo_name": "sekikn/ambari",
"path": "ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java",
"license": "apache-2.0",
"size": 24252
}
|
[
"org.apache.ambari.server.state.configgroup.ConfigGroup"
] |
import org.apache.ambari.server.state.configgroup.ConfigGroup;
|
import org.apache.ambari.server.state.configgroup.*;
|
[
"org.apache.ambari"
] |
org.apache.ambari;
| 860,447
|
private Object readResolve() throws ObjectStreamException {
if (this.equals(AxisLocation.TOP_OR_RIGHT)) {
return AxisLocation.TOP_OR_RIGHT;
}
else if (this.equals(AxisLocation.BOTTOM_OR_RIGHT)) {
return AxisLocation.BOTTOM_OR_RIGHT;
}
else if (this.equals(AxisLocation.TOP_OR_LEFT)) {
return AxisLocation.TOP_OR_LEFT;
}
else if (this.equals(AxisLocation.BOTTOM_OR_LEFT)) {
return AxisLocation.BOTTOM_OR_LEFT;
}
return null;
}
|
Object function() throws ObjectStreamException { if (this.equals(AxisLocation.TOP_OR_RIGHT)) { return AxisLocation.TOP_OR_RIGHT; } else if (this.equals(AxisLocation.BOTTOM_OR_RIGHT)) { return AxisLocation.BOTTOM_OR_RIGHT; } else if (this.equals(AxisLocation.TOP_OR_LEFT)) { return AxisLocation.TOP_OR_LEFT; } else if (this.equals(AxisLocation.BOTTOM_OR_LEFT)) { return AxisLocation.BOTTOM_OR_LEFT; } return null; }
|
/**
* Ensures that serialization returns the unique instances.
*
* @return The object.
*
* @throws ObjectStreamException if there is a problem.
*/
|
Ensures that serialization returns the unique instances
|
readResolve
|
{
"repo_name": "apetresc/JFreeChart",
"path": "src/main/java/org/jfree/chart/axis/AxisLocation.java",
"license": "lgpl-2.1",
"size": 6000
}
|
[
"java.io.ObjectStreamException"
] |
import java.io.ObjectStreamException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 25,336
|
private InstrumentationSource getInstrumentationSource(String source){
if(OPMConstants.SOURCE_AUDIT_SYSCALL.equals(source)
|| OPMConstants.SOURCE_AUDIT_NETFILTER.equals(source)){
// TODO Use the 'netfilter' source value when added in CDM
return InstrumentationSource.SOURCE_LINUX_AUDIT_TRACE;
}else if(OPMConstants.SOURCE_PROCFS.equals(source)){
return InstrumentationSource.SOURCE_LINUX_PROC_TRACE;
}else if(OPMConstants.SOURCE_BEEP.equals(source)){
return InstrumentationSource.SOURCE_LINUX_BEEP_TRACE;
}else{
logger.log(Level.WARNING,
"Unexpected source: {0}", new Object[]{source});
}
return null;
}
|
InstrumentationSource function(String source){ if(OPMConstants.SOURCE_AUDIT_SYSCALL.equals(source) OPMConstants.SOURCE_AUDIT_NETFILTER.equals(source)){ return InstrumentationSource.SOURCE_LINUX_AUDIT_TRACE; }else if(OPMConstants.SOURCE_PROCFS.equals(source)){ return InstrumentationSource.SOURCE_LINUX_PROC_TRACE; }else if(OPMConstants.SOURCE_BEEP.equals(source)){ return InstrumentationSource.SOURCE_LINUX_BEEP_TRACE; }else{ logger.log(Level.WARNING, STR, new Object[]{source}); } return null; }
|
/**
* Returns the CDM object for the source annotation
* Null if none matched
*
* @param source allowed values listed in OPMConstants class
* @return InstrumentationSource instance or null
*/
|
Returns the CDM object for the source annotation Null if none matched
|
getInstrumentationSource
|
{
"repo_name": "sranasir/SPADE",
"path": "src/spade/storage/CDM.java",
"license": "gpl-3.0",
"size": 55396
}
|
[
"com.bbn.tc.schema.avro.InstrumentationSource",
"java.util.logging.Level"
] |
import com.bbn.tc.schema.avro.InstrumentationSource; import java.util.logging.Level;
|
import com.bbn.tc.schema.avro.*; import java.util.logging.*;
|
[
"com.bbn.tc",
"java.util"
] |
com.bbn.tc; java.util;
| 2,175,859
|
@ServiceMethod(returns = ReturnType.SINGLE)
Mono<PublicIpPrefixInner> getByResourceGroupAsync(
String resourceGroupName, String publicIpPrefixName, String expand);
|
@ServiceMethod(returns = ReturnType.SINGLE) Mono<PublicIpPrefixInner> getByResourceGroupAsync( String resourceGroupName, String publicIpPrefixName, String expand);
|
/**
* Gets the specified public IP prefix in a specified resource group.
*
* @param resourceGroupName The name of the resource group.
* @param publicIpPrefixName The name of the public IP prefix.
* @param expand Expands referenced resources.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the specified public IP prefix in a specified resource group on successful completion of {@link Mono}.
*/
|
Gets the specified public IP prefix in a specified resource group
|
getByResourceGroupAsync
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/PublicIpPrefixesClient.java",
"license": "mit",
"size": 24606
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.resourcemanager.network.fluent.models.PublicIpPrefixInner"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.network.fluent.models.PublicIpPrefixInner;
|
import com.azure.core.annotation.*; import com.azure.resourcemanager.network.fluent.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 2,452,625
|
@Override
public String toString() {
return "Immortal Durable Good Decay Characteristic.";
}
}
static final class ExponentialLoss implements DurableGoodsDecayCharacteristic {
private double
multiplier;
public ExponentialLoss(final double loss) {
Preconditions.checkArgument(loss >= 0.);
Preconditions.checkArgument(loss <= 1.);
this.multiplier = 1. - loss;
}
|
String function() { return STR; } } static final class ExponentialLoss implements DurableGoodsDecayCharacteristic { private double multiplier; public ExponentialLoss(final double loss) { Preconditions.checkArgument(loss >= 0.); Preconditions.checkArgument(loss <= 1.); this.multiplier = 1. - loss; }
|
/**
* Returns a brief description of this object. The exact details of the
* string are subject to change, and should not be regarded as fixed.
*/
|
Returns a brief description of this object. The exact details of the string are subject to change, and should not be regarded as fixed
|
toString
|
{
"repo_name": "crisis-economics/CRISIS",
"path": "CRISIS/src/eu/crisis_economics/abm/inventory/goods/DurableGoodsDecayCharacteristic.java",
"license": "gpl-3.0",
"size": 4421
}
|
[
"com.google.common.base.Preconditions"
] |
import com.google.common.base.Preconditions;
|
import com.google.common.base.*;
|
[
"com.google.common"
] |
com.google.common;
| 471,234
|
PagedIterable<MaintenanceConfiguration> list();
|
PagedIterable<MaintenanceConfiguration> list();
|
/**
* Get Public Maintenance Configuration records.
*
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return public Maintenance Configuration records.
*/
|
Get Public Maintenance Configuration records
|
list
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/PublicMaintenanceConfigurations.java",
"license": "mit",
"size": 2629
}
|
[
"com.azure.core.http.rest.PagedIterable"
] |
import com.azure.core.http.rest.PagedIterable;
|
import com.azure.core.http.rest.*;
|
[
"com.azure.core"
] |
com.azure.core;
| 1,775,967
|
public void testRestore(final Path snapshotDir, final String sourceTableName,
final HTableDescriptor htdClone) throws IOException {
LOG.debug("pre-restore table=" + htdClone.getNameAsString() + " snapshot=" + snapshotDir);
FSUtils.logFileSystemState(fs, rootDir, LOG);
FSTableDescriptors.createTableDescriptor(htdClone, conf);
RestoreSnapshotHelper helper = getRestoreHelper(rootDir, snapshotDir, sourceTableName, htdClone);
helper.restoreHdfsRegions();
LOG.debug("post-restore table=" + htdClone.getNameAsString() + " snapshot=" + snapshotDir);
FSUtils.logFileSystemState(fs, rootDir, LOG);
}
|
void function(final Path snapshotDir, final String sourceTableName, final HTableDescriptor htdClone) throws IOException { LOG.debug(STR + htdClone.getNameAsString() + STR + snapshotDir); FSUtils.logFileSystemState(fs, rootDir, LOG); FSTableDescriptors.createTableDescriptor(htdClone, conf); RestoreSnapshotHelper helper = getRestoreHelper(rootDir, snapshotDir, sourceTableName, htdClone); helper.restoreHdfsRegions(); LOG.debug(STR + htdClone.getNameAsString() + STR + snapshotDir); FSUtils.logFileSystemState(fs, rootDir, LOG); }
|
/**
* Execute the restore operation
* @param snapshotDir The snapshot directory to use as "restore source"
* @param sourceTableName The name of the snapshotted table
* @param htdClone The HTableDescriptor of the table to restore/clone.
*/
|
Execute the restore operation
|
testRestore
|
{
"repo_name": "francisliu/hbase_namespace",
"path": "hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestRestoreSnapshotHelper.java",
"license": "apache-2.0",
"size": 8686
}
|
[
"java.io.IOException",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.hbase.HTableDescriptor",
"org.apache.hadoop.hbase.util.FSTableDescriptors",
"org.apache.hadoop.hbase.util.FSUtils"
] |
import java.io.IOException; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.util.FSTableDescriptors; import org.apache.hadoop.hbase.util.FSUtils;
|
import java.io.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.util.*;
|
[
"java.io",
"org.apache.hadoop"
] |
java.io; org.apache.hadoop;
| 393,729
|
protected void checkForMethodParameter(final UriComponentsBuilder uriBuilder, final HashMap<String, String> queryParams) {
webContext.getRequestParameter(CasProtocolConstants.PARAMETER_METHOD).ifPresent(methodParam -> {
LOGGER.debug("Processing method parameter [{}] with value [{}]",
CasProtocolConstants.PARAMETER_METHOD, methodParam);
uriBuilder.queryParam(CasProtocolConstants.PARAMETER_METHOD, "{method}");
queryParams.put("method", methodParam);
});
}
|
void function(final UriComponentsBuilder uriBuilder, final HashMap<String, String> queryParams) { webContext.getRequestParameter(CasProtocolConstants.PARAMETER_METHOD).ifPresent(methodParam -> { LOGGER.debug(STR, CasProtocolConstants.PARAMETER_METHOD, methodParam); uriBuilder.queryParam(CasProtocolConstants.PARAMETER_METHOD, STR); queryParams.put(STR, methodParam); }); }
|
/**
* Check for method parameter.
*
* @param uriBuilder the uri builder
* @param queryParams the query params
*/
|
Check for method parameter
|
checkForMethodParameter
|
{
"repo_name": "apereo/cas",
"path": "support/cas-server-support-pac4j-core/src/main/java/org/apereo/cas/web/DelegatedClientIdentityProviderConfigurationFactory.java",
"license": "apache-2.0",
"size": 6532
}
|
[
"java.util.HashMap",
"org.apereo.cas.CasProtocolConstants",
"org.springframework.web.util.UriComponentsBuilder"
] |
import java.util.HashMap; import org.apereo.cas.CasProtocolConstants; import org.springframework.web.util.UriComponentsBuilder;
|
import java.util.*; import org.apereo.cas.*; import org.springframework.web.util.*;
|
[
"java.util",
"org.apereo.cas",
"org.springframework.web"
] |
java.util; org.apereo.cas; org.springframework.web;
| 1,918,008
|
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedFlux<ListContainerItemInner> listAsync(
String resourceGroupName, String accountName, String maxpagesize, String filter, ListContainersInclude include);
|
@ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux<ListContainerItemInner> listAsync( String resourceGroupName, String accountName, String maxpagesize, String filter, ListContainersInclude include);
|
/**
* Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation
* token.
*
* @param resourceGroupName The name of the resource group within the user's subscription. The name is case
* insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage account names
* must be between 3 and 24 characters in length and use numbers and lower-case letters only.
* @param maxpagesize Optional. Specified maximum number of containers that can be included in the list.
* @param filter Optional. When specified, only container names starting with the filter will be listed.
* @param include Optional, used to include the properties for soft deleted blob containers.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response schema as paginated response with {@link PagedFlux}.
*/
|
Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token
|
listAsync
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/BlobContainersClient.java",
"license": "mit",
"size": 104918
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.PagedFlux",
"com.azure.resourcemanager.storage.fluent.models.ListContainerItemInner",
"com.azure.resourcemanager.storage.models.ListContainersInclude"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedFlux; import com.azure.resourcemanager.storage.fluent.models.ListContainerItemInner; import com.azure.resourcemanager.storage.models.ListContainersInclude;
|
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.resourcemanager.storage.fluent.models.*; import com.azure.resourcemanager.storage.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 32,753
|
public final void setXScaleID(String scaleId) {
// checks if scale id is valid
ScaleId.checkIfValid(scaleId);
// stores it
setValue(Property.X_SCALE_ID, scaleId);
}
|
final void function(String scaleId) { ScaleId.checkIfValid(scaleId); setValue(Property.X_SCALE_ID, scaleId); }
|
/**
* Sets the ID of the X scale to bind onto.
*
* @param scaleId the ID of the X scale to bind onto
*/
|
Sets the ID of the X scale to bind onto
|
setXScaleID
|
{
"repo_name": "pepstock-org/Charba",
"path": "src/org/pepstock/charba/client/annotation/AbstractAnnotation.java",
"license": "apache-2.0",
"size": 41191
}
|
[
"org.pepstock.charba.client.options.ScaleId"
] |
import org.pepstock.charba.client.options.ScaleId;
|
import org.pepstock.charba.client.options.*;
|
[
"org.pepstock.charba"
] |
org.pepstock.charba;
| 1,030,148
|
@Override
public ResidueSolvablePolynomial<C> multiply(SolvableResidue<C> b, ExpVector e, SolvableResidue<C> c,
ExpVector f) {
if (b == null || b.isZERO()) {
return ring.getZERO();
}
if (c == null || c.isZERO()) {
return ring.getZERO();
}
ResidueSolvablePolynomial<C> Cp = new ResidueSolvablePolynomial<C>(ring, b, e);
ResidueSolvablePolynomial<C> Dp = new ResidueSolvablePolynomial<C>(ring, c, f);
return multiply(Cp, Dp);
}
|
ResidueSolvablePolynomial<C> function(SolvableResidue<C> b, ExpVector e, SolvableResidue<C> c, ExpVector f) { if (b == null b.isZERO()) { return ring.getZERO(); } if (c == null c.isZERO()) { return ring.getZERO(); } ResidueSolvablePolynomial<C> Cp = new ResidueSolvablePolynomial<C>(ring, b, e); ResidueSolvablePolynomial<C> Dp = new ResidueSolvablePolynomial<C>(ring, c, f); return multiply(Cp, Dp); }
|
/**
* ResidueSolvablePolynomial left and right multiplication. Product with
* ring element and exponent vector.
* @param b coefficient polynomial.
* @param e exponent.
* @param c coefficient polynomial.
* @param f exponent.
* @return b x<sup>e</sup> * this * c x<sup>f</sup>, where * denotes
* solvable multiplication.
*/
|
ResidueSolvablePolynomial left and right multiplication. Product with ring element and exponent vector
|
multiply
|
{
"repo_name": "breandan/java-algebra-system",
"path": "src/edu/jas/application/ResidueSolvablePolynomial.java",
"license": "gpl-2.0",
"size": 20329
}
|
[
"edu.jas.poly.ExpVector"
] |
import edu.jas.poly.ExpVector;
|
import edu.jas.poly.*;
|
[
"edu.jas.poly"
] |
edu.jas.poly;
| 2,586,453
|
void onAudioTrackInitializationError(AudioTrack.InitializationException e);
|
void onAudioTrackInitializationError(AudioTrack.InitializationException e);
|
/**
* Invoked when the {@link AudioTrack} fails to initialize.
*
* @param e The corresponding exception.
*/
|
Invoked when the <code>AudioTrack</code> fails to initialize
|
onAudioTrackInitializationError
|
{
"repo_name": "pittenga/ExoPlayer",
"path": "extensions/opus/src/main/java/com/google/android/exoplayer/ext/opus/LibopusAudioTrackRenderer.java",
"license": "apache-2.0",
"size": 12338
}
|
[
"com.google.android.exoplayer.audio.AudioTrack"
] |
import com.google.android.exoplayer.audio.AudioTrack;
|
import com.google.android.exoplayer.audio.*;
|
[
"com.google.android"
] |
com.google.android;
| 403,840
|
DoubleIterator getUidxVs(final int uidx);
|
DoubleIterator getUidxVs(final int uidx);
|
/**
* Returns the item values of the preferences of a user.
*
* @param uidx user index
* @return iterator of the values of the items
*/
|
Returns the item values of the preferences of a user
|
getUidxVs
|
{
"repo_name": "RankSys/RankSys",
"path": "RankSys-fast/src/main/java/es/uam/eps/ir/ranksys/fast/preference/FastPreferenceData.java",
"license": "mpl-2.0",
"size": 3399
}
|
[
"it.unimi.dsi.fastutil.doubles.DoubleIterator"
] |
import it.unimi.dsi.fastutil.doubles.DoubleIterator;
|
import it.unimi.dsi.fastutil.doubles.*;
|
[
"it.unimi.dsi"
] |
it.unimi.dsi;
| 1,641,659
|
if (isInited) return (Socialnetwork_many_onePackage)EPackage.Registry.INSTANCE.getEPackage(Socialnetwork_many_onePackage.eNS_URI);
// Obtain or create and register package
Socialnetwork_many_onePackageImpl theSocialnetwork_many_onePackage = (Socialnetwork_many_onePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof Socialnetwork_many_onePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new Socialnetwork_many_onePackageImpl());
isInited = true;
// Create package meta-data objects
theSocialnetwork_many_onePackage.createPackageContents();
// Initialize created meta-data
theSocialnetwork_many_onePackage.initializePackageContents();
// Mark meta-data to indicate it can't be changed
theSocialnetwork_many_onePackage.freeze();
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(Socialnetwork_many_onePackage.eNS_URI, theSocialnetwork_many_onePackage);
return theSocialnetwork_many_onePackage;
}
|
if (isInited) return (Socialnetwork_many_onePackage)EPackage.Registry.INSTANCE.getEPackage(Socialnetwork_many_onePackage.eNS_URI); Socialnetwork_many_onePackageImpl theSocialnetwork_many_onePackage = (Socialnetwork_many_onePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof Socialnetwork_many_onePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new Socialnetwork_many_onePackageImpl()); isInited = true; theSocialnetwork_many_onePackage.createPackageContents(); theSocialnetwork_many_onePackage.initializePackageContents(); theSocialnetwork_many_onePackage.freeze(); EPackage.Registry.INSTANCE.put(Socialnetwork_many_onePackage.eNS_URI, theSocialnetwork_many_onePackage); return theSocialnetwork_many_onePackage; }
|
/**
* Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
*
* <p>This method is used to initialize {@link Socialnetwork_many_onePackage#eINSTANCE} when that field is accessed.
* Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #eNS_URI
* @see #createPackageContents()
* @see #initializePackageContents()
* @generated
*/
|
Creates, registers, and initializes the Package for this model, and for any others upon which it depends. This method is used to initialize <code>Socialnetwork_many_onePackage#eINSTANCE</code> when that field is accessed. Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
|
init
|
{
"repo_name": "FTSRG/iq-sirius-integration",
"path": "host/org.eclipse.incquery.viewmodel.sirius.example.socialnetwork.models/src/socialnetwork_many_one/impl/Socialnetwork_many_onePackageImpl.java",
"license": "epl-1.0",
"size": 6850
}
|
[
"org.eclipse.emf.ecore.EPackage"
] |
import org.eclipse.emf.ecore.EPackage;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 1,244,953
|
private WebElement getContactButton() {
return driver.findElement(By.id("userForm:contactButton"));
}
|
WebElement function() { return driver.findElement(By.id(STR)); }
|
/**
* Get "contactButton" button
*
* @return WebElement for button
*/
|
Get "contactButton" button
|
getContactButton
|
{
"repo_name": "chr-krenn/fhj-ws2015-sd13-pse",
"path": "pse/src/test/selenium/at/fhj/swd13/pse/test/gui/pageobjects/UserPage.java",
"license": "mit",
"size": 10727
}
|
[
"org.openqa.selenium.By",
"org.openqa.selenium.WebElement"
] |
import org.openqa.selenium.By; import org.openqa.selenium.WebElement;
|
import org.openqa.selenium.*;
|
[
"org.openqa.selenium"
] |
org.openqa.selenium;
| 2,061,314
|
public void writeFile(String filename) {
String cadenaSalida = new String("");
cadenaSalida = printString();
Files.writeFile(filename, cadenaSalida);
}
|
void function(String filename) { String cadenaSalida = new String(""); cadenaSalida = printString(); Files.writeFile(filename, cadenaSalida); }
|
/**
* It writes the Data Base into an output file
* @param filename String the name of the output file
*/
|
It writes the Data Base into an output file
|
writeFile
|
{
"repo_name": "TheMurderer/keel",
"path": "src/keel/Algorithms/Fuzzy_Rule_Learning/Genetic/Fuzzy_Ish_Hybrid/DataBase.java",
"license": "gpl-3.0",
"size": 9264
}
|
[
"org.core.Files"
] |
import org.core.Files;
|
import org.core.*;
|
[
"org.core"
] |
org.core;
| 419,914
|
public JobflowArtifact compile(BatchInfo batch, Jobflow jobflow) throws IOException {
Batch dummy = new Batch(batch);
dummy.addElement(jobflow);
BatchArtifact parent = compile(dummy);
JobflowArtifact result = parent.findJobflow(jobflow.getFlowId());
assert result != null;
return result;
}
|
JobflowArtifact function(BatchInfo batch, Jobflow jobflow) throws IOException { Batch dummy = new Batch(batch); dummy.addElement(jobflow); BatchArtifact parent = compile(dummy); JobflowArtifact result = parent.findJobflow(jobflow.getFlowId()); assert result != null; return result; }
|
/**
* Compiles the target jobflow.
* @param batch the structural information of a container batch
* @param jobflow the target jobflow
* @return the compilation result
* @throws IOException if failed to prepare the compilation environment
* @throws DiagnosticException if failed to compile the target jobflow
*/
|
Compiles the target jobflow
|
compile
|
{
"repo_name": "asakusafw/asakusafw-compiler",
"path": "compiler-project/tester/src/main/java/com/asakusafw/lang/compiler/tester/CompilerTester.java",
"license": "apache-2.0",
"size": 14055
}
|
[
"com.asakusafw.lang.compiler.model.graph.Batch",
"com.asakusafw.lang.compiler.model.graph.Jobflow",
"com.asakusafw.lang.compiler.model.info.BatchInfo",
"java.io.IOException"
] |
import com.asakusafw.lang.compiler.model.graph.Batch; import com.asakusafw.lang.compiler.model.graph.Jobflow; import com.asakusafw.lang.compiler.model.info.BatchInfo; import java.io.IOException;
|
import com.asakusafw.lang.compiler.model.graph.*; import com.asakusafw.lang.compiler.model.info.*; import java.io.*;
|
[
"com.asakusafw.lang",
"java.io"
] |
com.asakusafw.lang; java.io;
| 2,262,013
|
public static List<String> toList(CharSequence self) {
String s = self.toString();
int size = s.length();
List<String> answer = new ArrayList<String>(size);
for (int i = 0; i < size; i++) {
answer.add(s.substring(i, i + 1));
}
return answer;
}
|
static List<String> function(CharSequence self) { String s = self.toString(); int size = s.length(); List<String> answer = new ArrayList<String>(size); for (int i = 0; i < size; i++) { answer.add(s.substring(i, i + 1)); } return answer; }
|
/**
* Converts the given CharSequence into a List of Strings of one character.
*
* @param self a CharSequence
* @return a List of characters (a 1-character String)
* @see #toSet(String)
* @since 1.8.2
*/
|
Converts the given CharSequence into a List of Strings of one character
|
toList
|
{
"repo_name": "OpenBEL/kam-nav",
"path": "tools/groovy/src/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java",
"license": "apache-2.0",
"size": 132600
}
|
[
"java.util.ArrayList",
"java.util.List"
] |
import java.util.ArrayList; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,426,809
|
public static Control getControl(final QTIObject object) {
Control control = null;
List controls = null;
if (Item.class.isAssignableFrom(object.getClass())) {
final Item item = (Item) object;
controls = item.getItemcontrols();
} else if (Section.class.isAssignableFrom(object.getClass())) {
final Section section = (Section) object;
controls = section.getSectioncontrols();
} else if (Assessment.class.isAssignableFrom(object.getClass())) {
final Assessment assessment = (Assessment) object;
controls = assessment.getAssessmentcontrols();
}
for (final Iterator i = controls.iterator(); i.hasNext();) {
final Control tmp = (Control) i.next();
if (tmp.getView() != null) {
if (tmp.getView().equalsIgnoreCase("all")) {
control = tmp;
break;
}
} else {
control = tmp;
}
}
return control;
}
|
static Control function(final QTIObject object) { Control control = null; List controls = null; if (Item.class.isAssignableFrom(object.getClass())) { final Item item = (Item) object; controls = item.getItemcontrols(); } else if (Section.class.isAssignableFrom(object.getClass())) { final Section section = (Section) object; controls = section.getSectioncontrols(); } else if (Assessment.class.isAssignableFrom(object.getClass())) { final Assessment assessment = (Assessment) object; controls = assessment.getAssessmentcontrols(); } for (final Iterator i = controls.iterator(); i.hasNext();) { final Control tmp = (Control) i.next(); if (tmp.getView() != null) { if (tmp.getView().equalsIgnoreCase("all")) { control = tmp; break; } } else { control = tmp; } } return control; }
|
/**
* Get controls.
*
* @param object
* @return Controls.
*/
|
Get controls
|
getControl
|
{
"repo_name": "huihoo/olat",
"path": "OLAT-LMS/src/main/java/org/olat/lms/ims/qti/editor/QTIEditHelperEBL.java",
"license": "apache-2.0",
"size": 35428
}
|
[
"java.util.Iterator",
"java.util.List",
"org.olat.lms.ims.qti.objects.Assessment",
"org.olat.lms.ims.qti.objects.Control",
"org.olat.lms.ims.qti.objects.Item",
"org.olat.lms.ims.qti.objects.QTIObject",
"org.olat.lms.ims.qti.objects.Section"
] |
import java.util.Iterator; import java.util.List; import org.olat.lms.ims.qti.objects.Assessment; import org.olat.lms.ims.qti.objects.Control; import org.olat.lms.ims.qti.objects.Item; import org.olat.lms.ims.qti.objects.QTIObject; import org.olat.lms.ims.qti.objects.Section;
|
import java.util.*; import org.olat.lms.ims.qti.objects.*;
|
[
"java.util",
"org.olat.lms"
] |
java.util; org.olat.lms;
| 1,654,932
|
public static EntityPhoneBo from(EntityPhone immutable) {
if (immutable == null) {
return null;
}
EntityPhoneBo bo = new EntityPhoneBo();
bo.setId(immutable.getId());
bo.setActive(immutable.isActive());
bo.setEntityId(immutable.getEntityId());
bo.setEntityTypeCode(immutable.getEntityTypeCode());
if (immutable.getPhoneType() != null) {
bo.setPhoneTypeCode(immutable.getPhoneType().getCode());
}
bo.setPhoneType(EntityPhoneTypeBo.from(immutable.getPhoneType()));
bo.setDefaultValue(immutable.isDefaultValue());
bo.setCountryCode(immutable.getCountryCodeUnmasked());
bo.setPhoneNumber(immutable.getPhoneNumberUnmasked());
bo.setExtensionNumber(immutable.getExtensionNumberUnmasked());
bo.setVersionNumber(immutable.getVersionNumber());
bo.setObjectId(immutable.getObjectId());
return bo;
}
|
static EntityPhoneBo function(EntityPhone immutable) { if (immutable == null) { return null; } EntityPhoneBo bo = new EntityPhoneBo(); bo.setId(immutable.getId()); bo.setActive(immutable.isActive()); bo.setEntityId(immutable.getEntityId()); bo.setEntityTypeCode(immutable.getEntityTypeCode()); if (immutable.getPhoneType() != null) { bo.setPhoneTypeCode(immutable.getPhoneType().getCode()); } bo.setPhoneType(EntityPhoneTypeBo.from(immutable.getPhoneType())); bo.setDefaultValue(immutable.isDefaultValue()); bo.setCountryCode(immutable.getCountryCodeUnmasked()); bo.setPhoneNumber(immutable.getPhoneNumberUnmasked()); bo.setExtensionNumber(immutable.getExtensionNumberUnmasked()); bo.setVersionNumber(immutable.getVersionNumber()); bo.setObjectId(immutable.getObjectId()); return bo; }
|
/**
* Creates a CountryBo business object from an immutable representation of a Country.
*
* @param immutable immutable Country
* @return a CountryBo
*/
|
Creates a CountryBo business object from an immutable representation of a Country
|
from
|
{
"repo_name": "mztaylor/rice-git",
"path": "rice-middleware/kim/kim-impl/src/main/java/org/kuali/rice/kim/impl/identity/phone/EntityPhoneBo.java",
"license": "apache-2.0",
"size": 3286
}
|
[
"org.kuali.rice.kim.api.identity.phone.EntityPhone"
] |
import org.kuali.rice.kim.api.identity.phone.EntityPhone;
|
import org.kuali.rice.kim.api.identity.phone.*;
|
[
"org.kuali.rice"
] |
org.kuali.rice;
| 2,197,748
|
public List<AnnotatedField> getFields(String fieldName) {
final List<AnnotatedField> fieldList = fieldMap.get(fieldName);
if (fieldList != null) {
return Collections.unmodifiableList(fieldList);
}
return Collections.emptyList();
}
|
List<AnnotatedField> function(String fieldName) { final List<AnnotatedField> fieldList = fieldMap.get(fieldName); if (fieldList != null) { return Collections.unmodifiableList(fieldList); } return Collections.emptyList(); }
|
/**
* Gets the field-values of a given field.
*
* @param fieldName the name of the wanted field.
*
* @return an unmodifiable list of field-values. This method <i>never</i> returns <tt>null</tt>.
*/
|
Gets the field-values of a given field
|
getFields
|
{
"repo_name": "kolstae/openpipe",
"path": "openpipe-core/src/main/java/no/trank/openpipe/api/document/Document.java",
"license": "apache-2.0",
"size": 10501
}
|
[
"java.util.Collections",
"java.util.List"
] |
import java.util.Collections; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 273,434
|
public ApiResponse getLastTrades(CurrencyPair pair);
|
ApiResponse function(CurrencyPair pair);
|
/**
* Get the last trades associated with the account. The range of time
* depends on the exchange's default range
*
* @param pair pair.orderCurrency is the currency on order and
* pair.paymentCurrency is unit for its payment/redeem
* @return an ApiResponse object with an array of Trades
*/
|
Get the last trades associated with the account. The range of time depends on the exchange's default range
|
getLastTrades
|
{
"repo_name": "inuitwallet/plunge",
"path": "client/nubot/res/sources/src/com/nubits/nubot/trading/TradeInterface.java",
"license": "mit",
"size": 9348
}
|
[
"com.nubits.nubot.models.ApiResponse",
"com.nubits.nubot.models.CurrencyPair"
] |
import com.nubits.nubot.models.ApiResponse; import com.nubits.nubot.models.CurrencyPair;
|
import com.nubits.nubot.models.*;
|
[
"com.nubits.nubot"
] |
com.nubits.nubot;
| 1,096,758
|
private void lowLevelProcessAvlReport(AvlReport avlReport,
boolean rescursiveCall) {
// Determine previous state of vehicle
String vehicleId = avlReport.getVehicleId();
VehicleState vehicleState = VehicleStateManager.getInstance()
.getVehicleState(vehicleId);
// Since modifying the VehicleState should synchronize in case another
// thread simultaneously processes data for the same vehicle. This
// would be extremely rare but need to be safe.
synchronized (vehicleState) {
// Keep track of last AvlReport even if vehicle not predictable.
vehicleState.setAvlReport(avlReport);
// If part of consist and shouldn't be generating predictions
// and such and shouldn't grab assignment the simply return
// not that the last AVL report has been set for the vehicle.
if (avlReport.ignoreBecauseInConsist()) {
return;
}
// Do the matching depending on the old and the new assignment
// for the vehicle.
boolean matchAlreadyPredictableVehicle =
vehicleState.isPredictable()
&& !vehicleState.hasNewAssignment(avlReport);
boolean matchToNewAssignment = avlReport.hasValidAssignment()
&& (!vehicleState.isPredictable() || vehicleState
.hasNewAssignment(avlReport))
&& !vehicleState.previousAssignmentProblematic(avlReport);
if (matchAlreadyPredictableVehicle) {
// Vehicle was already assigned and assignment hasn't
// changed so update the match of where the vehicle is
// within the assignment.
matchNewFixForPredictableVehicle(vehicleState);
} else if (matchToNewAssignment) {
// New assignment so match the vehicle to it
matchVehicleToAssignment(vehicleState);
} else {
// Handle bad assignment where don't have assignment or such.
// Will try auto assigning a vehicle if that feature is enabled.
handleProblemAssignment(vehicleState);
}
// If the last match is actually valid then generate associated
// data like predictions and arrival/departure times.
if (vehicleState.isPredictable() && vehicleState.lastMatchIsValid()) {
// Reset the counter
vehicleState.setBadAssignmentsInARow(0);
// If vehicle is delayed as indicated by not making forward
// progress then store that in the vehicle state
handlePossibleVehicleDelay(vehicleState);
// Determine and store the schedule adherence. If schedule
// adherence is bad then try matching vehicle to assignment
// again. This can make vehicle unpredictable if can't match
// vehicle to assignment.
checkScheduleAdherence(vehicleState);
// Only continue processing if vehicle is still predictable
// since calling checkScheduleAdherence() can make it
// unpredictable if schedule adherence is really bad.
if (vehicleState.isPredictable()) {
// Generates the corresponding data for the vehicle such as
// predictions and arrival times
MatchProcessor.getInstance().generateResultsOfMatch(
vehicleState);
// If finished block assignment then should remove
// assignment
boolean endOfBlockReached = handlePossibleEndOfBlock(vehicleState);
// If just reached the end of the block and took the block
// assignment away and made the vehicle unpredictable then
// should see if the AVL report could be used to assign
// vehicle to the next assignment. This is needed for
// agencies like Zhengzhou which is frequency based and
// where each block assignment is only a single trip and
// when vehicle finishes one trip/block it can go into the
// next block right away.
if (endOfBlockReached) {
if (rescursiveCall) {
// This method was already called recursively which
// means unassigned vehicle at end of block but then
// it got assigned to end of block again. This
// indicates a bug since vehicles at end of block
// shouldn't be reassigned to the end of the block
// again. Therefore log problem and don't try to
// assign vehicle again.
logger.error(
"AvlProcessor.lowLevelProcessAvlReport() "
+ "called recursively, which is wrong. {}",
vehicleState);
} else {
// Actually process AVL report again to see if can
// assign to new assignment.
lowLevelProcessAvlReport(avlReport, true);
}
} // End of if end of block reached
}
}
// Now that VehicleState has been updated need to update the
// VehicleDataCache so that when data queried for API the proper
// info is provided.
VehicleDataCache.getInstance().updateVehicle(vehicleState);
// Write out current vehicle state to db so can join it with AVL
// data from db and get historical context of AVL report.
org.transitime.db.structs.VehicleState dbVehicleState =
new org.transitime.db.structs.VehicleState(vehicleState);
Core.getInstance().getDbLogger().add(dbVehicleState);
} // End of synchronizing on vehicleState }
}
|
void function(AvlReport avlReport, boolean rescursiveCall) { String vehicleId = avlReport.getVehicleId(); VehicleState vehicleState = VehicleStateManager.getInstance() .getVehicleState(vehicleId); synchronized (vehicleState) { vehicleState.setAvlReport(avlReport); if (avlReport.ignoreBecauseInConsist()) { return; } boolean matchAlreadyPredictableVehicle = vehicleState.isPredictable() && !vehicleState.hasNewAssignment(avlReport); boolean matchToNewAssignment = avlReport.hasValidAssignment() && (!vehicleState.isPredictable() vehicleState .hasNewAssignment(avlReport)) && !vehicleState.previousAssignmentProblematic(avlReport); if (matchAlreadyPredictableVehicle) { matchNewFixForPredictableVehicle(vehicleState); } else if (matchToNewAssignment) { matchVehicleToAssignment(vehicleState); } else { handleProblemAssignment(vehicleState); } if (vehicleState.isPredictable() && vehicleState.lastMatchIsValid()) { vehicleState.setBadAssignmentsInARow(0); handlePossibleVehicleDelay(vehicleState); checkScheduleAdherence(vehicleState); if (vehicleState.isPredictable()) { MatchProcessor.getInstance().generateResultsOfMatch( vehicleState); boolean endOfBlockReached = handlePossibleEndOfBlock(vehicleState); if (endOfBlockReached) { if (rescursiveCall) { logger.error( STR + STR, vehicleState); } else { lowLevelProcessAvlReport(avlReport, true); } } } } VehicleDataCache.getInstance().updateVehicle(vehicleState); org.transitime.db.structs.VehicleState dbVehicleState = new org.transitime.db.structs.VehicleState(vehicleState); Core.getInstance().getDbLogger().add(dbVehicleState); } }
|
/**
* Processes the AVL report by matching to the assignment and generating
* predictions and such. Sets VehicleState for the vehicle based on the
* results. Also stores AVL report into the database (if not in playback
* mode).
*
* @param avlReport
* The new AVL report to be processed
* @param rescursiveCall
* Set to true if this method is calling itself. Used to make
* sure that any bug can't cause infinite recursion.
*/
|
Processes the AVL report by matching to the assignment and generating predictions and such. Sets VehicleState for the vehicle based on the results. Also stores AVL report into the database (if not in playback mode)
|
lowLevelProcessAvlReport
|
{
"repo_name": "goeuropa/transitime",
"path": "transitime/src/main/java/org/transitime/core/AvlProcessor.java",
"license": "gpl-3.0",
"size": 54020
}
|
[
"org.transitime.applications.Core",
"org.transitime.core.dataCache.VehicleDataCache",
"org.transitime.core.dataCache.VehicleStateManager",
"org.transitime.db.structs.AvlReport"
] |
import org.transitime.applications.Core; import org.transitime.core.dataCache.VehicleDataCache; import org.transitime.core.dataCache.VehicleStateManager; import org.transitime.db.structs.AvlReport;
|
import org.transitime.applications.*; import org.transitime.core.*; import org.transitime.db.structs.*;
|
[
"org.transitime.applications",
"org.transitime.core",
"org.transitime.db"
] |
org.transitime.applications; org.transitime.core; org.transitime.db;
| 1,381,282
|
private void read(StreamInput in) throws IOException {
field = in.readOptionalString();
if (in.readBoolean()) {
script = new Script(in);
}
if (in.readBoolean()) {
valueType = ValueType.readFromStream(in);
}
format = in.readOptionalString();
missing = in.readGenericValue();
if (in.readBoolean()) {
timeZone = DateTimeZone.forID(in.readString());
}
}
|
void function(StreamInput in) throws IOException { field = in.readOptionalString(); if (in.readBoolean()) { script = new Script(in); } if (in.readBoolean()) { valueType = ValueType.readFromStream(in); } format = in.readOptionalString(); missing = in.readGenericValue(); if (in.readBoolean()) { timeZone = DateTimeZone.forID(in.readString()); } }
|
/**
* Read from a stream.
*/
|
Read from a stream
|
read
|
{
"repo_name": "nomoa/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/search/aggregations/support/ValuesSourceAggregatorBuilder.java",
"license": "apache-2.0",
"size": 17260
}
|
[
"java.io.IOException",
"org.elasticsearch.common.io.stream.StreamInput",
"org.elasticsearch.script.Script",
"org.joda.time.DateTimeZone"
] |
import java.io.IOException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.script.Script; import org.joda.time.DateTimeZone;
|
import java.io.*; import org.elasticsearch.common.io.stream.*; import org.elasticsearch.script.*; import org.joda.time.*;
|
[
"java.io",
"org.elasticsearch.common",
"org.elasticsearch.script",
"org.joda.time"
] |
java.io; org.elasticsearch.common; org.elasticsearch.script; org.joda.time;
| 1,915,269
|
public ServiceFuture<AppServiceEnvironmentResourceInner> updateAsync(String resourceGroupName, String name, AppServiceEnvironmentPatchResource hostingEnvironmentEnvelope, final ServiceCallback<AppServiceEnvironmentResourceInner> serviceCallback) {
return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, name, hostingEnvironmentEnvelope), serviceCallback);
}
|
ServiceFuture<AppServiceEnvironmentResourceInner> function(String resourceGroupName, String name, AppServiceEnvironmentPatchResource hostingEnvironmentEnvelope, final ServiceCallback<AppServiceEnvironmentResourceInner> serviceCallback) { return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, name, hostingEnvironmentEnvelope), serviceCallback); }
|
/**
* Create or update an App Service Environment.
* Create or update an App Service Environment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service Environment.
* @param hostingEnvironmentEnvelope Configuration details of the App Service Environment.
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
|
Create or update an App Service Environment. Create or update an App Service Environment
|
updateAsync
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/appservice/mgmt-v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java",
"license": "mit",
"size": 595166
}
|
[
"com.microsoft.azure.management.appservice.v2016_09_01.AppServiceEnvironmentPatchResource",
"com.microsoft.rest.ServiceCallback",
"com.microsoft.rest.ServiceFuture"
] |
import com.microsoft.azure.management.appservice.v2016_09_01.AppServiceEnvironmentPatchResource; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture;
|
import com.microsoft.azure.management.appservice.v2016_09_01.*; import com.microsoft.rest.*;
|
[
"com.microsoft.azure",
"com.microsoft.rest"
] |
com.microsoft.azure; com.microsoft.rest;
| 1,234,476
|
GraphCollection query(String query, String constructionPattern, boolean attachData,
MatchStrategy vertexStrategy, MatchStrategy edgeStrategy, GraphStatistics graphStatistics);
|
GraphCollection query(String query, String constructionPattern, boolean attachData, MatchStrategy vertexStrategy, MatchStrategy edgeStrategy, GraphStatistics graphStatistics);
|
/**
* Evaluates the given query using the Cypher query engine.
*
* @param query Cypher query
* @param constructionPattern Construction pattern
* @param attachData attach original vertex and edge data to the result
* @param vertexStrategy morphism setting for vertex mapping
* @param edgeStrategy morphism setting for edge mapping
* @param graphStatistics statistics about the data graph
* @return graph collection containing matching subgraphs
*/
|
Evaluates the given query using the Cypher query engine
|
query
|
{
"repo_name": "rostam/gradoop",
"path": "gradoop-flink/src/main/java/org/gradoop/flink/model/api/epgm/LogicalGraphOperators.java",
"license": "apache-2.0",
"size": 28211
}
|
[
"org.gradoop.flink.model.impl.epgm.GraphCollection",
"org.gradoop.flink.model.impl.operators.matching.common.MatchStrategy",
"org.gradoop.flink.model.impl.operators.matching.common.statistics.GraphStatistics"
] |
import org.gradoop.flink.model.impl.epgm.GraphCollection; import org.gradoop.flink.model.impl.operators.matching.common.MatchStrategy; import org.gradoop.flink.model.impl.operators.matching.common.statistics.GraphStatistics;
|
import org.gradoop.flink.model.impl.epgm.*; import org.gradoop.flink.model.impl.operators.matching.common.*; import org.gradoop.flink.model.impl.operators.matching.common.statistics.*;
|
[
"org.gradoop.flink"
] |
org.gradoop.flink;
| 1,484,041
|
public Contact[] getContactInfo(String name, String type) throws IOException, PrivilegeException {
return gson.fromJson(HttpUtil.httpGet(magister.schoolUrl.getApiUrl() + "personen/" + magister.profile.id + "/contactpersonen?contactPersoonType=" + type + "&q=" + name), Contact[].class);
}
/**
* {@inheritDoc}
|
Contact[] function(String name, String type) throws IOException, PrivilegeException { return gson.fromJson(HttpUtil.httpGet(magister.schoolUrl.getApiUrl() + STR + magister.profile.id + STR + type + "&q=" + name), Contact[].class); } /** * {@inheritDoc}
|
/**
* Get an array of {@link Contact}s with contact information. If no contacts can be found, an empty array will be
* returned instead.
*
* @param name the name.
* @param type the type.
* @return an array of {@link Contact} with the contact information.
* @throws IOException if there is no active internet connection.
* @throws PrivilegeException if the profile doesn't have the privilege to perform this action.
*/
|
Get an array of <code>Contact</code>s with contact information. If no contacts can be found, an empty array will be returned instead
|
getContactInfo
|
{
"repo_name": "iLexiconn/Magister.java",
"path": "src/main/java/net/ilexiconn/magister/handler/ContactHandler.java",
"license": "mit",
"size": 3945
}
|
[
"java.io.IOException",
"net.ilexiconn.magister.container.Contact",
"net.ilexiconn.magister.exeption.PrivilegeException",
"net.ilexiconn.magister.util.HttpUtil"
] |
import java.io.IOException; import net.ilexiconn.magister.container.Contact; import net.ilexiconn.magister.exeption.PrivilegeException; import net.ilexiconn.magister.util.HttpUtil;
|
import java.io.*; import net.ilexiconn.magister.container.*; import net.ilexiconn.magister.exeption.*; import net.ilexiconn.magister.util.*;
|
[
"java.io",
"net.ilexiconn.magister"
] |
java.io; net.ilexiconn.magister;
| 2,459,410
|
protected void sendEndOfHeader(OutputStream out) throws IOException {
LOG.trace("enter sendEndOfHeader(OutputStream out)");
out.write(CRLF_BYTES);
out.write(CRLF_BYTES);
}
|
void function(OutputStream out) throws IOException { LOG.trace(STR); out.write(CRLF_BYTES); out.write(CRLF_BYTES); }
|
/**
* Write the end of the header to the output stream
* @param out The output stream
* @throws IOException If an IO problem occurs.
*/
|
Write the end of the header to the output stream
|
sendEndOfHeader
|
{
"repo_name": "s20121035/rk3288_android5.1_repo",
"path": "frameworks/base/core/java/com/android/internal/http/multipart/Part.java",
"license": "gpl-3.0",
"size": 15223
}
|
[
"java.io.IOException",
"java.io.OutputStream"
] |
import java.io.IOException; import java.io.OutputStream;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,275,455
|
private String checkType(String target) {
if (!StanfordNeTagger.isInitialized()) StanfordNeTagger.init();
HashMap<String, String[]> nesByType = StanfordNeTagger.extractNEs(target);
ArrayList<String> neTypes = new ArrayList<String>(nesByType.keySet());
for (int t = 0; t < neTypes.size(); t++) {
String type = neTypes.get(t);
String[] nes = nesByType.get(type);
for (int n = 0; n < nes.length; n++)
if (nes[n].equals(target))
return type.replace("NE", "");
}
return null;
}
|
String function(String target) { if (!StanfordNeTagger.isInitialized()) StanfordNeTagger.init(); HashMap<String, String[]> nesByType = StanfordNeTagger.extractNEs(target); ArrayList<String> neTypes = new ArrayList<String>(nesByType.keySet()); for (int t = 0; t < neTypes.size(); t++) { String type = neTypes.get(t); String[] nes = nesByType.get(type); for (int n = 0; n < nes.length; n++) if (nes[n].equals(target)) return type.replace("NE", ""); } return null; }
|
/**
* find the NE type of a target
*
* @param target the target String to check
* @return the NE type of target, or null, if the type couldn't be determined
*/
|
find the NE type of a target
|
checkType
|
{
"repo_name": "csarron/PriaQA",
"path": "src/info/ephyra/answerselection/filters/WebTermImportanceFilter.java",
"license": "gpl-3.0",
"size": 34357
}
|
[
"info.ephyra.nlp.StanfordNeTagger",
"java.util.ArrayList",
"java.util.HashMap"
] |
import info.ephyra.nlp.StanfordNeTagger; import java.util.ArrayList; import java.util.HashMap;
|
import info.ephyra.nlp.*; import java.util.*;
|
[
"info.ephyra.nlp",
"java.util"
] |
info.ephyra.nlp; java.util;
| 758,999
|
private boolean containsLockToken(Session session, String lockToken) {
String[] lt = session.getLockTokens();
for (int i = 0; i < lt.length; i++) {
if (lt[i].equals(lockToken)) {
return true;
}
}
return false;
}
|
boolean function(Session session, String lockToken) { String[] lt = session.getLockTokens(); for (int i = 0; i < lt.length; i++) { if (lt[i].equals(lockToken)) { return true; } } return false; }
|
/**
* Return a flag indicating whether the indicated session contains
* a specific lock token
*/
|
Return a flag indicating whether the indicated session contains a specific lock token
|
containsLockToken
|
{
"repo_name": "sdmcraft/jackrabbit",
"path": "jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/LockTest.java",
"license": "apache-2.0",
"size": 24652
}
|
[
"javax.jcr.Session"
] |
import javax.jcr.Session;
|
import javax.jcr.*;
|
[
"javax.jcr"
] |
javax.jcr;
| 2,528,831
|
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
// So this fragment doesn't restart on configuration changes; i.e. rotation.
setRetainInstance(true);
mPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity());
String[] gamePaths = getArguments().getStringArray(KEY_GAMEPATHS);
mEmulationState = new EmulationState(gamePaths, getTemporaryStateFilePath());
}
|
void function(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRetainInstance(true); mPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); String[] gamePaths = getArguments().getStringArray(KEY_GAMEPATHS); mEmulationState = new EmulationState(gamePaths, getTemporaryStateFilePath()); }
|
/**
* Initialize anything that doesn't depend on the layout / views in here.
*/
|
Initialize anything that doesn't depend on the layout / views in here
|
onCreate
|
{
"repo_name": "aliaspider/dolphin",
"path": "Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/EmulationFragment.java",
"license": "gpl-2.0",
"size": 12471
}
|
[
"android.os.Bundle",
"android.preference.PreferenceManager"
] |
import android.os.Bundle; import android.preference.PreferenceManager;
|
import android.os.*; import android.preference.*;
|
[
"android.os",
"android.preference"
] |
android.os; android.preference;
| 216,520
|
public GenPolynomial<C> primitivePart(GenPolynomial<C> P) {
return engine.primitivePart(P);
}
|
GenPolynomial<C> function(GenPolynomial<C> P) { return engine.primitivePart(P); }
|
/**
* GenPolynomial primitive part. Delegates computation to a
* GreatestCommonDivisor class.
* @param P GenPolynomial.
* @return primitivePart(P).
*/
|
GenPolynomial primitive part. Delegates computation to a GreatestCommonDivisor class
|
primitivePart
|
{
"repo_name": "breandan/java-algebra-system",
"path": "src/edu/jas/ufd/FactorAbstract.java",
"license": "gpl-2.0",
"size": 28730
}
|
[
"edu.jas.poly.GenPolynomial"
] |
import edu.jas.poly.GenPolynomial;
|
import edu.jas.poly.*;
|
[
"edu.jas.poly"
] |
edu.jas.poly;
| 471,112
|
private String openNMSToRTState(final Ticket.State state) {
String rtStatus;
LogUtils.debugf(this, "getting RT status from OpenNMS State %s", state.toString());
switch (state) {
case OPEN:
// ticket is new
rtStatus = m_openStatus;
LogUtils.debugf(this, "OpenNMS Status OPEN matched rt status %s", rtStatus);
break;
case CLOSED:
// closed successful
rtStatus = m_closedStatus;
LogUtils.debugf(this, "OpenNMS Status CLOSED matched rt status %s", rtStatus);
break;
case CANCELLED:
// not sure how often we see this
rtStatus = m_cancelledStatus;
LogUtils.debugf(this, "OpenNMS Status CANCELLED matched rt status %s", rtStatus);
break;
default:
LogUtils.debugf(this, "No valid OpenNMS state on ticket");
rtStatus = m_openStatus;
}
LogUtils.debugf(this, "OpenNMS state was %s, setting RT status to %s", state.toString(), rtStatus);
return rtStatus;
}
|
String function(final Ticket.State state) { String rtStatus; LogUtils.debugf(this, STR, state.toString()); switch (state) { case OPEN: rtStatus = m_openStatus; LogUtils.debugf(this, STR, rtStatus); break; case CLOSED: rtStatus = m_closedStatus; LogUtils.debugf(this, STR, rtStatus); break; case CANCELLED: rtStatus = m_cancelledStatus; LogUtils.debugf(this, STR, rtStatus); break; default: LogUtils.debugf(this, STR); rtStatus = m_openStatus; } LogUtils.debugf(this, STR, state.toString(), rtStatus); return rtStatus; }
|
/**
* Convenience method for converting OpenNMS enumerated ticket states to
* RT status.
*
* @param state a valid <code>org.opennms.netmgt.ticketd.Ticket.State</code>.
* @return a String representing the RT Status of the ticket.
*/
|
Convenience method for converting OpenNMS enumerated ticket states to RT status
|
openNMSToRTState
|
{
"repo_name": "vishwaAbhinav/OpenNMS",
"path": "integrations/opennms-integration-rt/src/main/java/org/opennms/netmgt/ticketer/rt/RtTicketerPlugin.java",
"license": "gpl-2.0",
"size": 9636
}
|
[
"org.opennms.api.integration.ticketing.Ticket",
"org.opennms.core.utils.LogUtils"
] |
import org.opennms.api.integration.ticketing.Ticket; import org.opennms.core.utils.LogUtils;
|
import org.opennms.api.integration.ticketing.*; import org.opennms.core.utils.*;
|
[
"org.opennms.api",
"org.opennms.core"
] |
org.opennms.api; org.opennms.core;
| 846,639
|
private String applyRulesToString(final Calendar c) {
return applyRules(c, new StringBuffer(mMaxLengthEstimate)).toString();
}
|
String function(final Calendar c) { return applyRules(c, new StringBuffer(mMaxLengthEstimate)).toString(); }
|
/**
* Creates a String representation of the given Calendar by applying the rules of this printer to it.
*
* @param c the Calender to apply the rules to.
* @return a String representation of the given Calendar.
*/
|
Creates a String representation of the given Calendar by applying the rules of this printer to it
|
applyRulesToString
|
{
"repo_name": "sadegh-arfa/igramApp",
"path": "TMessagesProj/src/main/java/org/telegram/messenger/time/FastDatePrinter.java",
"license": "gpl-2.0",
"size": 40230
}
|
[
"java.util.Calendar"
] |
import java.util.Calendar;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 153,634
|
@Test
public void forwardRateMethodVsCalculator() {
final double fwdMethod = METHOD_FX.forwardForexRate(FX, MULTICURVES);
final ParRateDiscountingCalculator PRC = ParRateDiscountingCalculator.getInstance();
final double fwdCalculator = FX.accept(PRC, MULTICURVES);
assertEquals("Forex: forward rate", fwdMethod, fwdCalculator, TOLERANCE_RATE);
}
|
void function() { final double fwdMethod = METHOD_FX.forwardForexRate(FX, MULTICURVES); final ParRateDiscountingCalculator PRC = ParRateDiscountingCalculator.getInstance(); final double fwdCalculator = FX.accept(PRC, MULTICURVES); assertEquals(STR, fwdMethod, fwdCalculator, TOLERANCE_RATE); }
|
/**
* Tests the forward Forex rate through the method and through the calculator.
*/
|
Tests the forward Forex rate through the method and through the calculator
|
forwardRateMethodVsCalculator
|
{
"repo_name": "McLeodMoores/starling",
"path": "projects/analytics/src/test/java/com/opengamma/analytics/financial/forex/provider/ForexDiscountingMethodTest.java",
"license": "apache-2.0",
"size": 14290
}
|
[
"com.opengamma.analytics.financial.provider.calculator.discounting.ParRateDiscountingCalculator",
"org.testng.AssertJUnit"
] |
import com.opengamma.analytics.financial.provider.calculator.discounting.ParRateDiscountingCalculator; import org.testng.AssertJUnit;
|
import com.opengamma.analytics.financial.provider.calculator.discounting.*; import org.testng.*;
|
[
"com.opengamma.analytics",
"org.testng"
] |
com.opengamma.analytics; org.testng;
| 2,015,471
|
@ServiceMethod(returns = ReturnType.SINGLE)
void deactivateRevision(String resourceGroupName, String containerAppName, String name);
|
@ServiceMethod(returns = ReturnType.SINGLE) void deactivateRevision(String resourceGroupName, String containerAppName, String name);
|
/**
* Deactivates a revision for a Container App.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param containerAppName Name of the Container App.
* @param name Name of the Container App Revision to deactivate.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is
* rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
|
Deactivates a revision for a Container App
|
deactivateRevision
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/ContainerAppsRevisionsClient.java",
"license": "mit",
"size": 17086
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod;
|
import com.azure.core.annotation.*;
|
[
"com.azure.core"
] |
com.azure.core;
| 2,363,283
|
long addLocation(String locationSetting, String cityName, double lat, double lon) {
// Students: First, check if the location with this city name exists in the db
// If it exists, return the current ID
// Otherwise, insert it using the content resolver and the base URI
Cursor queryCursor = mContext.getContentResolver().query(
WeatherContract.LocationEntry.CONTENT_URI,
new String[]{WeatherContract.LocationEntry._ID},
WeatherContract.LocationEntry.COLUMN_LOCATION_SETTING + " = ?",
new String[]{locationSetting},
null);
long rowId;
if(queryCursor.moveToFirst()){
int columnIndex = queryCursor.getColumnIndex(WeatherContract.LocationEntry._ID);
rowId = queryCursor.getLong(columnIndex);
} else {
ContentValues newLocation = new ContentValues();
newLocation.put(WeatherContract.LocationEntry.COLUMN_LOCATION_SETTING, locationSetting);
newLocation.put(WeatherContract.LocationEntry.COLUMN_CITY_NAME, cityName);
newLocation.put(WeatherContract.LocationEntry.COLUMN_COORD_LAT, lat);
newLocation.put(WeatherContract.LocationEntry.COLUMN_COORD_LONG, lon);
Uri newLocationUri = mContext.getContentResolver().insert(
WeatherContract.LocationEntry.CONTENT_URI,
newLocation
);
rowId = ContentUris.parseId(newLocationUri);
}
queryCursor.close();
return rowId;
}
|
long addLocation(String locationSetting, String cityName, double lat, double lon) { Cursor queryCursor = mContext.getContentResolver().query( WeatherContract.LocationEntry.CONTENT_URI, new String[]{WeatherContract.LocationEntry._ID}, WeatherContract.LocationEntry.COLUMN_LOCATION_SETTING + STR, new String[]{locationSetting}, null); long rowId; if(queryCursor.moveToFirst()){ int columnIndex = queryCursor.getColumnIndex(WeatherContract.LocationEntry._ID); rowId = queryCursor.getLong(columnIndex); } else { ContentValues newLocation = new ContentValues(); newLocation.put(WeatherContract.LocationEntry.COLUMN_LOCATION_SETTING, locationSetting); newLocation.put(WeatherContract.LocationEntry.COLUMN_CITY_NAME, cityName); newLocation.put(WeatherContract.LocationEntry.COLUMN_COORD_LAT, lat); newLocation.put(WeatherContract.LocationEntry.COLUMN_COORD_LONG, lon); Uri newLocationUri = mContext.getContentResolver().insert( WeatherContract.LocationEntry.CONTENT_URI, newLocation ); rowId = ContentUris.parseId(newLocationUri); } queryCursor.close(); return rowId; }
|
/**
* Helper method to handle insertion of a new location in the weather database.
*
* @param locationSetting The location string used to request updates from the server.
* @param cityName A human-readable city name, e.g "Mountain View"
* @param lat the latitude of the city
* @param lon the longitude of the city
* @return the row ID of the added location.
*/
|
Helper method to handle insertion of a new location in the weather database
|
addLocation
|
{
"repo_name": "Fdiazreal/wetter",
"path": "app/src/main/java/com/fdiazreal/apps/wetter/FetchWeatherTask.java",
"license": "apache-2.0",
"size": 17902
}
|
[
"android.content.ContentUris",
"android.content.ContentValues",
"android.database.Cursor",
"android.net.Uri",
"com.fdiazreal.apps.wetter.data.WeatherContract"
] |
import android.content.ContentUris; import android.content.ContentValues; import android.database.Cursor; import android.net.Uri; import com.fdiazreal.apps.wetter.data.WeatherContract;
|
import android.content.*; import android.database.*; import android.net.*; import com.fdiazreal.apps.wetter.data.*;
|
[
"android.content",
"android.database",
"android.net",
"com.fdiazreal.apps"
] |
android.content; android.database; android.net; com.fdiazreal.apps;
| 2,355,426
|
public long enqueue(Request request) {
ContentValues values = request.toContentValues(mPackageName);
Uri downloadUri = mResolver.insert(Downloads.CONTENT_URI, values);
long id = Long.parseLong(downloadUri.getLastPathSegment());
return id;
}
|
long function(Request request) { ContentValues values = request.toContentValues(mPackageName); Uri downloadUri = mResolver.insert(Downloads.CONTENT_URI, values); long id = Long.parseLong(downloadUri.getLastPathSegment()); return id; }
|
/**
* Enqueue a new download. The download will start automatically once the download manager is
* ready to execute it and connectivity is available.
*
* @param request the parameters specifying this download
* @return an ID for the download, unique across the system. This ID is used to make future
* calls related to this download.
*/
|
Enqueue a new download. The download will start automatically once the download manager is ready to execute it and connectivity is available
|
enqueue
|
{
"repo_name": "msafin/wmc",
"path": "src/com/sharegogo/wireless/download/DownloadManager.java",
"license": "gpl-2.0",
"size": 44783
}
|
[
"android.content.ContentValues",
"android.net.Uri"
] |
import android.content.ContentValues; import android.net.Uri;
|
import android.content.*; import android.net.*;
|
[
"android.content",
"android.net"
] |
android.content; android.net;
| 2,904,715
|
Promise<GitHubPullRequestList> getPullRequests(
@NotNull String oauthToken, @NotNull String owner, @NotNull String repository);
|
Promise<GitHubPullRequestList> getPullRequests( @NotNull String oauthToken, @NotNull String owner, @NotNull String repository);
|
/**
* Get pull requests for given repository.
*
* @param oauthToken Github OAuth authorization token
* @param owner the repository owner.
* @param repository the repository name.
*/
|
Get pull requests for given repository
|
getPullRequests
|
{
"repo_name": "sleshchenko/che",
"path": "plugins/plugin-github/che-plugin-github-ide/src/main/java/org/eclipse/che/plugin/github/ide/GitHubServiceClient.java",
"license": "epl-1.0",
"size": 7872
}
|
[
"javax.validation.constraints.NotNull",
"org.eclipse.che.api.promises.client.Promise",
"org.eclipse.che.plugin.github.shared.GitHubPullRequestList"
] |
import javax.validation.constraints.NotNull; import org.eclipse.che.api.promises.client.Promise; import org.eclipse.che.plugin.github.shared.GitHubPullRequestList;
|
import javax.validation.constraints.*; import org.eclipse.che.api.promises.client.*; import org.eclipse.che.plugin.github.shared.*;
|
[
"javax.validation",
"org.eclipse.che"
] |
javax.validation; org.eclipse.che;
| 2,563,490
|
private JSONWriter end(char mode, char c) throws JSONException {
if (this.mode != mode) {
throw new JSONException(mode == 'a' ? "Misplaced endArray." : "Misplaced endObject.");
}
this.pop(mode);
try {
this.writer.write(c);
} catch (IOException e) {
throw new JSONException(e);
}
this.comma = true;
return this;
}
|
JSONWriter function(char mode, char c) throws JSONException { if (this.mode != mode) { throw new JSONException(mode == 'a' ? STR : STR); } this.pop(mode); try { this.writer.write(c); } catch (IOException e) { throw new JSONException(e); } this.comma = true; return this; }
|
/**
* End something.
*
* @param mode
* Mode
* @param c
* Closing character
* @return this
* @throws JSONException
* If unbalanced.
*/
|
End something
|
end
|
{
"repo_name": "xzzpig/PigUtils",
"path": "Json/src/main/java/com/github/xzzpig/pigutils/json/JSONWriter.java",
"license": "gpl-3.0",
"size": 9652
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,443,008
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.