repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/JobResult.java | JobResult.toJobExecutionResult | public JobExecutionResult toJobExecutionResult(ClassLoader classLoader) throws JobExecutionException, IOException, ClassNotFoundException {
"""
Converts the {@link JobResult} to a {@link JobExecutionResult}.
@param classLoader to use for deserialization
@return JobExecutionResult
@throws JobCancellationExcept... | java | public JobExecutionResult toJobExecutionResult(ClassLoader classLoader) throws JobExecutionException, IOException, ClassNotFoundException {
if (applicationStatus == ApplicationStatus.SUCCEEDED) {
return new JobExecutionResult(
jobId,
netRuntime,
AccumulatorHelper.deserializeAccumulators(
accumulat... | [
"public",
"JobExecutionResult",
"toJobExecutionResult",
"(",
"ClassLoader",
"classLoader",
")",
"throws",
"JobExecutionException",
",",
"IOException",
",",
"ClassNotFoundException",
"{",
"if",
"(",
"applicationStatus",
"==",
"ApplicationStatus",
".",
"SUCCEEDED",
")",
"{"... | Converts the {@link JobResult} to a {@link JobExecutionResult}.
@param classLoader to use for deserialization
@return JobExecutionResult
@throws JobCancellationException if the job was cancelled
@throws JobExecutionException if the job execution did not succeed
@throws IOException if the accumulator could not be deser... | [
"Converts",
"the",
"{",
"@link",
"JobResult",
"}",
"to",
"a",
"{",
"@link",
"JobExecutionResult",
"}",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/JobResult.java#L126-L155 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java | JBBPDslBuilder.Bool | public JBBPDslBuilder Bool(final String name) {
"""
Add named boolean field.
@param name name of the field, can be null for anonymous one
@return the builder instance, must not be null
"""
final Item item = new Item(BinType.BOOL, name, this.byteOrder);
this.addItem(item);
return this;
} | java | public JBBPDslBuilder Bool(final String name) {
final Item item = new Item(BinType.BOOL, name, this.byteOrder);
this.addItem(item);
return this;
} | [
"public",
"JBBPDslBuilder",
"Bool",
"(",
"final",
"String",
"name",
")",
"{",
"final",
"Item",
"item",
"=",
"new",
"Item",
"(",
"BinType",
".",
"BOOL",
",",
"name",
",",
"this",
".",
"byteOrder",
")",
";",
"this",
".",
"addItem",
"(",
"item",
")",
";... | Add named boolean field.
@param name name of the field, can be null for anonymous one
@return the builder instance, must not be null | [
"Add",
"named",
"boolean",
"field",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java#L806-L810 |
opendigitaleducation/web-utils | src/main/java/org/vertx/java/core/http/RouteMatcher.java | RouteMatcher.headWithRegEx | public RouteMatcher headWithRegEx(String regex, Handler<HttpServerRequest> handler) {
"""
Specify a handler that will be called for a matching HTTP HEAD
@param regex A regular expression
@param handler The handler to call
"""
addRegEx(regex, handler, headBindings);
return this;
} | java | public RouteMatcher headWithRegEx(String regex, Handler<HttpServerRequest> handler) {
addRegEx(regex, handler, headBindings);
return this;
} | [
"public",
"RouteMatcher",
"headWithRegEx",
"(",
"String",
"regex",
",",
"Handler",
"<",
"HttpServerRequest",
">",
"handler",
")",
"{",
"addRegEx",
"(",
"regex",
",",
"handler",
",",
"headBindings",
")",
";",
"return",
"this",
";",
"}"
] | Specify a handler that will be called for a matching HTTP HEAD
@param regex A regular expression
@param handler The handler to call | [
"Specify",
"a",
"handler",
"that",
"will",
"be",
"called",
"for",
"a",
"matching",
"HTTP",
"HEAD"
] | train | https://github.com/opendigitaleducation/web-utils/blob/5c12f7e8781a9a0fbbe7b8d9fb741627aa97a1e3/src/main/java/org/vertx/java/core/http/RouteMatcher.java#L259-L262 |
matthewhorridge/owlexplanation | src/main/java/org/semanticweb/owl/explanation/impl/blackbox/BlackBoxExplanationGenerator.java | BlackBoxExplanationGenerator.getOrderedJustifications | private static <E> List<OWLAxiom> getOrderedJustifications(List<OWLAxiom> mups, final Set<Explanation<E>> allJustifications) {
"""
Orders the axioms in a single MUPS by the frequency of which they appear
in all MUPS.
@param mups The MUPS containing the axioms to be ordered
@param allJustification... | java | private static <E> List<OWLAxiom> getOrderedJustifications(List<OWLAxiom> mups, final Set<Explanation<E>> allJustifications) {
Comparator<OWLAxiom> mupsComparator = new Comparator<OWLAxiom>() {
public int compare(OWLAxiom o1, OWLAxiom o2) {
// The checker that appears in most MUPS ha... | [
"private",
"static",
"<",
"E",
">",
"List",
"<",
"OWLAxiom",
">",
"getOrderedJustifications",
"(",
"List",
"<",
"OWLAxiom",
">",
"mups",
",",
"final",
"Set",
"<",
"Explanation",
"<",
"E",
">",
">",
"allJustifications",
")",
"{",
"Comparator",
"<",
"OWLAxio... | Orders the axioms in a single MUPS by the frequency of which they appear
in all MUPS.
@param mups The MUPS containing the axioms to be ordered
@param allJustifications The set of all justifications which is used to calculate the ordering
@return The ordered axioms | [
"Orders",
"the",
"axioms",
"in",
"a",
"single",
"MUPS",
"by",
"the",
"frequency",
"of",
"which",
"they",
"appear",
"in",
"all",
"MUPS",
"."
] | train | https://github.com/matthewhorridge/owlexplanation/blob/439c5ca67835f5e421adde725e4e8a3bcd760ac8/src/main/java/org/semanticweb/owl/explanation/impl/blackbox/BlackBoxExplanationGenerator.java#L279-L291 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/thrift/CQLTranslator.java | CQLTranslator.ensureCase | public StringBuilder ensureCase(StringBuilder builder, String fieldName, boolean useToken) {
"""
Ensures case for corresponding column name.
@param builder
column name builder.
@param fieldName
column name.
@param useToken
the use token
@return builder object with appended column name.
"""
if ... | java | public StringBuilder ensureCase(StringBuilder builder, String fieldName, boolean useToken)
{
if (useToken)
{
builder.append(TOKEN);
}
builder.append(Constants.ESCAPE_QUOTE);
builder.append(fieldName);
builder.append(Constants.ESCAPE_QUOTE);
if (use... | [
"public",
"StringBuilder",
"ensureCase",
"(",
"StringBuilder",
"builder",
",",
"String",
"fieldName",
",",
"boolean",
"useToken",
")",
"{",
"if",
"(",
"useToken",
")",
"{",
"builder",
".",
"append",
"(",
"TOKEN",
")",
";",
"}",
"builder",
".",
"append",
"(... | Ensures case for corresponding column name.
@param builder
column name builder.
@param fieldName
column name.
@param useToken
the use token
@return builder object with appended column name. | [
"Ensures",
"case",
"for",
"corresponding",
"column",
"name",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/thrift/CQLTranslator.java#L1003-L1018 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.getTaggedImages | public List<Image> getTaggedImages(UUID projectId, GetTaggedImagesOptionalParameter getTaggedImagesOptionalParameter) {
"""
Get tagged images for a given project iteration.
This API supports batching and range selection. By default it will only return first 50 images matching images.
Use the {take} and {skip} pa... | java | public List<Image> getTaggedImages(UUID projectId, GetTaggedImagesOptionalParameter getTaggedImagesOptionalParameter) {
return getTaggedImagesWithServiceResponseAsync(projectId, getTaggedImagesOptionalParameter).toBlocking().single().body();
} | [
"public",
"List",
"<",
"Image",
">",
"getTaggedImages",
"(",
"UUID",
"projectId",
",",
"GetTaggedImagesOptionalParameter",
"getTaggedImagesOptionalParameter",
")",
"{",
"return",
"getTaggedImagesWithServiceResponseAsync",
"(",
"projectId",
",",
"getTaggedImagesOptionalParameter... | Get tagged images for a given project iteration.
This API supports batching and range selection. By default it will only return first 50 images matching images.
Use the {take} and {skip} parameters to control how many images to return in a given batch.
The filtering is on an and/or relationship. For example, if the pro... | [
"Get",
"tagged",
"images",
"for",
"a",
"given",
"project",
"iteration",
".",
"This",
"API",
"supports",
"batching",
"and",
"range",
"selection",
".",
"By",
"default",
"it",
"will",
"only",
"return",
"first",
"50",
"images",
"matching",
"images",
".",
"Use",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L4974-L4976 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/projections/AbstractFullProjection.java | AbstractFullProjection.projectRenderToDataSpace | @Override
public <NV extends NumberVector> NV projectRenderToDataSpace(double[] v, NumberVector.Factory<NV> prototype) {
"""
Project a vector from rendering space to data space.
@param <NV> Vector type
@param v vector in rendering space
@param prototype Object factory
@return vector in data space
"""
... | java | @Override
public <NV extends NumberVector> NV projectRenderToDataSpace(double[] v, NumberVector.Factory<NV> prototype) {
final int dim = v.length;
double[] vec = projectRenderToScaled(v);
// Not calling {@link #projectScaledToDataSpace} to avoid extra copy of
// vector.
for(int d = 0; d < dim; d++... | [
"@",
"Override",
"public",
"<",
"NV",
"extends",
"NumberVector",
">",
"NV",
"projectRenderToDataSpace",
"(",
"double",
"[",
"]",
"v",
",",
"NumberVector",
".",
"Factory",
"<",
"NV",
">",
"prototype",
")",
"{",
"final",
"int",
"dim",
"=",
"v",
".",
"lengt... | Project a vector from rendering space to data space.
@param <NV> Vector type
@param v vector in rendering space
@param prototype Object factory
@return vector in data space | [
"Project",
"a",
"vector",
"from",
"rendering",
"space",
"to",
"data",
"space",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/projections/AbstractFullProjection.java#L181-L191 |
jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.getMappedTypeDefined | public static String getMappedTypeDefined(int order, FieldType type, String express, boolean isList) {
"""
get mapped type defined java expression.
@param order field order
@param type field type
@param express java expression
@param isList is field type is a {@link List}
@return full java expression
""... | java | public static String getMappedTypeDefined(int order, FieldType type, String express, boolean isList) {
String fieldName = getFieldName(order);
if ((type == FieldType.STRING || type == FieldType.BYTES) && !isList) {
// add null check
String code = "com.google.protobuf.ByteString ... | [
"public",
"static",
"String",
"getMappedTypeDefined",
"(",
"int",
"order",
",",
"FieldType",
"type",
",",
"String",
"express",
",",
"boolean",
"isList",
")",
"{",
"String",
"fieldName",
"=",
"getFieldName",
"(",
"order",
")",
";",
"if",
"(",
"(",
"type",
"... | get mapped type defined java expression.
@param order field order
@param type field type
@param express java expression
@param isList is field type is a {@link List}
@return full java expression | [
"get",
"mapped",
"type",
"defined",
"java",
"expression",
"."
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L93-L123 |
bmelnychuk/AndroidTreeView | library/src/main/java/com/unnamed/b/atv/view/TwoDScrollView.java | TwoDScrollView.onRequestFocusInDescendants | @Override
protected boolean onRequestFocusInDescendants(int direction, Rect previouslyFocusedRect) {
"""
When looking for focus in children of a scroll view, need to be a little
more careful not to give focus to something that is scrolled off screen.
<p/>
This is more expensive than the default {@link andro... | java | @Override
protected boolean onRequestFocusInDescendants(int direction, Rect previouslyFocusedRect) {
// convert from forward / backward notation to up / down / left / right
// (ugh).
if (direction == View.FOCUS_FORWARD) {
direction = View.FOCUS_DOWN;
} else if (direction ... | [
"@",
"Override",
"protected",
"boolean",
"onRequestFocusInDescendants",
"(",
"int",
"direction",
",",
"Rect",
"previouslyFocusedRect",
")",
"{",
"// convert from forward / backward notation to up / down / left / right",
"// (ugh).",
"if",
"(",
"direction",
"==",
"View",
".",
... | When looking for focus in children of a scroll view, need to be a little
more careful not to give focus to something that is scrolled off screen.
<p/>
This is more expensive than the default {@link android.view.ViewGroup}
implementation, otherwise this behavior might have been made the default. | [
"When",
"looking",
"for",
"focus",
"in",
"children",
"of",
"a",
"scroll",
"view",
"need",
"to",
"be",
"a",
"little",
"more",
"careful",
"not",
"to",
"give",
"focus",
"to",
"something",
"that",
"is",
"scrolled",
"off",
"screen",
".",
"<p",
"/",
">",
"Th... | train | https://github.com/bmelnychuk/AndroidTreeView/blob/d051ce75f5c9bd5206481808f6133b51f581c8f1/library/src/main/java/com/unnamed/b/atv/view/TwoDScrollView.java#L951-L971 |
hawkular/hawkular-apm | client/agent-opentracing/src/main/java/org/hawkular/apm/agent/opentracing/OpenTracingManager.java | OpenTracingManager.startSpanWithParent | public void startSpanWithParent(SpanBuilder spanBuilder, Span parent, String id) {
"""
This is a convenience method for situations where we don't know
if a parent span is available. If we try to add a childOf relationship
to a null parent, it would cause a null pointer exception.
The optional id is associated... | java | public void startSpanWithParent(SpanBuilder spanBuilder, Span parent, String id) {
if (parent != null) {
spanBuilder.asChildOf(parent.context());
}
doStartSpan(spanBuilder, id);
} | [
"public",
"void",
"startSpanWithParent",
"(",
"SpanBuilder",
"spanBuilder",
",",
"Span",
"parent",
",",
"String",
"id",
")",
"{",
"if",
"(",
"parent",
"!=",
"null",
")",
"{",
"spanBuilder",
".",
"asChildOf",
"(",
"parent",
".",
"context",
"(",
")",
")",
... | This is a convenience method for situations where we don't know
if a parent span is available. If we try to add a childOf relationship
to a null parent, it would cause a null pointer exception.
The optional id is associated with the started span.
@param spanBuilder The span builder
@param parent The parent span
@para... | [
"This",
"is",
"a",
"convenience",
"method",
"for",
"situations",
"where",
"we",
"don",
"t",
"know",
"if",
"a",
"parent",
"span",
"is",
"available",
".",
"If",
"we",
"try",
"to",
"add",
"a",
"childOf",
"relationship",
"to",
"a",
"null",
"parent",
"it",
... | train | https://github.com/hawkular/hawkular-apm/blob/57a4df0611b359597626563ea5f9ac64d4bb2533/client/agent-opentracing/src/main/java/org/hawkular/apm/agent/opentracing/OpenTracingManager.java#L138-L144 |
OpenHFT/Chronicle-Map | src/main/java/net/openhft/chronicle/hash/impl/util/math/Gamma.java | Gamma.regularizedGammaQ | public static double regularizedGammaQ(final double a,
double x,
double epsilon,
int maxIterations) {
"""
Returns the regularized gamma function Q(a, x) = 1 - P(a, x).
<p>
The implemen... | java | public static double regularizedGammaQ(final double a,
double x,
double epsilon,
int maxIterations) {
double ret;
if (Double.isNaN(a) || Double.isNaN(x) || (a <= 0.0) || (x <... | [
"public",
"static",
"double",
"regularizedGammaQ",
"(",
"final",
"double",
"a",
",",
"double",
"x",
",",
"double",
"epsilon",
",",
"int",
"maxIterations",
")",
"{",
"double",
"ret",
";",
"if",
"(",
"Double",
".",
"isNaN",
"(",
"a",
")",
"||",
"Double",
... | Returns the regularized gamma function Q(a, x) = 1 - P(a, x).
<p>
The implementation of this method is based on:
<ul>
<li>
<a href="http://mathworld.wolfram.com/RegularizedGammaFunction.html">
Regularized Gamma Function</a>, equation (1).
</li>
<li>
<a href="http://functions.wolfram.com/GammaBetaErf/GammaRegularized/10... | [
"Returns",
"the",
"regularized",
"gamma",
"function",
"Q",
"(",
"a",
"x",
")",
"=",
"1",
"-",
"P",
"(",
"a",
"x",
")",
".",
"<p",
">",
"The",
"implementation",
"of",
"this",
"method",
"is",
"based",
"on",
":",
"<ul",
">",
"<li",
">",
"<a",
"href"... | train | https://github.com/OpenHFT/Chronicle-Map/blob/0b09733cc96302f96be4394a261699eeb021fe37/src/main/java/net/openhft/chronicle/hash/impl/util/math/Gamma.java#L418-L452 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/core/QueryReferenceBroker.java | QueryReferenceBroker.getCollectionByQuery | public ManageableCollection getCollectionByQuery(Class collectionClass, Query query, boolean lazy) throws PersistenceBrokerException {
"""
retrieve a collection of type collectionClass matching the Query query
if lazy = true return a CollectionProxy
@param collectionClass
@param query
@param lazy
@return Ma... | java | public ManageableCollection getCollectionByQuery(Class collectionClass, Query query, boolean lazy) throws PersistenceBrokerException
{
ManageableCollection result;
try
{
// BRJ: return empty Collection for null query
if (query == null)
{
... | [
"public",
"ManageableCollection",
"getCollectionByQuery",
"(",
"Class",
"collectionClass",
",",
"Query",
"query",
",",
"boolean",
"lazy",
")",
"throws",
"PersistenceBrokerException",
"{",
"ManageableCollection",
"result",
";",
"try",
"{",
"// BRJ: return empty Collection f... | retrieve a collection of type collectionClass matching the Query query
if lazy = true return a CollectionProxy
@param collectionClass
@param query
@param lazy
@return ManageableCollection
@throws PersistenceBrokerException | [
"retrieve",
"a",
"collection",
"of",
"type",
"collectionClass",
"matching",
"the",
"Query",
"query",
"if",
"lazy",
"=",
"true",
"return",
"a",
"CollectionProxy"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/core/QueryReferenceBroker.java#L244-L279 |
opengeospatial/teamengine | teamengine-spi/src/main/java/com/occamlab/te/spi/util/HtmlReport.java | HtmlReport.earlHtmlReport | public static File earlHtmlReport( String outputDir )
throws FileNotFoundException {
"""
Convert EARL result into HTML report.
@param outputDir
Location of the test result.
@return
Return the output file.
@throws FileNotFoundException
Throws exception if file is not available.
"""
... | java | public static File earlHtmlReport( String outputDir )
throws FileNotFoundException {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
String resourceDir = cl.getResource( "com/occamlab/te/earl/lib" ).getPath();
String earlXsl = cl.getResource( "com/occam... | [
"public",
"static",
"File",
"earlHtmlReport",
"(",
"String",
"outputDir",
")",
"throws",
"FileNotFoundException",
"{",
"ClassLoader",
"cl",
"=",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoader",
"(",
")",
";",
"String",
"resourceDir",
"=",
... | Convert EARL result into HTML report.
@param outputDir
Location of the test result.
@return
Return the output file.
@throws FileNotFoundException
Throws exception if file is not available. | [
"Convert",
"EARL",
"result",
"into",
"HTML",
"report",
"."
] | train | https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-spi/src/main/java/com/occamlab/te/spi/util/HtmlReport.java#L77-L108 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Validator.java | Validator.validateBetween | public static void validateBetween(Number value, Number min, Number max, String errorMsg) throws ValidateException {
"""
检查给定的数字是否在指定范围内
@param value 值
@param min 最小值(包含)
@param max 最大值(包含)
@param errorMsg 验证错误的信息
@throws ValidateException 验证异常
@since 4.1.10
"""
if (false == isBetween(value, min, ma... | java | public static void validateBetween(Number value, Number min, Number max, String errorMsg) throws ValidateException {
if (false == isBetween(value, min, max)) {
throw new ValidateException(errorMsg);
}
} | [
"public",
"static",
"void",
"validateBetween",
"(",
"Number",
"value",
",",
"Number",
"min",
",",
"Number",
"max",
",",
"String",
"errorMsg",
")",
"throws",
"ValidateException",
"{",
"if",
"(",
"false",
"==",
"isBetween",
"(",
"value",
",",
"min",
",",
"ma... | 检查给定的数字是否在指定范围内
@param value 值
@param min 最小值(包含)
@param max 最大值(包含)
@param errorMsg 验证错误的信息
@throws ValidateException 验证异常
@since 4.1.10 | [
"检查给定的数字是否在指定范围内"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L1064-L1068 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobAgentsInner.java | JobAgentsInner.listByServerAsync | public Observable<Page<JobAgentInner>> listByServerAsync(final String resourceGroupName, final String serverName) {
"""
Gets a list of job agents in a server.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the ... | java | public Observable<Page<JobAgentInner>> listByServerAsync(final String resourceGroupName, final String serverName) {
return listByServerWithServiceResponseAsync(resourceGroupName, serverName)
.map(new Func1<ServiceResponse<Page<JobAgentInner>>, Page<JobAgentInner>>() {
@Override
... | [
"public",
"Observable",
"<",
"Page",
"<",
"JobAgentInner",
">",
">",
"listByServerAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"serverName",
")",
"{",
"return",
"listByServerWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"ser... | Gets a list of job agents in a server.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@throws IllegalArgumentException thrown if parameters fail the validation
@re... | [
"Gets",
"a",
"list",
"of",
"job",
"agents",
"in",
"a",
"server",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobAgentsInner.java#L154-L162 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4DatabaseMetaData.java | JDBC4DatabaseMetaData.getColumnPrivileges | @Override
public ResultSet getColumnPrivileges(String catalog, String schema, String table, String columnNamePattern) throws SQLException {
"""
Retrieves a description of the access rights for a table's columns.
"""
checkClosed();
throw SQLError.noSupport();
} | java | @Override
public ResultSet getColumnPrivileges(String catalog, String schema, String table, String columnNamePattern) throws SQLException
{
checkClosed();
throw SQLError.noSupport();
} | [
"@",
"Override",
"public",
"ResultSet",
"getColumnPrivileges",
"(",
"String",
"catalog",
",",
"String",
"schema",
",",
"String",
"table",
",",
"String",
"columnNamePattern",
")",
"throws",
"SQLException",
"{",
"checkClosed",
"(",
")",
";",
"throw",
"SQLError",
"... | Retrieves a description of the access rights for a table's columns. | [
"Retrieves",
"a",
"description",
"of",
"the",
"access",
"rights",
"for",
"a",
"table",
"s",
"columns",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4DatabaseMetaData.java#L188-L193 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/qe/JoinedQueryExecutor.java | JoinedQueryExecutor.mostOrdering | private static <T extends Storable> OrderingList
mostOrdering(StorableProperty<T> primeTarget, OrderingList<T> targetOrdering) {
"""
Given a list of chained ordering properties, returns the properties
stripped of the matching chain prefix for the targetToSourceProperty. As
the target ordering is scanned... | java | private static <T extends Storable> OrderingList
mostOrdering(StorableProperty<T> primeTarget, OrderingList<T> targetOrdering)
{
OrderingList handledOrdering = OrderingList.emptyList();
for (OrderedProperty<T> targetProp : targetOrdering) {
ChainedProperty<T> chainedProp = t... | [
"private",
"static",
"<",
"T",
"extends",
"Storable",
">",
"OrderingList",
"mostOrdering",
"(",
"StorableProperty",
"<",
"T",
">",
"primeTarget",
",",
"OrderingList",
"<",
"T",
">",
"targetOrdering",
")",
"{",
"OrderingList",
"handledOrdering",
"=",
"OrderingList"... | Given a list of chained ordering properties, returns the properties
stripped of the matching chain prefix for the targetToSourceProperty. As
the target ordering is scanned left-to-right, if any property is found
which doesn't match the targetToSourceProperty, the building of the new
list stops. In other words, it retur... | [
"Given",
"a",
"list",
"of",
"chained",
"ordering",
"properties",
"returns",
"the",
"properties",
"stripped",
"of",
"the",
"matching",
"chain",
"prefix",
"for",
"the",
"targetToSourceProperty",
".",
"As",
"the",
"target",
"ordering",
"is",
"scanned",
"left",
"-",... | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/qe/JoinedQueryExecutor.java#L386-L405 |
cloudinary/cloudinary_java | cloudinary-core/src/main/java/com/cloudinary/Api.java | Api.listStreamingProfiles | public ApiResponse listStreamingProfiles(Map options) throws Exception {
"""
List Streaming profiles
@param options additional options
@return a list of all streaming profiles defined for the current cloud
@throws Exception an exception
"""
if (options == null)
options = ObjectUtils.empt... | java | public ApiResponse listStreamingProfiles(Map options) throws Exception {
if (options == null)
options = ObjectUtils.emptyMap();
List<String> uri = Collections.singletonList("streaming_profiles");
return callApi(HttpMethod.GET, uri, ObjectUtils.emptyMap(), options);
} | [
"public",
"ApiResponse",
"listStreamingProfiles",
"(",
"Map",
"options",
")",
"throws",
"Exception",
"{",
"if",
"(",
"options",
"==",
"null",
")",
"options",
"=",
"ObjectUtils",
".",
"emptyMap",
"(",
")",
";",
"List",
"<",
"String",
">",
"uri",
"=",
"Colle... | List Streaming profiles
@param options additional options
@return a list of all streaming profiles defined for the current cloud
@throws Exception an exception | [
"List",
"Streaming",
"profiles"
] | train | https://github.com/cloudinary/cloudinary_java/blob/58ee1823180da2dea6a2eb7e5cf00d5a760f8aef/cloudinary-core/src/main/java/com/cloudinary/Api.java#L402-L408 |
osglworks/java-mvc | src/main/java/org/osgl/mvc/result/ExpectationFailed.java | ExpectationFailed.of | public static ExpectationFailed of(Throwable cause) {
"""
Returns a static ExpectationFailed instance and set the {@link #payload} thread local
with cause specified.
When calling the instance on {@link #getMessage()} method, it will return whatever
stored in the {@link #payload} thread local
@param cause t... | java | public static ExpectationFailed of(Throwable cause) {
if (_localizedErrorMsg()) {
return of(cause, defaultMessage(EXPECTATION_FAILED));
} else {
touchPayload().cause(cause);
return _INSTANCE;
}
} | [
"public",
"static",
"ExpectationFailed",
"of",
"(",
"Throwable",
"cause",
")",
"{",
"if",
"(",
"_localizedErrorMsg",
"(",
")",
")",
"{",
"return",
"of",
"(",
"cause",
",",
"defaultMessage",
"(",
"EXPECTATION_FAILED",
")",
")",
";",
"}",
"else",
"{",
"touch... | Returns a static ExpectationFailed instance and set the {@link #payload} thread local
with cause specified.
When calling the instance on {@link #getMessage()} method, it will return whatever
stored in the {@link #payload} thread local
@param cause the cause
@return a static ExpectationFailed instance as described abo... | [
"Returns",
"a",
"static",
"ExpectationFailed",
"instance",
"and",
"set",
"the",
"{",
"@link",
"#payload",
"}",
"thread",
"local",
"with",
"cause",
"specified",
"."
] | train | https://github.com/osglworks/java-mvc/blob/4d2b2ec40498ac6ee7040c0424377cbeacab124b/src/main/java/org/osgl/mvc/result/ExpectationFailed.java#L106-L113 |
Coveros/selenified | src/main/java/com/coveros/selenified/element/check/wait/WaitForEquals.java | WaitForEquals.selectedOption | public void selectedOption(String expectedText, double seconds) {
"""
Waits for the element's selected option equals the provided expected
option. If the element isn't present or a select, this will constitute a
failure, same as a mismatch.
The provided wait time will be used and if the element doesn't
have th... | java | public void selectedOption(String expectedText, double seconds) {
double end = System.currentTimeMillis() + (seconds * 1000);
try {
elementPresent(seconds);
if (!element.is().select()) {
throw new TimeoutException(ELEMENT_NOT_SELECT);
}
whi... | [
"public",
"void",
"selectedOption",
"(",
"String",
"expectedText",
",",
"double",
"seconds",
")",
"{",
"double",
"end",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"+",
"(",
"seconds",
"*",
"1000",
")",
";",
"try",
"{",
"elementPresent",
"(",
"secon... | Waits for the element's selected option equals the provided expected
option. If the element isn't present or a select, this will constitute a
failure, same as a mismatch.
The provided wait time will be used and if the element doesn't
have the desired match count at that time, it will fail, and log
the issue with a scre... | [
"Waits",
"for",
"the",
"element",
"s",
"selected",
"option",
"equals",
"the",
"provided",
"expected",
"option",
".",
"If",
"the",
"element",
"isn",
"t",
"present",
"or",
"a",
"select",
"this",
"will",
"constitute",
"a",
"failure",
"same",
"as",
"a",
"misma... | train | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/check/wait/WaitForEquals.java#L434-L447 |
katjahahn/PortEx | src/main/java/com/github/katjahahn/tools/Overlay.java | Overlay.getDump | public byte[] getDump() throws IOException {
"""
Loads all bytes of the overlay into an array and returns them.
@return array containing the overlay bytes
@throws IOException
"""
byte[] dump = new byte[(int) getSize()];
try (RandomAccessFile raf = new RandomAccessFile(file, "r")) {
... | java | public byte[] getDump() throws IOException {
byte[] dump = new byte[(int) getSize()];
try (RandomAccessFile raf = new RandomAccessFile(file, "r")) {
raf.seek(offset);
raf.readFully(dump);
}
return dump;
} | [
"public",
"byte",
"[",
"]",
"getDump",
"(",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"dump",
"=",
"new",
"byte",
"[",
"(",
"int",
")",
"getSize",
"(",
")",
"]",
";",
"try",
"(",
"RandomAccessFile",
"raf",
"=",
"new",
"RandomAccessFile",
"... | Loads all bytes of the overlay into an array and returns them.
@return array containing the overlay bytes
@throws IOException | [
"Loads",
"all",
"bytes",
"of",
"the",
"overlay",
"into",
"an",
"array",
"and",
"returns",
"them",
"."
] | train | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/tools/Overlay.java#L170-L177 |
Teddy-Zhu/SilentGo | framework/src/main/java/com/silentgo/core/route/support/paramdispatcher/PathParamDispatch.java | PathParamDispatch.dispatch | @Override
public void dispatch(ParameterResolveFactory parameterResolveFactory, ActionParam param, Route route, Object[] args) {
"""
prepare to resolve path parameters
@param parameterResolveFactory
@param param
@param route
@param args
"""
if (!route.isRegex()) return;
Matcher matcher... | java | @Override
public void dispatch(ParameterResolveFactory parameterResolveFactory, ActionParam param, Route route, Object[] args) {
if (!route.isRegex()) return;
Matcher matcher = route.getMatcher();
String[] pathParameters = new String[matcher.groupCount()];
for (int i = 1, len = matc... | [
"@",
"Override",
"public",
"void",
"dispatch",
"(",
"ParameterResolveFactory",
"parameterResolveFactory",
",",
"ActionParam",
"param",
",",
"Route",
"route",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"if",
"(",
"!",
"route",
".",
"isRegex",
"(",
")",
")",
... | prepare to resolve path parameters
@param parameterResolveFactory
@param param
@param route
@param args | [
"prepare",
"to",
"resolve",
"path",
"parameters"
] | train | https://github.com/Teddy-Zhu/SilentGo/blob/27f58b0cafe56b2eb9fc6993efa9ca2b529661e1/framework/src/main/java/com/silentgo/core/route/support/paramdispatcher/PathParamDispatch.java#L37-L50 |
ironjacamar/ironjacamar | deployers/src/main/java/org/ironjacamar/deployers/common/AbstractResourceAdapterDeployer.java | AbstractResourceAdapterDeployer.createResourceAdapter | protected void
createResourceAdapter(DeploymentBuilder builder,
String raClz,
Collection<org.ironjacamar.common.api.metadata.spec.ConfigProperty> configProperties,
Map<String, String> overrides,
Transac... | java | protected void
createResourceAdapter(DeploymentBuilder builder,
String raClz,
Collection<org.ironjacamar.common.api.metadata.spec.ConfigProperty> configProperties,
Map<String, String> overrides,
Transac... | [
"protected",
"void",
"createResourceAdapter",
"(",
"DeploymentBuilder",
"builder",
",",
"String",
"raClz",
",",
"Collection",
"<",
"org",
".",
"ironjacamar",
".",
"common",
".",
"api",
".",
"metadata",
".",
"spec",
".",
"ConfigProperty",
">",
"configProperties",
... | Create resource adapter instance
@param builder The deployment builder
@param raClz The resource adapter class
@param configProperties The config properties
@param overrides The config properties overrides
@param transactionSupport The transaction support level
@param productName The product name
@param productVersion ... | [
"Create",
"resource",
"adapter",
"instance"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/deployers/src/main/java/org/ironjacamar/deployers/common/AbstractResourceAdapterDeployer.java#L446-L488 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java | Matrix.setMatrix | public void setMatrix(int[] r, int[] c, Matrix X) {
"""
Set a submatrix.
@param r Array of row indices.
@param c Array of column indices.
@param X A(r(:),c(:))
@throws ArrayIndexOutOfBoundsException Submatrix indices
"""
try
{
for (int i = 0; i < r.length; i++)
{
... | java | public void setMatrix(int[] r, int[] c, Matrix X)
{
try
{
for (int i = 0; i < r.length; i++)
{
for (int j = 0; j < c.length; j++)
{
A[r[i]][c[j]] = X.get(i, j);
}
}
}
catch (ArrayI... | [
"public",
"void",
"setMatrix",
"(",
"int",
"[",
"]",
"r",
",",
"int",
"[",
"]",
"c",
",",
"Matrix",
"X",
")",
"{",
"try",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"r",
".",
"length",
";",
"i",
"++",
")",
"{",
"for",
"(",
"int... | Set a submatrix.
@param r Array of row indices.
@param c Array of column indices.
@param X A(r(:),c(:))
@throws ArrayIndexOutOfBoundsException Submatrix indices | [
"Set",
"a",
"submatrix",
"."
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java#L527-L543 |
Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPHandshake.java | RTMPHandshake.getDigestOffset2 | protected int getDigestOffset2(byte[] handshake, int bufferOffset) {
"""
Returns a digest byte offset.
@param handshake handshake sequence
@param bufferOffset buffer offset
@return digest offset
"""
bufferOffset += 772;
int offset = handshake[bufferOffset] & 0xff; // & 0x0ff;
bu... | java | protected int getDigestOffset2(byte[] handshake, int bufferOffset) {
bufferOffset += 772;
int offset = handshake[bufferOffset] & 0xff; // & 0x0ff;
bufferOffset++;
offset += handshake[bufferOffset] & 0xff;
bufferOffset++;
offset += handshake[bufferOffset] & 0xff;
... | [
"protected",
"int",
"getDigestOffset2",
"(",
"byte",
"[",
"]",
"handshake",
",",
"int",
"bufferOffset",
")",
"{",
"bufferOffset",
"+=",
"772",
";",
"int",
"offset",
"=",
"handshake",
"[",
"bufferOffset",
"]",
"&",
"0xff",
";",
"// & 0x0ff;\r",
"bufferOffset",
... | Returns a digest byte offset.
@param handshake handshake sequence
@param bufferOffset buffer offset
@return digest offset | [
"Returns",
"a",
"digest",
"byte",
"offset",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPHandshake.java#L531-L545 |
EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/model/TiffDocument.java | TiffDocument.addTag | public boolean addTag(String tagName, String tagValue) {
"""
Adds the tag.
@param tagName the tag name
@param tagValue the tag value
@return true, if successful
"""
boolean result = false;
if (firstIFD != null) {
if (firstIFD.containsTagId(TiffTags.getTagId(tagName))) {
firstIFD.remo... | java | public boolean addTag(String tagName, String tagValue) {
boolean result = false;
if (firstIFD != null) {
if (firstIFD.containsTagId(TiffTags.getTagId(tagName))) {
firstIFD.removeTag(tagName);
}
firstIFD.addTag(tagName, tagValue);
createMetadataDictionary();
}
return resul... | [
"public",
"boolean",
"addTag",
"(",
"String",
"tagName",
",",
"String",
"tagValue",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"if",
"(",
"firstIFD",
"!=",
"null",
")",
"{",
"if",
"(",
"firstIFD",
".",
"containsTagId",
"(",
"TiffTags",
".",
"getTa... | Adds the tag.
@param tagName the tag name
@param tagValue the tag value
@return true, if successful | [
"Adds",
"the",
"tag",
"."
] | train | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/model/TiffDocument.java#L497-L507 |
meertensinstituut/mtas | src/main/java/mtas/codec/util/CodecInfo.java | CodecInfo.getNextDoc | public IndexDoc getNextDoc(String field, int previousDocId) {
"""
Gets the next doc.
@param field
the field
@param previousDocId
the previous doc id
@return the next doc
"""
if (fieldReferences.containsKey(field)) {
FieldReferences fr = fieldReferences.get(field);
try {
if (previ... | java | public IndexDoc getNextDoc(String field, int previousDocId) {
if (fieldReferences.containsKey(field)) {
FieldReferences fr = fieldReferences.get(field);
try {
if (previousDocId < 0) {
return new IndexDoc(fr.refIndexDoc);
} else {
int nextDocId = previousDocId + 1;
... | [
"public",
"IndexDoc",
"getNextDoc",
"(",
"String",
"field",
",",
"int",
"previousDocId",
")",
"{",
"if",
"(",
"fieldReferences",
".",
"containsKey",
"(",
"field",
")",
")",
"{",
"FieldReferences",
"fr",
"=",
"fieldReferences",
".",
"get",
"(",
"field",
")",
... | Gets the next doc.
@param field
the field
@param previousDocId
the previous doc id
@return the next doc | [
"Gets",
"the",
"next",
"doc",
"."
] | train | https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/codec/util/CodecInfo.java#L593-L616 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Bidi.java | Bidi.addPoint | private void addPoint(int pos, int flag) {
"""
/*
param pos: position where to insert
param flag: one of LRM_BEFORE, LRM_AFTER, RLM_BEFORE, RLM_AFTER
"""
Point point = new Point();
int len = insertPoints.points.length;
if (len == 0) {
insertPoints.points = new Poin... | java | private void addPoint(int pos, int flag)
{
Point point = new Point();
int len = insertPoints.points.length;
if (len == 0) {
insertPoints.points = new Point[FIRSTALLOC];
len = FIRSTALLOC;
}
if (insertPoints.size >= len) { /* no room for new point */
... | [
"private",
"void",
"addPoint",
"(",
"int",
"pos",
",",
"int",
"flag",
")",
"{",
"Point",
"point",
"=",
"new",
"Point",
"(",
")",
";",
"int",
"len",
"=",
"insertPoints",
".",
"points",
".",
"length",
";",
"if",
"(",
"len",
"==",
"0",
")",
"{",
"in... | /*
param pos: position where to insert
param flag: one of LRM_BEFORE, LRM_AFTER, RLM_BEFORE, RLM_AFTER | [
"/",
"*",
"param",
"pos",
":",
"position",
"where",
"to",
"insert",
"param",
"flag",
":",
"one",
"of",
"LRM_BEFORE",
"LRM_AFTER",
"RLM_BEFORE",
"RLM_AFTER"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Bidi.java#L3051-L3069 |
carewebframework/carewebframework-vista | org.carewebframework.vista.api-parent/org.carewebframework.vista.api.esig/src/main/java/org/carewebframework/vista/esig/ESigList.java | ESigList.get | public ESigItem get(IESigType eSigType, String id) {
"""
Returns a sig item identified by type and id, or null if not found.
@param eSigType The esignature type.
@param id The item id.
@return Sig item.
"""
int i = indexOf(eSigType, id);
return i == -1 ? null : items.get(i);
} | java | public ESigItem get(IESigType eSigType, String id) {
int i = indexOf(eSigType, id);
return i == -1 ? null : items.get(i);
} | [
"public",
"ESigItem",
"get",
"(",
"IESigType",
"eSigType",
",",
"String",
"id",
")",
"{",
"int",
"i",
"=",
"indexOf",
"(",
"eSigType",
",",
"id",
")",
";",
"return",
"i",
"==",
"-",
"1",
"?",
"null",
":",
"items",
".",
"get",
"(",
"i",
")",
";",
... | Returns a sig item identified by type and id, or null if not found.
@param eSigType The esignature type.
@param id The item id.
@return Sig item. | [
"Returns",
"a",
"sig",
"item",
"identified",
"by",
"type",
"and",
"id",
"or",
"null",
"if",
"not",
"found",
"."
] | train | https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.api-parent/org.carewebframework.vista.api.esig/src/main/java/org/carewebframework/vista/esig/ESigList.java#L105-L108 |
sebastiangraf/treetank | interfacemodules/jax-rx/src/main/java/org/jaxrx/resource/XMLResource.java | XMLResource.getResource | @GET
public Response getResource(@PathParam(JaxRxConstants.SYSTEM) final String system,
@PathParam(JaxRxConstants.RESOURCE) final String resource, @Context final UriInfo uri,
@Context final HttpHeaders headers) {
"""
This method returns a collection of available resources. An available
resourc... | java | @GET
public Response getResource(@PathParam(JaxRxConstants.SYSTEM) final String system,
@PathParam(JaxRxConstants.RESOURCE) final String resource, @Context final UriInfo uri,
@Context final HttpHeaders headers) {
return getResource(system, uri, resource, headers);
} | [
"@",
"GET",
"public",
"Response",
"getResource",
"(",
"@",
"PathParam",
"(",
"JaxRxConstants",
".",
"SYSTEM",
")",
"final",
"String",
"system",
",",
"@",
"PathParam",
"(",
"JaxRxConstants",
".",
"RESOURCE",
")",
"final",
"String",
"resource",
",",
"@",
"Cont... | This method returns a collection of available resources. An available
resource can be either a particular XML resource or a collection containing
further XML resources.
@param system
The associated system with this request.
@param resource
The name of the requested resource.
@param uri
The context information due to t... | [
"This",
"method",
"returns",
"a",
"collection",
"of",
"available",
"resources",
".",
"An",
"available",
"resource",
"can",
"be",
"either",
"a",
"particular",
"XML",
"resource",
"or",
"a",
"collection",
"containing",
"further",
"XML",
"resources",
"."
] | train | https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/jax-rx/src/main/java/org/jaxrx/resource/XMLResource.java#L77-L83 |
DiUS/pact-jvm | pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslJsonArray.java | PactDslJsonArray.arrayMinMaxLike | public static PactDslJsonBody arrayMinMaxLike(int minSize, int maxSize, int numberExamples) {
"""
Array with a minimum and maximum size where each item must match the following example
@param minSize minimum size
@param maxSize maximum size
@param numberExamples Number of examples to generate
"""
if (nu... | java | public static PactDslJsonBody arrayMinMaxLike(int minSize, int maxSize, int numberExamples) {
if (numberExamples < minSize) {
throw new IllegalArgumentException(String.format("Number of example %d is less than the minimum size of %d",
numberExamples, minSize));
} else if (numberExamples > maxSize)... | [
"public",
"static",
"PactDslJsonBody",
"arrayMinMaxLike",
"(",
"int",
"minSize",
",",
"int",
"maxSize",
",",
"int",
"numberExamples",
")",
"{",
"if",
"(",
"numberExamples",
"<",
"minSize",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",... | Array with a minimum and maximum size where each item must match the following example
@param minSize minimum size
@param maxSize maximum size
@param numberExamples Number of examples to generate | [
"Array",
"with",
"a",
"minimum",
"and",
"maximum",
"size",
"where",
"each",
"item",
"must",
"match",
"the",
"following",
"example"
] | train | https://github.com/DiUS/pact-jvm/blob/2f447e9dd4ac152a6a36b7fcf8962d07de9ef3ef/pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslJsonArray.java#L878-L890 |
liferay/com-liferay-commerce | commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationTemplateUserSegmentRelPersistenceImpl.java | CommerceNotificationTemplateUserSegmentRelPersistenceImpl.findAll | @Override
public List<CommerceNotificationTemplateUserSegmentRel> findAll(int start,
int end) {
"""
Returns a range of all the commerce notification template user segment rels.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code... | java | @Override
public List<CommerceNotificationTemplateUserSegmentRel> findAll(int start,
int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceNotificationTemplateUserSegmentRel",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce notification template user segment rels.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in ... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"notification",
"template",
"user",
"segment",
"rels",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationTemplateUserSegmentRelPersistenceImpl.java#L2060-L2064 |
fernandospr/java-wns | src/main/java/ar/com/fernandospr/wns/WnsService.java | WnsService.pushToast | public WnsNotificationResponse pushToast(String channelUri, WnsToast toast) throws WnsException {
"""
Pushes a toast to channelUri
@param channelUri
@param toast which should be built with {@link ar.com.fernandospr.wns.model.builders.WnsToastBuilder}
@return WnsNotificationResponse please see response headers f... | java | public WnsNotificationResponse pushToast(String channelUri, WnsToast toast) throws WnsException {
return this.pushToast(channelUri, null, toast);
} | [
"public",
"WnsNotificationResponse",
"pushToast",
"(",
"String",
"channelUri",
",",
"WnsToast",
"toast",
")",
"throws",
"WnsException",
"{",
"return",
"this",
".",
"pushToast",
"(",
"channelUri",
",",
"null",
",",
"toast",
")",
";",
"}"
] | Pushes a toast to channelUri
@param channelUri
@param toast which should be built with {@link ar.com.fernandospr.wns.model.builders.WnsToastBuilder}
@return WnsNotificationResponse please see response headers from <a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh465435.aspx#send_notification_response">ht... | [
"Pushes",
"a",
"toast",
"to",
"channelUri"
] | train | https://github.com/fernandospr/java-wns/blob/cd621b9c17d1e706f6284e0913531d834904a90d/src/main/java/ar/com/fernandospr/wns/WnsService.java#L122-L124 |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/util/rhino/NodeUtil.java | NodeUtil.moduleDepsFromConfigDeps | public static Node moduleDepsFromConfigDeps(Node cursor, String configVarName) {
"""
If the specified node is for a property named 'deps' and the property is
a member of the object identified by <code>configVarName</code>, and the
'deps' property is being assigned an array literal, then return the node
for the ... | java | public static Node moduleDepsFromConfigDeps(Node cursor, String configVarName) {
if (cursor.getType() == Token.STRING && cursor.getString().equals("deps")) { //$NON-NLS-1$
// handle require.deps assignment of array literal
Node parent = cursor.getParent(),
previousSibling = parent.getChildBefore(cursor... | [
"public",
"static",
"Node",
"moduleDepsFromConfigDeps",
"(",
"Node",
"cursor",
",",
"String",
"configVarName",
")",
"{",
"if",
"(",
"cursor",
".",
"getType",
"(",
")",
"==",
"Token",
".",
"STRING",
"&&",
"cursor",
".",
"getString",
"(",
")",
".",
"equals",... | If the specified node is for a property named 'deps' and the property is
a member of the object identified by <code>configVarName</code>, and the
'deps' property is being assigned an array literal, then return the node
for the array literal, else return null.
<p>
For example, if <code>configVarName</code> is <code>requ... | [
"If",
"the",
"specified",
"node",
"is",
"for",
"a",
"property",
"named",
"deps",
"and",
"the",
"property",
"is",
"a",
"member",
"of",
"the",
"object",
"identified",
"by",
"<code",
">",
"configVarName<",
"/",
"code",
">",
"and",
"the",
"deps",
"property",
... | train | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/util/rhino/NodeUtil.java#L145-L190 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/filter/Filter.java | Filter.orExists | public final Filter<S> orExists(String propertyName, Filter<?> subFilter) {
"""
Returns a combined filter instance that accepts records which are
accepted either by this filter or the "exists" test applied to a join.
@param propertyName one-to-many join property name, which may be a chained property
@param su... | java | public final Filter<S> orExists(String propertyName, Filter<?> subFilter) {
ChainedProperty<S> prop = new FilterParser<S>(mType, propertyName).parseChainedProperty();
return or(ExistsFilter.build(prop, subFilter, false));
} | [
"public",
"final",
"Filter",
"<",
"S",
">",
"orExists",
"(",
"String",
"propertyName",
",",
"Filter",
"<",
"?",
">",
"subFilter",
")",
"{",
"ChainedProperty",
"<",
"S",
">",
"prop",
"=",
"new",
"FilterParser",
"<",
"S",
">",
"(",
"mType",
",",
"propert... | Returns a combined filter instance that accepts records which are
accepted either by this filter or the "exists" test applied to a join.
@param propertyName one-to-many join property name, which may be a chained property
@param subFilter sub-filter to apply to join, which may be null to test
for any existing
@return c... | [
"Returns",
"a",
"combined",
"filter",
"instance",
"that",
"accepts",
"records",
"which",
"are",
"accepted",
"either",
"by",
"this",
"filter",
"or",
"the",
"exists",
"test",
"applied",
"to",
"a",
"join",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/filter/Filter.java#L394-L397 |
jbundle/jbundle | base/remote/src/main/java/org/jbundle/base/remote/lock/LockSession.java | LockSession.unlockThisRecord | public boolean unlockThisRecord(String strDatabaseName, String strRecordName, Object bookmark, SessionInfo sessionInfo)
throws DBException, RemoteException {
"""
Unlock this bookmark in this record for this session.
@param strRecordName The record to unlock in.
@param bookmark The bookmark to unlock ... | java | public boolean unlockThisRecord(String strDatabaseName, String strRecordName, Object bookmark, SessionInfo sessionInfo)
throws DBException, RemoteException
{
sessionInfo.m_iRemoteSessionID = this.getSessionID();
LockTable lockTable = this.getLockTable(strDatabaseName, strRecordName);
... | [
"public",
"boolean",
"unlockThisRecord",
"(",
"String",
"strDatabaseName",
",",
"String",
"strRecordName",
",",
"Object",
"bookmark",
",",
"SessionInfo",
"sessionInfo",
")",
"throws",
"DBException",
",",
"RemoteException",
"{",
"sessionInfo",
".",
"m_iRemoteSessionID",
... | Unlock this bookmark in this record for this session.
@param strRecordName The record to unlock in.
@param bookmark The bookmark to unlock (or null to unlock all for this session).
@param objSession The session that wants to unlock.
@param iLockType The type of lock (wait or error lock).
@return True if successful. | [
"Unlock",
"this",
"bookmark",
"in",
"this",
"record",
"for",
"this",
"session",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/lock/LockSession.java#L145-L154 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/utils/FileUtils.java | FileUtils.createUniqueFile | public static File createUniqueFile(File directory, String filename) throws IOException {
"""
Creates a File that is unique in the specified directory. If the specified
filename exists in the directory, "-#" will be appended to the filename until
a unique filename can be created.
@param directory the director... | java | public static File createUniqueFile(File directory, String filename) throws IOException {
File uniqueFile = new File(directory, filename);
if (uniqueFile.createNewFile()) {
return (uniqueFile);
}
String extension = "";
int dotIndex = filename.lastIndexOf('.'... | [
"public",
"static",
"File",
"createUniqueFile",
"(",
"File",
"directory",
",",
"String",
"filename",
")",
"throws",
"IOException",
"{",
"File",
"uniqueFile",
"=",
"new",
"File",
"(",
"directory",
",",
"filename",
")",
";",
"if",
"(",
"uniqueFile",
".",
"crea... | Creates a File that is unique in the specified directory. If the specified
filename exists in the directory, "-#" will be appended to the filename until
a unique filename can be created.
@param directory the directory to create the file in
@param filename the base filename with extension
@return a File that is unique ... | [
"Creates",
"a",
"File",
"that",
"is",
"unique",
"in",
"the",
"specified",
"directory",
".",
"If",
"the",
"specified",
"filename",
"exists",
"in",
"the",
"directory",
"-",
"#",
"will",
"be",
"appended",
"to",
"the",
"filename",
"until",
"a",
"unique",
"file... | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/utils/FileUtils.java#L24-L46 |
alkacon/opencms-core | src/org/opencms/ui/apps/user/CmsShowResourceTable.java | CmsShowResourceTable.openExplorerForParent | void openExplorerForParent(String rootPath, String uuid) {
"""
Opens the explorer for given path and selected resource.<p>
@param rootPath to be opened
@param uuid to be selected
"""
String parentPath = CmsResource.getParentFolder(rootPath);
if (!rootPath.startsWith(m_cms.getRequestContex... | java | void openExplorerForParent(String rootPath, String uuid) {
String parentPath = CmsResource.getParentFolder(rootPath);
if (!rootPath.startsWith(m_cms.getRequestContext().getSiteRoot())) {
m_cms.getRequestContext().setSiteRoot("");
}
CmsAppWorkplaceUi.get().getNavigator().na... | [
"void",
"openExplorerForParent",
"(",
"String",
"rootPath",
",",
"String",
"uuid",
")",
"{",
"String",
"parentPath",
"=",
"CmsResource",
".",
"getParentFolder",
"(",
"rootPath",
")",
";",
"if",
"(",
"!",
"rootPath",
".",
"startsWith",
"(",
"m_cms",
".",
"get... | Opens the explorer for given path and selected resource.<p>
@param rootPath to be opened
@param uuid to be selected | [
"Opens",
"the",
"explorer",
"for",
"given",
"path",
"and",
"selected",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/user/CmsShowResourceTable.java#L244-L263 |
JodaOrg/joda-time | src/main/java/org/joda/time/Duration.java | Duration.standardDays | public static Duration standardDays(long days) {
"""
Create a duration with the specified number of days assuming that
there are the standard number of milliseconds in a day.
<p>
This method assumes that there are 24 hours in a day,
60 minutes in an hour, 60 seconds in a minute and 1000 milliseconds in
a seco... | java | public static Duration standardDays(long days) {
if (days == 0) {
return ZERO;
}
return new Duration(FieldUtils.safeMultiply(days, DateTimeConstants.MILLIS_PER_DAY));
} | [
"public",
"static",
"Duration",
"standardDays",
"(",
"long",
"days",
")",
"{",
"if",
"(",
"days",
"==",
"0",
")",
"{",
"return",
"ZERO",
";",
"}",
"return",
"new",
"Duration",
"(",
"FieldUtils",
".",
"safeMultiply",
"(",
"days",
",",
"DateTimeConstants",
... | Create a duration with the specified number of days assuming that
there are the standard number of milliseconds in a day.
<p>
This method assumes that there are 24 hours in a day,
60 minutes in an hour, 60 seconds in a minute and 1000 milliseconds in
a second. This will be true for most days, however days with Daylight... | [
"Create",
"a",
"duration",
"with",
"the",
"specified",
"number",
"of",
"days",
"assuming",
"that",
"there",
"are",
"the",
"standard",
"number",
"of",
"milliseconds",
"in",
"a",
"day",
".",
"<p",
">",
"This",
"method",
"assumes",
"that",
"there",
"are",
"24... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Duration.java#L82-L87 |
alkacon/opencms-core | src/org/opencms/db/generic/CmsVfsDriver.java | CmsVfsDriver.internalReadRelation | protected CmsRelation internalReadRelation(ResultSet res) throws SQLException {
"""
Creates a new {@link CmsRelation} object from the given result set entry.<p>
@param res the result set
@return the new {@link CmsRelation} object
@throws SQLException if something goes wrong
"""
CmsUUID source... | java | protected CmsRelation internalReadRelation(ResultSet res) throws SQLException {
CmsUUID sourceId = new CmsUUID(res.getString(m_sqlManager.readQuery("C_RELATION_SOURCE_ID")));
String sourcePath = res.getString(m_sqlManager.readQuery("C_RELATION_SOURCE_PATH"));
CmsUUID targetId = new CmsUUID(res.... | [
"protected",
"CmsRelation",
"internalReadRelation",
"(",
"ResultSet",
"res",
")",
"throws",
"SQLException",
"{",
"CmsUUID",
"sourceId",
"=",
"new",
"CmsUUID",
"(",
"res",
".",
"getString",
"(",
"m_sqlManager",
".",
"readQuery",
"(",
"\"C_RELATION_SOURCE_ID\"",
")",
... | Creates a new {@link CmsRelation} object from the given result set entry.<p>
@param res the result set
@return the new {@link CmsRelation} object
@throws SQLException if something goes wrong | [
"Creates",
"a",
"new",
"{",
"@link",
"CmsRelation",
"}",
"object",
"from",
"the",
"given",
"result",
"set",
"entry",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/generic/CmsVfsDriver.java#L3888-L3896 |
khennig/lazy-datacontroller | lazy-datacontroller-pfadapter/src/main/java/com/tri/ui/model/adapter/PrimeFacesLazyAdapter.java | PrimeFacesLazyAdapter.handleFilters | boolean handleFilters(Map<String, Object> filters) {
"""
Clears previously passed filters, sets new filters on adaptee.
@param filters
@return true if filters have changed to last call
"""
Validate.notNull(filters, "Filters required");
boolean changed = false;
// clear non active filters and remove ... | java | boolean handleFilters(Map<String, Object> filters) {
Validate.notNull(filters, "Filters required");
boolean changed = false;
// clear non active filters and remove them from lastFilters
for (Object filterKey : CollectionUtils.subtract(lastFilters.keySet(),
filters.keySet())) {
BeanProperty.clearBeanProp... | [
"boolean",
"handleFilters",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"filters",
")",
"{",
"Validate",
".",
"notNull",
"(",
"filters",
",",
"\"Filters required\"",
")",
";",
"boolean",
"changed",
"=",
"false",
";",
"// clear non active filters and remove them... | Clears previously passed filters, sets new filters on adaptee.
@param filters
@return true if filters have changed to last call | [
"Clears",
"previously",
"passed",
"filters",
"sets",
"new",
"filters",
"on",
"adaptee",
"."
] | train | https://github.com/khennig/lazy-datacontroller/blob/a72a5fc6ced43d0e06fc839d68bd58cede10ab56/lazy-datacontroller-pfadapter/src/main/java/com/tri/ui/model/adapter/PrimeFacesLazyAdapter.java#L183-L208 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/CharsetIssues.java | CharsetIssues.replaceNthArgWithCharsetString | private static String replaceNthArgWithCharsetString(String sig, int stackOffset) {
"""
rebuilds a signature replacing a String argument at a specified spot, with a Charset parameter.
@param sig
the signature to replace
@param stackOffset
the offset of the parameter to replace
@return a new signature with... | java | private static String replaceNthArgWithCharsetString(String sig, int stackOffset) {
List<String> arguments = SignatureUtils.getParameterSignatures(sig);
StringBuilder sb = new StringBuilder("(");
int argumentIndexToReplace = (arguments.size() - stackOffset) - 1;
for (int i = 0; i < ar... | [
"private",
"static",
"String",
"replaceNthArgWithCharsetString",
"(",
"String",
"sig",
",",
"int",
"stackOffset",
")",
"{",
"List",
"<",
"String",
">",
"arguments",
"=",
"SignatureUtils",
".",
"getParameterSignatures",
"(",
"sig",
")",
";",
"StringBuilder",
"sb",
... | rebuilds a signature replacing a String argument at a specified spot, with a Charset parameter.
@param sig
the signature to replace
@param stackOffset
the offset of the parameter to replace
@return a new signature with a Charset parameter | [
"rebuilds",
"a",
"signature",
"replacing",
"a",
"String",
"argument",
"at",
"a",
"specified",
"spot",
"with",
"a",
"Charset",
"parameter",
"."
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/CharsetIssues.java#L291-L308 |
ben-manes/caffeine | simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/policy/sketch/segment/LruWindowTinyLfuPolicy.java | LruWindowTinyLfuPolicy.policies | public static Set<Policy> policies(Config config) {
"""
Returns all variations of this policy based on the configuration parameters.
"""
LruWindowTinyLfuSettings settings = new LruWindowTinyLfuSettings(config);
return settings.percentMain().stream()
.map(percentMain -> new LruWindowTinyLfuPolic... | java | public static Set<Policy> policies(Config config) {
LruWindowTinyLfuSettings settings = new LruWindowTinyLfuSettings(config);
return settings.percentMain().stream()
.map(percentMain -> new LruWindowTinyLfuPolicy(percentMain, settings))
.collect(toSet());
} | [
"public",
"static",
"Set",
"<",
"Policy",
">",
"policies",
"(",
"Config",
"config",
")",
"{",
"LruWindowTinyLfuSettings",
"settings",
"=",
"new",
"LruWindowTinyLfuSettings",
"(",
"config",
")",
";",
"return",
"settings",
".",
"percentMain",
"(",
")",
".",
"str... | Returns all variations of this policy based on the configuration parameters. | [
"Returns",
"all",
"variations",
"of",
"this",
"policy",
"based",
"on",
"the",
"configuration",
"parameters",
"."
] | train | https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/policy/sketch/segment/LruWindowTinyLfuPolicy.java#L66-L71 |
line/armeria | core/src/main/java/com/linecorp/armeria/client/circuitbreaker/CircuitBreakerRpcClient.java | CircuitBreakerRpcClient.newDecorator | public static Function<Client<RpcRequest, RpcResponse>, CircuitBreakerRpcClient>
newDecorator(CircuitBreaker circuitBreaker, CircuitBreakerStrategyWithContent<RpcResponse> strategy) {
"""
Creates a new decorator using the specified {@link CircuitBreaker} instance and
{@link CircuitBreakerStrategy}.
<p>Sinc... | java | public static Function<Client<RpcRequest, RpcResponse>, CircuitBreakerRpcClient>
newDecorator(CircuitBreaker circuitBreaker, CircuitBreakerStrategyWithContent<RpcResponse> strategy) {
return newDecorator((ctx, req) -> circuitBreaker, strategy);
} | [
"public",
"static",
"Function",
"<",
"Client",
"<",
"RpcRequest",
",",
"RpcResponse",
">",
",",
"CircuitBreakerRpcClient",
">",
"newDecorator",
"(",
"CircuitBreaker",
"circuitBreaker",
",",
"CircuitBreakerStrategyWithContent",
"<",
"RpcResponse",
">",
"strategy",
")",
... | Creates a new decorator using the specified {@link CircuitBreaker} instance and
{@link CircuitBreakerStrategy}.
<p>Since {@link CircuitBreaker} is a unit of failure detection, don't reuse the same instance for
unrelated services.
@param circuitBreaker The {@link CircuitBreaker} instance to be used | [
"Creates",
"a",
"new",
"decorator",
"using",
"the",
"specified",
"{",
"@link",
"CircuitBreaker",
"}",
"instance",
"and",
"{",
"@link",
"CircuitBreakerStrategy",
"}",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/client/circuitbreaker/CircuitBreakerRpcClient.java#L42-L45 |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/style/StyleUtil.java | StyleUtil.cloneCellStyle | public static CellStyle cloneCellStyle(Workbook workbook, CellStyle cellStyle) {
"""
克隆新的{@link CellStyle}
@param workbook 工作簿
@param cellStyle 被复制的样式
@return {@link CellStyle}
"""
final CellStyle newCellStyle = workbook.createCellStyle();
newCellStyle.cloneStyleFrom(cellStyle);
return newCellSty... | java | public static CellStyle cloneCellStyle(Workbook workbook, CellStyle cellStyle) {
final CellStyle newCellStyle = workbook.createCellStyle();
newCellStyle.cloneStyleFrom(cellStyle);
return newCellStyle;
} | [
"public",
"static",
"CellStyle",
"cloneCellStyle",
"(",
"Workbook",
"workbook",
",",
"CellStyle",
"cellStyle",
")",
"{",
"final",
"CellStyle",
"newCellStyle",
"=",
"workbook",
".",
"createCellStyle",
"(",
")",
";",
"newCellStyle",
".",
"cloneStyleFrom",
"(",
"cell... | 克隆新的{@link CellStyle}
@param workbook 工作簿
@param cellStyle 被复制的样式
@return {@link CellStyle} | [
"克隆新的",
"{",
"@link",
"CellStyle",
"}"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/style/StyleUtil.java#L41-L45 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java | CoverageUtilities.coverageValuesMapper | public static GridCoverage2D coverageValuesMapper( GridCoverage2D valuesMap, GridCoverage2D maskMap ) {
"""
Mappes the values of a map (valuesMap) into the valid pixels of the second map (maskMap).
@param valuesMap the map holding the values that are needed in the resulting map.
@param maskMap the map to use a... | java | public static GridCoverage2D coverageValuesMapper( GridCoverage2D valuesMap, GridCoverage2D maskMap ) {
RegionMap valuesRegionMap = getRegionParamsFromGridCoverage(valuesMap);
int cs = valuesRegionMap.getCols();
int rs = valuesRegionMap.getRows();
RegionMap maskRegionMap = getRegionParam... | [
"public",
"static",
"GridCoverage2D",
"coverageValuesMapper",
"(",
"GridCoverage2D",
"valuesMap",
",",
"GridCoverage2D",
"maskMap",
")",
"{",
"RegionMap",
"valuesRegionMap",
"=",
"getRegionParamsFromGridCoverage",
"(",
"valuesMap",
")",
";",
"int",
"cs",
"=",
"valuesReg... | Mappes the values of a map (valuesMap) into the valid pixels of the second map (maskMap).
@param valuesMap the map holding the values that are needed in the resulting map.
@param maskMap the map to use as mask for the values.
@return the map containing the values of the valuesMap, but only in the places in which the m... | [
"Mappes",
"the",
"values",
"of",
"a",
"map",
"(",
"valuesMap",
")",
"into",
"the",
"valid",
"pixels",
"of",
"the",
"second",
"map",
"(",
"maskMap",
")",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java#L1366-L1397 |
jblas-project/jblas | src/main/java/org/jblas/Eigen.java | Eigen.symmetricGeneralizedEigenvectors | public static DoubleMatrix[] symmetricGeneralizedEigenvectors(DoubleMatrix A, DoubleMatrix B, double vl, double vu) {
"""
Computes selected eigenvalues and their corresponding eigenvectors of the real generalized symmetric-definite
eigenproblem of the form A x = L B x or, equivalently, (A - L B)x = 0. Here A and ... | java | public static DoubleMatrix[] symmetricGeneralizedEigenvectors(DoubleMatrix A, DoubleMatrix B, double vl, double vu) {
A.assertSquare();
B.assertSquare();
A.assertSameSize(B);
if (vu <= vl) {
throw new IllegalArgumentException("Bound exception: make sure vu > vl");
}
double abstol = (double... | [
"public",
"static",
"DoubleMatrix",
"[",
"]",
"symmetricGeneralizedEigenvectors",
"(",
"DoubleMatrix",
"A",
",",
"DoubleMatrix",
"B",
",",
"double",
"vl",
",",
"double",
"vu",
")",
"{",
"A",
".",
"assertSquare",
"(",
")",
";",
"B",
".",
"assertSquare",
"(",
... | Computes selected eigenvalues and their corresponding eigenvectors of the real generalized symmetric-definite
eigenproblem of the form A x = L B x or, equivalently, (A - L B)x = 0. Here A and B are assumed to be symmetric
and B is also positive definite. The selection is based on the given range of values for the desir... | [
"Computes",
"selected",
"eigenvalues",
"and",
"their",
"corresponding",
"eigenvectors",
"of",
"the",
"real",
"generalized",
"symmetric",
"-",
"definite",
"eigenproblem",
"of",
"the",
"form",
"A",
"x",
"=",
"L",
"B",
"x",
"or",
"equivalently",
"(",
"A",
"-",
... | train | https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/Eigen.java#L245-L265 |
aws/aws-sdk-java | aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/SerDeInfo.java | SerDeInfo.withParameters | public SerDeInfo withParameters(java.util.Map<String, String> parameters) {
"""
<p>
These key-value pairs define initialization parameters for the SerDe.
</p>
@param parameters
These key-value pairs define initialization parameters for the SerDe.
@return Returns a reference to this object so that method cal... | java | public SerDeInfo withParameters(java.util.Map<String, String> parameters) {
setParameters(parameters);
return this;
} | [
"public",
"SerDeInfo",
"withParameters",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"{",
"setParameters",
"(",
"parameters",
")",
";",
"return",
"this",
";",
"}"
] | <p>
These key-value pairs define initialization parameters for the SerDe.
</p>
@param parameters
These key-value pairs define initialization parameters for the SerDe.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"These",
"key",
"-",
"value",
"pairs",
"define",
"initialization",
"parameters",
"for",
"the",
"SerDe",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/SerDeInfo.java#L172-L175 |
epam/parso | src/main/java/com/epam/parso/impl/AbstractCSVWriter.java | AbstractCSVWriter.checkSurroundByQuotes | static String checkSurroundByQuotes(String delimiter, String trimmedText) throws IOException {
"""
The method to output a text represented by an array of bytes.
If the text contains the delimiter, line breaks, tabulation characters, and double quotes, the text is stropped.
@param delimiter if trimmedText con... | java | static String checkSurroundByQuotes(String delimiter, String trimmedText) throws IOException {
boolean containsDelimiter = stringContainsItemFromList(trimmedText, delimiter, "\n", "\t", "\r", "\"");
String trimmedTextWithoutQuotesDuplicates = trimmedText.replace("\"", "\"\"");
if (containsDelimi... | [
"static",
"String",
"checkSurroundByQuotes",
"(",
"String",
"delimiter",
",",
"String",
"trimmedText",
")",
"throws",
"IOException",
"{",
"boolean",
"containsDelimiter",
"=",
"stringContainsItemFromList",
"(",
"trimmedText",
",",
"delimiter",
",",
"\"\\n\"",
",",
"\"\... | The method to output a text represented by an array of bytes.
If the text contains the delimiter, line breaks, tabulation characters, and double quotes, the text is stropped.
@param delimiter if trimmedText contains this delimiter it will be stropped.
@param trimmedText the array of bytes that contains the text to o... | [
"The",
"method",
"to",
"output",
"a",
"text",
"represented",
"by",
"an",
"array",
"of",
"bytes",
".",
"If",
"the",
"text",
"contains",
"the",
"delimiter",
"line",
"breaks",
"tabulation",
"characters",
"and",
"double",
"quotes",
"the",
"text",
"is",
"stropped... | train | https://github.com/epam/parso/blob/fb132cf943ba099a35b2f5a1490c0a59641e09dc/src/main/java/com/epam/parso/impl/AbstractCSVWriter.java#L133-L140 |
albfernandez/javadbf | src/main/java/com/linuxense/javadbf/DBFField.java | DBFField.createField | protected static DBFField createField(DataInput in, Charset charset, boolean useFieldFlags) throws IOException {
"""
Creates a DBFField object from the data read from the given
DataInputStream.
The data in the DataInputStream object is supposed to be organised
correctly and the stream "pointer" is supposed to... | java | protected static DBFField createField(DataInput in, Charset charset, boolean useFieldFlags) throws IOException {
DBFField field = new DBFField();
byte t_byte = in.readByte(); /* 0 */
if (t_byte == (byte) 0x0d) {
return null;
}
byte[] fieldName = new byte[11];
in.readFully(fieldName, 1, 10); /* 1-10 */
... | [
"protected",
"static",
"DBFField",
"createField",
"(",
"DataInput",
"in",
",",
"Charset",
"charset",
",",
"boolean",
"useFieldFlags",
")",
"throws",
"IOException",
"{",
"DBFField",
"field",
"=",
"new",
"DBFField",
"(",
")",
";",
"byte",
"t_byte",
"=",
"in",
... | Creates a DBFField object from the data read from the given
DataInputStream.
The data in the DataInputStream object is supposed to be organised
correctly and the stream "pointer" is supposed to be positioned properly.
@param in DataInputStream
@param charset charset to use
@param useFieldFlags If the file can store f... | [
"Creates",
"a",
"DBFField",
"object",
"from",
"the",
"data",
"read",
"from",
"the",
"given",
"DataInputStream",
"."
] | train | https://github.com/albfernandez/javadbf/blob/ac9867b46786cb055bce9323e2cf074365207693/src/main/java/com/linuxense/javadbf/DBFField.java#L173-L213 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bcc/BccClient.java | BccClient.listZones | public ListZonesResponse listZones(AbstractBceRequest request) {
"""
listing zones within current region
@param request use withRequestCredentials
@return The response with list of zones
"""
InternalRequest internalRequest = this.createRequest(request, HttpMethodName.GET, ZONE);
return invoke... | java | public ListZonesResponse listZones(AbstractBceRequest request) {
InternalRequest internalRequest = this.createRequest(request, HttpMethodName.GET, ZONE);
return invokeHttpClient(internalRequest, ListZonesResponse.class);
} | [
"public",
"ListZonesResponse",
"listZones",
"(",
"AbstractBceRequest",
"request",
")",
"{",
"InternalRequest",
"internalRequest",
"=",
"this",
".",
"createRequest",
"(",
"request",
",",
"HttpMethodName",
".",
"GET",
",",
"ZONE",
")",
";",
"return",
"invokeHttpClient... | listing zones within current region
@param request use withRequestCredentials
@return The response with list of zones | [
"listing",
"zones",
"within",
"current",
"region"
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bcc/BccClient.java#L1621-L1624 |
UrielCh/ovh-java-sdk | ovh-java-sdk-allDom/src/main/java/net/minidev/ovh/api/ApiOvhAllDom.java | ApiOvhAllDom.serviceName_domain_domain_GET | public OvhAllDomDomain serviceName_domain_domain_GET(String serviceName, String domain) throws IOException {
"""
Get this object properties
REST: GET /allDom/{serviceName}/domain/{domain}
@param serviceName [required] The internal name of your allDom
@param domain [required] Domain name
"""
String qPath... | java | public OvhAllDomDomain serviceName_domain_domain_GET(String serviceName, String domain) throws IOException {
String qPath = "/allDom/{serviceName}/domain/{domain}";
StringBuilder sb = path(qPath, serviceName, domain);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhAllDomDomain.... | [
"public",
"OvhAllDomDomain",
"serviceName_domain_domain_GET",
"(",
"String",
"serviceName",
",",
"String",
"domain",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/allDom/{serviceName}/domain/{domain}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qP... | Get this object properties
REST: GET /allDom/{serviceName}/domain/{domain}
@param serviceName [required] The internal name of your allDom
@param domain [required] Domain name | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-allDom/src/main/java/net/minidev/ovh/api/ApiOvhAllDom.java#L71-L76 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/ScrollBarButtonPainter.java | ScrollBarButtonPainter.paintBackgroundApart | private void paintBackgroundApart(Graphics2D g, int width, int height) {
"""
DOCUMENT ME!
@param g DOCUMENT ME!
@param width DOCUMENT ME!
@param height DOCUMENT ME!
"""
Shape s = shapeGenerator.createScrollButtonApart(0, 0, width, height);
dropShadow.fill(g, s);
fillScrollBa... | java | private void paintBackgroundApart(Graphics2D g, int width, int height) {
Shape s = shapeGenerator.createScrollButtonApart(0, 0, width, height);
dropShadow.fill(g, s);
fillScrollBarButtonInteriorColors(g, s, isIncrease, buttonsTogether);
} | [
"private",
"void",
"paintBackgroundApart",
"(",
"Graphics2D",
"g",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"Shape",
"s",
"=",
"shapeGenerator",
".",
"createScrollButtonApart",
"(",
"0",
",",
"0",
",",
"width",
",",
"height",
")",
";",
"dropSha... | DOCUMENT ME!
@param g DOCUMENT ME!
@param width DOCUMENT ME!
@param height DOCUMENT ME! | [
"DOCUMENT",
"ME!"
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/ScrollBarButtonPainter.java#L255-L260 |
sshtools/j2ssh-maverick | j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpFileAttributes.java | SftpFileAttributes.setTimes | public void setTimes(UnsignedInteger64 atime, UnsignedInteger64 mtime) {
"""
Set the last access and last modified times. These times are represented
by integers containing the number of seconds from Jan 1, 1970 UTC. NOTE:
You should divide any value returned from Java's
System.currentTimeMillis() method by 100... | java | public void setTimes(UnsignedInteger64 atime, UnsignedInteger64 mtime) {
this.atime = atime;
this.mtime = mtime;
// Set the flag
if (atime != null) {
flags |= SSH_FILEXFER_ATTR_ACCESSTIME;
} else {
flags ^= SSH_FILEXFER_ATTR_ACCESSTIME;
}
} | [
"public",
"void",
"setTimes",
"(",
"UnsignedInteger64",
"atime",
",",
"UnsignedInteger64",
"mtime",
")",
"{",
"this",
".",
"atime",
"=",
"atime",
";",
"this",
".",
"mtime",
"=",
"mtime",
";",
"// Set the flag",
"if",
"(",
"atime",
"!=",
"null",
")",
"{",
... | Set the last access and last modified times. These times are represented
by integers containing the number of seconds from Jan 1, 1970 UTC. NOTE:
You should divide any value returned from Java's
System.currentTimeMillis() method by 1000 to set the correct times as
this returns the time in milliseconds from Jan 1, 1970 ... | [
"Set",
"the",
"last",
"access",
"and",
"last",
"modified",
"times",
".",
"These",
"times",
"are",
"represented",
"by",
"integers",
"containing",
"the",
"number",
"of",
"seconds",
"from",
"Jan",
"1",
"1970",
"UTC",
".",
"NOTE",
":",
"You",
"should",
"divide... | train | https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpFileAttributes.java#L556-L566 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachinesInner.java | VirtualMachinesInner.runCommand | public RunCommandResultInner runCommand(String resourceGroupName, String vmName, RunCommandInput parameters) {
"""
Run command on the VM.
@param resourceGroupName The name of the resource group.
@param vmName The name of the virtual machine.
@param parameters Parameters supplied to the Run command operation.
... | java | public RunCommandResultInner runCommand(String resourceGroupName, String vmName, RunCommandInput parameters) {
return runCommandWithServiceResponseAsync(resourceGroupName, vmName, parameters).toBlocking().last().body();
} | [
"public",
"RunCommandResultInner",
"runCommand",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmName",
",",
"RunCommandInput",
"parameters",
")",
"{",
"return",
"runCommandWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vmName",
",",
"parameters",
")",
... | Run command on the VM.
@param resourceGroupName The name of the resource group.
@param vmName The name of the virtual machine.
@param parameters Parameters supplied to the Run command operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is re... | [
"Run",
"command",
"on",
"the",
"VM",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachinesInner.java#L2626-L2628 |
deeplearning4j/deeplearning4j | datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/recordreader/BaseImageRecordReader.java | BaseImageRecordReader.initialize | public void initialize(InputSplit split, ImageTransform imageTransform) throws IOException {
"""
Called once at initialization.
@param split the split that defines the range of records to read
@param imageTransform the image transform to use to transform images while loading them
@throws java.io.IOEx... | java | public void initialize(InputSplit split, ImageTransform imageTransform) throws IOException {
this.imageLoader = null;
this.imageTransform = imageTransform;
initialize(split);
} | [
"public",
"void",
"initialize",
"(",
"InputSplit",
"split",
",",
"ImageTransform",
"imageTransform",
")",
"throws",
"IOException",
"{",
"this",
".",
"imageLoader",
"=",
"null",
";",
"this",
".",
"imageTransform",
"=",
"imageTransform",
";",
"initialize",
"(",
"s... | Called once at initialization.
@param split the split that defines the range of records to read
@param imageTransform the image transform to use to transform images while loading them
@throws java.io.IOException | [
"Called",
"once",
"at",
"initialization",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/recordreader/BaseImageRecordReader.java#L196-L200 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/FileBeanStore.java | FileBeanStore.getGZIPOutputStream | public GZIPOutputStream getGZIPOutputStream(BeanId beanId)
throws CSIException {
"""
Get object ouput stream suitable for reading persistent state
associated with given key.
"""
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabl... | java | public GZIPOutputStream getGZIPOutputStream(BeanId beanId)
throws CSIException
{
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "getOutputStream", beanId);
final String fileName = getPortable... | [
"public",
"GZIPOutputStream",
"getGZIPOutputStream",
"(",
"BeanId",
"beanId",
")",
"throws",
"CSIException",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEn... | Get object ouput stream suitable for reading persistent state
associated with given key. | [
"Get",
"object",
"ouput",
"stream",
"suitable",
"for",
"reading",
"persistent",
"state",
"associated",
"with",
"given",
"key",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/FileBeanStore.java#L273-L310 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/TagHandlerUtils.java | TagHandlerUtils.findFirstNextByType | public static <T> T findFirstNextByType(FaceletHandler nextHandler, Class<T> type) {
"""
Find the first occurence of a tag handler that is instanceof T
@since 2.0.1
@param <T>
@param nextHandler
@param type
@return
"""
if (type.isAssignableFrom(nextHandler.getClass()))
{
retu... | java | public static <T> T findFirstNextByType(FaceletHandler nextHandler, Class<T> type)
{
if (type.isAssignableFrom(nextHandler.getClass()))
{
return (T)nextHandler;
}
else if (nextHandler instanceof javax.faces.view.facelets.CompositeFaceletHandler)
{
for ... | [
"public",
"static",
"<",
"T",
">",
"T",
"findFirstNextByType",
"(",
"FaceletHandler",
"nextHandler",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"if",
"(",
"type",
".",
"isAssignableFrom",
"(",
"nextHandler",
".",
"getClass",
"(",
")",
")",
")",
"{",
... | Find the first occurence of a tag handler that is instanceof T
@since 2.0.1
@param <T>
@param nextHandler
@param type
@return | [
"Find",
"the",
"first",
"occurence",
"of",
"a",
"tag",
"handler",
"that",
"is",
"instanceof",
"T"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/TagHandlerUtils.java#L49-L67 |
samskivert/samskivert | src/main/java/com/samskivert/servlet/util/CookieUtil.java | CookieUtil.widenDomain | public static void widenDomain (HttpServletRequest req, Cookie cookie) {
"""
Sets the domain of the specified cookie to the server name associated with the supplied
request minus the hostname (ie. <code>www.samskivert.com</code> becomes
<code>.samskivert.com</code>).
"""
String server = req.getServer... | java | public static void widenDomain (HttpServletRequest req, Cookie cookie)
{
String server = req.getServerName();
int didx = server.indexOf(".");
// if no period was found (e.g. localhost) don't set the domain
if (didx == -1) {
return;
}
// if two or more peri... | [
"public",
"static",
"void",
"widenDomain",
"(",
"HttpServletRequest",
"req",
",",
"Cookie",
"cookie",
")",
"{",
"String",
"server",
"=",
"req",
".",
"getServerName",
"(",
")",
";",
"int",
"didx",
"=",
"server",
".",
"indexOf",
"(",
"\".\"",
")",
";",
"//... | Sets the domain of the specified cookie to the server name associated with the supplied
request minus the hostname (ie. <code>www.samskivert.com</code> becomes
<code>.samskivert.com</code>). | [
"Sets",
"the",
"domain",
"of",
"the",
"specified",
"cookie",
"to",
"the",
"server",
"name",
"associated",
"with",
"the",
"supplied",
"request",
"minus",
"the",
"hostname",
"(",
"ie",
".",
"<code",
">",
"www",
".",
"samskivert",
".",
"com<",
"/",
"code",
... | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/util/CookieUtil.java#L59-L74 |
eFaps/eFaps-Kernel | src/main/java/org/efaps/admin/datamodel/attributetype/OwnerLinkType.java | OwnerLinkType.prepare | @Override
protected void prepare(final AbstractSQLInsertUpdate<?> _insertUpdate,
final Attribute _attribute,
final Object... _values)
throws SQLException {
"""
The instance method sets the value in the insert statement to the id of
the current cont... | java | @Override
protected void prepare(final AbstractSQLInsertUpdate<?> _insertUpdate,
final Attribute _attribute,
final Object... _values)
throws SQLException
{
checkSQLColumnSize(_attribute, 1);
try {
_insertUpdate.column(_att... | [
"@",
"Override",
"protected",
"void",
"prepare",
"(",
"final",
"AbstractSQLInsertUpdate",
"<",
"?",
">",
"_insertUpdate",
",",
"final",
"Attribute",
"_attribute",
",",
"final",
"Object",
"...",
"_values",
")",
"throws",
"SQLException",
"{",
"checkSQLColumnSize",
"... | The instance method sets the value in the insert statement to the id of
the current context user.
@param _insertUpdate SQL insert / update statement
@param _attribute SQL update statement
@param _values new object value to set; values are localized and
are coming from the user interface
@throws SQLException o... | [
"The",
"instance",
"method",
"sets",
"the",
"value",
"in",
"the",
"insert",
"statement",
"to",
"the",
"id",
"of",
"the",
"current",
"context",
"user",
"."
] | train | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/admin/datamodel/attributetype/OwnerLinkType.java#L52-L65 |
knowm/XChange | xchange-cexio/src/main/java/org/knowm/xchange/cexio/CexIOAdapters.java | CexIOAdapters.adaptOrderBook | public static OrderBook adaptOrderBook(CexIODepth depth, CurrencyPair currencyPair) {
"""
Adapts Cex.IO Depth to OrderBook Object
@param depth Cex.IO order book
@param currencyPair The currency pair (e.g. BTC/USD)
@return The XChange OrderBook
"""
List<LimitOrder> asks = createOrders(currencyPair, Or... | java | public static OrderBook adaptOrderBook(CexIODepth depth, CurrencyPair currencyPair) {
List<LimitOrder> asks = createOrders(currencyPair, OrderType.ASK, depth.getAsks());
List<LimitOrder> bids = createOrders(currencyPair, OrderType.BID, depth.getBids());
Date date = new Date(depth.getTimestamp() * 1000);
... | [
"public",
"static",
"OrderBook",
"adaptOrderBook",
"(",
"CexIODepth",
"depth",
",",
"CurrencyPair",
"currencyPair",
")",
"{",
"List",
"<",
"LimitOrder",
">",
"asks",
"=",
"createOrders",
"(",
"currencyPair",
",",
"OrderType",
".",
"ASK",
",",
"depth",
".",
"ge... | Adapts Cex.IO Depth to OrderBook Object
@param depth Cex.IO order book
@param currencyPair The currency pair (e.g. BTC/USD)
@return The XChange OrderBook | [
"Adapts",
"Cex",
".",
"IO",
"Depth",
"to",
"OrderBook",
"Object"
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-cexio/src/main/java/org/knowm/xchange/cexio/CexIOAdapters.java#L126-L132 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java | CacheUnitImpl.removeExternalCacheAdapter | public void removeExternalCacheAdapter(String groupId, String address) throws DynamicCacheServiceNotStarted {
"""
This implements the method in the CacheUnit interface.
This is delegated to the ExternalCacheServices.
It calls ServletCacheUnit to perform this operation.
@param groupId The external cache group ... | java | public void removeExternalCacheAdapter(String groupId, String address) throws DynamicCacheServiceNotStarted {
if (servletCacheUnit == null) {
throw new DynamicCacheServiceNotStarted("Servlet cache service has not been started.");
}
servletCacheUnit.removeExternalCacheAdapter(groupId, address);
... | [
"public",
"void",
"removeExternalCacheAdapter",
"(",
"String",
"groupId",
",",
"String",
"address",
")",
"throws",
"DynamicCacheServiceNotStarted",
"{",
"if",
"(",
"servletCacheUnit",
"==",
"null",
")",
"{",
"throw",
"new",
"DynamicCacheServiceNotStarted",
"(",
"\"Ser... | This implements the method in the CacheUnit interface.
This is delegated to the ExternalCacheServices.
It calls ServletCacheUnit to perform this operation.
@param groupId The external cache group id.
@param address The IP address of the target external cache. | [
"This",
"implements",
"the",
"method",
"in",
"the",
"CacheUnit",
"interface",
".",
"This",
"is",
"delegated",
"to",
"the",
"ExternalCacheServices",
".",
"It",
"calls",
"ServletCacheUnit",
"to",
"perform",
"this",
"operation",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java#L231-L236 |
h2oai/h2o-3 | h2o-core/src/main/java/water/util/FrameUtils.java | FrameUtils.parseFrame | public static Frame parseFrame(Key okey, URI ...uris) throws IOException {
"""
Parse given set of URIs and produce a frame's key representing output.
@param okey key for ouput frame. Can be null
@param uris array of URI (file://, hdfs://, s3n://, s3a://, s3://, http://, https:// ...) to parse
@return a frame ... | java | public static Frame parseFrame(Key okey, URI ...uris) throws IOException {
return parseFrame(okey, null, uris);
} | [
"public",
"static",
"Frame",
"parseFrame",
"(",
"Key",
"okey",
",",
"URI",
"...",
"uris",
")",
"throws",
"IOException",
"{",
"return",
"parseFrame",
"(",
"okey",
",",
"null",
",",
"uris",
")",
";",
"}"
] | Parse given set of URIs and produce a frame's key representing output.
@param okey key for ouput frame. Can be null
@param uris array of URI (file://, hdfs://, s3n://, s3a://, s3://, http://, https:// ...) to parse
@return a frame which is saved into DKV under okey
@throws IOException in case of parse error. | [
"Parse",
"given",
"set",
"of",
"URIs",
"and",
"produce",
"a",
"frame",
"s",
"key",
"representing",
"output",
"."
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/util/FrameUtils.java#L53-L55 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/cuComplex.java | cuComplex.cuCdiv | public static cuComplex cuCdiv (cuComplex x, cuComplex y) {
"""
Returns the quotient of the given complex numbers.<br />
<br />
Original comment:<br />
<br />
This implementation guards against intermediate underflow and overflow
by scaling. Such guarded implementations are usually the default for
complex l... | java | public static cuComplex cuCdiv (cuComplex x, cuComplex y)
{
cuComplex quot;
float s = ((float)Math.abs(cuCreal(y))) + ((float)Math.abs(cuCimag(y)));
float oos = 1.0f / s;
float ars = cuCreal(x) * oos;
float ais = cuCimag(x) * oos;
float brs = cuCreal(y) * oos;... | [
"public",
"static",
"cuComplex",
"cuCdiv",
"(",
"cuComplex",
"x",
",",
"cuComplex",
"y",
")",
"{",
"cuComplex",
"quot",
";",
"float",
"s",
"=",
"(",
"(",
"float",
")",
"Math",
".",
"abs",
"(",
"cuCreal",
"(",
"y",
")",
")",
")",
"+",
"(",
"(",
"f... | Returns the quotient of the given complex numbers.<br />
<br />
Original comment:<br />
<br />
This implementation guards against intermediate underflow and overflow
by scaling. Such guarded implementations are usually the default for
complex library implementations, with some also offering an unguarded,
faster version... | [
"Returns",
"the",
"quotient",
"of",
"the",
"given",
"complex",
"numbers",
".",
"<br",
"/",
">",
"<br",
"/",
">",
"Original",
"comment",
":",
"<br",
"/",
">",
"<br",
"/",
">",
"This",
"implementation",
"guards",
"against",
"intermediate",
"underflow",
"and"... | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/cuComplex.java#L144-L158 |
RestComm/Restcomm-Connect | restcomm/restcomm.dao/src/main/java/org/restcomm/connect/dao/mybatis/MybatisApplicationsDao.java | MybatisApplicationsDao.populateApplicationWithNumber | private void populateApplicationWithNumber(Application application, final Map<String, Object> map, String field_prefix) {
"""
Populates application.numbers field with information of one or more numbers. The 'numbers' list is created if
already null and an IncomingPhoneNumber is added into it based on information ... | java | private void populateApplicationWithNumber(Application application, final Map<String, Object> map, String field_prefix) {
// first create the number
ApplicationNumberSummary number = new ApplicationNumberSummary(
readString(map.get(field_prefix + "sid")),
readString(map.g... | [
"private",
"void",
"populateApplicationWithNumber",
"(",
"Application",
"application",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
",",
"String",
"field_prefix",
")",
"{",
"// first create the number",
"ApplicationNumberSummary",
"number",
"=",
"new... | Populates application.numbers field with information of one or more numbers. The 'numbers' list is created if
already null and an IncomingPhoneNumber is added into it based on information from the map. Invoking the same method
several times to add more numbers to the same list is possible.
@param application
@param ma... | [
"Populates",
"application",
".",
"numbers",
"field",
"with",
"information",
"of",
"one",
"or",
"more",
"numbers",
".",
"The",
"numbers",
"list",
"is",
"created",
"if",
"already",
"null",
"and",
"an",
"IncomingPhoneNumber",
"is",
"added",
"into",
"it",
"based",... | train | https://github.com/RestComm/Restcomm-Connect/blob/2194dee4fc524cdfd0af77a218ba5f212f97f7c5/restcomm/restcomm.dao/src/main/java/org/restcomm/connect/dao/mybatis/MybatisApplicationsDao.java#L200-L217 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/media/MediaClient.java | MediaClient.listJobs | @Deprecated
public ListJobsResponse listJobs(ListJobsRequest request) {
"""
List all transcoder jobs on specified pipeline.
@param request The request object containing all options for list jobs.
@return The list of job IDs.
@deprecated As of release 0.8.5, replaced by {@link #listTranscodingJobs(ListTr... | java | @Deprecated
public ListJobsResponse listJobs(ListJobsRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
checkStringNotEmpty(request.getPipelineName(),
"The parameter pipelineName should NOT be null or empty string.");
InternalRequest intern... | [
"@",
"Deprecated",
"public",
"ListJobsResponse",
"listJobs",
"(",
"ListJobsRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"The parameter request should NOT be null.\"",
")",
";",
"checkStringNotEmpty",
"(",
"request",
".",
"getPipelineName",
"(",
... | List all transcoder jobs on specified pipeline.
@param request The request object containing all options for list jobs.
@return The list of job IDs.
@deprecated As of release 0.8.5, replaced by {@link #listTranscodingJobs(ListTranscodingJobsRequest)} | [
"List",
"all",
"transcoder",
"jobs",
"on",
"specified",
"pipeline",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/media/MediaClient.java#L248-L256 |
zalando-stups/spring-boot-etcd | zalando-boot-etcd/src/main/java/org/zalando/boot/etcd/EtcdClient.java | EtcdClient.listMembers | public EtcdMemberResponse listMembers() throws EtcdException {
"""
Returns a representation of all members in the etcd cluster.
@return the members
@throws EtcdException
in case etcd returned an error
"""
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(MEMBERSPACE);
return execute(bu... | java | public EtcdMemberResponse listMembers() throws EtcdException {
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(MEMBERSPACE);
return execute(builder, HttpMethod.GET, null, EtcdMemberResponse.class);
} | [
"public",
"EtcdMemberResponse",
"listMembers",
"(",
")",
"throws",
"EtcdException",
"{",
"UriComponentsBuilder",
"builder",
"=",
"UriComponentsBuilder",
".",
"fromUriString",
"(",
"MEMBERSPACE",
")",
";",
"return",
"execute",
"(",
"builder",
",",
"HttpMethod",
".",
... | Returns a representation of all members in the etcd cluster.
@return the members
@throws EtcdException
in case etcd returned an error | [
"Returns",
"a",
"representation",
"of",
"all",
"members",
"in",
"the",
"etcd",
"cluster",
"."
] | train | https://github.com/zalando-stups/spring-boot-etcd/blob/6b4f48663d424777326c38b1e7da75c8b68a3841/zalando-boot-etcd/src/main/java/org/zalando/boot/etcd/EtcdClient.java#L581-L584 |
sahan/IckleBot | icklebot/src/main/java/com/lonepulse/icklebot/util/ReflectiveR.java | ReflectiveR.getIdentifier | private static int getIdentifier(String resourcetype, Context context, String resourceName) {
"""
<p>Looks up the identifier of a resource using
{@link Resources#getIdentifier(String, String, String)}.</p>
@param resourcetype
the resource <i>type</i>; these include <i>string</i>,
<i>drawable</i> etc
@para... | java | private static int getIdentifier(String resourcetype, Context context, String resourceName) {
return context.getResources().getIdentifier(resourceName, resourcetype, context.getPackageName());
} | [
"private",
"static",
"int",
"getIdentifier",
"(",
"String",
"resourcetype",
",",
"Context",
"context",
",",
"String",
"resourceName",
")",
"{",
"return",
"context",
".",
"getResources",
"(",
")",
".",
"getIdentifier",
"(",
"resourceName",
",",
"resourcetype",
",... | <p>Looks up the identifier of a resource using
{@link Resources#getIdentifier(String, String, String)}.</p>
@param resourcetype
the resource <i>type</i>; these include <i>string</i>,
<i>drawable</i> etc
@param context
the {@link Context} in which the members of the <b>R</b>
file is discovered
@param resourceName
the... | [
"<p",
">",
"Looks",
"up",
"the",
"identifier",
"of",
"a",
"resource",
"using",
"{",
"@link",
"Resources#getIdentifier",
"(",
"String",
"String",
"String",
")",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/sahan/IckleBot/blob/a19003ceb3ad7c7ee508dc23a8cb31b5676aa499/icklebot/src/main/java/com/lonepulse/icklebot/util/ReflectiveR.java#L254-L257 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/multilayer/SparkDl4jMultiLayer.java | SparkDl4jMultiLayer.scoreExamples | public <K> JavaPairRDD<K, Double> scoreExamples(JavaPairRDD<K, DataSet> data, boolean includeRegularizationTerms) {
"""
Score the examples individually, using the default batch size {@link #DEFAULT_EVAL_SCORE_BATCH_SIZE}. Unlike {@link #calculateScore(JavaRDD, boolean)},
this method returns a score for each examp... | java | public <K> JavaPairRDD<K, Double> scoreExamples(JavaPairRDD<K, DataSet> data, boolean includeRegularizationTerms) {
return scoreExamples(data, includeRegularizationTerms, DEFAULT_EVAL_SCORE_BATCH_SIZE);
} | [
"public",
"<",
"K",
">",
"JavaPairRDD",
"<",
"K",
",",
"Double",
">",
"scoreExamples",
"(",
"JavaPairRDD",
"<",
"K",
",",
"DataSet",
">",
"data",
",",
"boolean",
"includeRegularizationTerms",
")",
"{",
"return",
"scoreExamples",
"(",
"data",
",",
"includeReg... | Score the examples individually, using the default batch size {@link #DEFAULT_EVAL_SCORE_BATCH_SIZE}. Unlike {@link #calculateScore(JavaRDD, boolean)},
this method returns a score for each example separately<br>
Note: The provided JavaPairRDD has a key that is associated with each example and returned score.<br>
<b>Not... | [
"Score",
"the",
"examples",
"individually",
"using",
"the",
"default",
"batch",
"size",
"{",
"@link",
"#DEFAULT_EVAL_SCORE_BATCH_SIZE",
"}",
".",
"Unlike",
"{",
"@link",
"#calculateScore",
"(",
"JavaRDD",
"boolean",
")",
"}",
"this",
"method",
"returns",
"a",
"s... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/multilayer/SparkDl4jMultiLayer.java#L452-L454 |
icode/ameba | src/main/java/ameba/message/jackson/internal/JacksonUtils.java | JacksonUtils.setObjectWriterInjector | public static void setObjectWriterInjector(Provider<ObjectProvider<FilterProvider>> provider,
final Type genericType,
final Annotation[] annotations) throws IOException {
"""
<p>setObjectWriterInjector.</p>
@param prov... | java | public static void setObjectWriterInjector(Provider<ObjectProvider<FilterProvider>> provider,
final Type genericType,
final Annotation[] annotations) throws IOException {
final FilterProvider filterProvider = provider.... | [
"public",
"static",
"void",
"setObjectWriterInjector",
"(",
"Provider",
"<",
"ObjectProvider",
"<",
"FilterProvider",
">",
">",
"provider",
",",
"final",
"Type",
"genericType",
",",
"final",
"Annotation",
"[",
"]",
"annotations",
")",
"throws",
"IOException",
"{",... | <p>setObjectWriterInjector.</p>
@param provider a {@link javax.inject.Provider} object.
@param genericType a {@link java.lang.reflect.Type} object.
@param annotations an array of {@link java.lang.annotation.Annotation} objects.
@throws java.io.IOException if any. | [
"<p",
">",
"setObjectWriterInjector",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/message/jackson/internal/JacksonUtils.java#L78-L85 |
brianwhu/xillium | data/src/main/java/org/xillium/data/persistence/Persistence.java | Persistence.executeSelect | public <T> T executeSelect(String name, DataObject object, ResultSetWorker<T> worker) throws Exception {
"""
Executes a SELECT statement and passes the result set to the ResultSetWorker.
"""
ParametricQuery statement = (ParametricQuery)_statements.get(name);
if (statement != null) {
... | java | public <T> T executeSelect(String name, DataObject object, ResultSetWorker<T> worker) throws Exception {
ParametricQuery statement = (ParametricQuery)_statements.get(name);
if (statement != null) {
return statement.executeSelect(DataSourceUtils.getConnection(_dataSource), object, worker);... | [
"public",
"<",
"T",
">",
"T",
"executeSelect",
"(",
"String",
"name",
",",
"DataObject",
"object",
",",
"ResultSetWorker",
"<",
"T",
">",
"worker",
")",
"throws",
"Exception",
"{",
"ParametricQuery",
"statement",
"=",
"(",
"ParametricQuery",
")",
"_statements"... | Executes a SELECT statement and passes the result set to the ResultSetWorker. | [
"Executes",
"a",
"SELECT",
"statement",
"and",
"passes",
"the",
"result",
"set",
"to",
"the",
"ResultSetWorker",
"."
] | train | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/persistence/Persistence.java#L183-L190 |
grpc/grpc-java | netty/src/main/java/io/grpc/netty/GrpcSslContexts.java | GrpcSslContexts.configure | @CanIgnoreReturnValue
public static SslContextBuilder configure(SslContextBuilder builder, Provider jdkProvider) {
"""
Set ciphers and APN appropriate for gRPC. Precisely what is set is permitted to change, so if
an application requires particular settings it should override the options set here.
"""
Ap... | java | @CanIgnoreReturnValue
public static SslContextBuilder configure(SslContextBuilder builder, Provider jdkProvider) {
ApplicationProtocolConfig apc;
if (SUN_PROVIDER_NAME.equals(jdkProvider.getName())) {
// Jetty ALPN/NPN only supports one of NPN or ALPN
if (JettyTlsUtil.isJettyAlpnConfigured()) {
... | [
"@",
"CanIgnoreReturnValue",
"public",
"static",
"SslContextBuilder",
"configure",
"(",
"SslContextBuilder",
"builder",
",",
"Provider",
"jdkProvider",
")",
"{",
"ApplicationProtocolConfig",
"apc",
";",
"if",
"(",
"SUN_PROVIDER_NAME",
".",
"equals",
"(",
"jdkProvider",
... | Set ciphers and APN appropriate for gRPC. Precisely what is set is permitted to change, so if
an application requires particular settings it should override the options set here. | [
"Set",
"ciphers",
"and",
"APN",
"appropriate",
"for",
"gRPC",
".",
"Precisely",
"what",
"is",
"set",
"is",
"permitted",
"to",
"change",
"so",
"if",
"an",
"application",
"requires",
"particular",
"settings",
"it",
"should",
"override",
"the",
"options",
"set",
... | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/netty/src/main/java/io/grpc/netty/GrpcSslContexts.java#L213-L238 |
VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/net/MediaType.java | MediaType.withCharset | public MediaType withCharset(Charset charset) {
"""
Returns a new instance with the same type and subtype as this instance, with the
{@code charset} parameter set to the {@link Charset#name name} of the given charset. Only one
{@code charset} parameter will be present on the new instance regardless of the number... | java | public MediaType withCharset(Charset charset) {
checkNotNull(charset);
return withParameter(CHARSET_ATTRIBUTE, charset.name());
} | [
"public",
"MediaType",
"withCharset",
"(",
"Charset",
"charset",
")",
"{",
"checkNotNull",
"(",
"charset",
")",
";",
"return",
"withParameter",
"(",
"CHARSET_ATTRIBUTE",
",",
"charset",
".",
"name",
"(",
")",
")",
";",
"}"
] | Returns a new instance with the same type and subtype as this instance, with the
{@code charset} parameter set to the {@link Charset#name name} of the given charset. Only one
{@code charset} parameter will be present on the new instance regardless of the number set on
this one.
<p>If a charset must be specified that i... | [
"Returns",
"a",
"new",
"instance",
"with",
"the",
"same",
"type",
"and",
"subtype",
"as",
"this",
"instance",
"with",
"the",
"{",
"@code",
"charset",
"}",
"parameter",
"set",
"to",
"the",
"{",
"@link",
"Charset#name",
"name",
"}",
"of",
"the",
"given",
"... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/net/MediaType.java#L634-L637 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/Input.java | Input.fireControlRelease | private void fireControlRelease(int index, int controllerIndex) {
"""
Fire an event indicating that a control has been released
@param index The index of the control released
@param controllerIndex The index of the controller on which the control was released
"""
consumed = false;
for (int i=0;i<cont... | java | private void fireControlRelease(int index, int controllerIndex) {
consumed = false;
for (int i=0;i<controllerListeners.size();i++) {
ControllerListener listener = (ControllerListener) controllerListeners.get(i);
if (listener.isAcceptingInput()) {
switch (index) {
case LEFT:
listener.contro... | [
"private",
"void",
"fireControlRelease",
"(",
"int",
"index",
",",
"int",
"controllerIndex",
")",
"{",
"consumed",
"=",
"false",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"controllerListeners",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
... | Fire an event indicating that a control has been released
@param index The index of the control released
@param controllerIndex The index of the controller on which the control was released | [
"Fire",
"an",
"event",
"indicating",
"that",
"a",
"control",
"has",
"been",
"released"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Input.java#L1439-L1467 |
openengsb/openengsb | components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/ModelDiff.java | ModelDiff.addDifference | public void addDifference(Field field, Object before, Object after) {
"""
Adds a difference to the list of differences of this ModelDiff instance.
"""
ModelDiffEntry entry = new ModelDiffEntry();
entry.setBefore(before);
entry.setAfter(after);
entry.setField(field);
diff... | java | public void addDifference(Field field, Object before, Object after) {
ModelDiffEntry entry = new ModelDiffEntry();
entry.setBefore(before);
entry.setAfter(after);
entry.setField(field);
differences.put(field, entry);
} | [
"public",
"void",
"addDifference",
"(",
"Field",
"field",
",",
"Object",
"before",
",",
"Object",
"after",
")",
"{",
"ModelDiffEntry",
"entry",
"=",
"new",
"ModelDiffEntry",
"(",
")",
";",
"entry",
".",
"setBefore",
"(",
"before",
")",
";",
"entry",
".",
... | Adds a difference to the list of differences of this ModelDiff instance. | [
"Adds",
"a",
"difference",
"to",
"the",
"list",
"of",
"differences",
"of",
"this",
"ModelDiff",
"instance",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/ModelDiff.java#L100-L106 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.getShort | public static short getShort(MemorySegment[] segments, int offset) {
"""
get short from segments.
@param segments target segments.
@param offset value offset.
"""
if (inFirstSegment(segments, offset, 2)) {
return segments[0].getShort(offset);
} else {
return getShortMultiSegments(segments, offset... | java | public static short getShort(MemorySegment[] segments, int offset) {
if (inFirstSegment(segments, offset, 2)) {
return segments[0].getShort(offset);
} else {
return getShortMultiSegments(segments, offset);
}
} | [
"public",
"static",
"short",
"getShort",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"2",
")",
")",
"{",
"return",
"segments",
"[",
"0",
"]",
".",
"getSho... | get short from segments.
@param segments target segments.
@param offset value offset. | [
"get",
"short",
"from",
"segments",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L800-L806 |
RuedigerMoeller/kontraktor | modules/reactive-streams/src/main/java/org/nustaq/kontraktor/reactivestreams/KxReactiveStreams.java | KxReactiveStreams.stream | public <T> Stream<T> stream( Publisher<T> pub ) {
"""
warning: blocks the calling thread. Need to execute in a separate thread if called
from within a callback
"""
return stream(pub, batchSize);
} | java | public <T> Stream<T> stream( Publisher<T> pub ) {
return stream(pub, batchSize);
} | [
"public",
"<",
"T",
">",
"Stream",
"<",
"T",
">",
"stream",
"(",
"Publisher",
"<",
"T",
">",
"pub",
")",
"{",
"return",
"stream",
"(",
"pub",
",",
"batchSize",
")",
";",
"}"
] | warning: blocks the calling thread. Need to execute in a separate thread if called
from within a callback | [
"warning",
":",
"blocks",
"the",
"calling",
"thread",
".",
"Need",
"to",
"execute",
"in",
"a",
"separate",
"thread",
"if",
"called",
"from",
"within",
"a",
"callback"
] | train | https://github.com/RuedigerMoeller/kontraktor/blob/d5f3817f9476f3786187b8ef00400b7a4f25a404/modules/reactive-streams/src/main/java/org/nustaq/kontraktor/reactivestreams/KxReactiveStreams.java#L244-L246 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WMultiFileWidgetExample.java | WMultiFileWidgetExample.appendFileDetails | private void appendFileDetails(final StringBuffer buf, final WMultiFileWidget fileWidget) {
"""
Appends details of the uploaded files to the given string buffer.
@param buf the buffer to append file details to.
@param fileWidget the WFieldWidget to obtain the files from.
"""
List<FileWidgetUpload> files ... | java | private void appendFileDetails(final StringBuffer buf, final WMultiFileWidget fileWidget) {
List<FileWidgetUpload> files = fileWidget.getFiles();
if (files != null) {
for (FileWidgetUpload file : files) {
String streamedSize;
try {
InputStream in = file.getFile().getInputStream();
int size =... | [
"private",
"void",
"appendFileDetails",
"(",
"final",
"StringBuffer",
"buf",
",",
"final",
"WMultiFileWidget",
"fileWidget",
")",
"{",
"List",
"<",
"FileWidgetUpload",
">",
"files",
"=",
"fileWidget",
".",
"getFiles",
"(",
")",
";",
"if",
"(",
"files",
"!=",
... | Appends details of the uploaded files to the given string buffer.
@param buf the buffer to append file details to.
@param fileWidget the WFieldWidget to obtain the files from. | [
"Appends",
"details",
"of",
"the",
"uploaded",
"files",
"to",
"the",
"given",
"string",
"buffer",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WMultiFileWidgetExample.java#L199-L223 |
networknt/light-4j | client/src/main/java/com/networknt/client/Http2Client.java | Http2Client.addCcTokenTrace | public Result addCcTokenTrace(ClientRequest request, String traceabilityId) {
"""
Add Client Credentials token cached in the client for standalone application
This is the method called from standalone application like enterprise scheduler for batch jobs
or mobile apps.
@param request the http request
@para... | java | public Result addCcTokenTrace(ClientRequest request, String traceabilityId) {
Result<Jwt> result = tokenManager.getJwt(request);
if(result.isFailure()) { return Failure.of(result.getError()); }
request.getRequestHeaders().put(Headers.AUTHORIZATION, "Bearer " + result.getResult().getJwt());
... | [
"public",
"Result",
"addCcTokenTrace",
"(",
"ClientRequest",
"request",
",",
"String",
"traceabilityId",
")",
"{",
"Result",
"<",
"Jwt",
">",
"result",
"=",
"tokenManager",
".",
"getJwt",
"(",
"request",
")",
";",
"if",
"(",
"result",
".",
"isFailure",
"(",
... | Add Client Credentials token cached in the client for standalone application
This is the method called from standalone application like enterprise scheduler for batch jobs
or mobile apps.
@param request the http request
@param traceabilityId the traceability id
@return Result when fail to get jwt, it will return a St... | [
"Add",
"Client",
"Credentials",
"token",
"cached",
"in",
"the",
"client",
"for",
"standalone",
"application"
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/client/src/main/java/com/networknt/client/Http2Client.java#L333-L339 |
bazaarvoice/emodb | common/stash/src/main/java/com/bazaarvoice/emodb/common/stash/StashReader.java | StashReader.getS3Client | protected static AmazonS3 getS3Client(URI stashRoot, AWSCredentialsProvider credentialsProvider) {
"""
Utility method to get the S3 client for a credentials provider.
"""
return getS3Client(stashRoot, credentialsProvider, null);
} | java | protected static AmazonS3 getS3Client(URI stashRoot, AWSCredentialsProvider credentialsProvider) {
return getS3Client(stashRoot, credentialsProvider, null);
} | [
"protected",
"static",
"AmazonS3",
"getS3Client",
"(",
"URI",
"stashRoot",
",",
"AWSCredentialsProvider",
"credentialsProvider",
")",
"{",
"return",
"getS3Client",
"(",
"stashRoot",
",",
"credentialsProvider",
",",
"null",
")",
";",
"}"
] | Utility method to get the S3 client for a credentials provider. | [
"Utility",
"method",
"to",
"get",
"the",
"S3",
"client",
"for",
"a",
"credentials",
"provider",
"."
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/stash/src/main/java/com/bazaarvoice/emodb/common/stash/StashReader.java#L70-L72 |
boncey/Flickr4Java | src/main/java/com/flickr4java/flickr/stats/StatsInterface.java | StatsInterface.getPhotoReferrers | public ReferrerList getPhotoReferrers(Date date, String domain, String photoId, int perPage, int page) throws FlickrException {
"""
Get a list of referrers from a given domain to a photo.
@param date
(Required) Stats will be returned for this date. A day according to Flickr Stats starts at midnight GMT for all... | java | public ReferrerList getPhotoReferrers(Date date, String domain, String photoId, int perPage, int page) throws FlickrException {
return getReferrers(METHOD_GET_PHOTO_REFERRERS, domain, "photo_id", photoId, date, perPage, page);
} | [
"public",
"ReferrerList",
"getPhotoReferrers",
"(",
"Date",
"date",
",",
"String",
"domain",
",",
"String",
"photoId",
",",
"int",
"perPage",
",",
"int",
"page",
")",
"throws",
"FlickrException",
"{",
"return",
"getReferrers",
"(",
"METHOD_GET_PHOTO_REFERRERS",
",... | Get a list of referrers from a given domain to a photo.
@param date
(Required) Stats will be returned for this date. A day according to Flickr Stats starts at midnight GMT for all users, and timestamps will
automatically be rounded down to the start of the day.
@param domain
(Required) The domain to return referrers f... | [
"Get",
"a",
"list",
"of",
"referrers",
"from",
"a",
"given",
"domain",
"to",
"a",
"photo",
"."
] | train | https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/stats/StatsInterface.java#L188-L190 |
keenon/loglinear | src/main/java/com/github/keenon/loglinear/model/ConcatVector.java | ConcatVector.setSparseComponent | public void setSparseComponent(int component, int[] indices, double[] values) {
"""
Sets a component to a set of sparse indices, each with a value.
@param component the index of the component to set
@param indices the indices of the vector to give values to
@param values their values
"""
if (comp... | java | public void setSparseComponent(int component, int[] indices, double[] values) {
if (component >= pointers.length) {
increaseSizeTo(component + 1);
}
assert (indices.length == values.length);
if (indices.length == 0) {
pointers[component] = new double[2];
sparse[component] = true;
... | [
"public",
"void",
"setSparseComponent",
"(",
"int",
"component",
",",
"int",
"[",
"]",
"indices",
",",
"double",
"[",
"]",
"values",
")",
"{",
"if",
"(",
"component",
">=",
"pointers",
".",
"length",
")",
"{",
"increaseSizeTo",
"(",
"component",
"+",
"1"... | Sets a component to a set of sparse indices, each with a value.
@param component the index of the component to set
@param indices the indices of the vector to give values to
@param values their values | [
"Sets",
"a",
"component",
"to",
"a",
"set",
"of",
"sparse",
"indices",
"each",
"with",
"a",
"value",
"."
] | train | https://github.com/keenon/loglinear/blob/fa0c370ab6782015412f676ef2ab11c97be58e29/src/main/java/com/github/keenon/loglinear/model/ConcatVector.java#L122-L143 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java | AlignmentTools.applyAlignment | public static <T> Map<T,T> applyAlignment(Map<T, T> alignmentMap, int k) {
"""
Applies an alignment k times. Eg if alignmentMap defines function f(x),
this returns a function f^k(x)=f(f(...f(x)...)).
@param <T>
@param alignmentMap The input function, as a map (see {@link AlignmentTools#alignmentAsMap(AFPChain... | java | public static <T> Map<T,T> applyAlignment(Map<T, T> alignmentMap, int k) {
return applyAlignment(alignmentMap, new IdentityMap<T>(), k);
} | [
"public",
"static",
"<",
"T",
">",
"Map",
"<",
"T",
",",
"T",
">",
"applyAlignment",
"(",
"Map",
"<",
"T",
",",
"T",
">",
"alignmentMap",
",",
"int",
"k",
")",
"{",
"return",
"applyAlignment",
"(",
"alignmentMap",
",",
"new",
"IdentityMap",
"<",
"T",... | Applies an alignment k times. Eg if alignmentMap defines function f(x),
this returns a function f^k(x)=f(f(...f(x)...)).
@param <T>
@param alignmentMap The input function, as a map (see {@link AlignmentTools#alignmentAsMap(AFPChain)})
@param k The number of times to apply the alignment
@return A new alignment. If the ... | [
"Applies",
"an",
"alignment",
"k",
"times",
".",
"Eg",
"if",
"alignmentMap",
"defines",
"function",
"f",
"(",
"x",
")",
"this",
"returns",
"a",
"function",
"f^k",
"(",
"x",
")",
"=",
"f",
"(",
"f",
"(",
"...",
"f",
"(",
"x",
")",
"...",
"))",
"."... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java#L191-L193 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/WebhooksInner.java | WebhooksInner.listEventsAsync | public Observable<Page<EventInner>> listEventsAsync(final String resourceGroupName, final String registryName, final String webhookName) {
"""
Lists recent events for the specified webhook.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The ... | java | public Observable<Page<EventInner>> listEventsAsync(final String resourceGroupName, final String registryName, final String webhookName) {
return listEventsWithServiceResponseAsync(resourceGroupName, registryName, webhookName)
.map(new Func1<ServiceResponse<Page<EventInner>>, Page<EventInner>>() {
... | [
"public",
"Observable",
"<",
"Page",
"<",
"EventInner",
">",
">",
"listEventsAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"registryName",
",",
"final",
"String",
"webhookName",
")",
"{",
"return",
"listEventsWithServiceResponseAsync",
... | Lists recent events for the specified webhook.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param webhookName The name of the webhook.
@throws IllegalArgumentException thrown if parameters fail the validation
@... | [
"Lists",
"recent",
"events",
"for",
"the",
"specified",
"webhook",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/WebhooksInner.java#L1097-L1105 |
aws/aws-sdk-java | aws-java-sdk-inspector/src/main/java/com/amazonaws/services/inspector/model/DescribeExclusionsResult.java | DescribeExclusionsResult.withFailedItems | public DescribeExclusionsResult withFailedItems(java.util.Map<String, FailedItemDetails> failedItems) {
"""
<p>
Exclusion details that cannot be described. An error code is provided for each failed item.
</p>
@param failedItems
Exclusion details that cannot be described. An error code is provided for each fa... | java | public DescribeExclusionsResult withFailedItems(java.util.Map<String, FailedItemDetails> failedItems) {
setFailedItems(failedItems);
return this;
} | [
"public",
"DescribeExclusionsResult",
"withFailedItems",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"FailedItemDetails",
">",
"failedItems",
")",
"{",
"setFailedItems",
"(",
"failedItems",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Exclusion details that cannot be described. An error code is provided for each failed item.
</p>
@param failedItems
Exclusion details that cannot be described. An error code is provided for each failed item.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Exclusion",
"details",
"that",
"cannot",
"be",
"described",
".",
"An",
"error",
"code",
"is",
"provided",
"for",
"each",
"failed",
"item",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-inspector/src/main/java/com/amazonaws/services/inspector/model/DescribeExclusionsResult.java#L135-L138 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java | ArrayUtil.containsAny | @SuppressWarnings("unchecked")
public static <T> boolean containsAny(T[] array, T... values) {
"""
数组中是否包含指定元素中的任意一个
@param <T> 数组元素类型
@param array 数组
@param values 被检查的多个元素
@return 是否包含指定元素中的任意一个
@since 4.1.20
"""
for (T value : values) {
if(contains(array, value)) {
return true;
}
... | java | @SuppressWarnings("unchecked")
public static <T> boolean containsAny(T[] array, T... values) {
for (T value : values) {
if(contains(array, value)) {
return true;
}
}
return false;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"boolean",
"containsAny",
"(",
"T",
"[",
"]",
"array",
",",
"T",
"...",
"values",
")",
"{",
"for",
"(",
"T",
"value",
":",
"values",
")",
"{",
"if",
"(",
"contains... | 数组中是否包含指定元素中的任意一个
@param <T> 数组元素类型
@param array 数组
@param values 被检查的多个元素
@return 是否包含指定元素中的任意一个
@since 4.1.20 | [
"数组中是否包含指定元素中的任意一个"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L970-L978 |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/matching/match/BaseMatch.java | BaseMatch.nCk | protected static long nCk(int n, int k) {
"""
Calculate binomial coefficients (the number of possible "choose k among n")
@param n the total size of the set
@param k the size of the selection
@return the binomial coefficient
"""
if (k > n)
{
return 0;
}
long res... | java | protected static long nCk(int n, int k)
{
if (k > n)
{
return 0;
}
long result = 1;
for (int i = 1; i <= k; i++)
{
result *= n--;
result /= i;
}
return result;
} | [
"protected",
"static",
"long",
"nCk",
"(",
"int",
"n",
",",
"int",
"k",
")",
"{",
"if",
"(",
"k",
">",
"n",
")",
"{",
"return",
"0",
";",
"}",
"long",
"result",
"=",
"1",
";",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<=",
"k",
";",
"i... | Calculate binomial coefficients (the number of possible "choose k among n")
@param n the total size of the set
@param k the size of the selection
@return the binomial coefficient | [
"Calculate",
"binomial",
"coefficients",
"(",
"the",
"number",
"of",
"possible",
"choose",
"k",
"among",
"n",
")"
] | train | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/matching/match/BaseMatch.java#L70-L83 |
demidenko05/beige-uml | beige-android-lib/src/main/java/org/beigesoft/android/ui/widget/FileChooserAdaptor.java | FileChooserAdaptor.showAndChoose | @Override
public void showAndChoose(IConsumer<File> consumer) {
"""
You must provide fileFilter, idFolderStart and title to invoke it!
"""
this.consumer = consumer;
initSrvNodeFile();
Intent activityTreeIntent = new Intent(activity, ActivityTreeChooser.class);
activityTreeIntent.putExtra(Frag... | java | @Override
public void showAndChoose(IConsumer<File> consumer) {
this.consumer = consumer;
initSrvNodeFile();
Intent activityTreeIntent = new Intent(activity, ActivityTreeChooser.class);
activityTreeIntent.putExtra(FragmentNodes.ARG_ID_NODE_SRVNODES, new String[]{idFolderStart, idSrvGetNodeFile, idComm... | [
"@",
"Override",
"public",
"void",
"showAndChoose",
"(",
"IConsumer",
"<",
"File",
">",
"consumer",
")",
"{",
"this",
".",
"consumer",
"=",
"consumer",
";",
"initSrvNodeFile",
"(",
")",
";",
"Intent",
"activityTreeIntent",
"=",
"new",
"Intent",
"(",
"activit... | You must provide fileFilter, idFolderStart and title to invoke it! | [
"You",
"must",
"provide",
"fileFilter",
"idFolderStart",
"and",
"title",
"to",
"invoke",
"it!"
] | train | https://github.com/demidenko05/beige-uml/blob/65f6024fa944e10875d9a3be3e4a586bede39683/beige-android-lib/src/main/java/org/beigesoft/android/ui/widget/FileChooserAdaptor.java#L56-L63 |
graphql-java/graphql-java | src/main/java/graphql/execution/NonNullableFieldValidator.java | NonNullableFieldValidator.validate | public <T> T validate(ExecutionPath path, T result) throws NonNullableFieldWasNullException {
"""
Called to check that a value is non null if the type requires it to be non null
@param path the path to this place
@param result the result to check
@param <T> the type of the result
@return the result ba... | java | public <T> T validate(ExecutionPath path, T result) throws NonNullableFieldWasNullException {
if (result == null) {
if (executionStepInfo.isNonNullType()) {
// see http://facebook.github.io/graphql/#sec-Errors-and-Non-Nullability
//
// > If the fiel... | [
"public",
"<",
"T",
">",
"T",
"validate",
"(",
"ExecutionPath",
"path",
",",
"T",
"result",
")",
"throws",
"NonNullableFieldWasNullException",
"{",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"if",
"(",
"executionStepInfo",
".",
"isNonNullType",
"(",
")",
... | Called to check that a value is non null if the type requires it to be non null
@param path the path to this place
@param result the result to check
@param <T> the type of the result
@return the result back
@throws NonNullableFieldWasNullException if the value is null but the type requires it to be non null | [
"Called",
"to",
"check",
"that",
"a",
"value",
"is",
"non",
"null",
"if",
"the",
"type",
"requires",
"it",
"to",
"be",
"non",
"null"
] | train | https://github.com/graphql-java/graphql-java/blob/9214b6044317849388bd88a14b54fc1c18c9f29f/src/main/java/graphql/execution/NonNullableFieldValidator.java#L34-L55 |
facebook/fresco | imagepipeline-base/src/main/java/com/facebook/imageformat/DefaultImageFormatChecker.java | DefaultImageFormatChecker.isGifHeader | private static boolean isGifHeader(final byte[] imageHeaderBytes, final int headerSize) {
"""
Checks if first headerSize bytes of imageHeaderBytes constitute a valid header for a gif image.
Details on GIF header can be found <a href="http://www.w3.org/Graphics/GIF/spec-gif89a.txt">
on page 7</a>
@param imageHea... | java | private static boolean isGifHeader(final byte[] imageHeaderBytes, final int headerSize) {
if (headerSize < GIF_HEADER_LENGTH) {
return false;
}
return ImageFormatCheckerUtils.startsWithPattern(imageHeaderBytes, GIF_HEADER_87A) ||
ImageFormatCheckerUtils.startsWithPattern(imageHeaderBytes, GIF_... | [
"private",
"static",
"boolean",
"isGifHeader",
"(",
"final",
"byte",
"[",
"]",
"imageHeaderBytes",
",",
"final",
"int",
"headerSize",
")",
"{",
"if",
"(",
"headerSize",
"<",
"GIF_HEADER_LENGTH",
")",
"{",
"return",
"false",
";",
"}",
"return",
"ImageFormatChec... | Checks if first headerSize bytes of imageHeaderBytes constitute a valid header for a gif image.
Details on GIF header can be found <a href="http://www.w3.org/Graphics/GIF/spec-gif89a.txt">
on page 7</a>
@param imageHeaderBytes
@param headerSize
@return true if imageHeaderBytes is a valid header for a gif image | [
"Checks",
"if",
"first",
"headerSize",
"bytes",
"of",
"imageHeaderBytes",
"constitute",
"a",
"valid",
"header",
"for",
"a",
"gif",
"image",
".",
"Details",
"on",
"GIF",
"header",
"can",
"be",
"found",
"<a",
"href",
"=",
"http",
":",
"//",
"www",
".",
"w3... | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline-base/src/main/java/com/facebook/imageformat/DefaultImageFormatChecker.java#L190-L196 |
infinispan/infinispan | query/src/main/java/org/infinispan/query/indexmanager/AbstractUpdateCommand.java | AbstractUpdateCommand.setCacheManager | @Override
public void setCacheManager(EmbeddedCacheManager cm) {
"""
This is invoked only on the receiving node, before {@link #perform(org.infinispan.context.InvocationContext)}.
"""
String name = cacheName.toString();
if (cm.cacheExists(name)) {
Cache cache = cm.getCache(name);
... | java | @Override
public void setCacheManager(EmbeddedCacheManager cm) {
String name = cacheName.toString();
if (cm.cacheExists(name)) {
Cache cache = cm.getCache(name);
searchFactory = ComponentRegistryUtils.getSearchIntegrator(cache);
queryInterceptor = ComponentRegistryUtils.getQuer... | [
"@",
"Override",
"public",
"void",
"setCacheManager",
"(",
"EmbeddedCacheManager",
"cm",
")",
"{",
"String",
"name",
"=",
"cacheName",
".",
"toString",
"(",
")",
";",
"if",
"(",
"cm",
".",
"cacheExists",
"(",
"name",
")",
")",
"{",
"Cache",
"cache",
"=",... | This is invoked only on the receiving node, before {@link #perform(org.infinispan.context.InvocationContext)}. | [
"This",
"is",
"invoked",
"only",
"on",
"the",
"receiving",
"node",
"before",
"{"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/query/src/main/java/org/infinispan/query/indexmanager/AbstractUpdateCommand.java#L71-L81 |
PureSolTechnologies/parsers | parsers/src/main/java/com/puresoltechnologies/parsers/parser/packrat/PackratParser.java | PackratParser.processTerminal | private MemoEntry processTerminal(ParseTreeNode node, Terminal terminal, int position, int line)
throws TreeException {
"""
This method processes a single terminal. This method uses
processTokenDefinition to do this. The information to be put into that method
is extracted and prepared here.
@param node
... | java | private MemoEntry processTerminal(ParseTreeNode node, Terminal terminal, int position, int line)
throws TreeException {
printMessage("applyTerminal: " + terminal, position, line);
TokenDefinitionSet tokenDefinitions = grammar.getTokenDefinitions();
TokenDefinition tokenDefinition = tokenDefinitions.getDefinitio... | [
"private",
"MemoEntry",
"processTerminal",
"(",
"ParseTreeNode",
"node",
",",
"Terminal",
"terminal",
",",
"int",
"position",
",",
"int",
"line",
")",
"throws",
"TreeException",
"{",
"printMessage",
"(",
"\"applyTerminal: \"",
"+",
"terminal",
",",
"position",
","... | This method processes a single terminal. This method uses
processTokenDefinition to do this. The information to be put into that method
is extracted and prepared here.
@param node
@param terminal
@param position
@return
@throws TreeException | [
"This",
"method",
"processes",
"a",
"single",
"terminal",
".",
"This",
"method",
"uses",
"processTokenDefinition",
"to",
"do",
"this",
".",
"The",
"information",
"to",
"be",
"put",
"into",
"that",
"method",
"is",
"extracted",
"and",
"prepared",
"here",
"."
] | train | https://github.com/PureSolTechnologies/parsers/blob/61077223b90d3768ff9445ae13036343c98b63cd/parsers/src/main/java/com/puresoltechnologies/parsers/parser/packrat/PackratParser.java#L631-L642 |
foundation-runtime/service-directory | 2.0/sd-core/src/main/java/com/cisco/oss/foundation/directory/utils/WebSocketSerializer.java | WebSocketSerializer.serializeProtocol | private static String serializeProtocol(ProtocolHeader header, Protocol protocol) throws JsonGenerationException, JsonMappingException, IOException {
"""
Serialize the Protocol to JSON String.
@param header
the ProtocolHeader.
@param protocol
the Protocol.
@return
the JSON String.
@throws JsonGenerationEx... | java | private static String serializeProtocol(ProtocolHeader header, Protocol protocol) throws JsonGenerationException, JsonMappingException, IOException{
ProtocolPair p = new ProtocolPair();
p.setProtocolHeader(header);
if(protocol == null){
p.setType(null);
} else {
p... | [
"private",
"static",
"String",
"serializeProtocol",
"(",
"ProtocolHeader",
"header",
",",
"Protocol",
"protocol",
")",
"throws",
"JsonGenerationException",
",",
"JsonMappingException",
",",
"IOException",
"{",
"ProtocolPair",
"p",
"=",
"new",
"ProtocolPair",
"(",
")",... | Serialize the Protocol to JSON String.
@param header
the ProtocolHeader.
@param protocol
the Protocol.
@return
the JSON String.
@throws JsonGenerationException
@throws JsonMappingException
@throws IOException | [
"Serialize",
"the",
"Protocol",
"to",
"JSON",
"String",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-core/src/main/java/com/cisco/oss/foundation/directory/utils/WebSocketSerializer.java#L198-L208 |
Talend/tesb-rt-se | locator-service/locator-rest-service/src/main/java/org/talend/esb/locator/service/rest/LocatorRestServiceImpl.java | LocatorRestServiceImpl.registerEndpoint | public void registerEndpoint(RegisterEndpointRequest arg0) {
"""
Register the endpoint for given service.
@param input
RegisterEndpointRequestType encapsulate name of service and
endpointURL. Must not be <code>null</code>
"""
String endpointURL = arg0.getEndpointURL();
QName serviceName = ... | java | public void registerEndpoint(RegisterEndpointRequest arg0) {
String endpointURL = arg0.getEndpointURL();
QName serviceName = QName.valueOf(arg0.getServiceName());
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("Registering endpoint " + endpointURL + " for service "
+ ... | [
"public",
"void",
"registerEndpoint",
"(",
"RegisterEndpointRequest",
"arg0",
")",
"{",
"String",
"endpointURL",
"=",
"arg0",
".",
"getEndpointURL",
"(",
")",
";",
"QName",
"serviceName",
"=",
"QName",
".",
"valueOf",
"(",
"arg0",
".",
"getServiceName",
"(",
"... | Register the endpoint for given service.
@param input
RegisterEndpointRequestType encapsulate name of service and
endpointURL. Must not be <code>null</code> | [
"Register",
"the",
"endpoint",
"for",
"given",
"service",
"."
] | train | https://github.com/Talend/tesb-rt-se/blob/0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886/locator-service/locator-rest-service/src/main/java/org/talend/esb/locator/service/rest/LocatorRestServiceImpl.java#L175-L210 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/FunctionSQL.java | FunctionSQL.getValue | @Override
public Object getValue(Session session) {
"""
Evaluates and returns this Function in the context of the session.<p>
"""
Object[] data = new Object[nodes.length];
for (int i = 0; i < nodes.length; i++) {
Expression e = nodes[i];
if (e != null) {
... | java | @Override
public Object getValue(Session session) {
Object[] data = new Object[nodes.length];
for (int i = 0; i < nodes.length; i++) {
Expression e = nodes[i];
if (e != null) {
data[i] = e.getValue(session, e.dataType);
}
}
retu... | [
"@",
"Override",
"public",
"Object",
"getValue",
"(",
"Session",
"session",
")",
"{",
"Object",
"[",
"]",
"data",
"=",
"new",
"Object",
"[",
"nodes",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"nodes",
".",
"length",
... | Evaluates and returns this Function in the context of the session.<p> | [
"Evaluates",
"and",
"returns",
"this",
"Function",
"in",
"the",
"context",
"of",
"the",
"session",
".",
"<p",
">"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/FunctionSQL.java#L677-L691 |
hageldave/ImagingKit | ImagingKit_Fourier/src/main/java/hageldave/imagingkit/fourier/ComplexImg.java | ComplexImg.copyArea | public ComplexImg copyArea(int x, int y, int w, int h, ComplexImg dest, int destX, int destY) {
"""
See {@link ColorImg#copyArea(int, int, int, int, ColorImg, int, int)}
@param x area origin in this image (x-coordinate)
@param y area origin in this image (y-coordinate)
@param w width of area
@param h height ... | java | public ComplexImg copyArea(int x, int y, int w, int h, ComplexImg dest, int destX, int destY) {
if(dest == null){
dest = new ComplexImg(w, h);
}
delegate.copyArea(x, y, w, h, dest.delegate, destX, destY);
if(dest.isSynchronizePowerSpectrum()){
dest.recomputePowerChannel();
}
return dest;
} | [
"public",
"ComplexImg",
"copyArea",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"w",
",",
"int",
"h",
",",
"ComplexImg",
"dest",
",",
"int",
"destX",
",",
"int",
"destY",
")",
"{",
"if",
"(",
"dest",
"==",
"null",
")",
"{",
"dest",
"=",
"new",
... | See {@link ColorImg#copyArea(int, int, int, int, ColorImg, int, int)}
@param x area origin in this image (x-coordinate)
@param y area origin in this image (y-coordinate)
@param w width of area
@param h height of area
@param dest destination image
@param destX area origin in destination image (x-coordinate)
@param dest... | [
"See",
"{",
"@link",
"ColorImg#copyArea",
"(",
"int",
"int",
"int",
"int",
"ColorImg",
"int",
"int",
")",
"}"
] | train | https://github.com/hageldave/ImagingKit/blob/3837c7d550a12cf4dc5718b644ced94b97f52668/ImagingKit_Fourier/src/main/java/hageldave/imagingkit/fourier/ComplexImg.java#L579-L588 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/servlet/RendererRequestUtils.java | RendererRequestUtils.getContextPathOverride | private static String getContextPathOverride(boolean isSslRequest, JawrConfig config) {
"""
Returns the context path depending on the request mode (SSL or not)
@param isSslRequest
the flag indicating that the request is an SSL request
@return the context path depending on the request mode
"""
String con... | java | private static String getContextPathOverride(boolean isSslRequest, JawrConfig config) {
String contextPathOverride = null;
if (isSslRequest) {
contextPathOverride = config.getContextPathSslOverride();
} else {
contextPathOverride = config.getContextPathOverride();
}
return contextPathOverride;
} | [
"private",
"static",
"String",
"getContextPathOverride",
"(",
"boolean",
"isSslRequest",
",",
"JawrConfig",
"config",
")",
"{",
"String",
"contextPathOverride",
"=",
"null",
";",
"if",
"(",
"isSslRequest",
")",
"{",
"contextPathOverride",
"=",
"config",
".",
"getC... | Returns the context path depending on the request mode (SSL or not)
@param isSslRequest
the flag indicating that the request is an SSL request
@return the context path depending on the request mode | [
"Returns",
"the",
"context",
"path",
"depending",
"on",
"the",
"request",
"mode",
"(",
"SSL",
"or",
"not",
")"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/servlet/RendererRequestUtils.java#L361-L369 |
fuinorg/objects4j | src/main/java/org/fuin/objects4j/vo/DayOpeningHours.java | DayOpeningHours.asRemovedChanges | public List<Change> asRemovedChanges() {
"""
Returns all hour ranges of this day as if they were removed.
@return Removed day changes.
"""
final List<Change> changes = new ArrayList<>();
for (final HourRange hr : hourRanges) {
changes.add(new Change(ChangeType.REMOVED, dayOfTheWe... | java | public List<Change> asRemovedChanges() {
final List<Change> changes = new ArrayList<>();
for (final HourRange hr : hourRanges) {
changes.add(new Change(ChangeType.REMOVED, dayOfTheWeek, hr));
}
return changes;
} | [
"public",
"List",
"<",
"Change",
">",
"asRemovedChanges",
"(",
")",
"{",
"final",
"List",
"<",
"Change",
">",
"changes",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"final",
"HourRange",
"hr",
":",
"hourRanges",
")",
"{",
"changes",
".",
... | Returns all hour ranges of this day as if they were removed.
@return Removed day changes. | [
"Returns",
"all",
"hour",
"ranges",
"of",
"this",
"day",
"as",
"if",
"they",
"were",
"removed",
"."
] | train | https://github.com/fuinorg/objects4j/blob/e7f278b5bae073ebb6a76053650571c718f36246/src/main/java/org/fuin/objects4j/vo/DayOpeningHours.java#L351-L357 |
jwtk/jjwt | api/src/main/java/io/jsonwebtoken/security/Keys.java | Keys.hmacShaKeyFor | public static SecretKey hmacShaKeyFor(byte[] bytes) throws WeakKeyException {
"""
Creates a new SecretKey instance for use with HMAC-SHA algorithms based on the specified key byte array.
@param bytes the key byte array
@return a new SecretKey instance for use with HMAC-SHA algorithms based on the specified key... | java | public static SecretKey hmacShaKeyFor(byte[] bytes) throws WeakKeyException {
if (bytes == null) {
throw new InvalidKeyException("SecretKey byte array cannot be null.");
}
int bitLength = bytes.length * 8;
for (SignatureAlgorithm alg : PREFERRED_HMAC_ALGS) {
if... | [
"public",
"static",
"SecretKey",
"hmacShaKeyFor",
"(",
"byte",
"[",
"]",
"bytes",
")",
"throws",
"WeakKeyException",
"{",
"if",
"(",
"bytes",
"==",
"null",
")",
"{",
"throw",
"new",
"InvalidKeyException",
"(",
"\"SecretKey byte array cannot be null.\"",
")",
";",
... | Creates a new SecretKey instance for use with HMAC-SHA algorithms based on the specified key byte array.
@param bytes the key byte array
@return a new SecretKey instance for use with HMAC-SHA algorithms based on the specified key byte array.
@throws WeakKeyException if the key byte array length is less than 256 bits (... | [
"Creates",
"a",
"new",
"SecretKey",
"instance",
"for",
"use",
"with",
"HMAC",
"-",
"SHA",
"algorithms",
"based",
"on",
"the",
"specified",
"key",
"byte",
"array",
"."
] | train | https://github.com/jwtk/jjwt/blob/86b6096946752cffcfbc9b0a5503f1ea195cc140/api/src/main/java/io/jsonwebtoken/security/Keys.java#L60-L82 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/locale/LocaleUtils.java | LocaleUtils.toBundleName | public static String toBundleName(String bundleBaseName, Locale locale) {
"""
Converts the given <code>baseName</code> and <code>locale</code> to the
bundle name. This method is called from the default implementation of the
{@link #newBundle(String, Locale, String, ClassLoader, boolean)
newBundle} and
{@link #... | java | public static String toBundleName(String bundleBaseName, Locale locale) {
String baseName = bundleBaseName.replace('.', '/');
if (locale == null) {
return baseName;
}
String language = locale.getLanguage();
String country = locale.getCountry();
String variant = locale.getVariant();
if (StringUtils.i... | [
"public",
"static",
"String",
"toBundleName",
"(",
"String",
"bundleBaseName",
",",
"Locale",
"locale",
")",
"{",
"String",
"baseName",
"=",
"bundleBaseName",
".",
"replace",
"(",
"'",
"'",
",",
"'",
"'",
")",
";",
"if",
"(",
"locale",
"==",
"null",
")",... | Converts the given <code>baseName</code> and <code>locale</code> to the
bundle name. This method is called from the default implementation of the
{@link #newBundle(String, Locale, String, ClassLoader, boolean)
newBundle} and
{@link #needsReload(String, Locale, String, ClassLoader, ResourceBundle, long)
needsReload} met... | [
"Converts",
"the",
"given",
"<code",
">",
"baseName<",
"/",
"code",
">",
"and",
"<code",
">",
"locale<",
"/",
"code",
">",
"to",
"the",
"bundle",
"name",
".",
"This",
"method",
"is",
"called",
"from",
"the",
"default",
"implementation",
"of",
"the",
"{",... | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/locale/LocaleUtils.java#L318-L343 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.