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
sequence | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
sequence | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
---|---|---|---|---|---|---|---|---|---|---|---|
protected void buildShape(BridgeContext ctx,
Element e,
ShapeNode shapeNode) {
SVGOMPathElement pe = (SVGOMPathElement) e;
AWTPathProducer app = new AWTPathProducer();
try {
// 'd' attribute - required
SVGOMAnimatedPathData _d = pe.getAnimatedPathData();
_d.check();
SVGPathSegList p = _d.getAnimatedPathSegList();
app.setWindingRule(CSSUtilities.convertFillRule(e));
SVGAnimatedPathDataSupport.handlePathSegList(p, app);
} catch (LiveAttributeException ex) {
throw new BridgeException(ctx, ex);
} finally {
shapeNode.setShape(app.getShape());
}
}
// BridgeUpdateHandler implementation ////////////////////////////////// | void function(BridgeContext ctx, Element e, ShapeNode shapeNode) { SVGOMPathElement pe = (SVGOMPathElement) e; AWTPathProducer app = new AWTPathProducer(); try { SVGOMAnimatedPathData _d = pe.getAnimatedPathData(); _d.check(); SVGPathSegList p = _d.getAnimatedPathSegList(); app.setWindingRule(CSSUtilities.convertFillRule(e)); SVGAnimatedPathDataSupport.handlePathSegList(p, app); } catch (LiveAttributeException ex) { throw new BridgeException(ctx, ex); } finally { shapeNode.setShape(app.getShape()); } } | /**
* Constructs a path according to the specified parameters.
*
* @param ctx the bridge context to use
* @param e the element that describes a rect element
* @param shapeNode the shape node to initialize
*/ | Constructs a path according to the specified parameters | buildShape | {
"repo_name": "sflyphotobooks/crp-batik",
"path": "sources/org/apache/batik/bridge/SVGPathElementBridge.java",
"license": "apache-2.0",
"size": 5559
} | [
"org.apache.batik.dom.svg.LiveAttributeException",
"org.apache.batik.dom.svg.SVGAnimatedPathDataSupport",
"org.apache.batik.dom.svg.SVGOMAnimatedPathData",
"org.apache.batik.dom.svg.SVGOMPathElement",
"org.apache.batik.gvt.ShapeNode",
"org.apache.batik.parser.AWTPathProducer",
"org.w3c.dom.Element",
"org.w3c.dom.svg.SVGPathSegList"
] | import org.apache.batik.dom.svg.LiveAttributeException; import org.apache.batik.dom.svg.SVGAnimatedPathDataSupport; import org.apache.batik.dom.svg.SVGOMAnimatedPathData; import org.apache.batik.dom.svg.SVGOMPathElement; import org.apache.batik.gvt.ShapeNode; import org.apache.batik.parser.AWTPathProducer; import org.w3c.dom.Element; import org.w3c.dom.svg.SVGPathSegList; | import org.apache.batik.dom.svg.*; import org.apache.batik.gvt.*; import org.apache.batik.parser.*; import org.w3c.dom.*; import org.w3c.dom.svg.*; | [
"org.apache.batik",
"org.w3c.dom"
] | org.apache.batik; org.w3c.dom; | 2,298,131 |
public static void inexistentField(String targetFieldName, String targetClassName){
throw new MappingErrorException(MSG.INSTANCE.message(mappingErrorException5, targetFieldName, targetClassName));
}
| static void function(String targetFieldName, String targetClassName){ throw new MappingErrorException(MSG.INSTANCE.message(mappingErrorException5, targetFieldName, targetClassName)); } | /**
* Thrown when the target field doesn't exist.
* @param targetFieldName name of the target field
* @param targetClassName name of the target field's class
*/ | Thrown when the target field doesn't exist | inexistentField | {
"repo_name": "jmapper-framework/jmapper-core",
"path": "JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java",
"license": "apache-2.0",
"size": 30461
} | [
"com.googlecode.jmapper.exceptions.MappingErrorException"
] | import com.googlecode.jmapper.exceptions.MappingErrorException; | import com.googlecode.jmapper.exceptions.*; | [
"com.googlecode.jmapper"
] | com.googlecode.jmapper; | 2,541,158 |
public static ByteBuf emptyPingBuf() {
// Return a duplicate so that modifications to the reader index will not affect the original
// buffer.
return Unpooled.wrappedBuffer(EMPTY_PING);
} | static ByteBuf function() { return Unpooled.wrappedBuffer(EMPTY_PING); } | /**
* Returns a buffer filled with all zeros that is the appropriate length for a PING frame.
*/ | Returns a buffer filled with all zeros that is the appropriate length for a PING frame | emptyPingBuf | {
"repo_name": "drowning/netty",
"path": "codec-http2/src/main/java/io/netty/handler/codec/http2/Http2CodecUtil.java",
"license": "apache-2.0",
"size": 8599
} | [
"io.netty.buffer.ByteBuf",
"io.netty.buffer.Unpooled"
] | import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; | import io.netty.buffer.*; | [
"io.netty.buffer"
] | io.netty.buffer; | 1,446,140 |
protected void writeLineSeparator() throws IOException {
String newline = getLineSeparator();
int length = newline.length();
if (newlineChars == null || newlineChars.length < length) {
newlineChars = new char[length];
}
newline.getChars(0, length, newlineChars, 0);
output(newlineChars, 0, length);
setCurrentLineLength(0);
} | void function() throws IOException { String newline = getLineSeparator(); int length = newline.length(); if (newlineChars == null newlineChars.length < length) { newlineChars = new char[length]; } newline.getChars(0, length, newlineChars, 0); output(newlineChars, 0, length); setCurrentLineLength(0); } | /**
* Writes the line separator. This invokes <code>output</code> directly
* as well as setting the <code>lineLength</code> to 0.
*
* @since 1.3
*/ | Writes the line separator. This invokes <code>output</code> directly as well as setting the <code>lineLength</code> to 0 | writeLineSeparator | {
"repo_name": "isaacl/openjdk-jdk",
"path": "src/share/classes/javax/swing/text/AbstractWriter.java",
"license": "gpl-2.0",
"size": 23261
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 997,437 |
public static double gamma(double x, double y) {
return org.hipparchus.special.Gamma.gamma(x) * regGammaQ(x, y, DEFAULT_EPSILON, MAX_ITERATIONS);
} | static double function(double x, double y) { return org.hipparchus.special.Gamma.gamma(x) * regGammaQ(x, y, DEFAULT_EPSILON, MAX_ITERATIONS); } | /**
* Incomplete gamma function.
*
* @param x
* @param y
* @return
*/ | Incomplete gamma function | gamma | {
"repo_name": "axkr/symja_android_library",
"path": "symja_android_library/matheclipse-core/src/main/java/org/matheclipse/core/builtin/functions/GammaJS.java",
"license": "gpl-3.0",
"size": 19823
} | [
"org.hipparchus.special.Gamma"
] | import org.hipparchus.special.Gamma; | import org.hipparchus.special.*; | [
"org.hipparchus.special"
] | org.hipparchus.special; | 1,155,563 |
public void warn(String msg, Throwable t) {
if (!logger.isWarnEnabled())
return;
if (instanceofLAL) {
((LocationAwareLogger) logger).log(null, fqcn,
LocationAwareLogger.WARN_INT, msg, null, t);
} else {
logger.warn(msg, t);
}
}
| void function(String msg, Throwable t) { if (!logger.isWarnEnabled()) return; if (instanceofLAL) { ((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.WARN_INT, msg, null, t); } else { logger.warn(msg, t); } } | /**
* Delegate to the appropriate method of the underlying logger.
*/ | Delegate to the appropriate method of the underlying logger | warn | {
"repo_name": "PRECISE/ROSLab",
"path": "lib/slf4j-1.7.10/slf4j-ext/src/main/java/org/slf4j/ext/LoggerWrapper.java",
"license": "apache-2.0",
"size": 28131
} | [
"org.slf4j.spi.LocationAwareLogger"
] | import org.slf4j.spi.LocationAwareLogger; | import org.slf4j.spi.*; | [
"org.slf4j.spi"
] | org.slf4j.spi; | 719,038 |
public PreferenceScreen getPreferenceScreen() {
return PreferenceManagerCompat.getPreferenceScreen(mPreferenceManager);
} | PreferenceScreen function() { return PreferenceManagerCompat.getPreferenceScreen(mPreferenceManager); } | /**
* Gets the root of the preference hierarchy that this fragment is showing.
*
* @return The {@link PreferenceScreen} that is the root of the preference
* hierarchy.
*/ | Gets the root of the preference hierarchy that this fragment is showing | getPreferenceScreen | {
"repo_name": "CyberSoftTeam/Open-Battery-Saver",
"path": "Source code/Android Application/OpenBatterySaver/src/android/support/v4/preference/PreferenceFragment.java",
"license": "apache-2.0",
"size": 10493
} | [
"android.preference.PreferenceScreen"
] | import android.preference.PreferenceScreen; | import android.preference.*; | [
"android.preference"
] | android.preference; | 822,679 |
public SEGUSUARIO searchDatabase(String username) {
// Retrieve all users from the database
List<SEGUSUARIO> users = getUser(username);
//List<SEGUSUARIO> users = getList();
// Search user based on the parameters
for (SEGUSUARIO dbUser : users) {
if (dbUser.getCUSUARIO().equals(username) == true) {
// return matching user
return dbUser;
}
}
return null;
}
| SEGUSUARIO function(String username) { List<SEGUSUARIO> users = getUser(username); for (SEGUSUARIO dbUser : users) { if (dbUser.getCUSUARIO().equals(username) == true) { return dbUser; } } return null; } | /**
* Retrieval of data from database of specific user.
*/ | Retrieval of data from database of specific user | searchDatabase | {
"repo_name": "IvanSantiago/retopublico",
"path": "MiMappir/src/mx/gob/sct/utic/mimappir/admseg/postgreSQL/dao/SEGUSUARIO_DAO.java",
"license": "gpl-2.0",
"size": 2817
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,677,331 |
ImmutableSet<SourcePath> getProguardConfigs(); | ImmutableSet<SourcePath> getProguardConfigs(); | /**
* Proguard configurations to include when running release builds.
*/ | Proguard configurations to include when running release builds | getProguardConfigs | {
"repo_name": "daedric/buck",
"path": "src/com/facebook/buck/android/AbstractAndroidPackageableCollection.java",
"license": "apache-2.0",
"size": 4888
} | [
"com.facebook.buck.rules.SourcePath",
"com.google.common.collect.ImmutableSet"
] | import com.facebook.buck.rules.SourcePath; import com.google.common.collect.ImmutableSet; | import com.facebook.buck.rules.*; import com.google.common.collect.*; | [
"com.facebook.buck",
"com.google.common"
] | com.facebook.buck; com.google.common; | 1,457,844 |
@SuppressWarnings("unchecked")
public HB boundaryScannerType(String boundaryScannerType) {
this.boundaryScannerType = BoundaryScannerType.fromString(boundaryScannerType);
return (HB) this;
} | @SuppressWarnings(STR) HB function(String boundaryScannerType) { this.boundaryScannerType = BoundaryScannerType.fromString(boundaryScannerType); return (HB) this; } | /**
* When using the highlighterType <tt>fvh</tt> this setting
* controls which scanner to use for fragment boundaries, and defaults to "simple".
*/ | When using the highlighterType fvh this setting controls which scanner to use for fragment boundaries, and defaults to "simple" | boundaryScannerType | {
"repo_name": "jimczi/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/search/fetch/subphase/highlight/AbstractHighlighterBuilder.java",
"license": "apache-2.0",
"size": 26809
} | [
"org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder"
] | import org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder; | import org.elasticsearch.search.fetch.subphase.highlight.*; | [
"org.elasticsearch.search"
] | org.elasticsearch.search; | 946,082 |
private void injectTestSystemOut() {
setOut(new PrintStream(testOut));
} | void function() { setOut(new PrintStream(testOut)); } | /**
* Inject {@link #testOut} to System.out for analyze in test.
*/ | Inject <code>#testOut</code> to System.out for analyze in test | injectTestSystemOut | {
"repo_name": "NSAmelchev/ignite",
"path": "modules/dev-utils/src/test/java/org/apache/ignite/development/utils/IgniteWalConverterSensitiveDataTest.java",
"license": "apache-2.0",
"size": 12101
} | [
"java.io.PrintStream",
"java.lang.System"
] | import java.io.PrintStream; import java.lang.System; | import java.io.*; import java.lang.*; | [
"java.io",
"java.lang"
] | java.io; java.lang; | 425,336 |
private void fireEvents(boolean considerCancellation, Event event,
CancellableEvent cancellableEvent, boolean cancellable) {
// Event handlers that consider cancellation will run
for (EventPriority priority : EventPriority.values()) {
Map<Method, EventListener> internalMapping = getRegistry()
.getMethodMap(event.getClass(), priority,
!considerCancellation);
if (internalMapping != null) {
for (Entry<Method, EventListener> entry : internalMapping
.entrySet()) {
try {
entry.getKey().invoke(entry.getValue(), event);
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
throw new RuntimeException(e);
}
// Immediately return in the case of the event being
// cancelled.
if (considerCancellation && cancellable
&& cancellableEvent.isCancelled()) {
return;
}
}
}
}
} | void function(boolean considerCancellation, Event event, CancellableEvent cancellableEvent, boolean cancellable) { for (EventPriority priority : EventPriority.values()) { Map<Method, EventListener> internalMapping = getRegistry() .getMethodMap(event.getClass(), priority, !considerCancellation); if (internalMapping != null) { for (Entry<Method, EventListener> entry : internalMapping .entrySet()) { try { entry.getKey().invoke(entry.getValue(), event); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (InvocationTargetException e) { throw new RuntimeException(e); } if (considerCancellation && cancellable && cancellableEvent.isCancelled()) { return; } } } } } | /**
* Fires all events of the specified type using the specified
* configurations.
*
* @param considerCancellation
* Whether or not to consider cancellation.
* @param event
* The event which specifies the type of events to fire.
* @param cancellableEvent
* The cancellable event instance.
* @param cancellable
* Whether or not the event is cancellable.
*/ | Fires all events of the specified type using the specified configurations | fireEvents | {
"repo_name": "Jire/Jire",
"path": "src/jire/event/UniversalEventManager.java",
"license": "mit",
"size": 2120
} | [
"java.lang.reflect.InvocationTargetException",
"java.lang.reflect.Method",
"java.util.Map"
] | import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.Map; | import java.lang.reflect.*; import java.util.*; | [
"java.lang",
"java.util"
] | java.lang; java.util; | 1,199,765 |
void save(Site site) throws IdUnusedException, PermissionException; | void save(Site site) throws IdUnusedException, PermissionException; | /**
* Save any updates to this site - it must be a defined site (the id must exist) and the user must have update permissions.
*
* @param site
* The site, modified, to save.
* @throws IdUnusedException
* If the site's id is not a defined site id.
* @throws PermissionException
* If the end user does not have permission to update the site.
*/ | Save any updates to this site - it must be a defined site (the id must exist) and the user must have update permissions | save | {
"repo_name": "eemirtekin/Sakai-10.6-TR",
"path": "kernel/api/src/main/java/org/sakaiproject/site/api/SiteService.java",
"license": "apache-2.0",
"size": 39755
} | [
"org.sakaiproject.exception.IdUnusedException",
"org.sakaiproject.exception.PermissionException"
] | import org.sakaiproject.exception.IdUnusedException; import org.sakaiproject.exception.PermissionException; | import org.sakaiproject.exception.*; | [
"org.sakaiproject.exception"
] | org.sakaiproject.exception; | 977,196 |
public String getODataLinkRelation(Link link, String entitySetName) {
if (canReturnRelUnchanged(link)) {
return link.getRel();
}
String relValue = getRelValue(link.getRel());
if (link.getTransition().isGetFromCollectionToEntityResource() && relValue.isEmpty()) {
//Links from collection to entity resource of an entity are considered 'self' links within an odata feed
return "self";
}
return getRelFromResourceState(link, getEntityName(link, entitySetName, relValue), relValue);
}
| String function(Link link, String entitySetName) { if (canReturnRelUnchanged(link)) { return link.getRel(); } String relValue = getRelValue(link.getRel()); if (link.getTransition().isGetFromCollectionToEntityResource() && relValue.isEmpty()) { return "self"; } return getRelFromResourceState(link, getEntityName(link, entitySetName, relValue), relValue); } | /**
* Return the OData link relation from the specified link.
*
* rel = "item" => "relDesc"
* rel = "collection" => "relDesc"
* rel = "foo /new" => "relDesc /new"
* rel = "/new" => "relDesc /new"
* @param link link
* @return odata link rel
*/ | Return the OData link relation from the specified link. rel = "item" => "relDesc" rel = "collection" => "relDesc" rel = "foo /new" => "relDesc /new" rel = "/new" => "relDesc /new" | getODataLinkRelation | {
"repo_name": "junejosheeraz/IRIS",
"path": "interaction-media-odata-xml/src/main/java/com/temenos/interaction/media/odata/xml/atom/ODataLinkInterceptor.java",
"license": "agpl-3.0",
"size": 6484
} | [
"com.temenos.interaction.core.hypermedia.Link"
] | import com.temenos.interaction.core.hypermedia.Link; | import com.temenos.interaction.core.hypermedia.*; | [
"com.temenos.interaction"
] | com.temenos.interaction; | 1,340,211 |
public boolean negativeDepth() {
final SimpleMatrix P = new SimpleMatrix(3, 4);
final SimpleMatrix sK = this.K.multipliedBy(this.s);
P.setSubMatrixValue(0, 0, SimpleOperators.multiplyMatrixProd(sK, this.R));
P.setColValue(3, SimpleOperators.multiply(sK, this.t));
SimpleVector origin = new SimpleVector(0,0,0,1);
SimpleVector projected = SimpleOperators.multiply(P, origin);
return projected.getElement(2) < 0;
}
/**
* Computes the 3x4 projection matrix
* {@latex.inline $\\mathbf{P} = s \\cdot \\mathbf{K} \\cdot \\left(\\begin{array}{c|c} \\mathbf{R} & \\mathbf{t} \\end{array}\\right)$} | boolean function() { final SimpleMatrix P = new SimpleMatrix(3, 4); final SimpleMatrix sK = this.K.multipliedBy(this.s); P.setSubMatrixValue(0, 0, SimpleOperators.multiplyMatrixProd(sK, this.R)); P.setColValue(3, SimpleOperators.multiply(sK, this.t)); SimpleVector origin = new SimpleVector(0,0,0,1); SimpleVector projected = SimpleOperators.multiply(P, origin); return projected.getElement(2) < 0; } /** * Computes the 3x4 projection matrix * {@latex.inline $\\mathbf{P} = s \\cdot \\mathbf{K} \\cdot \\left(\\begin{array}{c c} \\mathbf{R} & \\mathbf{t} \\end{array}\\right)$} | /**
* Computes whether the depth values that are computed from this projection are positive or negative.
*/ | Computes whether the depth values that are computed from this projection are positive or negative | negativeDepth | {
"repo_name": "YixingHuang/CONRAD",
"path": "src/edu/stanford/rsl/conrad/geometry/Projection.java",
"license": "gpl-3.0",
"size": 96850
} | [
"edu.stanford.rsl.conrad.numerics.SimpleMatrix",
"edu.stanford.rsl.conrad.numerics.SimpleOperators",
"edu.stanford.rsl.conrad.numerics.SimpleVector"
] | import edu.stanford.rsl.conrad.numerics.SimpleMatrix; import edu.stanford.rsl.conrad.numerics.SimpleOperators; import edu.stanford.rsl.conrad.numerics.SimpleVector; | import edu.stanford.rsl.conrad.numerics.*; | [
"edu.stanford.rsl"
] | edu.stanford.rsl; | 2,270,668 |
@GET
@Path("{organizationId}/apis/{apiId}/versions/{version}/metrics/clientUsage")
@Produces(MediaType.APPLICATION_JSON)
public UsagePerClientBean getUsagePerClient(
@PathParam("organizationId") String organizationId, @PathParam("apiId") String apiId,
@PathParam("version") String version, @QueryParam("from") String fromDate,
@QueryParam("to") String toDate) throws NotAuthorizedException, InvalidMetricCriteriaException;
| @Path(STR) @Produces(MediaType.APPLICATION_JSON) UsagePerClientBean function( @PathParam(STR) String organizationId, @PathParam("apiId") String apiId, @PathParam(STR) String version, @QueryParam("from") String fromDate, @QueryParam("to") String toDate) throws NotAuthorizedException, InvalidMetricCriteriaException; | /**
* Retrieves metrics/analytics information for a specific API. This will
* return request count data broken down by client. It basically answers
* the question "who is calling my API?".
*
* @summary Get API Usage Metrics (per Client)
* @param organizationId The organization ID.
* @param apiId The API ID.
* @param version The API version.
* @param fromDate The start of a valid date range.
* @param toDate The end of a valid date range.
* @statuscode 200 If the metrics data is successfully returned.
* @return Usage metrics information.
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/ | Retrieves metrics/analytics information for a specific API. This will return request count data broken down by client. It basically answers the question "who is calling my API?" | getUsagePerClient | {
"repo_name": "jasonchaffee/apiman",
"path": "manager/api/rest/src/main/java/io/apiman/manager/api/rest/contract/IOrganizationResource.java",
"license": "apache-2.0",
"size": 109599
} | [
"io.apiman.manager.api.beans.metrics.UsagePerClientBean",
"io.apiman.manager.api.rest.contract.exceptions.InvalidMetricCriteriaException",
"io.apiman.manager.api.rest.contract.exceptions.NotAuthorizedException",
"javax.ws.rs.Path",
"javax.ws.rs.PathParam",
"javax.ws.rs.Produces",
"javax.ws.rs.QueryParam",
"javax.ws.rs.core.MediaType"
] | import io.apiman.manager.api.beans.metrics.UsagePerClientBean; import io.apiman.manager.api.rest.contract.exceptions.InvalidMetricCriteriaException; import io.apiman.manager.api.rest.contract.exceptions.NotAuthorizedException; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; | import io.apiman.manager.api.beans.metrics.*; import io.apiman.manager.api.rest.contract.exceptions.*; import javax.ws.rs.*; import javax.ws.rs.core.*; | [
"io.apiman.manager",
"javax.ws"
] | io.apiman.manager; javax.ws; | 483,420 |
public static final SourceModel.Expr adjustWithKey(SourceModel.Expr f, SourceModel.Expr k, SourceModel.Expr m) {
return
SourceModel.Expr.Application.make(
new SourceModel.Expr[] {SourceModel.Expr.Var.make(Functions.adjustWithKey), f, k, m});
}
| static final SourceModel.Expr function(SourceModel.Expr f, SourceModel.Expr k, SourceModel.Expr m) { return SourceModel.Expr.Application.make( new SourceModel.Expr[] {SourceModel.Expr.Var.make(Functions.adjustWithKey), f, k, m}); } | /**
* Adjusts a value at a specific key. When the key is not a member of the map,
* the original map is returned.
* <p>
* Complexity: O(min(n,W))
*
* @param f (CAL type: <code>Cal.Core.Prelude.Long -> a -> a</code>)
* the function which, when given the old key-value pair, returns the new value to be associated with the key.
* @param k (CAL type: <code>Cal.Core.Prelude.Long</code>)
* the key.
* @param m (CAL type: <code>Cal.Collections.LongMap.LongMap a</code>)
* the map.
* @return (CAL type: <code>Cal.Collections.LongMap.LongMap a</code>)
* the map, with the value at the specified key adjusted if present.
*/ | Adjusts a value at a specific key. When the key is not a member of the map, the original map is returned. Complexity: O(min(n,W)) | adjustWithKey | {
"repo_name": "levans/Open-Quark",
"path": "src/CAL_Platform/src/org/openquark/cal/module/Cal/Collections/CAL_LongMap.java",
"license": "bsd-3-clause",
"size": 87249
} | [
"org.openquark.cal.compiler.SourceModel"
] | import org.openquark.cal.compiler.SourceModel; | import org.openquark.cal.compiler.*; | [
"org.openquark.cal"
] | org.openquark.cal; | 2,203,959 |
public final MetaProperty<HistoricalTimeSeriesMaster> historicalTimeSeriesMaster() {
return _historicalTimeSeriesMaster;
} | final MetaProperty<HistoricalTimeSeriesMaster> function() { return _historicalTimeSeriesMaster; } | /**
* The meta-property for the {@code historicalTimeSeriesMaster} property.
* @return the meta-property, not null
*/ | The meta-property for the historicalTimeSeriesMaster property | historicalTimeSeriesMaster | {
"repo_name": "McLeodMoores/starling",
"path": "projects/web/src/main/java/com/opengamma/web/security/WebSecuritiesData.java",
"license": "apache-2.0",
"size": 22556
} | [
"com.opengamma.master.historicaltimeseries.HistoricalTimeSeriesMaster",
"org.joda.beans.MetaProperty"
] | import com.opengamma.master.historicaltimeseries.HistoricalTimeSeriesMaster; import org.joda.beans.MetaProperty; | import com.opengamma.master.historicaltimeseries.*; import org.joda.beans.*; | [
"com.opengamma.master",
"org.joda.beans"
] | com.opengamma.master; org.joda.beans; | 1,144,124 |
public StyleRange[] getStyleRanges(int columnIndex) {
return (StyleRange[]) getItem().getData(getStyleRangesDataKey(columnIndex));
} | StyleRange[] function(int columnIndex) { return (StyleRange[]) getItem().getData(getStyleRangesDataKey(columnIndex)); } | /**
* Returns the style ranges to be applied on the text label at the column
* index or <code>null</code> if no style ranges have been set.
*
* @param columnIndex
* the index of the column
* @return styleRanges the styled ranges
*
* @since 3.4
*/ | Returns the style ranges to be applied on the text label at the column index or <code>null</code> if no style ranges have been set | getStyleRanges | {
"repo_name": "neelance/jface4ruby",
"path": "jface4ruby/src/org/eclipse/jface/viewers/ViewerRow.java",
"license": "epl-1.0",
"size": 11491
} | [
"org.eclipse.swt.custom.StyleRange"
] | import org.eclipse.swt.custom.StyleRange; | import org.eclipse.swt.custom.*; | [
"org.eclipse.swt"
] | org.eclipse.swt; | 2,752,366 |
boolean removeAdjLabel(Link link); | boolean removeAdjLabel(Link link); | /**
* Removes adjacency label from adjacency label store for specified link information.
*
* @param link between nodes
* @return success or failure
*/ | Removes adjacency label from adjacency label store for specified link information | removeAdjLabel | {
"repo_name": "donNewtonAlpha/onos",
"path": "protocols/pcep/ctl/src/main/java/org/onosproject/pcelabelstore/api/PceLabelStore.java",
"license": "apache-2.0",
"size": 6098
} | [
"org.onosproject.net.Link"
] | import org.onosproject.net.Link; | import org.onosproject.net.*; | [
"org.onosproject.net"
] | org.onosproject.net; | 1,478,360 |
String getStatusMessage() throws IOException; | String getStatusMessage() throws IOException; | /**
* Returns the HTTP response's status message
* @return the HTTP response's status message
* @throws IOException
*/ | Returns the HTTP response's status message | getStatusMessage | {
"repo_name": "kuFEAR/crest",
"path": "core/src/main/java/org/codegist/crest/io/http/HttpChannel.java",
"license": "apache-2.0",
"size": 4337
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 343,402 |
RunCommandResult runShellScriptInVMInstance(
String vmId, List<String> scriptLines, List<RunCommandInputParameter> scriptParameters); | RunCommandResult runShellScriptInVMInstance( String vmId, List<String> scriptLines, List<RunCommandInputParameter> scriptParameters); | /**
* Run shell script in a virtual machine instance in a scale set.
*
* @param vmId the virtual machine instance id
* @param scriptLines shell script lines
* @param scriptParameters script parameters
* @return result of shell script execution
*/ | Run shell script in a virtual machine instance in a scale set | runShellScriptInVMInstance | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSet.java",
"license": "mit",
"size": 116192
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 700,118 |
public BigDecimal getCost ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_Cost);
if (bd == null)
return Env.ZERO;
return bd;
} | BigDecimal function () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_Cost); if (bd == null) return Env.ZERO; return bd; } | /** Get Cost.
@return Cost information
*/ | Get Cost | getCost | {
"repo_name": "neuroidss/adempiere",
"path": "base/src/org/compiere/model/X_T_BOM_Indented.java",
"license": "gpl-2.0",
"size": 11523
} | [
"java.math.BigDecimal",
"org.compiere.util.Env"
] | import java.math.BigDecimal; import org.compiere.util.Env; | import java.math.*; import org.compiere.util.*; | [
"java.math",
"org.compiere.util"
] | java.math; org.compiere.util; | 2,830,949 |
public static void printAsciiArtLog(VoltLogger vLogger, String msg, Level level)
{
if (vLogger == null || msg == null || level == Level.OFF) { return; }
// 80 stars in a line
StringBuilder starBuilder = new StringBuilder();
for (int i = 0; i < 80; i++) {
starBuilder.append("*");
}
String stars = starBuilder.toString();
// Wrap the message with 2 lines of stars
switch (level) {
case DEBUG:
vLogger.debug(stars);
vLogger.debug("* " + msg + " *");
vLogger.debug(stars);
break;
case WARN:
vLogger.warn(stars);
vLogger.warn("* " + msg + " *");
vLogger.warn(stars);
break;
case ERROR:
vLogger.error(stars);
vLogger.error("* " + msg + " *");
vLogger.error(stars);
break;
case FATAL:
vLogger.fatal(stars);
vLogger.fatal("* " + msg + " *");
vLogger.fatal(stars);
break;
case INFO:
vLogger.info(stars);
vLogger.info("* " + msg + " *");
vLogger.info(stars);
break;
case TRACE:
vLogger.trace(stars);
vLogger.trace("* " + msg + " *");
vLogger.trace(stars);
break;
default:
break;
}
} | static void function(VoltLogger vLogger, String msg, Level level) { if (vLogger == null msg == null level == Level.OFF) { return; } StringBuilder starBuilder = new StringBuilder(); for (int i = 0; i < 80; i++) { starBuilder.append("*"); } String stars = starBuilder.toString(); switch (level) { case DEBUG: vLogger.debug(stars); vLogger.debug(STR + msg + STR); vLogger.debug(stars); break; case WARN: vLogger.warn(stars); vLogger.warn(STR + msg + STR); vLogger.warn(stars); break; case ERROR: vLogger.error(stars); vLogger.error(STR + msg + STR); vLogger.error(stars); break; case FATAL: vLogger.fatal(stars); vLogger.fatal(STR + msg + STR); vLogger.fatal(stars); break; case INFO: vLogger.info(stars); vLogger.info(STR + msg + STR); vLogger.info(stars); break; case TRACE: vLogger.trace(stars); vLogger.trace(STR + msg + STR); vLogger.trace(stars); break; default: break; } } | /**
* Print beautiful logs surrounded by stars. This function handles long lines (wrapping
* into multiple lines) as well. Please use only spaces and newline characters for word
* separation.
* @param vLogger The provided VoltLogger
* @param msg Message to be printed out beautifully
* @param level Logging level
*/ | Print beautiful logs surrounded by stars. This function handles long lines (wrapping into multiple lines) as well. Please use only spaces and newline characters for word separation | printAsciiArtLog | {
"repo_name": "deerwalk/voltdb",
"path": "src/frontend/org/voltcore/utils/CoreUtils.java",
"license": "agpl-3.0",
"size": 47610
} | [
"org.voltcore.logging.Level",
"org.voltcore.logging.VoltLogger"
] | import org.voltcore.logging.Level; import org.voltcore.logging.VoltLogger; | import org.voltcore.logging.*; | [
"org.voltcore.logging"
] | org.voltcore.logging; | 2,566,017 |
public ActionForward manualEdit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
LaborCorrectionForm laborCorrectionForm = (LaborCorrectionForm) form;
LaborCorrectionDocument document = laborCorrectionForm.getLaborCorrectionDocument();
laborCorrectionForm.clearLaborEntryForManualEdit();
laborCorrectionForm.clearEntryForManualEdit();
laborCorrectionForm.setEditableFlag(true);
laborCorrectionForm.setManualEditFlag(false);
if ( document.getCorrectionChangeGroup().isEmpty() ) {
document.addCorrectionChangeGroup(new CorrectionChangeGroup());
}
return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
| ActionForward function(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { LaborCorrectionForm laborCorrectionForm = (LaborCorrectionForm) form; LaborCorrectionDocument document = laborCorrectionForm.getLaborCorrectionDocument(); laborCorrectionForm.clearLaborEntryForManualEdit(); laborCorrectionForm.clearEntryForManualEdit(); laborCorrectionForm.setEditableFlag(true); laborCorrectionForm.setManualEditFlag(false); if ( document.getCorrectionChangeGroup().isEmpty() ) { document.addCorrectionChangeGroup(new CorrectionChangeGroup()); } return mapping.findForward(KFSConstants.MAPPING_BASIC); } | /**
* Handles manual edit of labor correction form
*
* @see org.kuali.kfs.gl.document.web.struts.CorrectionAction#manualEdit(org.apache.struts.action.ActionMapping,
* org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
*/ | Handles manual edit of labor correction form | manualEdit | {
"repo_name": "ua-eas/ua-kfs-5.3",
"path": "work/src/org/kuali/kfs/module/ld/document/web/struts/LaborCorrectionAction.java",
"license": "agpl-3.0",
"size": 74380
} | [
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse",
"org.apache.struts.action.ActionForm",
"org.apache.struts.action.ActionForward",
"org.apache.struts.action.ActionMapping",
"org.kuali.kfs.gl.businessobject.CorrectionChangeGroup",
"org.kuali.kfs.module.ld.document.LaborCorrectionDocument",
"org.kuali.kfs.sys.KFSConstants"
] | import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.kuali.kfs.gl.businessobject.CorrectionChangeGroup; import org.kuali.kfs.module.ld.document.LaborCorrectionDocument; import org.kuali.kfs.sys.KFSConstants; | import javax.servlet.http.*; import org.apache.struts.action.*; import org.kuali.kfs.gl.businessobject.*; import org.kuali.kfs.module.ld.document.*; import org.kuali.kfs.sys.*; | [
"javax.servlet",
"org.apache.struts",
"org.kuali.kfs"
] | javax.servlet; org.apache.struts; org.kuali.kfs; | 2,487,453 |
public URL getUrl() throws MalformedURLException {
StringBuilder pathAndQuery = new StringBuilder(100);
String path = this.getPath();
// Hack to allow entire URL to be provided in host field
if (path.startsWith(HTTP_PREFIX)
|| path.startsWith(HTTPS_PREFIX)) {
return new URL(path);
}
String domain = getDomain();
String protocol = getProtocol();
if (PROTOCOL_FILE.equalsIgnoreCase(protocol)) {
domain = null; // allow use of relative file URLs
} else {
// HTTP URLs must be absolute, allow file to be relative
if (!path.startsWith("/")) { // $NON-NLS-1$
pathAndQuery.append("/"); // $NON-NLS-1$
}
}
pathAndQuery.append(path);
// Add the query string if it is a HTTP GET or DELETE request
if (HTTPConstants.GET.equals(getMethod()) || HTTPConstants.DELETE.equals(getMethod())) {
// Get the query string encoded in specified encoding
// If no encoding is specified by user, we will get it
// encoded in UTF-8, which is what the HTTP spec says
String queryString = getQueryString(getContentEncoding());
if (queryString.length() > 0) {
if (path.contains(QRY_PFX)) {// Already contains a prefix
pathAndQuery.append(QRY_SEP);
} else {
pathAndQuery.append(QRY_PFX);
}
pathAndQuery.append(queryString);
}
}
// If default port for protocol is used, we do not include port in URL
if (isProtocolDefaultPort()) {
return new URL(protocol, domain, pathAndQuery.toString());
}
return new URL(protocol, domain, getPort(), pathAndQuery.toString());
} | URL function() throws MalformedURLException { StringBuilder pathAndQuery = new StringBuilder(100); String path = this.getPath(); if (path.startsWith(HTTP_PREFIX) path.startsWith(HTTPS_PREFIX)) { return new URL(path); } String domain = getDomain(); String protocol = getProtocol(); if (PROTOCOL_FILE.equalsIgnoreCase(protocol)) { domain = null; } else { if (!path.startsWith("/")) { pathAndQuery.append("/"); } } pathAndQuery.append(path); if (HTTPConstants.GET.equals(getMethod()) HTTPConstants.DELETE.equals(getMethod())) { String queryString = getQueryString(getContentEncoding()); if (queryString.length() > 0) { if (path.contains(QRY_PFX)) { pathAndQuery.append(QRY_SEP); } else { pathAndQuery.append(QRY_PFX); } pathAndQuery.append(queryString); } } if (isProtocolDefaultPort()) { return new URL(protocol, domain, pathAndQuery.toString()); } return new URL(protocol, domain, getPort(), pathAndQuery.toString()); } | /**
* Get the URL, built from its component parts.
*
* <p>
* As a special case, if the path starts with "http[s]://",
* then the path is assumed to be the entire URL.
* </p>
*
* @return The URL to be requested by this sampler.
* @throws MalformedURLException if url is malformed
*/ | Get the URL, built from its component parts. As a special case, if the path starts with "http[s]://", then the path is assumed to be the entire URL. | getUrl | {
"repo_name": "johrstrom/cloud-meter",
"path": "cloud-meter-protocols/src/main/java/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java",
"license": "apache-2.0",
"size": 78461
} | [
"java.net.MalformedURLException",
"org.apache.jmeter.protocol.http.util.HTTPConstants"
] | import java.net.MalformedURLException; import org.apache.jmeter.protocol.http.util.HTTPConstants; | import java.net.*; import org.apache.jmeter.protocol.http.util.*; | [
"java.net",
"org.apache.jmeter"
] | java.net; org.apache.jmeter; | 933,940 |
public final static void addHostkeyToFile(File knownHosts, String[] hostnames, String serverHostKeyAlgorithm,
byte[] serverHostKey) throws IOException
{
if ((hostnames == null) || (hostnames.length == 0))
throw new IllegalArgumentException("Need at least one hostname specification");
if ((serverHostKeyAlgorithm == null) || (serverHostKey == null))
throw new IllegalArgumentException();
CharArrayWriter writer = new CharArrayWriter();
for (int i = 0; i < hostnames.length; i++)
{
if (i != 0)
writer.write(',');
writer.write(hostnames[i]);
}
writer.write(' ');
writer.write(serverHostKeyAlgorithm);
writer.write(' ');
writer.write(Base64.encode(serverHostKey));
writer.write("\n");
char[] entry = writer.toCharArray();
RandomAccessFile raf = new RandomAccessFile(knownHosts, "rw");
long len = raf.length();
if (len > 0)
{
raf.seek(len - 1);
int last = raf.read();
if (last != '\n')
raf.write('\n');
}
raf.write(new String(entry).getBytes("ISO-8859-1"));
raf.close();
}
| final static void function(File knownHosts, String[] hostnames, String serverHostKeyAlgorithm, byte[] serverHostKey) throws IOException { if ((hostnames == null) (hostnames.length == 0)) throw new IllegalArgumentException(STR); if ((serverHostKeyAlgorithm == null) (serverHostKey == null)) throw new IllegalArgumentException(); CharArrayWriter writer = new CharArrayWriter(); for (int i = 0; i < hostnames.length; i++) { if (i != 0) writer.write(','); writer.write(hostnames[i]); } writer.write(' '); writer.write(serverHostKeyAlgorithm); writer.write(' '); writer.write(Base64.encode(serverHostKey)); writer.write("\n"); char[] entry = writer.toCharArray(); RandomAccessFile raf = new RandomAccessFile(knownHosts, "rw"); long len = raf.length(); if (len > 0) { raf.seek(len - 1); int last = raf.read(); if (last != '\n') raf.write('\n'); } raf.write(new String(entry).getBytes(STR)); raf.close(); } | /**
* Adds a single public key entry to the a known_hosts file.
* This method is designed to be used in a {@link ServerHostKeyVerifier}.
*
* @param knownHosts the file where the publickey entry will be appended.
* @param hostnames a list of hostname patterns - at least one most be specified. Check out the
* OpenSSH sshd man page for a description of the pattern matching algorithm.
* @param serverHostKeyAlgorithm as passed to the {@link ServerHostKeyVerifier}.
* @param serverHostKey as passed to the {@link ServerHostKeyVerifier}.
* @throws IOException
*/ | Adds a single public key entry to the a known_hosts file. This method is designed to be used in a <code>ServerHostKeyVerifier</code> | addHostkeyToFile | {
"repo_name": "kyau/connectbot",
"path": "src/com/trilead/ssh2/KnownHosts.java",
"license": "apache-2.0",
"size": 22818
} | [
"com.trilead.ssh2.crypto.Base64",
"java.io.CharArrayWriter",
"java.io.File",
"java.io.IOException",
"java.io.RandomAccessFile"
] | import com.trilead.ssh2.crypto.Base64; import java.io.CharArrayWriter; import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; | import com.trilead.ssh2.crypto.*; import java.io.*; | [
"com.trilead.ssh2",
"java.io"
] | com.trilead.ssh2; java.io; | 1,216,724 |
public void sendARAnimationObject(final int objectId, final Bitmap bitmap) {
if (objectId <= 0) {
throw new IllegalArgumentException("objectId has illegal value");
}
if (bitmap == null) {
throw new IllegalArgumentException("bitmap has illegal value");
}
if ((bitmap.getHeight() * bitmap.getWidth()) > IMAGE_PIXEL_SIZE_MAX) {
throw new IllegalArgumentException("Images that are trying to display too large");
}
if (mLocalRenderAnimationSocket != null) {
try {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, PNG_COMPLESS_QUALITY, byteArrayOutputStream);
byte[] imageByteArray = byteArrayOutputStream.toByteArray();
DataOutputStream outputStream = new DataOutputStream(mLocalRenderAnimationSocket.getOutputStream());
outputStream.writeInt(objectId);
outputStream.writeInt(SmartEyeglassControl.Intents.INVALID_DISPLAY_DATA_TRANSACTION_NUMBER);
outputStream.writeInt(imageByteArray.length);
outputStream.write(imageByteArray);
} catch (IOException e) {
if (Dbg.DEBUG) {
Dbg.e(e.getMessage(), e);
}
}
}
}
/**
* Sends the image data of each frame of the animation object.
* A processing result will be notified if display processing is completed.
* Response method {@link com.sony.smarteyeglass.extension.util.SmartEyeglassEventListener#onResultSendAnimationObject(int,int)} | void function(final int objectId, final Bitmap bitmap) { if (objectId <= 0) { throw new IllegalArgumentException(STR); } if (bitmap == null) { throw new IllegalArgumentException(STR); } if ((bitmap.getHeight() * bitmap.getWidth()) > IMAGE_PIXEL_SIZE_MAX) { throw new IllegalArgumentException(STR); } if (mLocalRenderAnimationSocket != null) { try { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.PNG, PNG_COMPLESS_QUALITY, byteArrayOutputStream); byte[] imageByteArray = byteArrayOutputStream.toByteArray(); DataOutputStream outputStream = new DataOutputStream(mLocalRenderAnimationSocket.getOutputStream()); outputStream.writeInt(objectId); outputStream.writeInt(SmartEyeglassControl.Intents.INVALID_DISPLAY_DATA_TRANSACTION_NUMBER); outputStream.writeInt(imageByteArray.length); outputStream.write(imageByteArray); } catch (IOException e) { if (Dbg.DEBUG) { Dbg.e(e.getMessage(), e); } } } } /** * Sends the image data of each frame of the animation object. * A processing result will be notified if display processing is completed. * Response method {@link com.sony.smarteyeglass.extension.util.SmartEyeglassEventListener#onResultSendAnimationObject(int,int)} | /**
* Sends image data in response to a request from the AR engine for update of
* an animation display. Call this in your handler for
* {@link com.sony.smarteyeglass.extension.util.SmartEyeglassEventListener#onARObjectRequest}.
* Image of more than 57822 pixels can not be sent.
*
* @param objectId The object identified in the request event.
* @param bitmap The bitmap for the next animation frame.
*/ | Sends image data in response to a request from the AR engine for update of an animation display. Call this in your handler for <code>com.sony.smarteyeglass.extension.util.SmartEyeglassEventListener#onARObjectRequest</code>. Image of more than 57822 pixels can not be sent | sendARAnimationObject | {
"repo_name": "jphacks/HK_08",
"path": "SmartEyeglassAPI/src/main/java/com/sony/smarteyeglass/extension/util/SmartEyeglassControlUtils.java",
"license": "mit",
"size": 71971
} | [
"android.graphics.Bitmap",
"com.sony.smarteyeglass.SmartEyeglassControl",
"java.io.ByteArrayOutputStream",
"java.io.DataOutputStream",
"java.io.IOException"
] | import android.graphics.Bitmap; import com.sony.smarteyeglass.SmartEyeglassControl; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.IOException; | import android.graphics.*; import com.sony.smarteyeglass.*; import java.io.*; | [
"android.graphics",
"com.sony.smarteyeglass",
"java.io"
] | android.graphics; com.sony.smarteyeglass; java.io; | 1,378,380 |
@Generated
@CVariable()
@NInt
public static native long GCKeyCodeKeypad7(); | @CVariable() static native long function(); | /**
* Keypad 7 or Home
*/ | Keypad 7 or Home | GCKeyCodeKeypad7 | {
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/gamecontroller/c/GameController.java",
"license": "apache-2.0",
"size": 61506
} | [
"org.moe.natj.c.ann.CVariable"
] | import org.moe.natj.c.ann.CVariable; | import org.moe.natj.c.ann.*; | [
"org.moe.natj"
] | org.moe.natj; | 1,250,295 |
private IgniteFuture<Void> dotnetDeployAsync(BinaryRawReaderEx reader, IgniteServices services) {
ServiceConfiguration cfg = dotnetConfiguration(reader);
return services.deployAsync(cfg);
} | IgniteFuture<Void> function(BinaryRawReaderEx reader, IgniteServices services) { ServiceConfiguration cfg = dotnetConfiguration(reader); return services.deployAsync(cfg); } | /**
* Deploys dotnet service asynchronously.
*
* @param reader Binary reader.
* @param services Services.
* @return Future of the operation.
*/ | Deploys dotnet service asynchronously | dotnetDeployAsync | {
"repo_name": "ilantukh/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/platform/services/PlatformServices.java",
"license": "apache-2.0",
"size": 26159
} | [
"org.apache.ignite.IgniteServices",
"org.apache.ignite.internal.binary.BinaryRawReaderEx",
"org.apache.ignite.lang.IgniteFuture",
"org.apache.ignite.services.ServiceConfiguration"
] | import org.apache.ignite.IgniteServices; import org.apache.ignite.internal.binary.BinaryRawReaderEx; import org.apache.ignite.lang.IgniteFuture; import org.apache.ignite.services.ServiceConfiguration; | import org.apache.ignite.*; import org.apache.ignite.internal.binary.*; import org.apache.ignite.lang.*; import org.apache.ignite.services.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 1,389,377 |
public void onOnButtonPress(OnButtonPress notification);
| void function(OnButtonPress notification); | /**
* onButtonPress being called indicates that SDL has a button has
* been pressed by the user.
*
* @param notification - Contains information about the notification sent from SDL.
*/ | onButtonPress being called indicates that SDL has a button has been pressed by the user | onOnButtonPress | {
"repo_name": "914802951/sdl_android",
"path": "sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerBase.java",
"license": "bsd-3-clause",
"size": 14857
} | [
"com.smartdevicelink.proxy.rpc.OnButtonPress"
] | import com.smartdevicelink.proxy.rpc.OnButtonPress; | import com.smartdevicelink.proxy.rpc.*; | [
"com.smartdevicelink.proxy"
] | com.smartdevicelink.proxy; | 2,227,031 |
public void addStrongListener(@NotNull IPropertyPitEventListener pListener)
{
getPit().addStrongListener(pListener);
} | void function(@NotNull IPropertyPitEventListener pListener) { getPit().addStrongListener(pListener); } | /**
* Adds a strong listener.
*
* @param pListener the listener to be strongly added.
*/ | Adds a strong listener | addStrongListener | {
"repo_name": "aditosoftware/propertly",
"path": "propertly.core/src/main/java/de/adito/propertly/core/spi/extension/AbstractPropertyPitProviderBase.java",
"license": "mit",
"size": 2986
} | [
"de.adito.propertly.core.spi.IPropertyPitEventListener",
"org.jetbrains.annotations.NotNull"
] | import de.adito.propertly.core.spi.IPropertyPitEventListener; import org.jetbrains.annotations.NotNull; | import de.adito.propertly.core.spi.*; import org.jetbrains.annotations.*; | [
"de.adito.propertly",
"org.jetbrains.annotations"
] | de.adito.propertly; org.jetbrains.annotations; | 1,981,794 |
public void setDbWorkUser(String dbWorkUser) {
setExtProperty(CmsDbPool.KEY_DATABASE_POOL + '.' + getPool() + '.' + CmsDbPool.KEY_POOL_USER, dbWorkUser);
} | void function(String dbWorkUser) { setExtProperty(CmsDbPool.KEY_DATABASE_POOL + '.' + getPool() + '.' + CmsDbPool.KEY_POOL_USER, dbWorkUser); } | /**
* Sets the user of the database to the given value.<p>
*
* @param dbWorkUser the database user used by the opencms core
*/ | Sets the user of the database to the given value | setDbWorkUser | {
"repo_name": "ggiudetti/opencms-core",
"path": "src-setup/org/opencms/setup/CmsSetupBean.java",
"license": "lgpl-2.1",
"size": 116372
} | [
"org.opencms.db.CmsDbPool"
] | import org.opencms.db.CmsDbPool; | import org.opencms.db.*; | [
"org.opencms.db"
] | org.opencms.db; | 2,544,463 |
public List<SystemOverview> listVirtualHosts(User loggedInUser) {
return SystemManager.listVirtualHosts(loggedInUser);
} | List<SystemOverview> function(User loggedInUser) { return SystemManager.listVirtualHosts(loggedInUser); } | /**
* Gets a list of virtual hosts for the current user
* @param loggedInUser The current user
* @return list of SystemOverview objects
*
* @xmlrpc.doc Lists the virtual hosts visible to the user
* @xmlrpc.param #param("string", "sessionKey")
* @xmlrpc.returntype
* #array()
* $SystemOverviewSerializer
* #array_end()
*/ | Gets a list of virtual hosts for the current user | listVirtualHosts | {
"repo_name": "jdobes/spacewalk",
"path": "java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java",
"license": "gpl-2.0",
"size": 240801
} | [
"com.redhat.rhn.domain.user.User",
"com.redhat.rhn.frontend.dto.SystemOverview",
"com.redhat.rhn.manager.system.SystemManager",
"java.util.List"
] | import com.redhat.rhn.domain.user.User; import com.redhat.rhn.frontend.dto.SystemOverview; import com.redhat.rhn.manager.system.SystemManager; import java.util.List; | import com.redhat.rhn.domain.user.*; import com.redhat.rhn.frontend.dto.*; import com.redhat.rhn.manager.system.*; import java.util.*; | [
"com.redhat.rhn",
"java.util"
] | com.redhat.rhn; java.util; | 2,280,077 |
public static ILazyWriteableDataset createLazyWriteableDataset(String name, int dtype, int[] shape, int[] maxShape, int[] chunks) {
return new LazyWriteableDataset(name, dtype, shape, maxShape, chunks, null);
} | static ILazyWriteableDataset function(String name, int dtype, int[] shape, int[] maxShape, int[] chunks) { return new LazyWriteableDataset(name, dtype, shape, maxShape, chunks, null); } | /**
* Create a lazy writeable dataset
* @param name
* @param dtype
* @param shape
* @param maxShape
* @param chunks
* @return lazy writeable dataset
*/ | Create a lazy writeable dataset | createLazyWriteableDataset | {
"repo_name": "jamesmudd/dawnsci",
"path": "org.eclipse.dawnsci.nexus/src/org/eclipse/dawnsci/nexus/NexusUtils.java",
"license": "epl-1.0",
"size": 16295
} | [
"org.eclipse.january.dataset.ILazyWriteableDataset",
"org.eclipse.january.dataset.LazyWriteableDataset"
] | import org.eclipse.january.dataset.ILazyWriteableDataset; import org.eclipse.january.dataset.LazyWriteableDataset; | import org.eclipse.january.dataset.*; | [
"org.eclipse.january"
] | org.eclipse.january; | 578,146 |
IterableStream<T> iterableStream = this.getElements();
return iterableStream == null
? new ArrayList<>()
: this.getElements().stream().collect(Collectors.toList());
} | IterableStream<T> iterableStream = this.getElements(); return iterableStream == null ? new ArrayList<>() : this.getElements().stream().collect(Collectors.toList()); } | /**
* Get list of elements in the page.
*
* @return the page elements
*
* @deprecated use {@link #getElements()}.
*/ | Get list of elements in the page | getItems | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/core/azure-core/src/main/java/com/azure/core/http/rest/Page.java",
"license": "mit",
"size": 909
} | [
"com.azure.core.util.IterableStream",
"java.util.ArrayList",
"java.util.stream.Collectors"
] | import com.azure.core.util.IterableStream; import java.util.ArrayList; import java.util.stream.Collectors; | import com.azure.core.util.*; import java.util.*; import java.util.stream.*; | [
"com.azure.core",
"java.util"
] | com.azure.core; java.util; | 1,929,907 |
public void setAwsConnectionFactory(AwsConnectionFactory awsConnectionFactory) {
this.awsConnectionFactory = awsConnectionFactory;
}
| void function(AwsConnectionFactory awsConnectionFactory) { this.awsConnectionFactory = awsConnectionFactory; } | /**
* Sets the AwsConnectionFactory used to load AWS configuration/authentication
* data and instantiate an AmazonEC2Client.
*
* @param awsConnectionFactory
* the AwsConnectionFactory used to load AWS configuration/authentication data and instantiate an AmazonEC2Client.
*/ | Sets the AwsConnectionFactory used to load AWS configuration/authentication data and instantiate an AmazonEC2Client | setAwsConnectionFactory | {
"repo_name": "deleidos/digitaledge-platform",
"path": "ingest/src/main/java/com/deleidos/rtws/core/framework/processor/AbstractDataSink.java",
"license": "apache-2.0",
"size": 22739
} | [
"com.deleidos.rtws.commons.cloud.platform.aws.AwsConnectionFactory"
] | import com.deleidos.rtws.commons.cloud.platform.aws.AwsConnectionFactory; | import com.deleidos.rtws.commons.cloud.platform.aws.*; | [
"com.deleidos.rtws"
] | com.deleidos.rtws; | 742,749 |
public void addPropertyChangeListener(PropertyChangeListener listener) {
propertyChangeSupport.addPropertyChangeListener(listener);
} | void function(PropertyChangeListener listener) { propertyChangeSupport.addPropertyChangeListener(listener); } | /**
* Register a listener to the the model, this will be a controller
* that wants to listen to changes done to the model.
*
* @param listener
*/ | Register a listener to the the model, this will be a controller that wants to listen to changes done to the model | addPropertyChangeListener | {
"repo_name": "samuel02/WeatherApp",
"path": "src/app/models/AbstractModel.java",
"license": "mit",
"size": 2038
} | [
"java.beans.PropertyChangeListener"
] | import java.beans.PropertyChangeListener; | import java.beans.*; | [
"java.beans"
] | java.beans; | 2,205,111 |
HashSet<OPT_Register> getLiveRegistersOnEdge(OPT_BasicBlock bb1, OPT_BasicBlock bb2) {
HashSet<OPT_Register> s1 = getLiveRegistersOnExit(bb1);
HashSet<OPT_Register> s2 = getLiveRegistersOnEntry(bb2);
s1.retainAll(s2);
return s1;
} | HashSet<OPT_Register> getLiveRegistersOnEdge(OPT_BasicBlock bb1, OPT_BasicBlock bb2) { HashSet<OPT_Register> s1 = getLiveRegistersOnExit(bb1); HashSet<OPT_Register> s2 = getLiveRegistersOnEntry(bb2); s1.retainAll(s2); return s1; } | /**
* Return the set of registers that are live on the control-flow edge
* basic block bb1 to basic block bb2
*/ | Return the set of registers that are live on the control-flow edge basic block bb1 to basic block bb2 | getLiveRegistersOnEdge | {
"repo_name": "rmcilroy/HeraJVM",
"path": "rvm/src/org/jikesrvm/compilers/opt/OPT_LiveAnalysis.java",
"license": "epl-1.0",
"size": 48238
} | [
"java.util.HashSet"
] | import java.util.HashSet; | import java.util.*; | [
"java.util"
] | java.util; | 2,547,653 |
public static String encode(String part) {
try {
return URLEncoder.encode(part, "utf-8");
} catch (Exception e) {
throw new RuntimeException(e);
}
} | static String function(String part) { try { return URLEncoder.encode(part, "utf-8"); } catch (Exception e) { throw new RuntimeException(e); } } | /**
* URL-encode an UTF-8 string to be used as a query string parameter.
* @param part string to encode
* @return url-encoded string
*/ | URL-encode an UTF-8 string to be used as a query string parameter | encode | {
"repo_name": "ericlink/adms-server",
"path": "playframework-dist/play-1.1/framework/src/play/libs/WS.java",
"license": "mit",
"size": 14564
} | [
"java.net.URLEncoder"
] | import java.net.URLEncoder; | import java.net.*; | [
"java.net"
] | java.net; | 600,091 |
public void setInetSocketAddress(InetSocketAddress socketAddress) {
this.socketAddress = socketAddress;
synchronized (this) {
this.proxy = null;
}
} | void function(InetSocketAddress socketAddress) { this.socketAddress = socketAddress; synchronized (this) { this.proxy = null; } } | /**
* Sets the inet socket address.
*
* @param socketAddress the new inet socket address
*/ | Sets the inet socket address | setInetSocketAddress | {
"repo_name": "oswetto/LoboEvolution",
"path": "LoboCommon/src/main/java/org/loboevolution/store/ConnectionStore.java",
"license": "gpl-3.0",
"size": 8217
} | [
"java.net.InetSocketAddress"
] | import java.net.InetSocketAddress; | import java.net.*; | [
"java.net"
] | java.net; | 1,119,330 |
@Override
public Content getSignature(ExecutableElement method) {
Content pre = new HtmlTree(HtmlTag.PRE);
writer.addAnnotationInfo(method, pre);
int annotationLength = pre.charCount();
addModifiers(method, pre);
addTypeParameters(method, pre);
addReturnType(method, pre);
if (configuration.linksource) {
Content methodName = new StringContent(name(method));
writer.addSrcLink(method, methodName, pre);
} else {
addName(name(method), pre);
}
int indent = pre.charCount() - annotationLength;
addParameters(method, pre, indent);
addExceptions(method, pre, indent);
return pre;
}
/**
* {@inheritDoc} | Content function(ExecutableElement method) { Content pre = new HtmlTree(HtmlTag.PRE); writer.addAnnotationInfo(method, pre); int annotationLength = pre.charCount(); addModifiers(method, pre); addTypeParameters(method, pre); addReturnType(method, pre); if (configuration.linksource) { Content methodName = new StringContent(name(method)); writer.addSrcLink(method, methodName, pre); } else { addName(name(method), pre); } int indent = pre.charCount() - annotationLength; addParameters(method, pre, indent); addExceptions(method, pre, indent); return pre; } /** * {@inheritDoc} | /**
* Get the signature for the given method.
*
* @param method the method being documented.
* @return a content object for the signature
*/ | Get the signature for the given method | getSignature | {
"repo_name": "google/error-prone-javac",
"path": "src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java",
"license": "gpl-2.0",
"size": 16566
} | [
"javax.lang.model.element.ExecutableElement"
] | import javax.lang.model.element.ExecutableElement; | import javax.lang.model.element.*; | [
"javax.lang"
] | javax.lang; | 1,235,431 |
Map<Integer,Integer> offset_Score_Table=new HashMap<>(); // offset_Score_Table<offset,count>
int numFrames;
float score=0;
int mostSimilarFramePosition=Integer.MIN_VALUE;
// one frame may contain several points, use the shorter one be the denominator
if (fingerprint1.length>fingerprint2.length){
numFrames=FingerprintManager.getNumFrames(fingerprint2);
}
else{
numFrames=FingerprintManager.getNumFrames(fingerprint1);
}
// get the pairs
PairManager pairManager=new PairManager();
Map<Integer,List<Integer>> this_Pair_PositionList_Table=pairManager.getPair_PositionList_Table(fingerprint1);
Map<Integer,List<Integer>> compareWave_Pair_PositionList_Table=pairManager.getPair_PositionList_Table(fingerprint2);
for (Integer compareWaveHashNumber : compareWave_Pair_PositionList_Table.keySet()) {
// if the compareWaveHashNumber doesn't exist in both tables, no need to compare
if (!this_Pair_PositionList_Table.containsKey(compareWaveHashNumber)
|| !compareWave_Pair_PositionList_Table.containsKey(compareWaveHashNumber)) {
continue;
}
// for each compare hash number, get the positions
List<Integer> wavePositionList = this_Pair_PositionList_Table.get(compareWaveHashNumber);
List<Integer> compareWavePositionList = compareWave_Pair_PositionList_Table.get(compareWaveHashNumber);
for (Integer thisPosition : wavePositionList) {
for (Integer compareWavePosition : compareWavePositionList) {
int offset = thisPosition - compareWavePosition;
if (offset_Score_Table.containsKey(offset)) {
offset_Score_Table.put(offset, offset_Score_Table.get(offset) + 1);
} else {
offset_Score_Table.put(offset, 1);
}
}
}
}
// map rank
MapRank mapRank=new MapRankInteger(offset_Score_Table,false);
// get the most similar positions and scores
List<Integer> orderedKeyList=mapRank.getOrderedKeyList(100, true);
if (orderedKeyList.size()>0){
int key=orderedKeyList.get(0);
// get the highest score position
mostSimilarFramePosition=key;
score=offset_Score_Table.get(key);
// accumulate the scores from neighbours
if (offset_Score_Table.containsKey(key-1)){
score+=offset_Score_Table.get(key-1)/2;
}
if (offset_Score_Table.containsKey(key+1)){
score+=offset_Score_Table.get(key+1)/2;
}
}
score/=numFrames;
float similarity=score;
// similarity >1 means in average there is at least one match in every frame
if (similarity>1){
similarity=1;
}
fingerprintSimilarity.setMostSimilarFramePosition(mostSimilarFramePosition);
fingerprintSimilarity.setScore(score);
fingerprintSimilarity.setSimilarity(similarity);
return fingerprintSimilarity;
}
| Map<Integer,Integer> offset_Score_Table=new HashMap<>(); int numFrames; float score=0; int mostSimilarFramePosition=Integer.MIN_VALUE; if (fingerprint1.length>fingerprint2.length){ numFrames=FingerprintManager.getNumFrames(fingerprint2); } else{ numFrames=FingerprintManager.getNumFrames(fingerprint1); } PairManager pairManager=new PairManager(); Map<Integer,List<Integer>> this_Pair_PositionList_Table=pairManager.getPair_PositionList_Table(fingerprint1); Map<Integer,List<Integer>> compareWave_Pair_PositionList_Table=pairManager.getPair_PositionList_Table(fingerprint2); for (Integer compareWaveHashNumber : compareWave_Pair_PositionList_Table.keySet()) { if (!this_Pair_PositionList_Table.containsKey(compareWaveHashNumber) !compareWave_Pair_PositionList_Table.containsKey(compareWaveHashNumber)) { continue; } List<Integer> wavePositionList = this_Pair_PositionList_Table.get(compareWaveHashNumber); List<Integer> compareWavePositionList = compareWave_Pair_PositionList_Table.get(compareWaveHashNumber); for (Integer thisPosition : wavePositionList) { for (Integer compareWavePosition : compareWavePositionList) { int offset = thisPosition - compareWavePosition; if (offset_Score_Table.containsKey(offset)) { offset_Score_Table.put(offset, offset_Score_Table.get(offset) + 1); } else { offset_Score_Table.put(offset, 1); } } } } MapRank mapRank=new MapRankInteger(offset_Score_Table,false); List<Integer> orderedKeyList=mapRank.getOrderedKeyList(100, true); if (orderedKeyList.size()>0){ int key=orderedKeyList.get(0); mostSimilarFramePosition=key; score=offset_Score_Table.get(key); if (offset_Score_Table.containsKey(key-1)){ score+=offset_Score_Table.get(key-1)/2; } if (offset_Score_Table.containsKey(key+1)){ score+=offset_Score_Table.get(key+1)/2; } } score/=numFrames; float similarity=score; if (similarity>1){ similarity=1; } fingerprintSimilarity.setMostSimilarFramePosition(mostSimilarFramePosition); fingerprintSimilarity.setScore(score); fingerprintSimilarity.setSimilarity(similarity); return fingerprintSimilarity; } | /**
* Get fingerprint similarity of inout fingerprints
*
* @return fingerprint similarity object
*/ | Get fingerprint similarity of inout fingerprints | getFingerprintsSimilarity | {
"repo_name": "ZenDevelopmentSystems/Canova",
"path": "canova-data/canova-data-audio/src/main/java/org/canova/sound/musicg/fingerprint/FingerprintSimilarityComputer.java",
"license": "apache-2.0",
"size": 4785
} | [
"java.util.HashMap",
"java.util.List",
"java.util.Map"
] | import java.util.HashMap; import java.util.List; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,239,807 |
@Override
public String toString() {
Structure s = getStructure();
return String.format("%s: [key=%s]",
s.getString("event"), s.getString("key"));
}
} | String function() { Structure s = getStructure(); return String.format(STR, s.getString("event"), s.getString("key")); } } | /**
* Gets a human-readable string representation of this navigation event.
*
* @return a string
*/ | Gets a human-readable string representation of this navigation event | toString | {
"repo_name": "gstreamer-java/gstreamer1.x-java",
"path": "src/org/gstreamer/event/NavigationEvent.java",
"license": "gpl-3.0",
"size": 7176
} | [
"org.gstreamer.Structure"
] | import org.gstreamer.Structure; | import org.gstreamer.*; | [
"org.gstreamer"
] | org.gstreamer; | 2,585,262 |
public static void fadeOut(final View view) {
fadeOut(view, null);
} | static void function(final View view) { fadeOut(view, null); } | /**
* Fades out a view.
* @param view The currently visible view to be faded out
*/ | Fades out a view | fadeOut | {
"repo_name": "reproio/apps-android-wikipedia",
"path": "wikipedia/src/main/java/org/wikipedia/ViewAnimations.java",
"license": "apache-2.0",
"size": 8618
} | [
"android.view.View"
] | import android.view.View; | import android.view.*; | [
"android.view"
] | android.view; | 1,886,353 |
@Nullable
public JSONObject getThingProperties() { return this.thingProperties; } | public JSONObject getThingProperties() { return this.thingProperties; } | /**
* get firmware version.
* @return firmware version.
*/ | get firmware version | getFirmwareVersion | {
"repo_name": "KiiPlatform/thing-if-AndroidSDK",
"path": "thingif/src/main/java/com/kii/thing_if/OnboardWithVendorThingIDOptions.java",
"license": "mit",
"size": 4136
} | [
"org.json.JSONObject"
] | import org.json.JSONObject; | import org.json.*; | [
"org.json"
] | org.json; | 2,087,709 |
private PointcutParser initializePointcutParser(ClassLoader cl) {
PointcutParser parser = PointcutParser
.getPointcutParserSupportingSpecifiedPrimitivesAndUsingSpecifiedClassLoaderForResolution(
SUPPORTED_PRIMITIVES, cl);
parser.registerPointcutDesignatorHandler(new BeanNamePointcutDesignatorHandler());
return parser;
} | PointcutParser function(ClassLoader cl) { PointcutParser parser = PointcutParser .getPointcutParserSupportingSpecifiedPrimitivesAndUsingSpecifiedClassLoaderForResolution( SUPPORTED_PRIMITIVES, cl); parser.registerPointcutDesignatorHandler(new BeanNamePointcutDesignatorHandler()); return parser; } | /**
* Initialize the underlying AspectJ pointcut parser.
*/ | Initialize the underlying AspectJ pointcut parser | initializePointcutParser | {
"repo_name": "deathspeeder/class-guard",
"path": "spring-framework-3.2.x/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java",
"license": "gpl-2.0",
"size": 22685
} | [
"org.aspectj.weaver.tools.PointcutParser"
] | import org.aspectj.weaver.tools.PointcutParser; | import org.aspectj.weaver.tools.*; | [
"org.aspectj.weaver"
] | org.aspectj.weaver; | 2,438,875 |
@Relation("RETURNS")
TypeDescriptor getReturns(); | @Relation(STR) TypeDescriptor getReturns(); | /**
* Return the return type of this method.
*
* @return The return type.
*/ | Return the return type of this method | getReturns | {
"repo_name": "kontext-e/jqassistant",
"path": "plugin/java/src/main/java/com/buschmais/jqassistant/plugin/java/api/model/MethodDescriptor.java",
"license": "gpl-3.0",
"size": 2778
} | [
"com.buschmais.xo.neo4j.api.annotation.Relation"
] | import com.buschmais.xo.neo4j.api.annotation.Relation; | import com.buschmais.xo.neo4j.api.annotation.*; | [
"com.buschmais.xo"
] | com.buschmais.xo; | 791,626 |
TestSuite suite = new TestSuite("Tests for package " + AllTests.class.getPackage().getName());
OpenCmsTestProperties.initialize(org.opencms.test.AllTests.TEST_PROPERTIES_PATH);
//$JUnit-BEGIN$
suite.addTest(new TestSuite(TestCmsFlexCacheEntry.class));
suite.addTest(TestCmsFlexResponse.suite());
//$JUnit-END$
return suite;
} | TestSuite suite = new TestSuite(STR + AllTests.class.getPackage().getName()); OpenCmsTestProperties.initialize(org.opencms.test.AllTests.TEST_PROPERTIES_PATH); suite.addTest(new TestSuite(TestCmsFlexCacheEntry.class)); suite.addTest(TestCmsFlexResponse.suite()); return suite; } | /**
* Returns the JUnit test suite for this package.<p>
*
* @return the JUnit test suite for this package
*/ | Returns the JUnit test suite for this package | suite | {
"repo_name": "ggiudetti/opencms-core",
"path": "test/org/opencms/flex/AllTests.java",
"license": "lgpl-2.1",
"size": 2097
} | [
"junit.framework.TestSuite",
"org.opencms.test.OpenCmsTestProperties"
] | import junit.framework.TestSuite; import org.opencms.test.OpenCmsTestProperties; | import junit.framework.*; import org.opencms.test.*; | [
"junit.framework",
"org.opencms.test"
] | junit.framework; org.opencms.test; | 2,608,783 |
public void deactivate()
{
// unregister the service
this.unregisterNetworkService();
// log
this.logger.log(LogService.LOG_INFO, "Deactivated...");
} | void function() { this.unregisterNetworkService(); this.logger.log(LogService.LOG_INFO, STR); } | /**
* Deactivates the driver, i.e, removes its services from the framework.
*/ | Deactivates the driver, i.e, removes its services from the framework | deactivate | {
"repo_name": "dog-gateway/hue-drivers",
"path": "it.polito.elite.dog.drivers.hue.network/src/it/polito/elite/dog/drivers/hue/network/HueNetworkDriver.java",
"license": "apache-2.0",
"size": 11581
} | [
"org.osgi.service.log.LogService"
] | import org.osgi.service.log.LogService; | import org.osgi.service.log.*; | [
"org.osgi.service"
] | org.osgi.service; | 716,174 |
public interface Model extends EObject
{
String getName(); | interface Model extends EObject { String function(); | /**
* Returns the value of the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Name</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Name</em>' attribute.
* @see #setName(String)
* @see org.xtext.mgpl.mgplDSL.MgplDSLPackage#getModel_Name()
* @model
* @generated
*/ | Returns the value of the 'Name' attribute. If the meaning of the 'Name' attribute isn't clear, there really should be more of a description here... | getName | {
"repo_name": "santifa/compilerbau",
"path": "projekt2/Neu/org.xtext.mgpl/src-gen/org/xtext/mgpl/mgplDSL/Model.java",
"license": "bsd-3-clause",
"size": 4546
} | [
"org.eclipse.emf.ecore.EObject"
] | import org.eclipse.emf.ecore.EObject; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,335,081 |
public int importJson(String jsonFile, String keyspace, String cf, String ssTablePath) throws IOException
{
ColumnFamily columnFamily = ColumnFamily.create(keyspace, cf);
IPartitioner<?> partitioner = DatabaseDescriptor.getPartitioner();
int importedKeys = (isSorted) ? importSorted(jsonFile, columnFamily, ssTablePath, partitioner)
: importUnsorted(jsonFile, columnFamily, ssTablePath, partitioner);
if (importedKeys != -1)
System.out.printf("%d keys imported successfully.%n", importedKeys);
return importedKeys;
} | int function(String jsonFile, String keyspace, String cf, String ssTablePath) throws IOException { ColumnFamily columnFamily = ColumnFamily.create(keyspace, cf); IPartitioner<?> partitioner = DatabaseDescriptor.getPartitioner(); int importedKeys = (isSorted) ? importSorted(jsonFile, columnFamily, ssTablePath, partitioner) : importUnsorted(jsonFile, columnFamily, ssTablePath, partitioner); if (importedKeys != -1) System.out.printf(STR, importedKeys); return importedKeys; } | /**
* Convert a JSON formatted file to an SSTable.
*
* @param jsonFile the file containing JSON formatted data
* @param keyspace keyspace the data belongs to
* @param cf column family the data belongs to
* @param ssTablePath file to write the SSTable to
*
* @throws IOException for errors reading/writing input/output
*/ | Convert a JSON formatted file to an SSTable | importJson | {
"repo_name": "Sonnbc/modelCheckingCassandra",
"path": "src/java/org/apache/cassandra/tools/SSTableImport.java",
"license": "apache-2.0",
"size": 20021
} | [
"java.io.IOException",
"org.apache.cassandra.config.DatabaseDescriptor",
"org.apache.cassandra.db.ColumnFamily",
"org.apache.cassandra.dht.IPartitioner"
] | import java.io.IOException; import org.apache.cassandra.config.DatabaseDescriptor; import org.apache.cassandra.db.ColumnFamily; import org.apache.cassandra.dht.IPartitioner; | import java.io.*; import org.apache.cassandra.config.*; import org.apache.cassandra.db.*; import org.apache.cassandra.dht.*; | [
"java.io",
"org.apache.cassandra"
] | java.io; org.apache.cassandra; | 2,442,671 |
boolean validateAssessmentSectionCode(DiagnosticChain diagnostics, Map<Object, Object> context);
| boolean validateAssessmentSectionCode(DiagnosticChain diagnostics, Map<Object, Object> context); | /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* not self.code.oclIsUndefined() and self.code.oclIsKindOf(datatypes::CE) and
* let value : datatypes::CE = self.code.oclAsType(datatypes::CE) in (
* value.code = '51848-0' and value.codeSystem = '2.16.840.1.113883.6.1')
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The cache of context-specific information.
* <!-- end-model-doc -->
* @model annotation="http://www.eclipse.org/uml2/1.1.0/GenModel body='not self.code.oclIsUndefined() and self.code.oclIsKindOf(datatypes::CE) and \nlet value : datatypes::CE = self.code.oclAsType(datatypes::CE) in (\nvalue.code = \'51848-0\' and value.codeSystem = \'2.16.840.1.113883.6.1\')'"
* @generated
*/ | not self.code.oclIsUndefined() and self.code.oclIsKindOf(datatypes::CE) and let value : datatypes::CE = self.code.oclAsType(datatypes::CE) in ( value.code = '51848-0' and value.codeSystem = '2.16.840.1.113883.6.1') | validateAssessmentSectionCode | {
"repo_name": "drbgfc/mdht",
"path": "cda/deprecated/org.openhealthtools.mdht.uml.cda.cdt/src/org/openhealthtools/mdht/uml/cda/cdt/AssessmentSection.java",
"license": "epl-1.0",
"size": 2600
} | [
"java.util.Map",
"org.eclipse.emf.common.util.DiagnosticChain"
] | import java.util.Map; import org.eclipse.emf.common.util.DiagnosticChain; | import java.util.*; import org.eclipse.emf.common.util.*; | [
"java.util",
"org.eclipse.emf"
] | java.util; org.eclipse.emf; | 2,410,808 |
public static long cronInterval(String cron, Date date) {
try {
return new CronExpression(cron).getNextInterval(date);
} catch (Exception e) {
throw new IllegalArgumentException("Invalid CRON pattern : " + cron, e);
}
}
public static class CronExpression implements Serializable, Cloneable {
private static final long serialVersionUID = 12423409423L;
protected static final int SECOND = 0;
protected static final int MINUTE = 1;
protected static final int HOUR = 2;
protected static final int DAY_OF_MONTH = 3;
protected static final int MONTH = 4;
protected static final int DAY_OF_WEEK = 5;
protected static final int YEAR = 6;
protected static final int ALL_SPEC_INT = 99; // '*'
protected static final int NO_SPEC_INT = 98; // '?'
protected static final Integer ALL_SPEC = new Integer(ALL_SPEC_INT);
protected static final Integer NO_SPEC = new Integer(NO_SPEC_INT);
protected static Map<String, Integer> monthMap = new HashMap<String, Integer>(20);
protected static Map<String, Integer> dayMap = new HashMap<String, Integer>(60);
static {
monthMap.put("JAN", new Integer(0));
monthMap.put("FEB", new Integer(1));
monthMap.put("MAR", new Integer(2));
monthMap.put("APR", new Integer(3));
monthMap.put("MAY", new Integer(4));
monthMap.put("JUN", new Integer(5));
monthMap.put("JUL", new Integer(6));
monthMap.put("AUG", new Integer(7));
monthMap.put("SEP", new Integer(8));
monthMap.put("OCT", new Integer(9));
monthMap.put("NOV", new Integer(10));
monthMap.put("DEC", new Integer(11));
dayMap.put("SUN", new Integer(1));
dayMap.put("MON", new Integer(2));
dayMap.put("TUE", new Integer(3));
dayMap.put("WED", new Integer(4));
dayMap.put("THU", new Integer(5));
dayMap.put("FRI", new Integer(6));
dayMap.put("SAT", new Integer(7));
}
private String cronExpression = null;
private TimeZone timeZone = null;
protected transient TreeSet<Integer> seconds;
protected transient TreeSet<Integer> minutes;
protected transient TreeSet<Integer> hours;
protected transient TreeSet<Integer> daysOfMonth;
protected transient TreeSet<Integer> months;
protected transient TreeSet<Integer> daysOfWeek;
protected transient TreeSet<Integer> years;
protected transient boolean lastdayOfWeek = false;
protected transient int nthdayOfWeek = 0;
protected transient boolean lastdayOfMonth = false;
protected transient boolean nearestWeekday = false;
protected transient boolean expressionParsed = false;
public CronExpression(String cronExpression) throws ParseException {
if (cronExpression == null) {
throw new IllegalArgumentException("cronExpression cannot be null");
}
this.cronExpression = cronExpression;
buildExpression(cronExpression.toUpperCase(Locale.US));
} | static long function(String cron, Date date) { try { return new CronExpression(cron).getNextInterval(date); } catch (Exception e) { throw new IllegalArgumentException(STR + cron, e); } } public static class CronExpression implements Serializable, Cloneable { private static final long serialVersionUID = 12423409423L; protected static final int SECOND = 0; protected static final int MINUTE = 1; protected static final int HOUR = 2; protected static final int DAY_OF_MONTH = 3; protected static final int MONTH = 4; protected static final int DAY_OF_WEEK = 5; protected static final int YEAR = 6; protected static final int ALL_SPEC_INT = 99; protected static final int NO_SPEC_INT = 98; protected static final Integer ALL_SPEC = new Integer(ALL_SPEC_INT); protected static final Integer NO_SPEC = new Integer(NO_SPEC_INT); protected static Map<String, Integer> monthMap = new HashMap<String, Integer>(20); protected static Map<String, Integer> dayMap = new HashMap<String, Integer>(60); static { monthMap.put("JAN", new Integer(0)); monthMap.put("FEB", new Integer(1)); monthMap.put("MAR", new Integer(2)); monthMap.put("APR", new Integer(3)); monthMap.put("MAY", new Integer(4)); monthMap.put("JUN", new Integer(5)); monthMap.put("JUL", new Integer(6)); monthMap.put("AUG", new Integer(7)); monthMap.put("SEP", new Integer(8)); monthMap.put("OCT", new Integer(9)); monthMap.put("NOV", new Integer(10)); monthMap.put("DEC", new Integer(11)); dayMap.put("SUN", new Integer(1)); dayMap.put("MON", new Integer(2)); dayMap.put("TUE", new Integer(3)); dayMap.put("WED", new Integer(4)); dayMap.put("THU", new Integer(5)); dayMap.put("FRI", new Integer(6)); dayMap.put("SAT", new Integer(7)); } private String cronExpression = null; private TimeZone timeZone = null; protected transient TreeSet<Integer> seconds; protected transient TreeSet<Integer> minutes; protected transient TreeSet<Integer> hours; protected transient TreeSet<Integer> daysOfMonth; protected transient TreeSet<Integer> months; protected transient TreeSet<Integer> daysOfWeek; protected transient TreeSet<Integer> years; protected transient boolean lastdayOfWeek = false; protected transient int nthdayOfWeek = 0; protected transient boolean lastdayOfMonth = false; protected transient boolean nearestWeekday = false; protected transient boolean expressionParsed = false; public CronExpression(String cronExpression) throws ParseException { if (cronExpression == null) { throw new IllegalArgumentException(STR); } this.cronExpression = cronExpression; buildExpression(cronExpression.toUpperCase(Locale.US)); } | /**
* Compute the number of milliseconds between the next valid date and the one after
* @param cron The CRON String
* @param date The date to start search
* @return the number of milliseconds between the next valid date and the one after,
* with an invalid interval between
*/ | Compute the number of milliseconds between the next valid date and the one after | cronInterval | {
"repo_name": "eBay/restcommander",
"path": "play-1.2.4/framework/src/play/libs/Time.java",
"license": "apache-2.0",
"size": 62565
} | [
"java.io.Serializable",
"java.text.ParseException",
"java.util.Date",
"java.util.HashMap",
"java.util.Locale",
"java.util.Map",
"java.util.TimeZone",
"java.util.TreeSet"
] | import java.io.Serializable; import java.text.ParseException; import java.util.Date; import java.util.HashMap; import java.util.Locale; import java.util.Map; import java.util.TimeZone; import java.util.TreeSet; | import java.io.*; import java.text.*; import java.util.*; | [
"java.io",
"java.text",
"java.util"
] | java.io; java.text; java.util; | 1,898,235 |
protected static long[] getIds(SRConnection c, long acct)
throws SQLException {
MySQLConnection cc = c.getConnection();
String sql = "SELECT id FROM Store WHERE accountId = ? "
+ "ORDER BY id";
DataTable dt = cc.executeQuery(sql, acct);
long[] arr = new long[dt.getRowCount()];
for(int i = 0; i < arr.length; i++)
arr[i] = dt.getLong(i, "id");
return arr;
} | static long[] function(SRConnection c, long acct) throws SQLException { MySQLConnection cc = c.getConnection(); String sql = STR + STR; DataTable dt = cc.executeQuery(sql, acct); long[] arr = new long[dt.getRowCount()]; for(int i = 0; i < arr.length; i++) arr[i] = dt.getLong(i, "id"); return arr; } | /**
* Returns an array of all Store ID's associated with the specified account.
*
* @param c the connection
* @param acct the account ID
* @return an array of ID's, or an empty array if no matches were found
* @throws SQLException if a database access error occurs
*/ | Returns an array of all Store ID's associated with the specified account | getIds | {
"repo_name": "mordigaldj/SmartRegister",
"path": "src/main/java/com/djm/smartreg/data/DBStore.java",
"license": "mit",
"size": 9326
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 1,497,375 |
public Integer createHotspot( Hotspot r) throws NoConnectionException, BDException, IOException {
init();
synchronized ( UNIQUE_ACCESS )
{
return em.createHotspot(r);
}
} | Integer function( Hotspot r) throws NoConnectionException, BDException, IOException { init(); synchronized ( UNIQUE_ACCESS ) { return em.createHotspot(r); } } | /** Creates a hotspot
*
* @param r
* @throws NoConnectionException
* @throws BDException
*/ | Creates a hotspot | createHotspot | {
"repo_name": "OurMap/OurMap",
"path": "OurMap/src/com/bnmi/ourmap/control/EasyDelegate.java",
"license": "bsd-3-clause",
"size": 31901
} | [
"com.bnmi.ourmap.model.Hotspot",
"com.inga.exception.BDException",
"com.inga.exception.NoConnectionException",
"java.io.IOException"
] | import com.bnmi.ourmap.model.Hotspot; import com.inga.exception.BDException; import com.inga.exception.NoConnectionException; import java.io.IOException; | import com.bnmi.ourmap.model.*; import com.inga.exception.*; import java.io.*; | [
"com.bnmi.ourmap",
"com.inga.exception",
"java.io"
] | com.bnmi.ourmap; com.inga.exception; java.io; | 896,408 |
private void openAnimate(View view, int position) {
if (!opened.get(position)) {
generateRevealAnimate(view, true, false, position);
}
} | void function(View view, int position) { if (!opened.get(position)) { generateRevealAnimate(view, true, false, position); } } | /**
* Open item
*
* @param view
* affected view
* @param position
* Position of list
*/ | Open item | openAnimate | {
"repo_name": "RGU5Android/Mini-Project-Workspace",
"path": "swipelistview/src/com/fortysevendeg/swipelistview/SwipeListViewTouchListener.java",
"license": "apache-2.0",
"size": 31100
} | [
"android.view.View"
] | import android.view.View; | import android.view.*; | [
"android.view"
] | android.view; | 396,586 |
@Override
public void notifyObjectWillResize() {
notifyObservers(new ObjectWillResize());
} | void function() { notifyObservers(new ObjectWillResize()); } | /**
* Notify that the object will be resized
*/ | Notify that the object will be resized | notifyObjectWillResize | {
"repo_name": "openflexo-team/diana",
"path": "diana-core/src/main/java/org/openflexo/diana/impl/DrawingGraphicalRepresentationImpl.java",
"license": "gpl-3.0",
"size": 9942
} | [
"org.openflexo.diana.notifications.ObjectWillResize"
] | import org.openflexo.diana.notifications.ObjectWillResize; | import org.openflexo.diana.notifications.*; | [
"org.openflexo.diana"
] | org.openflexo.diana; | 2,746,045 |
public final MetaProperty<CacheManager> cacheManager() {
return _cacheManager;
} | final MetaProperty<CacheManager> function() { return _cacheManager; } | /**
* The meta-property for the {@code cacheManager} property.
* @return the meta-property, not null
*/ | The meta-property for the cacheManager property | cacheManager | {
"repo_name": "jeorme/OG-Platform",
"path": "projects/OG-Component/src/main/java/com/opengamma/component/factory/engine/RemoteEngineContextsComponentFactory.java",
"license": "apache-2.0",
"size": 45440
} | [
"net.sf.ehcache.CacheManager",
"org.joda.beans.MetaProperty"
] | import net.sf.ehcache.CacheManager; import org.joda.beans.MetaProperty; | import net.sf.ehcache.*; import org.joda.beans.*; | [
"net.sf.ehcache",
"org.joda.beans"
] | net.sf.ehcache; org.joda.beans; | 665,247 |
public static Session createEmailSession(String relayHost,Integer port)
{
if(relayHost == null)
throw new NullPointerException("relayHost");
Properties emailProps;
Session emailSession;
// set the relay host as a property of the email session
emailProps = new Properties();
emailProps.setProperty("mail.transport.protocol", "smtp");
emailProps.put("mail.smtp.host", relayHost);
if(port != null)
emailProps.setProperty("mail.smtp.port",String.valueOf(port));
// set the timeouts
emailProps.setProperty("mail.smtp.connectiontimeout",String.valueOf(SOCKET_CONNECT_TIMEOUT_MS));
emailProps.setProperty("mail.smtp.timeout",String.valueOf(SOCKET_IO_TIMEOUT_MS));
emailSession = Session.getInstance(emailProps, null);
emailSession.setDebug(false);
return emailSession;
} | static Session function(String relayHost,Integer port) { if(relayHost == null) throw new NullPointerException(STR); Properties emailProps; Session emailSession; emailProps = new Properties(); emailProps.setProperty(STR, "smtp"); emailProps.put(STR, relayHost); if(port != null) emailProps.setProperty(STR,String.valueOf(port)); emailProps.setProperty(STR,String.valueOf(SOCKET_CONNECT_TIMEOUT_MS)); emailProps.setProperty(STR,String.valueOf(SOCKET_IO_TIMEOUT_MS)); emailSession = Session.getInstance(emailProps, null); emailSession.setDebug(false); return emailSession; } | /**
* Creates an email <code>Session</code> given the relay host.
*
* @param relayHost
*
* @return the <code>Session</code>
*/ | Creates an email <code>Session</code> given the relay host | createEmailSession | {
"repo_name": "justinjohn83/utils-java",
"path": "utils/src/main/java/com/gamesalutes/utils/EmailUtil.java",
"license": "lgpl-3.0",
"size": 36812
} | [
"java.util.Properties",
"javax.mail.Session"
] | import java.util.Properties; import javax.mail.Session; | import java.util.*; import javax.mail.*; | [
"java.util",
"javax.mail"
] | java.util; javax.mail; | 2,304,258 |
default void postGrant(ObserverContext<MasterCoprocessorEnvironment> ctx,
UserPermission userPermission, boolean mergeExistingPermissions) throws IOException {
} | default void postGrant(ObserverContext<MasterCoprocessorEnvironment> ctx, UserPermission userPermission, boolean mergeExistingPermissions) throws IOException { } | /**
* Called after granting user permissions.
* @param ctx the coprocessor instance's environment
* @param userPermission the user and permissions
* @param mergeExistingPermissions True if merge with previous granted permissions
*/ | Called after granting user permissions | postGrant | {
"repo_name": "apurtell/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/MasterObserver.java",
"license": "apache-2.0",
"size": 74501
} | [
"java.io.IOException",
"org.apache.hadoop.hbase.security.access.UserPermission"
] | import java.io.IOException; import org.apache.hadoop.hbase.security.access.UserPermission; | import java.io.*; import org.apache.hadoop.hbase.security.access.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 923,185 |
public static void displayError(Component component, Exception exception, String title) {
String message = exception.getLocalizedMessage();
StringTokenizer tok;
final StringBuilder strBuf = new StringBuilder(getResourceString("errException"));
int lineLen = 0;
String word;
String[] options = { getResourceString("buttonOk"), getResourceString("optionDlgStack") };
if (message == null)
message = exception.getClass().getName();
tok = new StringTokenizer(message);
strBuf.append(":\n");
while (tok.hasMoreTokens()) {
word = tok.nextToken();
if (lineLen > 0 && lineLen + word.length() > 40) {
strBuf.append("\n");
lineLen = 0;
}
strBuf.append(word);
strBuf.append(' ');
lineLen += word.length() + 1;
}
if (JOptionPane.showOptionDialog(component, strBuf.toString(), title, JOptionPane.YES_NO_OPTION,
JOptionPane.ERROR_MESSAGE, null, options, options[0]) == 1) {
exception.printStackTrace();
}
} | static void function(Component component, Exception exception, String title) { String message = exception.getLocalizedMessage(); StringTokenizer tok; final StringBuilder strBuf = new StringBuilder(getResourceString(STR)); int lineLen = 0; String word; String[] options = { getResourceString(STR), getResourceString(STR) }; if (message == null) message = exception.getClass().getName(); tok = new StringTokenizer(message); strBuf.append(":\n"); while (tok.hasMoreTokens()) { word = tok.nextToken(); if (lineLen > 0 && lineLen + word.length() > 40) { strBuf.append("\n"); lineLen = 0; } strBuf.append(word); strBuf.append(' '); lineLen += word.length() + 1; } if (JOptionPane.showOptionDialog(component, strBuf.toString(), title, JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, options, options[0]) == 1) { exception.printStackTrace(); } } | /**
* Displays an error message dialog by examining a given <code>Exception</code>.
* Returns after the dialog was closed by the user.
*
* @param component
* the component in which to open the dialog. <code>null</code> is
* allowed in which case the dialog will appear centered on the
* screen.
* @param exception
* the exception that was thrown. the message's text is displayed
* using the <code>getLocalizedMessage</code> method.
* @param title
* name of the action in which the error occurred
*
* @see java.lang.Throwable#getLocalizedMessage()
*/ | Displays an error message dialog by examining a given <code>Exception</code>. Returns after the dialog was closed by the user | displayError | {
"repo_name": "sudosci/JavaCollider",
"path": "src/main/java/de/sciss/jcollider/JavaCollider.java",
"license": "lgpl-2.1",
"size": 5124
} | [
"java.awt.Component",
"java.util.StringTokenizer",
"javax.swing.JOptionPane"
] | import java.awt.Component; import java.util.StringTokenizer; import javax.swing.JOptionPane; | import java.awt.*; import java.util.*; import javax.swing.*; | [
"java.awt",
"java.util",
"javax.swing"
] | java.awt; java.util; javax.swing; | 2,871,953 |
public com.mozu.api.contracts.productruntime.LocationInventoryCollection getProductInventories(com.mozu.api.contracts.productruntime.LocationInventoryQuery query, String responseFields) throws Exception
{
MozuClient<com.mozu.api.contracts.productruntime.LocationInventoryCollection> client = com.mozu.api.clients.commerce.catalog.storefront.ProductClient.getProductInventoriesClient(_dataViewMode, query, responseFields);
client.setContext(_apiContext);
client.executeRequest();
return client.getResult();
} | com.mozu.api.contracts.productruntime.LocationInventoryCollection function(com.mozu.api.contracts.productruntime.LocationInventoryQuery query, String responseFields) throws Exception { MozuClient<com.mozu.api.contracts.productruntime.LocationInventoryCollection> client = com.mozu.api.clients.commerce.catalog.storefront.ProductClient.getProductInventoriesClient(_dataViewMode, query, responseFields); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); } | /**
* Retrieves product inventories for the storefront displayed products.
* <p><pre><code>
* Product product = new Product();
* LocationInventoryCollection locationInventoryCollection = product.getProductInventories( query, responseFields);
* </code></pre></p>
* @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
* @param query Properties for the product location inventory provided for queries to locate products by their location.
* @return com.mozu.api.contracts.productruntime.LocationInventoryCollection
* @see com.mozu.api.contracts.productruntime.LocationInventoryCollection
* @see com.mozu.api.contracts.productruntime.LocationInventoryQuery
*/ | Retrieves product inventories for the storefront displayed products. <code><code> Product product = new Product(); LocationInventoryCollection locationInventoryCollection = product.getProductInventories( query, responseFields); </code></code> | getProductInventories | {
"repo_name": "lakshmi-nair/mozu-java",
"path": "mozu-java-core/src/main/java/com/mozu/api/resources/commerce/catalog/storefront/ProductResource.java",
"license": "mit",
"size": 25051
} | [
"com.mozu.api.MozuClient"
] | import com.mozu.api.MozuClient; | import com.mozu.api.*; | [
"com.mozu.api"
] | com.mozu.api; | 57,685 |
public void setLoadBalanceIdleTime(Period period)
{
_loadBalanceIdleTime = period.getPeriod();
} | void function(Period period) { _loadBalanceIdleTime = period.getPeriod(); } | /**
* Sets the loadBalance max-idle-time.
*/ | Sets the loadBalance max-idle-time | setLoadBalanceIdleTime | {
"repo_name": "dlitz/resin",
"path": "modules/resin/src/com/caucho/cloud/network/ClusterServer.java",
"license": "gpl-2.0",
"size": 18570
} | [
"com.caucho.config.types.Period"
] | import com.caucho.config.types.Period; | import com.caucho.config.types.*; | [
"com.caucho.config"
] | com.caucho.config; | 2,878,633 |
@WithBridgeMethods(value = MySQLQuery.class, castRequired = true)
public C intoDumpfile(File file) {
return addFlag(Position.END, "\ninto dumpfile '" + file.getPath() + "'");
} | @WithBridgeMethods(value = MySQLQuery.class, castRequired = true) C function(File file) { return addFlag(Position.END, STR + file.getPath() + "'"); } | /**
* SELECT ... INTO DUMPFILE writes a single row to a file without any formatting.
*
* @param file file to write to
* @return the current object
*/ | SELECT ... INTO DUMPFILE writes a single row to a file without any formatting | intoDumpfile | {
"repo_name": "balazs-zsoldos/querydsl",
"path": "querydsl-sql/src/main/java/com/querydsl/sql/mysql/AbstractMySQLQuery.java",
"license": "apache-2.0",
"size": 9622
} | [
"com.infradna.tool.bridge_method_injector.WithBridgeMethods",
"com.querydsl.core.QueryFlag",
"java.io.File"
] | import com.infradna.tool.bridge_method_injector.WithBridgeMethods; import com.querydsl.core.QueryFlag; import java.io.File; | import com.infradna.tool.bridge_method_injector.*; import com.querydsl.core.*; import java.io.*; | [
"com.infradna.tool",
"com.querydsl.core",
"java.io"
] | com.infradna.tool; com.querydsl.core; java.io; | 2,505,259 |
private void validateTupleLimitDeleteStmt(Statement catStmt) throws VoltCompilerException {
String tableName = catStmt.getParent().getTypeName();
String msgPrefix = "Error: Table " + tableName + " has invalid DELETE statement for LIMIT PARTITION ROWS constraint: ";
VoltXMLElement deleteXml = null;
try {
// We parse the statement here and cache the XML below if the statement passes
// validation.
deleteXml = m_hsql.getXMLCompiledStatement(catStmt.getSqltext());
}
catch (HSQLInterface.HSQLParseException e) {
throw m_compiler.new VoltCompilerException(msgPrefix + "parse error: " + e.getMessage());
}
if (! deleteXml.name.equals("delete")) {
// Could in theory allow TRUNCATE TABLE here too.
throw m_compiler.new VoltCompilerException(msgPrefix + "not a DELETE statement");
}
String deleteTarget = deleteXml.attributes.get("table");
if (! deleteTarget.equals(tableName)) {
throw m_compiler.new VoltCompilerException(msgPrefix + "target of DELETE must be " + tableName);
}
m_limitDeleteStmtToXml.put(catStmt, deleteXml);
} | void function(Statement catStmt) throws VoltCompilerException { String tableName = catStmt.getParent().getTypeName(); String msgPrefix = STR + tableName + STR; VoltXMLElement deleteXml = null; try { deleteXml = m_hsql.getXMLCompiledStatement(catStmt.getSqltext()); } catch (HSQLInterface.HSQLParseException e) { throw m_compiler.new VoltCompilerException(msgPrefix + STR + e.getMessage()); } if (! deleteXml.name.equals(STR)) { throw m_compiler.new VoltCompilerException(msgPrefix + STR); } String deleteTarget = deleteXml.attributes.get("table"); if (! deleteTarget.equals(tableName)) { throw m_compiler.new VoltCompilerException(msgPrefix + STR + tableName); } m_limitDeleteStmtToXml.put(catStmt, deleteXml); } | /** Makes sure that the DELETE statement on a LIMIT PARTITION ROWS EXECUTE (DELETE ...)
* - Contains no parse errors
* - Is actually a DELETE statement
* - Targets the table being constrained
* Throws VoltCompilerException if any of these does not hold
* @param catStmt The catalog statement whose sql text field is the DELETE to be validated
**/ | Makes sure that the DELETE statement on a LIMIT PARTITION ROWS EXECUTE (DELETE ...) - Contains no parse errors - Is actually a DELETE statement - Targets the table being constrained Throws VoltCompilerException if any of these does not hold | validateTupleLimitDeleteStmt | {
"repo_name": "paulmartel/voltdb",
"path": "src/frontend/org/voltdb/compiler/DDLCompiler.java",
"license": "agpl-3.0",
"size": 112463
} | [
"org.hsqldb_voltpatches.HSQLInterface",
"org.hsqldb_voltpatches.VoltXMLElement",
"org.voltdb.catalog.Statement",
"org.voltdb.compiler.VoltCompiler"
] | import org.hsqldb_voltpatches.HSQLInterface; import org.hsqldb_voltpatches.VoltXMLElement; import org.voltdb.catalog.Statement; import org.voltdb.compiler.VoltCompiler; | import org.hsqldb_voltpatches.*; import org.voltdb.catalog.*; import org.voltdb.compiler.*; | [
"org.hsqldb_voltpatches",
"org.voltdb.catalog",
"org.voltdb.compiler"
] | org.hsqldb_voltpatches; org.voltdb.catalog; org.voltdb.compiler; | 1,532,024 |
public Optional<MenuValue> getFromMenusList(LocalDate date, String mealType) {
var rawMenuList = date != null ? getRawMenuList(restClient::rest, date) : getRawMenuList(restClient::rest);
return Optional.ofNullable(rawMenuList
.param("date", date != null ? date.toString() : null)
.param("mealType", mealType != null ? mealType.toUpperCase() : null)
.getObject("_embedded.data.find { menu->menu.date == date && menu.mealType == mealType }", MenuValue.class));
} | Optional<MenuValue> function(LocalDate date, String mealType) { var rawMenuList = date != null ? getRawMenuList(restClient::rest, date) : getRawMenuList(restClient::rest); return Optional.ofNullable(rawMenuList .param("date", date != null ? date.toString() : null) .param(STR, mealType != null ? mealType.toUpperCase() : null) .getObject(STR, MenuValue.class)); } | /**
* Gets the menu corresponding to the specified date and meal type from the menus list owned by the currently
* authenticated user if existing.
* The menus list is retrieved from the server. If menu is retrieved from server, it should be populated with all
* attributes, especially its links.
*
* @param date the date of the menu to retrieve in the list.
* @param mealType the meal type of the menu to retrieve in the list.
* @return the menu retrieved from list.
*/ | Gets the menu corresponding to the specified date and meal type from the menus list owned by the currently authenticated user if existing. The menus list is retrieved from the server. If menu is retrieved from server, it should be populated with all attributes, especially its links | getFromMenusList | {
"repo_name": "adhuc-projects/cena",
"path": "src/acceptance/java/org/adhuc/cena/menu/steps/serenity/menus/MenuListClientDelegate.java",
"license": "gpl-3.0",
"size": 9565
} | [
"java.time.LocalDate",
"java.util.Optional"
] | import java.time.LocalDate; import java.util.Optional; | import java.time.*; import java.util.*; | [
"java.time",
"java.util"
] | java.time; java.util; | 145,880 |
void handleNonExistantFile( FileObject file ) throws KettleException; | void handleNonExistantFile( FileObject file ) throws KettleException; | /**
* This method handles a file that is required, but does not exist.
*
* @param file
* @throws KettleException
*/ | This method handles a file that is required, but does not exist | handleNonExistantFile | {
"repo_name": "tkafalas/pentaho-kettle",
"path": "engine/src/main/java/org/pentaho/di/trans/step/errorhandling/FileErrorHandler.java",
"license": "apache-2.0",
"size": 2149
} | [
"org.apache.commons.vfs2.FileObject",
"org.pentaho.di.core.exception.KettleException"
] | import org.apache.commons.vfs2.FileObject; import org.pentaho.di.core.exception.KettleException; | import org.apache.commons.vfs2.*; import org.pentaho.di.core.exception.*; | [
"org.apache.commons",
"org.pentaho.di"
] | org.apache.commons; org.pentaho.di; | 2,472,396 |
public BigDecimal getHeatIndexF() {
return WeatherUndergroundJsonUtils.convertToBigDecimal(heat_index_f);
} | BigDecimal function() { return WeatherUndergroundJsonUtils.convertToBigDecimal(heat_index_f); } | /**
* Get the heat index in degrees Fahrenheit
*
* Used to update the channel current#heatIndex
*
* @return the heat index in degrees Fahrenheit or null if not defined
*/ | Get the heat index in degrees Fahrenheit Used to update the channel current#heatIndex | getHeatIndexF | {
"repo_name": "openhab/openhab2",
"path": "bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonCurrent.java",
"license": "epl-1.0",
"size": 15780
} | [
"java.math.BigDecimal"
] | import java.math.BigDecimal; | import java.math.*; | [
"java.math"
] | java.math; | 356,692 |
@VisibleForTesting
static boolean ancestorsHaveExecutePermissions(FileSystem fs,
Path path, LoadingCache<Path,Future<FileStatus>> statCache)
throws IOException {
Path current = path;
while (current != null) {
//the subdirs in the path should have execute permissions for others
if (!checkPermissionOfOther(fs, current, FsAction.EXECUTE, statCache)) {
return false;
}
current = current.getParent();
}
return true;
} | static boolean ancestorsHaveExecutePermissions(FileSystem fs, Path path, LoadingCache<Path,Future<FileStatus>> statCache) throws IOException { Path current = path; while (current != null) { if (!checkPermissionOfOther(fs, current, FsAction.EXECUTE, statCache)) { return false; } current = current.getParent(); } return true; } | /**
* Returns true if all ancestors of the specified path have the 'execute'
* permission set for all users (i.e. that other users can traverse
* the directory hierarchy to the given path)
*/ | Returns true if all ancestors of the specified path have the 'execute' permission set for all users (i.e. that other users can traverse the directory hierarchy to the given path) | ancestorsHaveExecutePermissions | {
"repo_name": "lukmajercak/hadoop",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/FSDownload.java",
"license": "apache-2.0",
"size": 17549
} | [
"com.google.common.cache.LoadingCache",
"java.io.IOException",
"java.util.concurrent.Future",
"org.apache.hadoop.fs.FileStatus",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.fs.permission.FsAction"
] | import com.google.common.cache.LoadingCache; import java.io.IOException; import java.util.concurrent.Future; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsAction; | import com.google.common.cache.*; import java.io.*; import java.util.concurrent.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.fs.permission.*; | [
"com.google.common",
"java.io",
"java.util",
"org.apache.hadoop"
] | com.google.common; java.io; java.util; org.apache.hadoop; | 2,872,074 |
@Override
public Adapter createMMESPDeploymentPlatformAdapter() {
if (mmespDeploymentPlatformItemProvider == null) {
mmespDeploymentPlatformItemProvider = new MMESPDeploymentPlatformItemProvider(this);
}
return mmespDeploymentPlatformItemProvider;
}
protected MMESPDeployedDeviceItemProvider mmespDeployedDeviceItemProvider; | Adapter function() { if (mmespDeploymentPlatformItemProvider == null) { mmespDeploymentPlatformItemProvider = new MMESPDeploymentPlatformItemProvider(this); } return mmespDeploymentPlatformItemProvider; } protected MMESPDeployedDeviceItemProvider mmespDeployedDeviceItemProvider; | /**
* This creates an adapter for a {@link es.uah.aut.srg.micobs.mesp.mespdep.MMESPDeploymentPlatform}.
* @generated
*/ | This creates an adapter for a <code>es.uah.aut.srg.micobs.mesp.mespdep.MMESPDeploymentPlatform</code> | createMMESPDeploymentPlatformAdapter | {
"repo_name": "parraman/micobs",
"path": "mesp/es.uah.aut.srg.micobs.mesp/src/es/uah/aut/srg/micobs/mesp/mespdep/provider/mespdepItemProviderAdapterFactory.java",
"license": "epl-1.0",
"size": 10846
} | [
"org.eclipse.emf.common.notify.Adapter"
] | import org.eclipse.emf.common.notify.Adapter; | import org.eclipse.emf.common.notify.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,402,072 |
protected void pauseForWalletRestore() {
Pause.pause(20, TimeUnit.SECONDS);
} | void function() { Pause.pause(20, TimeUnit.SECONDS); } | /**
* The standard length of time for a wallet to be restored (at least 20 seconds with CA certs which take at least 6 seconds on broadband)
*/ | The standard length of time for a wallet to be restored (at least 20 seconds with CA certs which take at least 6 seconds on broadband) | pauseForWalletRestore | {
"repo_name": "oscarguindzberg/multibit-hd",
"path": "mbhd-swing/src/test/java/org/multibit/hd/ui/fest/use_cases/AbstractHardwareWalletFestUseCase.java",
"license": "mit",
"size": 11096
} | [
"java.util.concurrent.TimeUnit",
"org.fest.swing.timing.Pause"
] | import java.util.concurrent.TimeUnit; import org.fest.swing.timing.Pause; | import java.util.concurrent.*; import org.fest.swing.timing.*; | [
"java.util",
"org.fest.swing"
] | java.util; org.fest.swing; | 1,782,176 |
public static Integer getKeyLengthFromURI(String algorithmURI) {
Logger log = getLogger();
String algoClass = DatatypeHelper.safeTrimOrNullString(JCEMapper.getAlgorithmClassFromURI(algorithmURI));
if (ApacheXMLSecurityConstants.ALGO_CLASS_BLOCK_ENCRYPTION.equals(algoClass)
|| ApacheXMLSecurityConstants.ALGO_CLASS_SYMMETRIC_KEY_WRAP.equals(algoClass)) {
try {
int keyLength = JCEMapper.getKeyLengthFromURI(algorithmURI);
return new Integer(keyLength);
} catch (NumberFormatException e) {
log.warn("XML Security config contained invalid key length value for algorithm URI: " + algorithmURI);
}
}
log.info("Mapping from algorithm URI {} to key length not available", algorithmURI);
return null;
} | static Integer function(String algorithmURI) { Logger log = getLogger(); String algoClass = DatatypeHelper.safeTrimOrNullString(JCEMapper.getAlgorithmClassFromURI(algorithmURI)); if (ApacheXMLSecurityConstants.ALGO_CLASS_BLOCK_ENCRYPTION.equals(algoClass) ApacheXMLSecurityConstants.ALGO_CLASS_SYMMETRIC_KEY_WRAP.equals(algoClass)) { try { int keyLength = JCEMapper.getKeyLengthFromURI(algorithmURI); return new Integer(keyLength); } catch (NumberFormatException e) { log.warn(STR + algorithmURI); } } log.info(STR, algorithmURI); return null; } | /**
* Get the length of the key indicated by the algorithm URI, if applicable and available.
*
* @param algorithmURI the algorithm URI to evaluate
* @return the length of the key indicated by the algorithm URI, or null if the length is either unavailable or
* indeterminable from the URI
*/ | Get the length of the key indicated by the algorithm URI, if applicable and available | getKeyLengthFromURI | {
"repo_name": "Safewhere/kombit-service-java",
"path": "XmlTooling/src/org/opensaml/xml/security/SecurityHelper.java",
"license": "mit",
"size": 47541
} | [
"org.apache.xml.security.algorithms.JCEMapper",
"org.opensaml.xml.util.DatatypeHelper",
"org.slf4j.Logger"
] | import org.apache.xml.security.algorithms.JCEMapper; import org.opensaml.xml.util.DatatypeHelper; import org.slf4j.Logger; | import org.apache.xml.security.algorithms.*; import org.opensaml.xml.util.*; import org.slf4j.*; | [
"org.apache.xml",
"org.opensaml.xml",
"org.slf4j"
] | org.apache.xml; org.opensaml.xml; org.slf4j; | 2,790,321 |
public static String encodeEscape(String str) {
String regex = "\\\\";
String replacement = quoteReplacement("\\\\");
return str.replaceAll(regex, replacement);
} | static String function(String str) { String regex = "\\\\"; String replacement = quoteReplacement("\\\\"); return str.replaceAll(regex, replacement); } | /**
* Helper method to replace all occurrences of "\" with "\\" in a
* string. This is useful to fix the file path string on Windows
* where "\" is used as the path separator.
*
* @param str Any string
* @return The resulting string
*/ | Helper method to replace all occurrences of "\" with "\\" in a string. This is useful to fix the file path string on Windows where "\" is used as the path separator | encodeEscape | {
"repo_name": "ljl1988com/pig",
"path": "test/org/apache/pig/test/Util.java",
"license": "apache-2.0",
"size": 53036
} | [
"java.util.regex.Matcher"
] | import java.util.regex.Matcher; | import java.util.regex.*; | [
"java.util"
] | java.util; | 1,915,852 |
public static CategoryDataset createCategoryDataset(String rowKeyPrefix,
String columnKeyPrefix,
double[][] data) {
DefaultCategoryDataset result = new DefaultCategoryDataset();
for (int r = 0; r < data.length; r++) {
String rowKey = rowKeyPrefix + (r + 1);
for (int c = 0; c < data[r].length; c++) {
String columnKey = columnKeyPrefix + (c + 1);
result.addValue(new Double(data[r][c]), rowKey, columnKey);
}
}
return result;
} | static CategoryDataset function(String rowKeyPrefix, String columnKeyPrefix, double[][] data) { DefaultCategoryDataset result = new DefaultCategoryDataset(); for (int r = 0; r < data.length; r++) { String rowKey = rowKeyPrefix + (r + 1); for (int c = 0; c < data[r].length; c++) { String columnKey = columnKeyPrefix + (c + 1); result.addValue(new Double(data[r][c]), rowKey, columnKey); } } return result; } | /**
* Creates a {@link CategoryDataset} that contains a copy of the data in an
* array (instances of <code>Double</code> are created to represent the
* data items).
* <p>
* Row and column keys are created by appending 0, 1, 2, ... to the
* supplied prefixes.
*
* @param rowKeyPrefix the row key prefix.
* @param columnKeyPrefix the column key prefix.
* @param data the data.
*
* @return The dataset.
*/ | Creates a <code>CategoryDataset</code> that contains a copy of the data in an array (instances of <code>Double</code> are created to represent the data items). Row and column keys are created by appending 0, 1, 2, ... to the supplied prefixes | createCategoryDataset | {
"repo_name": "opensim-org/opensim-gui",
"path": "Gui/opensim/jfreechart/src/org/jfree/data/general/DatasetUtilities.java",
"license": "apache-2.0",
"size": 58159
} | [
"org.jfree.data.category.CategoryDataset",
"org.jfree.data.category.DefaultCategoryDataset"
] | import org.jfree.data.category.CategoryDataset; import org.jfree.data.category.DefaultCategoryDataset; | import org.jfree.data.category.*; | [
"org.jfree.data"
] | org.jfree.data; | 450,119 |
public void readObject (InputStream stream)
throws IOException, ClassNotFoundException
{
readObject (new DataInputStream(stream));
} | void function (InputStream stream) throws IOException, ClassNotFoundException { readObject (new DataInputStream(stream)); } | /**
* Read the object attributes from an input stream.
*
* @param stream The input stream to read from.
* @throws IOException In case of a read error.
* @throws ClassNotFoundException If the object class could not be
* instantiated.
*/ | Read the object attributes from an input stream | readObject | {
"repo_name": "grappendorf/openmetix",
"path": "src/java/de/iritgo/openmetix/core/iobject/IObjectProxy.java",
"license": "gpl-2.0",
"size": 5224
} | [
"java.io.DataInputStream",
"java.io.IOException",
"java.io.InputStream"
] | import java.io.DataInputStream; import java.io.IOException; import java.io.InputStream; | import java.io.*; | [
"java.io"
] | java.io; | 1,566,879 |
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux<ResourceSkuInner> listAsync() {
return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink));
} | @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux<ResourceSkuInner> function() { return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } | /**
* Get the list of StorageCache.Cache SKUs available to this subscription.
*
* @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 list of StorageCache.Cache SKUs available to this subscription.
*/ | Get the list of StorageCache.Cache SKUs available to this subscription | listAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/SkusClientImpl.java",
"license": "mit",
"size": 13280
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.PagedFlux",
"com.azure.resourcemanager.storagecache.fluent.models.ResourceSkuInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedFlux; import com.azure.resourcemanager.storagecache.fluent.models.ResourceSkuInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.resourcemanager.storagecache.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 835,411 |
public Map<String,String> getApplicationIdAndTokenTypeByConsumerKey(String consumerKey) throws APIManagementException {
Map<String,String> appIdAndConsumerKey = new HashMap<String, String>();
if (log.isDebugEnabled()) {
log.debug("fetching application id and token type by consumer key " + consumerKey);
}
Connection connection = null;
PreparedStatement prepStmt = null;
ResultSet rs = null;
String sqlQuery = "SELECT " +
" MAP.APPLICATION_ID, " +
" MAP.KEY_TYPE " +
"FROM " +
" AM_APPLICATION_KEY_MAPPING MAP " +
"WHERE " +
" MAP.CONSUMER_KEY = ? ";
try {
connection = APIMgtDBUtil.getConnection();
prepStmt = connection.prepareStatement(sqlQuery);
prepStmt.setString(1, consumerKey);
rs = prepStmt.executeQuery();
while (rs.next()) {
appIdAndConsumerKey.put("application_id", rs.getString("APPLICATION_ID"));
appIdAndConsumerKey.put("token_type", rs.getString("KEY_TYPE"));
}
} catch (SQLException e) {
handleException("Error when reading application subscription information", e);
} finally {
APIMgtDBUtil.closeAllConnections(prepStmt, connection, rs);
}
return appIdAndConsumerKey;
} | Map<String,String> function(String consumerKey) throws APIManagementException { Map<String,String> appIdAndConsumerKey = new HashMap<String, String>(); if (log.isDebugEnabled()) { log.debug(STR + consumerKey); } Connection connection = null; PreparedStatement prepStmt = null; ResultSet rs = null; String sqlQuery = STR + STR + STR + STR + STR + STR + STR; try { connection = APIMgtDBUtil.getConnection(); prepStmt = connection.prepareStatement(sqlQuery); prepStmt.setString(1, consumerKey); rs = prepStmt.executeQuery(); while (rs.next()) { appIdAndConsumerKey.put(STR, rs.getString(STR)); appIdAndConsumerKey.put(STR, rs.getString(STR)); } } catch (SQLException e) { handleException(STR, e); } finally { APIMgtDBUtil.closeAllConnections(prepStmt, connection, rs); } return appIdAndConsumerKey; } | /**
* This method will return a java Map that contains application ID and token type.
* @param consumerKey consumer key of the oAuth application.
* @return Map.
* @throws APIManagementException
*/ | This method will return a java Map that contains application ID and token type | getApplicationIdAndTokenTypeByConsumerKey | {
"repo_name": "rnavagamuwa/custom-carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java",
"license": "apache-2.0",
"size": 404796
} | [
"java.sql.Connection",
"java.sql.PreparedStatement",
"java.sql.ResultSet",
"java.sql.SQLException",
"java.util.HashMap",
"java.util.Map",
"org.wso2.carbon.apimgt.api.APIManagementException",
"org.wso2.carbon.apimgt.impl.utils.APIMgtDBUtil"
] | import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.HashMap; import java.util.Map; import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.impl.utils.APIMgtDBUtil; | import java.sql.*; import java.util.*; import org.wso2.carbon.apimgt.api.*; import org.wso2.carbon.apimgt.impl.utils.*; | [
"java.sql",
"java.util",
"org.wso2.carbon"
] | java.sql; java.util; org.wso2.carbon; | 1,704,986 |
private boolean isFontAwesomeComponentUsedAndRemoveIt() {
FacesContext fc = FacesContext.getCurrentInstance();
UIViewRoot viewRoot = fc.getViewRoot();
ListIterator<UIComponent> resourceIterator = (viewRoot.getComponentResources(fc, "head")).listIterator();
UIComponent fontAwesomeResource = null;
while (resourceIterator.hasNext()) {
UIComponent resource = resourceIterator.next();
String name = (String) resource.getAttributes().get("name");
// rw.write("\n<!-- res: '"+name+"' -->" );
if (name != null) {
if (name.endsWith("font-awesome.css"))
fontAwesomeResource = resource;
}
}
if (null != fontAwesomeResource) {
fontAwesomeResource.setInView(false);
viewRoot.removeComponentResource(fc, fontAwesomeResource);
// System.out.println("-3" + fontAwesomeResource.getClientId());
return true;
}
return false;
} | boolean function() { FacesContext fc = FacesContext.getCurrentInstance(); UIViewRoot viewRoot = fc.getViewRoot(); ListIterator<UIComponent> resourceIterator = (viewRoot.getComponentResources(fc, "head")).listIterator(); UIComponent fontAwesomeResource = null; while (resourceIterator.hasNext()) { UIComponent resource = resourceIterator.next(); String name = (String) resource.getAttributes().get("name"); if (name != null) { if (name.endsWith(STR)) fontAwesomeResource = resource; } } if (null != fontAwesomeResource) { fontAwesomeResource.setInView(false); viewRoot.removeComponentResource(fc, fontAwesomeResource); return true; } return false; } | /**
* Look whether a b:iconAwesome component is used. If so, the font-awesome.css
* is removed from the resource list because it's loaded from the CDN.
*
* @return true, if the font-awesome.css is found in the resource list. Note the
* side effect of this method!
*/ | Look whether a b:iconAwesome component is used. If so, the font-awesome.css is removed from the resource list because it's loaded from the CDN | isFontAwesomeComponentUsedAndRemoveIt | {
"repo_name": "mtvweb/BootsFaces-OSP",
"path": "src/main/java/net/bootsfaces/listeners/AddResourcesListener.java",
"license": "apache-2.0",
"size": 35662
} | [
"java.util.ListIterator",
"javax.faces.component.UIComponent",
"javax.faces.component.UIViewRoot",
"javax.faces.context.FacesContext"
] | import java.util.ListIterator; import javax.faces.component.UIComponent; import javax.faces.component.UIViewRoot; import javax.faces.context.FacesContext; | import java.util.*; import javax.faces.component.*; import javax.faces.context.*; | [
"java.util",
"javax.faces"
] | java.util; javax.faces; | 1,344,472 |
protected void fireInlineProjectionEnabled() {
if (fInlineProjectionListeners != null) {
Iterator e = new ArrayList(fInlineProjectionListeners).iterator();
while (e.hasNext()) {
IInlineProjectionListener l = (IInlineProjectionListener) e.next();
l.inlineProjectionEnabled();
}
}
}
| void function() { if (fInlineProjectionListeners != null) { Iterator e = new ArrayList(fInlineProjectionListeners).iterator(); while (e.hasNext()) { IInlineProjectionListener l = (IInlineProjectionListener) e.next(); l.inlineProjectionEnabled(); } } } | /**
* Notifies all registered projection listeners that projection mode has
* been enabled.
*/ | Notifies all registered projection listeners that projection mode has been enabled | fireInlineProjectionEnabled | {
"repo_name": "ckaestne/CIDE",
"path": "other/CIDE/src/coloredide/editor/inlineprojection/InlineProjectionJavaViewer.java",
"license": "gpl-3.0",
"size": 61019
} | [
"java.util.ArrayList",
"java.util.Iterator"
] | import java.util.ArrayList; import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 738,294 |
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
// Get src and dest types from request code for a Camera Activity
int srcType = (requestCode / 16) - 1;
int destType = (requestCode % 16) - 1;
// If Camera Crop
if (requestCode >= CROP_CAMERA) {
if (resultCode == Activity.RESULT_OK) {
// Because of the inability to pass through multiple intents, this hack will allow us
// to pass arcane codes back.
destType = requestCode - CROP_CAMERA;
try {
processResultFromCamera(destType, intent);
} catch (IOException e) {
e.printStackTrace();
Log.e(LOG_TAG, "Unable to write to file");
}
}// If cancelled
else if (resultCode == Activity.RESULT_CANCELED) {
this.failPicture("Camera cancelled.");
}
// If something else
else {
this.failPicture("Did not complete!");
}
}
// If CAMERA
else if (srcType == CAMERA) {
// If image available
if (resultCode == Activity.RESULT_OK) {
try {
if(this.allowEdit)
{
Uri tmpFile = Uri.fromFile(new File(getTempDirectoryPath(), ".Pic.jpg"));
performCrop(tmpFile, destType, intent);
}
else {
this.processResultFromCamera(destType, intent);
}
} catch (IOException e) {
e.printStackTrace();
this.failPicture("Error capturing image.");
}
}
// If cancelled
else if (resultCode == Activity.RESULT_CANCELED) {
this.failPicture("Camera cancelled.");
}
// If something else
else {
this.failPicture("Did not complete!");
}
}
// If retrieving photo from library
else if ((srcType == PHOTOLIBRARY) || (srcType == SAVEDPHOTOALBUM)) {
if (resultCode == Activity.RESULT_OK && intent != null) {
this.processResultFromGallery(destType, intent);
}
else if (resultCode == Activity.RESULT_CANCELED) {
this.failPicture("Selection cancelled.");
}
else {
this.failPicture("Selection did not complete!");
}
}
} | void function(int requestCode, int resultCode, Intent intent) { int srcType = (requestCode / 16) - 1; int destType = (requestCode % 16) - 1; if (requestCode >= CROP_CAMERA) { if (resultCode == Activity.RESULT_OK) { destType = requestCode - CROP_CAMERA; try { processResultFromCamera(destType, intent); } catch (IOException e) { e.printStackTrace(); Log.e(LOG_TAG, STR); } } else if (resultCode == Activity.RESULT_CANCELED) { this.failPicture(STR); } else { this.failPicture(STR); } } else if (srcType == CAMERA) { if (resultCode == Activity.RESULT_OK) { try { if(this.allowEdit) { Uri tmpFile = Uri.fromFile(new File(getTempDirectoryPath(), STR)); performCrop(tmpFile, destType, intent); } else { this.processResultFromCamera(destType, intent); } } catch (IOException e) { e.printStackTrace(); this.failPicture(STR); } } else if (resultCode == Activity.RESULT_CANCELED) { this.failPicture(STR); } else { this.failPicture(STR); } } else if ((srcType == PHOTOLIBRARY) (srcType == SAVEDPHOTOALBUM)) { if (resultCode == Activity.RESULT_OK && intent != null) { this.processResultFromGallery(destType, intent); } else if (resultCode == Activity.RESULT_CANCELED) { this.failPicture(STR); } else { this.failPicture(STR); } } } | /**
* Called when the camera view exits.
*
* @param requestCode The request code originally supplied to startActivityForResult(),
* allowing you to identify who this result came from.
* @param resultCode The integer result code returned by the child activity through its setResult().
* @param intent An Intent, which can return result data to the caller (various data can be attached to Intent "extras").
*/ | Called when the camera view exits | onActivityResult | {
"repo_name": "gaguirre/cordova-plugin-camera",
"path": "src/android/CameraLauncher.java",
"license": "apache-2.0",
"size": 44753
} | [
"android.app.Activity",
"android.content.Intent",
"android.net.Uri",
"android.util.Log",
"java.io.File",
"java.io.IOException"
] | import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.util.Log; import java.io.File; import java.io.IOException; | import android.app.*; import android.content.*; import android.net.*; import android.util.*; import java.io.*; | [
"android.app",
"android.content",
"android.net",
"android.util",
"java.io"
] | android.app; android.content; android.net; android.util; java.io; | 2,150,193 |
VectorGAOp vop = new VectorGAOp(2);
GridDistribution2D dist = new GridDistribution2D(new GridInfo(-10, 10, 100));
for(int i=0; i<10000; i++) {
dist.count(vop.generate());
}
dist.normalise();
// Distribution2DChart chart = new Distribution2DChart(dist);
// HighchartsRenderer r = new HighchartsRenderer();
// Image img = r.renderToImage(chart, com.winterwell.maths.chart.ImageFormat.PNG);
// JFrame frame = GuiUtils.popup(img, "Generated Points");
// GuiUtils.blockWhileOpen(frame);
}
| VectorGAOp vop = new VectorGAOp(2); GridDistribution2D dist = new GridDistribution2D(new GridInfo(-10, 10, 100)); for(int i=0; i<10000; i++) { dist.count(vop.generate()); } dist.normalise(); } | /**
* Test method for {@link com.winterwell.optimization.genetic.VectorGAOp#generate()}.
*/ | Test method for <code>com.winterwell.optimization.genetic.VectorGAOp#generate()</code> | testGenerate | {
"repo_name": "sodash/open-code",
"path": "winterwell.optimization/test/com/winterwell/optimization/genetic/VectorGAOperatorTest.java",
"license": "mit",
"size": 3227
} | [
"com.winterwell.maths.GridInfo",
"com.winterwell.maths.stats.distributions.GridDistribution2D"
] | import com.winterwell.maths.GridInfo; import com.winterwell.maths.stats.distributions.GridDistribution2D; | import com.winterwell.maths.*; import com.winterwell.maths.stats.distributions.*; | [
"com.winterwell.maths"
] | com.winterwell.maths; | 2,635,322 |
public Builder<TYPE> cfg(SplitTransitionProvider splitTransitionProvider) {
Preconditions.checkState(this.configTransition == ConfigurationTransition.NONE,
"the configuration transition is already set");
this.splitTransitionProvider = Preconditions.checkNotNull(splitTransitionProvider);
this.configTransition = ConfigurationTransition.SPLIT;
return this;
} | Builder<TYPE> function(SplitTransitionProvider splitTransitionProvider) { Preconditions.checkState(this.configTransition == ConfigurationTransition.NONE, STR); this.splitTransitionProvider = Preconditions.checkNotNull(splitTransitionProvider); this.configTransition = ConfigurationTransition.SPLIT; return this; } | /**
* Defines the configuration transition for this attribute.
*/ | Defines the configuration transition for this attribute | cfg | {
"repo_name": "mbrukman/bazel",
"path": "src/main/java/com/google/devtools/build/lib/packages/Attribute.java",
"license": "apache-2.0",
"size": 83062
} | [
"com.google.devtools.build.lib.util.Preconditions"
] | import com.google.devtools.build.lib.util.Preconditions; | import com.google.devtools.build.lib.util.*; | [
"com.google.devtools"
] | com.google.devtools; | 2,534,699 |
void mutateSensorGroup(Random rnd, List<SensorConfiguration> configurations); | void mutateSensorGroup(Random rnd, List<SensorConfiguration> configurations); | /**
* Perform the same mutation on all the sensor configurations.
*
* @param rnd
* A random number generator.
* @param configurations
* The list of sensor configuration to mutate
*/ | Perform the same mutation on all the sensor configurations | mutateSensorGroup | {
"repo_name": "JayH5/hons-experiment",
"path": "src/main/java/za/redbridge/experiment/NEATM/training/opp/sensors/MutateSensor.java",
"license": "apache-2.0",
"size": 1273
} | [
"java.util.List",
"java.util.Random",
"za.redbridge.experiment.NEATM"
] | import java.util.List; import java.util.Random; import za.redbridge.experiment.NEATM; | import java.util.*; import za.redbridge.experiment.*; | [
"java.util",
"za.redbridge.experiment"
] | java.util; za.redbridge.experiment; | 1,717,878 |
public float snapOffset(Rect imageRect) {
final float oldCoordinate = mCoordinate;
float newCoordinate = oldCoordinate;
switch (this) {
case LEFT:
newCoordinate = imageRect.left;
break;
case TOP:
newCoordinate = imageRect.top;
break;
case RIGHT:
newCoordinate = imageRect.right;
break;
case BOTTOM:
newCoordinate = imageRect.bottom;
break;
}
final float offset = newCoordinate - oldCoordinate;
return offset;
} | float function(Rect imageRect) { final float oldCoordinate = mCoordinate; float newCoordinate = oldCoordinate; switch (this) { case LEFT: newCoordinate = imageRect.left; break; case TOP: newCoordinate = imageRect.top; break; case RIGHT: newCoordinate = imageRect.right; break; case BOTTOM: newCoordinate = imageRect.bottom; break; } final float offset = newCoordinate - oldCoordinate; return offset; } | /**
* Returns the potential snap offset of snaptoRect, without changing the coordinate.
*
* @param imageRect the bounding rectangle of the image to snap to
* @return the amount (in pixels) that this coordinate was changed (i.e. the
* new coordinate minus the old coordinate value)
*/ | Returns the potential snap offset of snaptoRect, without changing the coordinate | snapOffset | {
"repo_name": "wangeason/PhotoViewCropper",
"path": "cropper/src/com/edmodo/cropper/cropwindow/edge/Edge.java",
"license": "apache-2.0",
"size": 19807
} | [
"android.graphics.Rect"
] | import android.graphics.Rect; | import android.graphics.*; | [
"android.graphics"
] | android.graphics; | 414,401 |
public void completeType2Int(){
HashMap<String, HashMap<String, HashMap<String, Integer>>> globalMap = this._param_g._featureIntMap;
HashMap<String, ArrayList<String>> type2Input = this._param_g._type2inputMap;
Iterator<String> iterType = globalMap.keySet().iterator();
while(iterType.hasNext()){
String type = iterType.next();
if(!type2Input.containsKey(type)){
type2Input.put(type, new ArrayList<String>());
}
HashMap<String, HashMap<String, Integer>> output2input = globalMap.get(type);
Iterator<String> iterOutput = output2input.keySet().iterator();
while(iterOutput.hasNext()){
String output = iterOutput.next();
HashMap<String, Integer> input2int = output2input.get(output);
Iterator<String> iterInput = input2int.keySet().iterator();
while(iterInput.hasNext()){
String input = iterInput.next();
ArrayList<String> inputs = type2Input.get(type);
int index = Collections.binarySearch(inputs, input);
if(index<0){
inputs.add(-1-index, input);
}
}
}
}
} | void function(){ HashMap<String, HashMap<String, HashMap<String, Integer>>> globalMap = this._param_g._featureIntMap; HashMap<String, ArrayList<String>> type2Input = this._param_g._type2inputMap; Iterator<String> iterType = globalMap.keySet().iterator(); while(iterType.hasNext()){ String type = iterType.next(); if(!type2Input.containsKey(type)){ type2Input.put(type, new ArrayList<String>()); } HashMap<String, HashMap<String, Integer>> output2input = globalMap.get(type); Iterator<String> iterOutput = output2input.keySet().iterator(); while(iterOutput.hasNext()){ String output = iterOutput.next(); HashMap<String, Integer> input2int = output2input.get(output); Iterator<String> iterInput = input2int.keySet().iterator(); while(iterInput.hasNext()){ String input = iterInput.next(); ArrayList<String> inputs = type2Input.get(type); int index = Collections.binarySearch(inputs, input); if(index<0){ inputs.add(-1-index, input); } } } } } | /**
* Used during generative training, this method completes the cross product between the type features and
* the input features
*/ | Used during generative training, this method completes the cross product between the type features and the input features | completeType2Int | {
"repo_name": "justhalf/weak-semi-crf-naacl2016",
"path": "src/main/java/com/statnlp/hybridnetworks/FeatureManager.java",
"license": "gpl-3.0",
"size": 11976
} | [
"java.util.ArrayList",
"java.util.Collections",
"java.util.HashMap",
"java.util.Iterator"
] | import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 1,989,830 |
void handleToken(final ByteBuffer src, final int startPosition, final int endPosition); | void handleToken(final ByteBuffer src, final int startPosition, final int endPosition); | /**
* Handle a single token.
* @param src data source
* @param startPosition the start position of the token
* @param endPosition the end position of the token
*/ | Handle a single token | handleToken | {
"repo_name": "LMAX-Exchange/angler",
"path": "src/main/java/com/lmax/angler/monitoring/network/monitor/util/TokenHandler.java",
"license": "apache-2.0",
"size": 672
} | [
"java.nio.ByteBuffer"
] | import java.nio.ByteBuffer; | import java.nio.*; | [
"java.nio"
] | java.nio; | 2,613,249 |
@Nullable
T read() throws IOException; | T read() throws IOException; | /**
* Reads the next record. Returns {@code null} when the input has reached its end.
*/ | Reads the next record. Returns null when the input has reached its end | read | {
"repo_name": "greghogan/flink",
"path": "flink-connectors/flink-connector-files/src/main/java/org/apache/flink/connector/file/src/reader/FileRecordFormat.java",
"license": "apache-2.0",
"size": 8516
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,012,095 |
@PUT
@Path("{path:.*}")
@Consumes({"*/*"})
@Produces({MediaType.APPLICATION_JSON})
public Response put(InputStream is,
@Context
Principal user,
@Context
UriInfo uriInfo,
@PathParam("path")
String path,
@QueryParam(OperationParam.NAME)
OperationParam op,
@Context
Parameters params) throws IOException, FileSystemAccessException {
Response response;
path = makeAbsolute(path);
MDC.put(HttpFSFileSystem.OP_PARAM, op.value().name());
String doAs = params.get(DoAsParam.NAME, DoAsParam.class);
switch (op.value()) {
case CREATE: {
Boolean hasData = params.get(DataParam.NAME, DataParam.class);
if (!hasData) {
response = Response.temporaryRedirect(
createUploadRedirectionURL(uriInfo,
HttpFSFileSystem.Operation.CREATE)).build();
} else {
Short permission =
params.get(PermissionParam.NAME, PermissionParam.class);
Boolean override =
params.get(OverwriteParam.NAME, OverwriteParam.class);
Short replication =
params.get(ReplicationParam.NAME, ReplicationParam.class);
Long blockSize =
params.get(BlockSizeParam.NAME, BlockSizeParam.class);
FSOperations.FSCreate command =
new FSOperations.FSCreate(is, path, permission, override,
replication, blockSize);
fsExecute(user, doAs, command);
AUDIT_LOG.info(
"[{}] permission [{}] override [{}] replication [{}] blockSize [{}]",
new Object[]{path, permission, override, replication, blockSize});
response = Response.status(Response.Status.CREATED).build();
}
break;
}
case MKDIRS: {
Short permission =
params.get(PermissionParam.NAME, PermissionParam.class);
FSOperations.FSMkdirs command =
new FSOperations.FSMkdirs(path, permission);
JSONObject json = fsExecute(user, doAs, command);
AUDIT_LOG.info("[{}] permission [{}]", path, permission);
response = Response.ok(json).type(MediaType.APPLICATION_JSON).build();
break;
}
case RENAME: {
String toPath =
params.get(DestinationParam.NAME, DestinationParam.class);
FSOperations.FSRename command = new FSOperations.FSRename(path, toPath);
JSONObject json = fsExecute(user, doAs, command);
AUDIT_LOG.info("[{}] to [{}]", path, toPath);
response = Response.ok(json).type(MediaType.APPLICATION_JSON).build();
break;
}
case SETOWNER: {
String owner = params.get(OwnerParam.NAME, OwnerParam.class);
String group = params.get(GroupParam.NAME, GroupParam.class);
FSOperations.FSSetOwner command =
new FSOperations.FSSetOwner(path, owner, group);
fsExecute(user, doAs, command);
AUDIT_LOG.info("[{}] to (O/G)[{}]", path, owner + ":" + group);
response = Response.ok().build();
break;
}
case SETPERMISSION: {
Short permission =
params.get(PermissionParam.NAME, PermissionParam.class);
FSOperations.FSSetPermission command =
new FSOperations.FSSetPermission(path, permission);
fsExecute(user, doAs, command);
AUDIT_LOG.info("[{}] to [{}]", path, permission);
response = Response.ok().build();
break;
}
case SETREPLICATION: {
Short replication =
params.get(ReplicationParam.NAME, ReplicationParam.class);
FSOperations.FSSetReplication command =
new FSOperations.FSSetReplication(path, replication);
JSONObject json = fsExecute(user, doAs, command);
AUDIT_LOG.info("[{}] to [{}]", path, replication);
response = Response.ok(json).build();
break;
}
case SETTIMES: {
Long modifiedTime =
params.get(ModifiedTimeParam.NAME, ModifiedTimeParam.class);
Long accessTime =
params.get(AccessTimeParam.NAME, AccessTimeParam.class);
FSOperations.FSSetTimes command =
new FSOperations.FSSetTimes(path, modifiedTime, accessTime);
fsExecute(user, doAs, command);
AUDIT_LOG
.info("[{}] to (M/A)[{}]", path, modifiedTime + ":" + accessTime);
response = Response.ok().build();
break;
}
default: {
throw new IOException(MessageFormat
.format("Invalid HTTP PUT operation [{0}]", op.value()));
}
}
return response;
} | @Path(STR) @Consumes({"*/*"}) @Produces({MediaType.APPLICATION_JSON}) Response function(InputStream is, Principal user, UriInfo uriInfo, @PathParam("path") String path, @QueryParam(OperationParam.NAME) OperationParam op, Parameters params) throws IOException, FileSystemAccessException { Response response; path = makeAbsolute(path); MDC.put(HttpFSFileSystem.OP_PARAM, op.value().name()); String doAs = params.get(DoAsParam.NAME, DoAsParam.class); switch (op.value()) { case CREATE: { Boolean hasData = params.get(DataParam.NAME, DataParam.class); if (!hasData) { response = Response.temporaryRedirect( createUploadRedirectionURL(uriInfo, HttpFSFileSystem.Operation.CREATE)).build(); } else { Short permission = params.get(PermissionParam.NAME, PermissionParam.class); Boolean override = params.get(OverwriteParam.NAME, OverwriteParam.class); Short replication = params.get(ReplicationParam.NAME, ReplicationParam.class); Long blockSize = params.get(BlockSizeParam.NAME, BlockSizeParam.class); FSOperations.FSCreate command = new FSOperations.FSCreate(is, path, permission, override, replication, blockSize); fsExecute(user, doAs, command); AUDIT_LOG.info( STR, new Object[]{path, permission, override, replication, blockSize}); response = Response.status(Response.Status.CREATED).build(); } break; } case MKDIRS: { Short permission = params.get(PermissionParam.NAME, PermissionParam.class); FSOperations.FSMkdirs command = new FSOperations.FSMkdirs(path, permission); JSONObject json = fsExecute(user, doAs, command); AUDIT_LOG.info(STR, path, permission); response = Response.ok(json).type(MediaType.APPLICATION_JSON).build(); break; } case RENAME: { String toPath = params.get(DestinationParam.NAME, DestinationParam.class); FSOperations.FSRename command = new FSOperations.FSRename(path, toPath); JSONObject json = fsExecute(user, doAs, command); AUDIT_LOG.info(STR, path, toPath); response = Response.ok(json).type(MediaType.APPLICATION_JSON).build(); break; } case SETOWNER: { String owner = params.get(OwnerParam.NAME, OwnerParam.class); String group = params.get(GroupParam.NAME, GroupParam.class); FSOperations.FSSetOwner command = new FSOperations.FSSetOwner(path, owner, group); fsExecute(user, doAs, command); AUDIT_LOG.info(STR, path, owner + ":" + group); response = Response.ok().build(); break; } case SETPERMISSION: { Short permission = params.get(PermissionParam.NAME, PermissionParam.class); FSOperations.FSSetPermission command = new FSOperations.FSSetPermission(path, permission); fsExecute(user, doAs, command); AUDIT_LOG.info(STR, path, permission); response = Response.ok().build(); break; } case SETREPLICATION: { Short replication = params.get(ReplicationParam.NAME, ReplicationParam.class); FSOperations.FSSetReplication command = new FSOperations.FSSetReplication(path, replication); JSONObject json = fsExecute(user, doAs, command); AUDIT_LOG.info(STR, path, replication); response = Response.ok(json).build(); break; } case SETTIMES: { Long modifiedTime = params.get(ModifiedTimeParam.NAME, ModifiedTimeParam.class); Long accessTime = params.get(AccessTimeParam.NAME, AccessTimeParam.class); FSOperations.FSSetTimes command = new FSOperations.FSSetTimes(path, modifiedTime, accessTime); fsExecute(user, doAs, command); AUDIT_LOG .info(STR, path, modifiedTime + ":" + accessTime); response = Response.ok().build(); break; } default: { throw new IOException(MessageFormat .format(STR, op.value())); } } return response; } | /**
* Binding to handle PUT requests.
*
* @param is
* the inputstream for the request payload.
* @param user
* the principal of the user making the request.
* @param uriInfo
* the of the request.
* @param path
* the path for operation.
* @param op
* the HttpFS operation of the request.
* @param params
* the HttpFS parameters of the request.
* @return the request response.
* @throws IOException
* thrown if an IO error occurred. Thrown exceptions are
* handled by {@link HttpFSExceptionProvider}.
* @throws FileSystemAccessException
* thrown if a FileSystemAccess releated
* error occurred. Thrown exceptions are handled by
* {@link HttpFSExceptionProvider}.
*/ | Binding to handle PUT requests | put | {
"repo_name": "robzor92/hops",
"path": "hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/HttpFSServer.java",
"license": "apache-2.0",
"size": 24367
} | [
"java.io.IOException",
"java.io.InputStream",
"java.security.Principal",
"java.text.MessageFormat",
"javax.ws.rs.Consumes",
"javax.ws.rs.Path",
"javax.ws.rs.PathParam",
"javax.ws.rs.Produces",
"javax.ws.rs.QueryParam",
"javax.ws.rs.core.MediaType",
"javax.ws.rs.core.Response",
"javax.ws.rs.core.UriInfo",
"org.apache.hadoop.fs.http.client.HttpFSFileSystem",
"org.apache.hadoop.fs.http.server.HttpFSParametersProvider",
"org.apache.hadoop.lib.service.FileSystemAccessException",
"org.apache.hadoop.lib.wsrs.Parameters",
"org.json.simple.JSONObject",
"org.slf4j.MDC"
] | import java.io.IOException; import java.io.InputStream; import java.security.Principal; import java.text.MessageFormat; import javax.ws.rs.Consumes; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; import org.apache.hadoop.fs.http.client.HttpFSFileSystem; import org.apache.hadoop.fs.http.server.HttpFSParametersProvider; import org.apache.hadoop.lib.service.FileSystemAccessException; import org.apache.hadoop.lib.wsrs.Parameters; import org.json.simple.JSONObject; import org.slf4j.MDC; | import java.io.*; import java.security.*; import java.text.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import org.apache.hadoop.fs.http.client.*; import org.apache.hadoop.fs.http.server.*; import org.apache.hadoop.lib.service.*; import org.apache.hadoop.lib.wsrs.*; import org.json.simple.*; import org.slf4j.*; | [
"java.io",
"java.security",
"java.text",
"javax.ws",
"org.apache.hadoop",
"org.json.simple",
"org.slf4j"
] | java.io; java.security; java.text; javax.ws; org.apache.hadoop; org.json.simple; org.slf4j; | 397,069 |
return selector;
}
/**
* Sets the value of the selector property.
*
* @param value
* allowed object is
* {@link Selector } | return selector; } /** * Sets the value of the selector property. * * @param value * allowed object is * {@link Selector } | /**
* Gets the value of the selector property.
*
* @return
* possible object is
* {@link Selector }
*
*/ | Gets the value of the selector property | getSelector | {
"repo_name": "nafae/developer",
"path": "modules/adwords_appengine/src/main/java/com/google/api/ads/adwords/jaxws/v201406/express/ProductServiceServiceInterfaceget.java",
"license": "apache-2.0",
"size": 1976
} | [
"com.google.api.ads.adwords.jaxws.v201406.cm.Selector"
] | import com.google.api.ads.adwords.jaxws.v201406.cm.Selector; | import com.google.api.ads.adwords.jaxws.v201406.cm.*; | [
"com.google.api"
] | com.google.api; | 1,118,172 |
protected HoldingTaxLotDao getHoldingTaxLotDao() {
return holdingTaxLotDao;
} | HoldingTaxLotDao function() { return holdingTaxLotDao; } | /**
* Gets the holdingTaxLotDao.
*
* @return holdingTaxLotDao
*/ | Gets the holdingTaxLotDao | getHoldingTaxLotDao | {
"repo_name": "Ariah-Group/Finance",
"path": "af_webapp/src/main/java/org/kuali/kfs/module/endow/document/service/impl/HoldingTaxLotServiceImpl.java",
"license": "apache-2.0",
"size": 15759
} | [
"org.kuali.kfs.module.endow.dataaccess.HoldingTaxLotDao"
] | import org.kuali.kfs.module.endow.dataaccess.HoldingTaxLotDao; | import org.kuali.kfs.module.endow.dataaccess.*; | [
"org.kuali.kfs"
] | org.kuali.kfs; | 1,983,524 |
public static void safeClose(final ServerSocket resource) {
try {
if (resource != null) {
closeMsg.closingResource(resource);
resource.close();
}
} catch (ClosedChannelException ignored) {
} catch (Throwable t) {
closeMsg.resourceCloseFailed(t, resource);
}
} | static void function(final ServerSocket resource) { try { if (resource != null) { closeMsg.closingResource(resource); resource.close(); } } catch (ClosedChannelException ignored) { } catch (Throwable t) { closeMsg.resourceCloseFailed(t, resource); } } | /**
* Close a resource, logging an error if an error occurs.
*
* @param resource the resource to close
*/ | Close a resource, logging an error if an error occurs | safeClose | {
"repo_name": "stuartwdouglas/xnio",
"path": "api/src/main/java/org/xnio/IoUtils.java",
"license": "apache-2.0",
"size": 24525
} | [
"java.net.ServerSocket",
"java.nio.channels.ClosedChannelException"
] | import java.net.ServerSocket; import java.nio.channels.ClosedChannelException; | import java.net.*; import java.nio.channels.*; | [
"java.net",
"java.nio"
] | java.net; java.nio; | 2,574,122 |
public void testSerialization() throws IOException {
for (int runs = 0; runs < NUMBER_OF_TESTBUILDERS; runs++) {
HighlightBuilder original = randomHighlighterBuilder();
HighlightBuilder deserialized = serializedCopy(original);
assertEquals(deserialized, original);
assertEquals(deserialized.hashCode(), original.hashCode());
assertNotSame(deserialized, original);
}
} | void function() throws IOException { for (int runs = 0; runs < NUMBER_OF_TESTBUILDERS; runs++) { HighlightBuilder original = randomHighlighterBuilder(); HighlightBuilder deserialized = serializedCopy(original); assertEquals(deserialized, original); assertEquals(deserialized.hashCode(), original.hashCode()); assertNotSame(deserialized, original); } } | /**
* Test serialization and deserialization of the highlighter builder
*/ | Test serialization and deserialization of the highlighter builder | testSerialization | {
"repo_name": "snikch/elasticsearch",
"path": "core/src/test/java/org/elasticsearch/search/highlight/HighlightBuilderTests.java",
"license": "apache-2.0",
"size": 23464
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,379,463 |
public static Iterable<String> toRootRelativePaths(NestedSet<Artifact> artifacts) {
return toRootRelativePaths(artifacts.toList());
} | static Iterable<String> function(NestedSet<Artifact> artifacts) { return toRootRelativePaths(artifacts.toList()); } | /**
* Lazily converts artifacts into root-relative path strings. Middleman artifacts are ignored by
* this method.
*/ | Lazily converts artifacts into root-relative path strings. Middleman artifacts are ignored by this method | toRootRelativePaths | {
"repo_name": "twitter-forks/bazel",
"path": "src/main/java/com/google/devtools/build/lib/actions/Artifact.java",
"license": "apache-2.0",
"size": 61163
} | [
"com.google.devtools.build.lib.collect.nestedset.NestedSet"
] | import com.google.devtools.build.lib.collect.nestedset.NestedSet; | import com.google.devtools.build.lib.collect.nestedset.*; | [
"com.google.devtools"
] | com.google.devtools; | 2,106,649 |
@SuppressWarnings("deprecation")
public boolean hasEnoughSpaceOnSdCard(long updateSize) {
RootTools.log("Checking SDcard size and that it is mounted as RW");
String status = Environment.getExternalStorageState();
if (!status.equals(Environment.MEDIA_MOUNTED)) {
return false;
}
File path = Environment.getExternalStorageDirectory();
StatFs stat = new StatFs(path.getPath());
long blockSize = 0;
long availableBlocks = 0;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) {
blockSize = stat.getBlockSize();
availableBlocks = stat.getAvailableBlocks();
} else {
blockSize = stat.getBlockSizeLong();
availableBlocks = stat.getAvailableBlocksLong();
}
return (updateSize < availableBlocks * blockSize);
} | @SuppressWarnings(STR) boolean function(long updateSize) { RootTools.log(STR); String status = Environment.getExternalStorageState(); if (!status.equals(Environment.MEDIA_MOUNTED)) { return false; } File path = Environment.getExternalStorageDirectory(); StatFs stat = new StatFs(path.getPath()); long blockSize = 0; long availableBlocks = 0; if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) { blockSize = stat.getBlockSize(); availableBlocks = stat.getAvailableBlocks(); } else { blockSize = stat.getBlockSizeLong(); availableBlocks = stat.getAvailableBlocksLong(); } return (updateSize < availableBlocks * blockSize); } | /**
* Checks if there is enough Space on SDCard
*
* @param updateSize size to Check (long)
* @return <code>true</code> if the Update will fit on SDCard, <code>false</code> if not enough
* space on SDCard. Will also return <code>false</code>, if the SDCard is not mounted as
* read/write
*/ | Checks if there is enough Space on SDCard | hasEnoughSpaceOnSdCard | {
"repo_name": "Xorok/android_app_efidroidmanager",
"path": "sub_projects/RootTools/src/main/java/com/stericson/roottools/internal/RootToolsInternalMethods.java",
"license": "apache-2.0",
"size": 48905
} | [
"android.os.Build",
"android.os.Environment",
"android.os.StatFs",
"com.stericson.roottools.RootTools",
"java.io.File"
] | import android.os.Build; import android.os.Environment; import android.os.StatFs; import com.stericson.roottools.RootTools; import java.io.File; | import android.os.*; import com.stericson.roottools.*; import java.io.*; | [
"android.os",
"com.stericson.roottools",
"java.io"
] | android.os; com.stericson.roottools; java.io; | 1,928,135 |
public Collection<UUID> list() throws ConfigStoreException {
String configurationsPath = getConfigsPath(namespace);
try {
Collection<UUID> ids = new ArrayList<>();
for (String id : persister.getChildren(configurationsPath)) {
try {
ids.add(UUID.fromString(id));
} catch (IllegalArgumentException e) {
throw new ConfigStoreException(Reason.SERIALIZATION_ERROR,
String.format("Invalid UUID value: %s", id), e);
}
}
return ids;
} catch (PersisterException e) {
if (e.getReason() == Reason.NOT_FOUND) {
// Clearing a non-existent Configuration should not result in an exception.
logger.warn("Configuration list at path '{}' does not exist: returning empty list",
configurationsPath);
return new ArrayList<>();
} else {
throw new ConfigStoreException(Reason.STORAGE_ERROR, String.format(
"Failed to retrieve list of configurations from '%s'", configurationsPath), e);
}
}
} | Collection<UUID> function() throws ConfigStoreException { String configurationsPath = getConfigsPath(namespace); try { Collection<UUID> ids = new ArrayList<>(); for (String id : persister.getChildren(configurationsPath)) { try { ids.add(UUID.fromString(id)); } catch (IllegalArgumentException e) { throw new ConfigStoreException(Reason.SERIALIZATION_ERROR, String.format(STR, id), e); } } return ids; } catch (PersisterException e) { if (e.getReason() == Reason.NOT_FOUND) { logger.warn(STR, configurationsPath); return new ArrayList<>(); } else { throw new ConfigStoreException(Reason.STORAGE_ERROR, String.format( STR, configurationsPath), e); } } } | /**
* Returns a list of all stored configuration UUIDs, or an empty list if none are found.
*
* @throws ConfigStoreException if list retrieval fails
*/ | Returns a list of all stored configuration UUIDs, or an empty list if none are found | list | {
"repo_name": "mesosphere/dcos-commons",
"path": "sdk/scheduler/src/main/java/com/mesosphere/sdk/state/ConfigStore.java",
"license": "apache-2.0",
"size": 9867
} | [
"com.mesosphere.sdk.storage.PersisterException",
"com.mesosphere.sdk.storage.StorageError",
"java.util.ArrayList",
"java.util.Collection",
"java.util.UUID"
] | import com.mesosphere.sdk.storage.PersisterException; import com.mesosphere.sdk.storage.StorageError; import java.util.ArrayList; import java.util.Collection; import java.util.UUID; | import com.mesosphere.sdk.storage.*; import java.util.*; | [
"com.mesosphere.sdk",
"java.util"
] | com.mesosphere.sdk; java.util; | 1,337,177 |
@Test
public void testCheckCoordinatorSlaCheckForceAct() throws Exception {
IScheduledTask task1 = makeTask("taskA", 1, RUNNING);
CountDownLatch workCalled = new CountDownLatch(1);
jettyServer.setHandler(mockCoordinatorResponse(task1, "{\"drain\": false}"));
jettyServer.start();
// expect that the fetchTask in the work is called after force
expect(storageUtil.taskStore.fetchTask(task1.getAssignedTask().getTaskId()))
.andReturn(Optional.of(task1));
control.replay();
slaManager.checkSlaThenAct(
task1,
createCoordinatorSlaPolicy(),
storeProvider -> {
// set the marker to indicate that we performed the work
workCalled.countDown();
storeProvider
.getUnsafeTaskStore()
.fetchTask(task1.getAssignedTask().getTaskId());
return null;
},
ImmutableMap.of(),
true);
workCalled.await();
// coordinator is not contacted
assertEquals(1, coordinatorResponded.getCount());
// check the work was called
assertEquals(0, workCalled.getCount());
} | void function() throws Exception { IScheduledTask task1 = makeTask("taskA", 1, RUNNING); CountDownLatch workCalled = new CountDownLatch(1); jettyServer.setHandler(mockCoordinatorResponse(task1, "{\"drain\STR)); jettyServer.start(); expect(storageUtil.taskStore.fetchTask(task1.getAssignedTask().getTaskId())) .andReturn(Optional.of(task1)); control.replay(); slaManager.checkSlaThenAct( task1, createCoordinatorSlaPolicy(), storeProvider -> { workCalled.countDown(); storeProvider .getUnsafeTaskStore() .fetchTask(task1.getAssignedTask().getTaskId()); return null; }, ImmutableMap.of(), true); workCalled.await(); assertEquals(1, coordinatorResponded.getCount()); assertEquals(0, workCalled.getCount()); } | /**
* Verifies that when {@code force} is {@code True} the supplied {@link Storage.MutateWork} gets
* executed without checking the SLA.
*/ | Verifies that when force is True the supplied <code>Storage.MutateWork</code> gets executed without checking the SLA | testCheckCoordinatorSlaCheckForceAct | {
"repo_name": "thinker0/aurora",
"path": "src/test/java/org/apache/aurora/scheduler/sla/SlaManagerTest.java",
"license": "apache-2.0",
"size": 49619
} | [
"com.google.common.collect.ImmutableMap",
"java.util.Optional",
"java.util.concurrent.CountDownLatch",
"org.apache.aurora.scheduler.storage.entities.IScheduledTask",
"org.easymock.EasyMock",
"org.junit.Assert"
] | import com.google.common.collect.ImmutableMap; import java.util.Optional; import java.util.concurrent.CountDownLatch; import org.apache.aurora.scheduler.storage.entities.IScheduledTask; import org.easymock.EasyMock; import org.junit.Assert; | import com.google.common.collect.*; import java.util.*; import java.util.concurrent.*; import org.apache.aurora.scheduler.storage.entities.*; import org.easymock.*; import org.junit.*; | [
"com.google.common",
"java.util",
"org.apache.aurora",
"org.easymock",
"org.junit"
] | com.google.common; java.util; org.apache.aurora; org.easymock; org.junit; | 2,755,799 |
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<Void>> deleteWithResponseAsync(
String resourceGroupName,
String serviceName,
String apiId,
String operationId,
PolicyIdName policyId,
String ifMatch) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (serviceName == null) {
return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));
}
if (apiId == null) {
return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null."));
}
if (operationId == null) {
return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null."));
}
if (policyId == null) {
return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null."));
}
if (ifMatch == null) {
return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.delete(
this.client.getEndpoint(),
resourceGroupName,
serviceName,
apiId,
operationId,
policyId,
ifMatch,
this.client.getApiVersion(),
this.client.getSubscriptionId(),
accept,
context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
} | @ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<Void>> function( String resourceGroupName, String serviceName, String apiId, String operationId, PolicyIdName policyId, String ifMatch) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (serviceName == null) { return Mono.error(new IllegalArgumentException(STR)); } if (apiId == null) { return Mono.error(new IllegalArgumentException(STR)); } if (operationId == null) { return Mono.error(new IllegalArgumentException(STR)); } if (policyId == null) { return Mono.error(new IllegalArgumentException(STR)); } if (ifMatch == null) { return Mono.error(new IllegalArgumentException(STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( STR)); } final String accept = STR; return FluxUtil .withContext( context -> service .delete( this.client.getEndpoint(), resourceGroupName, serviceName, apiId, operationId, policyId, ifMatch, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } | /**
* Deletes the policy configuration at the Api Operation.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the API Management service.
* @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current
* revision has ;rev=n as a suffix where n is the revision number.
* @param operationId Operation identifier within an API. Must be unique in the current API Management service
* instance.
* @param policyId The identifier of the Policy.
* @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET
* request or it should be * for unconditional update.
* @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 completion.
*/ | Deletes the policy configuration at the Api Operation | deleteWithResponseAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiOperationPoliciesClientImpl.java",
"license": "mit",
"size": 67502
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.core.util.FluxUtil",
"com.azure.resourcemanager.apimanagement.models.PolicyIdName"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.apimanagement.models.PolicyIdName; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.apimanagement.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 2,797,205 |
name = "Item name";
description = "Item description";
price = 3.47;
item = new MenuItem(name, description, true, price);
} | name = STR; description = STR; price = 3.47; item = new MenuItem(name, description, true, price); } | /**
* Initialize test case.
*/ | Initialize test case | setUp | {
"repo_name": "CC3002/DesignPatternsInJava",
"path": "src/test/java/com/cc3002/auxiliar/design/pattern/composite/example06/test/MenuItemTest.java",
"license": "mit",
"size": 2165
} | [
"com.cc3002.auxiliar.design.pattern.composite.example06.MenuItem"
] | import com.cc3002.auxiliar.design.pattern.composite.example06.MenuItem; | import com.cc3002.auxiliar.design.pattern.composite.example06.*; | [
"com.cc3002.auxiliar"
] | com.cc3002.auxiliar; | 1,870,933 |
public QueryWorkUnit getFragments(OptionList options, DrillbitEndpoint foremanNode, QueryId queryId, Collection<DrillbitEndpoint> activeEndpoints,
PhysicalPlanReader reader, Fragment rootNode, PlanningSet planningSet, UserSession session) throws ExecutionSetupException {
assignEndpoints(activeEndpoints, planningSet);
return generateWorkUnit(options, foremanNode, queryId, reader, rootNode, planningSet, session);
} | QueryWorkUnit function(OptionList options, DrillbitEndpoint foremanNode, QueryId queryId, Collection<DrillbitEndpoint> activeEndpoints, PhysicalPlanReader reader, Fragment rootNode, PlanningSet planningSet, UserSession session) throws ExecutionSetupException { assignEndpoints(activeEndpoints, planningSet); return generateWorkUnit(options, foremanNode, queryId, reader, rootNode, planningSet, session); } | /**
* Generate a set of assigned fragments based on the provided planningSet. Do not allow parallelization stages to go
* beyond the global max width.
*
* @param foremanNode The driving/foreman node for this query. (this node)
* @param queryId The queryId for this query.
* @param activeEndpoints The list of endpoints to consider for inclusion in planning this query.
* @param reader Tool used to read JSON plans
* @param rootNode The root node of the PhysicalPlan that we will parallelizing.
* @param planningSet The set of queries with collected statistics that we'll work with.
* @return The list of generated PlanFragment protobuf objects to be assigned out to the individual nodes.
* @throws ForemanException
*/ | Generate a set of assigned fragments based on the provided planningSet. Do not allow parallelization stages to go beyond the global max width | getFragments | {
"repo_name": "bbevens/drill",
"path": "exec/java-exec/src/main/java/org/apache/drill/exec/planner/fragment/SimpleParallelizer.java",
"license": "apache-2.0",
"size": 9672
} | [
"java.util.Collection",
"org.apache.drill.common.exceptions.ExecutionSetupException",
"org.apache.drill.exec.planner.PhysicalPlanReader",
"org.apache.drill.exec.proto.CoordinationProtos",
"org.apache.drill.exec.proto.UserBitShared",
"org.apache.drill.exec.rpc.user.UserSession",
"org.apache.drill.exec.server.options.OptionList",
"org.apache.drill.exec.work.QueryWorkUnit"
] | import java.util.Collection; import org.apache.drill.common.exceptions.ExecutionSetupException; import org.apache.drill.exec.planner.PhysicalPlanReader; import org.apache.drill.exec.proto.CoordinationProtos; import org.apache.drill.exec.proto.UserBitShared; import org.apache.drill.exec.rpc.user.UserSession; import org.apache.drill.exec.server.options.OptionList; import org.apache.drill.exec.work.QueryWorkUnit; | import java.util.*; import org.apache.drill.common.exceptions.*; import org.apache.drill.exec.planner.*; import org.apache.drill.exec.proto.*; import org.apache.drill.exec.rpc.user.*; import org.apache.drill.exec.server.options.*; import org.apache.drill.exec.work.*; | [
"java.util",
"org.apache.drill"
] | java.util; org.apache.drill; | 1,560,451 |
Subsets and Splits