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 |
|---|---|---|---|---|---|---|---|---|---|---|
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/thrift/CassandraDefs.java | CassandraDefs.slicePredicateStartEndCol | static SlicePredicate slicePredicateStartEndCol(byte[] startColName, byte[] endColName, int count) {
"""
Create a SlicePredicate that starts at the given column name, selecting up to
{@link #MAX_COLS_BATCH_SIZE} columns.
@param startColName Starting column name as a byte[].
@param endColName Ending column... | java | static SlicePredicate slicePredicateStartEndCol(byte[] startColName, byte[] endColName, int count) {
if(startColName == null) startColName = EMPTY_BYTES;
if(endColName == null) endColName = EMPTY_BYTES;
SliceRange sliceRange =
new SliceRange(ByteBuffer.wrap(startColName), ByteBuf... | [
"static",
"SlicePredicate",
"slicePredicateStartEndCol",
"(",
"byte",
"[",
"]",
"startColName",
",",
"byte",
"[",
"]",
"endColName",
",",
"int",
"count",
")",
"{",
"if",
"(",
"startColName",
"==",
"null",
")",
"startColName",
"=",
"EMPTY_BYTES",
";",
"if",
"... | Create a SlicePredicate that starts at the given column name, selecting up to
{@link #MAX_COLS_BATCH_SIZE} columns.
@param startColName Starting column name as a byte[].
@param endColName Ending column name as a byte[]
@return SlicePredicate that starts at the given starting column name,
ends at the g... | [
"Create",
"a",
"SlicePredicate",
"that",
"starts",
"at",
"the",
"given",
"column",
"name",
"selecting",
"up",
"to",
"{",
"@link",
"#MAX_COLS_BATCH_SIZE",
"}",
"columns",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/thrift/CassandraDefs.java#L173-L181 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/inject/annotation/DefaultAnnotationMetadata.java | DefaultAnnotationMetadata.registerAnnotationDefaults | @SuppressWarnings("unused")
@Internal
@UsedByGeneratedCode
protected static void registerAnnotationDefaults(String annotation, Map<String, Object> defaultValues) {
"""
Registers annotation default values. Used by generated byte code. DO NOT REMOVE.
@param annotation The annotation name
@param defau... | java | @SuppressWarnings("unused")
@Internal
@UsedByGeneratedCode
protected static void registerAnnotationDefaults(String annotation, Map<String, Object> defaultValues) {
AnnotationMetadataSupport.registerDefaultValues(annotation, defaultValues);
} | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"@",
"Internal",
"@",
"UsedByGeneratedCode",
"protected",
"static",
"void",
"registerAnnotationDefaults",
"(",
"String",
"annotation",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"defaultValues",
")",
"{",
"Annot... | Registers annotation default values. Used by generated byte code. DO NOT REMOVE.
@param annotation The annotation name
@param defaultValues The default values | [
"Registers",
"annotation",
"default",
"values",
".",
"Used",
"by",
"generated",
"byte",
"code",
".",
"DO",
"NOT",
"REMOVE",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/annotation/DefaultAnnotationMetadata.java#L510-L515 |
bazaarvoice/emodb | common/astyanax/src/main/java/com/bazaarvoice/emodb/common/cassandra/cqldriver/AdaptiveResultSet.java | AdaptiveResultSet.executeAdaptiveQueryAsync | public static ListenableFuture<ResultSet> executeAdaptiveQueryAsync(Session session, Statement statement, int fetchSize) {
"""
Executes a query asychronously, dynamically adjusting the fetch size down if necessary.
"""
return executeAdaptiveQueryAsync(session, statement, fetchSize, MAX_ADAPTATIONS);
... | java | public static ListenableFuture<ResultSet> executeAdaptiveQueryAsync(Session session, Statement statement, int fetchSize) {
return executeAdaptiveQueryAsync(session, statement, fetchSize, MAX_ADAPTATIONS);
} | [
"public",
"static",
"ListenableFuture",
"<",
"ResultSet",
">",
"executeAdaptiveQueryAsync",
"(",
"Session",
"session",
",",
"Statement",
"statement",
",",
"int",
"fetchSize",
")",
"{",
"return",
"executeAdaptiveQueryAsync",
"(",
"session",
",",
"statement",
",",
"fe... | Executes a query asychronously, dynamically adjusting the fetch size down if necessary. | [
"Executes",
"a",
"query",
"asychronously",
"dynamically",
"adjusting",
"the",
"fetch",
"size",
"down",
"if",
"necessary",
"."
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/astyanax/src/main/java/com/bazaarvoice/emodb/common/cassandra/cqldriver/AdaptiveResultSet.java#L51-L53 |
Whiley/WhileyCompiler | src/main/java/wyil/transform/VerificationConditionGenerator.java | VerificationConditionGenerator.translateAssume | private Context translateAssume(WyilFile.Stmt.Assume stmt, Context context) {
"""
Translate an assume statement. This simply updates the current context to
assume that the given condition holds true (i.e. regardless of whether it
does or not). The purpose of assume statements is to allow some level of
interacti... | java | private Context translateAssume(WyilFile.Stmt.Assume stmt, Context context) {
Pair<Expr, Context> p = translateExpressionWithChecks(stmt.getCondition(), null, context);
Expr condition = p.first();
context = p.second();
return context.assume(condition);
} | [
"private",
"Context",
"translateAssume",
"(",
"WyilFile",
".",
"Stmt",
".",
"Assume",
"stmt",
",",
"Context",
"context",
")",
"{",
"Pair",
"<",
"Expr",
",",
"Context",
">",
"p",
"=",
"translateExpressionWithChecks",
"(",
"stmt",
".",
"getCondition",
"(",
")"... | Translate an assume statement. This simply updates the current context to
assume that the given condition holds true (i.e. regardless of whether it
does or not). The purpose of assume statements is to allow some level of
interaction between the programmer and the verifier. That is, the programmer
can assume things whic... | [
"Translate",
"an",
"assume",
"statement",
".",
"This",
"simply",
"updates",
"the",
"current",
"context",
"to",
"assume",
"that",
"the",
"given",
"condition",
"holds",
"true",
"(",
"i",
".",
"e",
".",
"regardless",
"of",
"whether",
"it",
"does",
"or",
"not"... | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/transform/VerificationConditionGenerator.java#L730-L735 |
baasbox/Android-SDK | library/src/main/java/com/baasbox/android/BaasAsset.java | BaasAsset.fetchData | public static RequestToken fetchData(String id, int flags, BaasHandler<JsonObject> handler) {
"""
Asynchronously retrieves named assets data,
If the named asset is a document, the document is retrieved
otherwise attached data to the file are returned.
@param id the name of the asset
@param flags used for the... | java | public static RequestToken fetchData(String id, int flags, BaasHandler<JsonObject> handler){
if(id==null) throw new IllegalArgumentException("asset id cannot be null");
BaasBox box = BaasBox.getDefaultChecked();
AssetDataRequest req = new AssetDataRequest(box,id,flags,handler);
return bo... | [
"public",
"static",
"RequestToken",
"fetchData",
"(",
"String",
"id",
",",
"int",
"flags",
",",
"BaasHandler",
"<",
"JsonObject",
">",
"handler",
")",
"{",
"if",
"(",
"id",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"asset id cannot ... | Asynchronously retrieves named assets data,
If the named asset is a document, the document is retrieved
otherwise attached data to the file are returned.
@param id the name of the asset
@param flags used for the request a bit or of {@link RequestOptions} constants
@param handler an handler that will be handed the resp... | [
"Asynchronously",
"retrieves",
"named",
"assets",
"data",
"If",
"the",
"named",
"asset",
"is",
"a",
"document",
"the",
"document",
"is",
"retrieved",
"otherwise",
"attached",
"data",
"to",
"the",
"file",
"are",
"returned",
"."
] | train | https://github.com/baasbox/Android-SDK/blob/6bb2203246b885b2ad63a7bfaf37c83caf15e0d8/library/src/main/java/com/baasbox/android/BaasAsset.java#L55-L60 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/XYCurve.java | XYCurve.addAndSimplify | public void addAndSimplify(double x, double y) {
"""
Add a coordinate pair, performing curve simplification if possible.
@param x X coordinate
@param y Y coordinate
"""
// simplify curve when possible:
final int len = data.size();
if (len >= 4) {
// Look at the previous 2 points
fin... | java | public void addAndSimplify(double x, double y) {
// simplify curve when possible:
final int len = data.size();
if (len >= 4) {
// Look at the previous 2 points
final double l1x = data.get(len - 4);
final double l1y = data.get(len - 3);
final double l2x = data.get(len - 2);
fina... | [
"public",
"void",
"addAndSimplify",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"// simplify curve when possible:",
"final",
"int",
"len",
"=",
"data",
".",
"size",
"(",
")",
";",
"if",
"(",
"len",
">=",
"4",
")",
"{",
"// Look at the previous 2 points... | Add a coordinate pair, performing curve simplification if possible.
@param x X coordinate
@param y Y coordinate | [
"Add",
"a",
"coordinate",
"pair",
"performing",
"curve",
"simplification",
"if",
"possible",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/XYCurve.java#L149-L179 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/TimeFinder.java | TimeFinder.findAdjacentCue | private CueList.Entry findAdjacentCue(CdjStatus update, BeatGrid beatGrid) {
"""
Checks whether a CDJ status update seems to be close enough to a cue that if we just jumped there (or just
loaded the track) it would be a reasonable assumption that we jumped to the cue.
@param update the status update to check f... | java | private CueList.Entry findAdjacentCue(CdjStatus update, BeatGrid beatGrid) {
if (!MetadataFinder.getInstance().isRunning()) return null;
final TrackMetadata metadata = MetadataFinder.getInstance().getLatestMetadataFor(update);
final int newBeat = update.getBeatNumber();
if (metadata != n... | [
"private",
"CueList",
".",
"Entry",
"findAdjacentCue",
"(",
"CdjStatus",
"update",
",",
"BeatGrid",
"beatGrid",
")",
"{",
"if",
"(",
"!",
"MetadataFinder",
".",
"getInstance",
"(",
")",
".",
"isRunning",
"(",
")",
")",
"return",
"null",
";",
"final",
"Trac... | Checks whether a CDJ status update seems to be close enough to a cue that if we just jumped there (or just
loaded the track) it would be a reasonable assumption that we jumped to the cue.
@param update the status update to check for proximity to hot cues and memory points
@param beatGrid the beat grid of the track be... | [
"Checks",
"whether",
"a",
"CDJ",
"status",
"update",
"seems",
"to",
"be",
"close",
"enough",
"to",
"a",
"cue",
"that",
"if",
"we",
"just",
"jumped",
"there",
"(",
"or",
"just",
"loaded",
"the",
"track",
")",
"it",
"would",
"be",
"a",
"reasonable",
"ass... | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/TimeFinder.java#L171-L187 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/ArrayEquals.java | ArrayEquals.matchMethodInvocation | @Override
public Description matchMethodInvocation(MethodInvocationTree t, VisitorState state) {
"""
Suggests replacing with Arrays.equals(a, b). Also adds the necessary import statement for
java.util.Arrays.
"""
String arg1;
String arg2;
if (instanceEqualsMatcher.matches(t, state)) {
arg1... | java | @Override
public Description matchMethodInvocation(MethodInvocationTree t, VisitorState state) {
String arg1;
String arg2;
if (instanceEqualsMatcher.matches(t, state)) {
arg1 = state.getSourceForNode(((JCFieldAccess) t.getMethodSelect()).getExpression());
arg2 = state.getSourceForNode(t.getArg... | [
"@",
"Override",
"public",
"Description",
"matchMethodInvocation",
"(",
"MethodInvocationTree",
"t",
",",
"VisitorState",
"state",
")",
"{",
"String",
"arg1",
";",
"String",
"arg2",
";",
"if",
"(",
"instanceEqualsMatcher",
".",
"matches",
"(",
"t",
",",
"state",... | Suggests replacing with Arrays.equals(a, b). Also adds the necessary import statement for
java.util.Arrays. | [
"Suggests",
"replacing",
"with",
"Arrays",
".",
"equals",
"(",
"a",
"b",
")",
".",
"Also",
"adds",
"the",
"necessary",
"import",
"statement",
"for",
"java",
".",
"util",
".",
"Arrays",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/ArrayEquals.java#L58-L78 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java | CommonOps_DDRM.solveSPD | public static boolean solveSPD( DMatrixRMaj A , DMatrixRMaj b , DMatrixRMaj x ) {
"""
<p>
Linear solver for systems which are symmetric positive definite.<br>
A*x = b
</p>
@see UnrolledCholesky_DDRM
@see LinearSolverFactory_DDRM
@param A A matrix that is n by n and SPD. Not modified.
@param b A matrix t... | java | public static boolean solveSPD( DMatrixRMaj A , DMatrixRMaj b , DMatrixRMaj x )
{
if( A.numRows != A.numCols )
throw new IllegalArgumentException("Must be a square matrix");
x.reshape(A.numCols,b.numCols);
if( A.numRows <= UnrolledCholesky_DDRM.MAX ) {
DMatrixRMaj L... | [
"public",
"static",
"boolean",
"solveSPD",
"(",
"DMatrixRMaj",
"A",
",",
"DMatrixRMaj",
"b",
",",
"DMatrixRMaj",
"x",
")",
"{",
"if",
"(",
"A",
".",
"numRows",
"!=",
"A",
".",
"numCols",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Must be a squa... | <p>
Linear solver for systems which are symmetric positive definite.<br>
A*x = b
</p>
@see UnrolledCholesky_DDRM
@see LinearSolverFactory_DDRM
@param A A matrix that is n by n and SPD. Not modified.
@param b A matrix that is n by k. Not modified.
@param x A matrix that is n by k. Modified.
@return true if it could in... | [
"<p",
">",
"Linear",
"solver",
"for",
"systems",
"which",
"are",
"symmetric",
"positive",
"definite",
".",
"<br",
">",
"A",
"*",
"x",
"=",
"b",
"<",
"/",
"p",
">"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java#L568-L603 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/digest/_apacheCommonsCodec/Base64.java | Base64.readResults | int readResults(byte[] b, int bPos, int bAvail) {
"""
Extracts buffered data into the provided byte[] array, starting at position bPos, up to a maximum of bAvail
bytes. Returns how many bytes were actually extracted.
@param b
byte[] array to extract the buffered data into.
@param bPos
position in byte[] arr... | java | int readResults(byte[] b, int bPos, int bAvail) {
if (buffer != null) {
int len = Math.min(avail(), bAvail);
if (buffer != b) {
System.arraycopy(buffer, readPos, b, bPos, len);
readPos += len;
if (readPos >= pos) {
buffe... | [
"int",
"readResults",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"bPos",
",",
"int",
"bAvail",
")",
"{",
"if",
"(",
"buffer",
"!=",
"null",
")",
"{",
"int",
"len",
"=",
"Math",
".",
"min",
"(",
"avail",
"(",
")",
",",
"bAvail",
")",
";",
"if",
"... | Extracts buffered data into the provided byte[] array, starting at position bPos, up to a maximum of bAvail
bytes. Returns how many bytes were actually extracted.
@param b
byte[] array to extract the buffered data into.
@param bPos
position in byte[] array to start extraction at.
@param bAvail
amount of bytes we're al... | [
"Extracts",
"buffered",
"data",
"into",
"the",
"provided",
"byte",
"[]",
"array",
"starting",
"at",
"position",
"bPos",
"up",
"to",
"a",
"maximum",
"of",
"bAvail",
"bytes",
".",
"Returns",
"how",
"many",
"bytes",
"were",
"actually",
"extracted",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/digest/_apacheCommonsCodec/Base64.java#L389-L406 |
Scalified/fab | fab/src/main/java/com/scalified/fab/ActionButton.java | ActionButton.drawElevation | @TargetApi(Build.VERSION_CODES.LOLLIPOP)
protected void drawElevation() {
"""
Draws the elevation around the main circle
<p>
Stroke corrective is used due to ambiguity in drawing stroke in
combination with elevation enabled (for API 21 and higher only.
In such case there is no possibility to determine the acc... | java | @TargetApi(Build.VERSION_CODES.LOLLIPOP)
protected void drawElevation() {
float halfSize = getSize() / 2;
final int left = (int) (calculateCenterX() - halfSize);
final int top = (int) (calculateCenterY() - halfSize);
final int right = (int) (calculateCenterX() + halfSize);
final int bottom = (int) (calculate... | [
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"LOLLIPOP",
")",
"protected",
"void",
"drawElevation",
"(",
")",
"{",
"float",
"halfSize",
"=",
"getSize",
"(",
")",
"/",
"2",
";",
"final",
"int",
"left",
"=",
"(",
"int",
")",
"(",
"calculate... | Draws the elevation around the main circle
<p>
Stroke corrective is used due to ambiguity in drawing stroke in
combination with elevation enabled (for API 21 and higher only.
In such case there is no possibility to determine the accurate
<b>Action Button</b> size, so width and height must be corrected
<p>
This logic ma... | [
"Draws",
"the",
"elevation",
"around",
"the",
"main",
"circle",
"<p",
">",
"Stroke",
"corrective",
"is",
"used",
"due",
"to",
"ambiguity",
"in",
"drawing",
"stroke",
"in",
"combination",
"with",
"elevation",
"enabled",
"(",
"for",
"API",
"21",
"and",
"higher... | train | https://github.com/Scalified/fab/blob/0fc001e2f21223871d05d28b192a32ea70726884/fab/src/main/java/com/scalified/fab/ActionButton.java#L1545-L1560 |
eFaps/eFaps-Kernel | src/main/java/org/efaps/admin/ui/AbstractUserInterfaceObject.java | AbstractUserInterfaceObject.hasAccess | public boolean hasAccess(final TargetMode _targetMode,
final Instance _instance)
throws EFapsException {
"""
Check, if the user of the context has access to this user interface
object. <br>
The Check is made in the following order: <br>
<ol>
<li>If no access User or role is... | java | public boolean hasAccess(final TargetMode _targetMode,
final Instance _instance)
throws EFapsException
{
return hasAccess(_targetMode, _instance, null, null);
} | [
"public",
"boolean",
"hasAccess",
"(",
"final",
"TargetMode",
"_targetMode",
",",
"final",
"Instance",
"_instance",
")",
"throws",
"EFapsException",
"{",
"return",
"hasAccess",
"(",
"_targetMode",
",",
"_instance",
",",
"null",
",",
"null",
")",
";",
"}"
] | Check, if the user of the context has access to this user interface
object. <br>
The Check is made in the following order: <br>
<ol>
<li>If no access User or role is assigned to this user interface object,
all user have access and the return is <i>true</i> => go on with Step 3</li>
<li>else check if the context person ... | [
"Check",
"if",
"the",
"user",
"of",
"the",
"context",
"has",
"access",
"to",
"this",
"user",
"interface",
"object",
".",
"<br",
">",
"The",
"Check",
"is",
"made",
"in",
"the",
"following",
"order",
":",
"<br",
">",
"<ol",
">",
"<li",
">",
"If",
"no",... | train | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/admin/ui/AbstractUserInterfaceObject.java#L202-L207 |
datacleaner/DataCleaner | engine/xml-config/src/main/java/org/datacleaner/configuration/JaxbConfigurationReader.java | JaxbConfigurationReader.createCustomElement | private <E> E createCustomElement(final CustomElementType customElementType, final Class<E> expectedClazz,
final DataCleanerConfiguration configuration, final boolean initialize) {
"""
Creates a custom component based on an element which specified just a class name and an optional set of
properties.
... | java | private <E> E createCustomElement(final CustomElementType customElementType, final Class<E> expectedClazz,
final DataCleanerConfiguration configuration, final boolean initialize) {
final InjectionManager injectionManager =
configuration.getEnvironment().getInjectionManagerFactory().g... | [
"private",
"<",
"E",
">",
"E",
"createCustomElement",
"(",
"final",
"CustomElementType",
"customElementType",
",",
"final",
"Class",
"<",
"E",
">",
"expectedClazz",
",",
"final",
"DataCleanerConfiguration",
"configuration",
",",
"final",
"boolean",
"initialize",
")"... | Creates a custom component based on an element which specified just a class name and an optional set of
properties.
@param <E>
@param customElementType the JAXB custom element type
@param expectedClazz an expected class or interface that the component should honor
@param configuration the DataCleaner configuration (ma... | [
"Creates",
"a",
"custom",
"component",
"based",
"on",
"an",
"element",
"which",
"specified",
"just",
"a",
"class",
"name",
"and",
"an",
"optional",
"set",
"of",
"properties",
"."
] | train | https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/engine/xml-config/src/main/java/org/datacleaner/configuration/JaxbConfigurationReader.java#L1563-L1568 |
h2oai/h2o-2 | src/main/java/water/Model.java | Model.score | public final float[] score( String names[], String domains[][], boolean exact, double row[] ) {
"""
Single row scoring, on a compatible set of data. Fairly expensive to adapt.
"""
return score(adapt(names,domains,exact),row,new float[nclasses()]);
} | java | public final float[] score( String names[], String domains[][], boolean exact, double row[] ) {
return score(adapt(names,domains,exact),row,new float[nclasses()]);
} | [
"public",
"final",
"float",
"[",
"]",
"score",
"(",
"String",
"names",
"[",
"]",
",",
"String",
"domains",
"[",
"]",
"[",
"]",
",",
"boolean",
"exact",
",",
"double",
"row",
"[",
"]",
")",
"{",
"return",
"score",
"(",
"adapt",
"(",
"names",
",",
... | Single row scoring, on a compatible set of data. Fairly expensive to adapt. | [
"Single",
"row",
"scoring",
"on",
"a",
"compatible",
"set",
"of",
"data",
".",
"Fairly",
"expensive",
"to",
"adapt",
"."
] | train | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Model.java#L296-L298 |
jqm4gwt/jqm4gwt | library/src/main/java/com/sksamuel/jqm4gwt/form/JQMForm.java | JQMForm.validate | protected boolean validate(Validator validator, UIObject ui) {
"""
Perform validation for a single validator
@param ui the {@link UIObject} to change the stylesheet on
@return true if this validator was successfully applied or false otherwise
"""
if (notifiedWidgets.containsKey(validator))
... | java | protected boolean validate(Validator validator, UIObject ui) {
if (notifiedWidgets.containsKey(validator))
ui = notifiedWidgets.get(validator);
String msg = validator.validate();
if (msg == null || msg.length() == 0) {
validationStyles(validator, null, ui, true);
... | [
"protected",
"boolean",
"validate",
"(",
"Validator",
"validator",
",",
"UIObject",
"ui",
")",
"{",
"if",
"(",
"notifiedWidgets",
".",
"containsKey",
"(",
"validator",
")",
")",
"ui",
"=",
"notifiedWidgets",
".",
"get",
"(",
"validator",
")",
";",
"String",
... | Perform validation for a single validator
@param ui the {@link UIObject} to change the stylesheet on
@return true if this validator was successfully applied or false otherwise | [
"Perform",
"validation",
"for",
"a",
"single",
"validator"
] | train | https://github.com/jqm4gwt/jqm4gwt/blob/cf59958e9ba6d4b70f42507b2c77f10c2465085b/library/src/main/java/com/sksamuel/jqm4gwt/form/JQMForm.java#L578-L591 |
openbase/jul | exception/src/main/java/org/openbase/jul/exception/printer/ExceptionPrinter.java | ExceptionPrinter.printHistory | public static <T extends Throwable> void printHistory(final String message, final T th, final PrintStream stream) {
"""
Print Exception messages without stack trace in non debug mode. Method prints recursive all messages of the given exception stack to get a history overview of the causes. In verbose mode (app
-v... | java | public static <T extends Throwable> void printHistory(final String message, final T th, final PrintStream stream) {
printHistory(new CouldNotPerformException(message, th), new SystemPrinter(stream));
} | [
"public",
"static",
"<",
"T",
"extends",
"Throwable",
">",
"void",
"printHistory",
"(",
"final",
"String",
"message",
",",
"final",
"T",
"th",
",",
"final",
"PrintStream",
"stream",
")",
"{",
"printHistory",
"(",
"new",
"CouldNotPerformException",
"(",
"messag... | Print Exception messages without stack trace in non debug mode. Method prints recursive all messages of the given exception stack to get a history overview of the causes. In verbose mode (app
-v) the stacktrace is printed in the end of history. The given message and the exception are bundled as new CouldNotPerformExcep... | [
"Print",
"Exception",
"messages",
"without",
"stack",
"trace",
"in",
"non",
"debug",
"mode",
".",
"Method",
"prints",
"recursive",
"all",
"messages",
"of",
"the",
"given",
"exception",
"stack",
"to",
"get",
"a",
"history",
"overview",
"of",
"the",
"causes",
... | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/exception/src/main/java/org/openbase/jul/exception/printer/ExceptionPrinter.java#L237-L239 |
alkacon/opencms-core | src/org/opencms/ui/apps/resourcetypes/CmsResourceTypesTable.java | CmsResourceTypesTable.filterTable | public void filterTable(String text) {
"""
Filters the table according to given string.<p>
@param text to filter
"""
m_container.removeAllContainerFilters();
if (!CmsStringUtil.isEmptyOrWhitespaceOnly(text)) {
m_container.addContainerFilter(
new Or(
... | java | public void filterTable(String text) {
m_container.removeAllContainerFilters();
if (!CmsStringUtil.isEmptyOrWhitespaceOnly(text)) {
m_container.addContainerFilter(
new Or(
new SimpleStringFilter(TableProperty.Name, text, true, false),
... | [
"public",
"void",
"filterTable",
"(",
"String",
"text",
")",
"{",
"m_container",
".",
"removeAllContainerFilters",
"(",
")",
";",
"if",
"(",
"!",
"CmsStringUtil",
".",
"isEmptyOrWhitespaceOnly",
"(",
"text",
")",
")",
"{",
"m_container",
".",
"addContainerFilter... | Filters the table according to given string.<p>
@param text to filter | [
"Filters",
"the",
"table",
"according",
"to",
"given",
"string",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/resourcetypes/CmsResourceTypesTable.java#L626-L637 |
pushbit/sprockets | src/main/java/net/sf/sprockets/lang/Maths.java | Maths.clamp | public static int clamp(int value, int min, int max) {
"""
Get the value if it is between min and max, min if the value is less than min, or max if the
value is greater than max.
"""
return Math.min(Math.max(min, value), max);
} | java | public static int clamp(int value, int min, int max) {
return Math.min(Math.max(min, value), max);
} | [
"public",
"static",
"int",
"clamp",
"(",
"int",
"value",
",",
"int",
"min",
",",
"int",
"max",
")",
"{",
"return",
"Math",
".",
"min",
"(",
"Math",
".",
"max",
"(",
"min",
",",
"value",
")",
",",
"max",
")",
";",
"}"
] | Get the value if it is between min and max, min if the value is less than min, or max if the
value is greater than max. | [
"Get",
"the",
"value",
"if",
"it",
"is",
"between",
"min",
"and",
"max",
"min",
"if",
"the",
"value",
"is",
"less",
"than",
"min",
"or",
"max",
"if",
"the",
"value",
"is",
"greater",
"than",
"max",
"."
] | train | https://github.com/pushbit/sprockets/blob/5d967317cbb2374c69d33271d3c7b7311e1ea4ac/src/main/java/net/sf/sprockets/lang/Maths.java#L33-L35 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/listeners/AddResourcesListener.java | AddResourcesListener.ensureExistBootsfacesComponent | private boolean ensureExistBootsfacesComponent(UIViewRoot root, FacesContext context) {
"""
Check if there is almost one bootsfaces component in page. If yes, load the
correct items.
To ensure that, it checks first the viewMap to find specific bootsfaces key.
If it found nothing, it check for components that ... | java | private boolean ensureExistBootsfacesComponent(UIViewRoot root, FacesContext context) {
Map<String, Object> viewMap = root.getViewMap();
// check explicit js request
if (viewMap.get(RESOURCE_KEY) != null)
return true;
// check explicit css request
if (viewMap.get(THEME_RESOURCE_KEY) != null)
return tru... | [
"private",
"boolean",
"ensureExistBootsfacesComponent",
"(",
"UIViewRoot",
"root",
",",
"FacesContext",
"context",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"viewMap",
"=",
"root",
".",
"getViewMap",
"(",
")",
";",
"// check explicit js request",
"if",
... | Check if there is almost one bootsfaces component in page. If yes, load the
correct items.
To ensure that, it checks first the viewMap to find specific bootsfaces key.
If it found nothing, it check for components that has as a resource lib, the
"bsf" lib.
@param root the UIViewRoot
@param context the faces conte... | [
"Check",
"if",
"there",
"is",
"almost",
"one",
"bootsfaces",
"component",
"in",
"page",
".",
"If",
"yes",
"load",
"the",
"correct",
"items",
"."
] | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/listeners/AddResourcesListener.java#L155-L172 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/lss/LssClient.java | LssClient.resumeAppStream | public ResumeAppStreamResponse resumeAppStream(ResumeAppStreamRequest request) {
"""
Resume your app stream by app name and stream name
@param request The request object containing all parameters for resuming app session.
@return the response
"""
checkNotNull(request, "The parameter request should ... | java | public ResumeAppStreamResponse resumeAppStream(ResumeAppStreamRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
checkStringNotEmpty(request.getApp(), "The parameter app should NOT be null or empty string.");
checkStringNotEmpty(request.getStream(), "The param... | [
"public",
"ResumeAppStreamResponse",
"resumeAppStream",
"(",
"ResumeAppStreamRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"The parameter request should NOT be null.\"",
")",
";",
"checkStringNotEmpty",
"(",
"request",
".",
"getApp",
"(",
")",
",",... | Resume your app stream by app name and stream name
@param request The request object containing all parameters for resuming app session.
@return the response | [
"Resume",
"your",
"app",
"stream",
"by",
"app",
"name",
"and",
"stream",
"name"
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/lss/LssClient.java#L977-L985 |
stevespringett/Alpine | alpine/src/main/java/alpine/tasks/AlpineTaskScheduler.java | AlpineTaskScheduler.scheduleEvent | protected void scheduleEvent(final Event event, final long delay, final long period) {
"""
Schedules a repeating Event.
@param event the Event to schedule
@param delay delay in milliseconds before task is to be executed.
@param period time in milliseconds between successive task executions.
"""
fina... | java | protected void scheduleEvent(final Event event, final long delay, final long period) {
final Timer timer = new Timer();
timer.schedule(new ScheduleEvent().event(event), delay, period);
timers.add(timer);
} | [
"protected",
"void",
"scheduleEvent",
"(",
"final",
"Event",
"event",
",",
"final",
"long",
"delay",
",",
"final",
"long",
"period",
")",
"{",
"final",
"Timer",
"timer",
"=",
"new",
"Timer",
"(",
")",
";",
"timer",
".",
"schedule",
"(",
"new",
"ScheduleE... | Schedules a repeating Event.
@param event the Event to schedule
@param delay delay in milliseconds before task is to be executed.
@param period time in milliseconds between successive task executions. | [
"Schedules",
"a",
"repeating",
"Event",
"."
] | train | https://github.com/stevespringett/Alpine/blob/6c5ef5e1ba4f38922096f1307d3950c09edb3093/alpine/src/main/java/alpine/tasks/AlpineTaskScheduler.java#L46-L50 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxAPIRequest.java | BoxAPIRequest.writeBody | protected void writeBody(HttpURLConnection connection, ProgressListener listener) {
"""
Writes the body of this request to an HttpURLConnection.
<p>Subclasses overriding this method must remember to close the connection's OutputStream after writing.</p>
@param connection the connection to which the body shou... | java | protected void writeBody(HttpURLConnection connection, ProgressListener listener) {
if (this.body == null) {
return;
}
connection.setDoOutput(true);
try {
OutputStream output = connection.getOutputStream();
if (listener != null) {
outp... | [
"protected",
"void",
"writeBody",
"(",
"HttpURLConnection",
"connection",
",",
"ProgressListener",
"listener",
")",
"{",
"if",
"(",
"this",
".",
"body",
"==",
"null",
")",
"{",
"return",
";",
"}",
"connection",
".",
"setDoOutput",
"(",
"true",
")",
";",
"t... | Writes the body of this request to an HttpURLConnection.
<p>Subclasses overriding this method must remember to close the connection's OutputStream after writing.</p>
@param connection the connection to which the body should be written.
@param listener an optional listener for monitoring the write progress.
@throws ... | [
"Writes",
"the",
"body",
"of",
"this",
"request",
"to",
"an",
"HttpURLConnection",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxAPIRequest.java#L450-L470 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java | AppServicePlansInner.restartWebAppsAsync | public Observable<Void> restartWebAppsAsync(String resourceGroupName, String name) {
"""
Restart all apps in an App Service plan.
Restart all apps in an App Service plan.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service plan.
@throws Illeg... | java | public Observable<Void> restartWebAppsAsync(String resourceGroupName, String name) {
return restartWebAppsWithServiceResponseAsync(resourceGroupName, name).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return r... | [
"public",
"Observable",
"<",
"Void",
">",
"restartWebAppsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
")",
"{",
"return",
"restartWebAppsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
")",
".",
"map",
"(",
"new",
"Func1",
"... | Restart all apps in an App Service plan.
Restart all apps in an App Service plan.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service plan.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceResponse} ob... | [
"Restart",
"all",
"apps",
"in",
"an",
"App",
"Service",
"plan",
".",
"Restart",
"all",
"apps",
"in",
"an",
"App",
"Service",
"plan",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java#L2222-L2229 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/osgi/container/config/WebAppConfiguratorHelper.java | WebAppConfiguratorHelper.processFilterConfig | private FilterConfig processFilterConfig(DeploymentDescriptor webDD, Filter filter) {
"""
Merging Rules :
a. Once a filter configuration exists, the following ones with the same filter name are ignored
b. If init-param/asyncSupported is configured in web.xml, all the values from web-fagment.xml and annotation ar... | java | private FilterConfig processFilterConfig(DeploymentDescriptor webDD, Filter filter) {
String filterName = filter.getFilterName();
Map<String, ConfigItem<FilterConfig>> filterMap = configurator.getConfigItemMap("filter");
ConfigItem<FilterConfig> existedFilter = filterMap.get(filterName);
... | [
"private",
"FilterConfig",
"processFilterConfig",
"(",
"DeploymentDescriptor",
"webDD",
",",
"Filter",
"filter",
")",
"{",
"String",
"filterName",
"=",
"filter",
".",
"getFilterName",
"(",
")",
";",
"Map",
"<",
"String",
",",
"ConfigItem",
"<",
"FilterConfig",
"... | Merging Rules :
a. Once a filter configuration exists, the following ones with the same filter name are ignored
b. If init-param/asyncSupported is configured in web.xml, all the values from web-fagment.xml and annotation are ignored
b. If init-param/asyncSupported is NOT configured in web.xml,
b1. Those values from web... | [
"Merging",
"Rules",
":",
"a",
".",
"Once",
"a",
"filter",
"configuration",
"exists",
"the",
"following",
"ones",
"with",
"the",
"same",
"filter",
"name",
"are",
"ignored",
"b",
".",
"If",
"init",
"-",
"param",
"/",
"asyncSupported",
"is",
"configured",
"in... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/osgi/container/config/WebAppConfiguratorHelper.java#L2812-L2841 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/Collectors.java | Collectors.summingLong | @NotNull
public static <T> Collector<T, ?, Long> summingLong(@NotNull final ToLongFunction<? super T> mapper) {
"""
Returns a {@code Collector} that summing long-valued input elements.
@param <T> the type of the input elements
@param mapper the mapping function which extracts value from element to calcula... | java | @NotNull
public static <T> Collector<T, ?, Long> summingLong(@NotNull final ToLongFunction<? super T> mapper) {
return new CollectorsImpl<T, long[], Long>(
LONG_2ELEMENTS_ARRAY_SUPPLIER,
new BiConsumer<long[], T>() {
@Override
public ... | [
"@",
"NotNull",
"public",
"static",
"<",
"T",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"Long",
">",
"summingLong",
"(",
"@",
"NotNull",
"final",
"ToLongFunction",
"<",
"?",
"super",
"T",
">",
"mapper",
")",
"{",
"return",
"new",
"CollectorsImpl",
"<"... | Returns a {@code Collector} that summing long-valued input elements.
@param <T> the type of the input elements
@param mapper the mapping function which extracts value from element to calculate result
@return a {@code Collector}
@since 1.1.3 | [
"Returns",
"a",
"{",
"@code",
"Collector",
"}",
"that",
"summing",
"long",
"-",
"valued",
"input",
"elements",
"."
] | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/Collectors.java#L613-L633 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ElasticPoolsInner.java | ElasticPoolsInner.beginUpdate | public ElasticPoolInner beginUpdate(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolUpdate parameters) {
"""
Updates an existing elastic pool.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Man... | java | public ElasticPoolInner beginUpdate(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolUpdate parameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, parameters).toBlocking().single().body();
} | [
"public",
"ElasticPoolInner",
"beginUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"elasticPoolName",
",",
"ElasticPoolUpdate",
"parameters",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Updates an existing elastic pool.
@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.
@param elasticPoolName The name of the elastic pool to be updated.
@param paramete... | [
"Updates",
"an",
"existing",
"elastic",
"pool",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ElasticPoolsInner.java#L382-L384 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PackageSummaryBuilder.java | PackageSummaryBuilder.buildInterfaceSummary | public void buildInterfaceSummary(XMLNode node, Content summaryContentTree) {
"""
Build the summary for the interfaces in this package.
@param node the XML element that specifies which components to document
@param summaryContentTree the summary tree to which the interface summary
will be added
"""
... | java | public void buildInterfaceSummary(XMLNode node, Content summaryContentTree) {
String interfaceTableSummary =
configuration.getText("doclet.Member_Table_Summary",
configuration.getText("doclet.Interface_Summary"),
configuration.getText("doclet.interfaces"));
... | [
"public",
"void",
"buildInterfaceSummary",
"(",
"XMLNode",
"node",
",",
"Content",
"summaryContentTree",
")",
"{",
"String",
"interfaceTableSummary",
"=",
"configuration",
".",
"getText",
"(",
"\"doclet.Member_Table_Summary\"",
",",
"configuration",
".",
"getText",
"(",... | Build the summary for the interfaces in this package.
@param node the XML element that specifies which components to document
@param summaryContentTree the summary tree to which the interface summary
will be added | [
"Build",
"the",
"summary",
"for",
"the",
"interfaces",
"in",
"this",
"package",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PackageSummaryBuilder.java#L176-L193 |
Swagger2Markup/swagger2markup | src/main/java/io/github/swagger2markup/Swagger2MarkupProperties.java | Swagger2MarkupProperties.getRequiredPath | public Path getRequiredPath(String key) {
"""
Return the Path property value associated with the given key (never {@code null}).
@return The Path property
@throws IllegalStateException if the key cannot be resolved
"""
Optional<String> property = getString(key);
if (property.isPresent()) {
... | java | public Path getRequiredPath(String key) {
Optional<String> property = getString(key);
if (property.isPresent()) {
return Paths.get(property.get());
} else {
throw new IllegalStateException(String.format("required key [%s] not found", key));
}
} | [
"public",
"Path",
"getRequiredPath",
"(",
"String",
"key",
")",
"{",
"Optional",
"<",
"String",
">",
"property",
"=",
"getString",
"(",
"key",
")",
";",
"if",
"(",
"property",
".",
"isPresent",
"(",
")",
")",
"{",
"return",
"Paths",
".",
"get",
"(",
... | Return the Path property value associated with the given key (never {@code null}).
@return The Path property
@throws IllegalStateException if the key cannot be resolved | [
"Return",
"the",
"Path",
"property",
"value",
"associated",
"with",
"the",
"given",
"key",
"(",
"never",
"{",
"@code",
"null",
"}",
")",
"."
] | train | https://github.com/Swagger2Markup/swagger2markup/blob/da83465f19a2f8a0f1fba873b5762bca8587896b/src/main/java/io/github/swagger2markup/Swagger2MarkupProperties.java#L257-L264 |
m-m-m/util | pojo/src/main/java/net/sf/mmm/util/pojo/base/SimplePojoFactory.java | SimplePojoFactory.newInstanceForClass | protected <POJO> POJO newInstanceForClass(Class<POJO> pojoType) throws InstantiationFailedException {
"""
Implementation of {@link #newInstance(Class)} for regular class.
@param <POJO> is the generic type of the {@link net.sf.mmm.util.pojo.api.Pojo} to create.
@param pojoType is the {@link Class} reflecting th... | java | protected <POJO> POJO newInstanceForClass(Class<POJO> pojoType) throws InstantiationFailedException {
try {
return pojoType.newInstance();
} catch (Exception e) {
throw new InstantiationFailedException(e, pojoType);
}
} | [
"protected",
"<",
"POJO",
">",
"POJO",
"newInstanceForClass",
"(",
"Class",
"<",
"POJO",
">",
"pojoType",
")",
"throws",
"InstantiationFailedException",
"{",
"try",
"{",
"return",
"pojoType",
".",
"newInstance",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
... | Implementation of {@link #newInstance(Class)} for regular class.
@param <POJO> is the generic type of the {@link net.sf.mmm.util.pojo.api.Pojo} to create.
@param pojoType is the {@link Class} reflecting the {@link net.sf.mmm.util.pojo.api.Pojo} to create.
@return the new instance of the given {@code pojoType}.
@throws... | [
"Implementation",
"of",
"{",
"@link",
"#newInstance",
"(",
"Class",
")",
"}",
"for",
"regular",
"class",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/pojo/src/main/java/net/sf/mmm/util/pojo/base/SimplePojoFactory.java#L48-L55 |
dmfs/xmlobjects | src/org/dmfs/xmlobjects/serializer/XmlObjectSerializer.java | XmlObjectSerializer.setOutput | public XmlObjectSerializer setOutput(SerializerContext serializerContext, OutputStream out, String charset) throws SerializerException, IOException {
"""
Set the output of the serializer.
@param serializerContext
A {@link SerializerContext}.
@param out
The {@link OutputStream} to write to.
@param charset
T... | java | public XmlObjectSerializer setOutput(SerializerContext serializerContext, OutputStream out, String charset) throws SerializerException, IOException
{
try
{
serializerContext.serializer.setOutput(out, charset == null ? "UTF-8" : charset);
}
catch (IllegalArgumentException e)
{
throw new SerializerExcept... | [
"public",
"XmlObjectSerializer",
"setOutput",
"(",
"SerializerContext",
"serializerContext",
",",
"OutputStream",
"out",
",",
"String",
"charset",
")",
"throws",
"SerializerException",
",",
"IOException",
"{",
"try",
"{",
"serializerContext",
".",
"serializer",
".",
"... | Set the output of the serializer.
@param serializerContext
A {@link SerializerContext}.
@param out
The {@link OutputStream} to write to.
@param charset
The charset. The serializer will use "UTF-8" if this is <code>null</code>.
@return
@throws SerializerException
@throws IOException | [
"Set",
"the",
"output",
"of",
"the",
"serializer",
"."
] | train | https://github.com/dmfs/xmlobjects/blob/b68ddd0ce994d804fc2ec6da1096bf0d883b37f9/src/org/dmfs/xmlobjects/serializer/XmlObjectSerializer.java#L221-L236 |
apache/incubator-heron | heron/metricscachemgr/src/java/org/apache/heron/metricscachemgr/metricscache/CacheCore.java | CacheCore.getExceptions | public ExceptionResponse getExceptions(
ExceptionRequest request) {
"""
for internal process use
@param request <p>
idxComponentInstance == null: query all components
idxComponentInstance == []: query none component
idxComponentInstance == [c1->null, ..]: query all instances of c1, ..
idxComponentI... | java | public ExceptionResponse getExceptions(
ExceptionRequest request) {
synchronized (CacheCore.class) {
List<ExceptionDatum> response = new ArrayList<>();
Map<String, Set<String>> componentNameInstanceId = request.getComponentNameInstanceId();
// candidate component names
Set<String> co... | [
"public",
"ExceptionResponse",
"getExceptions",
"(",
"ExceptionRequest",
"request",
")",
"{",
"synchronized",
"(",
"CacheCore",
".",
"class",
")",
"{",
"List",
"<",
"ExceptionDatum",
">",
"response",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Map",
"<",
... | for internal process use
@param request <p>
idxComponentInstance == null: query all components
idxComponentInstance == []: query none component
idxComponentInstance == [c1->null, ..]: query all instances of c1, ..
idxComponentInstance == [c1->[], ..]: query none instance of c1, ..
idxComponentInstance == [c1->... | [
"for",
"internal",
"process",
"use"
] | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/metricscachemgr/src/java/org/apache/heron/metricscachemgr/metricscache/CacheCore.java#L459-L494 |
defei/codelogger-utils | src/main/java/org/codelogger/utils/DateUtils.java | DateUtils.getDateOfWeeksBack | public static Date getDateOfWeeksBack(final int weeksBack, final Date date) {
"""
Get specify weeks back from given date.
@param weeksBack how many weeks want to be back.
@param date date to be handled.
@return a new Date object.
"""
return dateBack(Calendar.WEEK_OF_MONTH, weeksBack, date);
} | java | public static Date getDateOfWeeksBack(final int weeksBack, final Date date) {
return dateBack(Calendar.WEEK_OF_MONTH, weeksBack, date);
} | [
"public",
"static",
"Date",
"getDateOfWeeksBack",
"(",
"final",
"int",
"weeksBack",
",",
"final",
"Date",
"date",
")",
"{",
"return",
"dateBack",
"(",
"Calendar",
".",
"WEEK_OF_MONTH",
",",
"weeksBack",
",",
"date",
")",
";",
"}"
] | Get specify weeks back from given date.
@param weeksBack how many weeks want to be back.
@param date date to be handled.
@return a new Date object. | [
"Get",
"specify",
"weeks",
"back",
"from",
"given",
"date",
"."
] | train | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/DateUtils.java#L197-L200 |
raydac/java-comment-preprocessor | jcp/src/main/java/com/igormaznitsa/jcp/context/PreprocessorContext.java | PreprocessorContext.setLocalVariable | @Nonnull
public PreprocessorContext setLocalVariable(@Nonnull final String name, @Nonnull final Value value) {
"""
Set a local variable value
@param name the variable name, must not be null, remember that the name will be normalized and will be entirely in lower case
@param value the value for the variable,... | java | @Nonnull
public PreprocessorContext setLocalVariable(@Nonnull final String name, @Nonnull final Value value) {
assertNotNull("Variable name is null", name);
assertNotNull("Value is null", value);
final String normalized = assertNotNull(PreprocessorUtils.normalizeVariableName(name));
if (normalized.i... | [
"@",
"Nonnull",
"public",
"PreprocessorContext",
"setLocalVariable",
"(",
"@",
"Nonnull",
"final",
"String",
"name",
",",
"@",
"Nonnull",
"final",
"Value",
"value",
")",
"{",
"assertNotNull",
"(",
"\"Variable name is null\"",
",",
"name",
")",
";",
"assertNotNull"... | Set a local variable value
@param name the variable name, must not be null, remember that the name will be normalized and will be entirely in lower case
@param value the value for the variable, it must not be null
@return this preprocessor context
@see Value | [
"Set",
"a",
"local",
"variable",
"value"
] | train | https://github.com/raydac/java-comment-preprocessor/blob/83ac87b575ac084914d77695a8c8673de3b8300c/jcp/src/main/java/com/igormaznitsa/jcp/context/PreprocessorContext.java#L453-L470 |
biojava/biojava | biojava-alignment/src/main/java/org/biojava/nbio/alignment/Alignments.java | Alignments.getPairwiseScore | static <S extends Sequence<C>, C extends Compound> double getPairwiseScore(S query, S target,
PairwiseSequenceScorerType type, GapPenalty gapPenalty, SubstitutionMatrix<C> subMatrix) {
"""
Factory method which computes a similarity score for the given {@link Sequence} pair.
@param <S> each {@link Sequence} o... | java | static <S extends Sequence<C>, C extends Compound> double getPairwiseScore(S query, S target,
PairwiseSequenceScorerType type, GapPenalty gapPenalty, SubstitutionMatrix<C> subMatrix) {
return getPairwiseScorer(query, target, type, gapPenalty, subMatrix).getScore();
} | [
"static",
"<",
"S",
"extends",
"Sequence",
"<",
"C",
">",
",",
"C",
"extends",
"Compound",
">",
"double",
"getPairwiseScore",
"(",
"S",
"query",
",",
"S",
"target",
",",
"PairwiseSequenceScorerType",
"type",
",",
"GapPenalty",
"gapPenalty",
",",
"SubstitutionM... | Factory method which computes a similarity score for the given {@link Sequence} pair.
@param <S> each {@link Sequence} of the pair is of type S
@param <C> each element of a {@link Sequence} is a {@link Compound} of type C
@param query the first {@link Sequence} to score
@param target the second {@link Sequence} to sco... | [
"Factory",
"method",
"which",
"computes",
"a",
"similarity",
"score",
"for",
"the",
"given",
"{",
"@link",
"Sequence",
"}",
"pair",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/Alignments.java#L352-L355 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java | PersistenceBrokerImpl.getIteratorByQuery | public Iterator getIteratorByQuery(Query query) throws PersistenceBrokerException {
"""
returns an Iterator that iterates Objects of class c if calling the .next()
method. The Elements returned come from a SELECT ... WHERE Statement
that is defined by the Query query.
If itemProxy is null, no proxies are used.
... | java | public Iterator getIteratorByQuery(Query query) throws PersistenceBrokerException
{
Class itemClass = query.getSearchClass();
ClassDescriptor cld = getClassDescriptor(itemClass);
return getIteratorFromQuery(query, cld);
} | [
"public",
"Iterator",
"getIteratorByQuery",
"(",
"Query",
"query",
")",
"throws",
"PersistenceBrokerException",
"{",
"Class",
"itemClass",
"=",
"query",
".",
"getSearchClass",
"(",
")",
";",
"ClassDescriptor",
"cld",
"=",
"getClassDescriptor",
"(",
"itemClass",
")",... | returns an Iterator that iterates Objects of class c if calling the .next()
method. The Elements returned come from a SELECT ... WHERE Statement
that is defined by the Query query.
If itemProxy is null, no proxies are used. | [
"returns",
"an",
"Iterator",
"that",
"iterates",
"Objects",
"of",
"class",
"c",
"if",
"calling",
"the",
".",
"next",
"()",
"method",
".",
"The",
"Elements",
"returned",
"come",
"from",
"a",
"SELECT",
"...",
"WHERE",
"Statement",
"that",
"is",
"defined",
"b... | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java#L1651-L1656 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/layout/GridBagLayoutBuilder.java | GridBagLayoutBuilder.appendLeftLabel | public GridBagLayoutBuilder appendLeftLabel(String labelKey, int colSpan) {
"""
Appends a left-justified label to the end of the given line, using the
provided string as the key to look in the
{@link #setComponentFactory(ComponentFactory) ComponentFactory's}message
bundle for the text to use.
@param labelKey... | java | public GridBagLayoutBuilder appendLeftLabel(String labelKey, int colSpan) {
final JLabel label = createLabel(labelKey);
label.setHorizontalAlignment(SwingConstants.LEFT);
return appendLabel(label, colSpan);
} | [
"public",
"GridBagLayoutBuilder",
"appendLeftLabel",
"(",
"String",
"labelKey",
",",
"int",
"colSpan",
")",
"{",
"final",
"JLabel",
"label",
"=",
"createLabel",
"(",
"labelKey",
")",
";",
"label",
".",
"setHorizontalAlignment",
"(",
"SwingConstants",
".",
"LEFT",
... | Appends a left-justified label to the end of the given line, using the
provided string as the key to look in the
{@link #setComponentFactory(ComponentFactory) ComponentFactory's}message
bundle for the text to use.
@param labelKey the key into the message bundle; if not found the key is used
as the text to display
@par... | [
"Appends",
"a",
"left",
"-",
"justified",
"label",
"to",
"the",
"end",
"of",
"the",
"given",
"line",
"using",
"the",
"provided",
"string",
"as",
"the",
"key",
"to",
"look",
"in",
"the",
"{",
"@link",
"#setComponentFactory",
"(",
"ComponentFactory",
")",
"C... | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/layout/GridBagLayoutBuilder.java#L535-L539 |
alkacon/opencms-core | src/org/opencms/ade/configuration/CmsResourceTypeConfig.java | CmsResourceTypeConfig.updateBasePath | protected void updateBasePath(String basePath) {
"""
Updates the base path for the folder information.<p>
@param basePath the new base path
"""
if (m_folderOrName != null) {
if (m_folderOrName.isName()) {
m_folderOrName = new CmsContentFolderDescriptor(basePath, m_folder... | java | protected void updateBasePath(String basePath) {
if (m_folderOrName != null) {
if (m_folderOrName.isName()) {
m_folderOrName = new CmsContentFolderDescriptor(basePath, m_folderOrName.getFolderName());
}
} else {
m_folderOrName = new CmsContentFolderDe... | [
"protected",
"void",
"updateBasePath",
"(",
"String",
"basePath",
")",
"{",
"if",
"(",
"m_folderOrName",
"!=",
"null",
")",
"{",
"if",
"(",
"m_folderOrName",
".",
"isName",
"(",
")",
")",
"{",
"m_folderOrName",
"=",
"new",
"CmsContentFolderDescriptor",
"(",
... | Updates the base path for the folder information.<p>
@param basePath the new base path | [
"Updates",
"the",
"base",
"path",
"for",
"the",
"folder",
"information",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsResourceTypeConfig.java#L774-L783 |
CloudSlang/cs-actions | cs-vmware/src/main/java/io/cloudslang/content/vmware/services/VmService.java | VmService.deleteVM | public Map<String, String> deleteVM(HttpInputs httpInputs, VmInputs vmInputs) throws Exception {
"""
Method used to connect to specified data center and delete the virtual machine identified by the inputs provided.
@param httpInputs Object that has all the inputs necessary to made a connection to data center
@... | java | public Map<String, String> deleteVM(HttpInputs httpInputs, VmInputs vmInputs) throws Exception {
ConnectionResources connectionResources = new ConnectionResources(httpInputs, vmInputs);
try {
ManagedObjectReference vmMor = new MorObjectHandler().getMor(connectionResources,
... | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"deleteVM",
"(",
"HttpInputs",
"httpInputs",
",",
"VmInputs",
"vmInputs",
")",
"throws",
"Exception",
"{",
"ConnectionResources",
"connectionResources",
"=",
"new",
"ConnectionResources",
"(",
"httpInputs",
",",
... | Method used to connect to specified data center and delete the virtual machine identified by the inputs provided.
@param httpInputs Object that has all the inputs necessary to made a connection to data center
@param vmInputs Object that has all the specific inputs necessary to identify the targeted virtual machine
@... | [
"Method",
"used",
"to",
"connect",
"to",
"specified",
"data",
"center",
"and",
"delete",
"the",
"virtual",
"machine",
"identified",
"by",
"the",
"inputs",
"provided",
"."
] | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-vmware/src/main/java/io/cloudslang/content/vmware/services/VmService.java#L118-L140 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/dsl/ComparableExpression.java | ComparableExpression.notBetween | public final BooleanExpression notBetween(T from, T to) {
"""
Create a {@code this not between from and to} expression
<p>Is equivalent to {@code this < from || this > to}</p>
@param from inclusive start of range
@param to inclusive end of range
@return this not between from and to
"""
return b... | java | public final BooleanExpression notBetween(T from, T to) {
return between(from, to).not();
} | [
"public",
"final",
"BooleanExpression",
"notBetween",
"(",
"T",
"from",
",",
"T",
"to",
")",
"{",
"return",
"between",
"(",
"from",
",",
"to",
")",
".",
"not",
"(",
")",
";",
"}"
] | Create a {@code this not between from and to} expression
<p>Is equivalent to {@code this < from || this > to}</p>
@param from inclusive start of range
@param to inclusive end of range
@return this not between from and to | [
"Create",
"a",
"{",
"@code",
"this",
"not",
"between",
"from",
"and",
"to",
"}",
"expression"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/ComparableExpression.java#L101-L103 |
wwadge/bonecp | bonecp/src/main/java/com/jolbox/bonecp/BoneCPConfig.java | BoneCPConfig.setMaxConnectionAge | public void setMaxConnectionAge(long maxConnectionAge, TimeUnit timeUnit) {
"""
Sets the maxConnectionAge. Any connections older than this setting will be closed
off whether it is idle or not. Connections currently in use will not be affected until they
are returned to the pool.
@param maxConnectionAge the ma... | java | public void setMaxConnectionAge(long maxConnectionAge, TimeUnit timeUnit) {
this.maxConnectionAgeInSeconds = TimeUnit.SECONDS.convert(maxConnectionAge, timeUnit);
} | [
"public",
"void",
"setMaxConnectionAge",
"(",
"long",
"maxConnectionAge",
",",
"TimeUnit",
"timeUnit",
")",
"{",
"this",
".",
"maxConnectionAgeInSeconds",
"=",
"TimeUnit",
".",
"SECONDS",
".",
"convert",
"(",
"maxConnectionAge",
",",
"timeUnit",
")",
";",
"}"
] | Sets the maxConnectionAge. Any connections older than this setting will be closed
off whether it is idle or not. Connections currently in use will not be affected until they
are returned to the pool.
@param maxConnectionAge the maxConnectionAge to set.
@param timeUnit the unit of the maxConnectionAge argument. | [
"Sets",
"the",
"maxConnectionAge",
".",
"Any",
"connections",
"older",
"than",
"this",
"setting",
"will",
"be",
"closed",
"off",
"whether",
"it",
"is",
"idle",
"or",
"not",
".",
"Connections",
"currently",
"in",
"use",
"will",
"not",
"be",
"affected",
"until... | train | https://github.com/wwadge/bonecp/blob/74bc3287025fc137ca28909f0f7693edae37a15d/bonecp/src/main/java/com/jolbox/bonecp/BoneCPConfig.java#L1200-L1202 |
Impetus/Kundera | src/kundera-ethereum/src/main/java/com/impetus/kundera/blockchain/util/PropertyReader.java | PropertyReader.getProperties | private static Map<String, String> getProperties(String fileName) {
"""
Gets the properties.
@param fileName
the file name
@return the properties
"""
if (kunderaBlockchainProps == null || kunderaBlockchainProps.isEmpty())
{
Configuration config = null;
try
... | java | private static Map<String, String> getProperties(String fileName)
{
if (kunderaBlockchainProps == null || kunderaBlockchainProps.isEmpty())
{
Configuration config = null;
try
{
config = new PropertiesConfiguration(fileName);
}
... | [
"private",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"getProperties",
"(",
"String",
"fileName",
")",
"{",
"if",
"(",
"kunderaBlockchainProps",
"==",
"null",
"||",
"kunderaBlockchainProps",
".",
"isEmpty",
"(",
")",
")",
"{",
"Configuration",
"config... | Gets the properties.
@param fileName
the file name
@return the properties | [
"Gets",
"the",
"properties",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-ethereum/src/main/java/com/impetus/kundera/blockchain/util/PropertyReader.java#L61-L80 |
jcuda/jcusparse | JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java | JCusparse.cusparseSdoti | public static int cusparseSdoti(
cusparseHandle handle,
int nnz,
Pointer xVal,
Pointer xInd,
Pointer y,
Pointer resultDevHostPtr,
int idxBase) {
"""
Description: dot product of a sparse vector x and a dense vector y.
"""
return check... | java | public static int cusparseSdoti(
cusparseHandle handle,
int nnz,
Pointer xVal,
Pointer xInd,
Pointer y,
Pointer resultDevHostPtr,
int idxBase)
{
return checkResult(cusparseSdotiNative(handle, nnz, xVal, xInd, y, resultDevHostPtr, idxBase... | [
"public",
"static",
"int",
"cusparseSdoti",
"(",
"cusparseHandle",
"handle",
",",
"int",
"nnz",
",",
"Pointer",
"xVal",
",",
"Pointer",
"xInd",
",",
"Pointer",
"y",
",",
"Pointer",
"resultDevHostPtr",
",",
"int",
"idxBase",
")",
"{",
"return",
"checkResult",
... | Description: dot product of a sparse vector x and a dense vector y. | [
"Description",
":",
"dot",
"product",
"of",
"a",
"sparse",
"vector",
"x",
"and",
"a",
"dense",
"vector",
"y",
"."
] | train | https://github.com/jcuda/jcusparse/blob/7687a62a4ef6b76cb91cf7da93d4cf5ade96a791/JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java#L726-L736 |
alkacon/opencms-core | src/org/opencms/ugc/CmsUgcSession.java | CmsUgcSession.validateContent | public CmsXmlContentErrorHandler validateContent(Map<String, String> contentValues) throws CmsUgcException {
"""
Validates the content values.<p>
@param contentValues the content values to validate
@return the validation handler
@throws CmsUgcException if reading the content file fails
"""
ch... | java | public CmsXmlContentErrorHandler validateContent(Map<String, String> contentValues) throws CmsUgcException {
checkNotFinished();
try {
CmsFile file = m_cms.readFile(m_editResource);
CmsXmlContent content = addContentValues(file, contentValues);
return content.validat... | [
"public",
"CmsXmlContentErrorHandler",
"validateContent",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"contentValues",
")",
"throws",
"CmsUgcException",
"{",
"checkNotFinished",
"(",
")",
";",
"try",
"{",
"CmsFile",
"file",
"=",
"m_cms",
".",
"readFile",
"(",... | Validates the content values.<p>
@param contentValues the content values to validate
@return the validation handler
@throws CmsUgcException if reading the content file fails | [
"Validates",
"the",
"content",
"values",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ugc/CmsUgcSession.java#L529-L540 |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/internals/metamodel/AbstractProperty.java | AbstractProperty.encodeFromJava | public VALUETO encodeFromJava(VALUEFROM javaValue, Optional<CassandraOptions> cassandraOptions) {
"""
Encode given java value to CQL-compatible value using Achilles codec system and a CassandraOptions
containing a runtime SchemaNameProvider. Use the
<br/>
<br/>
<pre class="code"><code class="java">
CassandraO... | java | public VALUETO encodeFromJava(VALUEFROM javaValue, Optional<CassandraOptions> cassandraOptions) {
if (javaValue == null) return null;
return encodeFromJavaInternal(javaValue, cassandraOptions);
} | [
"public",
"VALUETO",
"encodeFromJava",
"(",
"VALUEFROM",
"javaValue",
",",
"Optional",
"<",
"CassandraOptions",
">",
"cassandraOptions",
")",
"{",
"if",
"(",
"javaValue",
"==",
"null",
")",
"return",
"null",
";",
"return",
"encodeFromJavaInternal",
"(",
"javaValue... | Encode given java value to CQL-compatible value using Achilles codec system and a CassandraOptions
containing a runtime SchemaNameProvider. Use the
<br/>
<br/>
<pre class="code"><code class="java">
CassandraOptions.withSchemaNameProvider(SchemaNameProvider provider)
</code></pre>
<br/>
static method to build such a Cas... | [
"Encode",
"given",
"java",
"value",
"to",
"CQL",
"-",
"compatible",
"value",
"using",
"Achilles",
"codec",
"system",
"and",
"a",
"CassandraOptions",
"containing",
"a",
"runtime",
"SchemaNameProvider",
".",
"Use",
"the",
"<br",
"/",
">",
"<br",
"/",
">",
"<pr... | train | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/metamodel/AbstractProperty.java#L81-L84 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/client/QuorumJournalManager.java | QuorumJournalManager.saveDigestAndRenameCheckpointImage | @Override
public boolean saveDigestAndRenameCheckpointImage(long txid, MD5Hash digest) {
"""
Roll image and save md5 digest to the underlying nodes. This is a quorum
roll, and we ensure that it can succeed only on the nodes that consumed
entirely the uploaded image.
"""
try {
LOG.info("Saving md5... | java | @Override
public boolean saveDigestAndRenameCheckpointImage(long txid, MD5Hash digest) {
try {
LOG.info("Saving md5: " + digest + " for txid: " + txid);
QuorumCall<AsyncLogger, Void> q = loggers
.saveDigestAndRenameCheckpointImage(txid, digest);
loggers.waitForWriteQuorum(q, writeTxnsT... | [
"@",
"Override",
"public",
"boolean",
"saveDigestAndRenameCheckpointImage",
"(",
"long",
"txid",
",",
"MD5Hash",
"digest",
")",
"{",
"try",
"{",
"LOG",
".",
"info",
"(",
"\"Saving md5: \"",
"+",
"digest",
"+",
"\" for txid: \"",
"+",
"txid",
")",
";",
"QuorumC... | Roll image and save md5 digest to the underlying nodes. This is a quorum
roll, and we ensure that it can succeed only on the nodes that consumed
entirely the uploaded image. | [
"Roll",
"image",
"and",
"save",
"md5",
"digest",
"to",
"the",
"underlying",
"nodes",
".",
"This",
"is",
"a",
"quorum",
"roll",
"and",
"we",
"ensure",
"that",
"it",
"can",
"succeed",
"only",
"on",
"the",
"nodes",
"that",
"consumed",
"entirely",
"the",
"up... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/client/QuorumJournalManager.java#L682-L695 |
Erudika/para | para-server/src/main/java/com/erudika/para/rest/RestUtils.java | RestUtils.readResourcePath | public static ParaObject readResourcePath(String appid, String path) {
"""
Reads an object from a given resource path.
Assumes that the "id" is located after the first slash "/" like this: {type}/{id}/...
@param appid app id
@param path resource path
@return the object found at this path or null
"""
if (... | java | public static ParaObject readResourcePath(String appid, String path) {
if (StringUtils.isBlank(appid) || StringUtils.isBlank(path) || !path.contains("/")) {
return null;
}
try {
URI uri = new URI(path);
if (path.length() > 1) {
path = path.startsWith("/") ? uri.getPath().substring(1) : uri.getPath();... | [
"public",
"static",
"ParaObject",
"readResourcePath",
"(",
"String",
"appid",
",",
"String",
"path",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"appid",
")",
"||",
"StringUtils",
".",
"isBlank",
"(",
"path",
")",
"||",
"!",
"path",
".",
"co... | Reads an object from a given resource path.
Assumes that the "id" is located after the first slash "/" like this: {type}/{id}/...
@param appid app id
@param path resource path
@return the object found at this path or null | [
"Reads",
"an",
"object",
"from",
"a",
"given",
"resource",
"path",
".",
"Assumes",
"that",
"the",
"id",
"is",
"located",
"after",
"the",
"first",
"slash",
"/",
"like",
"this",
":",
"{",
"type",
"}",
"/",
"{",
"id",
"}",
"/",
"..."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/rest/RestUtils.java#L168-L191 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ImageSegmentationOps.java | ImageSegmentationOps.countRegionPixels | public static int countRegionPixels(GrayS32 labeled , int which ) {
"""
Counts the number of instances of 'which' inside the labeled image.
@param labeled Image which has been labeled
@param which The label being searched for
@return Number of instances of 'which' in 'labeled'
"""
int total = 0;
for( ... | java | public static int countRegionPixels(GrayS32 labeled , int which ) {
int total = 0;
for( int y = 0; y < labeled.height; y++ ) {
int index = labeled.startIndex + y*labeled.stride;
for( int x = 0; x < labeled.width; x++ ) {
if( labeled.data[index++] == which ) {
total++;
}
}
}
return total;
... | [
"public",
"static",
"int",
"countRegionPixels",
"(",
"GrayS32",
"labeled",
",",
"int",
"which",
")",
"{",
"int",
"total",
"=",
"0",
";",
"for",
"(",
"int",
"y",
"=",
"0",
";",
"y",
"<",
"labeled",
".",
"height",
";",
"y",
"++",
")",
"{",
"int",
"... | Counts the number of instances of 'which' inside the labeled image.
@param labeled Image which has been labeled
@param which The label being searched for
@return Number of instances of 'which' in 'labeled' | [
"Counts",
"the",
"number",
"of",
"instances",
"of",
"which",
"inside",
"the",
"labeled",
"image",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ImageSegmentationOps.java#L44-L55 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/concurrent/ExecutorServiceHelper.java | ExecutorServiceHelper.shutdownAndWaitUntilAllTasksAreFinished | @Nonnull
public static EInterrupt shutdownAndWaitUntilAllTasksAreFinished (@Nonnull final ExecutorService aES) {
"""
Call shutdown on the {@link ExecutorService} and wait indefinitely until it
terminated.
@param aES
The {@link ExecutorService} to operate on. May not be
<code>null</code>.
@return {@link EI... | java | @Nonnull
public static EInterrupt shutdownAndWaitUntilAllTasksAreFinished (@Nonnull final ExecutorService aES)
{
return shutdownAndWaitUntilAllTasksAreFinished (aES, 1, TimeUnit.SECONDS);
} | [
"@",
"Nonnull",
"public",
"static",
"EInterrupt",
"shutdownAndWaitUntilAllTasksAreFinished",
"(",
"@",
"Nonnull",
"final",
"ExecutorService",
"aES",
")",
"{",
"return",
"shutdownAndWaitUntilAllTasksAreFinished",
"(",
"aES",
",",
"1",
",",
"TimeUnit",
".",
"SECONDS",
"... | Call shutdown on the {@link ExecutorService} and wait indefinitely until it
terminated.
@param aES
The {@link ExecutorService} to operate on. May not be
<code>null</code>.
@return {@link EInterrupt#INTERRUPTED} if the executor service was
interrupted while awaiting termination. Never <code>null</code>. | [
"Call",
"shutdown",
"on",
"the",
"{",
"@link",
"ExecutorService",
"}",
"and",
"wait",
"indefinitely",
"until",
"it",
"terminated",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/concurrent/ExecutorServiceHelper.java#L108-L112 |
hgoebl/DavidWebb | src/main/java/com/goebl/david/Webb.java | Webb.setDefaultHeader | public void setDefaultHeader(String name, Object value) {
"""
Set the value for a named header which is valid for all requests created by this instance.
<br>
The value takes precedence over {@link Webb#setGlobalHeader(String, Object)} but can be overwritten by
{@link com.goebl.david.Request#header(String, Objec... | java | public void setDefaultHeader(String name, Object value) {
if (defaultHeaders == null) {
defaultHeaders = new HashMap<String, Object>();
}
if (value == null) {
defaultHeaders.remove(name);
} else {
defaultHeaders.put(name, value);
}
} | [
"public",
"void",
"setDefaultHeader",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"defaultHeaders",
"==",
"null",
")",
"{",
"defaultHeaders",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"}",
"if",
"(... | Set the value for a named header which is valid for all requests created by this instance.
<br>
The value takes precedence over {@link Webb#setGlobalHeader(String, Object)} but can be overwritten by
{@link com.goebl.david.Request#header(String, Object)}.
<br>
For the supported types for values see {@link Request#header... | [
"Set",
"the",
"value",
"for",
"a",
"named",
"header",
"which",
"is",
"valid",
"for",
"all",
"requests",
"created",
"by",
"this",
"instance",
".",
"<br",
">",
"The",
"value",
"takes",
"precedence",
"over",
"{",
"@link",
"Webb#setGlobalHeader",
"(",
"String",
... | train | https://github.com/hgoebl/DavidWebb/blob/4f1532fbc3d817886d38de24eacc02b44b910b42/src/main/java/com/goebl/david/Webb.java#L211-L220 |
h2oai/h2o-2 | src/main/java/water/genmodel/GeneratedModel.java | GeneratedModel.grpContains | public static boolean grpContains(byte[] gcmp, int offset, int idx) {
"""
Return <code>true</code> if the given index is in given bit array else false.
<p>The method returns <code>false</code> if <code>idx</code> is less than
<code>offset</code>. It also returns <code>false</code> if the <code>idx</code>
is g... | java | public static boolean grpContains(byte[] gcmp, int offset, int idx) {
if(offset < 0) throw new IndexOutOfBoundsException("offset < 0: " + offset);
if(idx < offset) return false;
idx = idx - offset;
int max_idx = (gcmp.length << 3) - 1;
if(idx > max_idx) return false;
return (gcmp[idx >> 3] & ((... | [
"public",
"static",
"boolean",
"grpContains",
"(",
"byte",
"[",
"]",
"gcmp",
",",
"int",
"offset",
",",
"int",
"idx",
")",
"{",
"if",
"(",
"offset",
"<",
"0",
")",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"offset < 0: \"",
"+",
"offset",
")",
... | Return <code>true</code> if the given index is in given bit array else false.
<p>The method returns <code>false</code> if <code>idx</code> is less than
<code>offset</code>. It also returns <code>false</code> if the <code>idx</code>
is greater then length of given bit set!
</p>
@param gcmp bit set array
@param offset ... | [
"Return",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"the",
"given",
"index",
"is",
"in",
"given",
"bit",
"array",
"else",
"false",
"."
] | train | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/genmodel/GeneratedModel.java#L27-L35 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/geom/Vector2f.java | Vector2f.projectOntoUnit | public void projectOntoUnit(Vector2f b, Vector2f result) {
"""
Project this vector onto another
@param b The vector to project onto
@param result The projected vector
"""
float dp = b.dot(this);
result.x = dp * b.getX();
result.y = dp * b.getY();
} | java | public void projectOntoUnit(Vector2f b, Vector2f result) {
float dp = b.dot(this);
result.x = dp * b.getX();
result.y = dp * b.getY();
} | [
"public",
"void",
"projectOntoUnit",
"(",
"Vector2f",
"b",
",",
"Vector2f",
"result",
")",
"{",
"float",
"dp",
"=",
"b",
".",
"dot",
"(",
"this",
")",
";",
"result",
".",
"x",
"=",
"dp",
"*",
"b",
".",
"getX",
"(",
")",
";",
"result",
".",
"y",
... | Project this vector onto another
@param b The vector to project onto
@param result The projected vector | [
"Project",
"this",
"vector",
"onto",
"another"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/geom/Vector2f.java#L329-L335 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/ssl/jdbc4/LibPQFactory.java | LibPQFactory.verify | @Deprecated
public boolean verify(String hostname, SSLSession session) {
"""
Verifies the server certificate according to the libpq rules. The cn attribute of the
certificate is matched against the hostname. If the cn attribute starts with an asterisk (*),
it will be treated as a wildcard, and will match all c... | java | @Deprecated
public boolean verify(String hostname, SSLSession session) {
if (!sslMode.verifyPeerName()) {
return true;
}
return PGjdbcHostnameVerifier.INSTANCE.verify(hostname, session);
} | [
"@",
"Deprecated",
"public",
"boolean",
"verify",
"(",
"String",
"hostname",
",",
"SSLSession",
"session",
")",
"{",
"if",
"(",
"!",
"sslMode",
".",
"verifyPeerName",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"return",
"PGjdbcHostnameVerifier",
".",
... | Verifies the server certificate according to the libpq rules. The cn attribute of the
certificate is matched against the hostname. If the cn attribute starts with an asterisk (*),
it will be treated as a wildcard, and will match all characters except a dot (.). This means
the certificate will not match subdomains. If t... | [
"Verifies",
"the",
"server",
"certificate",
"according",
"to",
"the",
"libpq",
"rules",
".",
"The",
"cn",
"attribute",
"of",
"the",
"certificate",
"is",
"matched",
"against",
"the",
"hostname",
".",
"If",
"the",
"cn",
"attribute",
"starts",
"with",
"an",
"as... | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/ssl/jdbc4/LibPQFactory.java#L76-L82 |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/style/StyleUtil.java | StyleUtil.createFont | public static Font createFont(Workbook workbook, short color, short fontSize, String fontName) {
"""
创建字体
@param workbook {@link Workbook}
@param color 字体颜色
@param fontSize 字体大小
@param fontName 字体名称,可以为null使用默认字体
@return {@link Font}
"""
final Font font = workbook.createFont();
return setFontStyle... | java | public static Font createFont(Workbook workbook, short color, short fontSize, String fontName) {
final Font font = workbook.createFont();
return setFontStyle(font, color, fontSize, fontName);
} | [
"public",
"static",
"Font",
"createFont",
"(",
"Workbook",
"workbook",
",",
"short",
"color",
",",
"short",
"fontSize",
",",
"String",
"fontName",
")",
"{",
"final",
"Font",
"font",
"=",
"workbook",
".",
"createFont",
"(",
")",
";",
"return",
"setFontStyle",... | 创建字体
@param workbook {@link Workbook}
@param color 字体颜色
@param fontSize 字体大小
@param fontName 字体名称,可以为null使用默认字体
@return {@link Font} | [
"创建字体"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/style/StyleUtil.java#L120-L123 |
rosette-api/java | api/src/main/java/com/basistech/rosette/api/HttpRosetteAPI.java | HttpRosetteAPI.getSupportedLanguagePairs | @Override
public SupportedLanguagePairsResponse getSupportedLanguagePairs(String endpoint) throws HttpRosetteAPIException {
"""
Gets the set of language, script codes and transliteration scheme pairs supported by the specified Rosette API
endpoint.
@param endpoint Rosette API endpoint.
@return SupportedLa... | java | @Override
public SupportedLanguagePairsResponse getSupportedLanguagePairs(String endpoint) throws HttpRosetteAPIException {
if (NAMES_ENDPOINTS.contains(endpoint) && !NAME_DEDUPLICATION_SERVICE_PATH.equals(endpoint)) {
return sendGetRequest(urlBase + endpoint + SUPPORTED_LANGUAGES_SUBPATH, Supp... | [
"@",
"Override",
"public",
"SupportedLanguagePairsResponse",
"getSupportedLanguagePairs",
"(",
"String",
"endpoint",
")",
"throws",
"HttpRosetteAPIException",
"{",
"if",
"(",
"NAMES_ENDPOINTS",
".",
"contains",
"(",
"endpoint",
")",
"&&",
"!",
"NAME_DEDUPLICATION_SERVICE_... | Gets the set of language, script codes and transliteration scheme pairs supported by the specified Rosette API
endpoint.
@param endpoint Rosette API endpoint.
@return SupportedLanguagePairsResponse
@throws HttpRosetteAPIException for an error returned from the Rosette API. | [
"Gets",
"the",
"set",
"of",
"language",
"script",
"codes",
"and",
"transliteration",
"scheme",
"pairs",
"supported",
"by",
"the",
"specified",
"Rosette",
"API",
"endpoint",
"."
] | train | https://github.com/rosette-api/java/blob/35faf9fbb9c940eae47df004da7639a3b177b80b/api/src/main/java/com/basistech/rosette/api/HttpRosetteAPI.java#L257-L264 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java | Resolve.isInnerSubClass | private boolean isInnerSubClass(ClassSymbol c, Symbol base) {
"""
Is given class a subclass of given base class, or an inner class
of a subclass?
Return null if no such class exists.
@param c The class which is the subclass or is contained in it.
@param base The base class
"""
while (c != ... | java | private boolean isInnerSubClass(ClassSymbol c, Symbol base) {
while (c != null && !c.isSubClass(base, types)) {
c = c.owner.enclClass();
}
return c != null;
} | [
"private",
"boolean",
"isInnerSubClass",
"(",
"ClassSymbol",
"c",
",",
"Symbol",
"base",
")",
"{",
"while",
"(",
"c",
"!=",
"null",
"&&",
"!",
"c",
".",
"isSubClass",
"(",
"base",
",",
"types",
")",
")",
"{",
"c",
"=",
"c",
".",
"owner",
".",
"encl... | Is given class a subclass of given base class, or an inner class
of a subclass?
Return null if no such class exists.
@param c The class which is the subclass or is contained in it.
@param base The base class | [
"Is",
"given",
"class",
"a",
"subclass",
"of",
"given",
"base",
"class",
"or",
"an",
"inner",
"class",
"of",
"a",
"subclass?",
"Return",
"null",
"if",
"no",
"such",
"class",
"exists",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java#L365-L370 |
FINRAOS/JTAF-ExtWebDriver | src/main/java/org/finra/jtaf/ewd/widget/element/Element.java | Element.waitForNotVisible | public void waitForNotVisible(final long time) throws WidgetException {
"""
Waits for specific element at locator to be not visible within period of
specified time
@param time
Milliseconds
@throws WidgetException
"""
try {
waitForCommand(new ITimerCallback() {
@Override
public boolean execu... | java | public void waitForNotVisible(final long time) throws WidgetException {
try {
waitForCommand(new ITimerCallback() {
@Override
public boolean execute() throws WidgetException {
return !isVisible();
}
@Override
public String toString() {
return "Waiting for element with locator: " + l... | [
"public",
"void",
"waitForNotVisible",
"(",
"final",
"long",
"time",
")",
"throws",
"WidgetException",
"{",
"try",
"{",
"waitForCommand",
"(",
"new",
"ITimerCallback",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"execute",
"(",
")",
"throws",
"WidgetE... | Waits for specific element at locator to be not visible within period of
specified time
@param time
Milliseconds
@throws WidgetException | [
"Waits",
"for",
"specific",
"element",
"at",
"locator",
"to",
"be",
"not",
"visible",
"within",
"period",
"of",
"specified",
"time"
] | train | https://github.com/FINRAOS/JTAF-ExtWebDriver/blob/78d646def1bf0904f79b19a81df0241e07f2c73a/src/main/java/org/finra/jtaf/ewd/widget/element/Element.java#L417-L434 |
prestodb/presto | presto-spi/src/main/java/com/facebook/presto/spi/type/TypeUtils.java | TypeUtils.readNativeValue | public static Object readNativeValue(Type type, Block block, int position) {
"""
Get the native value as an object in the value at {@code position} of {@code block}.
"""
Class<?> javaType = type.getJavaType();
if (block.isNull(position)) {
return null;
}
if (javaTyp... | java | public static Object readNativeValue(Type type, Block block, int position)
{
Class<?> javaType = type.getJavaType();
if (block.isNull(position)) {
return null;
}
if (javaType == long.class) {
return type.getLong(block, position);
}
if (javaTyp... | [
"public",
"static",
"Object",
"readNativeValue",
"(",
"Type",
"type",
",",
"Block",
"block",
",",
"int",
"position",
")",
"{",
"Class",
"<",
"?",
">",
"javaType",
"=",
"type",
".",
"getJavaType",
"(",
")",
";",
"if",
"(",
"block",
".",
"isNull",
"(",
... | Get the native value as an object in the value at {@code position} of {@code block}. | [
"Get",
"the",
"native",
"value",
"as",
"an",
"object",
"in",
"the",
"value",
"at",
"{"
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-spi/src/main/java/com/facebook/presto/spi/type/TypeUtils.java#L35-L55 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/history/FsJobArchivist.java | FsJobArchivist.getArchivedJsons | public static Collection<ArchivedJson> getArchivedJsons(Path file) throws IOException {
"""
Reads the given archive file and returns a {@link Collection} of contained {@link ArchivedJson}.
@param file archive to extract
@return collection of archived jsons
@throws IOException if the file can't be opened, read... | java | public static Collection<ArchivedJson> getArchivedJsons(Path file) throws IOException {
try (FSDataInputStream input = file.getFileSystem().open(file);
ByteArrayOutputStream output = new ByteArrayOutputStream()) {
IOUtils.copyBytes(input, output);
JsonNode archive = mapper.readTree(output.toByteArray());
... | [
"public",
"static",
"Collection",
"<",
"ArchivedJson",
">",
"getArchivedJsons",
"(",
"Path",
"file",
")",
"throws",
"IOException",
"{",
"try",
"(",
"FSDataInputStream",
"input",
"=",
"file",
".",
"getFileSystem",
"(",
")",
".",
"open",
"(",
"file",
")",
";",... | Reads the given archive file and returns a {@link Collection} of contained {@link ArchivedJson}.
@param file archive to extract
@return collection of archived jsons
@throws IOException if the file can't be opened, read or doesn't contain valid json | [
"Reads",
"the",
"given",
"archive",
"file",
"and",
"returns",
"a",
"{",
"@link",
"Collection",
"}",
"of",
"contained",
"{",
"@link",
"ArchivedJson",
"}",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/history/FsJobArchivist.java#L107-L122 |
liferay/com-liferay-commerce | commerce-shipping-engine-fixed-api/src/main/java/com/liferay/commerce/shipping/engine/fixed/model/CommerceShippingFixedOptionWrapper.java | CommerceShippingFixedOptionWrapper.getName | @Override
public String getName(String languageId, boolean useDefault) {
"""
Returns the localized name of this commerce shipping fixed option in the language, optionally using the default language if no localization exists for the requested language.
@param languageId the ID of the language
@param useDefault... | java | @Override
public String getName(String languageId, boolean useDefault) {
return _commerceShippingFixedOption.getName(languageId, useDefault);
} | [
"@",
"Override",
"public",
"String",
"getName",
"(",
"String",
"languageId",
",",
"boolean",
"useDefault",
")",
"{",
"return",
"_commerceShippingFixedOption",
".",
"getName",
"(",
"languageId",
",",
"useDefault",
")",
";",
"}"
] | Returns the localized name of this commerce shipping fixed option in the language, optionally using the default language if no localization exists for the requested language.
@param languageId the ID of the language
@param useDefault whether to use the default language if no localization exists for the requested langu... | [
"Returns",
"the",
"localized",
"name",
"of",
"this",
"commerce",
"shipping",
"fixed",
"option",
"in",
"the",
"language",
"optionally",
"using",
"the",
"default",
"language",
"if",
"no",
"localization",
"exists",
"for",
"the",
"requested",
"language",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-shipping-engine-fixed-api/src/main/java/com/liferay/commerce/shipping/engine/fixed/model/CommerceShippingFixedOptionWrapper.java#L383-L386 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/LdapConnection.java | LdapConnection.modifyAttributes | public void modifyAttributes(String name, ModificationItem[] mods) throws NamingException, WIMException {
"""
Modify the given LDAP name according to the specified modification items.
@param dn The distinguished name to modify attributes on.
@param mod_op The operation to perform.
@param mods The modification... | java | public void modifyAttributes(String name, ModificationItem[] mods) throws NamingException, WIMException {
TimedDirContext ctx = iContextManager.getDirContext();
// checkWritePermission(ctx); TODO Why are we not checking for permission here?
try {
try {
ctx.modifyAttri... | [
"public",
"void",
"modifyAttributes",
"(",
"String",
"name",
",",
"ModificationItem",
"[",
"]",
"mods",
")",
"throws",
"NamingException",
",",
"WIMException",
"{",
"TimedDirContext",
"ctx",
"=",
"iContextManager",
".",
"getDirContext",
"(",
")",
";",
"// checkWrit... | Modify the given LDAP name according to the specified modification items.
@param dn The distinguished name to modify attributes on.
@param mod_op The operation to perform.
@param mods The modification items.
@throws NamingException If there was an issue writing the new attribute values.
@throws WIMException If there w... | [
"Modify",
"the",
"given",
"LDAP",
"name",
"according",
"to",
"the",
"specified",
"modification",
"items",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/LdapConnection.java#L2131-L2152 |
Wikidata/Wikidata-Toolkit | wdtk-examples/src/main/java/org/wikidata/wdtk/examples/EntityStatisticsProcessor.java | EntityStatisticsProcessor.countKey | private void countKey(Map<String, Integer> map, String key, int count) {
"""
Helper method that stores in a hash map how often a certain key occurs.
If the key has not been encountered yet, a new entry is created for it in
the map. Otherwise the existing value for the key is incremented.
@param map
the map w... | java | private void countKey(Map<String, Integer> map, String key, int count) {
if (map.containsKey(key)) {
map.put(key, map.get(key) + count);
} else {
map.put(key, count);
}
} | [
"private",
"void",
"countKey",
"(",
"Map",
"<",
"String",
",",
"Integer",
">",
"map",
",",
"String",
"key",
",",
"int",
"count",
")",
"{",
"if",
"(",
"map",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"map",
".",
"put",
"(",
"key",
",",
"map",... | Helper method that stores in a hash map how often a certain key occurs.
If the key has not been encountered yet, a new entry is created for it in
the map. Otherwise the existing value for the key is incremented.
@param map
the map where the counts are stored
@param key
the key to be counted
@param count
value by which... | [
"Helper",
"method",
"that",
"stores",
"in",
"a",
"hash",
"map",
"how",
"often",
"a",
"certain",
"key",
"occurs",
".",
"If",
"the",
"key",
"has",
"not",
"been",
"encountered",
"yet",
"a",
"new",
"entry",
"is",
"created",
"for",
"it",
"in",
"the",
"map",... | train | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-examples/src/main/java/org/wikidata/wdtk/examples/EntityStatisticsProcessor.java#L441-L447 |
opencb/biodata | biodata-tools/src/main/java/org/opencb/biodata/tools/variant/algorithm/IdentityByStateClustering.java | IdentityByStateClustering.countSharedAlleles | public int countSharedAlleles(int allelesCount, Genotype genotypeFirst, Genotype genotypeSecond) {
"""
Counts the amount of shared alleles in two individuals.
This is which IBS kind is this pair: IBS0, IBS1 or IBS2.
The idea is to count how many alleles there are of each kind: for instance, 0 reference alleles f... | java | public int countSharedAlleles(int allelesCount, Genotype genotypeFirst, Genotype genotypeSecond) {
// amount of different alleles: reference, alternate. other alleles (missing, or multiallelic) are ignored
int[] allelesCountsFirst = new int[2];
int[] allelesCountsSecond = new int[2];
f... | [
"public",
"int",
"countSharedAlleles",
"(",
"int",
"allelesCount",
",",
"Genotype",
"genotypeFirst",
",",
"Genotype",
"genotypeSecond",
")",
"{",
"// amount of different alleles: reference, alternate. other alleles (missing, or multiallelic) are ignored",
"int",
"[",
"]",
"allele... | Counts the amount of shared alleles in two individuals.
This is which IBS kind is this pair: IBS0, IBS1 or IBS2.
The idea is to count how many alleles there are of each kind: for instance, 0 reference alleles for individual 1
and 2 reference alleles for individual 2, and then count the alternate alleles. Then take the ... | [
"Counts",
"the",
"amount",
"of",
"shared",
"alleles",
"in",
"two",
"individuals",
".",
"This",
"is",
"which",
"IBS",
"kind",
"is",
"this",
"pair",
":",
"IBS0",
"IBS1",
"or",
"IBS2",
".",
"The",
"idea",
"is",
"to",
"count",
"how",
"many",
"alleles",
"th... | train | https://github.com/opencb/biodata/blob/21b3d51d71f578efab908422aca4bab7a73097b1/biodata-tools/src/main/java/org/opencb/biodata/tools/variant/algorithm/IdentityByStateClustering.java#L108-L131 |
lastaflute/lastaflute | src/main/java/org/lastaflute/web/LastaAction.java | LastaAction.redirectByParam | protected HtmlResponse redirectByParam(Class<?> actionType, Object... params) {
"""
Redirect to the action (index method) by the parameters on GET.
<pre>
<span style="color: #3F7E5E">// e.g. /member/edit/?foo=3</span>
return redirectByParam(MemberEditAction.class, "foo", 3);
<span style="color: #3F7E5E">// e... | java | protected HtmlResponse redirectByParam(Class<?> actionType, Object... params) {
assertArgumentNotNull("actionType", actionType);
assertArgumentNotNull("params", params);
return redirectWith(actionType, params(params));
} | [
"protected",
"HtmlResponse",
"redirectByParam",
"(",
"Class",
"<",
"?",
">",
"actionType",
",",
"Object",
"...",
"params",
")",
"{",
"assertArgumentNotNull",
"(",
"\"actionType\"",
",",
"actionType",
")",
";",
"assertArgumentNotNull",
"(",
"\"params\"",
",",
"para... | Redirect to the action (index method) by the parameters on GET.
<pre>
<span style="color: #3F7E5E">// e.g. /member/edit/?foo=3</span>
return redirectByParam(MemberEditAction.class, "foo", 3);
<span style="color: #3F7E5E">// e.g. /member/edit/?foo=3&bar=qux</span>
return redirectByParam(MemberEditAction.class, "foo... | [
"Redirect",
"to",
"the",
"action",
"(",
"index",
"method",
")",
"by",
"the",
"parameters",
"on",
"GET",
".",
"<pre",
">",
"<span",
"style",
"=",
"color",
":",
"#3F7E5E",
">",
"//",
"e",
".",
"g",
".",
"/",
"member",
"/",
"edit",
"/",
"?foo",
"=",
... | train | https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/web/LastaAction.java#L306-L310 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.lockResource | public void lockResource(CmsRequestContext context, CmsResource resource, CmsLockType type) throws CmsException {
"""
Locks a resource.<p>
The <code>type</code> parameter controls what kind of lock is used.<br>
Possible values for this parameter are: <br>
<ul>
<li><code>{@link org.opencms.lock.CmsLockType#EX... | java | public void lockResource(CmsRequestContext context, CmsResource resource, CmsLockType type) throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
checkOfflineProject(dbc);
checkPermissions(dbc, resource, CmsPermissionSet.ACCESS_WRITE, false, Cm... | [
"public",
"void",
"lockResource",
"(",
"CmsRequestContext",
"context",
",",
"CmsResource",
"resource",
",",
"CmsLockType",
"type",
")",
"throws",
"CmsException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext",
"(",
"context",
")",
";",
... | Locks a resource.<p>
The <code>type</code> parameter controls what kind of lock is used.<br>
Possible values for this parameter are: <br>
<ul>
<li><code>{@link org.opencms.lock.CmsLockType#EXCLUSIVE}</code></li>
<li><code>{@link org.opencms.lock.CmsLockType#TEMPORARY}</code></li>
<li><code>{@link org.opencms.lock.CmsL... | [
"Locks",
"a",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L3562-L3583 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/SpriteSheet.java | SpriteSheet.getSubImage | public Image getSubImage(int x, int y) {
"""
Get the sub image cached in this sprite sheet
@param x The x position in tiles of the image to get
@param y The y position in tiles of the image to get
@return The subimage at that location on the sheet
"""
init();
if ((x < 0) || (x >= subImages.lengt... | java | public Image getSubImage(int x, int y) {
init();
if ((x < 0) || (x >= subImages.length)) {
throw new RuntimeException("SubImage out of sheet bounds: "+x+","+y);
}
if ((y < 0) || (y >= subImages[0].length)) {
throw new RuntimeException("SubImage out of sheet bounds: "+x+","+y);
}
return... | [
"public",
"Image",
"getSubImage",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"init",
"(",
")",
";",
"if",
"(",
"(",
"x",
"<",
"0",
")",
"||",
"(",
"x",
">=",
"subImages",
".",
"length",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"... | Get the sub image cached in this sprite sheet
@param x The x position in tiles of the image to get
@param y The y position in tiles of the image to get
@return The subimage at that location on the sheet | [
"Get",
"the",
"sub",
"image",
"cached",
"in",
"this",
"sprite",
"sheet"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/SpriteSheet.java#L198-L209 |
intellimate/Izou | src/main/java/org/intellimate/izou/security/SocketPermissionModule.java | SocketPermissionModule.checkPermission | @Override
public void checkPermission(Permission permission, AddOnModel addon) throws IzouPermissionException {
"""
Checks if the given addOn is allowed to access the requested service and registers them if not yet registered.
@param permission the Permission to check
@param addon the identifiable to ... | java | @Override
public void checkPermission(Permission permission, AddOnModel addon) throws IzouPermissionException {
for (String socket : allowedSocketConnections) {
if (permission.getName().contains(socket)) {
return;
}
}
if (isRegistered(addon))
... | [
"@",
"Override",
"public",
"void",
"checkPermission",
"(",
"Permission",
"permission",
",",
"AddOnModel",
"addon",
")",
"throws",
"IzouPermissionException",
"{",
"for",
"(",
"String",
"socket",
":",
"allowedSocketConnections",
")",
"{",
"if",
"(",
"permission",
".... | Checks if the given addOn is allowed to access the requested service and registers them if not yet registered.
@param permission the Permission to check
@param addon the identifiable to check
@throws IzouPermissionException thrown if the addOn is not allowed to access its requested service | [
"Checks",
"if",
"the",
"given",
"addOn",
"is",
"allowed",
"to",
"access",
"the",
"requested",
"service",
"and",
"registers",
"them",
"if",
"not",
"yet",
"registered",
"."
] | train | https://github.com/intellimate/Izou/blob/40a808b97998e17655c4a78e30ce7326148aed27/src/main/java/org/intellimate/izou/security/SocketPermissionModule.java#L54-L83 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/metadata/URLMatchingUtils.java | URLMatchingUtils.isExtensionMatch | public static boolean isExtensionMatch(String uriName, String urlPattern) {
"""
Determine if the urlPattern is an extension match for the uriName.
@param uriName
@param urlPattern
@return
"""
if (urlPattern.startsWith("*.")) {
String ext = urlPattern.substring(1);
if (uriNa... | java | public static boolean isExtensionMatch(String uriName, String urlPattern) {
if (urlPattern.startsWith("*.")) {
String ext = urlPattern.substring(1);
if (uriName.endsWith(ext)) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"isExtensionMatch",
"(",
"String",
"uriName",
",",
"String",
"urlPattern",
")",
"{",
"if",
"(",
"urlPattern",
".",
"startsWith",
"(",
"\"*.\"",
")",
")",
"{",
"String",
"ext",
"=",
"urlPattern",
".",
"substring",
"(",
"1",
")... | Determine if the urlPattern is an extension match for the uriName.
@param uriName
@param urlPattern
@return | [
"Determine",
"if",
"the",
"urlPattern",
"is",
"an",
"extension",
"match",
"for",
"the",
"uriName",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/metadata/URLMatchingUtils.java#L122-L130 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/hyphenation/TernaryTree.java | TernaryTree.insertBalanced | protected void insertBalanced(String[] k, char[] v, int offset, int n) {
"""
Recursively insert the median first and then the median of the
lower and upper halves, and so on in order to get a balanced
tree. The array of keys is assumed to be sorted in ascending
order.
"""
int m;
if (n < 1) {... | java | protected void insertBalanced(String[] k, char[] v, int offset, int n) {
int m;
if (n < 1) {
return;
}
m = n >> 1;
insert(k[m + offset], v[m + offset]);
insertBalanced(k, v, offset, m);
insertBalanced(k, v, offset + m + 1, n - m - 1);
} | [
"protected",
"void",
"insertBalanced",
"(",
"String",
"[",
"]",
"k",
",",
"char",
"[",
"]",
"v",
",",
"int",
"offset",
",",
"int",
"n",
")",
"{",
"int",
"m",
";",
"if",
"(",
"n",
"<",
"1",
")",
"{",
"return",
";",
"}",
"m",
"=",
"n",
">>",
... | Recursively insert the median first and then the median of the
lower and upper halves, and so on in order to get a balanced
tree. The array of keys is assumed to be sorted in ascending
order. | [
"Recursively",
"insert",
"the",
"median",
"first",
"and",
"then",
"the",
"median",
"of",
"the",
"lower",
"and",
"upper",
"halves",
"and",
"so",
"on",
"in",
"order",
"to",
"get",
"a",
"balanced",
"tree",
".",
"The",
"array",
"of",
"keys",
"is",
"assumed",... | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/hyphenation/TernaryTree.java#L369-L380 |
dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/v1/DbxClientV1.java | DbxClientV1.uploadFile | public DbxEntry.File uploadFile(String targetPath, DbxWriteMode writeMode, long numBytes, InputStream contents)
throws DbxException, IOException {
"""
A wrapper around {@link #uploadFile(String, DbxWriteMode, long, DbxStreamWriter)} that
lets you pass in an {@link InputStream}. The entire stream {@code c... | java | public DbxEntry.File uploadFile(String targetPath, DbxWriteMode writeMode, long numBytes, InputStream contents)
throws DbxException, IOException
{
return uploadFile(targetPath, writeMode, numBytes, new DbxStreamWriter.InputStreamCopier(contents));
} | [
"public",
"DbxEntry",
".",
"File",
"uploadFile",
"(",
"String",
"targetPath",
",",
"DbxWriteMode",
"writeMode",
",",
"long",
"numBytes",
",",
"InputStream",
"contents",
")",
"throws",
"DbxException",
",",
"IOException",
"{",
"return",
"uploadFile",
"(",
"targetPat... | A wrapper around {@link #uploadFile(String, DbxWriteMode, long, DbxStreamWriter)} that
lets you pass in an {@link InputStream}. The entire stream {@code contents} will
be uploaded.
<pre>
DbxClientV1 dbxClient = ...
File f = new File("ReadMe.txt")
dbxClient.uploadFile("/ReadMe.txt", {@link DbxWriteMode#add()}, f.lengt... | [
"A",
"wrapper",
"around",
"{",
"@link",
"#uploadFile",
"(",
"String",
"DbxWriteMode",
"long",
"DbxStreamWriter",
")",
"}",
"that",
"lets",
"you",
"pass",
"in",
"an",
"{",
"@link",
"InputStream",
"}",
".",
"The",
"entire",
"stream",
"{",
"@code",
"contents",
... | train | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v1/DbxClientV1.java#L600-L604 |
js-lib-com/commons | src/main/java/js/util/Params.java | Params.belongsTo | public static void belongsTo(File directory, File parameter, String name) throws IllegalArgumentException {
"""
Check if file parameter belongs to requested directory. This predicate test if given <code>directory</code> is ancestor
of <code>parameter</code> file.
@param directory directory supposed to be ances... | java | public static void belongsTo(File directory, File parameter, String name) throws IllegalArgumentException {
String dirPath = directory.getAbsolutePath();
String filePath = parameter.getAbsolutePath();
if (!filePath.startsWith(dirPath)) {
throw new IllegalArgumentException(String.format("%s |%s| is outside ... | [
"public",
"static",
"void",
"belongsTo",
"(",
"File",
"directory",
",",
"File",
"parameter",
",",
"String",
"name",
")",
"throws",
"IllegalArgumentException",
"{",
"String",
"dirPath",
"=",
"directory",
".",
"getAbsolutePath",
"(",
")",
";",
"String",
"filePath"... | Check if file parameter belongs to requested directory. This predicate test if given <code>directory</code> is ancestor
of <code>parameter</code> file.
@param directory directory supposed to be ancestor of file parameter,
@param parameter invocation file parameter,
@param name parameter name.
@throws IllegalArgumentEx... | [
"Check",
"if",
"file",
"parameter",
"belongs",
"to",
"requested",
"directory",
".",
"This",
"predicate",
"test",
"if",
"given",
"<code",
">",
"directory<",
"/",
"code",
">",
"is",
"ancestor",
"of",
"<code",
">",
"parameter<",
"/",
"code",
">",
"file",
"."
... | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Params.java#L205-L211 |
joachimvda/jtransfo | core/src/main/java/org/jtransfo/internal/TaggedConverter.java | TaggedConverter.addConverters | public void addConverters(Converter converter, String... tags) {
"""
Add the converter which should be used for a specific tag.
@param tags tags for which the converter applies
@param converter converter for the tag
"""
for (String tag : tags) {
if (tag.startsWith("!")) {
... | java | public void addConverters(Converter converter, String... tags) {
for (String tag : tags) {
if (tag.startsWith("!")) {
notConverters.put(tag.substring(1), converter);
} else {
converters.put(tag, converter);
}
}
} | [
"public",
"void",
"addConverters",
"(",
"Converter",
"converter",
",",
"String",
"...",
"tags",
")",
"{",
"for",
"(",
"String",
"tag",
":",
"tags",
")",
"{",
"if",
"(",
"tag",
".",
"startsWith",
"(",
"\"!\"",
")",
")",
"{",
"notConverters",
".",
"put",... | Add the converter which should be used for a specific tag.
@param tags tags for which the converter applies
@param converter converter for the tag | [
"Add",
"the",
"converter",
"which",
"should",
"be",
"used",
"for",
"a",
"specific",
"tag",
"."
] | train | https://github.com/joachimvda/jtransfo/blob/eb1c72b64b09d6f3b6212bd3f1579cac5c983ea8/core/src/main/java/org/jtransfo/internal/TaggedConverter.java#L34-L42 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/tools/offlineEditsViewer/XmlEditsVisitor.java | XmlEditsVisitor.writeTag | private void writeTag(String tag, String value) throws IOException {
"""
Write an XML tag
@param tag a tag name
@param value a tag value
"""
printIndents();
if(value.length() > 0) {
write("<" + tag + ">" + value + "</" + tag + ">\n");
} else {
write("<" + tag + "/>\n");
}
} | java | private void writeTag(String tag, String value) throws IOException {
printIndents();
if(value.length() > 0) {
write("<" + tag + ">" + value + "</" + tag + ">\n");
} else {
write("<" + tag + "/>\n");
}
} | [
"private",
"void",
"writeTag",
"(",
"String",
"tag",
",",
"String",
"value",
")",
"throws",
"IOException",
"{",
"printIndents",
"(",
")",
";",
"if",
"(",
"value",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"write",
"(",
"\"<\"",
"+",
"tag",
"+",
... | Write an XML tag
@param tag a tag name
@param value a tag value | [
"Write",
"an",
"XML",
"tag"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/tools/offlineEditsViewer/XmlEditsVisitor.java#L136-L143 |
wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java | Util.getStringProperty | public static String getStringProperty(Map<String, Object> properties, String key, String defaultVal) {
"""
Get string type property value from a property map.
<p>
If {@code properties} is null or property value is null, default value is returned
@param properties map of properties
@param key property... | java | public static String getStringProperty(Map<String, Object> properties, String key, String defaultVal) {
if (properties == null) {
return defaultVal;
}
Object propertyVal = properties.get(key);
if (propertyVal == null) {
return defaultVal;
}
if ... | [
"public",
"static",
"String",
"getStringProperty",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
",",
"String",
"key",
",",
"String",
"defaultVal",
")",
"{",
"if",
"(",
"properties",
"==",
"null",
")",
"{",
"return",
"defaultVal",
";",
"}",
... | Get string type property value from a property map.
<p>
If {@code properties} is null or property value is null, default value is returned
@param properties map of properties
@param key property name
@param defaultVal default value of the property
@return integer value of the property, | [
"Get",
"string",
"type",
"property",
"value",
"from",
"a",
"property",
"map",
".",
"<p",
">",
"If",
"{",
"@code",
"properties",
"}",
"is",
"null",
"or",
"property",
"value",
"is",
"null",
"default",
"value",
"is",
"returned"
] | train | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java#L437-L454 |
gwt-maven-plugin/gwt-maven-plugin | src/main/java/org/codehaus/mojo/gwt/AbstractGwtMojo.java | AbstractGwtMojo.addClasspathElements | protected int addClasspathElements( Collection<?> elements, URL[] urls, int startPosition )
throws MojoExecutionException {
"""
Add classpath elements to a classpath URL set
@param elements the initial URL set
@param urls the urls to add
@param startPosition the position to insert URLS
@return full c... | java | protected int addClasspathElements( Collection<?> elements, URL[] urls, int startPosition )
throws MojoExecutionException
{
for ( Object object : elements )
{
try
{
if ( object instanceof Artifact )
{
urls[startPosit... | [
"protected",
"int",
"addClasspathElements",
"(",
"Collection",
"<",
"?",
">",
"elements",
",",
"URL",
"[",
"]",
"urls",
",",
"int",
"startPosition",
")",
"throws",
"MojoExecutionException",
"{",
"for",
"(",
"Object",
"object",
":",
"elements",
")",
"{",
"try... | Add classpath elements to a classpath URL set
@param elements the initial URL set
@param urls the urls to add
@param startPosition the position to insert URLS
@return full classpath URL set
@throws MojoExecutionException some error occured | [
"Add",
"classpath",
"elements",
"to",
"a",
"classpath",
"URL",
"set"
] | train | https://github.com/gwt-maven-plugin/gwt-maven-plugin/blob/0cdd5054b43f182cc22a8acf61ec79ac42b0dfdc/src/main/java/org/codehaus/mojo/gwt/AbstractGwtMojo.java#L184-L213 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/job/InstallRequest.java | InstallRequest.setExtensionProperty | public Object setExtensionProperty(String key, Object value) {
"""
Sets a custom extension property to be set on each of the extensions that are going to be installed from this
request.
@param key the property name
@param value the new property value
@return the previous property value
@since 7.0M2
"""
... | java | public Object setExtensionProperty(String key, Object value)
{
return getExtensionProperties().put(key, value);
} | [
"public",
"Object",
"setExtensionProperty",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"return",
"getExtensionProperties",
"(",
")",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Sets a custom extension property to be set on each of the extensions that are going to be installed from this
request.
@param key the property name
@param value the new property value
@return the previous property value
@since 7.0M2 | [
"Sets",
"a",
"custom",
"extension",
"property",
"to",
"be",
"set",
"on",
"each",
"of",
"the",
"extensions",
"that",
"are",
"going",
"to",
"be",
"installed",
"from",
"this",
"request",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/job/InstallRequest.java#L84-L87 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java | VirtualCdj.findMatchingAddress | private InterfaceAddress findMatchingAddress(DeviceAnnouncement aDevice, NetworkInterface networkInterface) {
"""
Scan a network interface to find if it has an address space which matches the device we are trying to reach.
If so, return the address specification.
@param aDevice the DJ Link device we are trying... | java | private InterfaceAddress findMatchingAddress(DeviceAnnouncement aDevice, NetworkInterface networkInterface) {
for (InterfaceAddress address : networkInterface.getInterfaceAddresses()) {
if ((address.getBroadcast() != null) &&
Util.sameNetwork(address.getNetworkPrefixLength(), aDe... | [
"private",
"InterfaceAddress",
"findMatchingAddress",
"(",
"DeviceAnnouncement",
"aDevice",
",",
"NetworkInterface",
"networkInterface",
")",
"{",
"for",
"(",
"InterfaceAddress",
"address",
":",
"networkInterface",
".",
"getInterfaceAddresses",
"(",
")",
")",
"{",
"if",... | Scan a network interface to find if it has an address space which matches the device we are trying to reach.
If so, return the address specification.
@param aDevice the DJ Link device we are trying to communicate with
@param networkInterface the network interface we are testing
@return the address which can be used to... | [
"Scan",
"a",
"network",
"interface",
"to",
"find",
"if",
"it",
"has",
"an",
"address",
"space",
"which",
"matches",
"the",
"device",
"we",
"are",
"trying",
"to",
"reach",
".",
"If",
"so",
"return",
"the",
"address",
"specification",
"."
] | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java#L477-L485 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRCamera.java | GVRCamera.addPostEffect | public void addPostEffect(GVRMaterial postEffectData) {
"""
Add a post-effect to this camera's render chain.
Post-effects are GL shaders, applied to the texture (hardware bitmap)
containing the rendered scene graph. Each post-effect combines a shader
selector with a set of parameters: This lets you pass diffe... | java | public void addPostEffect(GVRMaterial postEffectData) {
GVRContext ctx = getGVRContext();
if (mPostEffects == null)
{
mPostEffects = new GVRRenderData(ctx, postEffectData);
GVRMesh dummyMesh = new GVRMesh(getGVRContext(),"float3 a_position float2 a_texcoord");
... | [
"public",
"void",
"addPostEffect",
"(",
"GVRMaterial",
"postEffectData",
")",
"{",
"GVRContext",
"ctx",
"=",
"getGVRContext",
"(",
")",
";",
"if",
"(",
"mPostEffects",
"==",
"null",
")",
"{",
"mPostEffects",
"=",
"new",
"GVRRenderData",
"(",
"ctx",
",",
"pos... | Add a post-effect to this camera's render chain.
Post-effects are GL shaders, applied to the texture (hardware bitmap)
containing the rendered scene graph. Each post-effect combines a shader
selector with a set of parameters: This lets you pass different
parameters to the shaders for each eye.
@param postEffectData
P... | [
"Add",
"a",
"post",
"-",
"effect",
"to",
"this",
"camera",
"s",
"render",
"chain",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRCamera.java#L214-L231 |
padrig64/ValidationFramework | validationframework-core/src/main/java/com/google/code/validationframework/base/property/AbstractReadableListProperty.java | AbstractReadableListProperty.doNotifyListenersOfAddedValues | protected void doNotifyListenersOfAddedValues(int startIndex, List<R> newItems) {
"""
Notifies the change listeners that items have been added.
<p>
Note that the specified list of items will be wrapped in an unmodifiable list before being passed to the
listeners.
@param startIndex Index of the first added it... | java | protected void doNotifyListenersOfAddedValues(int startIndex, List<R> newItems) {
List<ListValueChangeListener<R>> listenersCopy = new ArrayList<ListValueChangeListener<R>>(listeners);
List<R> unmodifiable = Collections.unmodifiableList(newItems);
for (ListValueChangeListener<R> listener : liste... | [
"protected",
"void",
"doNotifyListenersOfAddedValues",
"(",
"int",
"startIndex",
",",
"List",
"<",
"R",
">",
"newItems",
")",
"{",
"List",
"<",
"ListValueChangeListener",
"<",
"R",
">>",
"listenersCopy",
"=",
"new",
"ArrayList",
"<",
"ListValueChangeListener",
"<"... | Notifies the change listeners that items have been added.
<p>
Note that the specified list of items will be wrapped in an unmodifiable list before being passed to the
listeners.
@param startIndex Index of the first added item.
@param newItems Newly added items. | [
"Notifies",
"the",
"change",
"listeners",
"that",
"items",
"have",
"been",
"added",
".",
"<p",
">",
"Note",
"that",
"the",
"specified",
"list",
"of",
"items",
"will",
"be",
"wrapped",
"in",
"an",
"unmodifiable",
"list",
"before",
"being",
"passed",
"to",
"... | train | https://github.com/padrig64/ValidationFramework/blob/2dd3c7b3403993db366d24a927645f467ccd1dda/validationframework-core/src/main/java/com/google/code/validationframework/base/property/AbstractReadableListProperty.java#L91-L97 |
stratosphere/stratosphere | stratosphere-java/src/main/java/eu/stratosphere/api/java/ExecutionEnvironment.java | ExecutionEnvironment.registerCachedFile | public void registerCachedFile(String filePath, String name) {
"""
Registers a file at the distributed cache under the given name. The file will be accessible
from any user-defined function in the (distributed) runtime under a local path. Files
may be local files, or files in a distributed file system. The runti... | java | public void registerCachedFile(String filePath, String name){
this.cacheFile.add(new Tuple2<String, String>(filePath, name));
} | [
"public",
"void",
"registerCachedFile",
"(",
"String",
"filePath",
",",
"String",
"name",
")",
"{",
"this",
".",
"cacheFile",
".",
"add",
"(",
"new",
"Tuple2",
"<",
"String",
",",
"String",
">",
"(",
"filePath",
",",
"name",
")",
")",
";",
"}"
] | Registers a file at the distributed cache under the given name. The file will be accessible
from any user-defined function in the (distributed) runtime under a local path. Files
may be local files, or files in a distributed file system. The runtime will copy the files
temporarily to a local cache, if needed.
<p>
The {@... | [
"Registers",
"a",
"file",
"at",
"the",
"distributed",
"cache",
"under",
"the",
"given",
"name",
".",
"The",
"file",
"will",
"be",
"accessible",
"from",
"any",
"user",
"-",
"defined",
"function",
"in",
"the",
"(",
"distributed",
")",
"runtime",
"under",
"a"... | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-java/src/main/java/eu/stratosphere/api/java/ExecutionEnvironment.java#L556-L558 |
baasbox/Android-SDK | library/src/main/java/com/baasbox/android/BaasAsset.java | BaasAsset.fetchDataSync | public static BaasResult<JsonObject> fetchDataSync(String id) {
"""
Synchronously retrieves named assets data,
If the named asset is a document, the document is retrieved
otherwise attached data to the file are returned.
@param id the name of the asset
@return a baas result wrapping the response.
"""
... | java | public static BaasResult<JsonObject> fetchDataSync(String id){
if (id == null) throw new IllegalArgumentException("asset id cannot be null");
BaasBox box = BaasBox.getDefaultChecked();
AssetDataRequest req = new AssetDataRequest(box,id, RequestOptions.DEFAULT,null);
return box.submitSync... | [
"public",
"static",
"BaasResult",
"<",
"JsonObject",
">",
"fetchDataSync",
"(",
"String",
"id",
")",
"{",
"if",
"(",
"id",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"asset id cannot be null\"",
")",
";",
"BaasBox",
"box",
"=",
"Baas... | Synchronously retrieves named assets data,
If the named asset is a document, the document is retrieved
otherwise attached data to the file are returned.
@param id the name of the asset
@return a baas result wrapping the response. | [
"Synchronously",
"retrieves",
"named",
"assets",
"data",
"If",
"the",
"named",
"asset",
"is",
"a",
"document",
"the",
"document",
"is",
"retrieved",
"otherwise",
"attached",
"data",
"to",
"the",
"file",
"are",
"returned",
"."
] | train | https://github.com/baasbox/Android-SDK/blob/6bb2203246b885b2ad63a7bfaf37c83caf15e0d8/library/src/main/java/com/baasbox/android/BaasAsset.java#L71-L76 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/common/CommsUtils.java | CommsUtils.getRuntimeProperty | public static String getRuntimeProperty(String property, String defaultValue) {
"""
This method will get a runtime property from the sib.properties file.
@param property The property key used to look up in the file.
@param defaultValue The default value if the property is not in the file.
@return Returns the ... | java | public static String getRuntimeProperty(String property, String defaultValue)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getRuntimeProperty", new Object[] {property, defaultValue});
String runtimeProp = RuntimeInfo.getPr... | [
"public",
"static",
"String",
"getRuntimeProperty",
"(",
"String",
"property",
",",
"String",
"defaultValue",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
... | This method will get a runtime property from the sib.properties file.
@param property The property key used to look up in the file.
@param defaultValue The default value if the property is not in the file.
@return Returns the property value. | [
"This",
"method",
"will",
"get",
"a",
"runtime",
"property",
"from",
"the",
"sib",
".",
"properties",
"file",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/common/CommsUtils.java#L59-L68 |
haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/sql/ObjectReader.java | ObjectReader.readObjects | public Object[] readObjects(Class pObjClass, Hashtable pMapping,
Hashtable pWhere) throws SQLException {
"""
Reads all objects from the database, using the given mapping.
This is the most general form of readObjects().
@param objClass The class of the objects to read
@param m... | java | public Object[] readObjects(Class pObjClass, Hashtable pMapping,
Hashtable pWhere) throws SQLException {
return readObjects0(pObjClass, pMapping, pWhere);
} | [
"public",
"Object",
"[",
"]",
"readObjects",
"(",
"Class",
"pObjClass",
",",
"Hashtable",
"pMapping",
",",
"Hashtable",
"pWhere",
")",
"throws",
"SQLException",
"{",
"return",
"readObjects0",
"(",
"pObjClass",
",",
"pMapping",
",",
"pWhere",
")",
";",
"}"
] | Reads all objects from the database, using the given mapping.
This is the most general form of readObjects().
@param objClass The class of the objects to read
@param mapping The hashtable containing the object mapping
@param where An hashtable containing extra criteria for the read
@return An array of Objects, or an ... | [
"Reads",
"all",
"objects",
"from",
"the",
"database",
"using",
"the",
"given",
"mapping",
".",
"This",
"is",
"the",
"most",
"general",
"form",
"of",
"readObjects",
"()",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/sql/ObjectReader.java#L611-L614 |
padrig64/ValidationFramework | validationframework-core/src/main/java/com/google/code/validationframework/base/property/AbstractReadableProperty.java | AbstractReadableProperty.notifyListenersIfUninhibited | private void notifyListenersIfUninhibited(R oldValue, R newValue) {
"""
Notifies the listeners that the property value has changed, if the property is not inhibited.
@param oldValue Previous value.
@param newValue New value.
@see #maybeNotifyListeners(Object, Object)
@see #doNotifyListeners(Object, Object)... | java | private void notifyListenersIfUninhibited(R oldValue, R newValue) {
if (inhibited) {
inhibitCount++;
lastInhibitedValue = newValue;
} else {
lastInhibitedValue = newValue; // Just in case, even though not really necessary
lastNonInhibitedValue = newValue;
... | [
"private",
"void",
"notifyListenersIfUninhibited",
"(",
"R",
"oldValue",
",",
"R",
"newValue",
")",
"{",
"if",
"(",
"inhibited",
")",
"{",
"inhibitCount",
"++",
";",
"lastInhibitedValue",
"=",
"newValue",
";",
"}",
"else",
"{",
"lastInhibitedValue",
"=",
"newV... | Notifies the listeners that the property value has changed, if the property is not inhibited.
@param oldValue Previous value.
@param newValue New value.
@see #maybeNotifyListeners(Object, Object)
@see #doNotifyListeners(Object, Object) | [
"Notifies",
"the",
"listeners",
"that",
"the",
"property",
"value",
"has",
"changed",
"if",
"the",
"property",
"is",
"not",
"inhibited",
"."
] | train | https://github.com/padrig64/ValidationFramework/blob/2dd3c7b3403993db366d24a927645f467ccd1dda/validationframework-core/src/main/java/com/google/code/validationframework/base/property/AbstractReadableProperty.java#L177-L186 |
JadiraOrg/jadira | bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java | BasicBinder.registerMarshaller | public final <S, T> void registerMarshaller(ConverterKey<S,T> key, ToMarshaller<S, T> converter) {
"""
Register a Marshaller with the given source and target class.
The marshaller is used as follows: Instances of the source can be marshalled into the target class.
@param key Converter Key to use
@param converte... | java | public final <S, T> void registerMarshaller(ConverterKey<S,T> key, ToMarshaller<S, T> converter) {
registerConverter(key, new ToMarshallerConverter<S,T>(converter));
} | [
"public",
"final",
"<",
"S",
",",
"T",
">",
"void",
"registerMarshaller",
"(",
"ConverterKey",
"<",
"S",
",",
"T",
">",
"key",
",",
"ToMarshaller",
"<",
"S",
",",
"T",
">",
"converter",
")",
"{",
"registerConverter",
"(",
"key",
",",
"new",
"ToMarshall... | Register a Marshaller with the given source and target class.
The marshaller is used as follows: Instances of the source can be marshalled into the target class.
@param key Converter Key to use
@param converter The ToMarshaller to be registered | [
"Register",
"a",
"Marshaller",
"with",
"the",
"given",
"source",
"and",
"target",
"class",
".",
"The",
"marshaller",
"is",
"used",
"as",
"follows",
":",
"Instances",
"of",
"the",
"source",
"can",
"be",
"marshalled",
"into",
"the",
"target",
"class",
"."
] | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java#L655-L657 |
zxing/zxing | core/src/main/java/com/google/zxing/pdf417/encoder/PDF417.java | PDF417.setDimensions | public void setDimensions(int maxCols, int minCols, int maxRows, int minRows) {
"""
Sets max/min row/col values
@param maxCols maximum allowed columns
@param minCols minimum allowed columns
@param maxRows maximum allowed rows
@param minRows minimum allowed rows
"""
this.maxCols = maxCols;
this.mi... | java | public void setDimensions(int maxCols, int minCols, int maxRows, int minRows) {
this.maxCols = maxCols;
this.minCols = minCols;
this.maxRows = maxRows;
this.minRows = minRows;
} | [
"public",
"void",
"setDimensions",
"(",
"int",
"maxCols",
",",
"int",
"minCols",
",",
"int",
"maxRows",
",",
"int",
"minRows",
")",
"{",
"this",
".",
"maxCols",
"=",
"maxCols",
";",
"this",
".",
"minCols",
"=",
"minCols",
";",
"this",
".",
"maxRows",
"... | Sets max/min row/col values
@param maxCols maximum allowed columns
@param minCols minimum allowed columns
@param maxRows maximum allowed rows
@param minRows minimum allowed rows | [
"Sets",
"max",
"/",
"min",
"row",
"/",
"col",
"values"
] | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/pdf417/encoder/PDF417.java#L739-L744 |
ontop/ontop | mapping/sql/core/src/main/java/it/unibz/inf/ontop/spec/mapping/serializer/TurtleWriter.java | TurtleWriter.put | void put(String subject, String predicate, String object) {
"""
Adding the subject, predicate and object components to this container.
@param subject
The subject term of the Function.
@param predicate
The Function predicate.
@param object
The object term of the Function.
"""
// Subject to Predicates ... | java | void put(String subject, String predicate, String object) {
// Subject to Predicates map
ArrayList<String> predicateList = subjectToPredicates.get(subject);
if (predicateList == null) {
predicateList = new ArrayList<String>();
}
insert(predicateList, predicate);
subjectToPredicates.put(subject, predicate... | [
"void",
"put",
"(",
"String",
"subject",
",",
"String",
"predicate",
",",
"String",
"object",
")",
"{",
"// Subject to Predicates map",
"ArrayList",
"<",
"String",
">",
"predicateList",
"=",
"subjectToPredicates",
".",
"get",
"(",
"subject",
")",
";",
"if",
"(... | Adding the subject, predicate and object components to this container.
@param subject
The subject term of the Function.
@param predicate
The Function predicate.
@param object
The object term of the Function. | [
"Adding",
"the",
"subject",
"predicate",
"and",
"object",
"components",
"to",
"this",
"container",
"."
] | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/mapping/sql/core/src/main/java/it/unibz/inf/ontop/spec/mapping/serializer/TurtleWriter.java#L72-L88 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/requests/restaction/InviteAction.java | InviteAction.setMaxAge | @CheckReturnValue
public final InviteAction setMaxAge(final Long maxAge, final TimeUnit timeUnit) {
"""
Sets the max age for the invite. Set this to {@code 0} if the invite should never expire. Default is {@code 86400} (24 hours).
{@code null} will reset this to the default value.
@param maxAge
The max a... | java | @CheckReturnValue
public final InviteAction setMaxAge(final Long maxAge, final TimeUnit timeUnit)
{
if (maxAge == null)
return this.setMaxAge(null);
Checks.notNegative(maxAge, "maxAge");
Checks.notNull(timeUnit, "timeUnit");
return this.setMaxAge(Math.toIntExact(tim... | [
"@",
"CheckReturnValue",
"public",
"final",
"InviteAction",
"setMaxAge",
"(",
"final",
"Long",
"maxAge",
",",
"final",
"TimeUnit",
"timeUnit",
")",
"{",
"if",
"(",
"maxAge",
"==",
"null",
")",
"return",
"this",
".",
"setMaxAge",
"(",
"null",
")",
";",
"Che... | Sets the max age for the invite. Set this to {@code 0} if the invite should never expire. Default is {@code 86400} (24 hours).
{@code null} will reset this to the default value.
@param maxAge
The max age for this invite or {@code null} to use the default value.
@param timeUnit
The {@link java.util.concurrent.TimeUni... | [
"Sets",
"the",
"max",
"age",
"for",
"the",
"invite",
".",
"Set",
"this",
"to",
"{",
"@code",
"0",
"}",
"if",
"the",
"invite",
"should",
"never",
"expire",
".",
"Default",
"is",
"{",
"@code",
"86400",
"}",
"(",
"24",
"hours",
")",
".",
"{",
"@code",... | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/requests/restaction/InviteAction.java#L116-L126 |
jcuda/jnvgraph | JNvgraphJava/src/main/java/jcuda/jnvgraph/JNvgraph.java | JNvgraph.nvgraphExtractSubgraphByVertex | public static int nvgraphExtractSubgraphByVertex(
nvgraphHandle handle,
nvgraphGraphDescr descrG,
nvgraphGraphDescr subdescrG,
Pointer subvertices,
long numvertices) {
"""
create a new graph by extracting a subgraph given a list of vertices
"""
return checkRe... | java | public static int nvgraphExtractSubgraphByVertex(
nvgraphHandle handle,
nvgraphGraphDescr descrG,
nvgraphGraphDescr subdescrG,
Pointer subvertices,
long numvertices)
{
return checkResult(nvgraphExtractSubgraphByVertexNative(handle, descrG, subdescrG, subvertices, ... | [
"public",
"static",
"int",
"nvgraphExtractSubgraphByVertex",
"(",
"nvgraphHandle",
"handle",
",",
"nvgraphGraphDescr",
"descrG",
",",
"nvgraphGraphDescr",
"subdescrG",
",",
"Pointer",
"subvertices",
",",
"long",
"numvertices",
")",
"{",
"return",
"checkResult",
"(",
"... | create a new graph by extracting a subgraph given a list of vertices | [
"create",
"a",
"new",
"graph",
"by",
"extracting",
"a",
"subgraph",
"given",
"a",
"list",
"of",
"vertices"
] | train | https://github.com/jcuda/jnvgraph/blob/2c6bd7c58edac181753bacf30af2cceeb1989a78/JNvgraphJava/src/main/java/jcuda/jnvgraph/JNvgraph.java#L383-L391 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/parser/JavacParser.java | JavacParser.forInit | List<JCStatement> forInit() {
"""
ForInit = StatementExpression MoreStatementExpressions
| { FINAL | '@' Annotation } Type VariableDeclarators
"""
ListBuffer<JCStatement> stats = new ListBuffer<>();
int pos = token.pos;
if (token.kind == FINAL || token.kind == MONKEYS_AT) {
... | java | List<JCStatement> forInit() {
ListBuffer<JCStatement> stats = new ListBuffer<>();
int pos = token.pos;
if (token.kind == FINAL || token.kind == MONKEYS_AT) {
return variableDeclarators(optFinal(0), parseType(), stats).toList();
} else {
JCExpression t = term(EXPR ... | [
"List",
"<",
"JCStatement",
">",
"forInit",
"(",
")",
"{",
"ListBuffer",
"<",
"JCStatement",
">",
"stats",
"=",
"new",
"ListBuffer",
"<>",
"(",
")",
";",
"int",
"pos",
"=",
"token",
".",
"pos",
";",
"if",
"(",
"token",
".",
"kind",
"==",
"FINAL",
"... | ForInit = StatementExpression MoreStatementExpressions
| { FINAL | '@' Annotation } Type VariableDeclarators | [
"ForInit",
"=",
"StatementExpression",
"MoreStatementExpressions",
"|",
"{",
"FINAL",
"|"
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/parser/JavacParser.java#L2769-L2785 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/TokenizerBase.java | TokenizerBase.debugTokenize | public void debugTokenize(OutputStream outputStream, String text) throws IOException {
"""
Tokenizes the provided text and outputs the corresponding Viterbi lattice and the Viterbi path to the provided output stream
<p>
The output is written in <a href="https://en.wikipedia.org/wiki/DOT_(graph_description_langua... | java | public void debugTokenize(OutputStream outputStream, String text) throws IOException {
ViterbiLattice lattice = viterbiBuilder.build(text);
List<ViterbiNode> bestPath = viterbiSearcher.search(lattice);
outputStream.write(viterbiFormatter.format(lattice, bestPath).getBytes(StandardCharsets.UTF_8... | [
"public",
"void",
"debugTokenize",
"(",
"OutputStream",
"outputStream",
",",
"String",
"text",
")",
"throws",
"IOException",
"{",
"ViterbiLattice",
"lattice",
"=",
"viterbiBuilder",
".",
"build",
"(",
"text",
")",
";",
"List",
"<",
"ViterbiNode",
">",
"bestPath"... | Tokenizes the provided text and outputs the corresponding Viterbi lattice and the Viterbi path to the provided output stream
<p>
The output is written in <a href="https://en.wikipedia.org/wiki/DOT_(graph_description_language)">DOT</a> format.
<p>
This method is not thread safe
@param outputStream output stream to wri... | [
"Tokenizes",
"the",
"provided",
"text",
"and",
"outputs",
"the",
"corresponding",
"Viterbi",
"lattice",
"and",
"the",
"Viterbi",
"path",
"to",
"the",
"provided",
"output",
"stream",
"<p",
">",
"The",
"output",
"is",
"written",
"in",
"<a",
"href",
"=",
"https... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/TokenizerBase.java#L143-L149 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.token.ltpa/src/com/ibm/ws/security/token/ltpa/internal/UserData.java | UserData.addAttributeShort | private final void addAttributeShort(String key, String value) {
"""
Add the attribute name/value pair to a String[] list of values for
the specified key. Once an attribute is set, it cannot only be
appended to but not overwritten. This method does not return any
values.
@param key The name of a attribute
@... | java | private final void addAttributeShort(String key, String value) {
this._toString = null; // reset toString variable
ArrayList<String> array = this._attributes.get(key);
if (array != null) {
if (array.size() > 0) {
if (key.equals("u")) {
return;
... | [
"private",
"final",
"void",
"addAttributeShort",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"this",
".",
"_toString",
"=",
"null",
";",
"// reset toString variable",
"ArrayList",
"<",
"String",
">",
"array",
"=",
"this",
".",
"_attributes",
".",
... | Add the attribute name/value pair to a String[] list of values for
the specified key. Once an attribute is set, it cannot only be
appended to but not overwritten. This method does not return any
values.
@param key The name of a attribute
@param value The value of the attribute | [
"Add",
"the",
"attribute",
"name",
"/",
"value",
"pair",
"to",
"a",
"String",
"[]",
"list",
"of",
"values",
"for",
"the",
"specified",
"key",
".",
"Once",
"an",
"attribute",
"is",
"set",
"it",
"cannot",
"only",
"be",
"appended",
"to",
"but",
"not",
"ov... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.token.ltpa/src/com/ibm/ws/security/token/ltpa/internal/UserData.java#L124-L139 |
line/armeria | saml/src/main/java/com/linecorp/armeria/server/saml/KeyStoreCredentialResolverBuilder.java | KeyStoreCredentialResolverBuilder.addKeyPassword | public KeyStoreCredentialResolverBuilder addKeyPassword(String name, String password) {
"""
Adds a key name and its password to the {@link KeyStoreCredentialResolverBuilder}.
"""
requireNonNull(name, "name");
requireNonNull(password, "password");
checkArgument(!keyPasswords.containsKey(... | java | public KeyStoreCredentialResolverBuilder addKeyPassword(String name, String password) {
requireNonNull(name, "name");
requireNonNull(password, "password");
checkArgument(!keyPasswords.containsKey(name), "key already exists: %s", name);
keyPasswords.put(name, password);
return thi... | [
"public",
"KeyStoreCredentialResolverBuilder",
"addKeyPassword",
"(",
"String",
"name",
",",
"String",
"password",
")",
"{",
"requireNonNull",
"(",
"name",
",",
"\"name\"",
")",
";",
"requireNonNull",
"(",
"password",
",",
"\"password\"",
")",
";",
"checkArgument",
... | Adds a key name and its password to the {@link KeyStoreCredentialResolverBuilder}. | [
"Adds",
"a",
"key",
"name",
"and",
"its",
"password",
"to",
"the",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/saml/src/main/java/com/linecorp/armeria/server/saml/KeyStoreCredentialResolverBuilder.java#L97-L103 |
netheosgithub/pcs_api | java/src/main/java/net/netheos/pcsapi/providers/cloudme/CloudMe.java | CloudMe.getBlobByName | private CMBlob getBlobByName( CMFolder cmFolder, String baseName )
throws ParseException {
"""
Gets a blob according to the parent folder id of the folder.
@param cmFolder parent folder
@param baseName base name of the file to find
@return the CloudMe blob, or null if not found
@throws ParseExcep... | java | private CMBlob getBlobByName( CMFolder cmFolder, String baseName )
throws ParseException
{
StringBuilder innerXml = new StringBuilder();
innerXml.append( "<folder id=" ).append( "'" ).append( cmFolder.getId() ).append( "'" ).append( "/>" )
.append( "<query>" )
... | [
"private",
"CMBlob",
"getBlobByName",
"(",
"CMFolder",
"cmFolder",
",",
"String",
"baseName",
")",
"throws",
"ParseException",
"{",
"StringBuilder",
"innerXml",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"innerXml",
".",
"append",
"(",
"\"<folder id=\"",
")",
"... | Gets a blob according to the parent folder id of the folder.
@param cmFolder parent folder
@param baseName base name of the file to find
@return the CloudMe blob, or null if not found
@throws ParseException | [
"Gets",
"a",
"blob",
"according",
"to",
"the",
"parent",
"folder",
"id",
"of",
"the",
"folder",
"."
] | train | https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/providers/cloudme/CloudMe.java#L219-L242 |
jcuda/jcusparse | JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java | JCusparse.cusparseScsrsm_analysis | public static int cusparseScsrsm_analysis(
cusparseHandle handle,
int transA,
int m,
int nnz,
cusparseMatDescr descrA,
Pointer csrSortedValA,
Pointer csrSortedRowPtrA,
Pointer csrSortedColIndA,
cusparseSolveAnalysisInfo info) {
... | java | public static int cusparseScsrsm_analysis(
cusparseHandle handle,
int transA,
int m,
int nnz,
cusparseMatDescr descrA,
Pointer csrSortedValA,
Pointer csrSortedRowPtrA,
Pointer csrSortedColIndA,
cusparseSolveAnalysisInfo info)
... | [
"public",
"static",
"int",
"cusparseScsrsm_analysis",
"(",
"cusparseHandle",
"handle",
",",
"int",
"transA",
",",
"int",
"m",
",",
"int",
"nnz",
",",
"cusparseMatDescr",
"descrA",
",",
"Pointer",
"csrSortedValA",
",",
"Pointer",
"csrSortedRowPtrA",
",",
"Pointer",... | <pre>
Description: Solution of triangular linear system op(A) * X = alpha * F,
with multiple right-hand-sides, where A is a sparse matrix in CSR storage
format, rhs F and solution X are dense tall matrices.
This routine implements algorithm 1 for this problem.
</pre> | [
"<pre",
">",
"Description",
":",
"Solution",
"of",
"triangular",
"linear",
"system",
"op",
"(",
"A",
")",
"*",
"X",
"=",
"alpha",
"*",
"F",
"with",
"multiple",
"right",
"-",
"hand",
"-",
"sides",
"where",
"A",
"is",
"a",
"sparse",
"matrix",
"in",
"CS... | train | https://github.com/jcuda/jcusparse/blob/7687a62a4ef6b76cb91cf7da93d4cf5ade96a791/JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java#L4300-L4312 |
CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/DataHandler.java | DataHandler.pushGcmRegistrationId | @Deprecated
public void pushGcmRegistrationId(String gcmId, boolean register) {
"""
Sends the GCM registration ID to CleverTap.
@param gcmId The GCM registration ID
@param register Boolean indicating whether to register
or not for receiving push messages from CleverTap.
Set this to true to receive pus... | java | @Deprecated
public void pushGcmRegistrationId(String gcmId, boolean register) {
CleverTapAPI cleverTapAPI = weakReference.get();
if (cleverTapAPI == null) {
Logger.d("CleverTap Instance is null.");
} else {
cleverTapAPI.pushGcmRegistrationId(gcmId, register);
... | [
"@",
"Deprecated",
"public",
"void",
"pushGcmRegistrationId",
"(",
"String",
"gcmId",
",",
"boolean",
"register",
")",
"{",
"CleverTapAPI",
"cleverTapAPI",
"=",
"weakReference",
".",
"get",
"(",
")",
";",
"if",
"(",
"cleverTapAPI",
"==",
"null",
")",
"{",
"L... | Sends the GCM registration ID to CleverTap.
@param gcmId The GCM registration ID
@param register Boolean indicating whether to register
or not for receiving push messages from CleverTap.
Set this to true to receive push messages from CleverTap,
and false to not receive any messages from CleverTap.
@deprecated use {... | [
"Sends",
"the",
"GCM",
"registration",
"ID",
"to",
"CleverTap",
"."
] | train | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/DataHandler.java#L23-L31 |
ksclarke/vertx-pairtree | src/main/java/info/freelibrary/pairtree/PairtreeUtils.java | PairtreeUtils.getEncapsulatingDir | public static String getEncapsulatingDir(final String aBasePath, final String aPtPath)
throws InvalidPathException {
"""
Extracts the encapsulating directory from the supplied Pairtree path, using the supplied base path.
@param aBasePath A base path for the Pairtree path
@param aPtPath The Pairtree... | java | public static String getEncapsulatingDir(final String aBasePath, final String aPtPath)
throws InvalidPathException {
return getEncapsulatingDir(removeBasePath(aBasePath, aPtPath));
} | [
"public",
"static",
"String",
"getEncapsulatingDir",
"(",
"final",
"String",
"aBasePath",
",",
"final",
"String",
"aPtPath",
")",
"throws",
"InvalidPathException",
"{",
"return",
"getEncapsulatingDir",
"(",
"removeBasePath",
"(",
"aBasePath",
",",
"aPtPath",
")",
")... | Extracts the encapsulating directory from the supplied Pairtree path, using the supplied base path.
@param aBasePath A base path for the Pairtree path
@param aPtPath The Pairtree path
@return The name of the encapsulating directory
@throws InvalidPathException If there is a problem extracting the encapsulating directo... | [
"Extracts",
"the",
"encapsulating",
"directory",
"from",
"the",
"supplied",
"Pairtree",
"path",
"using",
"the",
"supplied",
"base",
"path",
"."
] | train | https://github.com/ksclarke/vertx-pairtree/blob/b2ea1e32057e5df262e9265540d346a732b718df/src/main/java/info/freelibrary/pairtree/PairtreeUtils.java#L236-L239 |
facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Utilities.java | Utilities.incrComputeSpecs | public static void incrComputeSpecs(ComputeSpecs target, ComputeSpecs incr) {
"""
Increase the compute specs
@param target the compute specs to increase
@param incr the increment
"""
target.numCpus += incr.numCpus;
target.memoryMB += incr.memoryMB;
target.diskGB += incr.diskGB;
} | java | public static void incrComputeSpecs(ComputeSpecs target, ComputeSpecs incr) {
target.numCpus += incr.numCpus;
target.memoryMB += incr.memoryMB;
target.diskGB += incr.diskGB;
} | [
"public",
"static",
"void",
"incrComputeSpecs",
"(",
"ComputeSpecs",
"target",
",",
"ComputeSpecs",
"incr",
")",
"{",
"target",
".",
"numCpus",
"+=",
"incr",
".",
"numCpus",
";",
"target",
".",
"memoryMB",
"+=",
"incr",
".",
"memoryMB",
";",
"target",
".",
... | Increase the compute specs
@param target the compute specs to increase
@param incr the increment | [
"Increase",
"the",
"compute",
"specs"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Utilities.java#L88-L92 |
jenkinsci/java-client-api | jenkins-client/src/main/java/com/offbytwo/jenkins/client/util/UrlUtils.java | UrlUtils.toJobBaseUrl | public static String toJobBaseUrl(final FolderJob folder, final String jobName) {
"""
Helper to create the base url for a job, with or without a given folder
@param folder the folder or {@code null}
@param jobName the name of the job.
@return converted base url.
"""
final StringBuilder sb = new Stri... | java | public static String toJobBaseUrl(final FolderJob folder, final String jobName) {
final StringBuilder sb = new StringBuilder(DEFAULT_BUFFER_SIZE);
sb.append(UrlUtils.toBaseUrl(folder));
if (sb.charAt(sb.length() - 1) != '/') sb.append('/');
sb.append("job/");
final String[] jobNa... | [
"public",
"static",
"String",
"toJobBaseUrl",
"(",
"final",
"FolderJob",
"folder",
",",
"final",
"String",
"jobName",
")",
"{",
"final",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"DEFAULT_BUFFER_SIZE",
")",
";",
"sb",
".",
"append",
"(",
"UrlUti... | Helper to create the base url for a job, with or without a given folder
@param folder the folder or {@code null}
@param jobName the name of the job.
@return converted base url. | [
"Helper",
"to",
"create",
"the",
"base",
"url",
"for",
"a",
"job",
"with",
"or",
"without",
"a",
"given",
"folder"
] | train | https://github.com/jenkinsci/java-client-api/blob/c4f5953d3d4dda92cd946ad3bf2b811524c32da9/jenkins-client/src/main/java/com/offbytwo/jenkins/client/util/UrlUtils.java#L49-L61 |
iig-uni-freiburg/SEWOL | src/de/uni/freiburg/iig/telematik/sewol/writer/LogWriter.java | LogWriter.writeEntry | public void writeEntry(LogEntry logEntry, int caseNumber) throws PerspectiveException, IOException {
"""
This method is only allowed in the activity perspective.
@param logEntry The log entry to write.
@param caseNumber
@throws PerspectiveException
@throws IOException
"""
if(logPerspective == LogPerspect... | java | public void writeEntry(LogEntry logEntry, int caseNumber) throws PerspectiveException, IOException{
if(logPerspective == LogPerspective.TRACE_PERSPECTIVE)
throw new PerspectiveException(PerspectiveError.WRITE_ACTIVITY_IN_TRACE_PERSPECTIVE);
prepare();
if(!headerWritten){
write(logFormat.getFileHeader());... | [
"public",
"void",
"writeEntry",
"(",
"LogEntry",
"logEntry",
",",
"int",
"caseNumber",
")",
"throws",
"PerspectiveException",
",",
"IOException",
"{",
"if",
"(",
"logPerspective",
"==",
"LogPerspective",
".",
"TRACE_PERSPECTIVE",
")",
"throw",
"new",
"PerspectiveExc... | This method is only allowed in the activity perspective.
@param logEntry The log entry to write.
@param caseNumber
@throws PerspectiveException
@throws IOException | [
"This",
"method",
"is",
"only",
"allowed",
"in",
"the",
"activity",
"perspective",
"."
] | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/writer/LogWriter.java#L262-L272 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/Configurer.java | Configurer.getNodeStringDefault | private String getNodeStringDefault(String defaultValue, String attribute, String... path) {
"""
Get the string from a node.
@param defaultValue The default value returned if path not found.
@param attribute The attribute to get.
@param path The attribute node path.
@return The string found.
@throws LionEng... | java | private String getNodeStringDefault(String defaultValue, String attribute, String... path)
{
final Xml node = getNodeDefault(path);
if (node != null && node.hasAttribute(attribute))
{
return node.readString(attribute);
}
return defaultValue;
} | [
"private",
"String",
"getNodeStringDefault",
"(",
"String",
"defaultValue",
",",
"String",
"attribute",
",",
"String",
"...",
"path",
")",
"{",
"final",
"Xml",
"node",
"=",
"getNodeDefault",
"(",
"path",
")",
";",
"if",
"(",
"node",
"!=",
"null",
"&&",
"no... | Get the string from a node.
@param defaultValue The default value returned if path not found.
@param attribute The attribute to get.
@param path The attribute node path.
@return The string found.
@throws LionEngineException If node not found. | [
"Get",
"the",
"string",
"from",
"a",
"node",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/Configurer.java#L507-L515 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.